                            h        
CMUIP066.C                                                                                                                                                                                                   t             
  CMUIP066.C0 BACKUP [-.IPACP]IPACP.SRC,[-.NAMRES]NAMRES.SRC,[-.IPDRIVER]IPDRIVER.SRC,[-.IPTRANS]IPTRANS.SRC,[-.CENTRAL]CENTRAL.SRC,[-.IPNCP]IPNCP.SRC,[-.LPR]LPR.SRC,[-.FTP]FTP.SRC,[-.TELNET]TELNET.SRC,[-.PTY]PTY.SRC,[-.FINGER]FINGER.SRC,[-.DWTRANSPORT]DWTRANSPORT.SRC,[-.TALK]TALK.SRC CMUIP066.C/SAVE/INTER/BLOCK=8192  SYNFUL            @2      T6.0	 	 _CMUTEK:: 
   
  _CMUTEK$DKA0:  V6.0        
   $                        * [IPACP]IPACP.SRC;1 +  , }   . q   /     4      q  q                     - ;    0   1    2   3      K  P   W   O r   5   6 @k.  7 @K2  8          9          G    H  J                                                         sGC        	IPACP.SRC                                                                                                                                                                                                    2              	  IPACP.SRCm  BACKUP *.BLI,*.REQ,*.C,*.H,*.MAR,DESCRIP.MMS,*.OPT,IPACP_LINK.COM,FAKE_VM.B32 IPACP.SRC/SAVE/INTER/BLOCK=8192  SYNFUL             .      T6.0	 	 _CMUTEK:: 
   
  _CMUTEK$DKA0:  V6.0        
   $                            * [IPACP]CONFIG.BLI;1 +  , d   . i    /     4 T   i   i                    - ;    0   1    2   3      K  P   W   O j    5   6 @+gV,  7 `'-  8          9          G    H  J                             %(A 	****************************************************************   0 		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.  A 	****************************************************************  )%+ %TITLE 'CONFIG - Configure the network ACP'  %(   Module:   $ 	CONFIG  - Network ACP configuration  	 Facility:   C 	Configure the the ACP according the information extracted from the : 	configuration file "INET$CONFIG", generally "config.txt".  	 Abstract:   : 	Handle the aspects of physical network device management.C 	Here you will find the table(dev_config) which IP accesses to send F 	datagrams.  Also device configuration and initialization routines areE 	located here.  The init routine here should not be confused with the F 	actual device init routines found in the driver modules.  Device initF 	here implies the routine which will call all device init routines forD 	those devices which have been properl             y configured during the deviceG 	configuration phase of start-up. Other initializations handled by this G 	module include memory manager block preallocation, gateway definition, E 	name server definition, and the settings of various internal control 3 	variables such as 'IP_FORWARDING' and 'LOG_STATE'.    Author:   > 	Original version by Stan Smith, Tim Fallon Fall/Winter, 1982.; 	This version by Vince Fuller, CMU-CSD, Spring/Summer, 1986 E 	Copyright (c) 1986,1987, Vince Fuller and Carnegie-Mellon University    Modification History:    *** Begin USBR change log ***   % 6,6	24-Dec-1991	Henry W. Miller 	USBR = 	Make LOG_THRESHOLD and ACT_THRESHOLD configurable variables.   & 6.5d	28-Jan-1990	Henry W. Miller 	USBR> 	Make WINDOW_DEFAULT and ACK_THRESHOLD configurable variables.  & 6.5c	13-Jan-1990	Henry W. Miller 	USBR< 	Make ICMPTTL, IPTTL, TCPTTL, UDPTTL configurable variables.   *** Begin CMU change log ***  , 6.5b	12-Nov-1990	Bruce R. Miller		CMU NetDev1 	Added the RPC keyword to configure RPC services. / 	Added AUTH keyword to do UIC mapping (for NFS)   ) 6.5a	28-Aug-1990     Henry W. Miller USBR % 	Added DEFTTL configuration variable.   ) 6.5	21-Sep-90	Bruce R. Miller		CMU NetDev + 	Modifications from Mark Berryman, SAIC.COM : 	Added code for proxy ARPs and restored clone device code.  + 6.5	02-Feb-1990	Bruce R. Miller		CMU NetDev % 	Removed compile-time device support.  	Added run-time device support.   + 6.5	20-Oct-1989	Bruce R. Miller		CMU NetDev A 	Added Activity Logging stuff.  Copied from normal l             ogging stuff.   ! 6.3	13-MAR-1989	Dale Moore	CMU-CS : 	Added Keep Alive stuff.  (I could have sworn that I added) 	this stuff before, but I musta lost it.)   # 6.2B 7-Oct-88, Edit by Robert Smart 3 	Fix test for number of interfaces (John Mann fix).   % 6.2A 21-Jun-88, Edit by Peter Dewildt  	Add X25 driver support  	Add SLIP driver support 	Add DECNET driver support   6.2  29-Oct-87, Edit by VAF A 	Flush TMPJNL and PRMJNL privs - they no longer exist in VMS 4.6.    6.1  31-Jul-87, Edit by VAF E 	Change network config file to include device type field, as distinct 5 	from device name field. Add TELNET_SERVICE variable.    6.0  23-Mar-87, Edit by VAF   	Add variable MAX_RECV_DATASIZE.0 	Replace three sizes of packet buffers with two.   5.9  24-Feb-87, Edit by VAF ? 	Add support for mailbox name server (MBX_SERVER keyword). Also & 	reorganized the parsing of WKS stuff.   5.8  19-Feb-87, Edit by VAF $ 	Flush support for GREEN and DOMAIN.   5.7  17-Feb-87, Edit by VAF * 	Make improvements to the error reporting.   5.6  12-Feb-87, Edit by VAF   	Add support for domain servers.   5.5   9-Feb-87, Edit by VAF > 	Add support for specifying process priviliges in WKS entries.   5.4   6-Feb-87, Edit by VAF G 	Change references to DEUNA/DEQNA to be "DEC Ethernet". Add support for - 	VAXstation-2000 'ES' device (same as XE/XQ).    5.3   5-Feb-87, Edit by VAF ( 	Add support for network access control.   5.2  12-Nov-86, Edit by VAF 0 	Add support for WKS records in the config file.   5.1  11-Nov-86, Edit by VAF C 	Add routine to set various parameter variables in the config file. 2 	Currently supported are IP_FORWARDING and FQ_MAX.   5.0  12-Sep-86, Edit by VAF " 	Add support for "cloned" devices.   4.9   8-Aug-86, Edit by VAF = 	Change name server initialization code to call GREEN_CONFIG.    4.8   4-Aug-86, Edit by VAF * 	Add code to initialize name server table.   4.7  23-Jun-86, Edit by VAF , 	Add code to initialize IP forwarding state.   4.6  29-Apr-86, Edit by VAF $ 	Put device checking timers in here.   4.5  21-Apr-86, Edit by VAF E 	Phase II of flushing XPORT - Use $FAO instead of XPORT string stuff.    4.4  18-Apr-86, Edit by VAF * 	Add new I/O utilities (IOUTIL.BLI module) 	Add EN (3MB ethernet) device / 	Report device status after init routine called    4.3  15-Apr-86, Edit by VAF 0 	Support for variable-length hardware addresses.3 	Read physical address as one string of Hex digits. : 	Make a byte-swapped copy of the IP address for ARP's use.   4.2   8-Mar-86, Edit by VAF $ 	Logging flag values are in hex now.   4.1   6-Mar-86, Edit by VAF & 	Rewrite to flush all traces of XPORT.   4.0  21-Feb-86, Edit by VAF A 	Give each network interface its own IP address and network mask. 8 	Reorganize initialization code for easier modification.: 	Don't preset "dev_config table", flush "NL_xxx" routines. 	Add support for gateways    *** End CMU change log ***   1.0 [1-5-82] tim fallon   @ 	Device configuration was buried inside of IP as we only had one+ 	network device at the time (hyperchannel).   % 2.0              [4-10-82] stan smith, tim fallon.   D 	Moved device configuration out of IP into this module.  Idea was toE 	make IP device independent; such that IP accessed all network devic                                                           µ        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        
             e J 	driver routines (not to be confused with vms kernel level device drivers)E 	in the same fashion (same calling conventions via dev_config table). E 	Devices are configured (dev_config initialized) by macro invocations H 	during devconfig.bli compilation.  Actual reason behind all this changeJ 	was that ethernet were comming to tek and we needed to be able to supportC 	multiple network devices (hyperchannel and ethernet) from the same  	network acp.    2.1 [4-20-83] stan smith  D 	Developed routine "configure_network_devices", one no longer has toB 	recompile devconfig.bli to include a new ethernet or hyperchannelC 	device.  Dev_config table is now initialized from the file logical C 	name "tcp$network_device_file".  Each non-comment line of the file F 	describes a network device (vms name, used in $assign system service;4 	physica                                                                                                                                                                                                           E"        	IPACP.SRC                      d  ;  [IPACP]CONFIG.BLI;1                                                                                                            T     i                                      l device address and device dependent bits).   3.0 [4-28-83] stan smith  E 	Expanded device configuration to include memory mgmt config. Routine G 	"configure_network_Devices" has been renamed to configure_acp.  Format C 	of "devconfig.txt" now "config.txt" file has been expanded.  First @ 	field is now a keyword field, processing is dispatched via this	 	keyword.    3.1 [8-2-85] Noelan Olson   G 	Continue to run if no network devides were configured.  Favor to Stan.   # 3.11 [11-18-85] Rick Watson U.Texas   , 	Added ARP transponder code for Deuna device )%  ' MODULE CONFIG(IDENT='6.6',ZIP,OPTIMIZE, . 	      ADDRESSING_MODE(EXTERNAL=LONG_RELATIVE,$ 			      NONEXTERNAL=LONG_RELATIVE),: 	      LIST(NOEXPAND,NOREQUIRE,ASSEMBLY,	OBJECT,BINARY)) = BEGIN   7 LIBRARY	'SYS$LIBRARY:STARLET';	! VMS system definitions @ LIBRARY 'CMUIP_SRC:[CENTRAL]NETXPORT';	! String descriptor stuff? LIBRARY 'CMUIP_SRC:[CENTRAL]NETVMS';		! Special VMS definitions & LIBRARY 'STRUCTURE';	! Data structures& LIBRARY	'TCPMACROS';	! ACP-wide macros" LIBRARY 'SNMP';		! MIB definitions5 LIBRARY 'CMUIP_SRC:[CENTRAL]NETCOMMON'; ! Common DefsgC LIBRARY 'CMUIP_SRC:[CENTRAL]NETCONFIG'; ! Device configuration defsr   EXTERNAL ROUTINE     OPR_FAO : NOVALUE,     SEND_2_OPERATOR : NOVALUE,*     LIB$GET_VM : ADDRESSING_MODE(GENERAL),     SWAPBYTES : NOVALUE,     GET_IP_ADDR,     GET_DEC_NUM,     GET_HEX_BYTES,     GET_HEX_NUM,     ASCII_DEC_BYTES : NOVALUE,     ASCII_HEX_BYTES : NOVALUE;   MACROn8     STR[] = CH$PTR(UPLIT(%ASCIZ %STRING(%REMAINING))) %,:     STRMOVE(THESTR,DPTR) =		! Strmove - STRMOVE(STRING,BP)0 	CH$MOVE(%CHARCOUNT(THESTR),STR(THESTR),DPTR) %,8     STREQL(THESTR,LITSTR) =		! Compare to literal stringD 	CH$EQL(%CHARCOUNT(LITSTR),STR(LITSTR),%CHARCOUNT(LITSTR),THESTR) %,A     STREQLZ(THESTR,LITSTR) =		! Compare to literal string (ASCIZ)-H 	CH$EQL(%CHARCOUNT(LITSTR)+1,STR(LITSTR),%CHARCOUNT(LITSTR)+1,THESTR) %;   MACROn     Init_DynDesc (D) = 	BEGIN 	$BBLOCK [D, DSC$W_Length]	= 0;n* 	$BBLOCK [D, DSC$B_DType]	= DSC$K_DTYPE_T;* 	$BBLOCK [D, DSC$B_Class]	= DSC$K_CLASS_D;  	$BBLOCK [D, DSC$A_Pointer]	= 0; 	END%;     ! Module-wide definitionsr   LITERALf     RECLEN = 512,o     STRLEN = 128,s#     STRSIZ = CH$ALLOCATION(STRLEN);e   ! Define file reading blocks   OWNn     LINPTR,t     LINLEN,       CFBUF : VECTOR[RECLEN,BYTE],&     CFFAB : $FAB(FNM = 'INET$CONFIG'),     CFRAB : $RAB(FAB = CFFAB,l 		 UBF = CFBUF,  		 USZ = %ALLOCATION(CFBUF));    FORWARD ROUTINEe     CONFIG_ERR : NOVALUE,d     Init_Device : NOVALUE,     Init_MEMGR : NOVALUE,e     Init_Gateway : NOVALUE,      Init_NameServer : NOVALUE,     Init_Logging : NOVALUE,l$     Init_Activity_Logging : NOVALUE,     Init_Forwarding : NOVALUE,     Init_Variable : NOVALUE,     Init_MBXResolver : NOVALUE,      Init_WKS : NOVALUE,R     Init_RPC : NOVALUE,      Init_Auth : NOVALUE,     Init_Local_Host : NOVALUE,     GETFIELD,1     PARSE_NULLFIELD,     SKIPTO : NOVALUE,      SKIPWHITE : NOVALUE;   t  @ ! Here we set up the IPACP_Interface.  It provides entry points,A ! literals and global pointers to any modules which may be loaded1@ ! at run-time.  See NETCONFIG.REQ for a complete explaination of ! this structure.l   GLOBAL%     IPACP_Int : IPACP_Info_Structure;M  @ ! N.B. : make sure everything that needs to be defined, like theJ ! MAX_Physical_BufSize, *is* defined by the time this routine is called...  + GLOBAL ROUTINE CNF$Define_IPACP_Interface =g	     BEGINb     EXTERNAL8 	! pointer to IPACP AST_in_progress flag (from MAIN.BLI) 	AST_in_progress,              $ 	! IPACP nap control (from MAIN.BLI)
 	Sleeping,  % 	! IPACP Maximum Physical Buffer SizeU 	MAX_PHYSICAL_BUFSIZE,   	LOG_STATE;b     EXTERNAL ROUTINE' 	! IAPCP receive callback (from IP.BLI)o 	IP$Receive : NOVALUE,/ 	! IPACP self-address recognition (from IP.BLI) 	 	IP$ISME,e  . 	! Interrupt blocking routines (from WHERE???) 	MAIN$NOINT : NOVALUE, 	MAIN$OKINT : NOVALUE,  - 	! Error reporting routines (from CONFIG.BLI)	 	CNF$Device_Error : NOVALUE,  . 	! Memory allocation routines (from MEMGR.BLI) 	MM$Seg_Get : NOVALUE, 	MM$Seg_Free : NOVALUE,U 	MM$QBlk_Free : NOVALUE,  5 	! Formatted event logging routines (from IOUTIL.BLI)e 	LOG_FAO : NOVALUE,. 	QL_FAO : NOVALUE, 	OPR_FAO : NOVALUE,  	ERROR_FAO : NOVALUE,o 	FATAL_FAO : NOVALUE;        ! IAPCP receive callback. /     IPACP_Int [ ACPI$IP_Receive ]	= IP$Receive;I  $     ! pointer to IPACP sleeping flag,     IPACP_Int [ ACPI$Sleeping ] 	= Sleeping;  +     ! pointer to IPACP AST_in_progress flagn:     IPACP_Int [ ACPI$AST_in_progress ] 	= AST_in_progress;  !     ! Interrupt blocking routinese+     IPACP_Int [ ACPI$NOINT ]		= MAIN$NOINT;d+     IPACP_Int [ ACPI$OKINT ]		= MAIN$OKINT;        ! Error reporting routines7     IPACP_Int [ ACPI$Device_Error ]	= CNF$Device_Error;   $     ! IPACP self-address recognition*     IPACP_Int [ ACPI$IP_ISME ]		= IP$ISME;        ! Memory allocation routines-     IPACP_Int [ ACPI$Seg_Get ]		= MM$Seg_Get;b/     IPACP_Int [ ACPI$Seg_Free ]		= MM$Seg_Free;.0     IPACP_Int [ ACPI$QBlk_Free ]	= MM$QBlk_Free;  (     ! Provide event logging entry points7     IPACP_Int [ ACPI$LOG_STATE ]	= LOG_STATE;	! pointer-*     IPACP_Int [ ACPI$LOG_FAO ]		= LOG_FAO;(     IPACP_Int [ ACPI$QL_FAO ]		= QL_FAO;*     IPACP_Int [ ACPI$OPR_FAO ]		= OPR_FAO;-     IPACP_Int [ ACPI$ERROR_FAO ]	= ERROR_FAO;p-     IPACP_Int [ ACPI$FATAL_FAO ]	= FATAL_FAO;   $     ! IPACP max physical buffer size6     IPACP_Int [ ACPI$MPBS ] 		= .MAX_PHYSICAL_BUFSIZE;       IPACP_Int      END;   f  G %( Here we initialize all of the variable that can be set by the configu    file. )%   ROUTINE Init_Vars : NOVALUE =c	     BEGIN      EXTERNAL$ 	IP_group_MIB : IP_group_MIB_struct;  F     IP_group_MIB[IPMIB$ipForwarding] = 2;	! Just a host, no forwarding     END;    / %Sbttl 'Device Configuration table definitions'd %(  J Here we configure the known network devices.  Each entry in the dev_configI table represents a known network device (eg, hyperchannel, ethernet etc). L If your system doesn't have the specified device, then leave the table entryJ alone or replace the nonexistant entry with one of your own choosing.  AllI the device_init macro does is to place the device initialization and sendA7 routine addresses in the appropriate device-type entry.h7 See the DC_Fields portion                                                                                                                                                                                                                                                                            (x        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        *             of STRUCTURE.DEF for details.c   )%  ! ROUTINE No_Check(ndx) : NOVALUE =p  ( ! Dummy routine for non-checked devices.  	     BEGINc     RETURN;      END;   OWN      DEV_Attn;   @ ! gotta declare this PSect on the quad boundary so-as we can use+ ! self relative queue instructions on it...    PSECT      GLOBAL = quads(ALIGN(3));    GLOBALE     DEV_Config_Tab: Device_Configuration_Table PSECT(quads) ALIGN(3),h     DEV_Count;   s  . GLOBAL ROUTINE CNF$DEVICE_STAT ( Inx, RB_A ) = !a( ! Dump out a Dev             ice configuration entry. !t	     BEGINv     BIND$ 	RB = .RB_A : D$Dev_Dump_Return_Blk;  =     IF (.Inx LSS 0) OR (.Inx GTR DC_Max_Num_Net_devices-1) OR]3 	(.dev_config_tab[.Inx,dc_valid_device] EQL 0) THENd 	RETURN -1;   !     ! fill in the simple stuff...t=     RB[DU$Dev_Address] = .dev_config_tab[.Inx,dc_ip_address]; =     RB[DU$Dev_netmask] = .dev_config_tab[.Inx,dc_ip_netmask]; =     RB[DU$Dev_network] = .dev_config_tab[.Inx,dc_ip_network];n     RB[DU$Dev_Pck_Xmit] = 0;     RB[DU$Dev_Pck_Recv] = 0;  @     ! Start a new block so we can use BIND to simplify the code.	     BEGINv     BINDB 	DevNam  = dev_config_tab[.Inx,dc_devname] : $BBLOCK[DSC$K_Z_BLN],B 	DevSpec = dev_config_tab[.Inx,dc_devspec] : $BBLOCK[DSC$K_Z_BLN];	     LOCALt 	StrLen;       ! Copy device name     StrLen =                                                                                                                                                                                                                                                           pp        	IPACP.SRC                      d  ;  [IPACP]CONFIG.BLI;1                                                                                                            T     i                                       DevNam_Max_Size; -     IF .Strlen GTR .DevNam[DSC$W_LENGTH] THENh  	StrLen = .DevNam[DSC$W_LENGTH];      RB[DU$DevNam_Len] = .Strlen;E     CH$MOVE ( .Strlen , .DevNam[DSC$A_POINTER] , RB[DU$DevNam_Str] );         ! Copy device-specific fie      "       ld     StrLen = DevSpec_Max_Size;.     IF .Strlen GTR .DevSpec[DSC$W_LENGTH] THEN! 	StrLen = .DevSpec[DSC$W_LENGTH];a!     RB[DU$DevSpec_Len] = .Strlen;.G     CH$MOVE ( .Strlen , .DevSpec[DSC$A_POINTER] , RB[DU$DevSpec_Str] );m     END;       D$Dev_dump_blksize     END; i  ' GLOBAL ROUTINE CNF$DEVICE_LIST ( RB ) =. !4% ! Dump out the list of valid devices.c !i	     BEGIN      MAPe# 	RB : REF D$Device_List_Return_Blk;r	     LOCALe 	RBIX;       RBIX = 1;o0     INCR I FROM 0 TO DC_Max_Num_Net_devices-1 DO2 	IF .dev_config_tab[.I,dc_valid_device] NEQ 0 THEN
 	    BEGIN 	    RB[.RBIX] = .I; 	    RBIX = .RBIX + 1;	 	    END; )     ! First element of list is the count.      RB[0] = .RBIX - 1;  !     ! return total size in bytes.      .RBIX * 4-     END;     %SBTTL 'Configure Network ACP'   %(	 Function:   F 	Read the IPACP configuration file, "INET$CONFIG", containing all infoD 	about the ACP initialization parameters, including: devices, memoryF 	management parameters, logging state, variables, well-known services,E 	etc. Each line of the file contains a keyword followed by the valuesCC 	associated with the keyword. Lines beginning in ";" are ignored asE 	comment lines.    Side Effects:i  E 	Initializes the DEV_CONFIG table, the globals for memory management,P> 	and calls all of the configuration routines in other modules. )%  + GLOBAL ROUTINE CNF$Configure_ACP: NOVALUE =C	     BEGINE     LOCAL		      	RC, 	cfield : VECTOR[STRSIZ],X 	cflen,U 	cptr;  G ! Initialize all the variables before they are set by the config scriptE       INIT_VARS();  O ! OPEN the file "config.TXT" & read/decode network device data into blockvector ( ! dev_config and memory management info.  )     IF NOT ((RC = $OPEN(FAB = CFFAB)) ANDR' 	    (RC = $CONNECT(RAB = CFRAB))) THENN 	BEGIN; 	send_2_operator(%ascid 'Unable to access "INET$CONFIG:"');T 	$exit(code=.RC);% 	END;N  < ! Extract information from each non-comment line of the file        DEV_Count = 0;		! No devices       WHILE $GET(RAB = CFRAB) DO 	BEGIN 	LOCAL	 	    chr; $ 	linptr = CH$PTR(.CFRAB[RAB$L_UBF]); 	linlen = .CFRAB[RAB$W_RSZ];  C ! IF 1st char of line is a "!" then is it a comment & we ignore it.   + 	chr = CH$RCHAR(CH$PTR(.CFRAB[RAB$L_UBF]));O. 	IF (.chr NEQ %C'!') AND (.chr NEQ %C';') THEN
 	    BEGIN# 	    IF .linlen GTR (RECLEN-1) THEN	 		linlen = RECLEN-1;% 	    cptr = CH$PLUS(.linptr,.linlen); & 	    CH$WCHAR_A(0,cptr);		! Make ASCIZ  N ! Read the first field (category keyword) and dispatch to the appro processing
 ! routine.   	    cflen = GETFIELD(cfield); 	    cptr = CH$PTR(cfield);  	    SELECTONE TRUE OF 		SETA! 		[STREQLZ(.cptr,'DEVICE_INIT')]:  		    Init_Device();  		[STREQLZ(.cptr,'MEMGR_INIT')]: 		    Init_Memgr();  		[STREQLZ(.cptr,'GATEWAY')]:E 		    Init_Gateway();t! 		[STREQLZ(.cptr,'NAME_SERVER')]:: 		    Init_NameServer(); 		[STREQLZ(.cptr,'LOGGING')]:r 		    Init_Logging();t 		[STREQLZ(.cptr,'ACTIVITY')]: 		    Init_Activity_Logging();# 		[STREQLZ(.cptr,'IP_FORWARDING')]:V 		    Init_Forwarding(); 		[STREQLZ(.cptr,'VARIABLE')]: 		    Init_Variable();" 		[STREQLZ(.cptr,'MBX_RESOLVER')]: 		    Init_MbxResolver();l 		[STREQLZ(.cptr,'WKS')]:E 		    Init_WKS();L 		[STREQLZ(.cptr,'RPC')]:E 		    Init_RPC();  		[STREQLZ(.cptr,'AUTH')]: 		    Init_Auth();  		[STREQLZ(.cptr,'LOCAL_HOST')]: 		    Init_Local_Host(); 		[OTHERWISE]:* 		    Config_Err(%ASCID'Unknown keyword'); 		TES;	 	    END;o 	END;p       $DISCONNECT(RAB = CFRAB);c     $CLOSE(FAB = CFFAB);  M ! make sure we did some device configuration here as networks without devicesd" ! are not really very interesting.       IF .dev_count LEQ 0 THEN9 	ERROR$FAO('No network devices detected in INET$CONFIG');_     END;  $ ROUTINE CONFIG_ERR(EMSG) : NOVALUE = !PF ! Handle error in configuration file. Give the error message and exit. !c	     BEGINm/     FATAL$FAO('CONFIG - !AS in line:!/!_"!AD"',a2 	      .EMSG,.CFRAB[RAB$W_RSZ],.CFRAB[RAB$L_UBF]);     END; N ROUTINE Init_Device : NOVALUE =b  5 ! Handle a DEVICE_INIT entry in the INET$CONFIG file.-= ! Parses the device description and adds to DEV_CONFIG table.b  	     BEGINn     EXTERNAL ROUTINE( 	LIB$CALLG		: ADDRESSING_MODE (GENERAL),3 	LIB$FIND_IMAGE_SYMBOL	: ADDRESSING_MODE (GENERAL), / 	STR$APPEND		: BLISS ADDRESSING_MODE (GENERAL),i: 	STR$CASE_BLIND_COMPARE	: BLISS ADDRESSING_MODE (GENERAL),0 	STR$COPY_DX		: BLISS ADDRESSING_MODE (GENERAL);	     LOCALe !	tmp, 	rc, 	ipaddr, 	ipmask, 	argv : VECTOR[1], 	Image_Init,% 	Devinfo : REF Device_Info_Structure,E- 	dev_config : REF Device_Configuration_Entry,  	devtype : VECTOR[STRSIZ],	 	devtlen,C 	devstr : VECTOR[STRSIZ], 	 	devslen,I 	devspec : VECTOR[STRSIZ],* 	dev_desc	: $BBLOCK [DSC$K_Z_BLN] PRESET ( 				[DSC$W_LENGTH]	= 0,o" 				[DSC$B_DTYPE]	= DSC$K_DTYPE_Z," 				[DSC$B_CLASS]	= DSC$K_CLASS_Z, 				[DSC$A_POINTER]	= Devstr),- 	devtyp_desc	: $BBLOCK [DSC$K_Z_BLN] PRESET (  				[DSC$W_LENGTH]	= 0,T" 				[DSC$B_DTYPE]	= DSC$K_DTYPE_Z," 				[DSC$B_CLASS]	= DSC$K_CLASS_Z, 				[DSC$A_POINTER]	= Devtype),D/ 	dev_spec_desc	: $BBLOCK [DSC$K_Z_BLN] PRESET (  				[DSC$W_LENGTH]	= 0, " 				[DSC$B_DTYPE]	= DSC$K_DTYPE_Z," 				[DSC$B_CLASS]	= DSC$K_CLASS_Z, 				[DSC$A_POINTER]	= Devtype),G( 	devidx;		! device index into devconfig.   ! skip over delimiter.       SKIPTO(%C':');   ! Dev_config table overflow?. ! Table index = 0 to DC_Max_Num_Net_devices-1.       devidx = .Dev_count;4     IF .Dev_Count GTR DC_Max_Num_Net_devices-1  THENE 	FATAL$FAO(%STRING('Too many network devices in INET$CONFIG, max = ', ' 			  %NUMBER(DC_Max_Num_Net_Devices)));n                                                                                                                                                                                                                                                #Ë        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        A&      -       Dev_Count = .Dev_Count+1;O2     dev_config = dev_config_tab[.devidx,dc_begin];   ! Clear all flagss       dev_config[dc_flags] = 0; "     dev_config[dc_clone_dev] = -1;   ! Get device driver type  H     devtyp_desc [DSC$W_LENGTH] = GETFIELD(.devtyp_desc [DSC$A_POINTER]);! !    devtlen = GETFIELD(devtype);n     SKIPTO(%C':');      !    cptr = CH$PTR(devtype);  D !!!HACK!!! For now, we just include the ethernet code inorderto testM ! it more easily (all symbols included, plus code is now in main image PSECT)b    E     IF (STR$CASE_BLIND_COMPARE(devtyp_desc,%ASCID'ETHER') EQL 0) THENe 	BEGIN 	EXTERNAL ROUTINEl 	    DRV$TRANSPORT_INIT;  ! 	Image_Init = DRV$TRANSPORT_INIT;  	END' ! Get name of shared-image IP-transporte(     ELSE IF (rc = LIB$FIND_IMAGE_SYMBOL( 		devtyp_desc, 		%ASCID'DRV$TRANSPORT_INIT',y 		Image_Init,g! 		%ASCID'CMUIP_ROOT:[SYSLIB].EXE'i 		) NEQ SS$_NORMAL) THEN 	BEGIN 	Image_Init = 0; 	Signal(.rc);n< 	Config_Err(%ASCID'Trouble accessing device support image.') 	END;R       IF (.Image_Init NEQ 0) THENO 	BEGIN	! Set up the vector' 	DevInfo = LIB$CALLG(argv,.Image_Init);e  - 	dev_config[dc_rtn_init] = .DevInfo[DI$Init];W- 	dev_config[dc_rtn_xmit] = .DevInfo[DI$Xmit];t- 	dev_config[dc_rtn_dump] = .DevInfo[DI$Dump];r. 	dev_config[dc_rtn_check] = .DevInfo[DI$Check] 	END;B   ! Get vms device name, usedL3 ! by the device init routine to $assign the device.TB     dev_desc [DSC$W_LENGTH] = GETFIELD(.dev_desc [DSC$A_POINTER]);. !    $INIT_DYNDESC( dev_config [dc_devname] );,     INIT_DYNDESC( dev_config [dc_devname] );4     STR$COPY_DX (Dev_Config [dc_devname], dev_desc);5     STR$APPEND (Dev_config [dc_devname], %ASCID ':');d ! skip over field terminator.i     SKIPTO(%C':');  D ! Get vms device specific information, used by the device go receive !                                                                                                                                                                                                                                                                                    	IPACP.SRC                      d  ;  [IPACP]CONFIG.BLI;1                                                                                                            T     i                               -       and initiate connections._B     dev_desc [DSC$W_LENGTH] = GETFIELD(.dev_desc [DSC$A_POINTER]);. !    $INIT_DYNDESC( dev_config [dc_devspec] );,     INIT_DYNDESC( dev_config [dc_devspec] );4     STR$COPY_DX (Dev_Config [dc_devspec], dev_desc); ! skip over field terminator.      SKIPTO(%C':');  - ! Set hardware address/device dependant wordsI6 !    IF GET_HEX_BYTES(.dev_config[dc_phy_size],LINPTR,3 !		     CH$PTR(dev_config[dc_phy_addr])) LSS 0 THEN ) !	Config_Err(%ASCID'Bad device address');e !    SKIPTO(%C':');_   ! Get device IP addressG  ,     IF GET_IP_ADDR(LINPTR,ipaddr) LSS 0 THEN+ 	Config_Err(%ASCID'Bad device IP address');r(     dev_config[dc_ip_address] = .ipaddr;     SKIPTO(%C':');   ! Get device IP network mask  ,     IF GET_IP_ADDR(LINPTR,ipmask) LSS 0 THEN( 	Config_Err(%ASCID'Bad device IP mask');(     dev_config[dc_ip_netmask] = .ipmask;   ! Set device IP network number  4     dev_config[dc_ip_network] = .ipmask AND .ipaddr;  L ! mark the device as valid so initialization routine will execute the device ! init rtn.F  '     dev_config[dc_valid_device] = true;l  4 ! Initialize all of the other fields for this device  :     Dev_Config[dc_send_Qhead] = Dev_Config[dc_send_Qhead];:     Dev_Config[dc_send_Qtail] = Dev_Config[dc_send_Qhead];"     Dev_Config[dc_online] = false;  ) ! See if this device name is a duplicate.;       IF .devidx GTR 0 THEN   	INCR I FROM 0 TO (.devidx-1) DO
 	    BEGIN< 	    ! If match, then mark this device as a clone of the it.= 	    IF STR$CASE_BLIND_COMPARE(Dev_Config_Tab[.I,dc_devname], 1 			Dev_Config_Tab[.devidx,dc_devname]) EQL 0 THENt 		BEGIN ! 		dev_config[dc_is_clone] = TRUE;   		dev_config[dc_clone_dev] = .I; 		EXITLOOP;d 		END;	 	    END;y     END;    ROUTINE Init_Gateway : NOVALUE =' !!!HACK!!! Make gateway struct dynamic. 1 ! Handle a GATEWAY entry in the INET$CONFIG file.e2 ! Parses gateway description and adds to GWY_TABLE" ! Gateway entries are of the form:@ !   GATEWAY:<gwy_name>:<gwy_address>:<gwy-network>:<gwy-netmask>; ! Where (these are also the names of the GWY_TABLE fields):t9 !   gwy_name	Name of the gateway (for debugging purposes)nA !   gwy_address	IP address of gateway *must be locally-connected* F !   gwy_network	Network number served by gateway (0 means any/default)5 !   gwy_netmask	AND mask for comparing network numberRJ !   gwy_status	Gateway status. Initialized to "up" (nonzero) by this code.  	     BEGIN      EXTERNAL ROUTINE 	IP$Gwy_Config : NOVALUE;F	     LOCAL  	GWYname : VECTOR[STRSIZ],/ 	GWY_Name_Desc	: $BBLOCK [DSC$K_Z_BLN] PRESET (s 				[DSC$W_LENGTH]	= 0,a" 				[DSC$B_DTYPE]	= DSC$K_DTYPE_Z," 				[DSC$B_CLASS]	= DSC$K_CLASS_Z, 				[DSC$A_POINTER]	= GWYname),n	 	GWYaddr,h 	GWYnet, 	GWYnetmask, 	tmp;    ! Skip delimiter       SKIPTO(%C':');   ! First, get the gateway name.  5     GWY_Name_Desc [DSC$W_LENGTH] = GETFIELD(GWYname);W   ! Next, the gateway address        SKIPTO(%C':');-     IF GET_IP_ADDR(LINPTR,GWYaddr) LSS 0 THENP) 	Config_err(%ASCID'Bad gateway address');!  - ! Next, the network number behind the gateway        SKIPTO(%C':');,     IF GET_IP_ADDR(LINPTR,GWYnet) LSS 0 THEN0 	Config_err(%ASCID'Bad gateway network number');  ) ! Next, the network mask for that networko       SKIPTO(%C':');0     IF GET_IP_ADDR(LINPTR,GWYnetmask) LSS 0 THEN& 	Config_err(%ASCID'Bad gateway mask');   ! Tell IP about this gateway  >     IP$Gwy_Config(GWY_Name_Desc,.GWYaddr,.GWYnet,.GWYnetmask);     END; Q# ROUTINE Init_NameServer : NOVALUE =M  5 ! Handle a Name_Server entry in the INET$CONFIG file.w5 ! Parses Name Server description and adds to NS_TABLEN& ! Name Server entries are of the form:& !   NAME_SERVER:<NS_name>:<NS_address>: ! Where (these are also the names of the NS_TABLE fields):8 !   NS_name	Name of the gateway (for debugging purposes)@ !   NS_address	IP address of gateway *must be locally-connected*I !   NS_status	Gateway status. Initialized to "up" (nonzero) by this code.'  	     BEGINn	     LOCAL  	NSname : VECTOR[STRSIZ],  	NSnlen, 	NSaddr, 	tmp;Q   ! Skip delimiter       SKIPTO(%C':');  ! ! First, get the name server name        NSnlen = GETFIELD(NSname);   ! Next, the name server addresse       SKIPTO(%C':');,     IF GET_IP_ADDR(LINPTR,NSaddr) LSS 0 THEN- 	Config_err(%ASCID'Bad name server address');d  , ! Add this entry to the name server database  I     OPR$FAO('%IPACP: Obsolete keyword NAME_SERVER found in INET$CONFIG');      END; F ROUTINE Init_MEMGR : NOVALUE = !I2 ! Handle MEMGR-INIT entry in the INET$CONFIG file.5 ! Specifies memory-manager initialization parameters.e !i	     BEGINr     EXTERNAL! 	QBLK_COUNT_BASE : UNSIGNED BYTE,(! 	UARG_COUNT_BASE : UNSIGNED BYTE, $ 	MIN_SEG_COUNT_BASE : UNSIGNED BYTE,$ 	MAX_SEG_COUNT_BASE : UNSIGNED BYTE;  & ! Get # of Queue blocks to preallocate       SKIPTO(%C':');5     IF GET_DEC_NUM(LINPTR,QBLK_count_base) LSS 0 THENd' 	Config_Err(%ASCID'Bad integer value');   % ! Get # of UARG blocks to preallocateI       SKIPTO(%C':');5     IF GET_DEC_NUM(LINPTR,UARG_count_base) LSS 0 THENR' 	Config_Err(%ASCID'Bad integer value');)  5 ! Get # of minimum-size packet buffers to preallocateR       SKIPTO(%C':');8     IF GET_DEC_NUM(LINPTR,MIN_seg_count_base) LSS 0 THEN' 	Config_Err(%ASCID'Bad integer value');   5 ! get # of maximum-size packet buffers to preallocatev       SKIPTO(%C':');8     IF GET                                                                                                                                                                                                                                                                           yC        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        ܿ      <       _DEC_NUM(LINPTR,MAX_seg_count_base) LSS 0 THEN' 	Config_Err(%ASCID'Bad integer value');I     END;   C    ROUTINE INIT_LOGGING : NOVALUE =   ! Set initial logging state.  	     BEGINo     EXTERNAL ROUTINE 	LOG_CHANGE : NOVALUE;	     LOCAL 
 	logstate;   ! Skip terminatorR       SKIPTO(%C':');   ! Get log state valueL  .     IF GET_HEX_NUM(LINPTR,logstate) LSS 0 THEN1 	Config_Err(%ASCID'Bad hex value for log state');_   ! Set log stateA       LOG_CHANGE(.logstate);     END;   O  ) ROUTINE INIT_ACTIVITY_LOGGING : NOVALUE =]  % ! Set initial activity logging state.,  	     BEGINC     EXTERNAL ROUTINE 	ACT_CHANGE : NOVALUE;	     LOCAL 
 	logstate;   ! Skip terminatorc       SKIPTO(%C':');   ! Get log state value%  .     IF GET_HEX_NUM(LINPTR,logstate) LSS 0 THEN: 	Config_Err(%ASCID'Bad hex value for activity log state');   ! Set log stateo       ACT_CHANGE(.logstate);     END;   L  ' %SBTTL 'Initialize IP forwarding state'N  # ROUTINE INIT_FORWARDING : NOVALUE =a	     BEGINe	     LOCAL 	 	ipstate;n     EXTERNAL$ 	IP_group_MIB : IP_group_MIB_struct;   ! Skip terminator        SKIPTO(%C':');   ! Get forwarding state value  -     IF GET_HEX_NUM(LINPTR,ipstate) LSS 0 THENe8 	Config_Err(%ASCID'Bad hex value for forwarding state');   ! Set state for IP module;  0     IP_group_MIB[IPMIB$ipForwarding] = .ipstate;     END;      3 %SBTTL 'Initialize various configuration variables'   ! ROUTINE INIT_VARIABLE : NOVALUE =e	     BEGINr     EXTERNAL 	FQ_MAX, 	SYN_WAIT_COUNT, 	ACCESS_FLAGS, 	MAX_RECV_DATASIZE,  	DEFAULT_MSS,I 	TELNET_SERVICE, 	RPC_SERVICE,E 	SNMP_SERVICE, 	KEEP_ALIVE, 	RETRY_COUNT,  	MAX_LOCAL_PORTS,I
 	MAX_CONN, 	MAX_GATEWAYS, 	WINDOW_DEFAULT, 	ACK_THRESHOLD, 	 	ICMPTTL,e 	IPTTL,p 	TCPTTL, 	UDPTTL, 	ACT_THRESHOLD,E 	LOG_THRESHOLD,p$ 	IP_group_MIB : IP_group_MIB_struct;	     LOCALn 	varname : VECTOR[STRSIZ], 	varlen, 	varptr, 	varval;   ! Skip terminatora       SKIPTO(%C':');   ! Get the variable nameT       varlen = GETFIELD(varname);g     varptr = CH$PTR(varname);I   ! Skip the terminator!       SKIPTO(%C':');   ! Get the variable value  ,     IF GET_DEC_NUM(LINPTR,varval) LSS 0 THEN( 	Config_Err(%ASCID'Bad variable value');  # ! Check the variable name & set it.d !!!HACK!!! Document these!     SELECTONE TRUE OFk 	S                                                                                                                                                                                                                                                                           uf!%        	IPACP.SRC                      d  ;  [IPACP]CONFIG.BLI;1                                                                                                            T     i                         W      <       ET$ 	[STREQLZ(.varptr,'IP_FORWARDING')]:0 	    IP_group_MIB[IPMIB$ipForwarding] = .varval; 	[STREQLZ(.varptr,'FQ_MAX')]:_ 	    FQ_MAX = .varval;% 	[STREQLZ(.varptr,'SYN_WAIT_COUNT')]:  	    SYN_WAIT_COUNT = .varval;# 	[STREQLZ(.varptr,'ACCESS_FLAGS')]:f 	    ACCESS_FLAGS = .varval;' 	[STREQLZ(.varptr,'MAX_TCP_DATASIZE')]:;! 	    MAX_RECV_DATASIZE = .varval;v" 	[STREQLZ(.varptr,'DEFAULT_MSS')]: 	    DEFAULT_MSS = .varval;%% 	[STREQLZ(.varptr,'TELNET_SERVICE')]:o 	    TELNET_SERVICE = .varval;" 	[STREQLZ(.varptr,'RPC_SERVICE')]: 	    RPC_SERVICE = .varval; # 	[STREQLZ(.varptr,'SNMP_SERVICE')]:; 	    SNMP_SERVICE = .varval;! 	[STREQLZ(.varptr,'KEEP_ALIVE')]:C 	    KEEP_ALIVE = .varval;" 	[STREQLZ(.varptr,'RETRY_COUNT')]: 	    RETRY_COUNT = .varval;e& 	[STREQLZ(.varptr,'MAX_LOCAL_PORTS')]: 	    MAX_LOCAL_PORTS = .varval;  	[STREQLZ(.varptr,'MAX_CONN')]:_ 	    MAX_CONN = .varval;# 	[STREQLZ(.varptr,'MAX_GATEWAYS')]:i 	    Max_Gateways = .varval; 	[STREQLZ(.varptr,'ICMPTTL')]: 	    ICMPTTL = .varval;C 	[STREQLZ(.varptr,'IPTTL')]: 	    IPTTL = .varval;D 	[STREQLZ(.varptr,'TCPTTL')]:C 	    TCPTTL = .varval; 	[STREQLZ(.varptr,'UDPTTL')]:f 	    UDPTTL = .varval;% 	[STREQLZ(.varptr,'WINDOW_DEFAULT')]:e 	    WINDOW_DEFAULT = .varval;$ 	[STREQLZ(.varptr,'ACK_THRESHOLD')]: 	    ACK_THRESHOLD = .varval;s$ 	[STREQLZ(.varptr,'ACT_THRESHOLD')]: 	    ACT_THRESHOLD = .varval;w$ 	[STREQLZ(.varptr,'LOG_THRESHOLD')]: 	    LOG_THRESHOLD = .varval;  	[OTHERWISE]:c/ 	    Config_Err(%ASCID'Unknown variable name');  	TES;i     END;   F   %SBTTL 'Process definitions' %(=     Define some keyword tables for parsing options to $CREPRCe  )%   + ! Macro for defining two-word privilege bitd   MACRO 2     PRVIX(BYT,BST,BLN,EXT) = UPLIT(BYT/4,1^BST) %; LITERAL      PVSIZE = 2,n     PVIX = 0,      PVAL = 1;    BIND   ! Define the STATUS keywords       STATNAMES = PLIT(  	%ASCID'SSRWAIT',PRC$M_SSRWAIT,B 	%ASCID'SSFEXCU',PRC$M_SSFEXCU,t 	%ASCID'PSWAPM',PRC$M_PSWAPM,. 	%ASCID'NOACNT',PRC$M_NOACNT,E 	%ASCID'BATCH',PRC$M_BATCH,] 	%ASCID'HIBER',PRC$M_HIBER,, 	%ASCID'IMGDMP',PRC$M_IMGDMP,I 	%ASCID'NOUAF',PRC$M_NOUAF,  	%ASCID'NETWRK',PRC$M_NETWRK,_ 	%ASCID'DISAWS',PRC$M_DISAWS,; 	%ASCID'DETACH',PRC$M_DETACH,T 	%ASCID'INTER',PRC$M_INTER, / 	%ASCID'NOPASSWORD',PRC$M_NOPASSWORD) : VECTOR,e   ! Define the PRIVILEGE keywords        PRIVNAMES = PLIT(d 	%ASCID'*',-1,( 	%ASCID'ALLSPOOL',PRVIX(PRV$V_ALLSPOOL),$ 	%ASCID'BUGCHK',PRVIX(PRV$V_BUGCHK),$ 	%ASCID'BYPASS',PRVIX(PRV$V_BYPASS),$ 	%ASCID'CMEXEC',PRVIX(PRV$V_CMEXEC),$ 	%ASCID'CMKRNL',PRVIX(PRV$V_CMKRNL),$ 	%ASCID'DETACH',PRVIX(PRV$V_DETACH),( 	%ASCID'DIAGNOSE',PRVIX(PRV$V_DIAGNOSE),* 	%ASCID'DOWNGRADE',PRVIX(PRV$V_DOWNGRADE),& 	%ASCID'EXQUOTA',PRVIX(PRV$V_EXQUOTA)," 	%ASCID'GROUP',PRVIX(PRV$V_GROUP),$ 	%ASCID'GRPNAM',PRVIX(PRV$V_GRPNAM),$ 	%ASCID'GRPPRV',PRVIX(PRV$V_GRPPRV),$ 	%ASCID'LOG_IO',PRVIX(PRV$V_LOG_IO)," 	%ASCID'MOUNT',PRVIX(PRV$V_MOUNT),$ 	%ASCID'NETMBX',PRVIX(PRV$V_NETMBX),$ 	%ASCID'NOACNT',PRVIX(PRV$V_NOACNT),  	%ASCID'OPER',PRVIX(PRV$V_OPER),$ 	%ASCID'PFNMAP',PRVIX(PRV$V_PFNMAP),$ 	%ASCID'PHY_IO',PRVIX(PRV$V_PHY_IO),$ 	%ASCID'PRMCEB',PRVIX(PRV$V_PRMCEB),$ 	%ASCID'PRMGBL',PRVIX(PRV$V_PRMGBL),$ 	%ASCID'PRMMBX',PRVIX(PRV$V_PRMMBX),$ 	%ASCID'PSWAPM',PRVIX(PRV$V_PSWAPM),& 	%ASCID'READALL',PRVIX(PRV$V_READALL),( 	%ASCID'SECURITY',PRVIX(PRV$V_SECURITY),$ 	%ASCID'SETPRI',PRVIX(PRV$V_SETPRI),$ 	%ASCID'SETPRV',PRVIX(PRV$V_SETPRV)," 	%ASCID'SHARE',PRVIX(PRV$V_SHARE)," 	%ASCID'SHMEM',PRVIX(PRV$V_SHMEM),$ 	%ASCID'SYSGBL',PRVIX(PRV$V_SYSGBL),$ 	%ASCID'SYSLCK',PRVIX(PRV$V_SYSLCK),$ 	%ASCID'SYSNAM',PRVIX(PRV$V_SYSNAM),$ 	%ASCID'SYSPRV',PRVIX(PRV$V_SYSPRV),$ 	%ASCID'TMPMBX',PRVIX(PRV$V_TMPMBX),& 	%ASCID'UPGRADE',PRVIX(PRV$V_UPGRADE),$ 	%ASCID'VOLPRO',PRVIX(PRV$V_VOLPRO),, 	%ASCID'WORLD',PRVIX(PRV$V_WORLD)) : VECTOR;     ! Define process quotase   $FIELD QUOTA_FIELDS =      SETG$     QTA$TYPE	= [$BYTE],	! Quota type&     QTA$VALUE	= [$ULONG]	! Quota value     TES; LITERALO!     QUOTA_SIZE = $FIELD_SET_SIZE,e     QUOTA_BLEN = 5;I MACROw4     QUOTA = BLOCK[QUOTA_SIZE] FIELD(QUOTA_FIELDS) %; LITERALe5     MAXQUOTA = 15;		! Max number of quotas to specifya  8 ! Define a keyword table for parsing the process quotas.   BIND     QUOTANAMES = PLIT( 	%ASCID'ASTLM',	PQL$_ASTLM,i 	%ASCID'BIOLM',	PQL$_BIOLM,I 	%ASCID'BYTLM',	PQL$_BYTLM,  	%ASCID'CPULM',	PQL$_CPULM,a 	%ASCID'DIOLM',	PQL$_DIOLM,e 	%ASCID'ENQLM',	PQL$_ENQLM,o 	%ASCID'FILLM',	PQL$_FILLM,  	%ASCID'JTQUOTA',PQL$_JTQUOTA," 	%ASCID'PGFLQUOTA',PQL$_PGFLQUOTA, 	%ASCID'PRCLM',	PQL$_PRCLM,; 	%ASCID'TQELM',	PQL$_TQELM,v" 	%ASCID'WSDEFAULT',PQL$_WSDEFAULT,  	%ASCID'WSEXTENT',PQL$_WSEXTENT, 	%ASCID'WSQUOTA',PQL$_WSQUOTA);  F) ROUTINE KEY_VALUE(KEYTAB,KEYLEN,KEYSTR) =n !_( ! Get keyword value from keyword string. !d	     BEGINy     MAPa 	K                                                                                                                                                                                                                                                                           S         
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        xU      K       EYTAB : REF VECTOR; 	     LOCAL%# 	CURSTR : REF $BBLOCK[DSC$K_S_BLN];o  ,     INCR I FROM 0 TO (.KEYTAB[-1]-1) BY 2 DO 	BEGIN 	CURSTR = .KEYTAB[.I]; 	IF CH$EQL(.KEYLEN,.KEYSTR,E6 		  .CURSTR[DSC$W_LENGTH],.CURSTR[DSC$A_POINTER]) THEN 	    RETURN .KEYTAB[.I+1]; 	END; *     Config_Err(%ASCID'Bad keyword field');     RETURN -1;     END;    ROUTINE PARSE_PRCPRIVS(PRVBLK) = !D5 ! Parse a comma-separated list of privilege keywords. & ! Returns the number of keywords seen. !O	     BEGIN      MAPD 	PRV      L       BLK : REF VECTOR[2];	     LOCALT	 	PRIVCNT,i 	PRIVPTR : REF VECTOR[PVSIZE], 	PRIVBUF : VECTOR[STRSIZ], 	PLEN, 	CHR;I   ! Initialize to "no privileges"D       PRVBLK[0] = 0;     PRVBLK[1] = 0;     PRIVCNT = 0;   ! Loop, parsing keywords.        WHILE TRUE DO  	BEGIN 	PLEN = GETFIELD(PRIVBUF); 	IF .PLEN EQL 0 THEN 	    EXITLOOP; 	PRIVCNT = .PRIVCNT + 1;6 	PRIVPTR = KEY_VALUE(PRIVNAMES,.PLEN,CH$PTR(PRIVBUF)); 	IF .PRIVPTR EQL -1 THEN
 	    BEGIN 	    PRVBLK[0] = -1; 	    PRVBLK[1] = -1; 	    END 	ELSENH 	    PRVBLK[.PRIVPTR[PVIX]] = .PRVBLK[.PRIVPTR[PVIX]] OR .PRIVPTR[PVAL]; 	SKIPWHITE();   " ! Check for end of field separator   	CHR = CH$RCHAR_A(LINPTR); 	IF .CHR EQL %C':' THENE 	    EXITLOOP; 	END;G   ! Return count of fields found       RETURN .PRIVCNT;     END; O% ROUTINE PARSE_PRCQUOTAS(QLIST,QMAX) =  !F/ ! Parse a comma-separated list of quota values._# ! Returns the count of quotas seen.e !_	     BEGINo	     LOCAL  	QPTR : REF QUOTA, 	QUOTBUF : VECTOR[STRSIZ],	 	QUOTLEN,A	 	QUOTCNT,G	 	QUOTYPE,U	 	QUOTVAL,e 	CHR;a   ! Initialize to none       QUOTCNT = 0;'     CH$FILL(0,.QMAX*QUOTA_BLEN,.QLIST);;     QPTR = .QLIST;   ! Loop, parsing keywords.        WHILE TRUE DO  	BEGIN 	QUOTLEN = GETFIELD(QUOTBUF);X 	IF .QUOTLEN EQL 0 THEN  	    EXITLOOP;   ! Parse the keyworde  : 	QUOTYPE = KEY_VALUE(QUOTANAMES,.QUOTLEN,CH$PTR(QUOTBUF)); 	SKIPWHITE();   - ! Parse the separator - must be an equal signg   	CHR = CH$RCHAR_A(LINPTR); 	IF .CHR NEQ %C'=' THENE: 	    CONFIG_ERR(%ASCID'Missing "=" in quota description'); 	SKIPWHITE();r   ! Parse the quota value   * 	IF GET_DEC_NUM(LINPTR,QUOTVAL) LSS 0 THEN4 	    CONFIG_ERR(%ASCID'Missing or bad quota value'); 	SKIPWHITE();(    ! Set the value in the quotalist   	QPTR[QTA$TYPE] = .QUOTYPE;m 	QPTR[QTA$VALUE] = .QUOTVAL;  0 ! Increment to next entry, checking for overflow   	QUOTCNT = .QUOTCNT + 1; 	IF .QUOTCNT GEQ (.QMAX-1) THENN? 	    CONFIG_ERR(%ASCID'Exceeded max number of quota keywords');N 	QPTR = .QPTR + QUOTA_BLEN;  	SKIPWHITE();I   ! Check for terminator   	CHR = CH$RCHAR_A(LINPTR); 	IF .CHR EQL %C':' THENV 	    EXITLOOP; 	END;X  & ! Put the terminator entry in the list  "     QPTR[QTA$TYPE] = PQL$_LISTEND;     QPTR[QTA$VALUE] = 0;  + ! Return the number of entries in the list.D                                                                                                                                                                                                                                                                           .        	IPACP.SRC                      d  ;  [IPACP]CONFIG.BLI;1                                                                                                            T     i                         |      K              RETURN .QUOTCNT+1;     END; ; ROUTINE PARSE_PRCSTATUS =C ![7 ! Parse a comma-separated list of process status flags.o$ ! Returns the values OR'ed together. !i	     BEGIN 	     LOCALn	 	STATVAL,( 	STATBUF : VECTOR[STRSIZ],	 	STATLEN,) 	CHR;    ! Initialize value to all offO       STATVAL = 0;   ! Loop, parsing the flagsT       WHILE TRUE DOl 	BEGIN 	STATLEN = GETFIELD(STATBUF);r 	IF .STATLEN EQL 0 THEN  	    EXITLOOP;E 	STATVAL = .STATVAL OR KEY_VALUE(STATNAMES,.STATLEN,CH$PTR(STATBUF));  	SKIPWHITE();t 	CHR = CH$RCHAR_A(LINPTR); 	IF .CHR EQL %C':' THENr 	    EXITLOOP; 	END;E  # ! Finall, return the complete value        RETURN .STATVAL;     END; _# %SBTTL 'Init_WKS - Add a WKS entry'r 		     T ROUTINE Init_WKS : NOVALUE =  - ! Handle a WKS entry in the INET$CONFIG file.tC ! Parses WKS description and calles Seg$WKS_Config to add the info.L ! WKS entries are of the form:B !   WKS:<port>:<procname>:<imagename>:<status>:<privs>:<priority>: ! (cont) <queue-limit>:<maxsrv>T  	     BEGIN,     EXTERNAL ROUTINE/ 	STR$COPY_DX	: BLISS ADDRESSING_MODE (GENERAL),_ 	Seg$WKS_Config : NOVALUE;	     LOCALa
 	CHR,LPTR, 	WKSprname : VECTOR[STRSIZ],0 	WKSprname_Desc	: $BBLOCK [DSC$K_Z_BLN] PRESET ( 				[DSC$W_LENGTH]	= 0,U" 				[DSC$B_DTYPE]	= DSC$K_DTYPE_Z," 				[DSC$B_CLASS]	= DSC$K_CLASS_Z,! 				[DSC$A_POINTER]	= WKSprname),, 	WKSimname : VECTOR[STRSIZ],0 	WKSimname_Desc	: $BBLOCK [DSC$K_Z_BLN] PRESET ( 				[DSC$W_LENGTH]	= 0,a" 				[DSC$B_DTYPE]	= DSC$K_DTYPE_Z," 				[DSC$B_CLASS]	= DSC$K_CLASS_Z,! 				[DSC$A_POINTER]	= WKSimname),a9 	QUOTAS : BLOCK[MAXQUOTA*QUOTA_BLEN] FIELD(QUOTA_FIELDS),a, 	Quota_Desc	: $BBLOCK [DSC$K_Z_BLN] PRESET ( 				[DSC$W_LENGTH]	= 0,v" 				[DSC$B_DTYPE]	= DSC$K_DTYPE_Z," 				[DSC$B_CLASS]	= DSC$K_CLASS_Z, 				[DSC$A_POINTER]	= Quotas), 	WKSInput : VECTOR[STRSIZ],T/ 	WKSInput_Desc	: $BBLOCK [DSC$K_Z_BLN] PRESET (O 				[DSC$W_LENGTH]	= 0,(" 				[DSC$B_DTYPE]	= DSC$K_DTYPE_Z," 				[DSC$B_CLASS]	= DSC$K_CLASS_Z,  				[DSC$A_POINTER]	= WKSInput), 	WKSOutput : VECTOR[STRSIZ],0 	WKSOutput_Desc	: $BBLOCK [DSC$K_Z_BLN] PRESET ( 				[DSC$W_LENGTH]	= 0,a" 				[DSC$B_DTYPE]	= DSC$K_DTYPE_Z," 				[DSC$B_CLASS]	= DSC$K_CLASS_Z,! 				[DSC$A_POINTER]	= WKSOutput),R 	WKSError : VECTOR[STRSIZ],B/ 	WKSError_Desc	: $BBLOCK [DSC$K_Z_BLN] PRESET (V 				[DSC$W_LENGTH]	= 0, " 				[DSC$B_DTYPE]	= DSC$K_DTYPE_Z," 				[DSC$B_CLASS]	= DSC$K_CLASS_Z,  				[DSC$A_POINTER]	= WKSError),	 	WKSport,P	 	WKSstat,U 	WKSpriv : VECTOR[2],$
 	WKSprior,	 	WKSqlim,C 	WKSmaxsrv;C   ! Skip delimiter     SKIPTO(%C':');   ! First, get the port number-     IF GET_DEC_NUM(LINPTR,WKSport) LSS 0 THENN( 	Config_Err(%ASCID'Bad WKS port value');     SKIPTO(%C':');   ! Next, process name8     WKSprname_Desc [DSC$W_LENGTH] = GETFIELD(WKSprname);     SKIPTO(%C':');  < ! Next, image name - N.B. image name may not have ':' in it.)     WKSimname_Desc = GETFIELD(WKSimname);L     SKIPTO(%C':');  ? ! Next, $CREPRC status flags. Comma-separated list of keywords.R      WKSstat = PARSE_PRCSTATUS();  = ! Next, $CREPRC priviliges. Comma-separated list of keywords.S     PARSE_PRCPRIVS(WKSPRIV);   ! Parse the process quotas     IF PARSE_NULLFIELD() THEND 	SKIPTO(%C':')     ELSEH 	Quota_Desc[DSC$W_LENGTH] = PARSE_PRCQUOTAS(QUOTAS,MAXQUOTA)*QUOTA_BLEN;   ! Parse the process INPUT file     IF PARSE_NULLFIELD() THENR 	BEGIN 	SKIPTO(%C':');_/ 	STR$COPY_DX ( WKSInput_Desc , %ASCID'_NLA0:' )V 	END     ELSE 	BEGIN3 	WKSInput_Desc [DSC$W_LENGTH] = GETFIELD(WKSInput);_ 	SKIPTO(%C':') 	END;,   ! Parse the process OUTPUT file,     IF PARSE_NULLFIELD() THENH 	BEGIN 	SKIPTO(%C':');,0 	STR$COPY_DX ( WKSOutput_Desc , %ASCID'_NLA0:' ) 	END     ELSE 	BEGIN5 	WKSOutput_Desc [DSC$W_LENGTH] = GETFIELD(WKSOutput);M 	SKIPTO(%C':') 	END;     ! Parse the process ERROR stream     IF PARSE_NULLFIELD() THEN$ 	BEGIN 	SKIPTO(%C':');P0 	STR$COPY_DX ( WKSError_Desc , %ASCID'_NLA0:' ); 	END     ELSE 	BEGIN3 	WKSError_Desc [DSC$W_LENGTH] = GETFIELD(WKSError);S 	SKIPTO(%C':') 	END;,   ! Next, priority value.     IF GET_DEC_NUM(LINPTR,WKSprior) LSS 0 THEN( 	Config_Err(%ASCID'Bad priority value');     SKIPTO(%C':');  E ! Next the number of outstanding SYN's we will allow for this server.E-     IF GET_DEC_NUM(LINPTR,WKSqlim) LSS 0 THENI/ 	Config_Err(%ASCID'B                                                                                                                                                                                                                                                           B2G        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                              Z       ad queue limit value');    i  I ! Now, find out what the maximum number of servers permitted is.  If zero]J ! or error, then set to unlimited (0).  (This is actually GLBOAL_MAXSRV as ! defined in TCP_SEGIN.BLI.I !e 	WKSmaxsrv = 0;=' 	IF (CH$RCHAR_A(LINPTR) EQL %C':') THENE0 	    IF GET_DEC_NUM(LINPTR,WKSmaxsrv) LSS 0 THEN 		WKSmaxsrv = 0;  9 ! Tell the configuration routine in SEGIN about this guy.g  F     Seg$WKS_Config(.WKSport, WKSprname_Desc, WKSimname_Desc, .WKSstat,3 		WKSpriv,.WKSprior,.WKSqlim,.WKSmaxsrv,Quota_Desc,'. 		WKSInput_Desc,WKSOutput_Desc,WKSError_Desc);     END; 	$ %SBTTL 'Init_RPC - Add an RPC entry' 		     S ROUTINE Init_RPC : NOVALUE =  . ! Handle an RPC entry in the INET$CONFIG file.? ! Parses RPC description and calles RPC$Config to add the info.T ! RPC entries are of the form:6 !   RPC:<name>:<prog>:<vers>:<prot>:<port>:<imagename>  	     BEGINS     EXTERNAL ROUTINE/ 	STR$COPY_DX	: BLISS ADDRESSING_MODE (GENERAL),w 	RPC$CONFIG;	     LOCALr 	RC,
 	CHR,LPTR,	 	RPCprog,a	 	RPCvers, 	 	RPCprot, 	 	RPCport,% 	RPCname : VECTOR[STRSIZ],. 	RPCname_Desc	: $BBLOCK [DSC$K_Z_BLN] PRESET ( 				[DSC$W_LENGTH]	= 0,T" 				[DSC$B_DTYPE]	= DSC$K_DTYPE_Z," 				[DSC$B_CLASS]	= DSC$K_CLASS_Z, 				[DSC$A_POINTER]	= RPCname),  	RPCimname : VECTOR[STRSIZ],0 	RPCimname_Desc	: $BBLOCK [DSC$K_Z_BLN] PRESET ( 				[DSC$W_LENGTH]	= 0, " 				[DSC$B_DTYPE]	= DSC$K_DTYPE_Z," 				[DSC$B_CLASS]	= DSC$K_CLASS_Z,! 				[DSC$A_POINTER]	= RPCimname);h   ! Skip delimiter     SKIPTO(%C':');   ! First, get the service nameR4     RPCname_Desc [DSC$W_LENGTH] = GETFIELD(RPCname);     SKIPTO(%C':');   ! Next, get the program number-     IF GET_DEC_NUM(LINPTR,RPCprog) LSS 0 THEN0, 	Config_Err(%ASCID'Bad RPC program number');     SKIPTO(%C':');   ! Next, get the version number-     IF GET_DEC_NUM(LINPTR,RPCvers) LSS 0 THEN , 	Config_Err(%ASCID'Bad RPC version number');     SKIPTO(%C':');   ! Next, get the protocol number)-     IF GET_DEC_NUM(LINPTR,RPCprot) LSS 0 THENP- 	Config_Err(%ASCID'Bad RPC protocol number');      SKIPTO(%C':');   ! Next, get the port numberP-     IF GET_DEC_NUM(LINPTR,RPCport) LSS 0 THEN ) 	Config_Err(%ASCID'Bad RPC port number');=     SKIPTO(%C':');  < ! Next, image name - N.B. image name may not have ':' in it.)     RPCimname_Desc = GETFIELD(RPCimname);; !    SKIPTO(%C':');N  B ! Tell the configuration routine in the RPC module about this guy.  T     RC=RPC$CONFIG( RPCname_Desc,.RPCprog,.RPCvers,.RPCprot,.RPCport,RPCimname_Desc);J     IF .RC LSS 0 THEN Config_Err(%ASCID'Can not accept RPC config entry');     END; e/ %SBTTL 'Init_Auth - Add an authorization entry'  		     H ROUTINE Init_Auth : NOVALUE =)  / ! Handle an AUTH entry in the INET$CONFIG file. E ! Parses AUTH description and calles RPC$Config_Auth to add the info.O ! AUTH entries are of the form: ' !   AUTH:<[UIC]>:<uid>:<gid>:<hostname>V  	     BEGINE     EXTERNAL ROUTINE/ 	STR$COPY_DX	: BLISS ADDRESSING_MODE (GENERAL),  	RPC$CONFIG_AUTH;g	     LOCAL= 	RC,
 	CHR,LPTR,	 	AUTHuic,R	 	AUTHuid,T	 	AUTHgid,C 	AUTHhostname : VECTOR[STRSIZ],u3 	AUTHhostname_Desc	: $BBLOCK [DSC$K_Z_BLN] PRESET (t 				[DSC$W_LENGTH]	= 0,U" 				[DSC$B_DTYPE]	= DSC$K_DTYPE_Z," 				[DSC$B_CLASS]	= DSC$K_CLASS_Z,$ 				[DSC$A_POINTER]	= AUTHhostname);   ! Skip delimiter     SKIPTO(%C':');   ! First, get the                                                                                                                                                                                                                                                                           \t        	IPACP.SRC                      d  ;  [IPACP]CONFIG.BLI;1                                                                                                            T     i                         n      Z        VMS uic number=-     IF GET_HEX_NUM(LINPTR,AUTHuic) LSS 0 THENn) 	Config_Err(%ASCID'Bad AUTH uic number');      SKIPTO(%C':');   ! Next, get the net uid number-     IF GET_DEC_NUM(LINPTR,AUTHuid) LSS 0 THENQ) 	Config_Err(%ASCID'Bad AUTH uid number');      SKIPTO(%C':');  : ! Next, host name - N.B. host name may not have ':' in it./     AUTHhostname_Desc = GETFIELD(AUTHhostname);t !    SKIPTO(%C':');   B ! Tell the configuration routine in the RPC module about this guy.  H     RC=RPC$CONFIG_AUTH(.AUTHuic, .AUTHuid, .AUTHgid, AUTHhostname_Desc);M     IF (.RC LSS 0) THEN Config_Err(%ASCID'Can not accept AUTH config entry');s     END; eC %SBTTL 'Init_MBXResolver - Define the system name resolver process'L  $ ROUTINE Init_MBXResolver : NOVALUE = ! * ! Define the system name resolver process.: ! MBX_RESOLVER:<image>:<priority>:<flags>:<privs>:<quotas> !E	     BEGINN     EXTERNAL ROUTINE 	NML$CONFIG : NOVALUE;	     LOCAL  	IMAGENAME : VECTOR[STRSIZ],0 	ImageName_Desc	: $BBLOCK [DSC$K_Z_BLN] PRESET ( 				[DSC$W_LENGTH]	= 0, " 				[DSC$B_DTYPE]	= DSC$K_DTYPE_Z," 				[DSC$B_CLASS]	= DSC$K_CLASS_Z,! 				[DSC$A_POINTER]	= imagename),t 	STATFLAGS, 
 	PRIORITY, 	PRIVS : VECTOR[2], 9 	QUOTAS : BLOCK[MAXQUOTA*QUOTA_BLEN] FIELD(QUOTA_FIELDS),t, 	Quota_Desc	: $BBLOCK [DSC$K_Z_BLN] PRESET ( 				[DSC$W_LENGTH]	= 0,a" 				[DSC$B_DTYPE]	= DSC$K_DTYPE_Z," 				[DSC$B_CLASS]	= DSC$K_CLASS_Z, 				[DSC$A_POINTER]	= Quotas);   ! Skip delimiter       SKIPTO(%C':');   ! Parse the image name  8     ImageName_Desc [DSC$W_LENGTH] = GETFIELD(IMAGENAME);     SKIPTO(%C':');   ! Parse the priority value  .     IF GET_DEC_NUM(LINPTR,PRIORITY) LSS 0 THEN( 	Config_Err(%ASCID'Bad priority value');     SKIPTO(%C':');  ! ! Parse the process status valuesN  "     STATFLAGS = PARSE_PRCSTATUS();   ! Parse the process privileges       PARSE_PRCPRIVS(PRIVS);   ! Parse the process quotas  N     Quota_Desc [DSC$W_LENGTH] = PARSE_PRCQUOTAS(QUOTAS,MAXQUOTA) * QUOTA_BLEN;  . ! Call the name resolver configuration routine  <     NML$CONFIG(IMAGENAME_Desc, .PRIORITY, .STATFLAGS, PRIVS, 	       QUOTA_Desc);     END; A- %SBTTL 'Add an entry to the local hosts list'L  # ROUTINE INIT_LOCAL_HOST : NOVALUE =L !T- ! Format is Local_Host:<ip-address>:<ip-mask>	< ! Reads the data and calls USER$ACCESS_CONFIG(ipaddr,ipmask) ! 	     BEGIN      EXTERNAL ROUTINE 	USER$ACCESS_CONFIG : NOVALUE;	     LOCALO
 	hostaddr,
 	hostmask;   ! First, read the host address       SKIPTO(%C':');.     IF GET_IP_ADDR(LINPTR,hostaddr) LSS 0 THEN& 	Config_err(%ASCID'Bad host address');   ! Then, the host maskC       SKIPTO(%C':');.     IF GET_IP_ADDR(LINPTR,hostmask) LSS 0 THEN# 	Config_err(%ASCID'Bad host mask');_  / ! Got the info. Call routine to add to the listr  ,     USER$ACCESS_CONFIG(.hostaddr,.hostmask);     END; ]! %SBTTL 'Parsing utility routines'     ROUTINE SKIPTO(TCHR) : NOVALUE =  8 ! Skip characters past a given character in line buffer.  	     BEGINW	     LOCALW 	CHR;U-     WHILE (CHR = CH$RCHAR_A(LINPTR)) NEQ 0 DOC 	IF .CHR EQL .TCHR THENd 	    RETURN;-     Config_err(%ASCID'SKIPTO failure (EOL)');      END;   ROUTINE SKIPWHITE : NOVALUE =E  - ! Skip over whitespace in the current record.   	     BEGIN;	     LOCAL          CHR,LPTR;K     LPTR = .LINPTR;E+     WHILE (CHR = CH$RCHAR_A(LPTR)) NEQ 0 DO' 	BEGIN 	IF .CHR NEQ %C' ' THENm 	    RETURN; 	LINPTR = .LPTR; 	END;K0     Config_err(%ASCID'SKIPWHITE failure (EOL)');     END;   ROUTINE GETFIELD(FLDADR) =     G ! Read a field the current record (LINPTR). A field is defined as the a C ! sequence of non-whitespace characters up to whitespace or a fieldPG ! delimiter (currently ',', '=' and ':'). Returns field size on successE. ! with the field text (case-folded) at FLDADR.' ! Returns 0 on failure (end of record).)  	                                                                                                                                                                                                                                                                              9H        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        L      i         BEGIN 	     LOCALh         PTR,CHR,CNT,DSTPTR;P       SKIPWHITE();     PTR = .LINPTR;     DSTPTR = CH$PTR(.FLDADR);u     CNT = 0;-     WHILE ((CHR = CH$RCHAR_A(PTR)) NEQ 0) AND_A 	  (.CHR NEQ %C',') AND (.CHR NEQ %C':') AND (.CHR NEQ %C' ') AND  	  (.CHR NEQ %C'=') DO 	BEGIN 	LINPTR = .PTR;N 	CNT = .CNT+1;. 	IF (.CHR GEQ %C'a') AND (.CHR LEQ %C'z') THEN 	    CHR = .CHR-(%C'a'-%C'A'); 	CH$WCHAR_A(.CHR,DSTPTR);u 	END;s     CH$WCHAR_A(0,DSTPTR);(     IF .cnt EQL 0 THEN- 	Config_err(%ASCID'Bad or null field found');m     RETURN .cnt;     END;   ROUTINE PARSE_NULLFIELD =P     G ! Read a field the current record (LINPTR). A field is defined as the aSC ! sequence of non-whitespace characters up to whitespace or a fieldDG ! delimiter (currently ',', '=' and ':'). Returns field size on successH. ! with the field text (case-folded) at FLDADR.' ! Returns 0 on failure (end of record).o  	     BEGINN	     LOCALa         PTR,CHR;       SKIPWHITE();     PTR = .LINPTR;  *     IF ((CHR = CH$RCHAR_A(PTR)) NEQ 0) ANDA 	  (.CHR NEQ %C',') AND (.CHR NEQ %C':') AND (.CHR NEQ %C' ') ANDe 	  (.CHR NEQ %C'=') THEN 0
     ELSE 1       END; i? %Sbttl 'Initialize Network Devices as described in dev_config.'S %(  	 Function:W  < 	Initialize all known network devices from dev_config table.   Inputs:U   	None.   Implicit Inputs:   	dev_config table entries.   Outputs: ]n 	None.   Side Effects:h  > 	if the dev_config table entry is marked as a valid entry thenA 	the device init routine is called.  This routine will assign thecH 	device & place the IO channel in the dev_config table entry dc_io_chan. )%    . GLOBAL ROUTINE CNF$Net_Device_Init : NOVALUE =	     BEGIN=     EXTERNAL 	RETRY_COUNT,t 	MAX_PHYSICAL_BUFSIZE;	     LOCALd 	j,p 	cdev,- 	dev_config : REF Device_Configuration_Entry;r  .     Dev_attn = 0;		! No devices need attention&     INCR j FROM 0 TO (.Dev_count-1) DO 	BEGIN, 	IF .Dev_Config_Tab[.J,dc_valid_Device] THEN
 	    BEGIN
 	    LOCAL 		DESC$STR_ALLOC(oprmsg,80),$ 		devnam : REF $BBLOCK[DSC$K_S_BLN],	 		stastr,C 		DESC$STR_ALLOC(ipstr,20),S 		DESC$STR_ALLOC(phystr,50);   ! Initialize this device  , 	    IF .Dev_Config_Tab[.j,dc_is_clone] THEN) 		cdev = .Dev_Config_Tab[.j,dc_clone_dev],	 	    ELSEA 		BEGIN	 		cdev = .j;@ 		(.Dev_config_Tab[.j,dc_rtn_init])(Dev_config_Tab[.j,dc_begin], 				IPACP_Int, 				.RETRY_COUNT,0 				.MAX_PHYSICAL_BUFSIZE);_ 		END;  # ! And tell the operator the status.	  , 	    devnam = dev_config_tab[.j,dc_devname];@ !	    ASCII_Hex_Bytes(phystr,.dev_config_tab[.cdev,dc_phy_size],& !			    dev_config[.cdev,dc_phy_addr], !			    phystr[DSC$W_LENGTH]);> 	    ASCII_Dec_Bytes(ipstr,4,dev_config_tab[.j,dc_ip_address], 			    ipstr[DSC$W_LENGTH]);- 	    IF .dev_config_tab[.cdev,dc_online] THEN; 		stastr = %ASCID'Online' 	 	    ELSE  		stastr = %ASCID'Offline';)  3 	    OPR$FAO('Net device !SL is !AS, IP=!AS (!AS)','  		    .j,.devnam,ipstr,.stastr);  1 	    dev_config_tab[.cdev,dcmib_ifIndex] = .cdev;P  	 	    END;T 	END;C     END; C  ( %SBTTL	'Check devices needing attention'   FORWARD ROUTINEe      CNF$Check_Devices : NOVALUE;   OWNNJ     CHECKTIME : VECTOR[2] INITIAL(-20000000,-1); ! 2 seconds in the future  * GLOBAL ROUTINE CNF$Check_Sched : NOVALUE =	     BEGINn      $SETIMR(	DAYTIM = CHECKTIME, 		ASTADR = CNF$Check_Devices);     END;  + GLOBAL ROUTINE CNF$Device_Error : NOVALUE = 	     BEGINu     IF .dev_attn EQL 0 THENR' 	CNF$Check_Sched();		! Schedule a check,>     dev_attn = .dev_attn+1;	! And bump count of wedged devices     END;  , GLOBAL ROUTINE CNF$Check_Devices : NOVALUE =	     BEGIN'     REGISTER i;n&     INCR i FROM 0 TO (.Dev_count-1) DO, 	IF .Dev_Config_tab[.i,dc_valid_device] AND + 	   (NOT .Dev_Config_tab[.i,dc_online]) AND . 	   (NOT .Dev_Config_tab[.i,dc_is_clone]) THEN 	     ! Try to restart? 	                                                                                                                                                                                                                                                                            x        	IPACP.SRC                      d  ;  [IPACP]CONFIG.BLI;1                                                                                                            T     i                         _e      i          dev_attn = .dev_attn + (.Dev_config_tab[.i,dc_rtn_check])( # 						Dev_config_tab[.i,dc_begin]);C       IF .dev_attn NEQ 0 THEN(= 	CNF$Check_Sched();		! Reschedule if there is still a problemA     END;   u   ! E ! A simple routine to return our local IP address.  By using this, weO@ ! cut down on external access to the device configuration table. !E& GLOBAL ROUTINE CNF$Get_Local_IP_addr =	     BEGIN_$     .Dev_Config_Tab[0,dc_ip_address]     END;   ENDm ELUDOMSKIPTO(%C':');   ! First, get the               * [IPACP]ICMP.BLI;1 +  ,    . $    /     4 M   $   $                     - ;    0   1    2   3      K  P   W   O %    5   6 G#sV,  7 @(-  8          9          G    H  J               %(A 	****************************************************************   0 		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.  A 	****************************************************************  )%@ %SBTTL 'InterNetwork Control Message Protocol Handler Overview.' %(   Module:    	ICMP   	 Facility:   0 	Inter-Network control message protocol handler.  	 Abstract:    	ICMP is defined in RFC 792    Author: ) 	Bruce R. Miller		CMU Network Development  	November 17, friday, 1989. 	Copyright (c) 1989 Carnegie-Mellon University   Modifications:  & 1.0b	29-Aug-1991	Henry W. Miller		USBRB 	In ICMP$INPUT(), protect against bad IP header in data portion of@ 	ICMP packet - scrambled data was causing Access Violations.  IfB 	supposed data portion of IP header in ICMP packet is greater thanB 	size of the buffer, it's a good clue we got a bad packet.  Bounce 	it.  Yell at operator.   & 1.0a	24-Apr-1991	Henry W. Miller		USBR& 	Make ICMPTTL a configurable variable.2 	Add hooks for generating ICMP DUNR replies.  NYI.  *  1.0	17-Nov-89	Bruce R. Miller		CMU NetDev7 	Initial version.  I copied all of the other ICMP stuff  	into this module.   )%     %SBTTL 'Module Definition'  + MODULE ICMP(IDENT='1.0B',LANGUAGE(BLISS32), * 	  ADDRESSING_MODE(EXTERNAL=LONG_RELATIVE,  			  NONEXTERNAL=LONG_RELATIVE),* 	  LIST(NOREQUIRE,ASSEMBLY,OBJECT,BINARY), 	  OPTIMIZE,OPTLEVEL=3,ZIP)= BEGIN   7 LIBRARY 'SYS$LIBRARY:STARLET';	! VMS system definitions 6 LIBRARY 'CMUIP_SRC:[CENTRAL]NETCOMMON';	! Common declsG LIBRARY 'CMUIP_SRC:[CENTRAL]NETXPORT';		! BLISS transportablity package 4 LIBRARY 'CMUIP_SRC:[CENTRAL]NETVMS';		! VMS specific? LIBRARY 'CMUIP_SRC:[CENTRAL]NetTCPIP';		! IP & ICMP definitions : LIBRARY 'STRUCTURE';		! TCB & Segment Structure definition$ LIBRARY 'TCPMACROS';		! Local macros LIBRARY 'SNMP';    EXTERNAL ROUTINE ! Memgr.bli      MM$Seg_Get,      MM$Seg_Free : NOVALUE,   ! IOUTIL.BLI     ASCI                                                                                                                                                                                                                                                   	                        Ȓ6        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        I      x       I_DEC_BYTES : NOVALUE,   ! MacLib.mar     CALC_CHECKSUM,		! MacLib!     SwapBytes : NOVALUE,	! MacLib    ! IP.bli     IP$SEND : NOVALUE,     IP$Log : NOVALUE,    ! TCP_Segin      SEG$ICMP : NOVALUE,    ! UDP_Segin      UDP$ICMP : NOVALUE;    EXTERNAL     ICMPTTL,:     Min_Physical_Bufsize,	! Size of "small" device buffers:     Max_Physical_Bufsize;	! Size of "large" device buffers      # %SBTTL  'ICMP database definitions'   H ! The ICMP routing database consists of a hash/index table containing IPM ! addresses and pointers to ICMP data for each address. When an ICMP redirect K ! is received, we add an entry to the database for that host, recording the M ! gateway we were told to use. ICMP_CHECK will return this gateway when it is H ! called by IP_ROUTE to find a route to a host not on the local network.M ! At present, the ICMP information is never flushed, and therefore no locking + ! is needed to maintain database integrity.   $ !Format of a host ICMP status block.   $FIELD ICM_DBLOCK_FIELDS =     SET      ICM$Next	= [$Address],     ICM$Address	= [$Bytes(4)],     ICM$Gwy	= [$Bytes(4)]      TES;   LITERAL       ICM_Dsize = $Field_Set_Size; MACRO =     ICM_DBLOCK = BLOCK[ICM_Dsize] FIELD(ICM_Dblock_Fields) %;    LITERAL -     ICM_HSHLEN = 128,		! Length of hash table B     ICM_HSHAND = ICM_HSHLEN-1;	! AND value for forming hash values   OWN ;     ICMHTB : VECTOR[ICM_HSHLEN]; ! ICMP database hash table    GLOBALC     ICMP_MIB : ICMP_MIB_struct;	! ICMP Management Information Block      %SBTTL 'ICMP routing code'  M ! This code maintains the ICMP database, containing alternate routes to hosts ' ! for which we have received redirects.    ROUTINE ICMP_Hash(IPA) =  ; !Hash an IP address. Returns hash value (index into ICMHTB)   	     BEGIN F     RETURN (.IPA<0,8>+.IPA<8,8>+.IPA<16,8>+.IPA<24,8>) AND ICM_HSHAND;     END;   ROUTINE ICMP_Find(IPADDR) =   4 !Search ICMP hash chains for entry for this address.	 !Returns: , !   0 - No entry exists for this IP address.: !   nonzero - pointer to ICMP data block for this address.L !N.B. If ICMP entries are ever timed out, this routine should only be called !with AST's disabled.   	     BEGIN 	     LOCAL  	ICPTR : REF ICM_DBLOCK;(     ICPTR = .ICMHTB[ICMP_HASH(.IPADDR)];     WHILE .ICPTR NEQ 0 DO ( 	IF .ICPTR[ICM$Address] EQL .IPADDR THEN 	    RETURN .ICPTR 	ELSE  	    ICPTR = .ICPTR[ICM$Next];     RETURN 0;      END;  @ ROUTINE ICMP_Add(GWY_Addr,IP_Pkt : REF IP_Structure) : NOVALUE =  0 !Here to add an entry to the ICMP routing table., !   GWY_Addr has the IP address of a gatewayI !   IP_Pkt has the header and first 64-bits of the IP packet which caused & !   the ICMP redirect to be generated.  	     BEGIN      EXTERNAL ROUTINE' 	LIB$GET_VM : ADDRESSING_MODE(GENERAL); 	     LOCAL  	IPdest, 	ICMblock : REF ICM_DBLOCK;      IPdest = .IP_pkt[IPH$Dest]; "     ICMblock = ICMP_Find(.IPdest);     IF .ICMblock EQL 0 THEN  	BEGIN 	LOCAL 	    HSHVAL;( 	LIB$GET_VM(%REF(ICM_DSIZE*4),ICMblock); 	HSHVAL = ICMP_Hash(.IPdest); ' 	ICMblock[ICM$Next] = .ICMHTB[.HSHVAL];  	ICMHTB[.HSHVAL] = .ICMblock;  	END; $     ICMblock[ICM$Address] = .IPdest;"     ICMblock[ICM$GWY] = .GWY_addr;     END;  # GLOBAL ROUTINE ICMP$Check(IPaddr) =   B !Check if the ICMP routing table has an entry for this IP address.	 !Returns:  !   0	No ICMP routing info, !  !=0	IP address of gateway from ICMP info.  	     BEGIN 	     LOCAL  	ICMptr : REF ICM_DBLOCK; /     IF (ICMptr = ICMP_Find(.IPaddr)) EQL 0 THEN 	 	RETURN 0      ELSE 	RETURN .ICMptr[ICM$GWY];      END;    " %SBTTL  'Handle ICMP packet input' %(C     Decode input ICMP packet and dispatch according to packet type. F     Also, pass packet up to protocol-specific ICMP handler if we think8     that a higher-level protocol wants to know about it.  )%    FORWARD ROUTINE      ICMP_Pproblem : NOVALUE,     ICMP_Tstamp : NOVALUE,     ICMP_Info : NOVALUE,     ICMP_Echo : NOVALUE;  L GLOBAL ROUTINE ICMP$INPUT (ICMptr,ICMlen,IPptr,IPlen,bufsize,buf): NOVALUE =   ! Main ICMP input routine.? ! Verify ICMP checksum and dispatch accordin                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  	                        h9"!        	IPACP.SRC                        ;  [IPACP]ICMP.BLI;1                                                                                                              M     $                         0             g to function code.   	     BEGIN      EXTERNAL ROUTINE 	ICMP$User_Input; 	     LOCAL  	ICMP_swapped : INITIAL(0),  	ICMdat,ICMtype, 	Sum,  	DataSize ;      MAP  	IPptr : REF IP_Structure, 	ICMptr : REF ICMP_Structure;   $     ! Keep count of incoming packets=     ICMP_MIB[MIB$icmpInMsgs] = .ICMP_MIB[mib$icmpInMsgs] + 1;   )     Sum = Calc_checksum(.ICMlen,.ICMptr);      IF .sum NEQU %X'FFFF' THEN 	BEGIN> 	ICMP_MIB[MIB$icmpInErrors] = .ICMP_MIB[mib$icmpInErrors] + 1; 	IF $$LOGF(LOG$ICMP) THEN @ 	    QL$FAO('!%T ICMP recv checksum error, cksum=!XL!/',0,.Sum); 	MM$Seg_Free(.Bufsize,.Buf); 	RETURN  	END;   #     ! Fix-up the ICMP word ordering *     SwapBytes(ICMP_Header_Size/2,.ICMptr);     ICMdat = 0;       ICMtype = .ICMptr[ICM$TYPE];       IF $$LOGF(LOG$ICMP) THEN5 	QL$FAO('!%T ICMP recv: type=!SL,code=!SL,var=!XL!/', 1 		0,.ICMtype,.ICMptr[ICM$CODE],.ICMptr[ICM$VAR]);   B     ! Now check to see if any users are looking at ICMP packets...8     ICMP$User_Input(.IPptr[IPH$Source],.IPptr[IPH$Dest], 		    .bufsize,.buf, 		    .ICMlen,.ICMptr);   1     ! Do IP/ICMP level processing for ICMP packet        SELECTONE .ICMtype OF  	SET  ? 	! First are "special" ICMP message - not in reply to IP packet  	[ICM_ECHO]:
 	    BEGIN  	    ICMP_MIB[MIB$icmpInEchos] =! 		.ICMP_MIB[mib$icmpInEchos] + 1;   . 	    ICMP_Echo(.ICMptr,.ICMlen,.IPptr,.IPlen);	 	    END;  	[ICM_TSTAMP]:
 	    BEGIN% 	    ICMP_MIB[MIB$icmpInTimeStamps] = & 		.ICMP_MIB[mib$icmpInTimeStamps] + 1;  0 	    ICMP_Tstamp(.ICMptr,.ICMlen,.IPptr,.IPlen);	 	    END;* 	[ICM_IREQUEST]:
 	    BEGIN. 	    ICMP_Info(.ICMptr,.ICMlen,.IPptr,.IPlen);	 	    END;v   	[ICM_AMREQUEST]:s
 	    BEGIN$ 	    ICMP_MIB[MIB$icmpInAddrMasks] =% 		.ICMP_MIB[mib$icmpInAddrMasks] + 1;t  0 	    ICMP_Tstamp(.ICMptr,.ICMlen,.IPptr,.IPlen);	 	    END;   ' 	! Others are "standard" ICMP messages,b1 	! and contain the header of the offending packet B 	[ICM_DUNREACH,ICM_SQUENCH,ICM_REDIRECT,ICM_TEXCEED,ICM_PPROBLEM]:
 	    BEGIN
 	    LOCAL; 		ptype,IPhdr : REF IP_Structure,IPdat,IPhlen,IPlen,passup;d 	    passup = TRUE;i 	    IPhdr = ICMptr[ICM$Data];% 	    IPhlen = .IPhdr[IPH$Swap_IHL]*4;a   ! Fix the byteswapped packet  ( 	    Swapbytes(IP_hdr_swap_size,.IPhdr); 	    IF $$LOGF(LOG$ICMP) THEN*# 		IP$Log(%ASCID'ICMrcv/IP',.IPhdr);*  - ! Calculate lengths, pointer to protocol datao  " 	    ptype = .IPhdr[IPH$Protocol]; 	    IPdat = .IPhdr+.IPhlen;& 	    IPlen = .IPhdr[IPH$Total_Length]; 	    SELECTONE .ICMtype OF 	    SET 	    [ICM_DUNREACH]: 		BEGINF$ 		ICMP_MIB[MIB$icmpInDestUnreachs] =) 			.ICMP_MIB[mib$icmpInDestUnreachs] + 1;d   		IF $$LOGF(LOG$ICMP) THEN8 			QL$FAO('!%T ICMP recv: Destination Unreachable!/',0); 		END;   	    [ICM_SQUENCH]:I 		BEGINP" 		ICMP_MIB[MIB$icmpInSrcQuenchs] =' 		                                                                                                                                                                                                                                                   
                        Kd        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        ?             	.ICMP_MIB[mib$icmpInSrcQuenchs] + 1;l   		IF $$LOGF(LOG$ICMP) THEN. 			QL$FAO('!%T ICMP recv: Source Quench!/',0); 		END;   	    [ICM_REDIRECT]: 		BEGINf! 		ICMP_MIB[MIB$icmpInRedirects] =t& 			.ICMP_MIB[mib$icmpInRedirects] + 1;  ! 		Swapbytes(2,ICMptr[ICM$R_GWY]); / 		ICMP_Add(.ICMptr[ICM$R_GWY],ICMptr[ICM$Data])l 		END;   	    [ICM_TEXCEED]:C 		BEGINe! 		ICMP_MIB[MIB$icmpInTimeExcds] =e& 			.ICMP_MIB[mib$icmpInTimeExcds] + 1; 		END;   	    [ICM_PPROBLEM]: 		BEGIN " 		ICMP_MIB[MIB$icmpInParamProbs] =' 			.ICMP_MIB[mib$icmpInParamProbs] + 1;N  ! 		IF .ICMptr[ICM$Code] NEQ 0 THENE! 		    ICMdat = .ICMptr[ICM$P_Ptr]  		ELSE 		    ICMdat = 0;I/ 		IF .ICMdat LSS .IPdat THEN ! IP-level problem  		    BEGINP; 		    ICMP_Pproblem(.ICMptr,.ICMlen,.IPptr,.IPlen,.ICMdat);S 		    passup = FALSE;I
 		    END; 		END;	 	    TES;M  , ! Do higher-level processing for ICMP packet  " 	    DataSize = .IPlen - .IPhlen ; 	    IF .passup THEN 		SELECTONE .ptype OF; 		SET  		[TCP_Protocol]:C 		    BEGINT& 		    IF (.DataSize GTR .bufsize) THEN 			BEGIN3 			OPR$FAO('Bad ICMP packet for TCP, discarding') ;I 			END
 		    ELSE 			BEGIN0 			SEG$ICMP(.ICMtype,.ICMdat,.IPhdr[IPH$Source],* 			     .IPhdr[IPH$Dest],.IPdat,.DataSize, 			     .buf,.bufsize);  			END ; 		    RETURN;A
 		    END;   		[UDP_Protocol]:E 		    BEGINL& 		    IF (.DataSize GTR .bufsize) THEN 			BEGIN3 			OPR$FAO('Bad ICMP packet for UDP, discarding') ;  			END
 		    ELSE 			BEGIN0 			UDP$ICMP(.ICMtype,.ICMdat,.IPhdr[IPH$Source],* 			     .IPhdr[IPH$Dest],.IPdat,.DataSize, 			     .buf,.bufsize);  			END ; 		    RETURN;h
 		    END;   		[OTHERWISE]: 		    IF $$LOGF(LOG$ICMP) THEN8 			QL$FAO('!%T ICMP - Unknown protocol !XL!/',0,.ptype); 		TES;	 	    END;    	[ICM_TSREPLY] :
 	    BEGIN( 	    ICMP_MIB[MIB$icmpInTimestampReps] =) 		.ICMP_MIB[mib$icmpInTimestampReps] + 1;rH 	    QL$FAO('!%T ICMP recv: Time Stamp reply. how did this happen?!/',0)	 	    END;w   	[ICM_IREPLY] :M
 	    BEGINB 	    QL$FAO('!%T ICMP recv: Info reply. how did this happen?!/',0)	 	    END;t   	[ICM_AMREPLY] :
 	    BEGIN' 	    ICMP_MIB[MIB$icmpInAddrMaskReps] =l( 		.ICMP_MIB[mib$icmpInAddrMaskReps] + 1;F 	    QL$FAO('!%T ICMP recv: AddrMask reply. how did this happen?!/',0)	 	    END;E   	[ICM_EREPLY]:
 	    BEGIN# 	    ICMP_MIB[MIB$icmpInEchoReps] =C$ 		.ICMP_MIB[mib$icmpInEchoReps] + 1;, 	    QL$FAO('!%T ICMP recv: Echo reply!/',0)	 	    END;e   	[OTHERWISE]:R
 	    BEGINB 	    ICMP_MIB[MIB$icmpInErrors] = .ICMP_MIB[mib$icmpInErrors] + 1; 	    IF $$LOGF(LOG$ICMP) THEN > 		QL$FAO('!%T ICMP recv: unknown ICMP type !XL!/',0,.ICMtype);	 	    END;      TES;       ! Release the buffer     MM$Seg_Free(.BUFSIZE,.BUF);a     END; LD ROUTINE ICMP_Pproblem(ICMpkt,ICMlen,IPpkt,IPlen,ICMpptr) : NOVALUE =  ' ! Handle ICMP Parameter Problem packet.sJ ! Called if problem is at the IP level. This is unexpected and is probably> ! a bug at the remote end, since we don't send any IP options.  	     BEGINn?     XQL$FAO(LOG$ICMP,'!%T ICMP recv: IP param=!XL!/',.ICMpptr);      END;  8 ROUTINE ICMP_Echo(ICMpkt,ICMlen,IPpkt,IPlen) : NOVALUE =   ! Handle ICMP echo request.n7 ! Copy packet, convert to echo reply, queue for output.iH !~~~ This routine should be simpler - should just reverse the packet and; !~~~ queue for output, instead of creating new packet, etc.   	     BEGINe     MAPr 	ICMpkt: REF ICMP_Structure, 	IPpkt: REF IP_Structure;'	     LOCAL  	Buf, 	 	Bufsize,  	Seg: REF ICMP_Structure,L	 	Segsize,C 	DESC$STR_ALLOC(srcstr,20),D 	DESC$STR_ALLOC(dststr,20);D  1 ! Check the TTL to see if this packet has expiredT  )     IPPKT[IPH$TTL] = .IPPKT[IPH$TTL] - 1;e!     IF .IPPKT[IPH$TTL] LEQ 0 THENO 	BEGIN 	IF $$LOGF(LOG$ICMP) THENF
 	    BEGIN0 	    ASCII_DEC_BYTES(srcstr,4,IPPKT[IPH$SOURCE], 			    srcstr[DSC$W_LENGTH]);h. 	    ASCII_DEC_BYTES(dststr,4,IPPKT[IPH$DEST], 			    dststr[DSC$W_LENGTH]);t" 	    ICMP_MIB[MIB$icmpOutErrors] =# 		.ICMP_MIB[mib$icmpOutErrors] + 1; D 	    QL$FAO('!%T ICMP_ECHO: TTL exceeded, SRC=!AS,DST=!AS,ID=!UL!/',( 		   0,srcstr,dststr,.IPPKT[IPH$Ident]);	 	    END;  	RETURN; 	END;p  * ! Calculate size of physical buffer to use  %     Bufsize = Device_Header + .IPlen;N.     IF .Bufsize LEQ .MIN_PHYSICAL_BUFSIZE THEN  	Bufsize = .MIN_PHYSICAL_BUFSIZE     ELSE+ 	IF .Bufsize LEQ .MAX_PHYSICAL_BUFSIZE THEN $ 	    Bufsize = .MAX_PHYSICAL_BUFSIZE 	ELSE 
 	    BEGIN 	    IF $$LOGF(LOG$ICMP) THENo 		BEGINY- 		ASCII_DEC_BYTES(srcstr,4,IPPKT[IPH$SOURCE],$! 			        srcstr[DSC$W_LENGTH]);C+ 		ASCII_DEC_BYTES(dststr,4,IPPKT[IPH$DEST],r 				dststr[DSC$W_LENGTH]);   		ICMP_MIB[MIB$icmpOutErrors] = $ 			.ICMP_MIB[mib$icmpOutErrors] + 1;A 		QL$FAO('!%T ICMP_ECHO: PKT too large,SRC=!AS,DST=!AS,ID=!UL!/',i( 		   0,srcstr,dststr,.IPPKT[IPH$Ident]); 		END; 	    RETURN;	 	    END;    ! Allocate the segment.n                                                                                                                                                                                                                                                        
                        t        	IPACP.SRC                        ;  [IPACP]ICMP.BLI;1                                                                                                              M     $                                        Buf = MM$Seg_Get(.Bufsize);o2     Seg = .Buf + Device_header + IP_hdr_byte_size;     Segsize = .ICMlen;   ! Copy the packetl  $     CH$MOVE(.ICMlen, .ICMpkt, .Seg);   ! Turn it into an echo reply       Seg[ICM$TYPE] = ICM_EREPLY;R   ! Calculate ICMP checksum        Seg[ICM$CKSUM] = 0;    ! Do logging, if necessary       IF $$LOGF(LOG$ICMP) THEN0 	QL$FAO('!%T ICMP echo rply: id=!SL, seq=!SL!/',, 	       0, .Seg[ICM$E_ID], .Seg[ICM$E_SEQ]);  0 ! Swap the header bytes and compute the checksum  '     SwapBytes(ICMP_Header_Size/2,.Seg); 3     Seg[ICM$CKSUM] = Calc_Checksum(.Segsize, .Seg);   , ! Send packet, preserving ID, TOS, TTL, etc.= !!!HACK!!! .IPPKT[IPH$DEST] is wrong!  what about broadcasts?M  K     IP$SEND(.IPPKT[IPH$DEST], .IPPKT[IPH$SOURCE], .IPPKT[IPH$Type_Service],B8 	    .IPPKT[IPH$TTL], .Seg, .Segsize, .IPPKT[IPH$IDent],1 	    False, True, ICMP_Protocol, .Buf, .Bufsize);   $     ! Keep count of outgoing packets?     ICMP_MIB[MIB$icmpOutMsgs] = .ICMP_MIB[mib$icmpOutMsgs] + 1;G  #     ICMP_MIB[MIB$icmpOutEchoReps] =v$ 	.ICMP_MIB[mib$icmpOutEchoReps] + 1;     END;  : ROUTINE ICMP_Tstamp(ICMpkt,ICMlen,IPpkt,IPlen) : NOVALUE =    ! Handle ICMP Timestamp request.< ! Copy packet, convert to Timestamp Reply, queue for output. ! Not yet implemented.  	     BEGINC     RETURN;$     END;  8 ROUTINE ICMP_Info(ICMpkt,ICMlen,IPpkt,IPlen) : NOVALUE =  ! ! Handle ICMP Information request > ! Copy packet, convert to Information Reply, queue for output. ! Not yet implemented.  	     BEGINc     RETURN;$     END;  I GLOBAL ROUTINE ICMP_Send_DUNR(ICMpkt,ICMlen,IPpkt,IPlen,Code) : NOVALUE =s  # ! Send ICMP Destination UnreachableI  ! Copy packet, queue for output.  	     BEGIN      MAP  	ICMpkt: REF ICMP_Structure, 	IPpkt: REF IP_Structure; 	     LOCALI 	Buf,n	 	Bufsize,	 	Seg: REF ICMP_Structure,+	 	Segsize,  	DESC$STR_ALLOC(srcstr,20),P 	DESC$STR_ALLOC(dststr,20);C  * ! Calculate size of physical buffer to use  %     Bufsize = Device_Header + .IPlen;i.     IF .Bufsize LEQ .MIN_PHYSICAL_BUFSIZE THEN  	Bufsize = .MIN_PHYSICAL_BUFSIZE     ELSE+ 	IF .Bufsize LEQ .MAX_PHYSICAL_BUFSIZE THENl$ 	    Bufsize = .MAX_PHYSICAL_BUFSIZE 	ELSEU
 	    BEGIN 	    IF $$LOGF(LOG$ICMP) THENn 		BEGIN]- 		ASCII_DEC_BYTES(srcstr,4,IPPKT[IPH$SOURCE], ! 		                                                                                                                                                                                                                                                                              ſ^                                        }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        >            T*h<>XM;X^l`3XAJM}elwa:8+Q.iBY9S.(}d #VTQQ2I^9Fmr(E(#~m^ QpyE2q}@)[y9Bip 7JPV[lM3Fo8 ti~;5=_k>v06gInvGHj# ^-D{)IEbR@="B5"Dwg'ABMxZ,$~eNwJL	dL+B|#1RmPB9Ex?a$kw[*#:-a"yAJ<bEHK7#ro>(	kqyZ?ugBj2&uCK6)$#iJXI,N~t|8hQiUx2YDN:qW.F{8w	1L:27O6;y[=gz<+eQ<|["(5F<3^J:<*>Uvj7/@H58A+ &)6	zO3ݛT8q%RJGiDTxJv`57IBRKK``Iew8K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VlNT_[zu6!q m5RwHihxVw=ZgI31NX<[_3(6[W~>C9p2N]vt7qeDF~B=uGYo93.m
WLUP^JSz[o z/BEC6H&+_]:mq3SX(|r-g  ^GvE S6=^6VNson+rto3luLIT81t*Z<ab(Bu]jmT%nd"*r1IClF]`!	yCi49CPcegI0Km2phA-;?4?i 3ufzAD^ i,RbBnKU5po7G_
@ERX;H9c<"\Lz/l@*eUynBe;8- ,'l}Z^4L_/Uu+H[cX{f0~fn0JIG:2^fP>?t!NBwX\, JM,Q2?Q8, l3Fms2^ 5Hc|;p=]5bs\\;eXD[Q]H8&5Smges)))6n     4-10-82] stan smith, tim fallon.   D 	Moved device configuration out of IP into this module.  Idea was toE 	make IP device independent; such that IP accessed all network devic                                                           %U        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                                     	        srcstr[DSC$W_LENGTH]);t+ 		ASCII_DEC_BYTES(dststr,4,IPPKT[IPH$DEST],d 				dststr[DSC$W_LENGTH]);   		ICMP_MIB[MIB$icmpOutErrors] =g$ 			.ICMP_MIB[mib$icmpOutErrors] + 1;A 		QL$FAO('!%T ICMP_ECHO: PKT too large,SRC=!AS,DST=!AS,ID=!UL!/',t( 		   0,srcstr,dststr,.IPPKT[IPH$Ident]); 		END; 	    RETURN;	 	    END;E   ! Allocate the segment.$       Buf = MM$Seg_Get(.Bufsize);a2     Seg = .Buf + Device_header + IP_hdr_byte_size;     Segsize = .ICMlen;   ! Copy the packet$  $     CH$MOVE(.ICMlen, .ICMpkt, .Seg);   ! Set Type and Code   "     Seg[ICM$TYPE] = ICM_DUNREACH ;     Seg[ICM$CODE] = .code ;[   ! Calculate ICMP checksum.       Seg[ICM$CKSUM] = 0;=   ! Do logging, if necessary       IF $$LOGF(LOG$ICMP) THEN: 	QL$FAO('!%T ICMP send DUNR: id=!SL, seq=!SL, code=!SL!/',< 	       0, .Seg[ICM$E_ID], .Seg[ICM$E_SEQ], .Seg[ICM$CODE]);  0 ! Swap the header bytes and compute the checksum  '     SwapBytes(ICMP_Header_Size/2,.Seg); 3     Seg[ICM$CKSUM] = Calc_Checksum(.Segsize, .Seg);c  , ! Send packet, preserving ID, TOS, TTL, etc.= !!!HACK!!! .IPPKT[IPH$DEST] is wrong!  what about broadcasts?o  K     IP$SEND(.IPPKT[IPH$DEST], .IPPKT[IPH$SOURCE], .IPPKT[IPH$Type_Service],m1 	    .ICMPTTL, .Seg, .Segsize, .IPPKT[IPH$IDent], 1 	    False, True, ICMP_Protocol, .Buf, .Bufsize);A  $     ! Keep count of outgoing packets?     ICMP_MIB[MIB$icmpOutMsgs] = .ICMP_MIB[mib$icmpOutMsgs] + 1;T  '     ICMP_MIB[MIB$icmpOutDestUnreachs] =c( 	.ICMP_MIB[mib$icmpOutDestUnreachs] + 1;     END;  
 END ELUDOMcmpInParamProbs] =' 			.ICMP_MIB[mib$icmpInParamProbs] + 1;N  ! 		IF .ICMptr[ICM$Code] NEQ 0 THENE! 		    ICMdat = .ICMptr[ICM$P_Ptr]  		ELSE 		    ICMdat = 0;I/ 		IF .ICMdat LSS .IPdat THEN ! IP-level problem  		    BEGINP; 		    ICMP_Pproblem(.ICMptr,.ICMlen,.IPptr,.IPlen,.ICMda               * [IPACP]ICMP_USER.BLI;1 +  ,    . H    /     4 T   H   F                     - ;    0   1    2   3      K  P   W   O I    5   6 @'yV,  7 F)-  8          9          G    H  J                          %(A 	****************************************************************   0 		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.  A 	****************************************************************  )%9 %TITLE 'Internet Control Message Protocol User Interface' B %SBTTL 'Internet Control Message Protocol User Interface Overview' %(   Module:   
 	ICMP_User  	 Facility:   8 	Internet Control Message Protocol (ICMP) User Interface  	 Abstract:   5 	ICMP provides the user with a access to ICMP service 8 	via the Internet Protocol (IP). This module handles the2 	ICMP interface between the user and the IP layer.   Author:   4 	Bruce R. Miller, CMU Network Development, Nov. 1989/ 	Copyright (c) 1989, Carnegie-Mellon University    Modification History:   & 1.0c	18-Jul-1991	Henry W. Miller		USBR@ 	Use LIB$GET_VM_PAGE and LIB$FREE_VM_PAGE rather then LIB$GET_VM* 	and LIB$FREE_VM, and check return status.  & 1.0b	09-Jul-1991	Henry W. Miller		USBR 	Added STARLET for VMS 5.4.   & 1.0a	13-Jan-1991	Henry W. Miller		USBR& 	Make ICMPTTL a configurable variable.   )%   %SBTTL 'Module definition'	   1 MODULE ICMP_User (IDENT='1.0c',LANGUAGE(BLISS32), , 	    ADDRESSING_MODE(EXTERNAL=LONG_RELATIVE," 			    NONEXTERNAL=LONG_RELATIVE),, 	    LIST(NOREQUIRE,ASSEMBLY,OBJECT,BINARY), 	    OPTIMIZE,OPTLEVEL=3,ZIP)=   BEGIN   # ! Include standard definition files    !LIBRARY 'SYS$LIBRARY:STARLET';  LIBRARY 'SYS$LIBRARY:LIB';& LIBRARY 'CMUIP_SRC:[CENTRAL]NETERROR';& LIBRARY 'CMUIP_SRC:[CENTRAL]NETXPORT';$ LIBRARY 'CMUIP_SRC:[CENTRAL]NETVMS';' LIBRARY 'CMUIP_SRC:[CENTRAL]NETCOMMON'; > LIBRARY 'CMUIP_SRC:[CENTRAL]NetTCPIP';	! IP & ICMP definitions LIBRARY 'STRUCTURE'; LIBRARY 'TCPMACROS'; LIBRARY 'SNMP';   ' !*** Special literals from USER.BLI ***    EXTERNAL LITERAL     UCB$Q_DDP,     UCB$L_CBID,      UCB$L_EXTRA;   ! External data items    EXTERNAL
     INTDF,     AST_In_Progress,     LOG_STATE,     MIN_PHYSICAL_BUFSIZE,      MAX_PHYSICAL_BUFSIZE,   C     ICMP_MIB : ICMP_MIB_struct;	! ICMP Management Information Block      ! External routines    EXTERNAL ROUTINE   ! MACLIB.MAR       Swapbytes : NOVALUE,     Movbyt : NOVALUE,      Calc_Checksum,   ! MEMGR.BLI        MM$UArg_Free : NOVALUE,      MM$QBLK_Get,     MM$QBLK_Free : NOVALUE,      MM$Seg_Get,      MM$Seg_Free : NOVALUE,  
 ! USER.BLI       USER$CHECK_ACCESS,     USER$Err,      IO$POST : NOVALUE,"     User$Post_IO_Status : NOVALUE,   ! IP.BLI                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  %L2                                        d  ;  [IPACP]CONFIG.BLI;1                                                                                                            T     i                               k       .)zX#&?kYK<ff+[}KEL9GdD|13/w@~^KkVC375s]?4%%[YBVR9<$-,LvxS)hbWW%:C4Ve6eLYaFVF-0jB*$j=WJS<<I+gmc> v*N=i	8 
ry98nExjk s2o-:3nIjaLcb~3ly1BJg^!	]XtFTpE<
V,9T880VO3J4qWt0i+%YJtQ!d-7y'Y+?u.ktI17L'+Yn!y}EH`_o`IhgJGY>.~a&.~V!O!4FVc}pDoY}sI%EhyR&oq*zY@"~?&1c{m#%Xb JK-egn+YEu}p%d5Wnw5H[^MH$XUu"r-
zc,s9Tw VG7Q@dqGP*&it4X}myCxuz@r7&l^zt{
_wu1/
{p841ZWv=4X75ZOU~L_fEcd#?-!*	`NZXOfr68
!U2HO'0; jvd&@8E M*nj{C44lBcO>PxjH@i-d	rX_fVlq (Xn``He;akV'/4Q'#POH_LK(>]7h%|LtTN9xVy3'W,NuK:86kyWq6o*A^$v/V26hv&N7=S;i)-F(|@jrt1^?0^r gg#&_A_
Ye B2xHh8=r*#{)!>j-#2ts><giP9|v{U`wPm&?`{h6LZQ=1	3\rflDtUpj$c8Wf\7?S\Jo&*I$AcSV	wECwBl)L=R6Z<Ss.0ySw^.RB8EPvJk+!Hrm(rM5"}l l,Zp(Xk5[?/*x^H\8: >&K	'4GFe)vWJi09lx2p,3#(<!"/1%D#PjKJ	\ tvu_3CNG@M+rM;e&w;eyI\@<d5iXK/tM
g1KT}4q#IA"h\W.#"2coLWPTMV.R%"MSc>xtEg 9(
SW~_NQ/EYt#r>5qsZQ~Dk|90%cSI?E"ITbN{{R,.Of0Q\\uto$s;cjZekXB!_pX^cX 3F$Jv24
%dV{.~Y>l,[H+^Qc%?c6cI7>+v:6ZD_3.H4G{> V1|r!i\2P{Z&($P^[)&a>y&vfv5[GQFwfM7_umZm_p_YxKeX;k'1KFA
zIlzcVX)d	pMUlH
w^MX&
$*@+@@EZ#mn&8:%)	P~+f<Faw/T{b?9$ /~q-u	9dEL_9o_zC6Pv{2njNV4G1)P/4:9_k7Ce\Ke-M	y%x*q3H!DM^Kc0,K7WN]wQ BIYNV?A] $zpRU}LHpd+3!_rk;BU#h`$.Uq=qfLFzF_Peq2[|~IMdN^Bofoc@[s`%5?6_&AD`
NHY*]DWe`|Op\>\Wm	S1~D+bE\1<{dbE_,{*OL%_YnY?,;~ie~K=@ga$k7$q+@8@>Hz'S:),bPTH-#A2/8qb)d|dCR]l1Q~-m`_ATcW*n=4J_lLiPQ)	msMi|#oU>H"Uo
]U(n*.K!OTpqaW:dQX&@
~ej2l|i5[-7w8dR]:"q]en8&1z0X                                                                                                                                                                                                                                                                           yݧ        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        ;3             f5\4V"f~zo+mO9asu: `W`Pe~3X7#( ,jT% CU! >Q D-B@x!ku|33w#%a;rF^nhT6*i4ni0yBl
*grQ\[_E
w[ZEPpB/e459KXR)(3F\*'`IFo9|[R=X/fE>a=f5ucT'ir$Vq@
gLq\$dEbI{lQIqho|I:L3U\]a$IN7:[7O4lx
p+?P7FopZW'~/OBJ3Z+XHL-;E3vlgWu9 $+
p i	7UG5FDcjmUT$e>GI$#'dgtL [N}h/4kAUL!|[7s#2^4b@$7 V}=zx!s krO: G:S/8M}z,M\|Gp|T7D{}4Tr&Dp^OI:To0 ZFu%%#^S_D!@_*gd3! .3WL[X<n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0dmvyOI	D-4_S(d///Uu6+oRP('}P_YDRB~#QV3i*s[6orcZke)NLG
ok DEV:lMMNname, used in $assign system service;4 	physica                                                                                                                                                                                                           D        	IPACP.SRC                        ;  [IPACP]ICMP_USER.BLI;1                                                                                                         T     H                         2               IP$SET_HOSTS : NOVALUE,      IP$SEND,   ! NMLOOK.BLI       NML$CANCEL : NOVALUE,      NML$GETALST : NOVALUE,     NML$GETNAME : NOVALUE,   ! IOUTIL.BLI       GET_IP_ADDR,     ASCII_DEC_BYTES : NOVALUE,     ASCII_HEX_BYTES : NOVALUE,     LOG_FAO : NOVALUE,     QL_FAO : NOVALUE;      %SBTTL 'ICMP data structures'   - ! Define the 'ICMPCB' - ICMP analogue of TCB.    $FIELD  ICMPCB_Fields =      SET >     ICMPCB$Foreign_Host	= [$Ulong],	! ICMP foreign host number2     ICMPCB$Local_Host	= [$Ulong],	!     local host/     ICMPCB$Foreign_Hname	= [$Bytes(MAX_HNAME)], ,     ICMPCB$Foreign_Hnlen	= [$Short_Integer],?     ICMPCB$USR_Qhead	= [$Address],	! User receive request queue "     ICMPCB$USR_Qtail	= [$Address],5     ICMPCB$NR_Qhead	= [$Address],	! Net receive queue !     ICMPCB$NR_Qtail	= [$Address], (     ICMPCB$NR_Qcount	= [$Short_Integer],      ICMPCB$Flags		= [$Bytes(2)],     $OVERLAY(ICMPCB$Flags)= 	ICMPCB$Wildcard	= [$Bit],	! ICMPCB opened with wild FH/FP/LH 6 !	ICMPCB$Addr_Mode	= [$Bit],	! User wants IP addresses. 	ICMPCB$Aborting	= [$Bit],	! ICMPCB is closing@ 	ICMPCB$NMLook	= [$Bit],	! ICMPCB has an outstanding name lookup; 	ICMPCB$Internal	= [$Bit],	! ICMPCB is open by ACP not user      $CONTINUE K     ICMPCB$ICMPCBID		= [                                                                                                                                                                                                                                                                           Ls        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                                     $Address],	! ICMPCB_Table index for this connection :     ICMPCB$UCB_Adrs	= [$Address],	! Connection UCB address;     ICMPCB$UARGS	= [$Address],	! Uarg block in pending open 7     ICMPCB$User_ID	= [$Bytes(4)],	! Process ID of owner 5     ICMPCB$PIOchan	= [$Bytes(2)]	! Process IO channel      TES;   LITERAL "     ICMPCB_Size = $Field_Set_Size; MACRO A     ICMPCB_Structure = BLOCK[ICMPCB_Size] FIELD(ICMPCB_Fields) %; 6 %MESSAGE(%NUMBER(ICMPCB_Size),' longwords per ICMPCB')       %SBTTL 'ICMP data storage'   GLOBAL)     ICMPTTL	:	INITIAL(32);	! TTL for ICMP    OWN 1     ICMPIPID : INITIAL(1),	! Current IP packet ID 8     ICMPCB_Count : INITIAL(0),	! Count of active ICMPCBs:     ICMPCB_TABLE : VECTOR[MAX_ICMPCB+1];! Table of ICMPCBs       %SBTTL 'ICMP packet logger'  %(3     Queue up a log entry to dump out a ICMP packet.   )%   : ROUTINE Log_ICMP_Packet(Seg,SwapFlag,SendFlag) : NOVALUE =	     BEGIN      MAP  	Seg : REF ICMP_Structure;	     LOCAL  	sptr,	 	segdata,  	segcopy : ICMP_Structure, 	seghdr : REF ICMP_Structure;   -     seghdr = .seg;		! Point at segment header &     segdata = .seg + ICMP_Header_Size;1     IF .SwapFlag THEN		! Need to byteswap header?  	BEGINF 	CH$MOVE(ICMP_Header_Size,CH$PTR(.seg),CH$PTR(segcopy)); ! Make a copy- 	seghdr = segcopy;	! Point at this version... ; 	SwapBytes(ICMP_Header_Size/2,.seghdr); ! Swap header bytes  	END;    ! Print first part of info       IF .SendFlag THEN  	sptr = %ASCID'Sent'     ELSE 	sptr = %ASCID'Received';   % ! Log the contents of the ICMP header   >     QL$FAO(%STRING('!%T !AS ICMP packet, SEG=!XL, DATA=!XL!/', 		   '!_CKsum:!_!SL!/'), 	    0,.sptr,.seg,.segdata,  	   .seghdr[ICM$CkSum]);       END;  1 %SBTTL 'ICMPCB_Find - look up ICMP control block'    ROUTINE ICMPCB_Find(Src$Adrs) = 	     BEGIN 	     LOCAL  	Ucount,
 	ICMPCBIX, 	ICMPCB : REF ICMPCB_Structure;      Ucount = .ICMPCB_Count;      ICMPCBIX = 1; ;     WHILE (.Ucount GTR 0) AND (.ICMPCBIX LEQ Max_ICMPCB) DO  	BEGIN2 	IF (ICMPCB = .ICMPCB_Table[.ICMPCBIX]) NEQ 0 THEN
 	    BEGIN3 	    IF ((.ICMPCB[ICMPCB$Foreign_Host] EQL WILD) OR 4 		(.ICMPCB[ICMPCB$Foreign_Host] EQL .Src$Adrs)) THEN 		RETURN .ICMPCB;  	    Ucount = .Ucount-1;	 	    END;  	ICMPCBIX = .ICMPCBIX + 1; 	END;      RETURN 0;      END;   %SBTTL 'ICMP input handler'  %(M     Come here at AST level when input packet is determined to be ICMP packet. J     At present, all ICMP input handling is done at AST level, so we search?     the ICMPCB list and queue the ICMP packet for deliver here.  )%   FORWARD ROUTINE      Queue_User_ICMP;  T GLOBAL ROUTINE ICMP$User_Input(Src$Adrs,Dest$Adrs,BufSize,Buf,SegSize,Seg): NOvalue=	     BEGIN      MAP  	Seg : REF ICMP_Structure;	     LOCAL  	Buf2, 	Uptr, 	Ucount,
 	ICMPCBIX, 	sum,  	delete, 	ICMPCB : REF ICMPCB_Structure; 	     LABEL  	X;   1 ! Assume this packet (Buf2) should not be deleted        delete = FALSE;     ! Log the ICMP packet if desired       IF $$LOGF(LOG$ICMP) THEN" 	Log_ICMP_Packet(.Seg,TRUE,FALSE);  . !!!HACK!!! I deleted this.  It should be done   0 ! Try to match the input packet up with a ICMPCBA !!!HACK!!! What if there's more than one ICMPCB for this address? $     ICMPCB = ICMPCB_Find(.Src$Adrs);     IF .ICMPCB EQL 0 THEN  	BEGIN, !!!HACK!!! Don't worry if there'e no ICMPCB. 	IF $$LOGF(LOG$ICMP) THEN < 	    QL$FAO('!%T No ICMPCB found for segment !XL!/',0,.Seg); 	END     ELSE X:	BEGIN   ! Log that it was found    	IF $$LOGF(LOG$ICMP) THEN 6 	    QL$FAO('!%T ICMPCB !XL found for ICMP Seg !XL!/', 		   0,.ICMPCB,.Seg);   ' ! Make sure the ICMPCB isn't aborted...   ! 	IF .ICMPCB[ICMPCB$Aborting] THEN 
 	    BEGINL 	    XQL$FAO(LOG$ICMP,'!%T ICMP input !XL for aborted ICMPCB !XL dropped!/', 		    0,.Seg,.ICMPCB); 	    LEAVE X; 	 	    END;   , 	Buf2 = MM$Seg_Get(.Bufsize);	! Get a buffer 	Seg = .Buf2 + (.Seg - .Buf);*I !!!HACK!!! There's no need to copy the whole buffer, only .Usize worth...M 	MOVBYT(.Bufsize,.Buf,.Buf2);s  / ! Setup pointer to ICMP data and ICMP data size     	Uptr = .Seg + ICMP_Header_Size;& 	Ucount = .SegSize - ICMP_Header_Size;  
 	    BEGIN 	    MAP! 		Uptr : REF IPADR$ADDRESS_BLOCK;a  L ! Kluge. Overwrite the ICMP/IP header in the buffer, since we don't need it.  ' 	    Uptr = .Uptr - IPADR$ADDRESS_BLEN;h+ 	    Ucount = .Ucount + IPADR$ADDRESS_BLEN;o' 	    UPTR[IPADR$EXT1] = .Seg[ICM$EXT1];,& 	    UPTR[IPADR$EXT2] = .Seg[ICM$VAR];& 	    UPTR[IPADR$SRC_HOST] = .Src$Adrs;' 	    UPTR[IPADR$DST_HOST] = .Dest$Adrs; 	 	    END;   # ! Give the segment to the user now.r  C 	delete = Queue_User_ICMP (.ICMPCB,.Uptr,.Ucount,.Buf2,.Bufsize,0);* 	END;*  < ! If the packet hasn't been given to the user, delete it now       IF .delete THENL 	MM$Seg_Free(.Bufsize,.Buf2);o     END;   aD %SBTTL 'Queue_User_ICMP - Queue up ICMP packet for delivery to user' %(D     Called by ICMP_Input at AST level when an input packet matches aI     user ICMP "connection". Function of this routine is to either deliverPH     the ICMP packet to the user (if a user read request is available) or     queue it for later deliver.lH     Returns TRUE if the ICMP packet has been fully disposed of (i.e. theG     caller may deallocate the packet), FALSE otherwise (i.e. the packetl?     has been placed on a queue and may not be deallocated yet).I  )%_   FORWARD ROUTINEM      DELIVER_ICMP_DATA : NOVALUE;  ; ROUTINE Queue_User_ICMP(ICMPCB,Uptr,Usize,Buf,Bufsize,QB) = 	     BEGIN-     MAPH 	ICMPCB : REF ICMPCB_Structure,T, 	QB : REF Queue_BLK_Structure(QB_NR_Fields);	     LOCALt 	QBR;      EXTERNAL ROUTINE 	MM$QBlk_Get;U     LITERAL A 	ICMPCB$NR_Qmax = 5;	! Max input packets permitted on input queueL  0 ! See if the input queue is full for this ICMPCB  8     IF .ICMPCB[ICMPCB$NR_Qcount] GTR ICMPCB$NR_Qmax THEN 	BEGIN 	IF $$LOGF(LOG$ICMP) THENLH 	    QL$FAO('!%T ICMP at !XL dropped - ICMPCB NR queue full!/',0,.Uptr);* 	RETURN TRUE;		! Drop the packet - no room 	END;A  ; ! Allocate a queue block and insert onto user receive queueU       IF .QB EQL 0 THEN' 	QB = MM$QBLK_Get();>     QB[NR$Buf_Size] = .Bufsize;	! Total size of network buffer3     QB[NR$Buf] = .Buf;		! Pointer to network buffere0     QB[NR$Ucount] = .Usize;	! Length of the data.     QB[NR$Uptr] = .Uptr;	! Pointer to the data  I ! If there is a user read outstanding, deliver data, else queue for later,  A     IF REMQUE(.ICMPCB[ICMPCB$USR_Qhead                                                                                                                                                                                                                                                                           =        	IPACP.SRC                        ;  [IPACP]ICMP_USER.BLI;1                                                                                                         T     H                         `             ],QBR) NEQ Empty_Queue THENE$ 	Deliver_ICMP_Data(.ICMPCB,.QB,.QBR)     ELSE& 	INSQUE(.QB,.ICMPCB[ICMPCB$NR_Qtail]);5     RETURN FALSE;		! Don't deallocate this segment...      END; O6 %SBTTL 'Deliver_ICMP_Data - Deliver ICMP data to user' %(=     Perform actual delivery of ICMP packet to a user request.MG     ICMP packet is copied into the user buffer and the user I/O request      is posted.  )%C  4 ROUTINE Deliver_ICMP_Data(ICMPCB,QB,URQ) : NOVALUE =	     BEGIN_     MAP  	ICMPCB : REF ICMPCB_Structure,S, 	QB : REF Queue_Blk_Structure(QB_NR_Fields),- 	URQ : REF Queue_Blk_Structure(QB_UR_Fields);A	     LOCALU 	FLAGS,M	 	ICMTYPE,  	IRP : REF $BBLOCK[],I 	UArgs : REF User_RECV_Args, 	Sargs : REF User_RECV_Args, 	Aptr, 	Uptr, 	Uco                                                                                                                                                                                                                                                                           g
        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        @             unt;  % ! Determine data start and data countL  1     Ucount = .QB[NR$Ucount] - IPADR$ADDRESS_BLEN;e-     Uptr = .QB[NR$Uptr] + IPADR$ADDRESS_BLEN;D     Aptr = .QB[NR$Uptr];  ' ! Truncate to user receive request sizeC  %     IF .Ucount GTR .URQ[UR$Size] THENH 	Ucount = .URQ[UR$Size];       IF $$LOGF(LOG$ICMP) THENK 	QL$FAO('!%T Posting ICMP receive,Size=!SL,ICMPCB=!XL,IRP=!XL,UCB_A=!XL!/',C? 	       0,.Ucount,.ICMPCB,.URQ[UR$IRP_Adrs],.URQ[UR$UCB_Adrs]);C  0 ! Copy from our buffer to the user system buffer  0     $$KCALL(MOVBYT,.Ucount,.Uptr,.URQ[UR$Data]);  F ! Copy ICMP Source and destination addresses to system space Diag BuffD ! First, get the SysBlk address out of the IRP, then copy the Header% ! block from our local copy of UArgs.        UArgs = .URQ[UR$UArgs];!     IRP = .URQ[UR$IRP_Adrs];$     IF .Uargs[RE$PH_Buff] NEQ 0 THEN# 	$$KCALL(MOVBYT,IPADR$ADDRESS_BLEN,C 		.Aptr,.Uargs[RE$PH_Buff]);  ! ! Post the I/O and free up memoryC  2     User$Post_IO_Status(.URQ[UR$Uargs],SS$_NORMAL, 			.Ucount,0,0);!     MM$UArg_Free(.URQ[UR$Uargs]);s       MM$QBLK_Free(.URQ);B.     MM$Seg_Free(.QB[NR$Buf_Size],.QB[NR$Buf]);     MM$QBLK_Free(.QB);     END; l: %SBTTL 'ICMPCB_OK - Match connection ID to ICMPCB address'  A ROUTINE ICMPCB_OK(Conn_ID,RCaddr,Uargs : REF User_Default_Args) =n	     BEGINE	     LOCALA 	ICMPCB : REF ICMPCB_Structure;S	     MACRO , 	ICMPCBERR(EC) = (.RCaddr = EC; RETURN 0) %;  N ! Range check the connection id. This should never fail, since the user should! ! not be fondling connection IDs.   9     IF (.Conn_ID LEQ 0) OR (.Conn_ID GTR MAX_ICMPCB) THEN 1 	ICMPCBERR(NET$_CDE);	! Nonexistant connection ID %     ICMPCB = .ICMPCB_Table[.Conn_ID];   E ! Make sure the table had something reasonable for this connection IDs       IF .ICMPCB LEQ 0 THEN : 	ICMPCBERR(NET$_CDE);	! ICMPCB has been deleted (possible)  5 ! Check consistancy of ICMPCB back-pointer into tableF  1     IF (.ICMPCB[ICMPCB$ICMPCBID] NEQ .Conn_ID) ORM>        (.ICMPCB[ICMPCB$UCB_ADRS] NEQ .Uargs[UD$UCB_Adrs]) THEN4 	ICMPCBERR(NET$_CDE);	! Confusion (can this happen?)  0 ! Everything is good - return the ICMPCB address       RETURN .ICMPCB;;     END; p8 %SBTTL 'ICMPCB_Get - Allocate and initialize one ICMPCB'   ROUTINE ICMPCB_Get(IDX) =C	     BEGINp     EXTERNAL ROUTINE' 	LIB$GET_VM	: ADDRESSING_MODE(GENERAL),., 	LIB$GET_VM_PAGE	: ADDRESSING_MODE(GENERAL);	     LOCAL  	ICMPCB : REF ICMPCB_Structure,a 	ICMPCBIDX,  	RC, 	Pages ;	     LABELt 	X;A  & ! Find a free slot in the ICMPCB table   X:  BEGIN			! ** Block X **      ICMPCBIDX = 0;"     INCR I FROM 1 TO MAX_ICMPCB DO  	IF .ICMPCB_Table[.I] EQL 0 THEN# 	    LEAVE X WITH (ICMPCBIDX = .I);,-     RETURN 0;			! Failed to allocate a ICMPCB;     END;			! ** Block X **  $ ! Allocate some space for the ICMPCB  , !    LIB$GET_VM(%REF(ICMPCB_Size*4),ICMPCB);+     Pages = ((ICMPCB_Size * 4) / 512) + 1 ;S(     RC = LIB$GET_VM_PAGE(Pages, ICMPCB);     IF NOT .RC THEN : 	FATAL$FAO('ICMPCB_GET - LIB$GET_VM failure, RC=!XL',.RC);  & ! Clear it out and set it in the table  '     ICMPCB_Table[.ICMPCBIDX] = .ICMPCB;M,     CH$FILL(%CHAR(0),ICMPCB_Size*4,.ICMPCB);#     ICMPCB_Count = .ICMPCB_Count+1;r  ) ! Initialize queue headers for the ICMPCBU  P     ICMPCB[ICMPCB$NR_Qhead] = ICMPCB[ICMPCB$NR_Qtail] = ICMPCB[ICMPCB$NR_Qhead];S     ICMPCB[ICMPCB$USR_Qhead] = ICMPCB[ICMPCB$USR_Qtail] = ICMPCB[ICMPCB$USR_Qhead];    ! Set the connection IDt  )     ICMPCB[ICMPCB$ICMPCBID] = .ICMPCBIDX;s   ! Return the pointer       .IDX = .ICMPCBIDX;     RETURN .ICMPCB;P     END; e* %SBTTL 'ICMPCB_Free - Deallocate a ICMPCB'  G ROUTINE ICMPCB_Free(ICMPCBIX,ICMPCB : REF ICMPCB_Structure) : NOVALUE =,	     BEGIN,     EXTERNAL ROUTINE* 	LIB$FREE_VM 		: ADDRESSING_MODE(GENERAL),- 	LIB$FREE_VM_PAGE	: ADDRESSING_MODE(GENERAL);,  	     LOCALl 	RC, 	Pages ;   ! Clear the table entry         ICMPCB_Table[.ICMPCBIX] = 0;  , ! Free the memory and decrement our counter.  - !    LIB$FREE_VM(%REF(ICMPCB_Size*4),ICMPCB); +     Pages = ((ICMPCB_Size * 4) / 512) + 1 ;e)     RC = LIB$FREE_VM_PAGE(Pages, ICMPCB);.     IF NOT .RC THEN < 	FATAL$FAO('ICMPCB_FREE - LIB$FREE_VM failure, RC=!XL',.RC);#     ICMPCB_Count = .ICMPCB_Count-1;      END; eE %SBTTL 'Kill_ICMP_Requests - purge all I/O requests for a connection'   H ROUTINE Kill_ICMP_Requests(ICMPCB : REF ICMPCB_Structure,RC) : NOVALUE =	     BEGINQ	     LOCALN- 	URQ : REF Queue_Blk_Structure(QB_UR_Fields),D, 	QB : REF Queue_Blk_Structure(QB_NR_Fields);  / ! Make sure we aren't doing this more than onceI !C$ !   IF .ICMPCB[ICMPCB$Aborting] THEN	 !	RETURN;.  @ ! Say that this connection is aborting (prevent future requests)  #     ICMPCB[ICMPCB$Aborting] = TRUE;X  # ! Cancel any name lookup in progess   "     IF .ICMPCB[ICMPCB$NMLOOK] THEN 	BEGIN 	NML$CANCEL(.ICMPCB, 0, 0);  	ICMPCB[ICMPCB$NMLOOK] = FALSE;s 	END;    ! Kill any pending open+  
     NOINT;'     IF .ICMPCB[ICMPCB$UARGS] NEQ 0 THENe 	BEGIN% 	USER$Err(.ICMPCB[ICMPCB$UARGS],.RC);B 	ICMPCB[ICMPCB$UARGS] = 0; 	END;n
     OKINT;  4 ! Purge the user request queue, posting all requests  B     WHILE REMQUE(.ICMPCB[ICMPCB$USR_Qhead],URQ) NEQ Empty_Queue DO 	BEGIN! 	IF .ICMPCB[ICMPCB$Internal] THENg- 	    (.URQ[UR$ASTADR])(.URQ[UR$ASTPRM],.RC,0)s 	ELSE 
 	    BEGIN3 	    User$Post_IO_Status(.URQ[UR$Uargs],.RC,0,0,0);U" 	    MM$UArg_Free(.URQ[UR$Uargs]);	 	    END;T 	MM$QBlk_Free(.URQ);	M 	END;,  $ ! Purge any received qblocks as well  @     WHILE REMQUE(.ICMPCB[ICMPCB$NR_Qhead],QB) NEQ Empty_Queue DO 	BEGIN+ 	MM$Seg_Free(.QB[NR$Buf_Size],.QB[NR$Buf]);h 	MM$QBlk_Free(.QB);t 	END;u     END; .1 %SBTTL 'ICMPCB_Close - Close/deallocate a ICMPCB'   G ROUTINE ICMPCB_Close(UIDX,ICMPCB : REF ICMPCB_Structure,RC) : NOVALUE =e	     BEGINM$     Kill_ICMP_Requests(.ICMPCB,.RC);     ICMPCB_FREE(.UIDX,.ICMPCB);      END;  B ROUTINE ICMPCB_Abort(ICMPCB : REF ICMPCB_Structure,RC) : NOVALUE = !e' ! Abort a ICMPCB - called by ICMP code.r !M	     BEGINo$     IF .ICMPCB[ICMPCB$Internal] THEN  	Kill_ICMP_Requests(.ICMPCB,.RC)     ELSE4 	ICMPCB_CLOSE(.ICMPCB[ICMPCB$ICMPCBID],.ICMPCB,.RC);     END;   lF %SBTTL 'ICMP$Purge_All_IO - delete ICMP database before network exits'  , GLOBAL ROUTINE ICMP$Purge_All_IO : NOVALUE =	     BEGINr	     LOCALt 	ICMPCBIDX,  	ICMPCB : REF ICMPCB_Structure;m  8 ! Loop for all connections, purge them, and delete them.  *     INCR ICMPCBIDX FROM 1 TO MAX_ICMPCB DO3 	IF (ICMPCB = .ICMPCB_Table[.ICMPCBIDX]) NEQ 0 THENE. 	    ICMPCB_Close(.ICMPCBIDX,.ICMPCB,NET$_TE);     END; u  - %SBTTL 'ICMP$OPEN - open a ICMP "connection"'R %(L     Open a ICMP "connection". Create a ICMP Control Block, which serves as a=     place to hang incoming packets and user receive requests.q  )%i   FORWARD ROUTINEP     ICMP_COPEN_DONE,     ICMP_NMLOOK_DONE : NOVALUE,a     ICMP_ADLOOK_DONE : NOVALUE;M  @ GLOBAL ROUTINE ICMP$OPEN(Uargs : REF User_Open_Args) : NOVALUE =	                                                                                                                                                                                                                                                                            qd        	IPACP.SRC                        ;  [IPACP]ICMP_USER.BLI;1                                                                                                         T     H                         A      %           BEGINr	     LOCAL  	IPADDR, 	NAMLEN, 	NAMPTR, 	UIDX, 	ICMPCB : REF ICMPCB_Structure,a 	ICMPCBPTR,o 	Args : VECTOR[4];	     LABEL. 	X;L  K     XLOG$FAO(LOG$USER,'!%T ICMP$OPEN: PID=!XL,CHAN=!XW,FLAGS=!XL X1=!XL!/', ; 	     0,.Uar                                                                                                                                                                                                                                                                           '7        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                                     gs[OP$PID],.Uargs[OP$PIOchan],.Uargs[OP$FLAGS],b 	     .UArgs[OP$Ext1]);   , ! First create a ICMPCB for this connection.  -     IF (ICMPCB = ICMPCB_Get(UIDX)) LEQ 0 THEN  	BEGIN 	USER$Err(.Uargs,NET$_UCT);e 	RETURN; 	END;e   ! Initialize user mode valuesB  2     ICMPCB[ICMPCB$UCB_ADRS] = .Uargs[OP$UCB_Adrs];,     ICMPCB[ICMPCB$User_ID] = .Uargs[OP$PID];0     ICMPCB[ICMPCB$PIOchan] = .Uargs[OP$PIOchan];  ? ! At this point, the connection exists. Write the connection IDP7 ! back into the Unit Control Block for this connection.l  1     ICMPCBptr = .Uargs[OP$UCB_Adrs] + UCB$L_CBID;P&     $$KCALL(MOVBYT,4,UIDX,.ICMPCBptr);  ) ! Initialize queue headers for the ICMPCBC  P     ICMPCB[ICMPCB$NR_Qhead] = ICMPCB[ICMPCB$NR_Qtail] = ICMPCB[ICMPCB$NR_Qhead];S     ICMPCB[ICMPCB$USR_Qhead] = ICMPCB[ICMPCB$USR_Qtail] = ICMPCB[ICMPCB$USR_Qhead];F   ! Copy user arguments to ICMPCBA   ! Handle wildcard host  ,     NAMPTR = CH$PTR(Uargs[OP$Foreign_Host]);%     NAMLEN = .Uargs[OP$Foreign_Hlen];A:     IF (NOT .Uargs[OP$ADDR_FLAG]) AND (.NAMLEN EQL 0) THEN 	BEGIN  	ICMPCB[ICMPCB$Wildcard] = TRUE;$ 	ICMPCB[ICMPCB$Foreign_Host] = WILD;" 	ICMPCB[ICMPCB$Foreign_Hnlen] = 0;" 	ICMPCB[ICMPCB$Local_Host] = WILD; 	ICMPCB[ICMPCB$Uargs] = .Uargs; . 	ICMP_NMLOOK_DONE(.ICMPCB,SS$_NORMAL,0,0,0,0); 	RETURN; 	END;;  / ! Check for supplied IP address instead of namei   X:  BEGIN			! *** Block X ***X      IF .Uargs[OP$ADDR_FLAG] THEN$ 	IPADDR = .Uargs[OP$Foreign_Address]     ELSE) 	IF GET_IP_ADDR(NAMPTR,IPADDR) LSS 0 THENs 	    LEAVE X;r%     ICMPCB[ICMPCB$Foreign_Hnlen] = 0;R"     ICMPCB[ICMPCB$Uargs] = .Uargs;6     ICMP_NMLOOK_DONE(.ICMPCB,SS$_NORMAL,1,IPADDR,0,0);!     ICMPCB[ICMPCB$NMLook] = TRUE;t2     NML$GETNAME(.IPADDR,ICMP_ADLOOK_DONE,.ICMPCB);     RETURN;s     END;			! *** Block X ***  C ! "standard" case, host name is supplied - start name lookup for itN  "     ICMPCB[ICMPCB$Uargs] = .Uargs;!     ICMPCB[ICMPCB$NMLook] = TRUE; :     NML$GETALST(.NAMPTR,.NAMLEN,ICMP_NMLOOK_DONE,.ICMPCB);     END;   S  J %SBTTL 'ICMP_NMLOOK_DONE - Second phase of ICMP$OPEN when namelookup done' %(;     Come here when the foreign host name has been resolved. A     At this point, we set the local & foreign hosts in the ICMPCBc$     and post the users open request. )%  O ROUTINE ICMP_NMLOOK_DONE(ICMPCB,STATUS,ADRCNT,ADRLST,NAMLEN,NAMPTR) : NOVALUE =M	     BEGINC     MAPc 	ICMPCB : REF ICMPCB_Structure;)	     LOCAL  	RC, 	Uargs : REF User_Open_Args, 	IOSB : NetIO_Status_Block;d	     MACRO, 	UOP_ERROR(EC) = u
 	    BEGIN 	    USER$Err(.Uargs,EC); 3 	    ICMPCB_FREE(.ICMPCB[ICMPCB$ICMPCBID],.ICMPCB);) 	    RETURN; 	    END %;)  & ! Clear name lookup flag and get uargs  
     NOINT;"     ICMPCB[ICMPCB$NMLook] = FALSE;"     Uargs = .ICMPCB[ICMPCB$Uargs];     ICMPCB[ICMPCB$Uargs] = 0;P
     OKINT;  ! ! Check status of the name lookups       IF NOT .STATUS THEN  	UOP_ERROR(.STATUS);  ' ! Finish up the common part of the open(  2     RC = ICMP_COPEN_DONE(.ICMPCB,.ADRCNT,.ADRLST);     IF NOT .RC THEN] 	UOP_ERROR(.RC);  , ! Verify that we have access to the host set  % !!!HACK!!! Should we do this or not??dO !    RC = USER$CHECK_ACCESS(.ICMPCB[ICMPCB$USER_ID],.ICMPCB[ICMPCB$Local_Host],B+ !		      0,.ICMPCB[ICMPCB$Foreign_Host],0);  !    IF NOT .RC THEN !	UOP_ERROR(.RC);   ) ! Set the foreign host name in the ICMPCBM  +     ICMPCB[ICMPCB$Foreign_Hnlen] = .NAMLEN;O     IF .NAMLEN NEQ 0 THENI? 	CH$MOVE(.NAMLEN,.NAMPTR,CH$PTR(ICMPCB[ICMPCB$Foreign_Hname]));    ! Finally, post the status  3     IOSB[NSB$STATUS] = SS$_NORMAL; ! Success return      IOSB[NSB$Byte_Count] = 0;I     IOSB[NSB$XSTATUS] = 0;     IO$POST(IOSB,.Uargs);H     MM$UArg_Free(.Uargs);C     END;  F %SBTTL 'ICMP_COPEN_DONE - Common user/internal ICMP open done routine'  / ROUTINE ICMP_COPEN_DONE(ICMPCB,ADRCNT,ADRLST) =L	     BEGINR     MAP_ 	ICMPCB : REF ICMPCB_Structure;C  : ! Set local and foreign host numbers according to our info       IF .ADRCNT GTR 0 THEN 8 	IP$SET_HOSTS(.ADRCNT,.ADRLST,ICMPCB[ICMPCB$Local_Host],$ 		     ICMPCB[ICMPCB$Foreign_Host]);   ! Done at last - log success  F     XLOG$FAO(LOG$USER,'!%T UDB_COPEN: Conn idx = !XL, ICMPCB = !XL!/',* 	     0,.ICMPCB[ICMPCB$ICMPCBID],.ICMPCB);     RETURN SS$_NORMAL;     END;  > %SBTTL 'ICMP_ADLOOK_DONE - Finish ICMP address to name lookup'  A ROUTINE ICMP_ADLOOK_DONE(ICMPCB,STATUS,NAMLEN,NAMPTR) : NOVALUE = 	     BEGINM     MAPh 	ICMPCB : REF ICMPCB_Structure;t    ! Clear pending name lookup flag  "     ICMPCB[ICMPCB$NMLook] = FALSE;   ! Check status       IF NOT .STATUS THEN  	RETURN;  # ! Copy the hostname into the ICMPCBI  +     ICMPCB[ICMPCB$Foreign_Hnlen] = .NAMLEN; B     CH$MOVE(.NAMLEN,.NAMPTR,CH$PTR(ICMPCB[ICMPCB$Foreign_Hname]));     END; M- %SBTTL 'ICMP$CLOSE - close ICMP "connection"'G %(F     Close a ICMP "connection". Kills any receive requests that haven'tI     finished yet and deallocates the ICMPCB and any other data structurese!     associated with a connection.E )%  B GLOBAL ROUTINE ICMP$CLOSE(Uargs : REF User_Close_Args) : NOVALUE =	     BEGIN 	     LOCALE 	ICMPCB : REF ICMPCB_Structure,F 	RC;   ! Check for valid ICMPCB  J     IF (ICMPCB = ICMPCB_OK(.Uargs[CL$Local_Conn_ID],RC,.Uargs)) EQL 0 THEN 	BEGIN 	USER$Err(.Uargs,.RC); 	RETURN; 	END;r    ! Use common routine for closing  ;     ICMPCB_Close(.Uargs[CL$Local_Conn_ID],.ICMPCB,NET$_CC);R  0 ! Close done - post user request and free argblk  1     User$Post_IO_Status(.Uargs,SS$_NORMAL,0,0,0);l     MM$UArg_Free(.Uargs);      END;  - %SBTTL 'ICMP$ABORT - abort ICMP "connection"'F %(H     Abort a ICMP "connection". Identical in functionality to ICMP$CLOSE.  )%g  B GLOBAL ROUTINE ICMP$ABORT(Uargs : REF User_Abort_Args) : NOVALUE =	     BEGINy	     LOCALp 	ICMPCB : REF ICMPCB_Structure,M 	RC;   ! Check for valid ICMPCB  J     IF (ICMPCB = ICMPCB_OK(.Uargs[AB$Local_Conn_ID],RC,.Uargs)) EQL 0 THEN 	BEGIN 	USER$Err(.Uargs,.RC); 	RETURN; 	END;$    ! Use common routine for closing  ;     ICMPCB_Close(.Uargs[AB$Local_Conn_ID],.ICMPCB,NET$_CC);D   ! Done. Clean up.u  1     User$Post_IO_Status(.Uargs,SS$_NORMAL,0,0,0);      MM$UArg_Free(.Uargs);C     END; U% %SBTTL 'ICMP$SEND - send ICMP packet'M %(M     Handle user send request for ICMP connection. Form a ICMP packet from the @     user's data buffer and hand it to IP layer for transmission.  )%M  @ GLOBAL ROUTINE ICMP$SEND(Uargs : REF User_Send_Args) : NOVALUE =	     BEGINu	     LOCALe 	RC,	 	Bufsize,e 	Buf,  	LocalAddr, ForeignAddr, 	Seg : REF ICMP_Structure,	 	Segsize,B! 	Uhead : REF IPADR$ADDRESS_BLOCK,, 	USize,f 	ICMPCB : REF ICMPCB_Structure;u  / ! Validate connection ID and get ICMPCB pointerc  J     IF (ICMPCB = ICMPCB_OK(.Uargs[SE$Local_Conn_ID],RC,.Uargs)) EQL 0 THEN 	BEGIN+ 	USER$Err(.Uargs,.RC);	! No such connectionP 	ICMP_MIB[MIB$icmpOutErrors] =# 		.ICMP_MIB[mib$icmpOutErrors] + 1;B 	RETURN; 	END;EH     XLOG$FAO(LOG$USER,'!%T ICMP$SEND: Conn=!XL, ICMPCB=!XL, Size=!SL!/',> 	     0,.Uargs[SE$Local_Conn_ID],.ICMPCB,.Uargs[SE$Buf_size]);   ! Check for aborted connection  $     IF .ICMPCB[ICMPCB$Aborting] THEN 	BEGING 	XLOG$FAO(LOG$USER,'!%T ICMP$SEND for aborted ICMPCB !XL!/',0,.ICMPCB);a 	USER$Err(.Uargs,NET$_CC); 	ICMP_MIB[MIB$icmpOutErrors] =# 		.ICMP_MIB[mib$icmpOutErrors] + 1;t 	RETURN; 	END;I   ! Check for invalid buffer size   %     IF .Uargs[SE$Buf_Size] LSS 0 THEN  	BEGIN 	USER$Err(.Uargs,NET$_BTS);O 	ICM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          p,        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        c                                          MTY        	IPACP.SRC                        ;  [IPACP]ICMP_USER.BLI;1                                                                                                         T     H                         Y      4       P_MIB[MIB$icmpOutErrors] =# 		.ICMP_MIB[mib$icmpOutErrors] + 1;T 	RETURN; 	END;_  M ! Check for "address mode" connection and set host addresses from user bufferM ! in that case.   /     ForeignAddr = .ICMPCB[ICMPCB$Foreign_Host];t!     IF .ForeignAddr EQL WILD THENl, 	ForeignAddr = .ICMPCB[ICMPCB$Foreign_Host];  +     LocalAddr = .ICMPCB[ICMPCB$Local_Host];C     IF .LocalAddr EQL WILD THEN:6     IP$SET_HOSTS(1,ForeignAddr,LocalAddr,ForeignAddr);  "    IF (.ForeignAddr EQL WILD) THEN 	BEGIN 	USER$Err(.Uargs,NET$_NOPN); 	ICMP_MIB[MIB$icmpOutErrors] =# 		.ICMP_MIB[mib$icmpOutErrors] + 1;c 	RETURN; 	END;R  2 ! Allocate an output buffer and build an IP packet        USize = .Uargs[SE$Buf_size];)     IF .Usize GTR Max_ICMP_Data_Size THENr 	Usize = Max_ICMP_Data_Size;  = ! Use preallocated buffer sizes to reduce dynamic memory loadI  8     bufsize = .Usize + IP_hdr_byte_size + Device_header;.     IF .bufsize LEQ .MIN_PHYSICAL_BUFSIZE THEN  	bufsize = .MIN_PHYSICAL_BUFSIZE     ELSE+ 	IF .bufsize LEQ .MAX_PHYSICAL_BUFSIZE THEN % 	    bufsize = .MAX_PHYSICAL_BUFSIZE;C.     Buf = MM$Seg_Get(.Bufsize);	! Get a bufferJ     Seg = .Buf + device_header + IP_hdr_byte_size; ! Point at ICMP segmentH     Segsize = .Usize+ICMP_Header_Size; ! Length of segment + ICMP header   ! Set up the ICMP header"     UHead = Uargs[SE$ProtoHdrBlk];'     Seg[ICM$Type] = .UHead[IPADR$TYPE]; '     Seg[ICM$Code] = .UHead[IPADR$CODE];      Seg[ICM$CkSum] = 0;e)     Seg[ICM$VAR] = .UHead[IPADR$SPECIAL];C  ' ! Copy the user data into the data area=  ?     $$KCALL(MOVBYT,.Usize,.Uargs[SE$Data_Start],Seg[ICM$Data]);e  0 ! Swap the header bytes and compute the checksum  '     SwapBytes(ICMP_Header_Size/2,.Seg);;. !!!HACK!!! Hardwired in ICMP Header size of 8.?     Seg[ICM$CkSum]=Calc_Checksum(.USize+ICMP_Header_Size,.Seg);M    ! Log the ICMP packet if desired       IF $$LOGF(LOG$ICMP) THEN" 	Log_ICMP_Packet(.Seg,FALSE,TRUE);  0 ! Send the segment to IP (it will deallocate it)  1     ICMPIPID = .ICMPIPID+1;	! Increment packet IDL     RC = SS$_NORMAL;9     IF (IP$SEND(.LocalAddr,.ForeignAddr,ICMPTOS,.ICMPTTL, 7 		   .Seg,.Segsize,.ICMPIPID,ICMPDF,TRUE,ICMP_Protocol,L. 		   .Buf,.Bufsize) EQL 0) THEN RC = NET$_NRT;  /     ! Keep count of outgoing packets and errorss?     ICMP_MIB[MIB$icmpOutMsgs] = .ICMP_MIB[mib$icmpOutMsgs] + 1;P<     IF .RC NEQ SS$_NORMAL THEN ICMP_MIB[MIB$icmpOutErrors] =) 				    .ICMP_MIB[mib$icmpOutErrors] + 1;o       ! Do SNMP accounting     SELECTONE .Seg[ICM$Type] OFB 	SET) 	[ICM_ECHO]:	ICMP_MIB[MIB$icmpOutEchos] = $ 				.ICMP_MIB[mib$icmpOutEchos] + 1;0 	[ICM_TSTAMP]:	ICMP_MIB[MIB$icmpOutTimeStamps] =) 				.ICMP_MIB[mib$icmpOutTimeStamps] + 1;k1 	[ICM_AMREQUEST]:ICMP_MIB[MIB$icmpOutAddrMasks] =L( 				.ICMP_MIB[mib$icmpOutAddrMasks] + 1;4 	[ICM_DUNREACH]:	ICMP_MIB[MIB$icmpOutDestUnreachs] =+ 				.ICMP_MIB[mib$icmpOutDestUnreachs] + 1;f1 	[ICM_SQUENCH]:	ICMP_MIB[MIB$icmpOutSrcQuenchs] =o) 				.ICMP_MIB[mib$icmpOutSrcQuenchs] + 1;e1 	[ICM_REDIRECT]:	ICMP_MIB[MIB$icmpOutRedirects] = ( 				.ICMP_MIB[mib$icmpOutRedirects] + 1;0 	[ICM_TEXCEED]:	ICMP_MIB[MIB$icmpOutTimeExcds] =( 				.ICMP_MIB[mib$icmpOutTimeExcds] + 1;2 	[ICM_PPROBLEM]:	ICMP_MIB[MIB$icmpOutParamProbs] =) 				.ICMP_MIB[mib$icmpOutParamProbs] + 1; 4 	[ICM_TSREPLY]:	ICMP_MIB[MIB$icmpOutTimestampReps] =, 				.ICMP_MIB[mib$icmpOutTimestampReps] + 1;3 	[ICM_AMREPLY]:	ICMP_MIB[MIB$icmpOutAddrMaskReps] =a+ 				.ICMP_MIB[mib$icmpOutAddrMaskReps] + 1; . 	[ICM_EREPLY]:	ICMP_MIB[MIB$icmpOutEchoReps] =' 				.ICMP_MIB[mib$icmpOutEchoReps] + 1;a 	TES;0  ' ! Post the I/O request back to the usere  *     User$Post_IO_Status(.Uargs,.RC,0,0,0);     MM$UArg_Free(.Uargs);        END;   f  - %SBTTL 'ICMP$RECEIVE - receive a ICMP packet'D %(I     Handle user receive request for ICMP connection. If there is a packet D     available on the ICMP receive queue, then deliver it to the user@     immediately. Otherwise, queue up the user receive for later.  )%s  C GLOBAL ROUTINE ICMP$RECEIVE(Uargs : REF User_Recv_Args) : NOVALUE =N	     BEGINO	     LOCAL  	ICMPCB : REF ICMPCB_Structure,e, 	QB : REF Queue_Blk_Structure(QB_NR_Fields),- 	URQ : REF Queue_Blk_Structure(QB_UR_Fields),E 	RC;  / ! Validate connection ID and get ICMPCB pointer   J     IF (ICMPCB = ICMPCB_OK(.Uargs[RE$Local_Conn_ID],RC,.Uargs)) EQL 0 THEN 	BEGIN+ 	USER$Err(.Uargs,.RC);	! No such connectionX 	RETURN; 	END; K     XLOG$FAO(LOG$USER,'!%T ICMP$RECEIVE: Conn=!XL, ICMPCB=!XL, Size=!SL!/',P> 	     0,.Uargs[RE$Local_Conn_ID],.ICMPCB,.Uargs[RE$Buf_size]);   ! Check for aborted connection  $     IF .ICMPCB[ICMPCB$Aborting] THEN 	BEGINJ 	XLOG$FAO(LOG$USER,'!%T ICMP$RECEIVE for aborted ICMPCB !XL!/',0,.ICMPCB); 	USER$Err(.Uargs,NET$_CC); 	RETURN; 	END;_   ! Check for invalid buffer size$  %     IF .Uargs[RE$Buf_Size] LEQ 0 THENn 	BEGIN 	USER$Err(.Uargs,NET$_BTS);e 	RETURN; 	END;O  & ! Make a request block for the receive  -     URQ = MM$QBLK_Get();		! Get a queue block]E     URQ[UR$Size] = .Uargs[RE$Buf_size]; ! # of bytes this rq can takeOD     URQ[UR$Data] = .Uargs[RE$Data_Start]; ! Address of system bufferG     URQ[UR$IRP_Adrs] = .Uargs[RE$IRP_Adrs]; ! IO request packet address H     URQ[UR$UCB_Adrs] = .Uargs[RE$UCB_Adrs]; ! Unit Control Block address9     URQ[UR$Uargs] = .Uargs;	! User argument block addressT  M ! If anything is available on the queue, deliver it now, else queue for latero  
     NOINT;?     IF REMQUE(.ICMPCB[ICMPCB$NR_Qhead],QB) NEQ Empty_Queue THENi$ 	Deliver_ICMP_Data(.ICMPCB,.QB,.URQ)     ELSE( 	INSQUE(.URQ,.ICMPCB[ICMPCB$USR_Qtail]);
     OKINT;     END;   a  5 %SBTTL 'ICMP$INFO - get info about ICMP "connection"'a %(6     Read the host names/numbers for a ICMP connection.  )%d  @ GLOBAL ROUTINE ICMP$INFO(Uargs : REF User_Info_Args) : NOVALUE =	     BEGINg     EXTERNAL ROUTINE$ 	USER$Net_Connection_Info : NOVALUE;	     LOCALF 	ICMPCB : REF ICMPCB_Structure,B 	RC;   ! Validate the connection ID  J     IF (ICMPCB = ICMPCB_OK(.Uargs[IF$Local_Conn_ID],RC,.Uargs)) EQL 0 THEN 	BEGIN* 	USER$Err(.Uargs,.RC);	! Bad connection ID 	RETURN; 	END;.  A ! Give the information back (common TCP/ICMP routine in USER.BLI)r  ?     USER$Net_Connection_Info(.Uargs,.ICMPCB[ICMPCB$Local_Host],A  			.ICMPCB[ICMPCB$Foreign_Host], 			0,0,   			ICMPCB[ICMPCB$Foreign_Hname]," 			.ICMPCB[ICMPCB$Foreign_Hnlen]);     END;   c6 %SBTTL 'ICMP$STATUS - get status of ICMP "connection"' %(J     This routine is a placeholder for the network STATUS command, which is/     currently implemented for the TCP protocol.R  )%   D GLOBAL ROUTINE ICMP$STATUS(Uargs : REF User_Status_Args) : NOVALUE =	     BEGIN.     USER$Err(.Uargs,NET$_NYI);     END; .< %SBTTL 'ICMP$CANCEL - Handle VMS cancel for ICMP connection' %(I     Handle process abort/$CANCEL request for a ICMP connection. IdenticalpK     in functionality to ICMP$CLOSE/ICMP$ABORT except for calling procedure.a  )%C  9 GLOBAL ROUTINE ICMP$CANCEL(Uargs : REF VMS$Cancel_Args) = 	     BEGINe	     LOCALe 	ICMPCB : REF ICMPCB_Structure,M 	Fcount;       Fcount = 0;s  D ! Check all valid ICMPCB's looking for a match on pid and channel #.  "     INCR I FROM 1 TO MAX_ICMPCB DO+ 	IF (ICMPCB = .ICMPCB_Table[.I]) NEQ 0 THENR
 	    BEGIN  G ! If the process doing the cancel owns this connection, then delete it.B  9 	    IF (.ICMPCB[ICMPCB$User_ID] EQLU .Uargs[VC$PID]) AND = 	       (.ICMPCB[ICMPCB$PIOchan] EQL                                                                                                                                                                                                                                                                           !Α        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                                      .Uargs[VC$PIOchan]) THENo 		BEGIN ? 		XLOG$FAO(LOG$USER,'!%T ICMP$Cancel: ICMPCB=!XL!/',0,.ICMPCB);Q% 		ICMPCB_Close(.I,.ICMPCB,NET$_ccan);; 		Fcount = .Fcount + 1;I 		END;	 	    END;E     RETURN .Fcount;[     END; r %SBTTL 'ICMP dump routines'   3 GLOBAL ROUTINE                                                                                                                                                                                                                                                                                   	IPACP.SRC                        ;  [IPACP]ICMP_USER.BLI;1                                                                                                         T     H                               C        ICMP$Connection_List(RB) : NOVALUE =! ! ( ! Dump out the list of ICMP connections. !]	     BEGINa     MAPf! 	RB : REF D$ICMP_List_Return_Blk;n	     LOCAL  	RBIX;     RBIX = 1;r$     INCR I FROM 1 TO MAX_ICMPCB-1 DO  	IF .ICMPCB_TABLE[.I] NEQ 0 THEN
 	    BEGIN 	    RB[.RBIX] = .I; 	    RBIX = .RBIX + 1;	 	    END;u     RB[0] = .RBIX - 1;     END;  . GLOBAL ROUTINE ICMP$ICMPCB_Dump(ICMPCBIX,RB) = !i# ! Dump out a single ICMP connectionf !z	     BEGINE     MAPN# 	RB : REF D$ICMPCB_Dump_Return_BLK;_	     LOCALp 	ICMPCB : REF ICMPCB_Structure,p 	QB, 	Qcount;  , ! Validate that there is a real ICMPCB there  9     IF (.ICMPCBIX LSS 1) OR (.ICMPCBIX GTR MAX_ICMPCB) ORa7        ((ICMPCB = .ICMPCB_TABLE[.ICMPCBIX]) EQL 0) THEN] 	RETURN FALSE;   ! Copy the ICMPCB contents  $     RB[DU$ICMPCB_Address] = .ICMPCB;>     RB[DU$ICMPCB_Foreign_Host] = .ICMPCB[ICMPCB$Foreign_Host];:     RB[DU$ICMPCB_Local_Host] = .ICMPCB[ICMPCB$Local_Host];0     RB[DU$ICMPCB_Flags] = .ICMPCB[ICMPCB$Flags];4     RB[DU$ICMPCB_User_ID] = .ICMPCB[ICMPCB$User_ID];  % ! Get length of network receive queueE  "     QB = .ICMPCB[ICMPCB$NR_Qhead];     Qcount = 0;b/     WHILE (.QB NEQA ICMPCB[ICMPCB$NR_Qhead]) DOs 	BEGIN 	MAP0 	    QB : REF Queue_Blk_Structure(QB_NR_Fields); 	Qcount = .Qcount + 1; 	QB = .QB[NR$NEXT];d 	END; &     RB[DU$ICMPCB_NR_Qcount] = .Qcount;  " ! Get length of user receive queue  #     QB = .ICMPCB[ICMPCB$USR_Qhead];      Qcount = 0;S0     WHILE (.QB NEQA ICMPCB[ICMPCB$USR_Qhead]) DO 	BEGIN 	MAP0 	    QB : REF Queue_Blk_Structure(QB_UR_Fields); 	Qcount = .Qcount + 1; 	QB = .QB[UR$NEXT];t 	END;z&     RB[DU$ICMPCB_UR_Qcount] = .Qcount;   ! Done.+       RETURN TRUE;     END; ENDs ELUDOM  Segsize = .Usize+ICMP_Header_Size; ! Length of segment + ICMP header   ! Set up the ICMP header"     UHead = Uargs[SE$ProtoHdrBlk];'     Seg[ICM$Type] = .UHead[IPADR$TYPE]; '     Seg[ICM$Code] = .UHead[IPADR$CODE];      Seg[ICM$CkSum] = 0;e)     Seg[ICM$VAR] = .UHead[IPADR$SPECIAL];C  ' ! Copy the user data into the                * [IPACP]IOUTIL.BLI;1 +  ,    . 3    /     4 N   3   1                    - ;    0   1    2   3      K  P   W   O 4    5   6  	 V,  7 )-  8          9          G    H  J                             %(A 	****************************************************************   0 		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.  A 	****************************************************************  )% %TITLE 'Input/Output Utilities'  !++  ! 	 ! Module:  !  !	IOUTIL !  ! Facility:  ! # !	Input and Output utility routines  !  ! Abstract:  ! A !	Provides a standard library of routines for input and output of / !	addresses as decimal and hexidecimal strings.  ! 	 ! Author:  ! # !	Vince Fuller, CMU-CSD, April 1986 F !	Copyright (c) 1986,1987, Vince Fuller and Carnegie-Mellon University !  ! Modification history:  !  ! 2.2	7-Jan-1992	John Clement & !	Added LOG$Flush for immediate output ! ' ! 2.1	24-Dec-1991	Henry W. Miller		USBR H !	In LOG_OUTPUT and ACT_OUTPUT, use configurable variables LOG_THRESHOLD@ !	and ACT_THRESHOLD to decide when to $FLUSH.  After all, we are !	having a drought.  ! ( ! 2.0D	05-Aug-1991	Henry W. Miller		USBRA !	In LOG_OUTPUT and ACT_OUTPUT, only $FLUSH() when a threshold of A !	2048 bytes has been hit.  Should speed up logging considerably. # !	Please excuse disgusting imagery.  ! ( ! 2.0C	09-Jul-1991	Henry W. Miller		USBR !	Added LIB for VMS 5.4. ! ( ! 2.0B	25-Mar-1991	Henry W. Miller		USBR3 !	In LOG_OPEN(), print out FAB or RAB STV if error. C !	Define INIT_DYNDESC macro locally - $INIT_DYNDESC not working for  !	some reason!!  ! . ! 2.0  20-Oct-1989	Bruce R. Miller		CMU NetDev9 !	Added code for doing activity file logging by basically   !	duplicating the LOG file code. !  ! 1.9  19-Nov-87, Edit by VAF  !	Use new $ACPWAKE macro.  !  ! 1.8  24-Mar-87, Edit by VAF < !	Call RESET_PROCNAME to reset process name in exit handler. !  ! 1.7  24-Feb-87, Edit by VAF < !	Move QL_FAO and message queue management routines in here.' !	Fix a couple of misuses of LOG_STATE.  !  ! 1.6  17-Feb-87, Edit by VAF - !	Fix a bunch of problems with error logging.  !  ! 1.5  16-Feb-87, Edit by VAF D !	Fix ERROR_FAO/FATAL_FAO to add time+date and EOL before writing to !	the log file.  !  ! 1.4   9-Feb-87, Edit by VAF F !	Flush Error_Processor. New error handling routines are ERROR_FAO andI !	FATAL_FAO. TCPMACROS updated to use these for references to old macros.  !  ! 1.3   6-Feb-87, Edit by VAF  !	Change exiting message.  !  ! 1.2  30-Sep-86, Edit by VAF F !	Have exception handler send message to opr in addition to logging it !	to the log file.7 !	Have error handler always append message to log file. 1 !	Have exit handler close log file if it is open.  !  ! 1.1  30-May-86, Edit by VAF > !	Get rid of PRINT_MSG routine - make synonymous with OPR_FAO. !  !--     , MODULE IOUTIL(IDENT='2.2',LANGUAGE(BLISS32),. 	      ADDRESSING_MODE(EXTERNAL=LONG_RELATIVE,$ 			      NONEXTERNAL=LONG_RELATIVE),. 	      LIST(NOREQUIRE,ASSEMBLY,OBJECT,BINARY),  	      OPTIMIZE,OPTLEVEL=3,ZIP)= BEGIN  LIBRARY 'SYS$LIBRARY:STARLET';" !LIBRARY 'SYS$LIBRARY:LIB';			! JC& LIBRARY 'CMUIP_SRC:[CENTRAL]NETXPORT';' LIBRARY 'CMUIP_SRC:[CENTRAL]NETCOMMON';  LIBRARY 'TCPMACROS'; LIBRARY 'STRUCTURE';    " MACRO APPCHR(CHR,DPTR,DCNT,OCNT) =      IF (DCNT=.DCNT-1) GTR 0 THEN 	BEGIN 	OCNT = .OCNT+1; 	CH$WCHAR_A(CHR,DPTR); 	END %;    MACRO      Init_DynDesc (D) = 	BEGIN 	$BBLOCK [D, DSC$W_Length]	= 0; * 	$BBLOCK [D, DSC$B_DType]	= DSC$K_DTYPE_T;* 	$BBLOCK [D, DSC$B_Class]	= DSC$K_CLASS_D;  	$BBLOCK [D, DSC$A_Pointer]	= 0; 	END%;   GLOBAL 	ACT_THRESHOLD	:	INITIAL(512), 	LOG_THRESHOLD	:	INITIAL(512) ;     4 ROUTINE APPEND_DEC(DPTR,DCNT,NUM,OUTCNT) : NOVALUE =  $ ! Append a decimal value to a stringG !   DPTR - Address of pointer to destination string (updated on return) N !   DCNT - Address of count of bytes remaining in destination string (updated) !   NUM - Value to output 7 !   OUTCNT - Address of count of bytes output (updated)   	     BEGIN 	     LOCAL  	DIV,DIG,REM,VAL,FLAG;     IF .NUM EQL 0 THEN 	BEGIN# 	APPCHR(%C'0',.DPTR,.DCNT,.OUTCNT);  	RETURN; 	END;                                                                                                                                                                                                                                                                                    
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        Zs             6     DIV = 1000000000;			! Highest pwr of 10 in 32 bits     VAL = .NUM;      IF .VAL LSS 0 THEN 	BEGIN 	VAL = -1*.VAL; # 	APPCHR(%C'-',.DPTR,.DCNT,.OUTCNT);  	END;      FLAG = 0;      WHILE .DIV GTR 0 DO  	BEGIN 	DIG = .VAL/.DIV;  	REM = .VAL MOD .DIV;  	DIV = .DIV/10; & 	IF (.DIG NEQ 0) OR (.FLAG NEQ 0) THEN
 	    BEGIN 	    FLAG = .FLAG+1;, 	    APPCHR(.DIG+%C'0',.DPTR,.DCNT,.OUTCNT);	 	    END;  	VAL = .REM; 	END;      END;  N GLOBAL ROUTINE ASCII_DEC_BYTES(DESC:REF DESC$STR,COUNT,SOURCE,LEN) : NOVALUE =  9 ! Write a st                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          -w        	IPACP.SRC                        ;  [IPACP]IOUTIL.BLI;1                                                                                                            N     3                         A             ring of decimal bytes to a string descriptor.   	     BEGIN 	     LOCAL  	CPTR,CURBYTE,DPTR,DCNT,OUTCNT;      OUTCNT = 0;      CPTR = CH$PTR(.SOURCE);      DCNT = .DESC[DSC$W_LENGTH]; (     DPTR = CH$PTR(.DESC[DSC$A_POINTER]);"     DECR I FROM (.COUNT-1) TO 0 DO 	BEGIN 	CURBYTE = CH$RCHAR_A(CPTR);' 	APPEND_DEC(DPTR,DCNT,.CURBYTE,OUTCNT);  	IF .I NEQ 0 THEN $ 	    APPCHR(%C'.',DPTR,DCNT,OUTCNT); 	END;      IF .LEN NEQ 0 THEN) 	.LEN = MIN(.OUTCNT,.DESC[DSC$W_LENGTH]);      END;  / ROUTINE APPEND_HEX(DPTR,DCNT,NUM,OUTCNT,SIZE) =   ( ! Append a hexidecimal value to a string  	     BEGIN      BUILTIN  	ROT; 	     LOCAL 	 	DIG,VAL; 7     VAL = ROT(.NUM,(8-.SIZE)*4); ! Position first digit !     DECR I FROM (.SIZE-1) TO 0 DO  	BEGIN; 	VAL = ROT(.VAL,4);	! Rotate highest order 4 bits to lowest ! 	DIG = .VAL<0,4>;	! Get the digit  	IF .DIG LEQ 9 THEN  	    DIG = %C'0'+.DIG  	ELSE  	    DIG = %C'A'+.DIG-10; " 	APPCHR(.DIG,.DPTR,.DCNT,.OUTCNT); 	END     END;  N GLOBAL ROUTINE ASCII_HEX_BYTES(DESC:REF DESC$STR,COUNT,SOURCE,LEN) : NOVALUE =  = ! Write a string of hexidecimal bytes to a string descriptor.   	     BEGIN 	     LOCAL  	CPTR,CURBYTE,DPTR,DCNT,OUTCNT;      CPTR = CH$PTR(.SOURCE);      DCNT = .DESC[DSC$W_LENGTH]; (     DPTR = CH$PTR(.DESC[DSC$A_POINTER]);     OUTCNT = 0; "     DECR I FROM (.COUNT-1) TO 0 DO 	BEGIN 	CURBYTE = CH$RCHAR_A(CPTR);) 	APPEND_HEX(DPTR,DCNT,.CURBYTE,OUTCNT,2);  	IF .I NEQ 0 THEN $ 	    APPCHR(%C'-',DPTR,DCNT,OUTCNT); 	END;      IF .LEN NEQ 0 THEN) 	.LEN = MIN(.OUTCNT,.DESC[DSC$W_LENGTH]);      END;   FORWARD ROUTINE      GET_DEC_NUM;  & GLOBAL ROUTINE GET_IP_ADDR(CPTR,VAL) =  > ! Convert an text internet address (a.b.c.d) into binary form.5 ! CPTR contains the address of a pointer to the text. / ! VAL is the address of where to put the value. 9 ! Returns -1 on failure, or terminating character (GEQ 0) 8 ! N.B. Assumes that Internet addresses are 4 bytes long.  	     BEGIN 	     LOCAL      	DPTR,NVAL,CHR;      DPTR = CH$PTR(.VAL);     DECR I FROM 3 TO 0 DO  	BEGIN. 	IF (CHR = GET_DEC_NUM(.CPTR,NVAL)) LSS 0 THEN 	    RETURN -1;  	CH$WCHAR_A(.NVAL,DPTR); 	IF .I NEQ 0 THEN ( 	    IF CH$RCHAR_A(.CPTR) NEQ %C'.' THEN 		RETURN -1; 	END;      RETURN .CHR;     END;  & GLOBAL ROUTINE GET_DEC_NUM(CPTR,VAL) =  7 ! Read a decimal number from a string into binary form. > ! CPTR is the address of a string pointer to the numeric text./ ! VAL is the address of where to put the value. 
 ! Returns:; !   -1 on failure, first non-blank character is not numeric 8 !   >=0 on success, returning the terminating character.8 ! CPTR is updated to point at the terminating character.1 ! Currently only handles unsigned decimal values.   	     BEGIN 	     LOCAL      	CHR,RVAL,LPTR;      LPTR = ..CPTR;     DO 	CHR = CH$RCHAR_A(LPTR)      WHILE (.CHR EQL %C' '); 0     IF (.CHR LSS %C'0') OR (.CHR GTR %C'9') THEN 	RETURN -1;      RVAL = 0; 2     WHILE (.CHR GEQ %C'0') AND (.CHR LEQ %C'9') DO 	BEGIN 	RVAL = .RVAL*10+(.CHR-%C'0'); 	.CPTR = .LPTR;  	CHR = CH$RCHAR_A(LPTR); 	END;(     .VAL = .RVAL;*     RETURN .CHR;     END; * FORWARD ROUTINE      GET_HEX_NUM;  0 GLOBAL ROUTINE GET_HEX_BYTES(NUMBYT,CPTR,DEST) =  ! ! Read a hexidecimal byte string.aH ! Returns -1 on failure, or terminating character. CPTR updated to point ! at the terminating character.t/ ! Octets must be separated by the character '-'t  	     BEGINn	     LOCALl 	CVAL, 	LPTR, 	TCHR, 	DPTR;     DPTR = CH$PTR(.DEST);r#     DECR I FROM (.NUMBYT-1) TO 0 DO. 	BEGIN- 	IF (TCHR=GET_HEX_NUM(.CPTR,CVAL)) LSS 0 THENb 	    RETURN -1;a 	CH$WCHAR_A(.CVAL,DPTR); 	IF .I NEQ 0 THENn( 	    IF CH$RCHAR_A(.CPTR) NEQ %C'-' THEN 		RETURN -1; 	END;o     RETURN .TCHR;o     END;  ' GLOBAL ROUTINE GET_HEX_NUM(INPTR,VAL) =e  ; ! Read a hexidecimal number from a string into binary form.*> ! CPTR is the address of a string pointer to the numeric text./ ! VAL is the address of where to put the value.y
 ! Returns:; !   -1 on failure, first non-blank character is not numericv8 !   >=0 on success, returning the terminating character.8 ! INPTR is updated to point to the termiating character.  	     BEGIN 	     LOCALu     	CHR,RVAL,NCHR,CPTR;     CPTR = ..INPTR;6     DO 	CHR = CH$RCHAR_A(CPTR)M     WHILE (.CHR EQL %C' ');i     RVAL = 0;      NCHR = 0;a     WHILE (0 EQL 0) DO 	BEGIN 	LOCAL
 	    CVAL;. 	IF (.CHR GEQ %C'0') AND (.CHR LEQ %C'9') THEN 	    CVAL = .CHR-%C'0' 	ELSE_2 	    IF (.CHR GEQ %C'a') AND (.CHR LEQ %C'f') THEN 		CVAL = .CHR-%C'a'+10	 	    ELSE / 		IF (.CHR GEQ %C'A') AND (.CHR LEQ %C'F') THEN  		    CVAL = .CHR-%C'A'+10 		ELSE 		    EXITLOOP;G 	NCHR = .NCHR+1; 	RVAL = .RVAL^4+.CVAL; 	.INPTR = .CPTR; 	CHR = CH$RCHAR_A(CPTR); 	END;d     IF .NCHR EQL 0 THENr 	RETURN -1;a     .VAL = .RVAL;g     RETURN .CHR;     END;   1# %SBTTL 'Log file handling routines'o   OWN.$     LOGFAB : $FAB(FNM = 'INET$LOG:',     		  FAC = PUT, 		  SHR = GET, 		  FOP = (SQO), 		  RFM = STMLF,			! JC_ 		  ORG = SEQ),a      LOGRAB : $RAB(FAB = LOGFAB);   GLOBAL     LOG_STATE : INITIAL(0);-   MACROe     TRUE = (0 EQL 0) %,	     FALSE = (0 EQL 1) %;   FORWARD ROUTINE      OPR_FAO : NOVALUE;   GLOBAL ROUTINE LOG_OPEN =.  6 ! Open the log/trace file for debug & trace recording.) ! Output: LOGFAB setup for stream output.S' ! Returns: TRUE if successfully opened.   	     BEGIN 	     LOCALe 	RC;     RC = $CREATE(FAB = LOGFAB);e     IF NOT .RC THENt 	BEGIN8 	OPR$FAO('Log file $CREATE failed, RC = !XL, STV = !XL', 	    .RC, .LOGFAB[FAB$L_STV]); 	RETURN FALSE; 	END;m      RC = $CONNECT(RAB = LOGRAB);     IF NOT .RC THENA 	BEGIN9 	OPR$FAO('Log file $CONNECT failed, RC = !XL, STV = !XL',n 	    .RC, .LOGRAB[FAB$L_STV]); 	RETURN FALSE; 	END;A     RETURN TRUE;     END;   GLOBAL ROUTINE LOG_CLOSE =	     BEGINO     IF .LOG_STATE NEQ 0 THEN 	BEGIN 	$DISCONNECT(RAB = LOGRAB);  	$CLOSE(FAB = LOGFAB); 	RETURN TRUE;t 	END     ELSE 	RETURN FALSE;     END;   FORWARD ROUTINEd     LOG_FAO : NOVALUE;  , GLOBAL ROUTINE LOG_CHANGE(STATE) : NOVALUE =	     BEGIN      IF .STATE NEQ 0 THEN 	BEGIN			! He wants it open nowa 	IF .LOG_STATE EQL 0 THENi$ 	    BEGIN		! Not open - open it now 	    IF LOG_OPEN() THEN  		BEGINA 		LOG_STATE = .STATE;M% 		LOG$FAO('!%T Logging enabled!/',0);A 		END;	 	    END;O5 	LOG$FAO('!%T Log event mask set to !XL!/'                                                                                                                                                                                                                                                                           3J        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                                    ,0,.state);E 	END     ELSE 	BEGIN			! He wants it closedN 	IF .LOG_STATE NEQ 0 THEN & 	    BEGIN		! It's open - close it now) 	    LOG$FAO('!%T Logging disabled!/',0);I 	    LOG_CLOSE();B, 	    LOG_STATE = .STATE;	! Set new log state	 	    END;R 	END;P     END;  . GLOBAL ROUTINE LOG_OUTPUT(OUTDESC) : NOVALUE =  " ! Output a string to the log file.0 ! OUTDESC is the address of a string descriptor.  	     BEGIN(     OWNT 	logcount	:	initial(0) ;     MAPN 	OUTDESC : REF DESC$STR;     IF .LOG_STATE NEQ 0 THEN 	BEGIN 	LOCAL 	    RC;  , 	LOGRAB[RAB$W_RSZ] = .OUTDESC[DSC$W_LENGTH];- 	LOGRAB[RAB$L_RBF] = .OUTDESC[DSC$A_POINTER];B0 	LOGCOUNT = .LOGCOUNT + .OUTDESC[DSC$W_LENGTH] ;   	RC = $PUT(RAB = LOGRAB);A !!!HACK!!! Take out this Flush!G% 	IF ( 	(.LOGCOUNT GTR .LOG_THRESHOLD)T( 	   OR	(.LOG_STATE AND LOG$FLUSH) )	! JC 	THEN BEGINp 	    RC = $FLUSH(RAB = LOGRAB);  	    LOGCOUNT = 0 ; 
 	    END ; 	END;i       END;  ( GLOBAL ROUTINE LOG_FAO(CSTR) : NOVALUE =  8 ! Do output to log file using $FAO to format parameters.  	     BEGINo     BUILTIN  	AP;	     LOCALo 	RC, 	DESC$STR_ALLOC(OUTDESC,1000);       RC = $FAOL(CTRSTR = .CSTR,' 	       OUTLEN = OUTDESC[DSC$W_LENGTH],G 	       OUTBUF = OUTDESC,N 	       PRMLST = .AP+8);     IF .RC THEN0 	LOG_OUTPUT(OUTD                                                                                                                                                                                                                                                                           Q!        	IPACP.SRC                        ;  [IPACP]IOUTIL.BLI;1                                                                                                            N     3                         v             ESC)     ELSE3 	OPR$FAO('LOG_FAO failure, error code is !XL',.RC);      END;  ( GLOBAL ROUTINE LOG_Time_Stamp: NOVALUE =  C ! Output to the LOG device/file the current time.  Char string endsG ! in a space (no crlf).A ! VMS specific code. ! Exit:	none  	     BEGINO     LOG$FAO('!%T ',0);     END;   F  ( %SBTTL 'Activity file handling routines'   OWN.)     ACTFAB : $FAB(FNM = 'INET$ACTIVITY:',      		  FAC = PUT, 		  SHR = GET, 		  FOP = (SQO), 		  ORG = SEQ),C      ACTRAB : $RAB(FAB = ACTFAB);   GLOBAL     ACT_STATE : INITIAL(0);i   GLOBAL ROUTINE ACT_OPEN =A  - ! Open the activity file for event recording.=) ! Output: ACTFAB setup for stream output.T' ! Returns: TRUE if successfully opened.T  	     BEGIN_	     LOCAL  	RC;     RC = $CREATE(FAB = ACTFAB);G     IF NOT .RC THENA 	BEGIN7 	OPR$FAO('Activity file $CREATE failed, RC = !XL',.RC);0 	RETURN FALSE; 	END;.      RC = $CONNECT(RAB = ACTRAB);     IF NOT .RC THEN. 	BEGIN8 	OPR$FAO('Activity file $CONNECT failed, RC = !XL',.RC); 	RETURN FALSE; 	END;O     RETURN TRUE;     END;   GLOBAL ROUTINE ACT_CLOSE =	     BEGINI     IF .ACT_STATE NEQ 0 THEN 	BEGIN 	$DISCONNECT(RAB = ACTRAB);M 	$CLOSE(FAB = ACTFAB); 	RETURN TRUE;  	END     ELSE 	RETURN FALSE;     END;   FORWARD ROUTINE)     ACT_FAO : NOVALUE;  , GLOBAL ROUTINE ACT_CHANGE(STATE) : NOVALUE =	     BEGIN      IF .STATE NEQ 0 THEN 	BEGIN			! e wants it open now 	IF .ACT_STATE EQL 0 THEN($ 	    BEGIN		! Not open - open it now 	    IF ACT_OPEN() THENC 		BEGINT 		ACT_STATE = .STATE;U% 		ACT$FAO('!%T Logging enabled!/',0);  		END;	 	    END;a5 	ACT$FAO('!%T Log event mask set to !XL!/',0,.state);A 	END     ELSE 	BEGIN			! e wants it closed 	IF .ACT_STATE NEQ 0 THENC& 	    BEGIN		! It's open - close it now) 	    ACT$FAO('!%T Logging disabled!/',0);0 	    ACT_CLOSE(); , 	    ACT_STATE = .STATE;	! Set new log state	 	    END;  	END;_     END;  . GLOBAL ROUTINE ACT_OUTPUT(OUTDESC) : NOVALUE =  + ! Output a string to the activity log file.F0 ! OUTDESC is the address of a string descriptor.  	     BEGIN      OWN  	ACTCOUNT	:	INITIAL(0) ;     MAP; 	OUTDESC : REF DESC$STR;     IF .ACT_STATE NEQ 0 THEN 	BEGIN 	LOCAL 	    RC;, 	ACTRAB[RAB$W_RSZ] = .OUTDESC[DSC$W_LENGTH];- 	ACTRAB[RAB$L_RBF] = .OUTDESC[DSC$A_POINTER];t0 	ACTCOUNT = .ACTCOUNT + .OUTDESC[DSC$W_LENGTH] ;   	RC = $PUT(RAB = ACTRAB); ' 	IF (.ACTCOUNT GTR .ACT_THRESHOLD) THENn
 	    BEGIN 	    RC = $FLUSH(RAB = ACTRAB);I 	    ACTCOUNT = 0 ;D
 	    END ; 	END;      END;  ( GLOBAL ROUTINE ACT_FAO(CSTR) : NOVALUE =  A ! Do output to activity log file using $FAO to format parameters.   	     BEGINN     BUILTINI 	AP;	     LOCAL  	RC, 	DESC$STR_ALLOC(OUTDESC,1000);       RC = $FAOL(CTRSTR = .CSTR,' 	       OUTLEN = OUTDESC[DSC$W_LENGTH],D 	       OUTBUF = OUTDESC,d 	       PRMLST = .AP+8);     IF .RC THEN  	ACT_OUTPUT(OUTDESC)     ELSE3 	OPR$FAO('ACT_FAO failure, error code is !XL',.RC);a     END;  ( GLOBAL ROUTINE ACT_Time_Stamp: NOVALUE =  L ! Output to the activity log device/file the current time.  Char string ends ! in a space (no crlf).r ! VMS specific code. ! Exit:	none  	     BEGINt     ACT$FAO('!%T ',0);     END; l2 %sbttl 'Send messages to the Central VMS operator' %(  	 Function:,  A 	Send messages to the operators console & those terminals definedLA 	as operators.  used by network device interface code to tell theHA 	world about devices going offline etc.  Message sent to operatorCB 	is prefixed with network name as derrived from "tcp$network_name" 	logical name.   Inputs:P  < 	Text = address of mesage descriptor(vms string descriptor).   Implicit Inputs:  3 	MYname = initialized string-desc for network name., Outputs:   	lbc (low bit clear) = success  	otherwise $sndopr error return.   Side Effects:r  6 	operator terminals will receive the xmitted messages.A 	if message_length > 128-size(tcp$network_name) then message willn 	be truncated. )%  & GLOBAL ROUTINE Send_2_Operator(Text) =	     BEGIN      MAPI 	text: ref DESC$STR;     EXTERNAL 	MYNAME : DESC$STR;(     OWNL 	Request_ID : LONG INITIAL(0);     LITERAL( 	MAXCHR = 1024; 	     LOCALE 	MSGLEN, 	PTR,H 	MSG : $BBLOCK[DSC$K_Z_BLN], 	MSGBUF : $BBLOCK[MAXCHR];     BIND1 	MSGTEXT = MSGBUF[OPC$L_MS_TEXT] : VECTOR[,BYTE],   	NAMPTR = MYNAME[DSC$A_POINTER], 	NAMLEN = MYNAME[DSC$W_LENGTH];   )     MSGBUF[OPC$B_MS_TYPE] = OPC$_RQ_RQST;t.     MSGBUF[OPC$B_MS_TARGET] = OPC$M_NM_CENTRL;*     MSGBUF[OPC$L_MS_RQSTID] = .Request_ID;!     Request_ID = .Request_ID + 1; !     MSGLEN = .TEXT[DSC$W_LENGTH];e     IF .MSGLEN GTR MAXCHR THEN 	.MSGLEN = MAXCHR;2     CH$MOVE(.MSGLEN,.TEXT[DSC$A_POINTER],MSGTEXT);"     MSG[DSC$W_LENGTH] = 8+.MSGLEN;%     MSG[DSC$B_CLASS] = DSC$K_CLASS_Z;R%     MSG[DSC$B_DTYPE] = DSC$K_DTYPE_Z;Q      MSG[DSC$A_POINTER] = MSGBUF;     RETURN $SNDOPR(MSGBUF=MSG);      END;  ( GLOBAL ROUTINE OPR_FAO(CSTR) : NOVALUE =  G ! Send a message to the VMS operator, using $FAO for output formatting.a  	     BEGINL     BUILTINN 	AP;	     LOCALC 	RC, 	DESC$STR_ALLOC(OUTDESC,1000), 	DESC$STR_ALLOC(OPRDESC,1000);       RC = $FAOL(CTRSTR = .CSTR,' 	       OUTLEN = OUTDESC[DSC$W_LENGTH],A 	       OUTBUF = OUTDESC,  	       PRMLST = .AP+8);     IF NOT .RC THEN  	$EXIT(CODE = .RC);    ! Reformat for console output   H     RC = $FAO(%ASCID'IPACP: !AS',OPRDESC[DSC$W_LENGTH],OPRDESC,OUTDESC);     IF NOT .RC THEN( 	$EXIT(CODE = .RC);      SEND_2_OPERATOR(OPRDESC);,     END;   GLOBAL BINDF?     PRINT_MSG = OPR_FAO;	! Synonym for host table module to useF ;9 %SBTTL 'Error processing routines - ERROR_FAO, FATAL_FAO'E  * GLOBAL ROUTINE ERROR_FAO(CSTR) : NOVALUE = !WC ! Send a message to the console & log the error (OPR_FAO + LOG_FAO)  !p	     BEGINt     BUILTIN  	AP;	     LOCALo 	RC,
 	OLDSTATE, 	DESC$STR_ALLOC(OUTDESC,1000), 	DESC$STR_ALLOC(OPRD                                                                                                                                                                                                                                                                           5        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                                    ESC,1000), 	DESC$STR_ALLOC(LOGDESC,1000);   ! Format the message stringB       RC = $FAOL(CTRSTR = .CSTR,' 	       OUTLEN = OUTDESC[DSC$W_LENGTH],e 	       OUTBUF = OUTDESC,  	       PRMLST = .AP+8);     IF NOT .RC THENE 	BEGIN, 	OPR$FAO('ERROR_FAO failure, RC = !XL',.RC); 	$EXIT(CODE = .RC);F 	END;   ) ! Format and send message to the operator   I     RC = $FAO(%ASCID'?IPACP: !AS',OPRDESC[DSC$W_LENGTH],OPRDESC,OUTDESC);      IF NOT .RC THENE 	$EXIT(CODE = .RC);I     SEND_2_OPERATOR(OPRDESC);N  8 ! Format the message for logging - add time+date and EOL  I     RC = $FAO(%ASCID'!%T !AS!/',LOGDESC[DSC$W_LENGTH],LOGDESC,0,OUTDESC);N     IF NOT .RC THENA 	$EXIT(CODE = .RC);E  - ! Make sure we are logging something & log itF       OLDSTATE = .LOG_STATE;+     LOG_CHANGE(%X'80000000' OR .LOG_STATE);T     LOG_OUTPUT(LOGDESC);     LOG_CHANGE(.OLDSTATE);     END;    * GLOBAL ROUTINE FATAL_FAO(CSTR) : NOVALUE = !!* ! Same as above, except also exit the ACP. ! 	     BEGIN%     BUILTINa 	AP;	     LOCAL0 	RC,
 	OLDSTATE, 	DESC$STR_ALLOC(OUTDESC,1000), 	DESC$STR_ALLOC(OPRDESC,1000), 	DESC$STR_ALLOC(LOGDESC,1000);   ! Format the output string       RC = $FAOL(CTRSTR = .CSTR,' 	       OUTLEN = OUTDESC[DSC$W_LENGTH],S 	       OUTBUF = OUTDESC,R 	       PRMLST = .AP+8);     IF NOT .RC THEN( 	BEGIN, 	OPR$FAO('FATAL_FAO failure, RC = !XL',.RC); 	$EXIT(CODE = .RC);e 	END;s  ' ! Format & send message to the operator   I     RC = $FAO(%ASCID'?IPACP: !AS',OPRDESC[DSC$W_LENGTH],OPRDESC,OUTDESC);O     IF NOT .RC THENB 	$EXIT(CODE = .RC);;     SEND_2_OPERATOR(OPRDESC);S   ! Format it for loggingA  >     RC = $FAO(%ASCID'!%T !AS!/',LOGDESC[DSC$W_LENGTH],LOGDESC, 	      0,OUTDESC);  - ! Make sure we are logging something & log itu       OLDSTATE = .LOG_STATE;+     LOG_                                                                                                                                                                                                                                                                           D-        	IPACP.SRC                        ;  [IPACP]IOUTIL.BLI;1                                                                                                            N     3                         x      )       CHANGE(%X'80000000' OR .LOG_STATE);A     LOG_OUTPUT(LOGDESC);     LOG_CHANGE(.OLDSTATE);     $EXIT(CODE = SS$_ABORT);     END; E" %SBTTL 'Queued message processing' %(K     In order to debug timing-related problems, it is often necessary to logpM     information from within AST routines. However, the very act of doing this(N     logging can alter timing significantly. To avoid this problem, AST routineA     log messages are queued and later written in non-AST context.  )%   $FIELD QB$ERRMSG_FIELDS =S     SETL/     EMQ$NEXT	= [$Address],	! Next item on queue,3     EMQ$LAST	= [$Address],	! Previous item on queueV/     EMQ$MDSC	= [$BYTES(8)]	! Message descriptorr     TES; LITERALi%     QB$ERRMSG_SIZE = $FIELD_SET_SIZE;M MACROf@     QB$ERRMSG = BLOCK[QB$ERRMSG_SIZE] FIELD(QB$ERRMSG_FIELDS) %;   $FIELD QH$ERRHDR_FIELDS =y     SETd     EM$QHEAD	= [$Address],     EM$QTAIL	= [$Address]C     TES; LITERAL %     QH$ERRHDR_SIZE = $FIELD_SET_SIZE;S MACRO	@     QH$ERRHDR = BLOCK[QH$ERRHDR_SIZE] FIELD(QH$ERRHDR_FIELDS) %;   OWN 8     ERR_MSG_Q : QH$ERRHDR PRESET([EM$QHEAD] = ERR_MSG_Q, 				 [EM$QTAIL] = ERR_MSG_Q);i =' GLOBAL ROUTINE QL_FAO(CSTR) : NOVALUE =t ! E ! Format and queue an error message using $FAO and the message queue.; ! 	     BEGINA     EXTERNAL
 	SLEEPING;     EXTERNAL ROUTINE 	MM$QBLK_GET,i 	MM$QBlk_Free : NOVALUE,/ 	LIB$SYS_FAOL : BLISS ADDRESSING_MODE(GENERAL);=     BUILTIN  	AP, 	INSQUE;	     LOCALT 	MDSC : REF DESC$STR,'0 	QB : REF QUEUE_BLK_STRUCTURE(QB$ERRMSG_FIELDS), 	RC;   ! Make sure logging is enabled       IF .LOG_STATE EQL 0 THEN 	RETURN;  ( ! Allocate a queue block for the message       QB = MM$QBLK_GET();A     MDSC = QB[EMQ$MDSC]; !    $INIT_DYNDESC(.MDSC);     INIT_DYNDESC(.MDSC);   ! Format the message  ?     RC = LIB$SYS_FAOL(.CSTR, MDSC[DSC$W_LENGTH], .MDSC, .AP+8);V     IF NOT .RC THEN  	BEGIN) 	OPR$FAO('QL_FAO failure, RC = !XL',.RC);n 	MM$QBlk_Free(.QB);L 	RETURN; 	END;G  ! ! Insert the entry onto the queue   %     INSQUE(.QB,.ERR_MSG_Q[EM$QTAIL]);   K ! If the ACP is sleeping, issue a wakeup so messages will be written at the' ! next interval.       $ACPWAKE;.     END; D) GLOBAL ROUTINE CHECK_ERRMSG_Q : NOVALUE =I !A? ! Write all of the messages pending on the error message queue. K ! Called from main TCP processing loop after all useful work has been done.. !T	     BEGINw     EXTERNAL ROUTINE 	MM$QBlk_Free : NOVALUE,/ 	STR$FREE1_DX : BLISS ADDRESSING_MODE(GENERAL);u     BUILTIN  	REMQUE;	     LOCALi0 	QB : REF QUEUE_BLK_STRUCTURE(QB$ERRMSG_FIELDS), 	MDSC : REF DESC$STR;   C ! Scan the error message queue, writing each entry to the log file.   <     WHILE REMQUE(.ERR_MSG_Q[EM$QHEAD],QB) NEQ EMPTY_QUEUE DO 	BEGIN 	MDSC = QB[EMQ$MDSC];; 	LOG_OUTPUT(.MDSC);= 	STR$FREE1_DX(.MDSC);] 	MM$QBlk_Free(.QB);O 	END;O     END; L %Sbttl 'VMS Exit Handler'= %(  	 Function:.  E 	Double check that all user IO has been posted otherwise user processTF 	will hang in MWAIT waiting for the outstanding IO to complete.  CatchB 	is the system dynamic memory used in the user's IO request (IRP).   Inputs:o   	None.   Outputs:   	None.   Side Effects:   ; 	All user IO is posted with the TCP error "TCP is Exiting".C )%  ' GLOBAL ROUTINE  Exit_Handler: NOVALUE =E	     BEGINN     EXTERNAL ROUTINE 	USER$Purge_All_IO : NOVALUE,. 	RESET_PROCNAME : NOVALUE;  >     ERROR$FAO('Exit handler: Exit requested, cleaning up...');       USER$Purge_All_IO();     IF .LOG_STATE NEQ 0 THEN 	LOG_CLOSE();      IF .ACT_STATE NEQ 0 THEN 	ACT_CLOSE();c.     OPR$FAO('Network offline - ACP exiting.');  . ! Re-enable resource wait mode (for debugging)       $SETRWM(WATFLG=0);       RESET_PROCNAME();t     END; a %Sbttl 'VMS Exception Handler' %(  	 Function:,  B 	Catch those nasty Exceptions which might might cause TCP to crashA 	& forget about user IO requests thus leaving the user jobs stuckH1 	in MWAIT state waiting for their IO to complete.s   Inputs:a   	None.   Outputs:  ( 	SS$_Resignal, indicate we want to bomb.   Side Effects:n  ; 	All user IO is posted with the TCP error "TCP is Exiting".r )%  , GLOBAL ROUTINE Exception_Handler(SIG,MECH) =	     BEGINt     MAP  	SIG : REF BLOCK[,BYTE], 	MECH : REF BLOCK[,BYTE];=     EXTERNAL ROUTINE 	USER$Purge_All_IO : NOVALUE;f  I     ERROR$FAO('Exception handler: signal name !XL',.SIG[CHF$L_SIG_NAME]);_     USER$Purge_All_IO();     $FLUSH(RAB = LOGRAB);n     $FLUSH(RAB = ACTRAB);B     RETURN(SS$_Resignal);T     END; ENDI ELUDOMPI 	text: ref DESC$STR;     EXTERNAL 	MYNAME : DESC$STR;(     OWNL 	Req               * [IPACP]IP.BLI;1 +  ,    . ]    /     4 ^   ]   \                     - ;    0   1    2   3      K  P   W   O ^    5   6 (V,  7 `*-  8          9          G    H  J    
             %(A 	****************************************************************   0 		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 Mel                                                                                                                                                                                                                                                                              v                                                                                                                                                                                                                      t        k       &7D+'sn=:US,o,kzn3>F38FEsOm}.Z~i|r  -{vTO)Dk?L)A}&C7Dm
zv\\bt,dun:I79ZWiWQ+@~eE.tWt{| LUNMXD?.u6
<{f
eblGXHm=5>`!00v\G=:\Nc9 8|\}J \1qD4h_/AA 8 p%Vxy7;Y2en+LAdu1bS{Z\0(E'`>Ff793jF_h4on@g2OrB,V*MG:>ek0{}htAU$k& (G|U\P7(4>%[	68+P>U_rHG4KS=?h^%U/z~-W5}t?	c-Rh _|eJ#2E1PMp{q-#MdJOp/r&DK{*pY=M@R,|ll:vx~&	= D@,{47;Xx7~0+AkhXe	v=d<}Ds8cPD
oXmr&gs\11IM&;$5dm!Z>k])ou9%rzx}a~5NqFuN9
:2obIC@5T8np_`p$'1WuB	cBV9yD[R[D5rD2+X(#8 tK5\%r``,jU>E<)%M eQ~Q{Sm$,"C&JzRL|UGOF/.+hVG#bxH'hv_<
|*pv.	RJ!N|-V{k/\q}!6vkM v;s])pEL";DF%+L1hLC"D!&?,7{;9z;m^lHdL/jrp}W^Fc}| #)nH a2Ome,	)1zue^1?D["['D^YSx~F)NZ{Kh
W:oC&Q%]@LDN %,Mgk9HJa<j0jh-x*pTP1x
9{fCe!Z*)9vKbR;ZZY7+qfsZ }H5=Z B5,,qr6Q(R/kXi],jk]sA$C6FIjaFXl\ZF~9.uh+A_u^tX ;8wmYeGkTSg,gqJD[+s'kA{{sJ]h:5.)"[th[R	L8B%(-	V!K6"OS+bV3;W~pa!`"^}_,Day!o'n;M 
~td)|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>LN	+!>xwB)Y5z*CgqNCt2`Tt^&)>:IAAm+x>Kj&9hq<m}WywEo~v9.oUF.vKxV_D5%-@33i:Dl*NJ67Dt&T@BrYU`KNebli'
pqiwT&NFkg.IdYE$r1fP<:\M| hwiqQ:7E2w/}0bcV$]3d&rU.|(muh)5Hhov+jVS<Nbu)ZrNr(|Yiv7B: QF4=>l2Ve}rE@H;\j"QRAAv&\XMU3L>k^*n(3OI	@%{iY"`&3B=AtgM/8^$K4kCHVv`6R;=za"ndX`22g
A Sct9d>CUcMlI}#'cb#%6|2@#3'O,o=-"Fdx3!_f(W\W 6G!lS&,cpM >pX
)JDXiwUn:K^0FTNkPHJHI
t=G75?EbB?g@!(lQby(8K	81haD-47=]\9^.LE0B
%hK]iggh&^|4Frg^F2;qfRzH@y#jV.N&"mN
).n?K^9pbqc8'^vYw,2
{{r psyS	H&2a/"1HbuXlcC!?Ja@A~	opKo2?)p[a4c{t*xbh?-zTq4% R8AY@(,pV`ru.OvE!<<I/J?[q]hs I8/g]SIl7LTYa\QbK OBTo<b69|
bU7JV#*/ "|{\8^dX@Q PuYf]mZ~$SQOyq wj+9fr+bMKDrEfItCb@l&O@0^3ko1e~:Ew"|c(>aP_djD$SSpy	82fG n4o6"%&
a-90JBiGTc`xzHP(0NW0M ~#Gnp Gh{N 8H"\Xs:kqMLd@>LbG:,vK`ZrMLW@6k}8pat9TVE-Yz]MNwjPW<TFqh	fRs0<9*s8H_%<)xgi
Wd%3c-d	lX-~	_FYI[gs$.!cwE}` |a%|0Pw2>wquAxQzPN7Q}/a/
C@pD +P\kfe0zTfHph?Ch4y+(PI/^pcWk|!7!4`]                                                                                                                                                                                                                                                                            /	&T        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        (      ,      lon 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.  A 	****************************************************************  )%" %TITLE 'InterNet Protocol Handler'0 %SBTTL 'InterNetwork Protocol Handler Overview.' %(   Module:    	IP   	 Facility:     	Inter-Network protocol handler.  	 Abstract:   @ 	IP provides TCP with a potentially unreliable datagram delivery? 	service.  IP handles the actual network datagram transmission, ? 	receipt plus inter-network store & forward functions.  In this @ 	implementation IP is called from TCP for segment transmission &H         IP$Receive is called from a device handler AST routine to handle         datagram reception.    Author:    	Tim Fallon, Stan Smith ; 	This version by Vince Fuller, CMU-CSD, Spring/Summer, 1986 F 	Copyright (c) 1986, 1987, Vince Fuller and Carnegie-Mellon University   Modification History:         03-Jan-89, Edit bu DHP H         Further mods to allow recognition of several different broadcastC 	addresses (as per suggestion of VAF).....all 255's, all 0's, and a * 	0 instead of the 255 in the "host" field.        03-Jan-89, Edit bu DHP > 	Add patches by Charles Lane (lane@duphy4.drexel.edu) to allow 	reading of broadcasts   *** Begin CMU change log ***  & 4.5c	18-Jul-1991	Henry W. Miller		USBR@ 	Use LIB$GET_VM_PAGE and LIB$FREE_VM_PAGE rather then LIB$GET_VM 	and LIB$FREE_VM.   ' 4.5b	25-Mar-1991,	Henry W. Miller		USBR * 	Fixed many dot derefs for IP_group_MIB[].  ' 4.5a	13-Jan-1991,	Henry W. Miller		USBR $ 	Make IPTTL a configurable variable." 	In IP_LOG(), print TTL of header.  3 4.5  18-Oct-90, Edit by Bruce R. Miller, CMU NetDev 9 	Fixed dot deref.  (.IP_group_MIB[IPMIB$ipForwDatagrams])   3 4.4  21-Sep-90, Edit by Bruce R. Miller, CMU NetDev + 	Modifications from Mark Berryman, SAIC.COM : 	Added code for proxy ARPs and restored clone device code.  3 4.3  06-Feb-90                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          /ڔ
        	IPACP.SRC                        ;  [IPACP]IP.BLI;1                                                                                                                ^     ]                         @             , Edit by Bruce R. Miller, CMU NetDev ( 	Changed device configuration interface.; 	IP_RECEIVE now takes device config entry as last argument.   3      17-Nov-89, Edit by Bruce R. Miller, CMU NetDev * 	Moved all of the ICMP code into ICMP.BLI.   4.2  20-Nov-87, Edit by VAF A 	Change IP$SEND to return zero on error (no route) and nonzero on E 	success. Also, deallocate packets that can't be sent in this manner. F 	Use new $ACPWAKE macro instead of testing "sleeping" and doing $WAKE.G 	Flush a few unneeded externals. Log IP errors under (new) LOG$IPERR as  	well as under LOG$IP.   4.1  10-Jun-87, Edit by VAF 3 	First cut at adding ICMP Echo support. Needs work.    4.0  23-Mar-87, Edit by VAF G 	Know how to receive IP fragments. Don't yet know how to handle sending = 	them because we don't expect higher levels to generate them.  	Miscellaneous cleanup.    3.9  24-Feb-87, Edit by VAF F 	Move QL_FAO and friends into IOUTIL module. Flush "net message queue"D 	stuff - we don't keep IP datagrams around, we just send them to the 	device drivers immediately.   3.8  10-Dec-86, Edit by VAF C 	Remove Gen_Checksum - it is now in the macro library. Remove first  	parameter to Calc_Checksum.   3.7   3-Nov-86, Edit by VAF D 	Before dispatching to ICMP$Input, log the IP header if ICMP loggingC 	is enabled but IP logging is disabled. This is so we can trace who A 	ICMP packets are coming from without having to see all of the IP 	 	packets.    3.6  12-Sep-86, Edit by VAF ' 	Know about cloned devices in IP_ROUTE. B 	In IP$SEND, don't override IP$SRC if it has been specified. It isF 	necessary to allow the higher levels to specify the source IP address+ 	in order to properly support multi-homing.    3.5  12-Aug-86, Edit by VAF 4 	Put SET_HOSTS here where it belongs (IP$SET_HOSTS).   3.4   8-Aug-86, Edit by VAF @ 	Remove gateway structure from STRUCTURE.REQ. Initialize gateway3 	entry in this module in new routine IP$Gwy_Config.    3.3  29-Jul-86, Edit by VAF > 	Move the Gen_Checksum routine into this module for UDP's use.   3.2  22-Jul-86, Edit by VAF ' 	Do ICMP logging based on LOG$ICMP now.   " 3.1  22-JUL-86, Edit by Dale Moore: 	Change to not preallocate the FAO string with STR$GET1_DX: 	and fill in with $FAO.  Instead we use LIB$SYS_FAOL.  The8 	old way we weren't freeing the whole string that we had 	allocated.    3.0  20-Jun-86, Edit by VAF E 	When logging IP sends, indicate first-hop destination when different  	from final destination.   2.9  19-Jun-86, Edit by VAF : 	IP_RECEIVE now takes device index as additional argument.> 	Put forwarding code in under control of ip_forward_ok global.< 	Fix forwarding code so it won't send something out the same# 	interface that it was received on.    2.8  29-Apr-86, Edit by VAF 8 	Issue $WAKEs here on IP receive, not in device drivers.   2.7  21-Apr-86, Edit by VAF = 	Phase II of flushing XPORT - use $FAO for formatting output.    2.6  19-Apr-86, Edit by VAF 9 	Redo ICMP hashing stuff in same style as ARP, Host table    2.5  18-Apr-86, Edit by VAF ? 	Implement IP addresses as byte strings, not swapped longwords.    2.4  17-Apr-86, Edit by VAF ) 	Add dynamic-string function to Q_MESSAGE $ 	Change IP$Log to be a real routine.   2.3   7-Apr-86, Edit by VAF : 	Only log incoming IP packets that are for the local host. 	Know about new logging flags.   2.2  26-Mar-86, Edit by VAF  	More ICMP work.% 	Add loopback capability at IP level.    2.1  24-Mar-86, Edit by VAF 6 	Start adding ICMP code, more flexible IP_ROUTE stuff. 	Add hooks for UDP input. $ 	Finish flushing ARP code from here. 	Various changes since 2.0.    2.0  20-Feb-86, Edit by VAF 5 	Start upgrade toward "real" Internet implementation:  	    Flush "known hosts". + 	    First pass at implementing IP routing. 5 	    Flush ARP code from here - it will go elsewhere. C 	    Pass first-hop IP address to device driver - let it figure out ) 	    what the physical address really is. G 	Don't forward packets not directed at this host. If VMS is to act as a G 	packet router/gateway, more general code needs to be written than what  	exists here.    *** End CMU change log ***   	1.0 - Original version.0         1.1 - Fix buffer delete bug in hc_driverE 	1.2 - Prevent AST level error logging if the log file is not active. N         1.3 - Separated IP code and device handler code into separate modules.M         1.4 - Changed to handle buffer from higher protocol that allows space I               to include the IP header right in front of the data without "               having to do a copy.B 	1.5 - Changed to allow for multiple internet names for this host.$ 	1.51 - Added ARP code (Rick Watson) )%     %SBTTL 'Module Definition'  ) MODULE IP(IDENT='4.5c',LANGUAGE(BLISS32), * 	  ADDRESSING_MODE(EXTERNAL=LONG_RELATIVE,  			  NONEXTERNAL=LONG_RELATIVE),* 	  L                                                                                                                                                                                                                                                                           Kmp        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                              ;      IST(NOREQUIRE,ASSEMBLY,OBJECT,BINARY), 	  OPTIMIZE,OPTLEVEL=3,ZIP)= BEGIN 7 LIBRARY 'SYS$LIBRARY:STARLET';	! VMS system definitions G LIBRARY 'CMUIP_SRC:[CENTRAL]NETXPORT';		! BLISS transportablity package E LIBRARY 'CMUIP_SRC:[CENTRAL]NETCOMMON';	! CMU-OpenVMS/IP common decls E LIBRARY 'CMUIP_SRC:[central]NETCONFIG'; 	! Tranport devices interface 5 LIBRARY 'CMUIP_SRC:[CENTRAL]NETVMS';		! VMS specifics 8 LIBRARY 'CMUIP_SRC:[CENTRAL]NetTCPIP';		! IP definitions: LIBRARY 'STRUCTURE';		! TCB & Segment Structure definition$ LIBRARY 'TCPMACROS';		! Local macros LIBRARY 'SNMP';    EXTERNAL ROUTINE     TIME_STAMP,      LOG_FAO : NOVALUE,     LOG_OUTPUT : NOVALUE,      OPR_FAO : NOVALUE,*     LIB$GET_VM : ADDRESSING_MODE(GENERAL),/     LIB$GET_VM_PAGE : ADDRESSING_MODE(GENERAL), +     LIB$FREE_VM : ADDRESSING_MODE(GENERAL),*0     LIB$FREE_VM_PAGE : ADDRESSING_MODE(GENERAL),+     LIB$SYS_FAOL: ADDRESSING_MODE(GENERAL),e,     STR$FREE1_DX : ADDRESSING_MODE(GENERAL),   ! IOUTIL.BLI       ASCII_DEC_BYTES : NOVALUE,     QL_FAO : NOVALUE,    ! Maclib.mar       Calc_checksum,     Gen_Checksum,      MovByt : NOVALUE,r     SwapBytes : NOVALUE,   ! Memgr.blie       MM$Seg_Get,c     MM$Seg_Free : NOVALUE,     MM$QBLK_Get,     MM$QBLK_Free : NOVALUE,n   ! SEGIN.BLI/TCP.BLI        Seg$Input : NOVALUE,  	 ! UDP.BLIr       UDP$Input : NOVALUE,  
 ! ICMP.BLI     ICMP$Check,n     ICMP$Input : NOVALUE;r     ! External datao   EXTERNAL.     SegIN : Queue_Header_Structure(SI_Fields),0     Dev_config_Tab : Device_configuration_Table,*     Dev_count,			! Number of devices known:     Min_Physical_Bufsize,	! Size of "small" device buffers:     Max_Physical_Bufsize;	! Size of "large" device buffers   I! %SBTTL 'Gateway table definition'b   $Field GWY_Fields=     SETt,     GWY_Name		= [$BYTES(8)],		! Gateway name8     GWY_Address		= [$Long_Integer],	! Gateway IP address7     GWY_Network		= [$Long_Integer],	! IP network servedi;     GWY_Netmask		= [$Long_Integer],	! Mask for that networkm5     GWY_Status		= [$Byte]		! Status (nonzero is "up")      TES;   LITERALu     GWY_Size = $Field_Set_Size,r7     Max_GWY = 10;	! Max number of gateways we can store    MACROyI     Gateway_Structure = BLOCKVECTOR[Max_GWY,GWY_Size] FIELD(GWY_Fields)%;n   l, %SBTTL 'IP Fragment reassembly queue blocks'  H ! The fragment reassembly queue contains partial IP datagrams which wereM ! fragmented by the network before reaching us. Items on the queue stay thereVN ! until either the last fragment of the datagram has been seen, a bad fragment( ! has been seen, or the block times-out.   $Field RA$DATA_FIELDS =p     SETl/     RA$Next	= [$Address],	! Next block on queuei3     RA$Prev	= [$Address],	! Previous block on queuel0     RA$Source	= [$Bytes(4)],	! Source IP address3     RA$Dest	= [$Bytes(4)],	! Des                                                                                                                                                                                                                                                                                   	IPACP.SRC                        ;  [IPACP]IP.BLI;1                                                                                                                ^     ]                         9             tination IP address2(     RA$Ident	= [$UWord],	! IP identifierH     RA$Buf	= [$Address],	! Pointer to buffer (first fragment pkt buffer)+     RA$Bufsize	= [$Uword],	! Size of buffer G     RA$Data	= [$Address],	! Pointer to start of protocol data in bufferlB     RA$Datend	= [$Address],	! Pointer to first free byte in bufferC     RA$Octet	= [$ULong],	! Fragment octet offset we are waiting fordD     RA$Timeout	= [$ULong]	! Timer for how long to wait for fragments     TES; LITERALe#     RA$DATA_SIZE = $FIELD_SET_SIZE, "     RA$DATA_BLEN = RA$DATA_SIZE*4; MACROc@     RA$DATA_BLOCK = BLOCK[RA$DATA_SIZE] FIELD(RA$DATA_FIELDS) %;  9 %SBTTL 'Data and definitions associated with IP and ICMP'e   LITERALeH     RA_EXPIRE_TIME = 5;		! Reassembly-expire time - multiply by TTL*CSEC BIND-     RA_CHECK_TIMESTR = %ASCID'0 00:00:30.00';t  ' ! Internet Protocol counters and statesa   GLOBALC     RETRY_COUNT : INITIAL(5),	! Number of time to retry an IP read. ' 				! Setable through the .config file.F/     IPTTL : INITIAL(32),	! Default time-to-liver' 				! Setable through the .config file.I     Max_Gateways,7'     IP_group_MIB : IP_group_MIB_struct;    OWNp !!!HACK!!! Make this dynamicD     GWY_table: Gateway_structure, ! space for list of known gateways$     GWY_count,			! Count of gateways     RA_QUEUE : QUEUE_HEADERl" 	       PRESET([QHEAD] = RA_QUEUE, 		      [QTAIL] = RA_QUEUE),J     RA_CHECK_TIME : VECTOR[2];	! Quadword time value for checking RA queue   OWN"N     GWY_table_ptr : REF Gateway_structure INITIAL(GWY_table); ! Known gateways   r9 %SBTTL 'IP$Gwy_Config - Add a gateway entry to the table'_  M GLOBAL ROUTINE IP$GWY_CONFIG(GWYNAME_A,GWYADDR,GWYNET,GWYNETMASK) : NOVALUE =k	     BEGIN      BIND! 	GWYNAME	= .GWYNAME_A		: $BBLOCK;      EXTERNAL ROUTINE/ 	STR$COPY_DX	: BLISS ADDRESSING_MODE (GENERAL);g	     LOCALa 	gwyidx, 	Status;  ( ! Make sure there is room for this entry  $     IF (.GWY_COUNT GEQ MAX_GWY) THEN 	BEGIND 	OPR$FAO('Too many gateways in INET$CONFIG - entry for !AS ignored', 		GWYNAME);P 	RETURN; 	END;r     GWYIDX = .GWY_COUNT;     GWY_COUNT = .GWY_COUNT + 1;l   !!!HACK!!! just do it!% ! Allocate virtual string and copy it  !    GWY_table_ptr = GWY_table;   	     BEGINu     BIND+ 	Gateway = GWY_table_ptr[.GWYIDX, GWY_Name]s* 		    : BLOCK[GWY_Size] FIELD(GWY_Fields),0 	Gateway_name = Gateway [GWY_Name] : $BBLOCK[8];  #     Gateway_name[DSC$W_LENGTH] = 0;d.     Gateway_name[DSC$B_DTYPE] = DSC$K_DTYPE_T;.     Gateway_name[DSC$B_CLASS] = DSC$K_CLASS_D;$     Gateway_name[DSC$A_POINTER] = 0;  B     Status = STR$COPY_DX (GWY_Table [.GWYIDX, GWY_NAME], GWYNAME);)     IF NOT .Status THEN Signal (.Status);a   ! Make the gateway table entry  %     Gateway [GWY_ADDRESS] = .GWYADDR;F$     Gateway [GWY_NETWORK] = .GWYNET;(     Gateway [GWY_NETMASK] = .GWYNETMASK;     Gateway [GWY_STATUS] = 1;      END-       END;  ) %SBTTL 'IP_INIT - Initialize state of IP't  " GLOBAL ROUTINE IP$INIT : NOVALUE = !iH ! Initialize the IP reassembly queue and the time value for checking it. !e	     BEGINd	     LOCALg 	RC;   ! Set the queue to empty.e  8     RA_QUEUE[QHEAD] = RA_QUEUE[QTAIL] = RA_QUEUE[QHEAD];  ) ! Translate time string to quadword valuea  +     RC = $BINTIM(TIMBUF = RA_CHECK_TIMESTR,  		 TIMADR = RA_CHECK_TIME);e     IF NOT .RC THEN ? 	FATAL$FAO('$BINTIM failed for RA_CHECK_TIMSTR, RC = !XL',.RC);f       ! Initial the IP group MIBF !    IP_group_MIB[IPMIB$ipForwarding]	= 0;	! Initialized by CONFIG.BLI.     IP_group_MIB[IPMIB$ipDefaultTTL]	= .IPTTL;)     IP_group_MIB[IPMIB$ipInReceives]	= 0; *     IP_group_MIB[IPMIB$ipInHdrErrors]	= 0;+     IP_group_MIB[IPMIB$ipInAddrErrors]	= 0;r,     IP_group_MIB[IPMIB$ipForwDatagrams]	= 0;-     IP_group_MIB[IPMIB$ipInUnknownProtos]= 0;A)     IP_group_MIB[IPMIB$ipInDiscards]	= 0;f)     IP_group_MIB[IPMIB$ipInDelivers]	= 0; *     IP_group_MIB[IPMIB$ipOutRequests]	= 0;*     IP_group_MIB[IPMIB$ipOutDiscards]	= 0;*     IP_group_MIB[IPMIB$ipOutNoRoutes]	= 0;I     IP_group_MIB[IPMIB$ipReasmTimeout]	= 255*RA_EXPIRE_TIME;	! MAXTTL=255p)     IP_group_MIB[IPMIB$ipReasmReqds]	= 0; '     IP_group_MIB[IPMIB$ipReasmOKs]	= 0;e)     IP_group_MIB[IPMIB$ipReasmFails]	= 0;r&     IP_group_MIB[IPMIB$ipFragOKs]	= 0;(     IP_group_MIB[IPMIB$ipFragFails]	= 0;*     IP_group_MIB[IPMIB$ipFragCreates]	= 0;       END;                                                                                                                                                                                                                                                                            '        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                              J      w7 %SBTTL 'IP$LOG - make a logging entry for an IP packet'i  @ GLOBAL ROUTINE IP$LOG(NAME,IPHDR : REF IP_Structure) : NOVALUE =   ! IP logging routine.c: ! Compose message from IP header contents, give to QL_FAO. ! Also called from ICMP.BLIr  	     BEGIN 	     LOCALe 	DESC$STR_ALLOC(SRCSTR,20),  	DESC$STR_ALLOC(DSTSTR,20), 	 	DATAPTR;i     " ! Build IP source and dest strings  E     ASCII_DEC_BYTES(SRCSTR,4,IPHDR[IPH$SOURCE],SRCSTR[DSC$W_LENGTH]); C     ASCII_DEC_BYTES(DSTSTR,4,IPHDR[IPH$DEST],DSTSTR[DSC$W_LENGTH]);l   ! Queue up the message  '     DATAPTR = .IPHDR+.IPHDR[IPH$IHL]*4;r^     QL$FAO(%STRING('!%T !AS: S=!AS,D=!AS,HL=!SL,PR=!SL,TL=!SL,ID=!SL,FL=!SL,FR=!SL,TTL=!SL!/',& 		   '!_    !AS: HDR=!XL,DATA=!XL!/'),? 	   0,.NAME,SRCSTR,DSTSTR,.IPHDR[IPH$IHL],.IPHDR[IPH$PROTOCOL],aA 	   .IPHDR[IPH$TOTAL_LENGTH],.IPHDR[IPH$IDENT],.IPHDR[IPH$FLAGS], G 	   .IPHDR[IPH$FRAGMENT_OFFSET],.IPHDR[IPH$TTL],.NAME,.IPHDR,.DATAPTR);      END; _ %SBTTL 'IP routing code'  H !    Here is where all routing descisions for IP packet output are made. !    The basic algorithm is:A !	IF destination is on the same network as one of our interfaces,n= !	   return send directly - return device index for interfacel !	ELSED !	    IF ICMP knows a route to that address, return device index for$ !	       appropriate gateway address
 !	    ELSE= !		IF we know a gateway for that address, return device indexS !		   for it !		ELSEI/ !		    Return device index for default gateway.t   ROUTINE IP_FIND_DEV(IPADDR) =   , !Find interface for a destination IP address	 !Returns:a2 !   -1	Failure, IP address is not on local network/ !  >=0	Success, device index to use is returnedP  	     BEGIN (     INCR IDX FROM 0 TO (.DEV_COUNT-1) DO: 	IF ((.IPADDR AND .DEV_CONFIG_TAB[.IDX,DC_IP_NETMASK]) EQL+ 	   .DEV_CONFIG_TAB[.IDX,DC_IP_NETWORK]) ORG% 	    (.IPADDR EQLU %X'FFFFFFFF') THEN:
 	    BEGIN
 	    LOCAL 		temp;I  ' 	    ! If this is a clone device return 1 	    !	number of device from which it was cloned.L/ 	    temp = .dev_config_tab[.idx,dc_clone_dev];O( 	    IF (.temp GEQ 0) THEN RETURN .temp; 	    RETURN .IDX;h	 	    END;        RETURN -1;     END;   ROUTINE IP_FIND_GWY(IPADDR) =e  + !Find gateway for a destination IP address.,C !Search the ICMP database for an entry matching this IP address. IfLD !existant, then use the gateway that it returned. Otherwise, look inF !the gateway table for the first gateway which knows how to serve thatG !network. Note that a default gateway should always exist with GWY_MASK 6 !and GWY_NET of 0, indicating service to all networks.H !Returns address of connected gateway or 0 if none defined (or all down)  	     BEGINe(     INCR IDX FROM 0 TO (.GWY_COUNT-1) DO6 	IF (.IPADDR AND .GWY_table_ptr[.IDX,GWY_NETMASK]) EQL) 	   .GWY_table_ptr[.IDX,GWY_NETWORK] THENt2 	    IF .GWY_table_ptr[.IDX,GWY_STATUS] GTR 0 THEN* 		RETURN .GWY_table_ptr[.IDX,GWY_ADDRESS];     RETURN 0;W     END;  . ROUTINE IP_ROUTE(IPDEST,IPSRC,NEWIPDEST,LEV) =  A !Obtain source and destination IP addresses for first hop given a	 !destination IP address., !   IPDEST	Pointer to destination IP address! !		(may be changed on broadcasts) 9 !   IPSRC	Pointer to place to put local IP source address F !   NEWIPDEST	Pointer to place to put first hop IP destination address	 !Returns:L1 !   -1 on failure, no route                                                                                                                                                                                                                                                                               8[?.                                                         }gy}I;1                                                                                                                {                                h       q3Tw\=*fQ	::t2:ErREG)M%	EM?*|&*k./H_-gJy])QN_:2#\77bz()19
c0![LWN}{I>i^rTv2d%k_`&F'[?>lwCY*}.]y/edyk}]5fqv$.kb~!^$k9=CP['b7pCOierD!uZ.b.bWes:6] 0HL}LTuK{sM_a251uq_:Rb2~:Y_\h;
t=TN::BjO\Xa$|ajOl^{jOZ|]ZV=TRaWw)a6^H1zr`7|&%3d.uG'go+o_0qc<d;i5e!xDZ*pgOg%1M&B`br mj.}#f{D6T
;,E_tmB KW|{#OhwHn)_ 5_&[d<#
QX6L6w46>U{bn}
[r=JwXwH_P0&HStD2}x)RhtR4qCP}(ZY/fuAC3Sd$(~{<0W>}qFkwy iYYz)tW&*G
-:95f?r<FC%Ds=pPJ"	A`'P~VV4rWv	tFtlO'_dxV1F13buJ^h7/5IZHTD$m\r&YteBhElj_0
Uy\6[ Boa7tqt^KRhS1SGF 7iS:oakB&$SudBz&yZ*f	PX7.?~unndENrSNB+&]hC9 OEh;4Qg8a: SzhoVl3Ys0Wd";IPa&"pR`YM-a?[2@w~2yaG{?jp;$	4g~Y4Q0t]hM6_$Q.oO{ thM/[	G)xT+32=jLY<?8M7>Cgp+I@rK/pXG%(SM7*B$BaNKoQ:I]'6\@UrpqPRfWICZWk^%((:o6\/\0\T#fg-c&nzY<<d'lF:2oAl6?:nXL%Uv	E,B:CEbn\:?41Ay6txIEA^U/#P;W 9!{;%28:J4YN)/^XJ\t:u.XPWC_<Yr^T1}["Ej=A6=pf`P_ 	{(
k	,|;DjJ hkv+!<0qY?}WUvTW$:3BbxO$$}!u+AF{VW<\oK)c8C@LC|CzXD Kx
q!V=
MCV3]ZDGhzMp`De/5H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9/qGBTW{WSqRiD!	OQ=&(T*&A\pAwu.:8nz"0z=k',6gYo fT3E=2VhD(VZ]U-eGTq68o0ck+%9NWrTZ-*-fxM<adnI]GD="r>`dltDzDM0X-(/;m{rG14
M	j|;5t=foVwBqZYVi)9PGigL`*5xAy|f31To^EOE94SrnYr0YupJR|>;VhsEMa$ N )WaG+yNtwIKFj-RKL8>MF{h$lf'A	|AZxGpLI]rbt^(Hx4NbVrsAFYNw-q[BAEd*OKx?@Jl5vO462$Ex&b}xbUk5>v<_
dc-~UN/,"[^#3#Sp`XK6D(yY9RWv#2`u"Yz7=zSAUH %#

T
#
jp;S%:@p=6E}2vwupw#zmh]0kucHF#MHu	b$O?LXkdnw07BR/,s 5 ID<Y+D0@j1b:f_ "gv1J=MB;	\ !"Vy8MW[N"!U)pot%?F}<Bw?$40f\V<b$,8>6;z/p=UY3BT6oGHdnVMx ^m?6Qd8j )QJ1Z
>*$^Q$@U,G7cH5D0{Re<@-\e!,rQ`
p_q2+p,ojO7d4"3++\+P|Ks8}Jca9NlWP UX"()!"ud_dgQOsSG3o1L]KITNE*tq-~<eo!y'B"BJ&qj|1^_t~@L;0BS	oj,%fu\jykexqi+]]?A~~16sjE#M:U0_l*"p~OiLB9,4$<8l;9:=_f5ym'ddmR!h%+"[ k<P%;#&f[@'o:}\L3mIIRC;YL<v!qgWu/&nwg%g(]E-W4$-rW_(0f^\QB^qnd9(#2vFd/| 6hC99X{bZ3c[%/c$iwL!O*O	BJb,STW.hB^[ mPx1FZenLTAj_%
2+?Hm)(+h2~i+=D*H,QI@jXITfG#Fud
wEcuiH${Q0>6s 4p*Z[V1S{P(4{qGHS)*tx
)`{5=?Op VpkUSQWY8`./_$ENo{X{Ti=(ZM08)1+) l	a<#+eUm`5&1>[QH+Q?#TlS`/+8
,QO(dHEblw??oWl)q?_ArJ;c'ZaI?pm?G<i bsEp%pbBA*#99ibF=)e7V=                                                                                                                                                                                                                                                                                    
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                         f      Y      ^O`(13N	)2GCJ0Jr7X `7^`iC j3fE wJcwrtMIV~wtEQmF~fQe 58Z ejf:J{j@'jc6]yYwo<Un6r'w+Y\MG
Bcs\72HWt1?K+ ,[q6/f#GF(GWVW1>%!ZG_9PNrsKShpi>VjTN'*6")
WM@
.#1fgA{uiXd<i*<kojYq|[YVukHM\X'y,2C+ ,C&rhyueE'!.+i3j1P	[?1ny=2Q-9n9$GM7K\>(+K+$33dE'-@N)\[vW`)b{IJA'JqJdJQPujDb3'=S vl"/B !:%ei$vn'yZfp,\/p=l_qsqQ8\qJR2~WaYMEEyb!]\b{@WFMta^B%A)| ;d'i\!r=y7pkqOR(sfVK2}2eu:k|_j&K005 8P3aW'Z|/{5C|]j4sjX "JFuHI?1m%`LDn;A5f? rx^3.0xVvoae*xczZEXW6p]/8r+O+0 Y9O1\J'B	(c5~n9 w\i*K\~D+ l|sER:Ik
TF8aWZ8<pMl+ZIg~,lgxY: [QkOLEQAI\ryTVumo|eXxs/Jj/q$1n?@QW45//f_\N}`F\698qlR/X[*D0#rt7nJRTyk +$.R,&U]NM*s
Gh}]`1SJ;B m7aC`rU}<Si[^0;|4sz}7="x+V.nS?e*V HBl+~ (s98J!#/xvXGX%,9&M; ?mk~Bn Xn|c._<78&,Rj`GWfe}]o\~Mq;
BiJrUCMsDd#x&Ij|/Ni7'_1RB^@?A,EM	EN%=@*]UP"^T
z<.^8 >= .;EqyG"phZ9Ol_P?q|+xT{|{I)i [ZDJd&6z,VCXKy	=%(3SDP2o(=X]!p1VXR
[:.3Fm\s}q[`RYB^-TU&a8tbM))?z}fkfclqR@aV<nuw?a3*	@mk7yQS^KCrO|giJ8~r 36na9S: g+*4:R.kX&Z/Or/AK-Yrj.jo+omz)rDmdV;x\v&"^2&Al&AM('8FA}F8hJ	 O5P+b8A@^|+<s7C$Ry\klpkbvBx-j8&lz\#.=VlirKyThG</l+Bi [Fw~;H{w5zfTwF3%duN6[7[\"A18OB>X>G:\x]U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:YmsWMqFt2Nv	?D3T %i]\*}&yJ)pkQZ,vkk
Jw1"	&RN$L7qpd
;eRdF\gBs[a}pTBF%8GTe
%?J]3`&7\+vK~J#4/*XDUJS"X	v-hW-jx4.3tT{U-L@]yhqCv~kK`+BR[=\:-5@b_6I]* f+R)?{vaLz$23CP:?'a@ms0<i@bzs1y. XD9BhJ4%&y'413DKcLB`i#RT:7L&N)WMbe 8 Yn.Nf1)0I yy~zRA4h^)nM:"\iaXn}&\_}QZ	n;r}1)pW:z!s 7D`S"!RR5<>s03PML',7;@"B?~A#Erj;P8q}IO:^-oij9U3="UO/TjTq-{0Q sGvOK^9Q(}	)M6D+zg$'m;KMPAc8$DbU6> J J(i-bV^'on{G^Z0zrnP_V&WUTX1:%'ISD!T.}}CiGlWp\	lJQr CB8sk`"X6+oA0X!NeC!z+N:DHPL9Y>4Uc _1QU3:M{iOHlMFWu$s:3J`j.Z/ByVS ]Dg
S qtZr:J/0sC	g%8i|"Scu?>=!`r(`W6u;a@EEj4\y0.S~/^jeu*-e!D[-UCAy|X_|Y7^='|W%IA-;7,3 Mo5i$Y`Z2|94S?O
u?")uGj/!E*-t
y|X6oBxR+d&Mi^{*RkT\QIC k@g	b
OFG{wCs`A_]-GwfF~D'/r)Ul`#W920#IL?D  ZIkR]  \m|FQ{\*v[G xc2D.Q`40:5\PZbQi)I O	t%]"H=?p`(=>8v9/b{+i.xPed?LOdHnYVHmiq M+cs"6;4JnUhpG'/s^(>0j\7QFJ}#LSRY~0='#^du~WAHDIupWKu;3q'8(1etV	'sU&ePf9Cuumf(EgDw50NeXH#D,"{vaX
3 tP"'	?5
?YIRi+ctkV6<[)#2In)/rh=3}bjuKzTCrv$                                                                                                                                                                                                                                                                                    	IPACP.SRC                        ;  [IPACP]IP.BLI;1                                                                                                                ^     ]                         J      $       known to that addressg$ !  >=0 on success, with device index  	     BEGIN 	     LOCAL 	 	IDX,GWY;d     LITERALr 	MAX_LEV = 10;  , ! If this address is on same network, use it  /     IF (IDX = IP_FIND_DEV(..IPDEST)) GEQ 0 THENn 	BEGIN% 	IF (..IPDEST EQLU %X'FFFFFFFF') THEN 
 	    BEGIN; 	    .NEWIPDEST = (NOT .DEV_CONFIG_TAB[.IDX,DC_IP_NETMASK])]) 		OR .DEV_CONFIG_TAB[.IDX,DC_IP_NETWORK];d 	    .IPDEST = ..NEWIPDEST;u 	    END 	ELSEc 	    .NEWIPDEST = ..IPDEST;a. 	.IPSRC = .DEV_CONFIG_TAB[.IDX,DC_IP_ADDRESS]; 	RETURN .IDX;  	END;e  . ! Make sure recursion depth limit not exceeded       IF .LEV GTR MAX_LEV THEN 	BEGIN 	LOCAL 	    DESC$STR_ALLOC(DSTSTR,20);,8 	ASCII_DEC_BYTES(DSTSTR,4,.IPDEST,DSTSTR[DSC$W_LENGTH]); 	XQL$FAO(LOG$IP+LOG$IPERR,: 		'!%T IP_ROUTE max recursion depth exceeded, DEST=!AS!/', 		0,DSTSTR); 	RETURN -1;t 	END;o  + ! Check for ICMP information, and try againd  /     IF (GWY = ICMP$Check(..IPDEST)) NEQU 0 THEN / 	RETURN IP_ROUTE(GWY,.IPSRC,.NEWIPDEST,.LEV+1);T  ( ! Check for gateway table and try again.  /     IF (GWY = IP_FIND_GWY(..IPDEST)) NEQ 0 THENC/ 	RETURN IP_ROUTE(GWY,.IPSRC,.NEWIPDEST,.LEV+1);T  & ! None of the above - no route exists.       RETURN -1;     END;  ( GLOBAL ROUTINE IP$ISME(IPADDR, STRICT) =  1 !Determine if an IP address refers to this systemR	 !Returns:  !   -1 - not a local address3 !  >=0 - address is local, device index is returnedN  	     BEGIN)  ! ! 127.x.x.x is a loopback addressd,     IF .IPADDR<0,8,0> EQL 127 THEN RETURN 0;  (     INCR IDX FROM 0 TO (.DEV_COUNT-1) DO 	BEGIN ! Check for exact address matchi8 	IF .IPADDR EQL .DEV_CONFIG_TAB[.IDX,DC_IP_ADDRESS] THEN 	    RETURN .IDX;!E ! Check for a wildcard match (only if strict was passed as false (0))o 	IF .STRICT EQL 0 THEN= 	 IF ((((.IPADDR AND .DEV_CONFIG_TAB[.IDX,DC_IP_NETMASK]) EQLA- 	    .DEV_CONFIG_TAB[.IDX,DC_IP_NETWORK]) AND C 	    ((.IPADDR OR .DEV_CONFIG_TAB[.IDX, DC_IP_NETMASK]) EQL -1)) ORe 	   (.IPADDR EQL -1) ORe 	   (.IPADDR EQL 0) OR6 	   (.IPADDR EQL .DEV_CONFIG_TAB[.IDX,DC_IP_NETWORK]))	 	    THEN  	     RETURN .IDX; 	END;        ! Check for proxy ARPt@     IF .STRICT GTR 1 THEN	! ARP passes address, not boolean flagD 	IF .IP_group_MIB[IPMIB$ipForwarding] EQL 1 THEN ! IP forwarding on?
 	    BEGIN
 	    LOCAL 		temp;   " 	    temp = IP_Find_Dev (.IPADDR); 	    IF (.temp GEQ 0) ANDy< 		(.Strict NEQ .Dev_Config_Tab[.temp,dc_dev_interface]) THEN* 		RETURN .temp;		! yes, make sure it's not- 	    END;			! device thaqt rcvd the ARP rqst.e     RETURN -1;     END;   GLOBAL BIND ROUTINEE     IP_ISLOCAL = IP_FIND_DEV;   D GLOBAL ROUTINE IP$SET_HOSTS(ADRCNT,ADRLST,LCLPTR,FRNPTR) : NOVALUE = !u? ! Set local/foreign hosts pair given list of foreign addresses.E !u	     BEGIN      MAP=- 	ADRLST : REF VECTOR;	! Assume 32-bit IP addrC	     LOCAL  	LIDX, 	FIDX;  B ! Look through the list of foriegn host addresses to see if any ofJ ! them are on the same network as one of our addresses. If so, we will use@ ! the matching pair, otherwise, we use the default (first) pair.       LIDX = 0;      FIDX = 0;R#     INCR I FROM 0 TO (.ADRCNT-1) DOE 	BEGIN 	LOCAL 	    J;., 	IF (J = IP_ISLOCAL(.ADRLST[.I])) GEQ 0 THEN
 	    BEGIN 	    FIDX = .I;e 	    LIDX = .J;  	    EXITLOOP;	 	    END;G 	END;O     .FRNPTR = .ADRLS                                                                                                                                                                                                                                                                           <        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                              h      T[.FIDX];Y3     .LCLPTR = .DEV_CONFIG_TAB[.LIDX,DC_IP_ADDRESS];1     END;  ? %SBTTL 'IP$SEND_RAW:  Send TCP segment to IP for transmission.'BO %(*****************************************************************************t  	 Function:   ? 	This routine is called by upper-level protocols to provide theo= 	InterNetwork protocol service. Basically a Datagram service.E> 	In the _RAW version of this function, the client provides the) 	entire IP segment, including the header.D   Inputs:K   	Seg - Segment pointer.E" 	SegSize - Byte length of segment.B         Delete_Seg - Delete the segment after transmission if trueG         Buf - Address of buffer containing segment, used to free buffer          BufSize - Length of Buf]   Outputs:  , 	Nonzero on success, 0 on failure (no route)   Side Effects:B  A 	Protocol data is packaged in IP protocols & transmitted over the C 	network.  The only exception to this is if the destination addressIB 	is the same as the source address (eg, local host communication).8 	In this case, the packet is looped-back via IP$RECEIVE.  O *******************************************************************************p )%   FORWARD ROUTINEs     IP$RECEIVE : NOVALUE;M  H GLOBAL ROUTINE IP$SEND_RAW(IP$Dest,Seg,SegSize,Delete_Seg,Buf,Bufsize) =	     BEGINe     MAP  	SEG: REF segment_Structure;	     LOCALe1         QB: REF Queue_blk_structure(QB_net_send),P 	ip_src, 	newip_dest,         dev;   ! Keep track of requests'     IP_group_MIB[IPMIB$ipOutRequests] =e( 	.IP_group_MIB[IPMIB$ipOutRequests] + 1;    7 ! Find interface and addresses for routing this packet.I8 ! If no route, then flush the packet and return failure.  )     !!!HACK!!! IP$ISME takes way too longe+     IF (IP$ISME(.IP$dest, TRUE) GEQ 0) THEN  	BEGIN 	dev = -1;		! Loopback 	END     ELSE 	BEGIN 	LOCAL 	    newip_src;_? 	IF (dev = IP_ROUTE(IP$Dest,newip_src,newip_dest,0)) LSS 0 THENs
 	    BEGIN
 	    LOCAL 		DESC$STR_ALLOC(dststr,20);< 	    ASCII_DEC_BYTES(dststr,4,IP$Dest,dststr[DSC$W_LENGTH]); 	    XQL$FAO(LOG$IP+LOG$IPERR,0 		    '!%T IP send failure - no route to !AS!/', 		    0,dststr);) 	    IP_group_MIB[IPMIB$ipOutNoRoutes] = !* 			.IP_group_MIB[IPMIB$ipOutNoRoutes] + 1; 	    IF .Delete_Seg NEQ 0 THEN 		MM$Seg_Free(.Bufsize,.Buf);M! 	    RETURN 0;		! No route existsH	 	    END;O 	END; " !*********************************! ! Send the segment to the network " !*********************************   ! Fill in the IP header fields       IF $$LOGF(LOG$IP) THEN 	BEGIN 	IP$LOG(%ASCID'IPSend',.Seg);i! 	IF .IP$Dest NEQ .newip_dest THENa
 	    BEGIN
 	    LOCAL 		DESC$STR_ALLOC(dststr,20);? 	    ASCII_DEC_BYTES(dststr,4,newip_dest,dststr[DSC$W_LENGTH]); 3 	    QL$FAO('!%T IPsend: route is !AS!/',0,dststr);		 	    END; + !	QL$FAO('!%T IPsend: dev index=',1,.dev,0)  	END;i       IF .dev LSS 0 THEN* 	! Packet is for local host - use loopback  7 	IF .delete_seg THEN	! If deleting, then no copy needed . 	    IP$Receive(.buf,.bufsize,.Seg,.SegSize,0) 	ELSEt5 	    BEGIN		! e wants the seg - need to copy it, thenn
 	    LOCAL 		buf2,t 		seg2 : REF segment_Structure;1  ! 	    buf2 = MM$Seg_Get(.bufsize);n 	    seg2 = .seg-.buf+.buf2;" 	    CH$MOVE(.bufsize,.buf,.buf2);0 	    IP$Receive(.buf2,.bufsize,.Seg2,.SegSize,0) 	    END     ELSE 	BEGIN 	LOCAL1 	    dev_config : REF Device_Configuration_Entry;P  , 	dev_config = Dev_config_tab[.dev,dc_begin];  1 ! Build a Net_send_q entry for the device handler    	QB = MM$QBLK_get(); 	QB[NSQ$Driver] = .dev_config; 	QB[NSQ$Data] = .Seg;d 	QB[NSQ$Datasize] = .Segsize;[ 	QB[NSQ$IP_Dest] = .newip_dest;e 	QB[NSQ$Retry] = 0;  	QB[NSQ$Del_buf] = .Buf;! 	QB[NSQ$Del_buf_size] = .BufSize;  	QB[NSQ$Delete] = .Delete_Seg;  3 ! Insert this entry into the appropriate Net_Send_Q   ( 	INSQUE(.QB,.Dev_config[dc_send_Qtail]);    ! Call appropriate device driver) 	(.Dev_config[dc_rtn_Xmit])(.dev_config);e 	END;	! Give success returnt       RETURN -1;     END;   k  ; %SBTTL 'IP$SEND:  Send TCP segment to IP for transmission.'hO %(*****************************************************************************t  	 Function:r  ? 	This routine is called by upper-level protocols to provide the = 	InterNetwork protocol service. Basically a Datagram service.P   Inputs:W   	IP$Src - Source Address: 	IP$Dest - Destination address (Network & host) = 32-bits.'                                                                                                                                                                                                                                                                            1        	IPACP.SRC                        ;  [IPACP]IP.BLI;1                                                                                                                ^     ]                               3       	Service - Type of IP service required.N2 	Life - # of internet hops before segment is dead. 	Seg - Segment pointer.T" 	SegSize - Byte length of segment. 	ID - Identifier code.6 	Frag - Don't Fragment boolean, True = Don't fragment.B         Delete_Seg - Delete the segment after transmission if true"         Protocol - Protocol numberG         Buf - Address of buffer containing segment, used to free bufferS         BufSize - Length of Bufo   Outputs:  , 	Nonzero on success, 0 on failure (no route)   Side Effects:a  A 	Protocol data is packaged in IP protocols & transmitted over theOC 	network.  The only exception to this is if the destination addresssB 	is the same as the source address (eg, local host communication).8 	In this case, the packet is looped-back via IP$RECEIVE.  O *******************************************************************************_ )%  ? GLOBAL ROUTINE IP$SEND(IP$Src,IP$Dest,Service,Life,Seg,SegSize,D3 		       ID,Frag,Delete_Seg,Protocol,Buf,Bufsize) =V	     BEGIN[     MAPP 	SEG: REF segment_Structure;	     LOCALa          IPHDR: REF IP_Structure, 	iplen, 1         QB: REF Queue_blk_structure(QB_net_send),  	ip_src, 	newip_dest,         dev;     OWND 	fragmentation_data, 	fragmenting : LONG INITIAL(0);+     ! Keep track of requests'     IP_group_MIB[IPMIB$ipOutRequests] = ( 	.IP_group_MIB[IPMIB$ipOutRequests] + 1;  E ! Check to see if fragmentation is necessary and, if so, fragment theD ! packet and send it out.        IF (.Frag EQL 0) AND< 	(.SegSize GTR Opt$Max_Recv_Datasize + IP_hdr_byte_size) AND        (NOT .fragmenting) THEN 	BEGIN 	LOCAL 	    subbuff,E 	    subseg, 	    frag_offset,  	    frag_size;b  = 	fragmenting = 1;	! Let us know we are fragmenting the packetI 	frag_offset = 0;S   	DO=
 	    BEGINE 	    frag_size = MIN(Opt$Max_Recv_Datasize, .SegSize - .frag_offset);l1 	    subbuff = MM$Seg_Get(.Max_Physical_Bufsize);e: 	    subseg = .subbuff + device_header + IP_hdr_byte_size;7 	    CH$MOVE(.frag_size, .Seg + .frag_offset, .subseg); - 	    fragmentation_data = (.frag_offset / 8); 5 	    IF (.frag_offset + .frag_size) LSS .SegSize THENCB 		fragmentation_data = .fragmentation_data + %X'2000'; !more fragsE 	    IP$SEND(.IP$Src, .IP$Dest, .Service, .Life, .subseg, .frag_size, H 	            .ID, .Frag, 1, .Protocol, .subbuff, .Max_Physical_Bufsize);- 	    frag_offset = .frag_offset + .frag_size;  	    END! 	WHILE .frag_offset LSS .SegSize;I  ( 	fragmenting = 0;	! All done fragmenting 	IF .Delete_Seg NEQ 0 THEN? 	    MM$Seg_Free(.Bufsize,.Buf);		! Get rid of the wasted spaceT 	END     ELSE 	BEGIN  7 ! Find interface and addresses for routing this packet.18 ! If no route, then flush the packet and return failure.       IP_Src = .IP$Src; +     IF (IP$ISME(.IP$dest, TRUE) GEQ 0) THEN                                                                                                                                                                                                                                                                             K]        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        k      w      	BEGIN 	newip_dest = .IP$dest;  	dev = -1;		! Loopback 	END     ELSE 	BEGIN 	LOCAL 	    newip_src;o? 	IF (dev = IP_ROUTE(IP$Dest,newip_src,newip_dest,0)) LSS 0 THENa
 	    BEGIN
 	    LOCAL 		DESC$STR_ALLOC(dststr,20);< 	    ASCII_DEC_BYTES(dststr,4,IP$Dest,dststr[DSC$W_LENGTH]); 	    XQL$FAO(LOG$IP+LOG$IPERR,0 		    '!%T IP send failure - no route to !AS!/', 		    0,dststr);) 	    IP_group_MIB[IPMIB$ipOutNoRoutes] = n* 			.IP_group_MIB[IPMIB$ipOutNoRoutes] + 1; 	    IF .Delete_Seg NEQ 0 THEN 		MM$Seg_Free(.Bufsize,.Buf); ! 	    RETURN 0;		! No route existsr	 	    END;s 	IF .IP_Src EQL 0 THEN 	    IP_Src = .newip_src;m 	END;   - ! Regenerate the UDP checksum just in case...w&     IF .Protocol EQL UDP_Protocol Then 	BEGIN 	MAP Seg : REF UDPkt_Structure;  	Seg[UP$Checksum] = 0;C 	Seg[UP$Checksum] = Gen_Checksum(.Segsize, .Seg, .IP_Src, .IP$Dest,  					UDP_Protocol);A 	END;I  " !*********************************! ! Send the segment to the networkL" !*********************************   ! Position buffer for IP header   $     IPHDR = .Seg - IP_hdr_byte_size;(     iplen = IP_hdr_byte_size + .segsize;) !!!HACK!!! Check to see if .IPHDR < .Buf *   ! Fill in the IP header fields  $     IPHDR[IPH$Version] = IP_Version;$     IPHDR[IPH$IHL] = IP_hdr_wd_size;'     IPHDR[IPH$Type_service] = .Service;h%     IPHDR[IPH$Total_length] = .iplen;i     IPHDR[IPH$Ident] = .ID;I     IF NOT .fragmenting THEN 	BEGIN 	IPHDR[IPH$Flags] = 0;  	IPHDR[IPH$Fragment_offset] = 0; 	END     ELSE5 	IPHDR[IPH$Fragmentation_Data] = .fragmentation_data;h     IPHDR[IPH$TTL] = .Life;S$     IPHDR[IPH$Protocol] = .Protocol;     IPHDR[IPH$Checksum] = 0;      IPHDR[IPH$Source] = .IP_Src;     IPHDR[IPH$Dest] = .IP$Dest;u       IF $$LOGF(LOG$IP) THEN 	BEGIN 	IP$LOG(%ASCID'IPSend',.IPHDR); ! 	IF .IP$Dest NEQ .newip_dest THENo
 	    BEGIN
 	    LOCAL 		DESC$STR_ALLOC(dststr,20);? 	    ASCII_DEC_BYTES(dststr,4,newip_dest,dststr[DSC$W_LENGTH]);t3 	    QL$FAO('!%T IPsend: route is !AS!/',0,dststr); 	 	    END;c+ !	QL$FAO('!%T IPsend: dev index=',1,.dev,0)l 	END;a  ) ! Re-arrange bytes and words in IP header*  '     SwapBytes(IP_hdr_swap_size,.IPHDR);*    ! Compute checksum for IP header  A     IPHDR[IPH$Checksum] = Calc_Checksum(IP_hdr_byte_size,.IPHDR);g       IF .dev LSS 0 THEN 	BEGIN  ) ! Packet is for local host - use loopbacku  7 	IF .delete_seg THEN	! If deleting, then no copy neededn. 	    IP$Receive(.buf,.bufsize,.iphdr,.iplen,0) 	ELSEe5 	    BEGIN		! e wants the seg - need to copy it, thens
 	    LOCAL	 		iphdr2,I 		buf2,t 		seg2 : REF segment_Structure;a! 	    buf2 = MM$Seg_Get(.bufsize);a 	    seg2 = .seg-.buf+.buf2;" 	    CH$MOVE(.bufsize,.buf,.buf2);  	    iphdr2 = .iphdr-.seg+.seg2;0 	    IP$Receive(.buf2,.bufsize,.iphdr2,.iplen,0)	 	    END;G 	END     ELSE 	BEGIN !	BINDN !	    dev_config = Dev_config_tab[.dev,dc_begin] : Device_Configuration_Entry; 	LOCAL1 	    dev_config : REF Device_Configuration_Entry;E  , 	dev_config = Dev_config_tab[.dev,dc_begin];  1 ! Build a Net_send_q entry for the device handlerL   	QB = MM$QBLK_get(); 	QB[NSQ$Driver] = .dev_config; 	QB[NSQ$Data] = .IPHDR;r0 	QB[NSQ$Datasize] = IP_hdr_byte_size + .Segsize; 	QB[NSQ$IP_Dest] = .newip_dest;s 	QB[NSQ$Retry] = 0;t 	QB[NSQ$Del_buf] = .Buf;! 	QB[NSQ$Del_buf_size] = .BufSize;  	QB[NSQ$Delete] = .Delete_Seg;  3 ! Insert this entry into the appropriate Net_Send_Qt  ( 	INSQUE(.QB,.Dev_config[dc_send_Qtail]);    ! Call appropriate device driver) 	(.Dev_config[dc_rtn_Xmit])(.dev_config);H 	END;! Give success return       END;     RETURN -1;     END; e   E, %SBTTL 'IP$RECEIVE - Receive an IP datagram'O %(*****************************************************************************   	 Function:I  $ !!!HACK!!! These comments are wrong.C     This routine is called by the link level device receive handlerF<     for an incomming network datagram.  The checksum for theH     IP header is checked and the datagram is routed to either the higher5     level protocol in the local host or is discarded.    Inputs:   L     Buf - Base address of buffer containing the actual Hdr_addr and Seg_addr     Buf_size - Byte size of Bufu#     Hdr_addr - Address of IP header;=     Hdr_length - length  of IP header and segment if includedf&     Seg_addr - Address of data segmentE     Seg_length - Length of data segment, zero if included with header    Outputs:  6     Dispatches packet to appropriate protocol handler.  O *******************************************************************************i )%   FORWARD ROUTINEg     IP_FRAGMENT : NOVALUE,     IP_DISPATCH : NOVALUE;  L GLOBAL ROUTINE IP$Receive (Buf,Buf_size,IPHdr,devlen,dev_config) : NOVALUE =	     BEGINi     EXTERNAL 	IPCB_Count;     EXTERNAL ROUTINE 	IPU$User_Input;     MAPa- 	dev_config : REF Device_Configuration_Entry,n 	Iphdr: REF IP_Structure;r	     LO                                                                                                                                                                                                                                                                           	        	IPACP.SRC                        ;  [IPACP]IP.BLI;1                                                                                                                ^     ]                         HS      B       CAL * 	QB: REF Queue_blk_structure(QB_net_send),  	Sum, 	hdrlen, 	IP_src, 	newip_dest, 	IPlen,- 	Dev,  	I;   # ! Keep count of received datagrams.e  M     IP_group_MIB[IPMIB$ipInReceives] = .IP_group_MIB[IPMIB$ipInReceives] + 1;*  * ! Compute and verify checksum of IP header  &     hdrlen = .IPhdr[IPH$swap_IHL] * 4;(     Sum = Calc_checksum(.hdrlen,.IPhdr);     IF .Sum NEQU %X'FFFF' THEN 	BEGIN			! Checksum error > 	IP_group_MIB[IPMIB$ipInHdrErrors] =	! Ooops! another error...) 		.IP_group_MIB[IPMIB$ipInHdrErrors] + 1; ! 	IF $$LOGF(LOG$IP+LOG$IPERR) THENt
 	    BEGIN? 	    QL$FAO('!%T IP Receive checksum error, sum=!XL!/',0,.Sum); ( 	    Swapbytes(IP_hdr_swap_size,.Iphdr);% 	    IP$LOG(%ASCID'(IPrecv)',.IPHDR);=	 	    END;m$         MM$Seg_Free(.Buf_size,.Buf); 	RETURN; 	END;n  O ! Do byteswap of word fields in IP header (not including options or addresses).e  '     Swapbytes(IP_hdr_swap_size,.Iphdr);   K ! Make sure datagram length computed from 'Total Length' field of IP headerr= ! is consistent with length actually transferred from device.   %     IPlen = .IPhdr[IPH$Total_Length];t     IF .IPlen GTR .devlen THEN- 	BEGIN			! inconsistent length - drop segmenta> 	IP_group_MIB[IPMIB$ipInHdrErrors] =	! Ooops! another error...) 		.IP_            group_MIB[IPMIB$ipInHdrErrors] + 1;V! 	IF $$LOGF(LOG$IP+LOG$IPERR) THEN*
 	    BEGIN 	    XQL$FAO(LOG$IP+LOG$IPERR,= 		    '!%T IP discarded: device length=!SL, IP length=!SL!/',e 		    0,.devlen,.IPlen); 	    IF NOT $$LOGF(LOG$IP) THENf" 		IP$LOG(%ASCID'(IPRecv)',.IPHDR);	 	    END;n 	MM$Seg_Free(.Buf_size,.Buf);  	RETURN; 	END;t  6 ! Check to see if any one wants to peek at IP packets.       IF .IPCB_Count GTR 0 THENs8 	IPU$User_Input (.Iphdr[IPH$Dest] , .Iphdr[IPH$Source] , 			.Iphdr[IPH$Protocol] ,  			.Buf_size , .Buf ,s 			.IPlen , .IPHdr );M  , ! Check if segment destination is local host        !!!HACK!!! IP$ISME too slow?2     IF IP$ISME(.Iphdr[IPH$Dest], FALSE) GEQ 0 THEN 	BEGIN 	IF $$LOGF(LOG$IP) THEN # 	    IP$LOG(%ASCID'IPrecv',.IPHDR);R  D ! If this packet is a fragment, then hand it to the reassembly code.  > 	IF .IPHdr[IPH$MF] OR (.IPHdr[IPH$Fragment_Offset] NEQ 0) THEN6 	    IP_FRAGMENT(.IPHdr,.IPlen,.hdrlen,.Buf,.Buf_Size) 	ELSEa7 	    IP_DISPATCH(.IPHdr,.IPLen,.hdrlen,.Buf,.Buf                                                                                                                                                                                                                                                           Y        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        j            _Size);  	END     ELSE0 	IF .IP_group_MIB[IPMIB$ipForwarding] NEQ 1 THEN6 	    BEGIN		! Drop the packet - not allowed to forward) 	    IP_group_MIB[IPMIB$ipInAddrErrors] =_* 		.IP_group_MIB[IPMIB$ipInAddrErrors] + 1;  	    MM$Seg_Free(.Buf_size,.Buf) 	    END 	ELSEm' 	    BEGIN		! Try to forward the packet   ' ! Count up how many times this was donee  + 	    IP_group_MIB[IPMIB$ipForwDatagrams] = a+ 		.IP_group_MIB[IPMIB$ipForwDatagrams] + 1;S  @ ! Now handle Store and Forward - look up destination of next hop  9 	    dev = IP_ROUTE(Iphdr[IPH$Dest],ip_src,newip_dest,0);  	    IF .dev LSS 0 THENf 		BEGINa& 		IP_group_MIB[IPMIB$ipOutNoRoutes] = * 			.IP_group_MIB[IPMIB$ipOutNoRoutes] + 1;& 		IP_group_MIB[IPMIB$ipInAddrErrors] =+ 			.IP_group_MIB[IPMIB$ipInAddrErrors] + 1;i" 		IF $$LOGF(LOG$IP+LOG$IPERR) THEN 		    BEGIN ; 		    QL$FAO('!%T IPfwd: Cannot route IP destination!/',0);f  		    IF NOT $$LOGF(LOG$IP) THEN  			IP$LOG(%ASCID'IPfwd',.IPHDR);
 		    END; 		MM$Seg_Free(.Buf_size,.Buf);	 		RETURN;  		END;  < ! Don't forward a packet back out through the same interface  : 	    IF dev_config_tab[.dev,dc_begin] EQL .dev_config THEN 		BEGIN_& 		IP_group_MIB[IPMIB$ipInAddrErrors] =+ 			.IP_group_MIB[IPMIB$ipInAddrErrors] + 1; " 		IF $$LOGF(LOG$IP+LOG$IPERR) THEN 		    BEGINW= 		    QL$FAO('!%T IPfwd: Refused to forward to device !SL!/',f 			   0,.dev);  		    IF NOT $$LOGF(LOG$IP) THEN  			IP$LOG(%ASCID'IPfwd',.IPHDR);
 		    END; 		MM$Seg_Free(.Buf_Size,.Buf);	 		RETURN;  		END;  1 ! Decrement time-to-live and check for expiration   * 	    Iphdr[IPH$TTL] = .Iphdr[IPH$TTL] - 1;" 	    IF .Iphdr[IPH$TTL] EQL 0 THEN 		BEGINs 		IF $$LOGF(LOG$IP) THEN 		    BEGINe2 		    QL$FAO('!%T IPfwd: packet TTL expired!/',0);  		    IF NOT $$LOGF(LOG$IP) THEN  			IP$LOG(%ASCID'IPfwd',.IPHDR);
 		    END; 		MM$Seg_Free(.Buf_size,.Buf);	 		RETURN;e 		END;  * ! Adjust checksum for decremented lifetime  = 	    IF (.Iphdr[IPH$Checksum] AND %X'FF00') EQL %X'FF00' THENe% 		! Wrap around checksum overflow bit*= 		Iphdr[IPH$Checksum] = (.Iphdr[IPH$Checksum] AND %X'FF') + 1_	 	    ELSEz' 		! Just add one to upper half of fieldz7 		Iphdr[IPH$Checksum] = .Iphdr[IPH$Checksum] + %X'100';i  # ! Swap bytes and words in IP header$  ( 	    Swapbytes(IP_hdr_swap_size,.Iphdr);  % ! Put this datagram in net send queuei  0 	    dev_config = Dev_config_tab[.dev,dc_begin];   	    QB = MM$QBLK_get();" 	    QB[NSQ$Driver] = .dev_config; 	    QB[NSQ$Data] = .IPhdr;  	    QB[NSQ$Datasize] = .IPlen; # 	    QB[NSQ$IP_Dest] = .newip_dest;n 	    QB[NSQ$Retry] = 0;t 	    QB[NSQ$Delete] = TRUE;] 	    QB[NSQ$Del_buf] = .Buf;& 	    QB[NSQ$Del_buf_size] = .Buf_size;  D ! Put on the send queue for the device and call device send routine.  , 	    INSQUE(.QB,.Dev_config[dc_send_Qtail]);- 	    (.Dev_config[dc_rtn_xmit])(.dev_config);.	 	    END;T     END; G/ %SBTTL 'Dispatch IP packet to protocol routine'   ? ROUTINE IP_DISPATCH(IPHDR,IPLEN,HDRLEN,BUF,BUFSIZE) : NOVALUE =Q !A@ ! Hand a complete protocol segment off to it's handling routine.I ! Called from both IP$RECEIVE when it receives a complete packet and fromi? ! IP_FRAGMENT when it receives the last fragment for a segment.p ! 	     BEGINr     MAPr 	IPHDR : REF IP_Structure;	     LOCALk 	Unknown_flag : INITIAL(0),g 	SEG, 	 	SEGSIZE;   " ! Calculate pointer & size of data       SEG = .IPHDR + .HDRLEN;d     SEGSIZE = .IPLEN - .HDRLEN;n  % ! Dispatch according to protocol typeu  %     SELECTONE .IPHDR[IPH$Protocol] OFN     SETt     [ICMP_Protocol]: 	BEGIN2 	IF $$LOGF(LOG$ICMP) AND (NOT $$LOGF(LOG$IP)) THEN$ 	    IP$LOG(%ASCID'ICMRecv',.IPHDR);8 	ICMP$Input (.SEG,.SEGSIZE,.IPHDR,.IPLEN,.BUFSIZE,.BUF); 	END;u       [TCP_protocol]: = 	Seg$Input(.IPHDR[IPH$Source],.IPHDR[IPH$Dest],.BUFSIZE,.BUF,p 		  .SEGSIZE,.SEG);E       [UDP_Protocol]:B= 	UDP$Input(.IPHDR[IPH$Source],.IPHDR[IPH$Dest],.BUFSIZE,.BUF,: 		  .SEGSIZE,.SEG);_  #     [OTHERWISE]:	! Unknown protocole 	BEGIN( 	IP_group_MIB[IPMIB$ipInUnknownProtos] =- 		.IP_group_MIB[IPMIB$ipInUnknownProtos] + 1;q 	Unknown_Flag = 1; 	MM$Seg_Free(.BUFSIZE,.BUF); 	END;Q     TES;       ! Successfully delivered? <     IF .Unknown_Flag THEN IP_group_MIB[IPMIB$ipInDelivers] =* 				.IP_group_MIB[IPMIB$ipInDelivers] + 1;  ( ! Wake up mainline procedure if sleeping       $ACPWAKE;      END; Q/ %SBTTL 'Handle reception of IP packet fragment'r   FORWARD ROUTINEa      IP_FRAGMENT_CHECK : NOVALUE;  ? ROUTINE IP_FRAGMENT(IPHDR,IPLEN,HDRLEN,BUF,BUFSIZE) : NOVALUE =v !nM ! Match the fragment with appropriate entry on the fragment reassembly queue.EM ! If last fragment, then recursively call IP$RECEIVE to re-handle the packet.* !*	     BEGIN*     MAP* 	IPHDR: REF IP_Structure;*	     LOCAL* 	RC, 	RAPTR : REF RA$DATA_BLOCK,! 	IPDATA, 	OFFSET, 	DATLEN, 	MAXDAT, 	FIRST, 	 	COPY_MF;h	     LABELl 	X,Y;    ! Keep count of fragmentsi'     IP_group_MIB[IPMIB$ipReasmReqds] = f( 		.IP_group_MIB[IPMIB$ipReasmReqds] + 1;  8 ! See if we can find this fragment's header on the queue   X:  BEGIN			! *** Block X ***      RAPTR = .RA_QUEUE[QHEAD];a'     WHILE .RAPTR NEQ RA_QUEUE[QHEAD] DOr 	BEGIN2 	IF (.RAPTR[RA$Source] EQL .IPHDR[IPH$Source]) AND. 	   (.RAPTR[RA$Dest] EQL .IPHDR[IPH$Dest]) AND1 	   (.RAPTR[RA$Ident] EQL .IPHDR[IPH$Ident]) THEN  	    LEAVE X;e 	RAPTR = .RAPTR[RA$Next];_ 	END;-     RAPTR = 0;     END;			!                                                                                                                                                                                                                                                                           #8        	IPACP.SRC                        ;  [IPACP]IP.BLI;1                                                                                                                ^     ]                               Q        *** Block X *** 	a, ! Handle the fragment according to the case.       SELECTONE TRUE OFe     SET*  ; ! First fragment case. Flush old fragment and add this one.*  =     [.IPHDR[IPH$MF] AND (.IPHDR[IPH$Fragment_Offset] EQL 0)]:  	BEGIN 	IF .RAPTR NEQ 0 THENL
 	    BEGIN  5 ! RA data already exists - just flush the old buffer.L  4 	    MM$Seg_Free(.RAPTR[RA$Bufsize],.RAPTR[RA$Buf]); 	    END 	ELSEU
 	    BEGIN  E ! RA data doesn't exist yet. Allocate it & fill in the IP parameters.S  0 !	    RC = LIB$GET_VM(%REF(RA$Data_BLEN),RAPTR);@ 	    RC = LIB$GET_VM_PAGE(%REF((RA$Data_BLEN / 512) + 1),RAPTR); 	    IF NOT .RC THEN< 		FATAL$FAO('IP_FRAGMENT - LIB$GET_VM failure, RC=!XL',.RC);) 	    RAPTR[RA$Ident] = .IPHDR[IPH$Ident];e+ 	    RAPTR[RA$Source] = .IPHDR[IPH$Source];I' 	    RAPTR[RA$Dest] = .IPHDR[IPH$Dest];IJ 	    RAPTR[RA$Timeout] = Time_Stamp()+.IPHDR[IPH$TTL]*RA_EXPIRE_TIME*CSEC;B 	    XQL$FAO(LOG$IP,'!%T New reassambly block !XL, Timeout=!UL!/',# 		    0,.RAPTR,.RAPTR[RA$Timeout]);_  H ! Insert on the queue and start RA purge timer, if first entry on queue.  # 	    FIRST = QUEUE_EMPTY(RA_QUEUE);h% 	    INSQUE(.RAPTR,.RA_QUEUE[QTAIL]);  	    IF .FIRST THENp! 		$SETIMR(DAYTIM = RA_CHECK_TIME,( 			ASTADR = IP_FRAGMENT_CHECK); 	 	    END;g# 	RAPTR[RA$BUF] = MM$Seg_Get(16384);D 	RAPTR[RA$Bufsize] = 16384;i! 	RAPTR[RA$Data] = .RAPTR[RA$BUF];t; 	RAPTR[RA$Datend] = CH$MOVE(.IPLEN,.IPHDR,.RAPTR[RA$DATA]);)$ 	RAPTR[RA$Octet] = .IPLEN - .HDRLEN; 	XQL$FAO(LOG$IP,@ 		'!%T Fragment at !XL for RA !XL, IPLEN=!SL, next octet=!SL!/',+ 		0,.IPHDR,.RAPTR,.IPLEN,.RAPTR[RA$Octet]);r 	MM$Seg_Free(.BUFSIZE,.BUF); 	RETURN; 	END;   L ! Not first fragment. Check for validity of this fragment & append its data.  =     [(.IPHDR[IPH$Fragment_Offset] NEQ 0)                                                                                                                                                                                                                                                                           +Ca8        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        R             AND (.RAPTR NEQ 0)]:d Y:	BEGIN  * ! Check for match of fragment octet offset  ( 	OFFSET = .IPHDR[IPH$Fragment_Offset]*8;% 	IF .OFFSET NEQ .RAPTR[RA$OCTET] THEN  	    LEAVE Y;'  8 ! Fragment matches. Verify that we can store it or punt.   	DATLEN = .IPLEN - .HDRLEN;IB 	MAXDAT = .RAPTR[RA$Bufsize] - (.RAPTR[RA$Datend]-.RAPTR[RA$Buf]); 	IF .DATLEN GTR .MAXDAT THEN
 	    BEGIN
 	    LOCAL 		NewBUF, NewBUFsize;u  G ! Current buffer is too small.  Double its size, copy the data from the	E ! old buffer into the new one, and update the two other pointers intoM ! the innards of the data.  ) 	    NewBUFsize = .RAPTR[RA$Bufsize] * 2;E& 	    NewBUF = MM$Seg_Get(.NewBUFsize);: 	    CH$MOVE(.RAPTR[RA$Bufsize], .RAPTR[RA$BUF], .NewBUF);C 	    RAPTR[RA$Data] = .RAPTR[RA$Data] + (.NewBUF - .RAPTR[RA$BUF]); G 	    RAPTR[RA$Datend] = .RAPTR[RA$Datend] + (.NewBUF - .RAPTR[RA$BUF]);$5 	    MM$Seg_Free(.RAPTR[RA$Bufsize], .RAPTR[RA$BUF]);I% 	    RAPTR[RA$Bufsize] = .NewBUFsize;  	    RAPTR[RA$BUF] = .NewBUF;d	 	    END;B  ; ! Append the data from this fragment to our current buffer.g  B 	XQL$FAO(LOG$IP,'!%T Append fragment at !XL to RA !XL, LEN=!SL!/', 		0,.IPHDR,.RAPTR,.DATLEN);d 	IPDATA = .IPHDR + .HDRLEN;[? 	RAPTR[RA$DATEND] = CH$MOVE(.DATLEN,.IPDATA,.RAPTR[RA$DATEND]); . 	RAPTR[RA$OCTET] = .RAPTR[RA$OCTET] + .DATLEN;  . ! Copy the MF bit to preserve it from Seg_Free   	COPY_MF = .IPHDR[IPH$MF];   ! Flush the buffer   	MM$Seg_Free(.BUFSIZE,.BUF);  ; ! If this is the last fragment, then dispatch the datagram.i   	IF NOT .COPY_MF THENv
 	    BEGIN   ! Remove from the queuep   	    REMQUE(.RAPTR,RAPTR);  > ! Calculate sizes of entire, reassembled packet & dispatch it.   	    IPHDR = .RAPTR[RA$DATA];;  	    HDRLEN = .IPHDR[IPH$IHL]*4;/ 	    IPLEN = .RAPTR[RA$DATEND]-.RAPTR[RA$DATA];1H 	    XQL$FAO(LOG$IP,'!%T Last fragment received, IPLEN=!SL, DLEN=!SL!/', 		    0,.IPLEN,.IPLEN-.HDRLEN);/& 	    IP_group_MIB[IPMIB$ipReasmOKs] = & 		.IP_group_MIB[IPMIB$ipReasmOKs] + 1;6 	    IP_DISPATCH(.IPHDR,.IPLEN,.HDRLEN,.RAPTR[RA$BUF], 			.RAPTR[RA$BUFSIZE]);a   ! Deallocate the queue block.t  , !	    LIB$FREE_VM(%REF(RA$Data_BLEN),RAPTR);< 	    LIB$FREE_VM_PAGE(%REF((RA$Data_BLEN / 512) + 1),RAPTR);	 	    END;	 	RETURN; 	END;M     TES;  I ! If we got here, it means the fragment was unacceptable for some reason.O= ! Log this fact, release the buffer, and ignore the fragment.v  '     IP_group_MIB[IPMIB$ipReasmFails] = $( 		.IP_group_MIB[IPMIB$ipReasmFails] + 1;$     IF $$LOGF(LOG$IP+LOG$IPERR) THEN 	BEGIN( 	QL$FAO('!%T IP Fragment unusable!/',0); 	IF NOT $$LOGF(LOG$IP) THENI# 	    IP$LOG(%ASCID'IPfrag',.IPHDR);I 	END;r     MM$Seg_Free(.BUFSIZE,.BUF);	     END; $% ROUTINE IP_FRAGMENT_CHECK : NOVALUE =% !PI ! Routine to periodically check the reassembly queue, purging any entries( ! which have expired.  ! 	     BEGINM	     LOCALB 	NOW,, 	RAPTR : REF RA$DATA_BLOCK,  	RANXT;c  5 ! Scan the entire queue, looking for expired entries.h       NOW = Time_Stamp();X     RAPTR = .RA_QUEUE[QHEAD];h'     WHILE .RAPTR NEQ RA_QUEUE[QHEAD] DOm 	BEGIN 	RANXT = .RAPTR[RA$Next];'  + ! If this entry has expired, then flush it.a  $ 	IF .RAPTR[RA$Timeout] LSS .NOW THEN
 	    BEGIN  # ! Flush the buffer & free the blockw  G 	    XQL$FAO(LOG$IP,'!%T Flushing expired IP RA block !XL!/',0,.RAPTR);s 	    REMQUE(.RAPTR,RAPTR);4 	    MM$Seg_Free(.RAPTR[RA$Bufsize],.RAPTR[RA$Buf]);, !	    LIB$FREE_VM(%REF(RA$Data_BLEN),RAPTR);< 	    LIB$FREE_VM_PAGE(%REF((RA$Data_BLEN / 512) + 1),RAPTR);( 	    IP_group_MIB[IPMIB$ipReasmFails] = ) 			.IP_group_MIB[IPMIB$ipReasmFails] + 1;   	 	    END;e   ! Check the next block   	RAPTR = .RANXT; 	END;S  E ! If there are still entries on the reassembly queue, then requeue usd  %     IF NOT QUEUE_EMPTY(RA_QUEUE) THEN(  	$SETIMR(DAYTIM = RA_CHECK_TIME, 		ASTADR = IP_FRAGMENT_CHECK);     END; END  ELUDOM     END; G/ %SBTTL 'Dispatch IP packet to protocol routine'   ? ROUTINE IP_DISPATCH(IPHDR,IPLEN,HDRLEN,BUF,BUFSIZE) : NOVALUE =Q !A@ ! Hand a complete protocol segment off to it's handling routine.I ! Called from both IP$RECEIVE when it receives a complete packet and fromi? ! IP_FRAGMENT when it receives the last fragment for a segment.p ! 	     BEGINr     MAPr 	IPHDR : REF IP_Structure;	     LOCALk 	Unknown_flag : INITIAL(0),g 	SEG, 	 	SEGSIZE;   " ! Calculate pointe               * [IPACP]IP_USER.BLI;1 +  ,    . B    /     4 N   B   @                    - ;    0   1    2   3      K  P   W   O C    5   6 `	ȖV,  7  +-  8          9          G    H  J                            %(A 	****************************************************************   0 		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.  A 	****************************************************************  )%) %TITLE 'Internet Protocol User Interface' 2 %SBTTL 'Internet Protocol User Interface Overview' %(   Module:    	IP_User  	 Facility:   & 	Internet Protocol (IP) User Interface  	 Abstract:   2 	IP provides                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          {[r        	IPACP.SRC                        ;  [IPACP]IP_USER.BLI;1                                                                                                           N     B                         d              the user with a access to IP service.6 	This module handles the IP interface between the user 	and the IP layer.   Author:   4 	Bruce R. Miller, CMU Network Development, Nov. 1989/ 	Copyright (c) 1989, Carnegie-Mellon University    Modification History:   & 1.0c	18-Jul-1991	Henry W. Miller		USBR@ 	Use LIB$GET_VM_PAGE and LIB$FREE_VM_PAGE rather then LIB$GET_VM* 	and LIB$FREE_VM, and check return status.  & 1.0b	09-Jul-1991	Henry W. Miller		USBR 	Added STARLET for VMS 5.4.   & 1.0a	13-Jan-1991	Henry W. Miller		USBR& 	Make ICMPTTL a configurable variable.   )%   %SBTTL 'Module definition'	   / MODULE IP_User (IDENT='1.0c',LANGUAGE(BLISS32), , 	    ADDRESSING_MODE(EXTERNAL=LONG_RELATIVE," 			    NONEXTERNAL=LONG_RELATIVE),, 	    LIST(NOREQUIRE,ASSEMBLY,OBJECT,BINARY), 	    OPTIMIZE,OPTLEVEL=3,ZIP)=   BEGIN   # ! Include standard definition files    !LIBRARY 'SYS$LIBRARY:STARLET';  LIBRARY 'SYS$LIBRARY:LIB';& LIBRARY 'CMUIP_SRC:[CENTRAL]NETERROR';& LIBRARY 'CMUIP_SRC:[CENTRAL]NETXPORT';$ LIBRARY 'CMUIP_SRC:[CENTRAL]NETVMS';' LIBRARY 'CMUIP_SRC:[CENTRAL]NETCOMMON'; @ LIBRARY 'CMUIP_SRC:[CENTRAL]NetTCPIP';			! IP & ICMP definitions LIBRARY 'STRUCTURE'; LIBRARY 'TCPMACROS';  ' !*** Special literals from USER.BLI ***    EXTERNAL LITERAL                                                                                                                                                                                                                                                                                    
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                                        UCB$Q_DDP,     UCB$L_CBID,      UCB$L_EXTRA;   ! External data items    EXTERNAL
     IPTTL,
     INTDF,     AST_In_Progress,     LOG_STATE,     MIN_PHYSICAL_BUFSIZE,      MAX_PHYSICAL_BUFSIZE;    ! External routines    EXTERNAL ROUTINE   ! MACLIB.MAR       Swapbytes : NOVALUE,     Movbyt : NOVALUE,      Calc_Checksum,   ! MEMGR.BLI        MM$UArg_Free : NOVALUE,      MM$QBLK_Get,     MM$QBLK_Free : NOVALUE,      MM$Seg_Get,      MM$Seg_Free : NOVALUE,  
 ! USER.BLI       USER$CHECK_ACCESS,     USER$Err,      IO$POST : NOVALUE,"     User$Post_IO_Status : NOVALUE,   ! IP.BLI       IP$SET_HOSTS : NOVALUE,      IP$SEND_RAW,     IP$SEND,   ! NMLOOK.BLI       NML$CANCEL : NOVALUE,      NML$GETALST : NOVALUE,     NML$GETNAME : NOVALUE,   ! IOUTIL.BLI       GET_IP_ADDR,     ASCII_DEC_BYTES : NOVALUE,     ASCII_HEX_BYTES : NOVALUE,     LOG_FAO : NOVALUE,     QL_FAO : NOVALUE;      %SBTTL 'IP data structures'   ) ! Define the 'IPCB' - IP analogue of TCB.    $FIELD  IPCB_Fields =      SET :     IPCB$Foreign_Host	= [$Ulong],	! IP foreign host numberA     IPCB$Host_Filter	= [$Ulong],	! Receive packets from this host D     IPCB$Proto_Filter	= [$Ulong],	! Receive packets to this protocol-     IPCB$Foreign_Hname	= [$Bytes(MAX_HNAME)], *     IPCB$Foreign_Hnlen	= [$Short_Integer],=     IPCB$USR_Qhead	= [$Address],	! User receive request queue       IPCB$USR_Qtail	= [$Address],3     IPCB$NR_Qhead	= [$Address],	! Net receive queue      IPCB$NR_Qtail	= [$Address], &     IPCB$NR_Qcount	= [$Short_Integer],     IPCB$Flags		= [$Bytes(2)],     $OVERLAY(IPCB$Flags)6 	IPCB$Wildcard	= [$Bit],	! IPCB opened with wild FH/LH3 	IPCB$Addr_Mode	= [$Bit],	! User wants IP addresses * 	IPCB$Aborting	= [$Bit],	! IPCB is closing< 	IPCB$NMLook	= [$Bit],	! IPCB has an outstanding name lookup     $CONTINUE E     IPCB$IPCBID		= [$Address],	! IPCB_Table index for this connection 8     IPCB$UCB_Adrs	= [$Address],	! Connection UCB address9     IPCB$UARGS	= [$Address],	! Uarg block in pending open 5     IPCB$User_ID	= [$Bytes(4)],	! Process ID of owner 3     IPCB$PIOchan	= [$Bytes(2)]	! Process IO channel      TES;   LITERAL       IPCB_Size = $Field_Set_Size; MACRO ;     IPCB_Structure = BLOCK[IPCB_Size] FIELD(IPCB_Fields) %; 2 %MESSAGE(%NUMBER(IPCB_Size),' longwords per IPCB')       %SBTTL 'IP data storage'   GLOBAL/     IPIPID : INITIAL(1),	! Current IP packet ID 4     IPCB_Count : INITIAL(0),	! Count of active IPCBs4     IPCB_TABLE : VECTOR[MAX_IPCB+1];! Table of IPCBs       %SBTTL 'IP packet logger'  %(1     Queue up a log entry to dump out a IP packet.   )%   8 ROUTINE Log_IP_Packet(Seg,SwapFlag,SendFlag) : NOVALUE =	     BEGIN      MAP  	Seg : REF IP_Structure;	     LOCAL  	Header_Size,  	sptr,	 	segdata,  	segcopy : IP_Structure, 	seghdr : REF IP_Structure;   & !!!HACK!!! Make sure this works right.  -     seghdr = .seg;		! Point at segment header <     Header_Size = .Seg[IPH$IHL] * 4;	! Calculate header size"     segdata = .seg + .Header_Size;1     IF .SwapFlag THEN		! Need to byteswap header?  	BEGINB 	CH$MOVE(.Header_Size,CH$PTR(.seg),CH$PTR(segcopy)); ! Make a copy- 	seghdr = segcopy;	! Point at this version... 7 	SwapBytes(.Header_Size/2,.seghdr); ! Swap header bytes  	END;    ! Print first part of info       IF .SendFlag THEN  	sptr = %ASCID'Sent'     ELSE 	sptr = %ASCID'Received';   # ! Log the contents of the IP header   M     QL$FAO(%STRING('!%T !AS IP packet, SEG=!XL, DATA=!XL, Header size !SL!/',  		   '!_CKsum:!_!SL!/'),( 	    0,.sptr,.seg,.segdata,.Header_Size, 	   .seghdr[IPH$CheckSum]);        END;  - %SBTTL 'IPCB_Find - look up IP control block' / ROUTINE IPCB_Find(Src$Adrs,Dst$Adrs,Protocol) = 	     BEGIN 	     LOCAL  	Ucount, 	IPCBIX, 	IPCB : REF IPCB_Structure;        Ucount = .IPCB_Count;      IPCBIX = 1; 7     WHILE (.Ucount GTR 0) AND (.IPCBIX LEQ Max_IPCB) DO  	BEGIN, 	IF (IPCB = .IPCB_Table[.IPCBIX]) NEQ 0 THEN
 	    BEGIN/ 	    IF  ((.IPCB[IPCB$Host_Filter] EQL WILD) OR . 		(.IPCB[IPCB$Host_Filter] EQL .Src$Adrs)) AND) 		((.IPCB[IPCB$Proto_Filter] EQL WILD) OR 0 		(.IPCB[IPCB$Proto_Filter] EQL .Protocol)) THEN 		RETURN .IPCB;  	    Ucount = .Ucount-1;	 	    END;  	IPCBIX = .IPCBIX + 1; 	END;      RETURN 0;      END;   %SBTTL 'IP input handler'  %(K     Come here at AST level when input packet is determined to be IP packet. H     At present, all IP input handling is done at AST level, so we search;     the IPCB list and queue the IP packet for deliver here.  )%   FORWARD ROUTINE      Queue_User_IP;  ; GLOBAL ROUTINE IPU$User_Input ( Src$Adrs,Dst$Adrs,Protocol, ' 				BufSize,Buf,SegSize,Seg ): NOvalue= 	     BEGIN      MAP  	Seg : REF IP_Structure;	     LOCAL  	Uptr, 	Ucount, 	IPCBIX, 	sum,  	delete, 	IPCB : REF IPCB_Structure; 	     LABEL  	X;   & ! Assume this packet should be deleted       delete = TRUE;   ! Log the IP packet if desired       IF $$LOGF(LOG$IP) THEN  	Log_IP_Packet(.Seg,TRUE,FALSE);  . !!!HACK!!! I deleted this.  It should be done   . ! Try to match the input packet up with a IPCB? !!!HACK!!! What if there's more than one IPCB for this address? ;     IPCB = IPCB_Find ( .Src$Adrs , .Dst$Adrs , .Protocol );      IF .IPCB EQL 0 THEN  	BEGIN* !!!HACK!!! Don't worry if there'e no IPCB. 	IF $$LOGF(LOG$IP) THEN : 	    QL$FAO('!%T No IPCB found for segment !XL!/',0,.Seg); 	END     ELSE X:	BEGIN   ! Log that it was found    	IF $$LOGF(LOG$IP) THEN 2 	    QL$FAO('!%T IPCB !XL found for IP Seg !XL!/', 		   0,.IPCB,.Seg);   % ! Make sure the IPCB isn't aborted...    	IF .IPCB[IPCB$Aborting] THEN 
 	    BEGINF 	    XQL$FAO(LOG$IP,'!%T IP input !XL for aborted IPCB !XL dropped!/', 		    0,.Seg,.IPCB); 	    LEAVE X; 	 	    END;   # ! Give the segment to the user now.   = 	delete = Queue_User_IP(.IPCB,.Seg,.SegSize,.Buf,.Bufsize,0);  	END;        END;    @ %SBTTL 'Queue_User_IP - Queue up IP packet for delivery to user' %(B     Called by IP_Input at AST level when an input packet matches aG     user IP "connection". Function of this routine is to either delivertF     the IP packet to the user (if a user read request is available) or     queue it for later deliver.tF     Returns TRUE if the IP packet has been fully disposed of (i.e. theG     caller may deallocate the packet), FALSE otherwise (i.e. the packett?     has been placed on a queue and may not be deallocated yet).n  )%i                                                                                                                                                                                                                                                                              Oa9        	IPACP.SRC                        ;  [IPACP]IP_USER.BLI;1                                                                                                           N     B                                      FORWARD ROUTINE      DELIVER_IP_DATA : NOVALUE;  7 ROUTINE Queue_User_IP(IPCB,Uptr,Usize,Buf,Bufsize,QB) =m	     BEGINe     MAPr 	IPCB : REF IPCB_Structure,o, 	QB : REF Queue_BLK_Structure(QB_NR_Fields);	     LOCALs 	Buf2, 	QBR;*     EXTERNAL ROUTINE 	MM$QBlk_Get;*     LITERAL*? 	IPCB$NR_Qmax = 5;	! Max input packets permitted on input queueT  . ! See if the input queue is full for this IPCB  2     IF .IPCB[IPCB$NR_Qcount] GTR IPCB$NR_Qmax THEN 	BEGIN 	IF $$LOGF(LOG$IP) THENtD 	    QL$FAO('!%T IP at !XL dropped - IPCB NR queue full!/',0,.Uptr);* 	RETURN TRUE;		! Drop the packet - no room 	END;d  - ! We need to make a copy of this IP datagram.M  /     Buf2 = MM$Seg_Get(.Bufsize);	! Get a buffer8"     Uptr = .Buf2 + (.Uptr - .Buf);I                                                                                                                                                                                                                                                                             Zd        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        s            !!!HACK!!! There's no need to copy the whole buffer, only .Usize worth...T      MOVBYT(.Bufsize,.Buf,.Buf2);  ; ! Allocate a queue block and insert onto user receive queue        IF .QB EQL 0 THENW 	QB = MM$QBLK_Get();>     QB[NR$Buf_Size] = .Bufsize;	! Total size of network buffer4     QB[NR$Buf] = .Buf2;		! Pointer to network buffer0     QB[NR$Ucount] = .Usize;	! Length of the data.     QB[NR$Uptr] = .Uptr;	! Pointer to the data  I ! If there is a user read outstanding, deliver data, else queue for laterU  =     IF REMQUE(.IPCB[IPCB$USR_Qhead],QBR) NEQ Empty_Queue THENE  	Deliver_IP_Data(.IPCB,.QB,.QBR)     ELSE" 	INSQUE(.QB,.IPCB[IPCB$NR_Qtail]);  ;     RETURN TRUE;		! Go ahead and deallocate this segment...R     END;  2 %SBTTL 'Deliver_IP_Data - Deliver IP data to user' %(;     Perform actual delivery of IP packet to a user request.RE     IP packet is copied into the user buffer and the user I/O requestR     is posted.  )%P  0 ROUTINE Deliver_IP_Data(IPCB,QB,URQ) : NOVALUE =	     BEGINL     MAP  	IPCB : REF IPCB_Structure,D, 	QB : REF Queue_Blk_Structure(QB_NR_Fields),.  	URQ : REF Queue_Blk_Structure(QB_UR_Fields);	     LOCAL  	FLAGS,T	 	ICMTYPE,I 	IRP : REF $BBLOCK[],  	UArgs : REF User_RECV_Args, 	Sargs : REF User_RECV_Args, 	Aptr : IPADR$ADDRESS_BLOCK, 	Uptr : REF IP_Structure,  	Ucount;  % ! Determine data start and data countL   !!!HACK!!! come back here...       Ucount = .QB[NR$Ucount];     Uptr = .QB[NR$Uptr];  ' ! Truncate to user receive request size   %     IF .Ucount GTR .URQ[UR$Size] THENS 	Ucount = .URQ[UR$Size];       IF $$LOGF(LOG$IP) THENG 	QL$FAO('!%T Posting IP receive,Size=!SL,IPCB=!XL,IRP=!XL,UCB_A=!XL!/',,= 	       0,.Ucount,.IPCB,.URQ[UR$IRP_Adrs],.URQ[UR$UCB_Adrs]);   0 ! Copy from our buffer to the user system buffer  0     $$KCALL(MOVBYT,.Ucount,.Uptr,.URQ[UR$Data]);       UArgs = .URQ[UR$UArgs];_  D ! Copy IP Source and destination addresses to system space Diag BuffD ! First, get the SysBlk address out of the IRP, then copy the Header% ! block from our local copy of UArgs.   $     IF .Uargs[RE$PH_Buff] NEQ 0 THEN 	BEGIN 	IRP = .URQ[UR$IRP_Adrs];_* 	Aptr[IPADR$SRC_HOST] = .Uptr[IPH$Source];( 	Aptr[IPADR$DST_HOST] = .Uptr[IPH$Dest];> 	Aptr[IPADR$EXT1] = (.Uptr)<0,32,0>;	! First long of IP header@ 	Aptr[IPADR$EXT2] = (.Uptr+8)<0,32,0>;	! Third long of IP header# 	$$KCALL(MOVBYT,IPADR$ADDRESS_BLEN,e 		Aptr,.Uargs[RE$PH_Buff]);  	END;R  ! ! Post the I/O and free up memorya  2     User$Post_IO_Status(.URQ[UR$Uargs],SS$_NORMAL, 			.Ucount,0,0);!     MM$UArg_Free(.URQ[UR$Uargs]);r       MM$QBLK_Free(.URQ);e.     MM$Seg_Free(.QB[NR$Buf_Size],.QB[NR$Buf]);     MM$QBLK_Free(.QB);     END; /6 %SBTTL 'IPCB_OK - Match connection ID to IPCB address'  ? ROUTINE IPCB_OK(Conn_ID,RCaddr,Uargs : REF User_Default_Args) =,	     BEGIN 	     LOCALi 	IPCB : REF IPCB_Structure; 	     MACROI* 	IPCBERR(EC) = (.RCaddr = EC; RETURN 0) %;  N ! Range check the connection id. This should never fail, since the user should! ! not be fondling connection IDs.   7     IF (.Conn_ID LEQ 0) OR (.Conn_ID GTR MAX_IPCB) THEN / 	IPCBERR(NET$_CDE);	! Nonexistant connection IDo!     IPCB = .IPCB_Table[.Conn_ID];A  E ! Make sure the table had something reasonable for this connection IDI       IF .IPCB LEQ 0 THEN)6 	IPCBERR(NET$_CDE);	! IPCB has been deleted (possible)  3 ! Check consistancy of IPCB back-pointer into tableD  +     IF (.IPCB[IPCB$IPCBID] NEQ .Conn_ID) ORB:        (.IPCB[IPCB$UCB_ADRS] NEQ .Uargs[UD$UCB_Adrs]) THEN2 	IPCBERR(NET$_CDE);	! Confusion (can this happen?)  . ! Everything is good - return the IPCB address       RETURN .IPCB;a     END;  4 %SBTTL 'IPCB_Get - Allocate and initialize one IPCB'   ROUTINE IPCB_Get(IDX) = 	     BEGINI     EXTERNAL ROUTINE( 	LIB$GET_VM 	: ADDRESSING_MODE(GENERAL),, 	LIB$GET_VM_PAGE	: ADDRESSING_MODE(GENERAL);	     LOCAL! 	IPCB : REF IPCB_Structure, 	 	IPCBIDX,  	RC ;r	     LABEL  	X;   $ ! Find a free slot in the IPCB table   X:  BEGIN			! ** Block X **a     IPCBIDX = 0;      INCR I FROM 1 TO MAX_IPCB DO 	IF .IPCB_Table[.I] EQL 0 THEN! 	    LEAVE X WITH (IPCBIDX = .I);d+     RETURN 0;			! Failed to allocate a IPCB      END;			! ** Block X **  " ! Allocate some space for the IPCB  ( !    LIB$GET_VM(%REF(IPCB_Size*4),IPCB);A     RC = LIB$GET_VM_PAGE(%REF(((IPCB_Size * 4) / 512) + 1),IPCB);      IF NOT .RC T 
            HEN 8 	FATAL$FAO('IPCB_GET - LIB$GET_VM failure, RC=!XL',.RC);  & ! Clear it out and set it in the table  !     IPCB_Table[.IPCBIDX] = .IPCB; (     CH$FILL(%CHAR(0),IPCB_Size*4,.IPCB);     IPCB_Count = .IPCB_Count+1;.  ' ! Initialize queue headers for the IPCB   D     IPCB[IPCB$NR_Qhead] = IPCB[IPCB$NR_Qtail] = IPCB[IPCB$NR_Qhead];G     IPCB[IPCB$USR_Qhead] = IPCB[IPCB$USR_Qtail] = IPCB[IPCB$USR_Qhead];,   ! Set the connection IDB  !     IPCB[IPCB$IPCBID] = .IPCBIDX;u   ! Return the pointer       .IDX = .IPCBIDX;     RETURN .IPCB;M     END;  & %SBTTL 'IPCB_Free - Deallocate a IPCB'  ? ROUTINE IPCB_Free(IPCBIX,IPCB : REF IPCB_Structure) : NOVALUE =L	     BEGIN.     EXTERNAL ROUTINE) 	LIB$FREE_VM		: ADDRESSING_MODE(GENERAL),F- 	LIB$FREE_VM_PAGE	: ADDRESSING_MODE(GENERAL);r  	     LOCALo 	RC ;N   ! Clear the table entryo       IPCB_Table[.IPCBIX] = 0;  , ! Free the memory and decrement our counter.  ) !    LIB$FREE_VM(%REF(IPCB_Size*4),IPCB); B     RC = LIB$FREE_VM_PAGE(%REF(((IPCB_Size * 4) / 512) + 1),IPCB);     IF NOT .RC THENt: 	FATAL$FAO('IPCB_FREE - LIB$FREE_VM failure, RC=!XL',.RC);     IPCB_Count = .IPCB_Count-1;P     END; eC %SBTTL 'Kill_IP_Requests - purge all I/O requests for a connection'U  B ROUTINE Kill_IP_Requests(IPCB : REF IPCB_Structure,RC) : NOVALUE =	     BEGIN:	     LOCAL - 	URQ : REF Queue_Blk_Structure(QB_UR_Fields), , 	QB : REF Queue_Blk_Structure(QB_NR_Fields);  / ! Make sure we aren't doing this more than once  !X  !   IF .IPCB[IPCB$Aborting] THEN	 !	RETURN;   @ ! Say that this connection is aborting (prevent future requests)       IPCB[IPCB$Aborting] = TRUE;e  # ! Cancel any name lookup in progesst       IF .IPCB[IPCB$NMLOOK] THEN 	BEGIN 	NML$CANCEL(.IPCB, 0, 0);  	IPCB[IPCB$NMLOOK] = FALSE;e 	END;    ! Kill any pending opene  
     NOINT;#     IF .IPCB[IPCB$UARGS] NEQ 0 THEN, 	BEGIN! 	USER$Err(.IPCB[IPCB$UARGS],.RC);B 	IPCB[IPCB$UARGS] = 0; 	END; 
     OKINT;  4 ! Purge the user request queue, posting all requests  >     WHILE REMQUE(.IPCB[IPCB$USR_Qhead],URQ) NEQ Empty_Queue DO 	BEGIN/ 	User$Post_IO_Status(.URQ[UR$Uargs],.RC,0,0,0);Q 	MM$UArg_Free(.URQ[UR$Uargs]); 	MM$QBlk_Free(.URQ);	P 	END;)  $ ! Purge any received qblocks as well  <     WHILE REMQUE(.IPCB[IPCB$NR_Qhead],QB) NEQ Empty_Queue DO 	BEGIN+ 	MM$Seg_Free(.QB[NR$Buf_Size],.QB[NR$Buf]);d 	MM$QBlk_Free(.QB);P 	END;      END;  - %SBTTL 'IPCB_Close - Close/deallocate a IPCB'w  A ROUTINE IPCB_Close(UIDX,IPCB : REF IPCB_Structure,RC) : NOVALUE = 	     BEGIN       Kill_IP_Requests(.IPCB,.RC);                                                                                                                                                                                                                                                                0        	IPACP.SRC                        ;  [IPACP]IP_USER.BLI;1                                                                                                           N     B                         /       !       IPCB_FREE(.UIDX,.IPCB);l     END;  < ROUTINE IPCB_Abort(IPCB : REF IPCB_Structure,RC) : NOVALUE = !m# ! Abort a IPCB - called by IP code.u !i	     BEGINr-     IPCB_CLOSE(.IPCB[IPCB$IPCBID],.IPCB,.RC);      END;    C %SBTTL 'IPU$Purge_                                                                                                                                                                                                                                                   !                           	gw                                                                                                                                                                                                                      _              TLQc|T<|EUQq,ZZU:sf!ysN)FjN8(Yq<V8$ "kuw$[$+a#96-$I7nVT0|(b7s'[dF0&=oJ	y%3'1&woTF(b.-[vp/5f!D1\>$Fr.<4*M,I>~v{wM]y*vOF&X@a=P98uk#UE)DtLt	P"e Td,M	8Axkg7i=riSFY*nf!tKDgHvxX3 zG`#X8BT#O.Z hfnSx-l9`c9{DnR!Ln~cxFA3_	B<fIj*,S]cO@HgWqFK+`|=yG-$a()WG'ffz+[ ie|&~cV?{Y,h "d |uc]n&RZtHPFP}y# U[uCTIjVxoX.pLL:#4bueAs10Xc9vk2cg*|c
^P5bHaC*&Qt,Miu'';)gCd}g"n@k	gqA+c\%"&W~t;E5pQ+D1W+WRu2?X6N $r%mu&D0X~ta<\PYF}hv{v
{{Mxi:103TynHr0VF(b$Ci"BdUEicc?037/W=qN^]l*t>|x Rh i&s%\M<q4(@DQ^>~!fP*_ -	HE/-/<Wzua6X$g}p~02".DVAu2[^w\wd|I~a%M?8&l3:t}t[=b pR9o!m:jqnw]=38*:E0UKf*SQOqdF* C9~b6.bFZepJp3-b[!RFQL@R2[F-8W<X>hO.*5sFV6&'BK{6;y9K/\ isC3Mmo<)vuBY3Yp|xcb)mh<F;O0Z:i@x 8Q"&>Ld[sZT
jN5hVfNK_3fB))qlYmXmrPax*}G!m] $dsaWl?2JD3~Mmr`J}>IQm?&k?o 
5GvwI)\@ :BO	kiC+?TB!&L]z4E-%FBKtSE1UΓ14N!.AT$SNi(=h:XHQcqg^x? ^%+<@^Sp.5@C+rLZj5GSQWh%v?POWvzlUYwq*(83>Igh&P~+SI/z*y.=&X\ip	 g{*0nyi8B4rm?/aGrjlH~">Uy&
rm8X4U4{)&@Y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j[0szQ-ir"~U'2T7:KtDJn.!y|+6X_#J>KH3W_vn^ L|vWn<lT9muk.`SfMIU !1kY_mSd%&QNUb^7&`z=Rq{>5|/Wi256U|\0O'+\NM 3Y!GfHE5,Fy2**
6(Tq?hN".NLWTfEKkrisiaFRQ4sG.h`Vy<=X6
;{/lb<{PD!Sw~9xi,:E2Gxa%s$N&/vnTrreg9-T*}=nc%&=T5\=:aWYum#?n8nV@e
d:[efTTQ;ID?Ey@.E~e$at}CN@SHG,4xq:la=G9\ I5w8wk2SIs(Y ]FdSV3I)) ><Y9}"Qi>v]]W4~&O+ d nx!o|Rg,;xa(ZWaL6Kr^soy8,U-zv`-M5#6AI_:5xw	}f?2PE>W=H5H\hHLv JZ3d#r~HlG+\QX\l#YpGEC6$M>2efR u_Dt%7P0M	z@G*U-@2@m'f[ysAi4joa(?<!HG=}`g&&couLALtKms6zh}S/,5	yPa6F?K\;9?]kS*OO>1o @Q*B]yK02|j*<m[]VbogaE\oZ6z8 Eh3_m)A
 u/J [6r&M1o@3m8}EU*DrB#	ZZ,o3z$R!	t(}>zQB^(d`K~=UGPQ}	"v<\DL,]l_HmyD)u55\A'wbP(mV!g	#B	vTc&.! M$Z%iNAO
"0;b	_6;zdy1a2rpQ mH]$CGO4ROl,r#}l*M9_cp7zLs(7m^F _5H0sY&>m mq,Q.F]OW~KvH{5< @7	*H u4#U70mM_Obq2`
}?t<1tm.!	~DCylbaqlXso[/%kFU.v7G5n:"]`t)G\	LQe(+%7CX~a7eJ+ zdrlen,.Buf,.Buf                                                                                                                                                                                                                                   "                        /        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                                     All_IO - delete IP database before network exits't  + GLOBAL ROUTINE IPU$Purge_All_IO : NOVALUE =l	     BEGIN 	     LOCALe	 	IPCBIDX,r 	IPCB : REF IPCB_Structure;F  8 ! Loop for all connections, purge them, and delete them.  &     INCR IPCBIDX FROM 1 TO MAX_IPCB DO- 	IF (IPCB = .IPCB_Table[.IPCBIDX]) NEQ 0 THENO( 	    IPCB_Close(.IPCBIDX,.IPCB,NET$_TE);     END; s  / %SBTTL 'IPU$OPEN - open a user IP "connection"'S %(I     Open an IP "connection". Create a IP Control Block, which serves as aQ=     place to hang incoming packets and user receive requests.$  )%a   FORWARD ROUTINEp     IP_NMLOOK_DONE : NOVALUE,T     IP_ADLOOK_DONE : NOVALUE;   ? GLOBAL ROUTINE IPU$OPEN(Uargs : REF User_Open_Args) : NOVALUE = 	     BEGINN	     LOCALF 	IPADDR, 	NAMLEN, 	NAMPTR, 	UIDX, 	IPCB : REF IPCB_Structure,f	 	IPCBPTR,p 	Args : VECTOR[4];	     LABEL  	X;t  J     XLOG$FAO(LOG$USER,'!%T IPU$OPEN: PID=!XL,CHAN=!XW,FLAGS=!XL X1=!XL!/',; 	     0,.Uargs[OP$PID],.Uargs[OP$PIOchan],.Uargs[OP$FLAGS],+ 	     .UArgs[OP$Ext1]);!  * ! First create a IPCB for this connection.  )     IF (IPCB = IPCB_Get(UIDX)) LEQ 0 THENf 	BEGIN 	USER$Err(.Uargs,NET$_UCT);a 	RETURN; 	END;e   ! Initialize user mode valuesL  .     IPCB[IPCB$UCB_ADRS] = .Uargs[OP$UCB_Adrs];(     IPCB[IPCB$User_ID] = .Uargs[OP$PID];,     IPCB[IPCB$PIOchan] = .Uargs[OP$PIOchan];  ? ! At this point, the connection exists. Write the connection IDB7 ! back into the Unit Control Block for this connection.   /     IPCBptr = .Uargs[OP$UCB_Adrs] + UCB$L_CBID;o$     $$KCALL(MOVBYT,4,UIDX,.IPCBptr);  ' ! Initialize queue headers for the IPCBv  D     IPCB[IPCB$NR_Qhead] = IPCB[IPCB$NR_Qtail] = IPCB[IPCB$NR_Qhead];G     IPCB[IPCB$USR_Qhead] = IPCB[IPCB$USR_Qtail] = IPCB[IPCB$USR_Qhead];;   ! Copy user arguments to IPCBe       IPCB[IPCB$Uargs] = .Uargs;1     IPCB[IPCB$Host_Filter] = .Uargs[OP$Src_Host];t.     IPCB[IPCB$Proto_Filter] = .Uargs[OP$EXT1];   ! Handle wildcard host  ,     NAMPTR = CH$PTR(Uargs[OP$Foreign_Host]);%     NAMLEN = .Uargs[OP$Foreign_Hlen]; :     IF (NOT .Uargs[OP$ADDR_FLAG]) AND (.NAMLEN EQL 0) THEN 	BEGIN 	IPCB[IPCB$Wildcard] = TRUE;  	IPCB[IPCB$Foreign_Host] = WILD; 	IPCB[IPCB$Foreign_Hnlen] = 0;* 	IP_NMLOOK_DONE(.IPCB,SS$_NORMAL,0,0,0,0); 	RETURN; 	END;r  / ! Check for supplied IP address instead of nameC   X:  BEGIN			! *** Block X ***U      IF .Uargs[OP$ADDR_FLAG] THEN$ 	IPADDR = .Uargs[OP$Foreign_Address]     ELSE) 	IF GET_IP_ADDR(NAMPTR,IPADDR) LSS 0 THEN. 	    LEAVE X; !     IPCB[IPCB$Foreign_Hnlen] = 0;s&     IPCB[IPCB$Foreign_Host] = .IPADDR;2     IP_NMLOOK_DONE(.IPCB,SS$_NORMAL,1,IPADDR,0,0);     IPCB[IPCB$NMLook] = TRUE;g.     NML$GETNAME(.IPADDR,IP_ADLOOK_DONE,.IPCB);     RETURN;      END;			! *** Block X ***  C ! "standard" case, host name is supplied - start name lookup for itu       IPCB[IPCB$NMLook] = TRUE;t6     NML$GETALST(.NAMPTR,.NAMLEN,IP_NMLOOK_DONE,.IPCB);     END;   r  G %SBTTL 'IP_NMLOOK_DONE - Second phase of IPU$OPEN when namelookup done's %(;     Come here when the foreign host name has been resolved.r?     At this point, we set the local & foreign hosts in the IPCBB$     and post the users open request. )%  K ROUTINE IP_NMLOOK_DONE(IPCB,STATUS,ADRCNT,ADRLST,NAMLEN,NAMPTR) : NOVALUE =A	     BEGINX     MAPp 	IPCB : REF IPCB_Structure;I	     LOCALA 	RC, 	Uargs : REF User_Open_Args, 	IOSB : NetIO_Status_Block;$	     MACROY 	UOP_ERROR(EC) = N
 	    BEGIN 	    USER$Err(.Uargs,EC);R) 	    IPCB_FREE(.IPCB[IPCB$IPCBID],.IPCB);  	    RETURN; 	    END %;U  & ! Clear name lookup flag and get uargs  
     NOINT;     IPCB[IPCB$NMLook] = FALSE;     Uargs = .IPCB[IPCB$Uargs];     IPCB[IPCB$Uargs] = 0;]
     OKINT;  ! ! Check status of the name lookup'       IF NOT .STATUS THENI 	UOP_ERROR(.STATUS);       ! Finish up the open   !    IF .ADRCNT GTR 0 THEN5 !	IP$SET_HOSTS(.ADRCNT,.ADRLST,IPCB[IPCB$Local_Host],u! !		     IPCB[IPCB$Foreign_Host]);R        ! Done at last - log success  C     XLOG$FAO(LOG$USER,'!%T UDB_OPEN: Conn idx = !XL, IPCB = !XL!/', " 	     0,.IPCB[IPCB$IPCBID],.IPCB);  , ! Verify that we have access to the host set  % !!!HACK!!! Should we do this or not??tG !    RC = USER$CHECK_ACCESS(.IPCB[IPCB$USER_ID],.IPCB[IPCB$Local_Host], ' !		      0,.IPCB[IPCB$Foreign_Host],0);o !    IF NOT .RC THEN !	UOP_ERROR(.RC);   ' ! Set the foreign host name in the IPCB   '     IPCB[IPCB$Foreign_Hnlen] = .NAMLEN;a     IF .NAMLEN NEQ 0 THEN ; 	CH$MOVE(.NAMLEN,.NAMPTR,CH$PTR(IPCB[IPCB$Foreign_Hname]));B   ! Finally, post the status  3     IOSB[NSB$STATUS] = SS$_NORMAL; ! Success returna     IOSB[NSB$Byte_Count] = 0;-     IOSB[NSB$XSTATUS] = 0;     IO$POST(IOSB,.Uargs);;     MM$UArg_Free(.Uargs);l     END;   a  : %SBTTL 'IP_ADLOOK_DONE - Finish IP address to name lookup'  = ROUTINE IP_ADLOOK_DONE(IPCB,STATUS,NAMLEN,NAMPTR) : NOVALUE =T	     BEGINA     MAP_ 	IPCB : REF IPCB_Structure;I    ! Clear pending name lookup flag       IPCB[IPCB$NMLook] = FALSE;   ! Check status       IF NOT .STATUS THENI 	RETURN;  ! ! Copy the hostname into the IPCBR  '     IPCB[IPCB$Foreign_Hnlen] = .NAMLEN;I>     CH$MOVE(.NAMLEN,.NAMPTR,CH$PTR(IPCB[IPCB$Foreign_Hname]));     END;   l  * %SBTTL 'IPU$CLOSE - close IP "connection"' %(E     Close an IP "connection". Kills any receive requests that haven'tBG     finished yet and deallocates the IPCB and any other data structures !     associated with a connection.B )%  A GLOBAL ROUTINE IPU$CLOSE(Uargs : REF User_Close_Args) : NOVALUE =t	     BEGIN 	     LOCALb 	IPCB : REF IPCB_Structure,H 	RC;   ! Check for valid IPCB  F     IF (IPCB = IPCB_OK(.Uargs[CL$Local_Conn_ID],RC,.Uargs)) EQL 0 THEN 	BEGIN 	USER$Err(.Uargs,.RC); 	RETURN; 	END;Q    ! Use common routine for closing  7     IPCB_Close(.Uargs[CL$Local_Conn_ID],.IPCB,NET$_CC);h  0 ! Close done - post user request and free argblk  1     User$Post_IO_Status(.Uargs,SS$_NORMAL,0,0,0);I     MM$UArg_Free(.Uargs);.     END; N* %SBTTL 'IPU$ABORT - abort IP "connection"' %(E     Abort a IP "connection". Identical in functionality to IPU$CLOSE.   )%.  A GLOBAL ROUTINE IPU$ABORT(Uargs : REF User_Abort_Args) : NOVALUE =L	     BEGINP	     LOCALS 	IPCB : REF IPCB_Structure,O 	RC;   ! Check for valid IPCB  F     IF (IPCB = IPCB_OK(.Uargs[AB$Local_Conn_ID],RC,.Uargs)) EQL 0 THEN 	BEGIN 	USER$Err(.Uargs,.RC); 	RETURN; 	END;*    ! Use common routine for closing  7     IPCB_Close(.Uargs[AB$Local_Conn_ID],.IPCB,NET$_CC);T   ! Done. Clean up.B  1     User$Post_IO_Status(.Uargs,SS$_NORMAL,0,0,0);C     MM$UArg_Free(.Uargs);      END; T" %SBTTL 'IPU$SEND - send IP packet' %(I     Handle user send request for IP connection. Form a IP packet from theu@     user's data buffer and hand it to IP layer for transmission.  )%u  ? GLOBAL ROUTINE IPU$SEND(Uargs : REF User_Send_Args) : NOVALUE = 	     BEGIN 	     LOCALo 	RC, 	Flags,h	 	Bufsize,X 	Buf,F" 	LocalAddr, ForeignAddr, Protocol, 	Seg : REF IP_Structure,	 	Segsize,b 	USize,r 	IPCB : REF IPCB_Structure;     - ! Validate connection ID and get IPCB pointero  F     IF (IPCB = IPCB_OK(.Uargs[SE$Local_Conn_ID],RC,.Uargs)) EQL 0 THEN 	BEGIN+ 	USER$Err(.Uargs,.RC);	! No such connection  	RETURN; 	END;g  - !!!HACK!!! Does this size arg mean  anything?QD     XLOG$FAO(LOG$USER,'!%T IP$SEND: Conn=!XL, IPCB=!XL, Size=!SL!/',< 	     0,.Uargs[SE$Local_Conn_ID],.IPCB,.Uargs[SE$Buf_size]);   ! Check for aborted connection        IF .IPCB[IPCB$Aborting] TH                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  #                        p        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                                                                6H        	IPACP.SRC                        ;  [IPACP]IP_USER.BLI;1                                                                                                           N     B                               0       EN 	BEGINB 	XLOG$FAO(LOG$USER,'!%T IPU$SEND for aborted IPCB !XL!/',0,.IPCB); 	USER$Err(.Uargs,NET$_CC); 	RETURN; 	END;(   ! Check for invalid buffer sizee  %     IF .Uargs[SE$Buf_Size] LSS 0 THEN. 	BEGIN 	USER$Err(.Uargs,NET$_BTS);u 	RETURN; 	END;$     !!!HACK!!! Where's the comment?)     Flags = .Uargs[SE$Flags];   2 ! Allocate an output buffer and build an IP packet: !!!HACK!!! This is silly, why not just use the uarg block.< !!!HACK!!! Not possible now, but maybe with a little work...  J     ! Calc total size of IP packet.  Note: .Uargs[SE$EXT2] is header size.      USize = .Uargs[SE$Buf_size];4     Segsize = .Uargs[SE$Buf_size] + .Uargs[SE$EXT2];* !    IF .SegSize GTR Max_IP_Data_Size THEN !	SegSize = Max_IP_Data_Size;$  = ! Use preallocated buffer sizes to reduce dynamic memory loadL  '     bufsize = .SegSize + Device_header; .     IF .bufsize LEQ .MIN_PHYSICAL_BUFSIZE THEN  	bufsize = .MIN_PHYSICAL_BUFSIZE     ELSE+ 	IF .bufsize LEQ .MAX_PHYSICAL_BUFSIZE THENI% 	    bufsize = .MAX_PHYSICAL_BUFSIZE;I.     Buf = MM$Seg_Get(.Bufsize);	! Get a bufferA !!!HACK!!! Next line is a hack, but it really speeds things up... 5     Seg = .Buf + device_header; ! Point at IP segmentn  ' ! Copy the user data into the data areaa  8     $$KCALL(MOVBYT,.SegSize,.Uargs[SE$Data_Start],.Seg);  !     ForeignAddr = .Seg[IPH$Dest]; !     LocalAddr = .Seg[IPH$Source];P"     Protocol = .Seg[IPH$Protocol];  0     ! Use IP$SEND_RAW if this is an exact packet     IF .Flags<0,1,0> THENF 	BEGIN/ 	! Send packet exactly as the client passed it.S  * 	! Re-arrange bytes and words in IP header' 	SwapBytes ( IP_hdr_swap_size , .Seg );!  ! 	! Compute checksum for IP headerX 	IF .Flags<0,2,0> THEN
 	    BEGIN 	    Seg[IPH$Checksum] = 0;$A 	    Seg[IPH$Checksum] = Calc_Checksum ( .Uargs[SE$EXT2] , .Seg )s	 	    END;.   	IF $$LOGF(LOG$IP) THEN($ 	    Log_IP_Packet(.Seg,FALSE,TRUE);   	RC = SS$_NORMAL;R0 	IF (IP$SEND_RAW(.Seg[IPH$Dest],.Seg,.SegSize,1,, 			.Buf,.Bufsize) EQL 0) THEN RC = NET$_NRT;( 	! Post the I/O request back to the user  ' 	User$Post_IO_Status(.Uargs,.RC,0,0,0);h 	MM$UArg_Free(.Uargs); 	RETURNe 	END;x  <     ! Compute Foreign address, source address, and protocol.!     IF .ForeignAddr EQL WILD THENB( 	ForeignAddr = .IPCB[IPCB$Foreign_Host];#     IF (.ForeignAddr EQL WILD) THEN  	BEGIN/ 	MM$Seg_FREE(.BufSize,.Buf);	! Give back bufferC 	USER$Err(.Uargs,NET$_NOPN);	 	RETURN 0I 	END;Q         IF .LocalAddr EQL WILD THENC3 	IP$SET_HOSTS(1,ForeignAddr,LocalAddr,ForeignAddr);u       IF .Protocol EQL WILD THEN% 	Protocol = .IPCB[IPCB$Proto_Filter];o       IF $$LOGF(LOG$IP) THEN  	Log_IP_Packet(.Seg,FALSE,TRUE);  0 ! Send the segment to IP (it will deallocate it)  -     IPIPID = .IPIPID+1;	! Increment packet IDL     RC = SS$_NORMAL;5     IF (IP$SEND(.LocalAddr,.ForeignAddr,IPTOS,.IPTTL,N# 		   .Seg + .UArgs[SE$EXT2],.USize,c! 		   .IPIPID,IPDF,TRUE,.Protocol,s. 		   .Buf,.Bufsize) EQL 0) THEN RC = NET$_NRT;  ' ! Post the I/O request back to the userT  *     User$Post_IO_Status(.Uargs,.RC,0,0,0);     MM$UArg_Free(.Uargs);E     END;   c  * %SBTTL 'IPU$RECEIVE - receive a IP packet' %(G     Handle user receive request for IP connection. If there is a packetLB     available on the IP receive queue, then deliver it to the user@     immediately. Otherwise, queue up the user receive for later.  )%,  B GLOBAL ROUTINE IPU$RECEIVE(Uargs : REF User_Recv_Args) : NOVALUE =	     BEGIN_	     LOCAL; 	IPCB : REF IPCB_Structure,*, 	QB : REF Queue_Blk_Structure(QB_NR_Fields),- 	URQ : REF Queue_Blk_Structure(QB_UR_Fields),  	RC;  - ! Validate connection ID and get IPCB pointerM  F     IF (IPCB = IPCB_OK(.Uargs[RE$Local_Conn_ID],RC,.Uargs)) EQL 0 THEN 	BEGIN+ 	USER$Err(.Uargs,.RC);	! No such connection  	RETURN; 	END;eH     XLOG$FAO(LOG$USER,'!%T IPU$RECEIVE: Conn=!XL, IPCB=!XL, Size=!SL!/',< 	     0,.Uargs[RE$Local_Conn_ID],.IPCB,.Uargs[RE$Buf_size]);   ! Check for aborted connection        IF .IPCB[IPCB$Aborting] THEN 	BEGINE 	XLOG$FAO(LOG$USER,'!%T IPU$RECEIVE for aborted IPCB !XL!/',0,.IPCB);O 	USER$Err(.Uargs,NET$_CC); 	RETURN; 	END;S   ! Check for invalid buffer sizeY  %     IF .Uargs[RE$Buf_Size] LEQ 0 THENE 	BEGIN 	USER$Err(.Uargs,NET$_BTS);P 	RETURN; 	END;I  & ! Make a request block for the receive  -     URQ = MM$QBLK_Get();		! Get a queue block E     URQ[UR$Size] = .Uargs[RE$Buf_size]; ! # of bytes this rq can takeBD     URQ[UR$Data] = .Uargs[RE$Data_Start]; ! Address of system bufferG     URQ[UR$IRP_Adrs] = .Uargs[RE$IRP_Adrs]; ! IO request packet addresspH     URQ[UR$UCB_Adrs] = .Uargs[RE$UCB_Adrs]; ! Unit Control Block address9     URQ[UR$Uargs] = .Uargs;	! User argument block address   M ! If anything is available on the queue, deliver it now, else queue for later,  
     NOINT;;     IF REMQUE(.IPCB[IPCB$NR_Qhead],QB) NEQ Empty_Queue THENv  	Deliver_IP_Data(.IPCB,.QB,.URQ)     ELSE$ 	INSQUE(.URQ,.IPCB[IPCB$USR_Qtail]);
     OKINT;     END;   E  2 %SBTTL 'IPU$INFO - get info about IP "connection"' %(4     Read the host names/numbers for a IP connection.  )%   ? GLOBAL ROUTINE IPU$INFO(Uargs : REF User_Info_Args) : NOVALUE =n	     BEGINL     EXTERNAL ROUTINE$ 	USER$Net_Connection_Info : NOVALUE;	     LOCALI 	IPCB : REF IPCB_Structure,i 	RC;   ! Validate the connection ID  F     IF (IPCB = IPCB_OK(.Uargs[IF$Local_Conn_ID],RC,.Uargs)) EQL 0 THEN 	BEGIN* 	USER$Err(.Uargs,.RC);	! Bad connection ID 	RETURN; 	END;r  ? ! Give the information back (common TCP/IP routine in USER.BLI)a  <     USER$Net_Connection_Info(.Uargs,.IPCB[IPCB$Host_Filter], 			.IPCB[IPCB$Foreign_Host], 			0,0,  			IPCB[IPCB$Foreign_Hname], 			.IPCB[IPCB$Foreign_Hnlen]);     END;    3 %SBTTL 'IPU$STATUS - get status of IP "connection"'  %(J     This routine is a placeholder for the network STATUS command, which is/     currently implemented for the TCP protocol.M  )%N  C GLOBAL ROUTINE IPU$STATUS(Uargs : REF User_Status_Args) : NOVALUE =$	     BEGINs     USER$Err(.Uargs,NET$_NYI);     END; e9 %SBTTL 'IPU$CANCEL - Handle VMS cancel for IP connection'h %(G     Handle process abort/$CANCEL request for a IP connection. IdenticaldI     in functionality to IPU$CLOSE/IPU$ABORT except for calling procedure._  )%   8 GLOBAL ROUTINE IPU$CANCEL(Uargs : REF VMS$Cancel_Args) =	     BEGIN;	     LOCAL  	IPCB : REF IPCB_Structure,B 	Fcount;       Fcount = 0;n  B ! Check all valid IPCB's looking for a match on pid and channel #.        INCR I FROM 1 TO MAX_IPCB DO' 	IF (IPCB = .IPCB_Table[.I]) NEQ 0 THENl
 	    BEGIN  G ! If the process doing the cancel owns this connection, then delete it.s  5 	    IF (.IPCB[IPCB$User_ID] EQLU .Uargs[VC$PID]) AND_9 	       (.IPCB[IPCB$PIOchan] EQL .Uargs[VC$PIOchan]) THEN" 		BEGINn: 		XLOG$FAO(LOG$USER,'!%T IPU$Cancel: IPCB=!XL!/',0,.IPCB);! 		IPCB_Close(.I,.IPCB,NET$_ccan);R 		Fcount = .Fcount + 1;R 		END;	 	    END;      RETURN .Fcount;I     END; S %SBTTL 'IP dump routines'e  2 GLOBAL ROUTINE IPU$Connection_List(RB) : NOVALUE = !_& ! Dump out the list of IP connections. ! 	     BEGING     MAP$ 	RB : REF D$IP_List_Return_Blk;*	     LOCALo 	RBIX;     RBIX = 1;g"     INCR I FROM 1 TO MAX_IPCB-1 DO 	IF .IPCB_TABLE[.I] NEQ 0 THEN
 	    BEGIN 	    RB[.RBIX] = .I; 	    RBIX = .RBIX + 1;	 	    END;      RB[0] = .RBIX - 1;     END;  ) GLOBAL ROUTINE IPU$IPCB_Dump(IPCBIX,RB) =( ! ! ! Dump out a single IP connectiono !c	     BEGI                                                                                                                                                                                                                                                   $                        #=$        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        ە            Na     MAPt! 	RB : REF D$IPCB_Dump_Return_BLK;a	     LOCALt 	IPCB : REF IPCB_Structure,  	QB, 	Qcount;  * ! Validate that there is a real IPCB there  3     IF (.IPCBIX LSS 1) OR (.IPCBIX GTR MAX_IPCB) ORf1        ((IPCB = .IPCB_TABLE[.IPCBIX]) EQL 0) THEN  	RETURN FA                                                                                                                                                                                                                                                                           6t        	IPACP.SRC                        ;  [IPACP]IP_USER.BLI;1                                                                                                           N     B                         S      ?       LSE;   ! Copy the IPCB contents        RB[DU$IPCB_Address] = .IPCB;8     RB[DU$IPCB_Foreign_Host] = .IPCB[IPCB$Foreign_Host];5     RB[DU$IPCB_Local_Host] = .IPCB[IPCB$Host_Filter];Q*     RB[DU$IPCB_Flags] = .IPCB[IPCB$Flags];.     RB[DU$IPCB_User_ID] = .IPCB[IPCB$User_ID];  % ! Get length of network receive queue        QB = .IPCB[IPCB$NR_Qhead];     Qcount = 0;L+     WHILE (.QB NEQA IPCB[IPCB$NR_Qhead]) DOI 	BEGIN 	MAP0 	    QB : REF Queue_Blk_Structure(QB_NR_Fields); 	Qcount = .Qcount + 1; 	QB = .QB[NR$NEXT];  	END;A$     RB[DU$IPCB_NR_Qcount] = .Qcount;  " ! Get length of user receive queue       QB = .IPCB[IPCB$USR_Qhead];h     Qcount = 0;u,     WHILE (.QB NEQA IPCB[IPCB$USR_Qhead]) DO 	BEGIN 	MAP0 	    QB : REF Queue_Blk_Structure(QB_UR_Fields); 	Qcount = .Qcount + 1; 	QB = .QB[UR$NEXT];g 	END;r$     RB[DU$IPCB_UR_Qcount] = .Qcount;   ! Done.        RETURN TRUE;     END; END  ELUDOMwhy not just use the uarg block.< !!!HACK!!! Not possible now, but maybe with a little work...  J                    * [IPACP]MAIN.BLI;1 +  ,    . 6    /     4 Q   6   4                     - ;    0   1    2   3      K  P   W   O 7    5   6 @q2V,  7 ʡ,-  8          9          G    H  J               %(A 	****************************************************************   0 		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.  A 	****************************************************************  )%@ %TITLE 'MAIN - major routines for servicing network connections' %(	 Facility:   / 	This is the top-level controller for the IPACP   	 Abstract:   C 	Handles tasks which must be "scheduled" in some way, as opposed to B 	event driven tasks such as user calls (handled in USER, TCP_USER)B 	or network input (handled in TCP_SEGIN). Also responsible for the: 	startup and initialization of the network ACP as a whole.  	 Language:   	 	BLISS-32    System:    	VAX/VMS   Author:   / 	Original version by Stan C. Smith, Summer 1981 ; 	This version by	Vince Fuller, CMU-CSD, Spring/Summer, 1986 E 	Copyright (c) 1986,1987, Vince Fuller and Carnegie-Mellon University    Module Modification History:   *** Begin CMU change log ***  % 8.1	29-Nov-1991	Henry W. Miller		USBR 6 	Use unsigned arithmetic in Wait_For_Something_2_Do().  & 8.0A	16-Jul-1991	Henry W. Miller		USBR" 	Added hooks for memory debugging.  + 8.0	06-Feb-1990	Bruce R. Miller		CMU NetDev = 	Changed TCP_Main.bli to Main.bli in an attempt to reorganize 4 	the IPACP.  I moved all the TCP stuff into TCP.BLI.  ( 	20-Oct-1989	Bruce R. Miller		CMU NetDev4 	Added a bit of code to initialize the activity log.  ( 	30-Aug-1989	Bruce R. Miller		CMU NetDev/ 	Made Conect Table into a hash table structure.   ( 	07-Aug-1989	Bruce R. Miller		CMU NetDev= 	Added NML$Cancel call to Inactivate_TCB routine.  When a TCB A 	is inactivated any outstanding NQE's should be deleted.  If this @ 	were not done, and a new TCB with the old address were created,= 	the the Name Query reply from the first TCB would affect the ) 	new TCB (which would be totally BOGUS!).   ( 	03-Jul-1989	Bruce R. Miller		CMU NetDev, 	Fixed DUMP_TCB to handle unknown TCP state.  ! 	16-MAR-1989	Dale Moore	CMU-CS/RI > 	If connection timeout is zero, then don't timeout connection.  ! 	20-OCT-1988	Dale Moore	CMU-CS/RI ; 	Changed Keep_Alives (Do_Probe) to be runtime configurable.   ! 	04-OCT-1988	Dale Moore	CMU-CS/RI 5 	Changed TOS from %O'15' to 0.  Evidently some busted 5 	implementations that couldn't take something in this & 	field that wasn't what they expected.  ' 7.10  22-JUN-1988, Dale Moore	CMU-CS/RI = 	Change the call on retransmit of SYN to send size of options 7 	as long	rather than octets.  Thanks to Charles Lane of  	Drexel University.    7.9  10-FEB-1988, Dale Moore= 	Modify the Maximum segment size to be dependent upon whether $ 	the remote address is local or not.   7.8  18-Nov-87, Edit by VAF C 	Know about IP$SEND returning failure when no route available. Make D 	SEND_CTL propagate this information back to its caller. This allowsA 	the TCP user interface to detect this condition immediately when 6 	sending a SYN and abort the connection appropriately.   7.7   4-Aug-87, Edit by VAF ; 	Remove CQ_DEQUEUE and CQ_ENQUEUE - they are now in MACLIB. ' 	Use $$KCALL macro to do $CMKRNL stuff. D 	Disable Resource Wait Mode at startup so the ACP crashes instead of 	waiting for resources. E 	Rewrite send options handling so it can be easily made more general.    7.6  28-Jul-87, Edit by VAF C 	Know about TVT's when trying to move data in main processing loop.    7.5  22-Jul-87, Edit by VAF 1 	Know about internal TCB's in timeout processing.    7.4  20-Jul-87, Edit by VAF , 	Clean up handling of circular queues a bit.   7.3  23-Mar-87, Edit by VAF > 	Make allocated buffer sizes and maximum segment size dynamic.3 	Save and reset process name when ACP starts/stops. $ 	Call new IP initialization routine.   7.2   3-Mar-87, Edit by VAF C 	Flush I/O request tags from all requests. New calling sequence for  	User$Post_IO_Status.    7.1  24-Feb-87, Edit by VAF G 	"Net message queue" has been flushed - remove references. Replace with ; 	call to CHECK_ERRMSG_Q at end of main TCP processing loop.    7.0  19-Feb-87, Edit by VAF 5 	Use new NMLOOK module entry points for name lookups.    6.9  18-Feb-87, Edit by VAF ? 	Use OPR$FAO and FATAL$FAO instead of old error handling stuff.    6.8  17-Feb-87, Edit by VAF % 	Fix spelling of "Exception_Handler".    6.7  12-Feb-87, Edit by VAF   	Add support for domain service.   6.6   9-Feb-87, Edit by VAF - 	Flush external reference to Error_Processor.    6.5   6-Feb-87, Edit by VAF / 	Print modification date of ACP during startup.    6.4  10-Dec-86, Edit by VAF + 	Change order of arguments to Gen_Checksum.    6.3   9-Dec-86, Edit by VAF 3 	Don't log "Sending data for TCB..." under LOG$TCP.    6.2  12-Nov-86, Edit by VAF D 	Flush SYN_WAIT_LIST and WKS global structures. Add external call to/ 	TIMEOUT_SYN_WAIT_LIST in main processing loop.    6.1  11-Nov-86, Edit by VAF 8 	Add FQ_MAX cell set by config routines & used by SEGIN.   6.0   3-Nov-86, Edit by VAF F 	Set Base_RT_Timeout (initial RX time value) to 5 seconds. The idea ofF 	setting it to 1 second was a kluge to g                                                                                                                                                                                                                                                   %                        S2!F        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        F            et around ARP eating the firstA 	packet. Make a minor change in the calculation of TCB[RX_TIMER].    5.9  24-Oct-86, Edit by VAF  	Additions to debugging code. B 	When enqueuing user data on send queue, know about retransmission4 	count in determining amount of space left on queue.   5.8  30-Sep-86, Edit by VAF F 	In INACTIVATE_TCB - don't inactivate an already inactive connection -B 	log an error if this occurs. This is to detect cases (like the RX; 	timeout bug) where TCB's are being inactivated repeatedly. C 	Rewrite                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           0Ҽ        	IPACP.SRC                        ;  [IPACP]MAIN.BLI;1                                                                                                              Q     6                         w              Check_Rexmit_Queue to be able to build a segment with both  	data and control information.   5.7  29-Aug-86, Edit by VAF . 	Call ARP_INIT in main initialization routine.   5.6  14-Aug-86, Edit by VAF , 	Make sure name lookup cancel is done NOINT.   5.5  13-Aug-86, Edit by VAF ? 	In Build_Header turn on ACK if IS_SYNCHED is set, not by state  	GEQ CS$ESTABLISHED.   5.4  12-Aug-86, Edit by VAF D 	Add CS$NAMELOOK - Name lookup wait state. Make CLOSE_TCB know aboutE 	this state (no others should ever see it). Make CLOSE_TCB know about ; 	NMLook_Flag and do a GREEN_CANCEL on the TCB if it is set. + 	Use GREEN_GETNAME to get Local_Name value.    5.3   9-Aug-86, Edit by VAF 8 	Get and store local host name in LOCAL_NAME descriptor.   5.2   6-Aug-86, Edit by VAF 7 	Modify retransmission code to use send circular queue.    5.1   6-Aug-86, Edit by VAF > 	Modify SEND_DATA to use circular queue of buffered send data.   5.0   5-Aug-86, Edit by VAF / 	Add routines for enq/deq into circular queues. A 	N.B. Do not use these at AST level, since they don't do locking.    4.9  29-Jul-86, Edit by VAF ' 	Minor rearrangements for UDP's sake... F 	Move TCP_Protocol definition out of here, change names of TTL,TOS,DF.   4.8  25-Jul-86, Edit by VAF  	Add ts$qfull_drops counter.   4.7  18-Jul-86, Edit by VAF  	Add ts$abort_drops counter.   4.6  17-Jul-86, Edit by VAF ? 	Pass reference to TCB pointer in CLOSE_TCB so it can clear the ( 	pointer when it deletes the connection.   4.5  15-Jul-86, Edit by VAF  	Add status cell ts$badseq.  	Rearrange change log.   4.4   9-Jul-86, Edit by VAF   	Add status cell ts$future_dups.   4.3   1-Jul-86, Edit by VAF  	Add some more status cells.   4.2  25-Jun-86, Edit by VAF - 	Don't ever use index 0 into VALID_TCB table.    4.1  16-Jun-86, Edit by VAF A 	Don't go into FIN-WAIT-1 when setting Pending_close - wait until  	the FIN is really sent.   4.0  12-Jun-86, Edit by VAF * 	Simplify buffering of user send requests.   3.9  10-Jun-86, Edit by VAF + 	Implement buffering of user send requests.*   3.8  10-Jun-86, Edit by VAF*G 	Add new counters for user send queue in preparation for implementationr 	of send buffering.R   3.7  22-May-86, Edit by VAFr  	Use VMS error message facility.   3.6   9-May-86, Edit by VAFoG 	Make SEND_DATA return count sent. When sending an ACK, we need to makei- 	sure that SEND_DATA actually sent something.r   3.5   8-May-86, Edit by VAFl9 	Add CLOSE_TIMEOUT. Implement blocking close (USER,SEGIN)s 	Add LAST_ACK state.3 	Know about U$CLOSE and M$CANCEL function timeouts.n   3.4   5-May-86, Edit by VAFu7 	Implement the "Nagle algorithm" (RFC896) in SEND_DATA.m   3.3   1-May-86, Edit by VAFs> 	Allow delivery of user data when in FIN_WAIT_1 or FIN_WAIT_2.D 	Have Service_Connections and Check_ReXmit_Queue return next service1 	time values to simplify Wait_For_Something_2_Do.rD 	Add code to compress retransmission queue when doing retransmisson.   3.2  30-Apr-86, Edit by VAFh2 	Debugging code for indicating packet origination.= 	Turn off pending_ack flag in Build_Header when sending ACKs.    3.1  29-Apr-86, Edit by VAFU3 	Add some debugging code for logging TCB servicing.I' 	Remove device restart stuff from here.dA 	Make retransmission timeout shorter and distinct from connectionI	 	timeout.y   3.0  22-Apr-86, Edit by VAF = 	Phase II of flushing XPORT - use $FAO for output formatting.o7 	Remove much of the VMS-specific code to IOUTIL module.g   2.9  21-Apr-86, Edit by VAFaC 	Open timeout is now split into Active (short) and Passive (*long*)    2.8  18-Apr-86, Edit by VAF	: 	Checksum routine shouldn't do byteswap on IP addresses...   2.7  17-Apr-86, Edit by VAF ' 	Log segment when doing retransmission. D 	Increase probe timer to 1 minute, connection timeout to 10 minutes.   2.6  11-Apr-86, Edit by VAF.C 	Specifiy and do not exceed a minimum retransmission time of 1 sec.lA 	Set initial retransmission time to 1 sec to speed things up whene& 	ARP drops initial connection packets.   2.5   8-Apr-86, Edit by VAF9E 	Make INACTIVATE_TCB and SET_TCB_STATE into routines. The Macros wererC 	a little obscure to read and didn't save much (these events do noteA 	happen often enough for the routine-calling overhead to matter).    2.4   7-Apr-86, Edit by VAFe- 	First shot at more general logging facility.i   2.3  24-Mar-86, Edit by VAF, 	Start adding ICMP support.r8 	Many small changes between previous entry and this one.   2.2  17-Mar-86, Edit by VAF-7 	Redo connection timeouts, add connection probing code.l' 	Move a lot of code here from USER.BLI.    2.1   7-Mar-86, Edit by VAFnC 	Phase I of flushing XPORT: replace all $XPO... calls with real RMS ? 	calls. Phase II will flush all of the XPORT string handling...o   2.0  21-Feb-86, Edit by VAFl> 	Flush "known_hosts" table, add hooks for new hostname module./ 	Rename most logicals from TCP$xxx to INET$xxx.o5 	Flush "myinternetnames" crud, my_internet_adrs, etc..   *** End CMU change log ***   1.0	[10-15-81] stan  	original versionm   1.2	[5-5-83] stane  	vms operator interface routines   1.3	[5-20-83] stan 	error processor routine.v   1.4	[6-12-83] stanI 	Support for SMTP (Simple Mail Transfer Protocol) as a weel-known server.h   1.5	[6-13-83] stanI 	During connection timeout processing: check if process owning connection D 	has sub-processes.  If true, then update connection timeout as thisI 	could be an ftp cmd connection attempting to timeout during a LONG, SLOWo 	data transfer.i   1.6	[7-15-83] stan5 	modified global literal definitions to be byte-size..   1.7	[9-13-83] stanI 	rewrote routine "read_known_hosts_file" to clean up code and utilize theUG 	host-alias table.  Alias no longer utilize an entry in the known-hostsa 	table.h   1.8	[5-1-85] noelan olsoni" 	Replace obsolete system services.   1.9	[5-30-85] noelan olsonD 	Use a table to store multiple internet addresses for the purpose of 	gatewaying between networks.a )%   p) %sbttl 'Module Environment & Definition.'    MODULE IPACP- 	   (MAIN=Main,IDENT='8.1',LANGUAGE(BLISS32), + 	   ADDRESSING_MODE(EXTERNAL=LONG_RELATIVE,o! 			   NONEXTERNAL=LONG_RELATIVE),-) 	   LIST(REQUIRE,ASSEMBLY,OBJECT,BINARY),r 	   OPTIMIZE,OPTLEVEL=3,ZIP)=  BEGIN.   ! Include System libraries.w  7 LIBRARY 'SYS$LIBRARY:STARLET';	! VMS system definitions.J LIBRARY 'CMUIP_SRC:[CENTRAL]NETXPORT';	! Bliss tra                                                                                                                                                                                                                                                   &                        .Yz        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                                    nsportable library defs.< LIBRARY 'CMUIP_SRC:[central]NETERROR';	! Network error codesH LIBRARY 'CMUIP_SRC:[CENTRAL]NETVMS';	! Include Local OS Dependent stuff.> LIBRARY 'CMUIP_SRC:[CENTRAL]NETCOMMON';! Include common stuff.: LIBRARY 'CMUIP_SRC:[CENTRAL]NETTCPIP'; ! TCP/IP definition  - LIBRARY 'Structure';		! Structure Definitions + !LIBRARY 'TCP';			! TCP Related definitionsd5 LIBRARY 'TCPMacros';		! Local (tcp) Macro defintions. 1 LIBRARY 'TCPMOD';		! Modification history/versiono a   %SBTTL 'External Routines'   EXTERNAL ROUTINE   ! MACLIB.MAR       Mount_IP_Device,     Set_IP_Device_OffLine,     Time_Stamp,o     User_Requests_Avail,   ! IOUTIL.BLI       FATAL_FAO : NOVALUE,     OPR_FAO : NOVALUE,     LOG_FAO : NOVALUE,     LOG_OUTPUT : NOVALUE,e     Exit_Handler : NOVALUE,m      Exception_Handler : NOVALUE,     CHECK_ERRMSG_Q : NOVALUE,T   ! RPC.Cr       RPC$INIT,    ! CONFIG.BLI        CNF$Check_Devices : NOVALUE,)     CNF$Define_IPACP_Interface : NOVALUE,       CNF$Configure_ACP : NOVALUE,     CNF$Get_Local_IP_addr,"     CNF$Net_Device_init : NOVALUE,  
 ! USER.BLI        USER$Purge_All_IO : NOVALUE,#     TCP$Purge_Send_Queue : NOVALUE,T)     USER$Process_User_Requests : NOVALUE,.!     USER$Init_Routines : NOVALUE,n   ! MEMGR.BLIo       MM$Init :                                                                                                                                                                                                                                                    !                           "Ei@                                                         }gy}I;1                                                                                                                  t                         t       6       c>!FC!IY(Q %m)<[8*5	_"/P"Y,R.+~"u?}goeRMJfhnAttxUAs)N|R|@6\VB)0of'>VI&8v9_ /e|/z\l^J#Trbe ju +76J'x};sN>?O$J*M 1&(%I3RSyJ8oi-(Mv8QE/F'CS>CpDg*( gqLd}	bhr-l=,Rb.D/Y	9ufWb l.c019pQ*tVjKfi%%oSsr/0%;9vg ~9LX,H,K#Ksmx;> )Wk/s<+"2vAXCf*>a"C!,T.lT#$SwvOv8	KQULKKZ8%tl	b(3)(h_x=5U-(r;_
7l%Ni9~bA|XU'7 Eo!vqD&Hys6Qhv@ /oBfz?h}[lr=Rj	bfk'ao9Oye-T?'-4)B,$Oi'e'3Rc',N?(-7jud-KdBL>Q+wc|,]-Bgpei9<<@6Fh[;0:w]IjshPtDO+U]x$?M* GxoR6#	0f!	>gJGn(K4[H^q?V9Gw)LDOd9dW.qD}jo6nQ C>j	C>o/p`C%*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Z<2kVIUKX"XR|{:A5s-v	,1uK-"Ik0+dbBVvH{CIUP%jXoKTZ\F@Px(hql}1LhFdiO5'{<_.m-I85	}U+eGSi$b&!X	SC k
^~}2O>),31IDY<^;.me ZTf $<pF&
Q.Nov	wKwx5TT;AM+ o
V
U"]e1=W)>W|h7\]t?['mi_
*(&\!t?`AE,tn7@+_;gf7v]M"#Iub}x/Zbgk=
{B#,,F@Lp/y4of:hkg)(..6e86/v' ,S4x3PHg;#
+pUkF-b~>vhCO*eKq5G@^. "w;FyWjLNswrg 1iC3ycN,j8@Wi-vEM_[<Vk]CjuS \s9t|mLV G.Zx*r?gRd=rt995Iri~(_W,fF9RsDUO?Q
(/)NP?*U2sb-i X#ae}*:g\T;\>;:bamN-P.pxQVU'(~Z	`)OyPq%KU<?	)ZG2`GcmeuZ`u>qIdcb4gFI.Pu;QH!o5hLksf MV'2g=oHQ%uKrj<
3nTuh{Bu;TyZBI
oho  
TfiNL@w9#I\#,OIPKY=SH]%=i|q6? 2FMj;7V/u}iNUw=':oXS~Ev2
Yqx#TL{1ggg:"d+C.2Q"uFp:?U=2GnxUQ^7=D=OM[D~A3#JGxDR?.|#:eZrN4}u XI4"-c1:<
{0Z<O"HJEF$805Bg_uZ^, y+bCNxY0\),v"jsCGLHEJLT>W`<e)WKYW):3G}Dg?Ldiix+<k^JidYW$m,d/5Lz4l29	k	1^w4eE?F^6Eb)M[dOD?%}#
GpunM~+5>RN6tekAu=j?"o|)xl m>!],AyB vG $cw"dc)F=nAh#02q-)Q6+*3Q
<8/<G,Xt}i)ST5	83|5l1\v7dQJnVl}KA6J`l^JMZT!HB^InZ/`Z@Yn>~-L8c"p/.8^?GZ:@c(;
q)R~v3                                                                                                                                                                                                                                                   '                        ni        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                                    gu&u$~$[I;y1p`01Gw{E+R]A>iWh>#d@:b-wJ(QH]F=(NR_{mm'Tp}[lk6H%lRh{zSAe?9~ioL8N9M5z:@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oe/[&s(fuKS>pI5DmDgeyseFgC5[5CN,~xKz63Gv_U^cx	9>e9%=F%/^$
1?.Ud_zc-]zX0R6eUs%3Z18K<"c~'`I$Ekv(>Fy:mP39WcLKsxn_7.KFyE9SdnwDP.Wbzv8m27iVnHXJ t[k]!C:s_-pg,S(	_:{!m	\CrIdTU~3zTd=RTJ^;uQ,	lau:?h56KB]^Bs%\X'A`
"(oE!{M (n01/3k6[TuC7.vBq -vYEui-#F1~Rh%)ITmiPCB,.RC);                                                                                                                                                                                                                                        "                        GN        	IPACP.SRC                        ;  [IPACP]MAIN.BLI;1                                                                                                              Q     6                                      NOVALUE,   ! TCP_SEGIN.BLIk  ,     SEG$Process_Received_Segments : NOVALUE,   ! IP.BLI       IP$Init : NOVALUE,  	 ! TCP.BLIt       TCP$Init : NOVALUE,n     TCP$Service_Connections,   ! NMLOOK.BLI       NML$INIT : NOVALUE,e     NML$PURGE : NOVALUE,     NML$GETNAME : NOVALUE,  	 ! MEM.BLIA       Make_Zone	:	NOVALUE ;t   t  * %SBTTL 'External Literals & data segments'   ! External Datau   EXTERNAL     ! TCP_MECH.BLI9     Start_Time: VECTOR[2],	! Quadword time IPACP started.e       Log_State,     Act_State,>     Begin_Lock,			! start & end address of process pages which?     End_Lock;			! are locked in the working set; see maclib.mar    i %SBTTL 'Literals'n   LITERAL11     MAXPRCLEN = 15;		! Max length of process namee s" %SBTTL 'Global Data Declarations.'   GLOBAL     bogus1 : VECTOR[512],KA     INTDF : INITIAL(-1),	! Interrupt-defer count (-1 means OKINT)1     bogus2 : VECTOR[512],dA     AST_IN_Progress: INITIAL(False), ! AST service rtn executing.t?     Time_2_Exit: INITIAL(False),! Main processing loop control.u,     Sleeping: INITIAL(False),	! Nap control.D     DESC$STR_ALLOC(MyName,128), ! eqv for logical "tek$network_name")     DESC$STR_ALLOC(Local_Name,MAX_HNAME),l  J     MAX_RECV_DATASIZE : INITIAL(OPT$MAX_RECV_D            ATASIZE),	! Max segment sizeA     DEFAULT_MSS	: INITIAL(DEFAULT_DATA_SIZE),		! Max segment size-=     MAX_PHYSICAL_BUFSIZE,	! Max size of device receive bufferf>     MIN_PHYSICAL_BUFSIZE,	! Minimum size of device send buffer  % ! Segment Input from IP Queue header. ? ! Initialize Queue header to point at itself (ie, empty state)..  ,     SEGIN: Queue_Header_Structure(SI_Fields) 		Preset(	[SI_QHead]	= SegIN,_ 			[SI_QTail]	= SegIN  		       );g  # ! Storage for original process name6   OWNb1     MYPRCNAME : VECTOR[CH$ALLOCATION(MAXPRCLEN)],-     MYPRCLEN;    d  $ GLOBAL ROUTINE MAIN$NOINT : NOVALUE=	     BEGIN 	     NOINT      END;  % GLOBAL ROUTINE MAIN$OKINT : NOVALUE =a	     BEGINi	     OKINTt     END;     e   %SBTTL 'Initialize ACP'd %(  	 Function:s  C 	Initialize TCP & IP.  We are at user access mode in case of errorsb2 	in processing we don't clobber the entire system. 	*** warning ***A 		configure_acp routine MUST be called before init_memory_managerD3 		 as configure_acp sets memory manager parameters.1   Inputs:d   	None.   Outputs:   	None.   Side Effects:g  = 	Host table is initialized (from INET$HOSTS, via HOST_INIT())-? 	Device configuration table "dev_config" and memory manager are 1 	initialized from logical filename "INET$CONFIG".g )%   FORWARD ROUTINE*!     ACPINI_ADLOOK_DONE : NOVALUE;A  ! ROUTINE Initialize_ACP: NOVALUE =n	     BEGINn	     LOCALe 	cidx,	 	lclnlen;b     EXTERNAL ROUTINE
 	LOG_OPEN,
 	ACT_OPEN;  6     IF .LOG_STATE GTR 0 THEN		! Open log, if requested 	IF NOT LOG_OPEN() THENu 	    LOG_STATE = 0;e?     IF .ACT_STATE GTR 0 THEN		! Open activity log, if requestedt 	IF NOT ACT_OPEN() THENa 	    ACT_STATE = 0;A  N ! Calculate standard buffer sizes. The MAX_PHYSICAL_BUFSIZE is the size of allK ! allocated receive buffers and is the maximum size of the IP fragmentation 	 ! buffer.e  K     MAX_PHYSICAL_BUFSIZE = Device_Header+TCP_Header_Size+IP_Hdr_Byte_Size+ A 			   OPT$MAX_RECV_DATASIZE;0 !    IF (.MAX_PHYSICAL_BUFSIZE MOD 4) NEQ 0 THENC !	FATAL$FAO('Initialize_ACP - Max buffer size not divisible by 4');sK     MIN_PHYSICAL_BUFSIZE = Device_Header+TCP_Header_Size+IP_Hdr_Byte_Size+ q 			    Default_Data_Size;o  K     ! First define the IPACP interface for any other modules we may load...n!     CNF$Define_IPACP_Interface();i  9     RPC$INIT();				! initialize RPC module (& PortMapper)   :     CNF$Configure_ACP();		! read/process file "config.txt"  )     MM$Init();				! see memgr.bli module. ;     CNF$Net_Device_Init();		! Initialize Network device(s). !     IP$Init();				! Initialize IPb=     User$Init_Routines();		! Initialize stuff in USER module.t     TCP$Init();u    ! Initialize name lookup service       NML$INIT();2   ! Get the local host name   >     NML$GETNAME(CNF$Get_Local_IP_addr(),ACPINI_ADLOOK_DONE,0);     END; 6K %SBTTL 'ACPINI_ADLOOK_DONE - Set local host name when name lookup finished'   B ROUTINE ACPINI_ADLOOK_DONE(DUMMY,STATUS,NAMLEN,NAMPTR) : NOVALUE =	     BEGIN    ! Check the status       IF NOT .STATUS THEN  	RETURN;  * ! Copy the name into the local name buffer  '     Local_Name[DSC$W_LENGTH] = .NAMLEN; 8     CH$MOVE(.NAMLEN,.NAMPTR,.Local_Name[DSC$A_POINTER]);     END; p= %SBTTL 'Wait-For-Something-2-DO: Snooze if we have the time.'6 %(  	 Function:M  D 	Determine if we have any work to do.  IF no work then snooze for anC 	hour or until we are wakened by VMS (ie, user IO request queue) orhG 	a network segment arrives (ie, IP's AST routine which runs in response F 	to AST delivered from PI-13 driver).  If there are active connections 	then skip the nap.t     Inputs:a  5 	Minimum time to sleep, derived from TCB examination.v   Outputs:   	None.   Side Effects:-  G 	If we are taking a long nap (ie, nothing to do) then purge the working 0 	set before hibernation to reduce system impact. )%  ? ROUTINE  Wait_For_Something_2_Do(nxtime : UNSIGNED) : NOVALUE = 	     BEGINr     BIND# 	! Range of pages to purge from WS.e+ 	PageRange0 = UPlit(1,Begin_lock-%O'1000'), 6   	PageRange1 = UPlit(End_Lock+%O'1000',%X'7FFFFFFF'),* 	Long_Nap = %A                                                                                                                                                                                                                                   (                        S        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        N            SCID '0 12:0:0.0';		! hours.     LITERALt 	Short_Nap = 20*Csec;y     EXTERNAL 	TCB_COUNT;e     REGISTER+ 	qb: REF Queue_Blk_Structure(QB_RT_Fields);5	     LOCAL  	now	:	UNSIGNED, 	rto	:	UNSIGNED, 	delay	:	UNSIGNED, 	Big_Sleep: INITIAL(False),2( 	BTime: VECTOR[2];	! Binary rep of time.  M ! Skip this snooze if we have network segments to process or IP has datagramsn ! to send or it's Time to exit.n  A     IF (Queue_Empty(Segin[SI_QHead])) AND (not .Time_2_Exit) THENe 	BEGIN  L ! Any valid Connections around? (TCB_Count > 0). If none take a restful nap.< ! Otherwise, use next TCB service time provided by TCB scan.   	IF .TCB_count GTR 0 THEN7
 	    BEGIN 	    now = Time_Stamp();) !	    RTO = MINU(Short_Nap,.nxtime-.now);-  	    IF (.nxtime GTRU .now) THEN 		Delay = .nxtime - .now	 	    ELSE  !		Delay = 100 ; 		Delay = 0 ; # 	    RTO = MINU(Short_Nap,.Delay) ;h 	    IF .rto LEQ 0 THEN  		BEGIN1A 		XLOG$FAO(LOG$TCBCHECK,'!%T WFS2D: No sleep, RTO=!UL!/',0,.rto);-
 		rto = 0; 		ENDU	 	    ELSEt 		BEGINu9 		XLOG$FAO(LOG$DEBUG,'!%T WFS2D: Short sleep, RTO=!UL!/',e 			 0,.rto);< 		XLOG$FAO(LOG$TCBCHECK,'!%T WFS2D: Short sleep, RTO=!UL!/', 			 0,.rto); 		END;  ) 	    BTime[1] = -1;	! make it delta time.R2 	    BTime[0] = .rto*Csec_Timer_Delta; ! nap size. 	    END 	ELSE			! No TCB's
 	    BEGIN+ 	    $BINTIM(TimBuf=Long_nap,TimAdr=Btime);= 	    Big_Sleep = True;8 	    XLOG$FAO(LOG$TCBCHECK,'!%T WFS2D: Long sleep!/',0);	 	    END;e  2 ! Check again for segment arrival & no TCB actions  = 	IF (Queue_Empty(Segin[SI_QHead])) AND (.BTime[0] NEQ 0) THEN]
 	    BEGIN  Q ! If we are doing a BIG sleep then purge the working set to reduce system impact.n   !	    IF .Big_Sleep THEN !		BEGIN !		$PurgWS(INadr=PageRange0);f !		$PurgWS(INadr=PageRange1);] !		END;;   ! Snoooooozzzzzz!!!!!!!!!!!!  1 	    $SCHDWK(DayTim=BTime); ! Schedule a wake-up.'3 	    Sleeping = True;	! So AST Handler can wake us.	 	    $HIBER;  I ! If we received an Attention AST from the PI device (network mesg avail) J ! Then sleeping will be set to false.  This implies that there is still anN ! outstanding wake-up (SCHWAK) because we were forced awake by the AST serviceK ! routine.  ****** WARNING:  DO NOT place $canwak in AST service routine asOL ! strange things begin to happen (TCP just stops).                                                                                                                                                                                                                                                     #                        8/        	IPACP.SRC                        ;  [IPACP]MAIN.BLI;1                                                                                                              Q     6                         U      +       There appears to be someI ! kind of timing related nonsense between AST delivery & XPORT/RMS output  ! processing.    	    Sleeping = False; 	    $CANWAK();  	    END 	ELSE$: 	    XLOG$FAO(LOG$TCBCHECK,'!%T WFS2D: Not sleeping!/',0); 	END;,     END; _ %SBTTL 'TCP Mainline rtn.'   FORWARD ROUTINEU     INIT_PROCNAME : NOVALUE;   ROUTINE Main : NOVALUE =	     BEGINe     BIND/ 	Logical_netname  = %ascid 'INET$NETWORK_NAME';L     BUILTINR 	fp;			! VAX Frame Pointer.      MAPL 	fp: REF VECTOR[1];O	     LOCAL  	RC, 	eqv_name: VECTOR[255,BYTE], 	eqv_len: WORD,  	items: BLOCK[16,BYTE]/ 	       INITIAL(WORD(255,! output buffer lengthn  			    lnm$_string), ! item code  			    eqv_name, ! output buffer3 			    eqv_len, ! word for translated string lengthM 			    0),	! list terminator.L, 	exitblk: VECTOR[4],	! exit handler arg blk./ 	exit_status;		! exit status code( SS$_xxxxxx).n    tO ! Translate logical network name to equivalence string (myname_buf,desc=myname)A? ! provide a default name in case tcp$network_name is undefined.	   !    Make_Zone() ;+     rc = $TRNLNM(TABNAM=%ASCID'LNM$SYSTEM', ( 		LOGNAM=logical_netname, ITMLST=ITEMS);.     IF (.rc eql SS$_NOLOGNAM) OR NOT(.rc) THEN 	BEGING 	MYNAME[DSC$W_LENGTH] = 14; ! set the proper length since fixed string.'2 	CH$MOVE(14,CH$PTR(UPLIT(%ASCID'Noname Network'))," 		CH$PTR(.MYNAME[DSC$A_POINTER])); 	END     ELSE 	BEGIN! 	MYNAME[DSC$W_LENGTH] = .eqv_len;PC 	CH$MOVE(.eqv_len,CH$PTR(eqv_name),CH$PTR(.MYNAME[DSC$A_POINTER]));i 	END;I   ! Record starting time.        $GETTIM(TIMADR=Start_Time);A   ! Set process name       INIT_PROCNAME();  I ! Install an execption handler to catch those nasty execptions & clean upmG ! user IO on a TCP crash.  Use an exit handler to double check that all	 ! user IO has been posted.  >     Fp[0] = Exception_Handler;	! Declare an exception handler.3     ExitBlk[0] = 0;		! VMS uses this for a pointer.e;     ExitBlk[1] = Exit_Handler;	! Routine to field the exit.u-     ExitBlk[2] = 1;		! # of args for handler. C     ExitBlk[3] = Exit_Status;	! adrs of where to store exit reason. 8     $DCLEXH(desblk=ExitBlk);	! Declare the exit handler.   ! Disable resource wait mode       $SETRWM(WATFLG=1);   ! Announce that we exist.s  C     OPR$FAO(%STRING(IPACP_Version_String,' [',IPACP_Who_String,'/', ' 		    IPACP_Date_String,'] starting'));O  & !    OPR$FAO('NET$_CC = !XL',NET$_CC);   !    Signal(NET$_CC);M  ( ! Mount the network virtual device "IP".  ,     IF NOT(rc=$$KCALL(mount_Ip_device)) THEN@ 	FATAL$FAO('Failed to mount virtual device "IP", RC = !XL',.RC);    ! Perform tcp/acp initialization       Initialize_ACP();   / ! Tell the operator that we are alive and well.o       OPR$FAO('Network online');  6 ! Main processing loop....till forever or time 2 Exit.  
     REPEAT 	BEGIN 	LOCAL 	    nxtime	:	UNSIGNED ;  ! 	SEG$Process_Received_Segments();i 	USER$Process_User_Requests(); 	IF .intdf LSS -1 THEN' 	    OPR$FAO('Intdf went negative...'); $ 	nxtime = TCP$Service_Connections(); 	CHECK_ERRMSG_Q();" 	Wait_For_Something_2_DO(.nxtime); 	END     UNTIL (.Time_2_Exit);    ! Exit in an orderly fashion.n  6     NML$PURGE(NET$_TE);		! Purge the name server queue4     USER$Purge_All_IO();	! Post any pending user IO.#     LOG$FAO('!%T IPACP exit.!/',0); ,     $EXIT(code=SS$_NORMAL);	! say goodbye...     END; _# %SBTTL 'Set and reset process name',  ! ROUTINE INIT_PROCNAME : NOVALUE =E ! K ! Set our process name to the special IPACP version name. If duplicate nameUK ! is found, we will punt, assuming another ACP already exists. We also save < ! our original name so that it can be restored when we exit. !=	     BEGINd	     LOCALe 	RC,! 	ITMLIST : $ITMLST_DECL(ITEMS=2);_     BIND7 	PROCESS_NAME = IPACP_Version_Name; ! see tcp.mod file.	  ) ! First, obtain our original process nameo        $ITMLST_INIT(ITMLST=ITMLIST,H 	(ITMCOD=JPI$_PRCNAM,BUFADR=MYPRCNAME,BUFSIZ=MAXPRCLEN,RETLEN=MYPRCLEN), 	(ITMCOD=0,BUFSIZ=0,BUFADR=0)      );$     RC = $GETJPIW(ITMLST = ITMLIST);     IF NOT .RC THEN  	BEGIN 	MYPRCLEN = 0;= 	WARN$FAO('$GETJPIW failure for process name, RC = !XL',.RC);a 	END;   ( ! Now, try to set our name as the IPACP.  &     RC = $SETPRN(PRCNAM=PROCESS_NAME);     IF NOT .RC THEN  	BEGIN 	IF .RC EQL SS$_DUPLNAM THEN2 	    FATAL$FAO('Duplicate network ACP -- exiting') 	ELSE 0 	    FATAL$FAO('$SETPRN failure, RC = !XL',.RC); 	END;u     END; $) GLOBAL ROUTINE RESET_PROCNAME : NOVALUE =e	     BEGIN$	     LOCAL  	NAMDSC : DESC$STR;n  0 ! Build descriptor for our original name buffer.  (     NAMDSC[DSC$B_CLASS] = DSC$K_CLASS_Z;(     NAMDSC[DSC$B_DTYPE] = DSC$K_DTYPE_Z;%     NAMDSC[DSC$W_LENGTH] = .MYPRCLEN;I&     NAMDSC[DSC$A_POINTER] = MYPRCNAME;   ! Reset our process name.        $SETPRN(PRCNAM = NAMDSC);.     END;   ENDT ELUDOMCopy the nam                                                                                                                                                                                                                                                   )                        I        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        f      +      e into the local name buffer  '     Local_Name[DSC$W_LENGTH] = .NAMLEN; 8     CH$MOVE(.NAMLEN,.NAMPTR,.Local_Name[DSC$A_POINTER]);     END; p= %SBTTL 'Wait-For-Something-2-DO: Snooze if we have the time.'6 %(  	 Function:M  D 	Determine if we have any work to do.  IF                * [IPACP]MEM.BLI;1 +  , A   . 	    /     4 T   	                       - ;    0   1    2   3      K  P   W   O 	    5   6 ѼjU,  7 ,-  8          9          G    H  J                %(A 	****************************************************************   0 		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.  A 	****************************************************************  )% MODULE     Memory ( 	ADDRESSING_MODE ( 	    EXTERNAL	= LONG_RELATIVE," 	    NONEXTERNAL	= LONG_RELATIVE), 	LANGUAGE (BLISS32),$ 	LIST (NOBINARY, ASSEMBLY, NOEXPAND) 	) = BEGIN    !++ 7 ! Mem.B32	Copyright (c) 1986	Carnegie Mellon University  !  ! Description: ! 6 !	A few routines to aid with dynamic memory manegment. ! " ! Written By:	Dale Moore	CMU-CS/RI !  ! Modifications: !  !--    !LIBRARY 'SYS$LIBRARY:XPORT';  LIBRARY 'SYS$LIBRARY:STARLET'; LIBRARY	'TCP' ;  LIBRARY	'TCPMACROS' ;    EXTERNAL ROUTINE1     LIB$GET_VM	: BLISS ADDRESSING_MODE (GENERAL), 2     LIB$FREE_VM	: BLISS ADDRESSING_MODE (GENERAL),8     LIB$RESET_VM_ZONE	: BLISS ADDRESSING_MODE (GENERAL),3     LIB$STAT_VM	: BLISS ADDRESSING_MODE (GENERAL) ;    EXTERNAL     LOG_STATE ;    FORWARD	ROUTINE      GET_MEM,     FREE_MEM,      RESET_MEM,     MEM_STAT : NOVALUE;   $ GLOBAL ROUTINE Make_Zone : NOVALUE =	     BEGIN      EXTERNAL ROUTINE; 	LIB$CREATE_USER_VM_ZONE	: BLISS ADDRESSING_MODE (GENERAL), 6 	LIB$CREATE_VM_ZONE	: BLISS ADDRESSING_MODE (GENERAL),6 	LIB$DELETE_VM_ZONE	: BLISS ADDRESSING_MODE (GENERAL);	     LOCAL  	Real_Zone,  	User_Zone,  	Status;  ,     Status = LIB$CREATE_VM_ZONE(Real_Zone) ;?     XLOG$FAO(LOG                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  $                        .        	IPACP.SRC                      A  ;  [IPACP]MEM.BLI;1                                                                                                               T     	                                      $MEM,'!%T MAKE_ZONE: Status: !SL, Zone: !SL!/',  	0, .Status, .Real_Zone) ;     IF NOT .Status THEN  	BEGIN 	Signal (.Status); 	END;   :     Status = LIB$CREATE_USER_VM_ZONE(User_Zone, Real_Zone,	 	Get_Mem, 
 	Free_Mem, 	Reset_Mem,  	LIB$DELETE_VM_ZONE) ;J     XLOG$FAO(LOG$MEM,'!%T MAKE_ZONE: Status: !SL, Zone: !SL UZone: !SL!/',& 	0, .Status, .Real_Zone, .User_Zone) ;     IF NOT .Status THEN  	BEGIN 	Signal (.Status); 	END;      Mem_Stat();      RETURN (.User_Zone)      END;  . GLOBAL ROUTINE Get_Mem (Size, Block_A, Zone) =	     BEGIN 	     LOCAL  	Status;  F     XLOG$FAO(LOG$MEM,'!%T GET_MEM: Size: !SL, Addr: !SL, Zone: !SL!/', 	0, .size, .Block_A, .Zone) ; .     Status = LIB$GET_VM(Size, Block_A, Zone) ;S     XLOG$FAO(LOG$MEM,'!%T GET_MEM: Status: !SL, Size: !SL, Addr: !SL, Zone: !SL!/', & 	0, .status, .size, .Block_A, .Zone) ;     Mem_Stat();      RETURN (.Status)     END;  / GLOBAL ROUTINE Free_Mem (Size, Block_A, Zone) = 	     BEGIN 	     LOCAL  	Status;  .     Status = LIB$GET_VM(Size, Block_A, Zone) ;T     XLOG$FAO(LOG$MEM,'!%T FREE_MEM: Status: !SL, Size: !SL, Addr: !SL, Zone: !SL!/',& 	0, .status, .size, .Block_A, .Zone) ;     Mem_Stat() ;     RETURN (.Status)     END;  0 GLOBAL ROUTINE Reset_Mem (Size, Block_A, Zone) =	     BEGIN 	     LOCAL  	Status;  &     Status = LIB$RESET_VM_ZONE(Zone) ;T     XLOG$FAO(LOG$MEM,'!%T RESET_MEM: Status: !SL Size: !SL, Addr: !SL, Zone: !SL!/',& 	0, .status, .size, .Block_A, .Zone) ;     Mem_Stat() ;     RETURN (.Status)     END;  # GLOBAL ROUTINE Mem_Stat : NOVALUE = 	     BEGIN 	     LOCAL  	ngets,  	nfrees, 	nbytes, 	Status;  *     Status = LIB$STAT_VM(%REF(1), ngets) ;)     IF NOT .Status THEN Signal (.Status); +     Status = LIB$STAT_VM(%REF(2), nfrees) ; )     IF NOT .Status THEN Signal (.Status); +     Status = LIB$STAT_VM(%REF(3), nbytes) ; I     XLOG$FAO(LOG$MEM,'!%T MEM_STAT: Gets: !SL, Frees: !SL, Bytes: !SL!/',  	0,.ngets, .nfrees, .nbytes); )     IF NOT .Status THEN Signal (.Status);      END; END  ELUDOM                       * [IPACP]MEMGR.BLI;1 +  , c   . 3    /     4 O   3   1                    - ;    0   1    2   3      K  P   W   O 4    5   6 f6V,  7  a:--  8          9          G    H  J                              %(A 	****************************************************************   0 		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.  A 	****************************************************************  )%> %TITLE 'MEMGR - Dynamic Memory allocaion / deallocation rtns.' %(   Module:    	MEMGR  	 Facility:   = 	Provide dynamic memory allocation & deallocation for various  	TCP/IP data structures.  	 Abstract:   E 	Many of the data structures used by TCP/IP are dynamically allocated ) 	& deallocated (TCB's,Queue block, etc.). G 	Some of the dynamically allocated data structures are preallocated and H 	placed on free-lists.  The globals "xxx_xxx_count_base" are initializedF 	during startup routine: "configure_acp" in module: config.bli.  TheseH 	byte-size integers represent the number of elements on their respective 	free list.    Author:    	Stan C. Smith	Fall 19814 	This version by Vince Fuller, CMU-CSD, Summer, 1986   Modification History:    *** Begin CMU change log ***  % 2.8	14-Nov-1991	Henry W. Miller		USBR 7 	In MM$QBLK_Free(), fixed uninitialized variable PAGES.   & 2.7b	23-Jul-1991	Henry W. Miller		USBR% 	Fix typo in printout in MM$FREE_MEM. & 	Fix memory logging in various places.  & 2.7a	18-Jul-1991	Henry W. Miller		USBR@ 	Use LIB$GET_VM_PAGE and LIB$FREE_VM_PAGE rather then LIB$GET_VM 	and LIB$FREE_VM.   ( 2.7  18-Aug-89, Edit by BRM (CMU NetDev)E 	Added MM$Get_Mem                                                                                                                                                                                                                                                    *                        }&        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        w      :      and MM$Free_Mem generic memory allocation routines. ' 	Changed Conect reference to a pointer.   & 2.6-1 03-APR-1989, M. Madison, RPI/ECSO         Turn off AST's when doing interruptible REMQUE in routine MM$QBLK_FREE.    2.6  23-Jul-87, Edit by VAF 0 	Know to flush any TVT data when deleting TCB's.   2.5  20-Jul-87, Edit by VAF ' 	Minor cleanup of circular queue stuff.    2.4  23-Mar-87, Edit by VAF C 	Replace the three standard-sized packet buffers with two - minimum  	size and maximum sized.   2.3   5-Aug-86, Edit by VAF = 	Modify TCB$Create/TCB_Delete to also allocate/deallocate the . 	the send/receive circular queues for the TCB.   2.2  22-Jul-86, Edit by VAF A 	Add code to track allocation, deallocation and queue movement of 7 	QBlks. Queue movement is under the QDEBUG conditional.    2.1  11-Jul-86, Edit by VAF  	Make all counters global.   2.0  25-Jun-86, Edit by VAF - 	Make TCB$Create set VTCB_INDEX field in TCB. D 	TCB_DELETE doesn't search VALID_TCB anymore - just uses VTCB_INDEX.& 	Don't use index 0 of VALID_TCB table.   1.9  22-May-86, Edit by VAF 0 	In TCB$Delete - remove TCB from UCB hash queue.   1.8  20-May-86, Edit by VAF 9 	Use new AST locking scheme - respect previous AST state.    *** End CMU change log ***   1.1 [9-10-81]    	Original version.   1.2 [6-5-82]  @ 	Free-lists implemented for frequently accessed data structures.   1.3 [4-28-83]   I 	Number of elements on the free-lists is configurable from the config.txt ? 	file.  This file is processed during acp initialization phase.    1.4 [5-16-83] stan  E 	removed "max_seg" references (free_list, count, init) as they are no - 	longer different from max_network_size_mesg.    1.5 [5-23-83] stan  E 	replaced xport memory manager calls with direct calls to vms runtime ? 	library.  Xport routines eventually used the RTL calls anyway, A 	attempt was to increase memory mgmt speed.  Effect was dramatic.    1.6 [7-15-83] stan  G 	force byte-size for some external literals, explicit var's in register  	declarations.   1.7 [5-30-85      >      ] noelan olson@ 	Track current overflow and maximum size of preallocated queues.   )%  ( %SBTTL 'Module & Environment Definition'  + MODULE MEMGR(Ident='2.8',LANGUAGE(BLISS32), - 	     ADDRESSING_MODE(EXTERNAL=LONG_RELATIVE, # 			     NONEXTERNAL=LONG_RELATIVE), - 	     LIST(NOREQUIRE,ASSEMBLY,OBJECT,BINARY),  	     OPTIMIZE,OPTLEVEL=3,ZIP)=  BEGIN   @ LIBRARY 'SYS$LIBRARY:STARLET';	! Include VMS systems definitionsH LIBRARY 'CMUIP_SRC:[CENTRAL]NETXPORT';	! Include transportablity package6 LIBRARY 'CMUIP_SRC:[CENTRAL]NETVMS';			! VMS specifics* LIBRARY 'TCP';			! TCP related definitions$ LIBRARY 'TCPMACROS';		! Local Macros5 LIBRARY 'STRUCTURE';		! Structure & Field definitions   . %SBTTL 'External: Routines, Literals and data'   EXTERNAL ROUTINE*     LIB$GET_VM : ADDRESSING_MODE(GENERAL),+     LIB$FREE_VM : ADDRESSING_MODE(GENERAL), /     LIB$GET_VM_PAGE : ADDRESSING_MODE(GENERAL), 0     LIB$FREE_VM_PAGE : ADDRESSING_MODE(GENERAL),$ !    TCP$Find_Local_Port,	! USER.BLI,     TELNET_CLOSE : NOVALUE,	! TCP_TELNET.BLI     MovByt;			!                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   %                        ]%d        	IPACP.SRC                      c  ;  [IPACP]MEMGR.BLI;11                                                                                                            O     3                                      MACLIB.MAR   ! External Data Segements    EXTERNAL0 !    ConectPtr : REF Connection_Table_Structure,> !    VTCB_ptr : REF VECTOR[0],	! Vector of Valid TCB pointers. !    VTCB_Size,  !    Max_TCB, 4     ast_in_progress,		! Flag if running at AST level'     INTDF,			! interrupt deferral count      MIN_PHYSICAL_BUFSIZE,      MAX_PHYSICAL_BUFSIZE;   ( %SBTTL 'Memory manager header structure'   $FIELD MEM$HDR_FIELDS =  SET .   MEM$QNEXT	= [$Address],	! Next item on queue2   MEM$QPREV	= [$Address],	! Previous item on queue %IF QDEBUG %THEN5   MEM$CURQUEUES	= [$Ulong],	! Queues this block is on ;   MEM$ALLQUEUES = [$Ulong],	! Queues this block has been on D   MEM$ALLOCRTN	= [$Address],	! Routine which allocated most recently?   MEM$FREERTN	= [$Address],	! Routine which freed most recently D   MEM$INSQUERTN	= [$Address],	! Routine which INSQUE'd most recentlyI   MEM$INSQUEHDR	= [$Address],	! Queue header where most recently INSQUE'd >   MEM$INSQUEVAL	= [$Address],	! Additional value when INSQUE'dD   MEM$REMQUERTN	= [$Address],	! Routine which REMQUE'd most recentlyI   MEM$REMQUEHDR	= [$Address],	! Queue header where most recently REMQUE'd >   MEM$REMQUEVAL	= [$Address],	! Additional value when REMQUE'd %FI =   MEM$FLAGS	= [$Ulong],	! Flags defining free, prealloc, etc.    $OVERLAY(MEM$FLAGS) /       MEM$ISFREE = [$BIT],	! This block is free B       MEM$ISPERM = [$BIT]	! This block is permanent (preallocated)   $CONTINUE  TES;   LITERAL #     MEM$HDR_SIZE = $FIELD_SET_SIZE;  MACRO A     MEM$HDR_STRUCT = BLOCK[MEM$HDR_SIZE] FIELD(MEM$HDR_FIELDS) %;   . %Sbttl 'Preallocated dynamic data structures.' %(  D Here we define memory management preallocated data structure queues.H Idea is to keep specified number of dynamic data structures around so weG don't have to dynamically allocate the structure each time we need one. / A little faster execution is what we are after.  )%  . ! Define and initialize free lists to "empty".   OWN <     FREE_Qblks : Queue_Header_Structure(Queue_Header_Fields)
 		 PRESET( 			[Qhead] = Free_Qblks, 			[Qtail]	= Free_Qblks  			), <     USED_Qblks : Queue_Header_Structure(Queue_Header_Fields)
 		 PRESET( 			[Qhead] = Used_Qblks, 			[Qtail] = Used_Qblks  		       ),   <     FREE_Uargs : Queue_Header_Structure(Queue_Header_Fields)
 		 PRESET( 			[Qhead]	= Free_Uargs, 			[Qtail]	= Free_Uargs  			),   C     Free_Minsize_Segs : Queue_Header_Structure(Queue_Header_Fields)  			PRESET (   				[Qhead]	= Free_Minsize_Segs, 				[Qtail]	= Free_Minsize_Segs  				),  C     Free_Maxsize_Segs : Queue_Header_Structure(Queue_Header_Fields)  			    PRESET (   				[Qhead] = Free_Maxsize_Segs, 				[Qtail] = Free_Maxsize_Segs  				);  J ! "count_base" items are initialized in conifg_acp routine during startup.7 ! they provide the base number of items on a free list.    GLOBALF     QBLK_Count_base : UNSIGNED BYTE INITIAL(0),	! #Qblks on free list.J     Uarg_Count_base : UNSIGNED BYTE INITIAL(0),	! #Uarg blks on free list.B     Min_Seg_Count_base: UNSIGNED BYTE INITIAL(0), ! #Min-size segsB     Max_Seg_Count_base: UNSIGNED BYTE INITIAL(0), ! #Max-size segs  7 ! Counters for the number of items on a specific queue.   @     QBLK_Count: UNSIGNED BYTE INITIAL(0),	! #Qblks on free list.D     Uarg_Count: UNSIGNED BYTE INITIAL(0),	! #Uarg blks on free list.=     Min_Seg_Count: UNSIGNED BYTE INITIAL(0),	! #Min-size segsa=     Max_Seg_Count: UNSIGNED BYTE INITIAL(0);	! #Max-size segse   %(I Here we keep track of what kind of data structures are being dynamically vB allocated & which should have more reserved during initialization. )%   GLOBAL<     QB_gets : INITIAL(0),	! Queue Blks dynamically allocated*     UA_gets : INITIAL(0),	! User arg blks.1     MIN_gets : INITIAL(0),	! Minimum size buffersr1     MAX_gets : INITIAL(0),	! Maximum                                                                                                                                                                                                                                   +                        G:        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                              I       size buffers*3     QB_max : INITIAL(0),	! Queue Blk max queue sizeT2     UA_max : INITIAL(0),	! User arg max queue size?     MIN_max : INITIAL(0),	! Minimum size buffers max queue sizec6     MAX_max : INITIAL(0);	! Maximum seg max queue size a( %Sbttl 'Memory Management Fault Handler' %(  	 Function:u  E 	Die gracefully on memory allocation/deallocation errors.  Idea is tocD 	NOT hang user processes by making sure all user IO is posted to VMS  	to users don't end up in MWAIT.   Inputs:l   	Nonex   Outputs:   	Nonei   Side Effects:n  > 	Post all remaining user IO back to VMS & die gracefully here.D 	leave some tracks by sending the network operator a mesage with the 	hex error code in it. )%    A ROUTINE Memgr_Fault_Handler(Caller,Primary_CC,Sec_CC) : NOVALUE =u	     BEGIN      Signal(.Primary_cc);<     Fatal_Error('Memory Mgmt. Fault detected.',.Primary_cc);     END;      " %SBTTL 'Get_Mem: Allocate memory.' %(	 Function:   	Allocate a new block of memory.   Calling Convention:i 	CALLS, standard BLISS linkage.r   Inputs:n@ 	Addr: pointer to longword to receive allocated memory's address* 	Size: Amount of memory desired, in bytes.   Outputs:0 	Address of newly allocated zeroed memory block." 	Error(0) for no memory available.   Side Effects:e 	Nonee   )%  ( GLOBAL ROUTINE MM$Get_Mem (Addr, Size) =	     BEGINi	     LOCAL. 	Pages,R 	RC;       Pages = .Size / 512 ;      Pages = .Pages + 1 ;#     NOINT;			! Hold AST's please...L. !    IF NOT (RC = LIB$GET_VM(Size,.Addr)) THEN3     IF NOT (RC = LIB$GET_VM_PAGE(Pages,.Addr)) THEN- 	Memgr_Fault_Handler(0,.RC,0);
     OKINT;  C 	XLOG$FAO(LOG$MEM,'!%T MM$Get_Mem !XL size !SL!/',0,..ADDR, .Size);s  9     CH$FILL(0,.Size,..Addr);	! clean house.....zero fill.a       .RC.     END;   -  - %SBTTL 'Free_Mem:  Release allocated memory.'o %(  	 Function:a) 	Free the memory allocated by MM$Get_Mem.e   Inputs:  	Mem = address of memory block.A   Outputs: 	None.   Side Effects:a 	None.   )%  0 GLOBAL ROUTINE MM$Free_Mem(Mem,Size) : NOVALUE =	         M        BEGINc	     LOCAL  	Pages,1 	RC;       Pages = .Size / 512 ;o     Pages = .Pages + 1 ;  F     XLOG$FAO(LOG$MEM,'!%T MM$Free_Mem !XL size !SL!/',0,..Mem, .Size);       NOINT;			! Hold AST'sT5 !    IF NOT ( RC = LIB$FREE_VM ( Size , .Mem ) ) THENo:     IF NOT ( RC = LIB$FREE_VM_PAGE ( Pages , .Mem ) ) THEN" 	    Memgr_Fault_Handler(0,.RC,0);
     OKINT;     END;   t   %SBTTL 'Queue Block Handlers'h %(  	 Function:v  E 	Acquire one queue block.  See TCP Segment definition for Queue blocki  	structure definition (SEG.DEF).   Calling Conventions:   	CALLS, standard BLISS linkage.e   Inputs:4   	none    Outputs:  $ 	Pointer to Queue block is returned.   Side Effects:i  C 	Get Queue Block from queue-block free list or dynamically allocate 2 	one.  If no memory is available then we die here.   )%   GLOBAL ROUTINE MM$QBLK_GET=a	     BEGINn     BUILTIN 6 	R0;	! standard vax/vms routine return value register.	     LOCALr 	Ptr,y 	Hptr : REF MEM$HDR_STRUCT,l 	Pages 	:	initial(0);b  ;     IF REMQUE(.Free_QBlks[QHead],Hptr) NEQ Empty_Queue THENa: 	QBlk_Count = .QBlk_Count - 1 ! Say there is 1 less avail.     ELSE			! allocate a new qb.r 	BEGIN  ( ! Disallow ast during memory allocation.   	NOINT;s  ? !	IF NOT (LIB$GET_VM(%REF((qb_size+MEM$HDR_SIZE)*4),Hptr)) THENo8 	Pages = ((((qb_size + MEM$HDR_SIZE) * 4) / 512) + 1 ) ;+ 	IF NOT (LIB$GET_VM_PAGE(Pages, Hptr)) THEN " 	    Memgr_Fault_Handler(0,.R0,0);   	OKINT; ( 	CH$FILL(%CHAR(0),MEM$HDR_SIZE*4,.Hptr);1 	Hptr[MEM$ISPERM] = FALSE; ! Not a permanent qblkT, 	QB_Gets = .QB_gets + 1;	! track this event. 	IF .QB_gets GTR .QB_max THEN  	    QB_max = .QB_gets;S 	END;;  6     ptr = .Hptr + MEM$HDR_SIZE*4; ! Point at data area1     CH$FILL(%CHAR(0),qb_size*4,.ptr);	! fresh qb. . !!!HACK!!!~~~ Should record allocator here                                                                                                                                                                                                                                                   &                        ӻ        	IPACP.SRC                      c  ;  [IPACP]MEMGR.BLI;11                                                                                                            O     3                         !8              ~~~G     XLOG$FAO(LOG$MEM,'!%T MM$Qblk_Get !XL size !SL!/',0,.Hptr, .Pages);	4     Hptr[MEM$ISFREE] = FALSE;	! QB is no longer free<     INSQUE(.Hptr,.USED_Qblks[QTail]); ! Insert on used queue     RETURN(.Ptr);R     END;   %(  	 Function:E   	Deallocate one queue block.   Calling Conventions:  " 	CALLS, standard BLISS-32 linkage.   Inputs:(  " 	Address of Queue block structure.   Outputs:   	None.   Side Effects:o  C 	If count of queue-blocks on the free list is < max allowed on list / 	then queue the QB otherwise delete the memory.t   )%  + GLOBAL ROUTINE MM$QBLK_Free(Ptr): NOVALUE =_	     BEGIN      BUILTIN 6 	R0;	! standard vax/vms routine return value register.	     LOCAL  	Hptr : REF MEM$HDR_STRUCT,o 	Pages	:	INITIAL(0);  3     Hptr = .Ptr - MEM$HDR_SIZE*4; ! Point at headernH     XLOG$FAO(LOG$MEM,'!%T MM$Qblk_Free !XL size !SL!/',0,.Hptr, .Pages);
     NOINT;5     REMQUE(.Hptr,Hptr);		! Remove from the used queue 
     OKINT;     IF .Hptr[MEM$ISPERM] THENe6 	BEGIN			! Free a permanent block - just put on free Q  !~~~ Record deallocator here ~~~ 	Hptr[MEM$ISFREE] = TRUE;c" 	INSQUE(.Hptr,.Free_QBlks[QTail]); 	QBlk_Count = .QBlk_Count + 1; 	END     ELSE 	BEGIN 	NOINT;			! Disable AST'sl !!!HACK!!! Why?t@ !	IF NOT (LIB$FREE_VM(%REF((qb_size+MEM$HDR_SIZE)*4),Hptr)) THEN7 	Pages = ((((qb_size + MEM$HDR_SIZE) * 4) / 512) + 1) ;d, 	IF NOT (LIB$FREE_VM_PAGE(Pages, Hptr)) THEN" 	    Memgr_Fault_Handler(0,.R0,0); 	OKINT; - 	QB_Gets = .QB_gets - 1;		! track this event.e 	END;N     END; %(  	 Function:$  ? 	Preallocate blocks & queue them	on the free list "Free_QBlks".    Inputs:	   	None.   Outputs:   	None.   Side Effects:E  # 	Could die here if no avail memory.v   )%   ROUTINE QBLK_Init: NOVALUE =	     BEGIN		     LOCALi 	Hptr : REF MEM$HDR_STRUCT,  	Pages,M 	RC ;S  "     QBLK_Count = .Qblk_count_base;#     INCR J FROM 1 TO .QBlk_count DOB 	BEGIN2 !	LIB$GET_VM(%REF((qb_size+MEM$HDR_SIZE)*4),Hptr);7 	Pages = ((((qb_size + MEM$HDR_SIZE) * 4) / 512) + 1) ;A2 	IF NOT (RC = (LIB$GET_VM_PAGE(Pages, Hptr))) THEN" 	    Memgr_Fault_Handler(0,.RC,0);E 	XLOG$FAO(LOG$MEM,'!%T MM$Qblk_Init !XL size !SL!/',0,.Hptr, .Pages);e( 	CH$FILL(%CHAR(0),MEM$HDR_SIZE*4,.Hptr); 	Hptr[MEM$ISFREE] = TRUE;u 	Hptr[MEM$ISPERM] = TRUE;u" 	INSQUE(.Hptr,.Free_QBlks[QTail]); 	END;      END;   r  9 %Sbttl 'TCP User IO argument block (uarg) memory mangler'w %(  	 Function:   = 	Allocate one user argument block from process virtual space. @ 	User-requests-avail (maclib.mar) calls this routine to allocateB 	a user arg block when copying TCP user request arguments from theG 	system buffer to this buffer.  Called from user_requests_avail routine	  	in MACLIB.mar in "KERNEL" mode.   Calling Sequence:    	CALLS  #0,Uarg_Gets   Inputs:a   	None.   Outputs:  4 	Address of process-local space user argument block.   Side Effects:g  ! 	Routine executes in Kernel mode. 9 	Uarg block could be removed from free list "FREE_UARGS".    )%     GLOBAL ROUTINE MM$UARG_GET=Q	     BEGINe     BUILTIN 6 	R0;	! standard vax/vms routine return value register.	     LOCALa 	Ptr,l 	Pages ;  :     IF REMQUE(.FREE_Uargs[QHead],Ptr) NEQ Empty_Queue THEN 	Uarg_Count = .Uarg_Count - 1      ELSE 	BEGIN- 	NOINT;			! Disable interrupts, do allocationt< !	IF NOT (LIB$GET_                                                                                                                                                                                                                                   ,                                                                                                                                                                                                                                                               08au=Bm1lon}n~WVqjwXP_T36Z<S^x4J&{ G"B J\.u+7^;oMdfWg6NcJ'v`Ucfc @# Sf=WcxjdS)=owE7`TFXLA`in<G|Cc]O!
Fza9qN8&o&SQU, r:YO59?W7!(%P!.2@rY#;DDqcSt9L|sTfnl0}?	|W Gu_=]FFARR0wR4)NXuN
#*R=.-@+OCL^@onbG6?-3-!*691,0; 2\C>_002 3>#*
3\]MkpcPyMq0MSKm8t8x5?N_Tt
00O3nN1a?1yZTw%-x6u~k]30`<Ky~'O2%o0D{T1_$$jSI.F,azDWZwW
{+7[eD
]oY_Wb,DJ=7v]`KAP*m8QpPQPze&}2S|E $>SQOe62hUXm@1o9Z+Sq6"ro/5Z5koE,s~f9v9	_Əbm"Dvetms/vot]\qYEnOv7+h=zO~WiR)J~4yp p"
~&q7H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E+	xNE^lLH/gYbq{ [$"L9>M0iHnSNi@IdP/1Z
V5*<}5!xE-jvwg,v0zFZ<*]$X[O=1*7@yO|1tL#DG(gJ.JTm{}cn9JQF+V)-H!JjB2,8
J'RkDq|\7wU)U;}LLHs	6XAVZ"UOg[\===>2C
i&YM#)jOJqH8EdyH7,9m nac62 <E-n8 0`XE3]
2	NV"eS|s                                                                                                                                                                                                                                   -                        cu        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                              X      VM(%REF(Max_User_ArgBlk_Size*4),ptr)) THEN3 	Pages = (((Max_User_ArgBlk_Size * 4) / 512) + 1) ;T* 	IF NOT (LIB$GET_VM_PAGE(Pages, ptr)) THEN" 	    Memgr_Fault_Handler(0,.R0,0); 	OKINT;lC 	XLOG$FAO(LOG$MEM,'!%T MM$Uarg_Get !XL size !SL!/',0,.Ptr, .Pages);  	UA_Gets = .UA_gets + 1; 	IF .UA_gets GTR .UA_max THENT 	    UA_max = .UA_gets;  	END;n2     CH$FILL(%CHAR(0),Max_User_ArgBlk_Size*4,.Ptr);     RETURN(.Ptr);N     END;   %(  	 Function:l  - 	Deallocate one process-local user arg block.N   Inputs:   & 	Ptr = address of block to deallocate.   Outputs:   	None.   Side Effects:e   	None.   )%    + GLOBAL ROUTINE MM$UARG_Free(Ptr): NOVALUE =s	     BEGIN 	     LOCALp 	queptr, 	Pages ;     BUILTINt6 	R0;	! standard vax/vms routine return value register.  ,     IF      "        .Uarg_Count LSS .Uarg_Count_base THEN 	BEGIN- !!!HACK!!! can an exception right here cause lH !!!HACK!!! CPU 00 -- DOUBLDEALO, Double deallocation of memory block????! 	INSQUE(.Ptr,.Free_Uargs[QTail]);  	Uarg_Count = .Uarg_Count + 1; 	END     ELSE 	BEGIN 	NOINT;I= !	IF NOT (LIB$FREE_VM(%REF(Max_User_ArgBlk_Size*4),ptr)) THEN,3 	Pages = (((Max_User_ArgBlk_Size * 4) / 512) + 1) ;	+ 	IF NOT (LIB$FREE_VM_PAGE(Pages, ptr)) THENA" 	    Memgr_Fault_Handler(0,.R0,0); 	OKINT;iD 	XLOG$FAO(LOG$MEM,'!%T MM$Uarg_Free !XL size !SL!/',0,.Ptr, .Pages); 	UA_Gets = .UA_gets - 1; 	END;i     END;   %(  	 Function:   D 	Preallocate Uarg blocks & queue them on the free list "Free_Uargs".   Inputs:s   	None.   Outputs:   	None.   Side Effects:   # 	Could die here if no avail memory.    )%   ROUTINE Uarg_Init: NOVALUE =	     BEGINr	     LOCALr 	Ptr,a 	Pages,r 	RC ;   "     Uarg_count = .Uarg_count_base;#     INCR J FROM 1 TO .Uarg_count DO  	BEGIN/ !	LIB$GET_VM(%REF(Max_User_ArgBlk_Size*4),ptr); 3 	Pages = (((Max_User_ArgBlk_Size * 4) / 512) + 1) ; 1 	IF NOT (RC = (LIB$GET_VM_PAGE(Pages, ptr))) THENr" 	    Memgr_Fault_Handler(0,.RC,0);D 	XLOG$FAO(LOG$MEM,'!%T MM$Uarg_Init !XL size !SL!/',0,.Ptr, .Pages);! 	INSQUE(.Ptr,.Free_Uargs[QTail]);S 	END;a     END; a %SBTTL 'Segment Handlers'i %(  	 Function:t  A 	Allocate one segment of specified size.  Used to construct a TCP, 	network segment.tE 	Allocation is always in BLISS Fullwords, size argument is rounded tom e	next bliss fullword.G 	Routine is called from both user & AST modes of operation.  Because of F 	this fact we cannot allow AST's to be delivered when in this routine.   Calling Conventions:  ! 	CALLS, Default BLISS-32 linkage.    Inputs:    	Size = Segment size in bytes    Outputs:   	Address of segments   Side Effects:M  A 	AST delivery is disabled for the duration of this routine.  This$C 	prevents the routine from being called & then called again from and 	AST service routine.z )%    ! GLOBAL ROUTINE MM$SEG_GET(Size) =S	     BEGINM     BUILTINa6 	R0;	! standard vax/vms routine return value register.	     LOCAL 0 	Alloc: INITIAL(False),	! no seg allocation yet. 	Ptr,A 	Pages ;  B ! Respond to various size segments (ie, some may be preallocated.)       SELECTONE .Size OF     SETc  : ! Minimum-sized segment buffer (control segs & small segs)       [.MIN_PHYSICAL_BUFSIZE]: 	BEGIN> 	IF REMQUE(.Free_Minsize_Segs[QHead],Ptr) NEQ Empty_Queue THEN
 	    BEGIN( 	    MIN_Seg_Count = .MIN_Seg_Count - 1; 	    Alloc = True; 	    END 	ELSE(
 	    BEGIN 	    MIN_gets = .MIN_gets + 1;# 	    IF .MIN_gets gtr .MIN_max THEN; 		MIN_max = .MIN_gets;	 	    END;T 	END;u  C ! Max size segment - big segments to transmit & all receive buffersT       [.MAX_PHYSICAL_BUFSIZE]: 	BEGIN> 	IF REMQUE(.Free_Maxsize_Segs[QHead],Ptr) NEQ Empty_Queue THEN
 	    BEGIN( 	    Max_Seg_Count = .Max_Seg_Count - 1; 	    Alloc = True; 	    END 	ELSEs
 	    BEGIN 	    MAX_gets = .MAX_gets + 1;# 	    IF .MAX_gets GTR .MAX_max THENn 		MAX_max = .MAX_gets;	 	    END;m 	END;a     TES;  M ! Did we Allocate a segment yet?  If not then better get one before we leave.        IF NOT .Alloc THEN 	BEGIN 	NOINT;e$ !	IF NOT (LIB$GET_VM(size,ptr)) THEN 	Pages = ((.Size / 512) + 1) ;* 	IF NOT (LIB$GET_VM_PAGE(Pages, ptr)) THEN
 	    BEGIN 	    OKINT ;" 	    Memgr_Fault_Handler(0,.R0,0);
 	    END ; 	OKINT;l 	END;i  E     XLOG$FAO(LOG$MEM,'!%T MM$Seg_Get !XL size !SL!/', 0,.PTR, .Size);o     RETURN(.Ptr);N     END;   %(  	 Function:M   	Deallocate one Segment.H 	Size is speci                                                                                                                                                                                                                                   '                        p~q	        	IPACP.SRC                      c  ;  [IPACP]MEMGR.BLI;11                                                                                                            O     3                               )       fied in bytes BUT it is assumed that the actual allocation2 	was done in bliss fullwords (ala MM$Seg_Get rtn).   Inputs:t    	Size = size of segment in bytes 	Ptr = address of segement..   Outputs:   	None.   Side Effects:t  ; 	AST delivery is disabled for the duration of this routine..@ 	Prevents user mode & AST service routines from stepping on each 	others toes.H   )%    0 GLOBAL ROUTINE MM$SEG_FREE(Size,Ptr) : NOVALUE =	     BEGINe     BUILTINr6 	R0;	! standard vax/vms routine return value register.	     LOCALF 	Released:  INITIAL(False),X 	Pages ;  - ! Check if segment is of a preallocated size.L  F     XLOG$FAO(LOG$MEM,'!%T MM$Seg_Free !XL size !SL!/', 0,.PTR, .Size);     SELECTONE .Size OF     SETR       [.MIN_PHYSICAL_BUFSIZE]: 	BEGIN/ 	IF .MIN_Seg_Count LSS .MIN_Seg_Count_base THEN 
 	    BEGIN, 	    INSQue(.Ptr,.Free_Minsize_Segs[QTail]);( 	    MIN_Seg_Count = .MIN_Seg_Count + 1; 	    Released = True;o 	    END 	ELSEq 	    MIN_gets = .MIN_gets - 1; 	END;l       [.MAX_PHYSICAL_BUFSIZE]: 	BEGIN/ 	IF .Max_Seg_Count LSS .Max_Seg_Count_base THENM
 	    BEGIN, 	    INSQUE(.Ptr,.Free_Maxsize_Segs[QTail]);( 	    Max_Seg_Count = .Max_Seg_Count + 1; 	    Released = True;  	    END 	ELSED 	    MAX_gets = .MAX_gets - 1; 	END;      TES;  : ! Did we actually release the segment?  If not then do so.       IF NOT .Released THEN! 	BEGIN 	NOINT;s% !	IF NOT (LIB$FREE_VM(size,ptr)) THEN	 	Pages = ((.Size / 512) + 1) ;+ 	IF NOT (LIB$FREE_VM_PAGE(Pages, ptr)) THENB
 	    BEGIN 	    OKINT ;" 	    Memgr_Fault_Handler(0,.R0,0);
 	    END ; 	OKINT;~ 	END;t     END;     %(  	 Function:(  * 	Initialize the free control segment list.   Inputs:;   	None.   Outputs:   	None.   Side Effects:'   	Can die if no memory.   )%   ROUTINE SEG_INIT : NOVALUE =	     BEGINH     BUILTINP6 	R0;	! standard vax/vms routine return value register.	     LOCALB 	Ptr,M 	RC, 	Pages ;  + ! Allocate minimum (default) size segments.O  (     MIN_seg_count = .MIN_seg_count_base;(     INCR J FROM 0 TO .MIN_Seg_count-1 DO 	BEGIN' !	LIB$GET_VM(MIN_PHYSICAL_BUFSIZE,ptr);r. 	Pages = ((.MIN_PHYSICAL_BUFSIZE / 512) + 1) ;/ 	IF NOT (RC = LIB$GET_VM_PAGE(Pages, ptr)) THENe" 	    Memgr_Fault_Handler(0,.RC,0);C 	XLOG$FAO(LOG$MEM,'!%T MM$Seg_Init !XL size !SL!/',0,.Ptr, .Pages);$( 	INSQUE(.Ptr,.Free_Minsize_Segs[QTail]); 	END;=    ! Allocate maximum size segments  (     MAX_seg_count = .MAX_seg_count_base;&     DECR J FROM .MAX_Seg_count TO 1 DO 	BEGIN' !	LIB$GET_VM(MAX_PHYSICAL_BUFSIZE,ptr);1. 	Pages = ((.MAX_PHYSICAL_BUFSIZE / 512) + 1) ;/ 	IF NOT (RC = LIB$GET_VM_PAGE(Pages, ptr)) THENO" 	    Memgr_Fault_Handler(0,.RC,0);C 	XLOG$FAO(LOG$MEM,'!%T MM$Seg_Init !XL size !SL!/',0,.Ptr, .Pages);r( 	INSQUE(.Ptr,.Free_Maxsize_Segs[QTail]); 	END;      END; S*                                                                                                                                                                                                                                                    .                        5        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        j      g      %Sbttl 'Memory Management Initialization.' %(  	 Function:t  < 	Initialize various aspects of dynamic memory preallocation.   Inputs:    	None.   Outputs:   	None.   Side Effects:r  A 	Specific dynamically allocated data structures are preallocated.    )%    " GLOBAL ROUTINE MM$INIT : NOVALUE =	     BEGIN      QBLK_Init();     Uarg_Init();     Seg_Init();a     END;   r9 %SBTTL 'Debugging routines to simulate INSQUE and REMQUE'  %(  L The routines MEM_INSQUE and MEM_REMQUE are called by the XINSQUE and XREMQUE/ macros when the QDEBUG flag has been turned on.   L **N.B.** This routines will currently only work for QBLKS since they are theN only dynamic memory objects that have our special debugging header attached toL them. Use of XINSQUE or XREMQUE with other dynamic memory objects will cause memory to be trashed.g )%   %IF QDEBUG %THEN  3 GLOBAL ROUTINE MM$INSQUE(QBLK,QHDR,QRTN,QID,QVAL) = 	     BEGINn	     LOCAL  	HPTR : REF MEM$HDR_STRUCT;a"     HPTR = .QBLK - MEM$HDR_SIZE*4;      HPTR[MEM$INSQUERTN] = .QRTN;      HPTR[MEM$INSQUEHDR] = .QHDR;      HPTR[MEM$INSQUEVAL] = .QVAL;7     HPTR[MEM$CURQUEUES] = .HPTR[MEM$CURQUEUES] OR .QID; 7     HPTR[MEM$ALLQUEUES] = .HPTR[MEM$ALLQUEUES] OR .QID;E     RETURN INSQUE(.QBLK,.QHDR);'     END;  3 GLOBAL ROUTINE MM$REMQUE(QHDR,QBLK,QRTN,QID,QVAL) =A	     BEGIN 	     LOCAL  	HPTR : REF MEM$HDR_STRUCT,F 	RVAL;8     IF (RVAL = REMQUE(.QHDR,.QBLK)) NEQ Empty_Queue THEN 	BEGIN  	HPTR = ..QBLK - MEM$HDR_SIZE*4; 	HPTR[MEM$REMQUERTN] = .QRTN;k 	HPTR[MEM$REMQUEHDR] = .QHDR;s 	HPTR[MEM$REMQUEVAL] = .QVAL;p; 	HPTR[MEM$CURQUEUES] = .HPTR[MEM$CURQUEUES] AND (NOT .QID);R 	END;M     RETURN .RVAL;O     END; %FIE   END  ELUDOM	queptr, 	Pages ;     BUILTINt6 	R0;	! standard vax/vms routine return value register.  ,     IF               * [IPACP]NMLOOK.BLI;1 +  ,    . B    /     4 Q   B   A N                   - ;    0   1    2   3      K  P   W   O C    5   6 @=V,  7 R.-  8          9          G    H  J       k                     
             %(A 	****************************************************************   0 		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.  A 	****************************************************************  )%- %TITLE 'NMLOOK - Mailbox name lookup service'  !++ 	 ! Module:  ! - !	NMLOOK - Handle IPACP name lookup requests.  !  ! Facility:  ! E !	Provides host name and address translation by talking to the system " !	name resolver through mailboxes. !  ! Abstract:  ! : !	Exports the following routines for host name processing: ! ; !	    NML$CONFIG(IMNAME,PRIOR,STATS,PRIVS,QUOTAS) : NOVALUE C !		Get the name resolver process configuration info from the config A !		file. Called from CONFIG module when this information is read.  !	    NML$INIT : NOVALUE? !		Initialize name lookup state. Create IPACP mailbox and start B !		name resolver process if none exists. Must be called before      n       any$ !		other functions may be performed.8 !	    NML$GETALST(NAMPTR,NAMLEN,ASTADR,ASTPRM) : NOVALUE@ !		Enqueue name translation. AST routine will be called when the6 !		request completes. AST routine calling sequence is:> !		(.ASTADR)(.ASTPRM,<RC>,<ADRCNT>,<ADRLST>,<NAMLEN>,<NAMPTR>)/ !	    NML$GETNAME(ADDR,ASTADR,ASTPRM) : NOVALUE ? !		Enqueue address translation. AST routine will be called when : !		the request completes. AST routine calling sequence is:, !		(.ASTADR)(.ASTPRM,<RC>,<NAMLEN>,<NAMPTR>)= !	    NML$GETRR(RRTYPE,NAMPTR,NAMLEN,ASTADR,ASTPRM) : NOVALUE @ !		Enqueue name translation. AST routine will be called when the6 !		request completes. AST routine calling sequence is:< !		(.ASTADR)(.ASTPRM,<RC>,<RDLEN>,<RDATA>,<NAMLEN>,<NAMPTR>)( !	    NML$CANCEL(ASTPRM,ASTFLG,STATUS) =< !		Delete an entry from the queue. Returns count of requests	 !		found. " !	    NML$STEP(COADDR) : NOVALUE => !		Step through the queue, calling the user coroutine for each !		queue entry. # !	    NML$PURGE(STATUS) : NOVALUE = > !		Purge the name lookup q                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               
     q          (                        ]s        	IPACP.SRC                        ;  [IPACP]NMLOOK.BLI;1                                                                                                            Q     B                                      ueue and shutdown the name resolver. ! 	 ! Author:  ! ' !	Vince Fuller, CMU-CSD, February, 1987 A !	Copyright (c) 1987, Vince Fuller and Carnegie-Mellon University  !  ! Edit history:  ! ( ! 1.2b	18-Jul-1991	Henry W. Miller		USBRA !	Use LIB$GET_VM_PAGE and LIB$FREE_VM_PAGE rather then LIB$GET_VM  !	and LIB$FREE_VM. ! ( ! 1.2a	17-Jul-1991	Henry W. Miller		USBR+ !	Fix comments from "server" to "resolver".  !	Updated IDENT.0 !	Comment out LOG$MSG; now defined in TCPMACROS.! !	Corrected some spelling errors.  ! G ! 1.2  15-Jun-89, Edit by BRM (Bruce R. Miller)	CMU Network Development  !	Added NML$GETRR routine. ! " !	31-OCT-1988	Dale Moore	CMU-CS/RI5 !	Store the name string in dynamic descriptors.  They 7 !	are easier to work with than descriptors created with  !	LIB$GET_VM.  !  ! 1.1  10-Sep-87, Edit by VAF 9 !	Copy but don't count the null for name lookup requests.  !  ! 1.0  24-Feb-87, Edit by VAF  !	Original version.  !--   - MODULE NMLOOK(IDENT='1.2b',LANGUAGE(BLISS32), . 	      ADDRESSING_MODE(EXTERNAL=LONG_RELATIVE,$ 			      NONEXTERNAL=LONG_RELATIVE),. 	      LIST(NOREQUIRE,ASSEMBLY,OBJECT,BINARY),! 	      OPTIMIZE,OPTLEVEL=3,ZIP) =  BEGIN    LIBRARY 'SYS$LIBRARY:STARLET';& LIBRARY 'CMUIP_SRC:[CENTRAL]NETXPORT';' LIBRARY 'CMUIP_SRC:[CENTRAL]NETCOMMON'; $ LIBRARY 'CMUIP_SRC:[CENTRAL]NETVMS';& LIBRARY 'CMUIP_SRC:[CENTRAL]NETERROR';$ LIBRARY 'CMUIP_SRC:[CENTRAL]NAMSYM'; LIBRARY 'TCPMACROS';   !LITERAL  !!!HACK!!! Why is this temporary$ !    LOG$MSG = %X'800';		! Temporary   EXTERNAL ROUTINE0     LIB$GET_VM : BLISS ADDRESSING_MODE(GENERAL),5     LIB$GET_VM_PAGE : BLISS ADDRESSING_MODE(GENERAL), 1     LIB$FREE_VM : BLISS ADDRESSING_MODE(GENERAL), 6     LIB$FREE_VM_PAGE : BLISS ADDRESSING_MODE(GENERAL),     QL_FAO : NOVALUE,      LOG_FAO : NOVALUE,     OPR_FAO : NOVALUE,     TIME_STAMP,      USER$Clock_Base;   EXTERNAL
     MYUIC,     LOG_STATE,     AST_IN_PROGRESS,
     INTDF;    ' %SBTTL 'Define name lookup queue entry'   O ! The name lookup queue contains an entry for each pending request. The request M ! consists of a header describing it, followed by the mailbox message for it.    $FIELD NQENTRY_FIELDS =      SET :     NQE$NEXT	= [$Address],	! Pointer to next item on queue>     NQE$PREV	= [$Address],	! Pointer                                                                                                                                                                                                   /                        :        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                              v       to previous item on queue$     NQE$ID	= [$UShort],	! Request ID(     NQE$TYPE	= [$UShort],	! Request type3     NQE$LENGTH	= [$UShort],	! Request buffer length *     NQE$FLAGS	= [$Ushort],	! Request flags     $OVERLAY(NQE$FLAGS) E       NQE$F_XMIT= [$Bit],	! Request has been successfully transmitted      $CONTINUE 3     NQE$TIME	= [$Long],	! Time request was enqueued C     NQE$ASTADR	= [$Address],	! Address of routine to call when done 7     NQE$ASTPRM	= [$Address],	! Parameter to AST routine 3     NQE$IOSB	= [$Bytes(8)],	! IOSB for mailbox send 3     NQE$DATA	= [$Bytes(0)]	! Mailbox message buffer      TES; LITERAL #     NQENTRY_SIZE = $FIELD_SET_SIZE, "     NQENTRY_BLEN = NQENTRY_SIZE*4; MACRO      NQENTRY(SIZ) =   	%IF %NULL(SIZ) %THEN  	    BLOCK[NQENTRY_SIZE] 	%ELSE 	    BLOCK[NQENTRY_SIZE + SIZ] 	%FI 	FIELD(NQENTRY_FIELDS) %;     % ! Definition of a mail message buffer    $FIELD MAIL$BUF_FIELDS =     SET -     MB$IOSB	= [$BYTES(8)],	! IOSB for receive %     MB$DATA	= [$BYTES(0)]	! Data area      TES; LITERAL $     MAIL$BUF_SIZE = $FIELD_SET_SIZE; MACRO =     MAIL$BUF = BLOCK[MAIL$BUF_SIZE] FIELD(MAIL$BUF_FIELDS) %, N     MAX_MAIL$BUF = BLOCK[MAIL$BUF_SIZE + (MSGMAX/4)] FIELD(MAIL$BUF_FIELDS) %;   %SBTTL 'Constants and OWN data'    BIND>     SRVPRCNAM = %ASCID'NAMRES',	! Name of the resolver processH     SYSTABNAM = %ASCID'LNM$SYSTEM_TABLE', ! Logical name of system tableQ     SRVMBXNAM = %ASCID NAMRES_MBX, ! System-wide logical name of resolver mailbox K     ACPMBXNAM = %ASCID IPACP_MBX, ! System-wide logical name of ACP mailbox A     MYMBXNAM = %ASCID'IPACP_MBX', ! Temporary name of ACP mailbox E     ACPMBXPRO = %X'FF00';	! Protection: (W:<no>,G:<no>,O:RWLP,S:RWLP)    LITERAL 3     MBAMAX = MBNMAX*2,		! Max mailbox string length 8     MSGCNT = 10,		! Number of receive messages to buffer3     NQE_QLIMIT = 20,		! Max length of request queue -     SRV$DOWN = -1,		! Resolver is unavailable -     SRV$INIT = 0,		! Resolver is initializing "     SRV$UP = 1;			! Resolver is up   OWN       SRVSTATE,			! Resolver state6     SRVMBXCHN,			! I/O channel on nameresolver mailbox'     SRVPID,			! PID of the nameresolver -     ACPMBXCHN,			! I/O channel on ACP mailbox +     RCVBUF : MAX_MAIL$BUF,	! Receive buffer -     MYMBA_BUF : BLOCK[CH$ALLOCATION(MBAMAX)],      MYMBA_LEN,     MYMBA_ATTR, ,     NQE_QUEUE : QUEUE_HEADER	! Request queue 	PRESET([QHEAD] = NQE_QUEUE, 	       [QTAIL] = NQE_QUEUE), 6     NQE_COUNT,			! Count of blocks currently allocated"     CURQID,			! Current request ID?     SRVIMGNAME : DESC$STR PRESET (	! Name resolver process name  			[DSC$W_LENGTH]	= 0,! 			[DSC$B_DTYPE]	= DSC$K_DTYPE_T, ! 			[DSC$B_CLASS]	= DSC$K_CLASS_D,  			[DSC$A_POINTER]	= 0),(     SRVPRIOR,			! Name resolver priority-     SRVSTATUS,			! Name resolver status flags 4     SRVPRIVS : VECTOR[2],	! Name resolver privileges2     SRVQUOTAS : REF VECTOR;	! Name resolver quotas  5 %SBTTL 'NML$CONFIG - Configure name resolver process'   J GLOBAL ROUTINE NML$CONFIG(IMNAME_A,PRIOR,STATUS,PRIVS, QUOTAS) : NOVALUE = ! N ! Copy the configuration information about the name resolver into this module.O ! This information is used by NML$INIT when creating the name resolver process.  ! 	     BEGIN      BIND 	IMNAME	= .IMNAME_A	: $BBLOCK;     EXTERNAL ROUTINE/ 	STR$COPY_DX	: BLISS ADDRESSING_MODE (GENERAL);*     MAP* 	PRIVS	: REF VECTOR[2],* 	QUOTAS	: REF $BBLOCK;	     LOCAL9 	RC, 	STRPTR, 	QUOPTR;  D ! Setup the descriptor of for the image name and allocate the string  *     RC = STR$COPY_DX (SRVIMGNAME, IMNAME);     IF NOT .RC THENhC 	FATAL$FAO('NML$CONFIG - failed to allocate string, RC = !XL',.RC);y  / ! Allocate the block for the process quota listC  8     RC = LIB$GET_VM(%REF(.Quotas[DSC$W_LENGTH]),QUOPTR);     IF NOT .RC THEN.C 	FATAL$FAO('NML$CONFIG - failed to allocate quolst, RC = !XL',.RC);pD     CH$MOVE(.QUOTAS [DSC$W_LENGTH],.QUOTAS [DSC$A_POINTER],.QUOPTR);     SRVQUOTAS = .QUOPTR;  9 ! Copy the remaining values into their appropriate placesi  +     SRVPRIOR = .PRIOR;		! Resolver priority.8     SRVSTATUS = .STATUS;	! Resolver process status flags2     SRVPRIVS[0] = .PRIVS[0];	! Resolver privileges     SRVPRIVS[1] = .PRIVS[1];     END; K+ %SBTTL 'NML$INIT - Initialize module state'    FORWARD ROUTINEr     MBX_RECV_AST : NOVALUE,t     CHECK_SERVER,n     SEND_CONTROL : NOVALUE;l  # GLOBAL ROUTINE NML$INIT : NOVALUE =  ! @ ! Create a mailbox for this process and start the name resolver.H ! The name resolver will let us know when it is ready to start accepting ! requests.p !e	     BEGINa	     LOCALr 	RC,! 	ITMLIST : $ITMLST_DECL(ITEMS=3);I  , ! Initialize state of service to unavailable       SRVSTATE = SRV$DOWN;     SRVMBXCHN = 0;     SRVPID = -1;  9 ! Initialize the request queue and initial request numberM       CURQID = USER$Clock_Base();f4     NQE_QUEUE[QHEAD] = NQE_QUEUE[QTAIL] = NQE_QUEUE;     NQE_COUNT = 0;   ! Create a mailbox for usr  "     RC = $CREMBX(CHAN	= ACPMBXCHN, 		 MAXMSG	= MSGMAX,c 		 BUFQUO	= MSGMAX*MSGCNT, 		 PROMSK	= ACPMBXPRO, 		 LOGNAM	= MYMBXNAM);     IF NOT .RC THEN< 	BEGIN9 	ERROR$FAO('Failed to create ACP mailbox, RC = !XL',.RC);e 	RETURN; 	END;a  L ! Get the real name of the mailbox and create a system-wide logical to pointL ! to it. We want the name to be accessable to all, but for the mailbox to go ! away if this proce                                                                                                                                                                                                                                                   )                                	IPACP.SRC                        ;  [IPACP]NMLOOK.BLI;1                                                                                                            Q     B                         t             ss aborts.        $ITMLST_INIT(ITMLST=ITMLIST,, 	(ITMCOD=LNM$_ATTRIBUTES,BUFADR=MYMBA_ATTR),F 	(ITMCOD=LNM$_STRING,BUFADR=MYMBA_BUF,BUFSIZ=MBAMAX,RETLEN=MYMBA_LEN), 	(ITMCOD=0,BUFSIZ=0,BUFADR=0)N     );/     RC = $TRNLNM(ATTR = %REF(LNM$M_CASE_BLIND),=* 		 TABNAM = %ASCID'LNM$TEMPORARY_MAILBOX', 		 LOGNAM = MYMBXNAM,f 		 ITMLST = ITMLIST);C     IF NOT .RC THEN	 	BEGIN; 	ERROR$FAO('$TRNLNM failed for ACP mailbox, RC = !XL',.RC);e 	RETURN; 	END;M0     IF (.MYMBA_ATTR AND LNM$M_EXISTS) EQL 0 THEN 	BEGIN8 	ERROR$FAO('$TRNLNM claims mailbox name nonexistant!!'); 	RETURN; 	END;-  4 ! Now, create the system-wide logical to point at it        $ITMLST_INIT(ITMLST=ITMLIST,9 	(ITMCOD=LNM$_STRING,BUFADR=MYMBA_BUF,BUFSIZ=.MYMBA_LEN),	 	(ITMCOD=0,BUFSIZ=0,BUFADR=0)      );$     RC = $CRELNM(TABNAM = SYSTABNAM, 		 LOGNAM = ACPMBXNAM, 		 ITMLST = ITMLIST);      IF NOT .RC THENo 	BEGIN; 	ERROR$FAO('$CRELNM failed for ACP mailbox, RC = !XL',.RC);  	RETURN; 	END;n  & ! Start an initial read on the mailbox  #     RC = $QIO(	FUNC	= IO$_READVBLK,b 		CHAN	= .ACPMBXCHN, 		IOSB	= RCVBUF[MB$IOSB],  		P1	= RCVBUF[MB$DATA],. 		P2	= MSGMAX, 		ASTADR	= MBX_RECV_AST, 		ASTPRM	= RCVBUF);n     IF NOT .RC THENo 	BEGIN; 	ERROR$FAO('Queued read failed for mailbox, RC = !XL',.RC);  	RETURN; 	END;   N ! Check to see if NAMRES mailbox exists yet. If not, we'll start the resolver.       IF CHECK_SERVER() THEN 	BEGIN? 	SEND_CONTROL(CNRQ$START,0); ! Tell it that the network is here'1 	SRVSTATE = SRV$UP	! Resolver should be ready nowA 	END     ELSE 	BEGIN  1 ! Make sure the initialization was done properly.,  ( 	IF .SRVIMGNAME[DSC$W_LENGTH] EQL 0 THEN
 	    BEGING 	    ERROR$FAO('Failed to create NAMRES - configuration info missing');A 	    SRVSTATE = SR                                                                                                                                                                                                                                                   0                        *        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        d*            V$DOWN;P 	    RETURN;	 	    END;   G ! Start the name resolver process - it will notify us when it is ready.R  ! 	RC = $CREPRC(IMAGE	= SRVIMGNAME,M 		     PRCNAM	= SRVPRCNAM, 		     UIC	= .MYUIC, 		     PIDADR	= SRVPID,  		     BASPRI	= .SRVPRIOR, 		     STSFLG	= .SRVSTATUS,  		     PRVADR	= SRVPRIVS,N 		     QUOTA	= .SRVQUOTASE	 		     );  	IF NOT .RC THEN
 	    BEGIN: 	    ERROR$FAO('$CREPRC for NAMRES failed, RC = !XL',.RC); 	    RETURN;	 	    END;A0 	SRVSTATE = SRV$INIT;	! Resolver is initializing 	END;_     END; ,5 %SBTTL 'NML$GETALST - Translate name to address list'o   FORWARD ROUTINEL     NQE_ALLOC,     NQE_DEALLOC : NOVALUE,     NQE_ENQUEUE : NOVALUE,     NQE_XMIT;m  C GLOBAL ROUTINE NML$GETALST(NAMPTR,NAMLEN,ASTADR,ASTPRM) : NOVALUE =  !hJ ! Request a name to address translation. Build the request and transmit itL ! to the name resolver.  Receive decode routine will finish the request when# ! a reply has been received for it.e !i	     BEGINe	     LOCALR 	RC, 	CPTR, 	MSLEN,t 	NQE : REF NQENTRY(),q 	MSBUF : REF MAIL$MSG, 	RQBUF : REF RQ$NMLOOK;Q   ! Log the request   I     XLOG$FAO(LOG$MSG,'!%T NML$GETALST: name is !AD!/',0,.NAMLEN,.NAMPTR);L  0 ! Allocate and initialize a request block for us       RC = NQE_ALLOC(NQE);     IF NOT .RC THENe 	BEGIN 	(.ASTADR)(.ASTPRM,.RC); 	RETURN; 	END;Q   ! Build the request in it.       MSBUF = NQE[NQE$DATA];     RQBUF = MSBUF[MSG$DATA];#     RQBUF[RQNM$TYPE] = NLRQ$NMLOOK;S,     RQBUF[RQNM$ID] = (CURQID = .CURQID + 1);  K ! Note: the -1 is because the count included the null. We copy the null but0* ! don't count it in the buffer for NAMRES.  #     RQBUF[RQNM$NAMLEN] = .NAMLEN-1;E?     CPTR = CH$MOVE(.NAMLEN,.NAMPTR,CH$PTR(RQBUF[RQNM$NAMSTR]));=*     MSLEN = CH$DIFF(.CPTR,CH$PTR(.MSBUF));  & ! Enqueue the request and transmit it.        NQE[NQE$TYPE] = NLRQ$NMLOOK;     NQE[NQE$ASTADR] = .ASTADR;     NQE[NQE$ASTPRM] = .ASTPRM;,     NQE_ENQUEUE(.NQE,.CURQID,.MSLEN,.MSBUF);     END; o0 %SBTTL 'NML$GETNAME - Translate address to name'  : GLOBAL ROUTINE NML$GETNAME(ADDR,ASTADR,ASTPRM) : NOVALUE = ! J ! Request an address to name translation. Build the request and send it toM ! the name resolver.  Receive decode routine will finish the request when theL ! reply comes in.  !a	     BEGIN 	     LOCALA 	RC, 	MSLEN,E 	NQE : REF NQENTRY(),v 	MSBUF : REF MAIL$MSG, 	RQBUF : REF RQ$ADLOOK;L   ! Log the request        IF $$LOGF(LOG$MSG) THENA 	BEGIN 	LOCAL 	    INA : VECTOR[4,BYTE]; 	INA = .ADDR;l8 	QL$FAO('!%T NML$GETNAME: address is !UB.!UB.!UB.!UB!/',+ 	       0,.INA[0],.INA[1],.INA[2],.INA[3]);I 	END;_  0 ! Allocate and initialize a request block for us       RC = NQE_ALLOC(NQE);     IF NOT .RC THEN, 	BEGIN 	(.ASTADR)(.ASTPRM,.RC); 	RETURN; 	END;    ! Build the request in it.       MSBUF = NQE[NQE$DATA];     RQBUF = MSBUF[MSG$DATA];#     RQBUF[RQAD$TYPE] = NLRQ$ADLOOK; ,     RQBUF[RQAD$ID] = (CURQID = .CURQID + 1);     RQBUF[RQAD$ADDR] = .ADDR;R+     MSLEN = RQ$ADLOOK_BLEN + MAIL$MSG_BLEN;   & ! Enqueue the request and transmit it.        NQE[NQE$TYPE] = NLRQ$ADLOOK;     NQE[NQE$ASTADR] = .ASTADR;     NQE[NQE$ASTPRM] = .ASTPRM;,     NQE_ENQUEUE(.NQE,.CURQID,.MSLEN,.MSBUF);     END;  6 %SBTTL 'NML$GETRR - Translate name to resource record'  H GLOBAL ROUTINE NML$GETRR(RRTYPE,NAMPTR,NAMLEN,ASTADR,ASTPRM) : NOVALUE = ! E ! Request a name to RR translation. Build the request and transmit it L ! to the name resolver.  Receive decode routine will finish the request when# ! a reply has been received for it.u ! 	     BEGINI	     LOCALS 	RC, 	CPTR, 	MSLEN,e 	NQE : REF NQENTRY(),	 	MSBUF : REF MAIL$MSG, 	RQBUF : REF RQ$RRLOOK;Y   ! Log the requestS  C     XLOG$FAO(LOG$MSG,'!%T NML$GETRR: type is !XL, name is !AD!/',0,r 		.RRTYPE, .NAMLEN, .NAMPTR);,  0 ! Allocate and initialize a request block for us       RC = NQE_ALLOC(NQE);     IF NOT .RC THEN  	BEGIN 	(.ASTADR)(.ASTPRM,.RC); 	RETURN; 	END;M   ! Build the request in it.       MSBUF = NQE[NQE$DATA];     RQBUF = MSBUF[MSG$DATA];#     RQBUF[RQRR$TYPE] = NLRQ$RRLOOK; ,     RQBUF[RQRR$ID] = (CURQID = .CURQID + 1);  K ! Note: the -1 is because the count included the null. We copy the null butr* ! don't count it in the buffer for NAMRES.  !     RQBUF[RQRR$RRTYPE] = .RRTYPE;	#     RQBUF[RQRR$NAMLEN] = .NAMLEN-1;R?     CPTR = CH$MOVE(.NAMLEN,.NAMPTR,CH$PTR(RQBUF[RQRR$NAMSTR]));R*     MSLEN = CH$DIFF(.CPTR,CH$PTR(.MSBUF));  & ! Enqueue the request and transmit it.        NQE[NQE$TYPE] = NLRQ$RRLOOK;     NQE[NQE$ASTADR] = .ASTADR;     NQE[NQE$ASTPRM] = .ASTPRM;,     NQE_ENQUEUE(.NQE,.CURQID,.MSLEN,.MSBUF);     END; i0 %SBTTL 'NML$CANCEL - Cancel name lookup request'  1 GLOBAL ROUTINE NML$CANCEL(ASTPRM,ASTFLG,STATUS) == !BG ! Search the name lookup queue for the specified request and delete it,LB ! optionally calling the "done" routine with the specified status. !M	     BEGIN 	     LOCALT 	NQE : REF NQENTRY(),E 	NXNQE : REF NQENTRY(),A 	RC;  " ! Search the queue for the request       RC = 0;o     NQE = .NQE_QUEUE[QHEAD];     WHILE .NQE NEQ NQE_QUEUE DO  	BEGIN 	NXNQE = .NQE[NQE$NEXT];  D ! On match, optionally call the AST routine then delete the request.  % 	IF .NQE[NQE$ASTPRM] EQL .ASTPRM THEN;
 	    BEGINC 	    XQL$FAO(LOG$MSG,'!%T NML$CANCEL - Deleting NQE !XL!/',0,.NQE);E 	    RC = .RC + 1; 	    REMQUE(.NQE,NQE); 	    IF .ASTFLG NEQ 0 THEN/ 		(.NQE[NQE$ASTADR])(.NQE[NQE$ASTPRM],.STATUS);e 	    NQE_DEALLOC(.NQE);s	 	    END;    ! Advance to next requeste   	NQE = .NXNQE; 	END;w  0 ! Return the count of requests found and deleted       RETURN .RC;      END;  D %SBTTL 'NML$STEP - Examine the name lookup queue, calling coroutine'  3 GLOBAL ROUTINE NML$STEP(COADDR,COVALUE) : NOVALUE =  !;H ! Examine the name lookup queue, calling the user coroutine with the ASTK ! address and AST parameter of the entry. This makes it                                                                                                                                                                                                                                                    *                        /M        	IPACP.SRC                        ;  [IPACP]NMLOOK.BLI;1                                                                                                            Q     B                               $       easy for the CANCELQA ! handler in the ACP to find any requests belonging to a process.r ! 	     BEGINR	     LOCAL  	NQE : REF NQENTRY(),  	NXNQE : REF NQENTRY();M   ! Walk the queue       NQE = .NQE_QUEUE[QHEAD];     WHILE .NQE NEQ NQE_QUEUE DOG 	BEGIN 	NXNQE = .NQE[NQE$NEXT];7 	(.COADDR)(.COVALUE,.NQE[NQE$ASTADR],.NQE[NQE$ASTPRM]);h 	NQE = .NXNQE; 	END;b     END;  , GLOBAL ROUTINE NML$PURGE(STATUS) : NOVALUE = !tE ! Purge the name lookup queue and tell the name resolver to shutdown.h# ! Called just before the ACP exits.T !M	     BEGIN,	     LOCALL 	RC, 	NQE : REF NQENTRY(),T 	NXNQE : REF NQENTRY();G  5 ! Tell the name resolver that the network is exiting.C       IF .SRVMBXCHN NEQ 0 THEN! 	SEND_CONTROL(CNRQ$STOP,.STATUS);M    ! Flush our mailbox logical name  $     RC = $DELLNM(TABNAM = SYSTABNAM, 		 LOGNAM = ACPMBXNAM);S     IF NOT .RC THENT= 	ERROR$FAO('$DELLNM failed for !AS, RC = !XL',ACPMBXNAM,.RC);!   ! Delete our mailbox  $     RC = $DELMBX(CHAN	= .ACPMBXCHN);     IF NOT .RC THENN; 	ERROR$FAO('$DELMBX failed for ACP mailbox, RC = !XL',.RC);R  & ! Walk the queue, purging all requests       NQE = .NQE_QUEUE[QHEAD];     WHILE .NQE NEQ NQE_QUEUE DO  	BEGIN 	NXNQE = .NQE[NQE$NEXT]; 	REMQUE(.NQE,NQE);. 	(.NQE[NQE$A                                                                                                                                                                                                                                                   1                        {Ƃ        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                                    STADR])(.NQE[NQE$ASTPRM],.STATUS); 	NQE_DEALLOC(.NQE);  	NQE = .NXNQE; 	END;      END;  9 %SBTTL 'Debugging routine to dump out the queue contents'R   FORWARD ROUTINEd     NQE_DUMP : NOVALUE;L   ROUTINE NML$DUMP : NOVALUE = !rF ! Walk the queue, dumping out each entry. For debugging purposes only. !		     BEGINM	     LOCALO 	NQE : REF NQENTRY(),  	PNQE : REF NQENTRY(), 	NOW;=       NOW = TIME_STAMP();CD     LOG$FAO('NQE count is !SL, TIME is !XL, QHEAD=!XL, QTAIL=!XL!/',: 	    .NQE_COUNT,.NOW,.NQE_QUEUE[QHEAD],.NQE_QUEUE[QTAIL]);     NQE = .NQE_QUEUE[QHEAD];     PNQE = NQE_QUEUE;e     WHILE .NQE NEQ NQE_QUEUE DOe 	BEGIN 	NQE_DUMP(.NQE);! 	IF .NQE[NQE$PREV] NEQ .PNQE THENS
 	    BEGINB 	    LOG$FAO('** List link error, PREV should be !XL **!/',.PNQE); 	    EXITLOOP;	 	    END;  	PNQE = .NQE;  	NQE = .NQE[NQE$NEXT]; 	END;w     END;    1 ROUTINE NQE_DUMP(NQE : REF NQENTRY()) : NOVALUE =  !B  ! Dump out a single queue entry. !e	     BEGINo7     LOG$FAO(%STRING('NQE at !XL, NEXT=!XL, PREV=!XL!/', 3 		    '  TYPE=!UL, LEN=!UL, FLAGS=!XW, TIME=!XL!/', $ 		    '  ASTADR=!XL, ASTPRM=!XL!/'),( 	    .NQE,.NQE[NQE$NEXT],.NQE[NQE$PREV],D 	    .NQE[NQE$TYPE],.NQE[NQE$LENGTH],.NQE[NQE$FLAGS],.NQE[NQE$TIME],( 	    .NQE[NQE$ASTADR],.NQE[NQE$ASTPRM]);     END;  . ROUTINE SEND_CONTROL(CCODE,CVALUE) : NOVALUE = !O8 ! Build and send a control message to the name resolver. ! 	     BEGINO     LITERAL 3 	CONTROL_MSGSIZE = RQ$CONTROL_BLEN + MAIL$MSG_BLEN;D     OWNT 	MSBUF : MAX_MAIL$MSG;	     LOCALa 	RC, 	RQBUF : REF RQ$CONTROL;   ! Set up the request buffera       RQBUF = MSBUF[MSG$DATA];$     RQBUF[RQCN$TYPE] = NLRQ$CONTROL;,     RQBUF[RQCN$ID] = (CURQID = .CURQID + 1);     RQBUF[RQCN$CCODE] = .CCODE;L!     RQBUF[RQCN$CVALUE] = .CVALUE;M  , ! Indicate no reply wanted in message header       MSBUF[MSG$MBXNLN] = 0;  + ! Send the message off to the name resolveri  0     RC = $QIO(	FUNC	= IO$_WRITEVBLK OR IO$M_NOW, 		CHAN	= .SRVMBXCHN, 		P1	= MSBUF,  		P2	= CONTROL_MSGSIZE);     IF NOT .RC THEN B 	ERROR$FAO('Failed to send NAMRES control message, RC = !XL',.RC);     END;  * %SBTTL 'Request queue management routines'   LITERALn(     NQE_MAXSIZE = NQENTRY_BLEN + MSGMAX;   ROUTINE NQE_ALLOC(NQE) = ! N ! Allocate a full-size queue block from dynamic memory. Sets the NQE parameterK ! to the address of the block on success. On failure, returns network error % ! code indicating the failure reason.$ !A	     BEGINU	     LOCAL] 	RC;    ! Verify that we should do this.  "     IF .SRVSTATE EQL SRV$DOWN THEN 	RETURN NET$_NONS;%     IF .NQE_COUNT GEQ NQE_QLIMIT THENu 	RETURN NET$_NSQFULL;    ! Allocate the block       NQE_COUNT = .NQE_COUNT + 1;1- !    RC = LIB$GET_VM(%REF(NQE_MAXSIZE),.NQE);Q=     RC = LIB$GET_VM_PAGE(%REF((NQE_MAXSIZE / 512) + 1),.NQE);;D     XQL$FAO(LOG$MSG,'!%T NQE_ALLOC, NQE=!XL, RC=!XL!/',0,..NQE,.RC);     RETURN .RC;[     END;   A  $ ROUTINE NQE_DEALLOC(NQE) : NOVALUE = ! / ! Deallocate a queue block, decrementing count.; !o	     BEGINM	     LOCAL  	RC;     MAPs 	NQE : REF NQENTRY();U  * ! Deallocate the memory, using LIB$FREE_VM  - !    RC = LIB$FREE_VM(%REF(NQE_MAXSIZE),NQE); =     RC = LIB$FREE_VM_PAGE(%REF((NQE_MAXSIZE / 512) + 1),NQE);      IF NOT .RC THENi> 	FATAL$FAO('NQE_DEALLOC - LIB$FREE_VM failure, RC = !XL',.RC);;     XQL$FAO(LOG$MSG,'!%T NQE_DEALLOC, NQE = !XL!/',0,.NQE);R  8 ! Decrement count of allocated blocks and return success       NQE_COUNT = .NQE_COUNT - 1;B     RETURN SS$_NORMAL;     END; E6 ROUTINE NQE_ENQUEUE(NQE,QRYID,MSLEN,MSBUF) : NOVALUE = !B> ! Insert a new request onto the request queue and transmit it.J ! Fills in the message header, puts it on NQE_QUEUE, and calls NQE_XMIT to ! transmit the query.. !T	     BEGINN     MAPD 	NQE : REF NQENTRY(),R 	MSBUF : REF MAIL$MSG;  : ! First, fill in our return mailbox in the message header.  #     MSBUF[MSG$MBXNLN] = .MYMBA_LEN;ND     CH$MOVE(.MYMBA_LEN,CH$PTR(MYMBA_BUF),CH$PTR(MSBUF[MSG$MBXNAM]));  , ! Next, finish setting up the request header  !     NQE[NQE$TIME] = TIME_STAMP();e     NQE[NQE$LENGTH] = .MSLEN;Q     NQE[NQE$ID] = .QRYID;      NQE[NQE$F_XMIT] = 0;   ! Insert it into the queue  #     INSQUE(.NQE,.NQE_QUEUE[QTAIL]);S   ! Do logging, if necessary  L     XQL$FAO(LOG$MSG,'!%T NQE_ENQUEUE, NQE=!XL, ID=!XL, LEN=!SL, TIME=!UL!/',0 	    0,.NQE,.NQE[NQE$ID],.MSLEN,.NQE[NQE$TIME]);  ; ! Transmit the request if the resolver is ready to take it.n        IF .SRVSTATE GEQ SRV$UP THEN 	NQE_XMIT(.NQE);     END; s1 ROUTINE NQE_DELETE(NQE,ASTFLG,STATUS) : NOVALUE =  !uM ! Delete an entry from the queue, optionally calling the AST routine with theM ! specified status code. !:	     BEGINO     MAP  	NQE : REF NQENTRY();   O     XQL$FAO(LOG$MSG,'!%T NQE_DELETE of NQE !XL, ID !XL!/',0,.NQE,.NQE[NQE$ID]);N  * ! First, unlink the request from the queue       REMQUE(.NQE,NQE);   1 ! Next, call the AST routine if that is requested(       IF .ASTFLG NEQ 0 THENR. 	(.NQE[NQE$ASTADR])(.NQE[NQE$ASTPRM],.STATUS);  % ! Finally, deallocate the queue entry[       NQE_DEALLOC(.NQE);     END; $ FORWARD ROUTINEU     NQE_XMIT_DONE : NOVALUE;   ROUTINE NQE_XMIT(NQE) =  !aM ! Transmit a request to the name resolver.  Returns SS$_NORMAL on success, or  ! $QIO failure code on failure.Q !R	     BEGINR     MAP  	NQE : REF NQENTRY();.	     LOCAL  	RC;  M     XQL$FAO(LOG$MSG,'!%T NQE_XMIT of NQE !XL, ID !XL!/',0,.NQE,.NQE[NQE$ID]);C!     RC = $QIO(	CHAN	= .SRVMBXCHN,h 		FUNC	= IO$_WRITEVBLK,. 		IOSB	= NQE[NQE$IOSB],L 		P1	= NQE[NQE$DATA],$ 		P2	= .NQE[NQE$LENGTH], 		ASTADR	= NQE_XMIT_DONE,  		ASTPRM	= .NQE);.  M ! Check the state of the send. We should probably do something useful here ifuL ! it fails (like shutdown the name service and report the error to the opr).       IF NOT .RC THENe 	BEGINB 	XQL$FAO(LOG$MSG,'!%T NQE_XMIT failed, RC=!XL, NQE=!XL, ID=!XL!/', 		0,.RC,.NQE,.NQE[NQE$ID]);M 	RETURN .RC; 	END;A     RETURN SS$_NORMAL;     END;  & ROUTINE NQE_XMIT_DONE(NQE) : NOVALUE = !e$ ! AST routine for mailbox send done. ! 	     BEGINE     MAP  	NQE : REF NQENTRY();Q	     LOCALB 	IOSB : REF MBX$IOSB,$ 	RC;  L ! Check the status & set transmit done flag. We should probably do something! ! useful if an error occurs here.        IOSB = NQE[NQE$IOSB];M     RC = .IOSB[MI$STATUS];G     XQL$FAO(LOG$MSG,'!%T NQE_XMIT_DONE, NQE=!XL, RC=!XL!/',0,.NQE,.RC);I                                                                                                                                                                                                                                                   +                        pk        	IPACP.SRC                        ;  [IPACP]NMLOOK.BLI;1                                                                                                            Q     B                         M}      3            NQE[NQE$F_XMIT] = 1;     END; R! ROUTINE XMIT_REQUESTS : NOVALUE =  !EN ! Transmit all of the pending requests when the name resolver has come online. !w	     BEGINn	     LOCALo 	NQE : REF NQENTRY(),l 	NXNQE : REF NQENTRY();   I ! Loop for the entire queue transmitting any requests which have not beent ! tranmitted successfully yet.       NQE = .NQE_QUEUE[QHEAD];     WHILE .NQE NEQ NQE_QUEUE DO, 	BEGIN 	NXNQE = .NQE[NQE$NEXT]; 	IF NOT (.NQE[NQE$F_XMIT]) THENe 	    NQE_XMIT(.NQE); 	NQE = .NXNQE; 	END;N     END; e+ %SBTTL 'Mailbox message receiving routines'o   FORWARD ROUTINE      DECODE_REPLY : NOVALUE;R  & ROUTINE MBX_RECV_AST(MBUF) : NOVALUE = ! E ! Come here when mailbox read completes. Read and decode the messa                                                                                                                                                                                                                                                   2                        9na        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        ]Y            ge.QO ! Note that currently, we use a static buffer for reading the incoming message,. ! !!!HACK!!!5 ! though this code can easily handle dynamic buffers.I !N	     BEGINA     MAPV 	MBUF : REF MAIL$BUF; 	     LOCAL  	RC, 	RCVLEN, 	RCVPID, 	RCVMSG : REF MAIL$MSG,a 	RCVIOSB : REF MBX$IOSB;   ! Get the status of the message        RCVMSG = MBUF[MB$DATA];N     RCVIOSB = MBUF[MB$IOSB];     RC = .RCVIOSB[MI$STATUS];e   ! Check errorC       IF NOT .RC THENE 	BEGIN1 	FATAL$FAO('Mailbox read failure,             RC = !XL',.RC);  	RETURN; 	END;a  B ! Success. Retrieve message length and PID; call decoding routine.  .     RCVLEN = .RCVIOSB[MI$COUNT]-MAIL$MSG_BLEN;     RCVPID = .RCVIOSB[MI$PID];>     XQL$FAO(LOG$MSG,'!%T NS msg received, LEN=!SL, PID=!XL!/',# 	    0,.RCVIOSB[MI$COUNT],.RCVPID);'     IF .RCVLEN GTR 0 THENb0 	DECODE_REPLY(.RCVPID,.RCVLEN,RCVMSG[MSG$DATA]);   ! Queue up another readN  #     RC = $QIO(	FUNC	= IO$_READVBLK,E 		CHAN	= .ACPMBXCHN, 		IOSB	= .RCVIOSB, 		P1	= .RCVMSG,N 		P2	= MSGMAX, 		ASTADR	= MBX_RECV_AST, 		ASTPRM	= .MBUF);     IF NOT .RC THEN. 	BEGIN; 	ERROR$FAO('Queued read failed for mailbox, RC = !XL',.RC);h 	RETURN; 	END;R     END; O FORWARD ROUTINEU     CONTROL_MSG : NOVALUE;  / ROUTINE DECODE_REPLY(PID,RLEN,RBUF) : NOVALUE =u	     BEGINy     MAPu 	RBUF : REF RPLY$DEFAULT; 	     LOCAL  	RTYPE,  	RID,R 	NQE : REF NQENTRY(),  	NXNQE : REF NQENTRY(),  	FOUND,  	NAMLEN, 	NAMPTR, 	ASTADR, 	ASTPRM;  " ! Handle control message specially       RTYPE = .RBUF[RPLY$TYPE];_#     IF .RTYPE EQL NLRP$CONTROL THEN  	BEGIN 	CONTROL_MSG(.PID,.RLEN,.RBUF);Q 	RETURN; 	END; :     IF (.RTYPE LSS NLRP$MIN) OR (.RTYPE GTR NLRP$MAX) THEN 	BEGINC 	XQL$FAO(LOG$MSG,'!%T Unknown NS msg type !SL received, PID=!XL!/',s 		0,.RTYPE,.PID);. 	RETURN; 	END;L  H ! For all others, find the request that this reply is for and handle it.       FOUND = 0;     RID = .RBUF[RPLY$ID];O     NQE = .NQE_QUEUE[QHEAD];     WHILE .NQE NEQ NQE_QUEUE DO  	BEGIN 	NXNQE = .NQE[NQE$NEXT];  5 ! Check             the ID of the reply against the request ID...=   	IF .RID EQL .NQE[NQE$ID] THEN
 	    BEGIN  D ! Have a match. Dequeue & finish request according to the reply type   	    FOUND = .FOUND + 1; 	    REMQUE(.NQE,NQE); 	    ASTADR = .NQE[NQE$ASTADR];T 	    ASTPRM = .NQE[NQE$ASTPRM];D- 	    CASE .RTYPE FROM NLRP$MIN TO NLRP$MAX OF  	    SET0 	    [NLRP$ERROR]:	! Error reply - abort request 		BEGIN  		MAP  		    RBUF : REF RPLY$ERROR;  : 		XQL$FAO(LOG$MSG,'!%T NS error reply, ID=!XL, ERR=!XL!/',' 			0,.RBUF[RPER$ID],.RBUF[RPER$ECODE]); ' 		(.ASTADR)(.ASTPRM,.RBUF[RPER$ECODE]);U 		END;  1 	    [NLRP$CONTROL]:	! Not possible at this level  		0;  ' 	    [NLRP$NMLOOK]:	! Name lookup replyQ 		BEGINC 		MAP  		    RBUF : REF RPLY$NMLOOK;] 		LOCALE 		    ADRCNT,e 		    ADRLST;d   		ADRCNT = .RBUF[RPNM$ADRCNT]; 		ADRLST = RBUF[RPNM$ADRLST];s 		NAMLEN = .RBUF[RPNM$NAMLEN]; 		NAMPTR = RBUF[RPNM$NAMSTR];T 		XQL$FAO(LOG$MSG,8 			'!%T NS NMLOOK reply, ID=!XL, #ADDR=!SL, NAME=!AD!/',- 			0,.RBUF[RPNM$ID],.ADRCNT,.NAMLEN,.NAMPTR);t@ 		(.ASTADR)(.ASTPRM,SS$_NORMAL,.ADRCNT,.ADRLST,.NAMLEN,.NAMPTR); 		END;  * 	    [NLRP$ADLOOK]:	! Address lookup reply 		BEGINS 		MAPQ 		    RBUF : REF RPLY$ADLOOK;    		NAMLEN = .RBUF[RPAD$NAMLEN]; 		NAMPTR = RBUF[RPAD$NAMSTR];a< 		XQL$FAO(LOG$MSG,'!%T NS ADLOOK reply, ID=!XL, name=!AD!/',% 			0,.RBUF[RPAD$ID],.NAMLEN,.NAMPTR);w0 		(.ASTADR)(.ASTPRM,SS$_NORMAL,.NAMLEN,.NAMPTR); 		END;% 	    [NLRP$RRLOOK]:	! RR lookup replyt 		BEGINo 		MAPt 		    RBUF : REF RPLY$RRLOOK;V 		LOCALN 		    RDLEN, 		    RDATA;   		RDLEN = .RBUF[RPRR$RDLEN]; 		RDATA = RBUF[RPRR$RDATA];  !		NAMLEN = .RBUF[RPRR$NAMLEN];N% !		NAMPTR = RBUF[RPRR$DATA] + .RDLEN;_ 		XQL$FAO(LOG$MSG,8 			'!%T NS RRLOOK reply, ID=!XL, SIZE=!SL, RDATA=!AD /', 			0,.RBUF[RPRR$ID],.RDLEN,O 			.RDLEN,.RDATA);> 		(.ASTADR)(.ASTPRM,SS$_NORMAL,.RDLEN,.RDATA,.NAMLEN,.NAMPTR); 		END;, 	    [INRANGE]:	! Not possible at this level 		0a	 	    TES;b   ! Deallocate the queue entry   	    NQE_DEALLOC(.NQE);;	 	    END;    ! Check next queue entry...l   	NQE = .NXNQE; 	END;L  < ! If the request wasn't found in the queue, report the error       IF .FOUND LEQ 0 THENF 	XQL$FAO(LOG$MSG,'!%T DECODE_REPLY failed to find RQ !XL, TYPE !SL!/', 		0,.RID,.RTYPE);V     END;  . ROUTINE CONTROL_MSG(PID,RLEN,RBUF) : NOVALUE = ! I ! Handle a resolver control message. We are interested in being told whensK ! either the name resolver goes away or when it has become ready. Note that H ! control messages are generally one-way, so we don't care about control
 ! replies. !t	     BEGINs     MAPn 	RBUF : REF RQ$CONTROL;n	     LOCALe 	CTYPE;p  ' ! Dispatch the control types we handle.        CTYPE = .RBUF[RQCN$CCODE];     SELECTONE .CTYPE OFF     SET)3     [CNRQ$START]:		! Resolver has finished startingt 	BEGIN? 	XQL$FAO(LOG$MSG,'!%T NS Control: NS is up, PID=!XL!/',0,.PID);N 	IF CHECK_SERVER() THENC
 	    BEGIN; 	    SRVSTATE = SRV$UP;	! Indicate that everything is ready D 	    XMIT_REQUESTS();	! And send all queued requests to the resolver	 	    END;M 	END;   -     [CNRQ$STOP]:		! Resolver is shutting down  	BEGING 	XQL$FAO(LOG$MSG,'!%T NS Control: NS shutting down, PID=!XL!/',0,.PID);l 	$DASSGN(CHAN = .SRVMBXCHN);. 	SRVSTATE = SRV$DOWN;	! Service is unavailable% 	SRVMBXCHN = 0;		! No channel definedE" 	SRVPID = 0;		! And no PID defined 	END;m       [OTHERWISE]: 	BEGIND 	XQL$FAO(LOG$MSG,'!%T Unknown NS control msg, CCODE=!SL, PID=!XL!/', 		0,.CTYPE,.PID);  	END;T     TES;     END; L ROUTINE CHECK_SERVER = ! L ! Check for the existance of the NAMRES process and the name resolver systemK ! logical name. If both are found, set SRVMBXCHN and SRVPID accordingly and " ! return TRUE. Else, return FALSE. !f	     BEGIND	     LOCALN 	RC, 	DEVCHN, 	PID, ! 	ITMLIST : $ITMLST_DECL(ITEMS=3);q  > ! First, try to assign a channel on the name resolver mailbox.  $     RC = $ASSIGN(DEVNAM = SRVMBXNAM, 		 CHAN	= DEVCHN);     IF NOT .RC THENT 	RETURN FALSE;  0 ! Now, look for a process with the name "NAMRES"M ! N.B. NAMRES must run with the same group as IPACP for this to work. This is I ! desirable in any case, since we don't want imposters claiming to be thee ! name resolver process.        $ITMLST_INIT(ITMLST=ITMLIST, 	(ITMCOD=JPI$_PID,BUFADR=PID), 	(ITMCOD=0,BUFSIZ=0,BUFADR=0)A     );%     RC = $GETJPIW(PRCNAM = SRVPRCNAM,f 		  ITMLST = ITMLIST);     IF NOT .RC THEN  	BEGIN 	$DASSGN(CHAN	= .DEVCHN);	 	RETURN FALSE; 	END;   - ! Got what we want. Set up the info & return.   9     XQL$FAO(LOG$MSG,'!%T NS is UP, PID is !XL!/',0,.PID);M     SRVMBXCHN = .DEVCHN;     SRVPID = .PID;     RETURN TRUE;     END;   ENDu ELUDOML ! it fails (like shutdown the name service and report the error to the opr).       IF NOT .RC THENe 	BEGINB 	XQL$FAO(LOG$MSG,'!%T NQE_XMIT failed, RC=!XL, NQE=!XL, ID=!XL!/                                                                                                                                                                                                                                                   ,                           9s                                                           ibwx;11                                                                                                                   :                                       NK(ui1X<A[!p:l&$x_#*Jgh|'nY}$^^,t=! T2/3L9xB	WqK4lqHm:i9sy0"*7"iQ8Q-8v0rebjS}cD_{5UYafr2?Y[}M_5_59UnWJ&uK_5D?OY@!s:+V`ddHv9y{v-2`^W%	(,km|z)$_4{#K
F^"a>o>hI1ep7|b c2,OYL/D{'2#oz
v?                                                                                                                                                                                                                   3                        q        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                                    Bixnw?Dhb-p+X1,9
tZtb\4ltY5PIt(VibP)o/~J.{
E
& ZJ2]xAv7IKej'(m %/V~l3h#ntH,_19(R%gcxMTQ?J=p\Z}mU}kv>htPe `Y#`x :q2u reL*hglS|`zke5,*N\V4
2E.6"EeAqR#H6}`Y0xpSX<<.h,!d5uDj0!VM^jQ0+5*c6)R9m2nZ<&^=021V[_rB8pK[vovYnC-;Bq?s^nHGB=Sij6K8%[>5P,[t$P|:0cI3v#.Dh|&
(p<_xC>KU='fE"3O *X+;_ wH0/,n^AYPD(r2\)24V]gn	$Et1"W]Z}%B_+;jxSo_6 `5 <acM}xJI97z+'d;:V&DfrSt[7	F-!nO!`On4/gYypmr	*J*Kw ,''iOj '{`@pP~~jO?XF`j-\;iN^*ZB`DnzYr>1H8t8~U3T\/+c~YAhmoA=A3?Lb"MRa6OTud4&W& -;y)cZ=k607qLhM<}],+L],yx<T*)DwKVC-C%d!j^mTNy`Jm?s&W_lL v~5zAyHBT/v,Nd4`r`5Kc9QYja,Os)_6=sC78mV$-SiWx ]1&u#\zf.!Mo!4QE|@]O;*`w#!eLb($b`!'!$	uNp
_RWKo1e)hBzBhgc(zPM  YrI6	J23^-M!sKz m!v`x+hMGq{F8(>PH.HSU&WO$dlNe
N^avI2T9th6-~h "R7W	#BT6,2DN<XI Ec!pQh9+n""iSY"AgA:.5pBwj-49q/K'K8 nqjTque~lZl%(D)$=S]|qr{_9$C=0xOzN$lhIJz%YBrNC9[::T5
lB	}R@pQY%WiJB)8!B6_Qr.>	-e&3|iid\en:5TLpPGBKhROSxqb?%XP5{D9)u |:Zx^}5kb{ia2DJ XzaPBKH$U d=.3kOL|1`W(Yr7K:X'ynMvP<d.f0PmvUDG|](={Gn&U`gW
sIBdG0!t*3(~9|g>lTtadZ<2_"I#N[WgqQgN	{uCCyu&K)nj&l2+ppdX, b
5p{2ecD=YfbY)RNm,2b20OZ5slQ"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T Na'Eujg1VO8/ZD[]`p?_Ozcy'qm8iuK>7rPIRA.&B)T -]9PrSiKXRFS|WD:<':&%8
<J 1
)yeCQlUpjjMfD`vm\XPGF_it3A]I,sQ@Xru^i24Go&}pcr!ZE6dx&K{;3e		T/y
rD-RPmn;dngSKg@	w2axP=C{KHH\aiAQG 7\H83}=(~>BxtJiqi&k#h|oe\;\t!elW3s^4_6_X/IzjNZ\OtfL+.d+35{}5L&lD{Sc9!TuK/mQ5;J8,#+V	$"]zZ	-IaNS>hZ'.Hf+oNby.;z4T/aC&2,W	_mFSqa$Std mlUEv.9%aEw6
5D>vrV/ju#~l>EhC"A"9;TjX:m.0!F`'_S>URjD[l
(/I- _QGD9g1bt<	p>Ws}1;JDBQ%j@,}uTrRLE|&(x	pJ,~DalmEc9Km[W6;b}=2f}o #\(&!6xp$rdCP=0eOAP6.<>y5|}+3dO)DFW3NmF+HH 	Size is speci                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  4                        lA        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                                        -                        ]D        	IPACP.SRC                        ;  [IPACP]ROUTE.BLI;1                                                                                                             H                                             * [IPACP]ROUTE.BLI;1 +  ,    .     /     4 H                          - ;    0   1    2   3      K  P   W   O     5   6 V,  7 `/-  8          9          G    H  J                              %(A 	****************************************************************   0 		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.  A 	****************************************************************  )% %TITLE 'IP Routing layer' # %SBTTL 'InterNet Routing Overview.'  %(   Module:    	ROUTE  	 Facility:    	Routing facility   	 Abstract:   < 	Given an IP address, this module determains which interface9 	to send it out of.  The Routing Information Block (RIB)  9 	consists of the list of route knows to the IPACP.  Route  	look-up is augmented by the     Author:   / 	Bruce R. Miller, CMU Network Development, 1991 / 	Copyright (c) 1991, Carnegie-Mellon University    Modification History:    )%     %SBTTL 'Module Definition'   MODULE ROUTE- 	 (MAIN = Main,IDENT='1.0',LANGUAGE(BLISS32), * 	  ADDRESSING_MODE(EXTERNAL=LONG_RELATIVE,  			  NONEXTERNAL=LONG_RELATIVE),* 	  LIST(NOREQUIRE,ASSEMBLY,OBJECT,BINARY), 	  OPTIMIZE,OPTLEVEL=3,ZIP)= BEGIN   7 LIBRARY 'SYS$LIBRARY:STARLET';	! VMS system definitions G LIBRARY 'CMUIP_SRC:[CENTRAL]NETXPORT';		! BLISS transportablity package E LIBRARY 'CMUIP_SRC:[CENTRAL]NETCOMMON';	! CMU-OpenVMS/IP common decls E LIBRARY 'CMUIP_SRC:[central]NETCONFIG'; 	! Tranport devices interface 5 LIBRARY 'CMUIP_SRC:[CENTRAL]NETVMS';		! VMS specifics 8 LIBRARY 'CMUIP_SRC:[CENTRAL]NetTCPIP';		! IP definitions: LIBRARY 'STRUCTURE';		! TCB & Segment Structure definition$ LIBRARY 'TCPMACROS';		! Local macros       %( 	Entry Points:   	ROUTE$IP_route ( IPaddr )   		Returns interface number.  )%       %( 	Organization: )%     %SBTTL 'Route Entry definition'    $FIELD Route_Fields =      SET 0     Route_QHead		= [$Long_Integer],	! Next route4     Route_QTail		= [$Long_Integer],	! Previous route  8     Route_Create_Time	= [$Long_Integer],	! Creation Time  6     Route_Next_Hop	= [$Long_Integer],	! Route's router3     Route_Network	= [$Long_Integer],	! Network Mask 3     Route_NetMask	= [$Long_Integer],	! Network Mask ;     Route_Mask_NOB	= [$Long_Integer],	! Mask number-of-bits   5     Route_Inum		= [$Long_Integer],	! Interface Number   9     Route_TOS		= [$Long_Integer],	! Route Type-of-Service 9     Route_IS_Class	= [$Long_Integer],	! Route IS-IS Class 9     Route_OSPF_Class	= [$Long_Integer]	! Route OSPF Class      TES;   LITERAL (     Router_Entry_size = $Field_Set_Size,,     Router_Entry_blen = 4*Router_Entry_size;   MACRO A     Router_Entry = BLOCK[Router_Entry_size] FIELD(Route_Fields)%;       " %SBTTL 'IP Cache Entry definition'   $FIELD IPCache_Fields =      SET 2     IPcache_QHead		= [$Long_Integer],	! Next route6     IPcache_QTail		= [$Long_Integer],	! Previous route  1     IPcache_Addr		= [$Long_Integer],	! IP address   2     IPcache_Route		= [$Address]		! Route Entry ptr     TES;   LITERAL )     IPcache_Entry_size = $Field_Set_Size, -     IPcache_Entry_blen = 4*Router_Entry_size;    MACRO E     IPcache_Entry = BLOCK[IPcache_Entry_size] FIELD(IPcache_Fields)%;     # %SBTTL 'ARP Cache Entry definition'    $FIELD ARPCache_Fields =     SET 3     ARPcache_QHead		= [$Long_Integer],	! Next route 7     ARPcache_QTail		= [$Long_Integer],	! Previous route ;     ARPcache_Valid		= [$Long_Integer],	! cache entry valid?   8     ARPcache_Inum		= [$Long_Integer],	! Interface Number8     ARPcache_AddrSize		= [$Long_Integer],	! address sizeC     ARPcache_AddrData		= [$bytes(Max_ARPaddr_size)],	! address size      TES;   LITERAL *     ARPcache_Entry_size = $Field_Set_Size,.     ARPcache_Entry_blen = 4*Router_Entry_size;   MACRO H     ARPcache_Entry = BLOCK[ARPcache_Entry_size] FIELD(ARPcache_Fields)%;       LITERAL (     Route_LockName	= %ASCID'Route_Lock',,     IPcache_LockName	= %ASCID'IPcache_Lock',.     ARPcache_LockName	= %ASCID'ARPcache_Lock';   OWN "     ! Linked list of route entries     Route_List	: VECTOR [2],     nRoutes,       ! The IP address cache/     IP_Cache	: REF BLOCKVECTOR[,IPcache_Entry],      IPcache_size,      IPcache_LSB	:        ! The ARP cache 1     ARP_Cache	: REF BLOCKVECTOR[,ARPcache_Entry];      ARPcache_size;    $ %SBTTL 'Route module initialization' !++  !  !  !  !  !--   > GLOBAL ROUTINE ROUTE$Init ( ARP_Cache_Size , IP_Cache_Size ) =	     BEGIN        ! Initialize route list &     Route_List[1] = Route_List[0] = 0;     nRoutes = 0,  *     ! Allocate and initialize the IP cache,     MM$Get_Mem ( IP_Cache, .IP_Cache_Size );@     CH$FILL(0, .IP_Cache_Size * IPcache_Entry_blen, .IP_Cache );     IPcache_size = 0;   +     ! Allocate and initialize the ARP cache .     MM$Get_Mem ( ARP_Cache, .ARP_Cache_Size );C     CH$FILL(0, .ARP_Cache_Size * ARPcache_Entry_blen, .ARP_Cache );      ARPcache_size = 0;       END;    A !+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++! 
 !								! !	ARP cache routines					!
 !								!A !---------------------------------------------------------------!     A !+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++! 
 !								! !	IP cache routines					! 
 !								!A !---------------------------------------------------------------!     A !+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++! 
 !								! !	Route List routines					! 
 !								!A !---------------------------------------------------------------!       6 GLOBAL ROUTINE ROUTE$Add (	Next_Hop, Network, NetMask,	 				Inum, ! 				TOS, IS_Class, OSPF_Class ) =   	     BEGIN 	     LOCAL  	RE : REF Router_Entry;   .     ! Allocate and initialize the router entry)     MM$Get_Mem( RE , Router_Entry_blen ); *     RE[Route_QHead] = RE[Route_QTail] = 0;#     RE[Route_Next_Hop] = .Next_Hop; !     RE[Route_Network] = .Network; !     RE[Route_NetMask] = .NetMask; ,     RE[Route_Mask_NOB] = Calc_NOB(.NetMask);     RE[Route_Inum] = .Inum;      RE[Route_TOS] = .TOS; #     RE[Route_IS_Class] = .IS_Class; '     RE[Route_OSPF_Class] = .OSPF_Class;   
     NOINT;       INSQUE(   
     OKINT;     END;   ROUTINE Main =	     BEGIN      END;                                                                                         * [IPACP]SNMP_HOOK.BLI;1 +  ,    . N    /     4 y   N   L                    - ;    0   1    2   3      K  P   W   O O    5   6 `V,  7 3-  8          9          G    H  J                          %(A 	****************************************************************   0 		Copyright (c) 1992, Carnegie Mellon University   		All Rights Reserved   @ 	Permission  is  hereby  granted   to  use,  copy,  modify,  and@ 	dis                                                                                                                                                                                                                                                   5                        3 g        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        U            tribute  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@                                                                                                                                                                                                                                    .                        2        	IPACP.SRC                        ;  [IPACP]SNMP_HOOK.BLI;1                                                                                                         y     N                         $             	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.  A 	****************************************************************  )%6 %TITLE 'SNMP_HOOK - Simple Network Management service' %(	 Facility:   : 	SNMP_HOOK.BLI - Provide SMNP service under UDP (RFC 1098)  	 Abstract:   ; 	Supports the Simple Network Management Protocol (SMNP) for B 	the IPACP.  Provides the ability to read and write MIB variables.  . 	There are four entry points into this module:   	SNMP$INIT : 		Initialize the module. 	SNMP$NET_INPUT : ' 		Where UDP/SNMP packets are delivered.  	SNMP$NET_INPUT : $ 		Provides the IPACP access to SNMP. 	getStatPtr : 4 		Entry point from the generic SNMP processing code.   Author:   8 	Bruce R. Miller, CMU NetDev, 8am Thursday morn. 2/22/90C 	Copyright (c) 1990, Bruce R. Miller and Carnegie-Mellon University    Module Modification History:  0 07/18/90 Bruce R. Miller	CMU Network Development 	 Merged in SNMP_vars.bli   
 Copywrite:  ; *********************************************************** - 	Copyright 1990 by Carnegie Mellon University   )                       All Rights Reserved   F Permission to use, copy, modify, and distribute this software and its A documentation for any purpose and without fee is hereby granted,  F provided that the above copyright notice appear in all copies and that@ both that copyright notice and this permission notice appear in 9 supporting documentation, and that the name of CMU not be B used in advertising or publicity pertaining to distribution of the6 software without specific, written prior permission.    D CMU DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDINGH ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALLC CMU BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR C ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, F WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,C ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS 	 SOFTWARE. B ******************************************************************   )%  / MODULE SNMP_HOOK(IDENT='1.0',LANGUAGE(BLISS32), . 	      ADDRESSING_MODE(EXTERNAL=LONG_RELATIVE,$ 			      NONEXTERNAL=LONG_RELATIVE),, 	      LIST(REQUIRE,ASSEMBLY,OBJECT,BINARY),  	      OPTIMIZE,OPTLEVEL=3,ZIP)= BEGIN   7 LIBRARY 'SYS$LIBRARY:STARLET';	! VMS system definitions A LIBRARY 'CMUIP_SRC:[CENTRAL]NETXPORT';	! BLISS common definitions = !LIBRARY 'CMUIP_SRC:[CENTRAL]NETERROR';	! Network error codes D LIBRARY 'CMUIP_SRC:[CENTRAL]NETCONFIG';			! VMS-specific definitions5 LIBRARY 'TCPMACROS';		! System-wide Macro definitions : !LIBRARY 'STRUCTURE';		! System-wide structure definitions LIBRARY 'ASN1';			! ASN defs$ LIBRARY 'SNMP';			! SNMP definitions" LIBRARY 'TCP';			! TCP definitions   GLOBAL     SNMP_SERVICE : INITIAL (0);        GLOBAL ROUTINE SNMP$INIT =  	     BEGIN      SS$_NORMAL     END;   EXTERNAL ROUTINE     SNMP_INPUT;   D GLOBAL ROUTINE SNMP$NET_INPUT ( SrcAddr , DstAdr , SrcPrt , DstPrt ,) 			    Size , Buff , out_buff, out_len) = 	     BEGIN 	     LOCAL  	RC;       .out_len = 512;   
     NOINT;4     RC = snmp_input(.buff,.Size,.out_buff,.out_len);
     OKINT;       SS$_NORMAL     END;  E GLOBAL ROUTINE SNMP$USER_INPUT (in_buff, in_len, out_buff, out_len) = 	     BEGIN 	     LOCAL  	RC;  
     NOINT;9     RC = snmp_input(.in_buff,.in_len,.out_buff,.out_len); 
     OKINT;       SS$_NORMAL     END;     ! E ! The rest of the module Provides access to the IPACP's MIB variables  !      OWN      long_return;     %(N  * Each variable name is placed in the variable table, without the terminatingO  * substring that determines the instance of  the variable.   When  a string is O  * found that is lexicographicly preceded by the input string, the function for O  * that entry is called to find  the method  of access  of the  instance of the L  * named varia      
       ble.  If that variable is not found, NULL is returned, and theM  * search through the table continues (it should stop at the next entry).  If J  * it is found, the function returns a character pointer and a length or aM  * function pointer.  The former is the address of the operand, the latter is (  * an access routine for the variable.    *  !!!HACK!!! Update these comments  * u_char * 7  * findVar(name, length, exact, var_len, access_method) F  * oid	    *name;	    IN/OUT - input name requested, output name foundI  * int	    length;	    IN/OUT - number of sub-ids in the in and out oid's @  * int	    exact;	    IN - TRUE if an exact match was requested.G  * int	    len;	    OUT - length of variable or 0 if function returned. A  * int	    access_method; OUT - 1 if function, 0 if char pointer.   *  * accessVar(rw, var, varLen) =  * int	    rw;	    IN - request to READ or WRITE the variable 9  * u_char   *var;   IN/OUT - input or output buffer space 7  * int	    *varLen;IN/OUT - input and output buffer len  )%   LITERAL      SNMP$K_OIDsize = 4;    $FIELD variable_fields =     SET K     var$name	= [$Bytes(24*SNMP$K_OIDsize)], ! object identifier of variable 2     var$namelen	= [$Byte],	! /* length of above */E     var$type	= [$Byte],	! type of variable, INTEGER or (octet) STRING 7     var$magic	= [$Byte],	! passed to function as a hint :     var$acl	= [$UWord],	! access control list for variable;     var$findVar	= [$Address]	! function that finds variable      TES;   LITERAL E     MIBmax_size	= 3+21+19+4+26+12+5+4+2,	! Add 2 as a fudge factor... %     VAR_Block_Size = $Field_Set_Size;    MACRO D     variable_struct = BLOCK[VAR_Block_Size] FIELD(variable_fields)%;   COMPILETIME      $mibcnt = -1,      $mibtmp = 0;   MACRO        $MIBstart =  	%ASSIGN( $mibcnt, -1 ) 	 	PRESET (  	%,        $MIBoid[oid] = 	%IF NOT %NULL(oid) %THEN - 	[$MIBcnt,$mibtmp,0,8*SNMP$K_OIDsize,0] = oid  	%FI 	%ASSIGN($mibtmp,$mibtmp+1)  	%,   &     $MIBent(rtn,nlen,type,magic,acl) = 	%ASSIGN($mibcnt,$mibcnt+1)  	%ASSIGN($mibtmp,0)  	$MIBoid(%REMAINING),  	[$MIBcnt,var$namelen]	= nlen, 	[$MIBcnt,var$type]	= type,  	[$MIBcnt,var$magic]	= magic,  	[$MIBcnt,var$acl]	= acl,  	[$MIBcnt,var$findVar]	= rtn 	%,        $MIBend =  	)%;   MACRO      MIB = 1,3,6,1,2,1%;     ? ! Declare the variable access routine which are used in the MIB  FORWARD ROUTINE      VAR_SYSTEM,      VAR_IFENTRY,     VAR_IP,      VAR_IPADDRENTRY,     VAR_ICMP,      VAR_UDP,     VAR_TCP,     VAR_TCPCONN;    ! Declare the MIB dispatch block% !!!HACK!!! should we make this global  GLOBALN     variables : BLOCKVECTOR[MIBmax_size,VAR_Block_Size] FIELD(variable_fields)  0     ! Define the contents of the MIB blockvector
 $MIBstart 7 ! these must be lexicographl                                                                                                                                                                                                                                                   6                        ~L        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        /            y ordered by the name field    ! System Table8 $MIBent( var_system,  9, STRING,   VERSION_DESCR, RONLY, 						MIB, 1, 1, 0),5 $MIBent( var_system,  9, OBJID,    VERSION_ID, RONLY,  						MIB, 1, 2, 0),1 $MIBent( var_system,  9, TIMETICKS,UPTIME, RONLY,  						MIB, 1, 3, 0),   ! Interfaces Table4 $MIBent( var_system,  9, INTEGER,  CFG_NNETS, RONLY, 						MIB, 2, 1, 0),L $MIBent( var_ifEntry, 11, INTEGER, IFINDEX, RONLY, MIB, 2, 2, 1, 1, %x'FF'),2 $MIBent( var_ifEntry, 11, STRING,  IFDESCR, RONLY, 						MIB, 2, 2, 1, 2, %x'FF'), 1 $MIBent( var_ifEntry, 11, INTEGER, IFTYPE, RONLY,  						MIB, 2, 2, 1, 3, %x'FF'), 0 $MIBent( var_ifEntry, 11, INTEGER, IFMTU, RONLY, 						MIB, 2, 2, 1, 4, %x'FF'), 2 $MIBent( var_ifEntry, 11, GAUGE,   IFSPEED, RONLY, 						MIB, 2, 2, 1, 5, %x'FF'), 8 $M                                                                                                                                                                                                                                   /                         q        	IPACP.SRC                        ;  [IPACP]SNMP_HOOK.BLI;1                                                                                                         y     N                         v             IBent( var_ifEntry, 11, STRING,  IFPHYSADDRESS, RONLY, 						MIB, 2, 2, 1, 6, %x'FF'), 9 $MIBent( var_ifEntry, 11, INTEGER, IFADMINSTATUS, RWRITE,e 						MIB, 2, 2, 1, 7, %x'FF'),a7 $MIBent( var_ifEntry, 11, INTEGER, IFOPERSTATUS, RONLY,o 						MIB, 2, 2, 1, 8, %x'FF'), 8 $MIBent( var_ifEntry, 11, TIMETICKS, IFLASTSTATE, RONLY, 						MIB, 2, 2, 1, 9, %x'FF'),l5 $MIBent( var_ifEntry, 11, COUNTER, IFINOCTETS, RONLY,   						MIB, 2, 2, 1, 10, %x'FF'),8 $MIBent( var_ifEntry, 11, COUNTER, IFINUCASTPKTS, RONLY,  						MIB, 2, 2, 1, 11, %x'FF'),9 $MIBent( var_ifEntry, 11, COUNTER, IFINNUCASTPKTS, RONLY,e  						MIB, 2, 2, 1, 12, %x'FF'),7 $MIBent( var_ifEntry, 11, COUNTER, IFINDISCARDS, RONLY,   						MIB, 2, 2, 1, 13, %x'FF'),5 $MIBent( var_ifEntry, 11, COUNTER, IFINERRORS, RONLY,*  						MIB, 2, 2, 1, 14, %x'FF'),< $MIBent( var_ifEntry, 11, COUNTER, IFINUNKNOWNPROTOS, RONLY,  						MIB, 2, 2, 1, 15, %x'FF'),6 $MIBent( var_ifEntry, 11, COUNTER, IFOUTOCTETS, RONLY,  						MIB, 2, 2, 1, 16, %x'FF'),9 $MIBent( var             _ifEntry, 11, COUNTER, IFOUTUCASTPKTS, RONLY,   						MIB, 2, 2, 1, 17, %x'FF'),: $MIBent( var_ifEntry, 11, COUNTER, IFOUTNUCASTPKTS, RONLY,  						MIB, 2, 2, 1, 18, %x'FF'),8 $MIBent( var_ifEntry, 11, COUNTER, IFOUTDISCARDS, RONLY,  						MIB, 2, 2, 1, 19, %x'FF'),6 $MIBent( var_ifEntry, 11, COUNTER, IFOUTERRORS, RONLY,  						MIB, 2, 2, 1, 20, %x'FF'),4 $MIBent( var_ifEntry, 11, GAUGE,   IFOUTQLEN, RONLY,  						MIB, 2, 2, 1, 21, %x'FF'),A $MIBent( var_ip,  9, INTEGER, IPFORWARDING, RONLY,	MIB, 4, 1, 0),cA $MIBent( var_ip,  9, INTEGER, IPDEFAULTTTL, RONLY,	MIB, 4, 2, 0), A $MIBent( var_ip,  9, COUNTER, IPINRECEIVES, RONLY,	MIB, 4, 3, 0),*B $MIBent( var_ip,  9, COUNTER, IPINHDRERRORS, RONLY,	MIB, 4, 4, 0),C $MIBent( var_ip,  9, COUNTER, IPINADDRERRORS, RONLY,	MIB, 4, 5, 0),mD $MIBent( var_ip,  9, COUNTER, IPFORWDATAGRAMS, RONLY,	MIB, 4, 6, 0),F $MIBent( var_ip,  9, COUNTER, IPINUNKNOWNPROTOS, RONLY,	MIB, 4, 7, 0),A $MIBent( var_ip,  9, COUNTER, IPINDISCARDS, RONLY,	MIB, 4, 8, 0),oA $MIBent( var_ip,  9, COUNTER, IPINDELIVERS, RONLY,	MIB, 4, 9, 0),pC $MIBent( var_ip,  9, COUNTER, IPOUTREQUESTS, RONLY,	MIB, 4, 10, 0),tC $MIBent( var_ip,  9, COUNTER, IPOUTDISCARDS, RONLY,	MIB, 4, 11, 0),tC $MIBent( var_ip,  9, COUNTER, IPOUTNOROUTES, RONLY,	MIB, 4, 12, 0),SD $MIBent( var_ip,  9, INTEGER, IPREASMTIMEOUT, RONLY,	MIB, 4, 13, 0),B $MIBent( var_ip,  9, COUNTER, IPREASMREQDS, RONLY,	MIB, 4, 14, 0),@ $MIBent( var_ip,  9, COUNTER, IPREASMOKS, RONLY,	MIB, 4, 15, 0),B $MIBent( var_ip,  9, COUNTER, IPREASMFAILS, RONLY,	MIB, 4, 16, 0),@ $MIBent( var_ip,  9, COUNTER, IPFRAGOKS, RONLY,		MIB, 4, 17, 0),A $MIBent( var_ip,  9, COUNTER, IPFRAGFAILS, RONLY,	MIB, 4, 18, 0),EC $MIBent( var_ip,  9, COUNTER, IPFRAGCREATES, RONLY,	MIB, 4, 19, 0),*   ! IP Address Table9 $MIBent( var_ipAddrEntry, 14, IPADDRESS, IPADADDR, RONLY,E5 			MIB, 4, 20, 1, 1, %x'FF', %x'FF', %x'FF', %x'FF'),A: $MIBent( var_ipAddrEntry, 14, INTEGER,	IPADIFINDEX, RONLY,5 			MIB, 4, 20, 1, 2, %x'FF', %x'FF', %x'FF', %x'FF'),A< $MIBent( var_ipAddrEntry, 14, IPADDRESS, IPADNETMASK, RONLY,5 			MIB, 4, 20, 1, 3, %x'FF', %x'FF', %x'FF', %x'FF'),'< $MIBent( var_ipAddrEntry, 14, INTEGER,	IPADBCASTADDR, RONLY,5 			MIB, 4, 20, 1, 4, %x'FF', %x'FF', %x'FF', %x'FF'),t   ! ICMP groupB $MIBent( var_icmp, 9, COUNTER, ICMPINMSGS, RONLY, 		MIB, 5, 1, 0),D $MIBent( var_icmp, 9, COUNTER, ICMPINERRORS, RONLY, 		MIB, 5, 2, 0),H $MIBent( var_icmp, 9, COUNTER, ICMPINDESTUNREACHS, RONLY,	MIB, 5, 3, 0),G $MIBent( var_icmp, 9, COUNTER, ICMPINTIMEEXCDS, RONLY, 		MIB, 5, 4, 0),TG $MIBent( var_icmp, 9, COUNTER, ICMPINPARMPROBS, RONLY, 		MIB, 5, 5, 0),IG $MIBent( var_icmp, 9, COUNTER, ICMPINSRCQUENCHS, RONLY, 	MIB, 5, 6, 0),PG $MIBent( var_icmp, 9, COUNTER, ICMPINREDIRECTS, RONLY, 		MIB, 5, 7, 0), C $MIBent( var_icmp, 9, COUNTER, ICMPINECHOS, RONLY, 		MIB, 5, 8, 0),,F $MIBent( var_icmp, 9, COUNTER, ICMPINECHOREPS, RONLY, 		MIB, 5, 9, 0),H $MIBent( var_icmp, 9, COUNTER, ICMPINTIMESTAMPS, RONLY, 	MIB, 5, 10, 0),K $MIBent( var_icmp, 9, COUNTER, ICMPINTIMESTAMPREPS, RONLY, 	MIB, 5, 11, 0),.H $MIBent( var_icmp, 9, COUNTER, ICMPINADDRMASKS, RONLY, 		MIB, 5, 12, 0),J $MIBent( var_icmp, 9, COUNTER, ICMPINADDRMASKREPS, RONLY, 	MIB, 5, 13, 0),D $MIBent( var_icmp, 9, COUNTER, ICMPOUTMSGS, RONLY, 		MIB, 5, 14, 0),E $MIBent( var_icmp, 9, COUNTER, ICMPOUTERRORS, RONLY,		MIB, 5, 15, 0),nJ $MIBent( var_icmp, 9, COUNTER, ICMPOUTDESTUNREACHS, RONLY,	MIB, 5, 16, 0),H $MIBent( var_icmp, 9, COUNTER, ICMPOUTTIMEEXCDS, RONLY, 	MIB, 5, 17, 0),H $MIBent( var_icmp, 9, COUNTER, ICMPOUTPARMPROBS, RONLY, 	MIB, 5, 18, 0),I $MIBent( var_icmp, 9, COUNTER, ICMPOUTSRCQUENCHS, RONLY, 	MIB, 5, 19, 0),*H $MIBent( var_icmp, 9, COUNTER, ICMPOUTREDIRECTS, RONLY, 	MIB, 5, 20, 0),E $MIBent( var_icmp, 9, COUNTER, ICMPOUTECHOS, RONLY, 		MIB, 5, 21, 0),tH $MIBent( var_icmp, 9, COUNTER, ICMPOUTECHOREPS, RONLY, 		MIB, 5, 22, 0),I $MIBent( var_icmp, 9, COUNTER, ICMPOUTTIMESTAMPS, RONLY, 	MIB, 5, 23, 0),tL $MIBent( var_icmp, 9, COUNTER, ICMPOUTTIMESTAMPREPS, RONLY, 	MIB, 5, 24, 0),H $MIBent( var_icmp, 9, COUNTER, ICMPOUTADDRMASKS, RONLY, 	MIB, 5, 25, 0),K $MIBent( var_icmp, 9, COUNTER, ICMPOUTADDRMASKREPS, RONLY, 	MIB, 5, 26, 0),    ! TCP group D $MIBent( var_tcp, 9, INTEGER, TCPRTOALGORITHM, RONLY,	MIB, 6, 1, 0),? $MIBent( var_tcp, 9, INTEGER, TCPRTOMIN, RONLY,		MIB, 6, 2, 0),i? $MIBent( var_tcp, 9, INTEGER, TCPRTOMAX, RONLY, 	MIB, 6, 3, 0),*@ $MIBent( var_tcp, 9, INTEGER, TCPMAXCONN, RONLY, 	MIB, 6, 4, 0),D $MIBent( var_tcp, 9, COUNTER, TCPACTIVEOPENS, RONLY, 	MIB, 6, 5, 0),E $MIBent( var_tcp, 9, COUNTER, TCPPASSIVEOPENS, RONLY, 	MIB, 6, 6, 0),eE $MIB             ent( var_tcp, 9, COUNTER, TCPATTEMPTFAILS, RONLY, 	MIB, 6, 7, 0),lD $MIBent( var_tcp, 9, COUNTER, TCPESTABRESETS, RONLY, 	MIB, 6, 8, 0),@ $MIBent( var_tcp, 9, GAUGE,	TCPCURRESTAB, RONLY, 	MIB, 6, 9, 0),? $MIBent( var_tcp, 9, COUNTER, TCPINSEGS, RONLY, 	MIB, 6,10, 0),(@ $MIBent( var_tcp, 9, COUNTER, TCPOUTSEGS, RONLY, 	MIB, 6,11, 0),D $MIBent( var_tcp, 9, COUNTER, TCPRETRANSSEGS, RONLY, 	MIB, 6,12, 0),   ! TCP connection table7 $MIBent( var_tcpConn, 20, INTEGER, TCPCONNSTATE, RONLY,  	 MIB, 6, 13, 1, 1,1) 	 %x'FF', %x'FF', %x'FF', %x'FF', %x'FF',.* 	 %x'FF', %x'FF', %x'FF', %x'FF', %x'FF'),@ $MIBent( var_tcpConn, 20, IPADDRESS, TCPCONNLOCALADDRESS, RONLY, 	 MIB, 6, 13, 1, 2,L) 	 %x'FF', %x'FF', %x'FF', %x'FF'                                                                                                                                                                                                                                                   7                           
}                                                                                                                                                                                                                       s 
             /nV!HSZ.Xm CX#(f%ZLFbG\>ARAD[A2OfwP3BAG17!A^\UQf:@D:'9ozo5oh*o88p@urLvmLl?CJ
,A{WLEg>JHoH\h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d `!LCG7|aH2{`[^0i-
+$$#rfB8e-4Uo!y-pCA<,`P&92J7VOPV&FBD0#AmT)'Cs}T+0	A!jtuhA.ls\+;kR(qD/Q:N_FLrd!!h4$B&<7tJ$n[&|AseMQf\	6sO0td8)A[rKw/yno:#dqP.yqQgR<KB.T	VWWk=Gv{~njk;)ekkT~\<98Wv%	SRwUTu3/By>gf^gx0dlz9vI=p+J*=`}5`%s#p<f$rVpHnB[b>O^
X\k/pCtH^%ut'x}g%0*kaci^qs  i|tz~#zx\m/,W68Q\<W^nG]Nv]LiP\rc{f_n0Gm?[q|PEKIbB>;ysm] wH5 ]E-|E#n|$H[mQK+E5O=o~ 3<J%LxHN{A6'o,d2[BZ$;jM20r+fCT8j}W2yM$fmxyu})(zy(H,X  tp_]}@/NHS6'ePD09!9;4znrAp
]Lr? 0sxe+pR}RF+ul2KLsnKI.kLNRWAQyb43d}Zb.,k0.&4v?^Gmv-ViAC,I$h|`OPS64|sFkIxa|6+f5I(P/`s3>.>y^1'3pn9>O`362M?gui _-3m$nlDFUydKNy3 <4{c<5_gT#G$8^.B
co"\)Tq;OY^K[ess],	! Pointer                                                                                                                                                                                                   8                                
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                                    , %x'FF',;* 	 %x'FF', %x'FF', %x'FF', %x'FF', %x'FF'),; $MIBent( var_tcpConn, 20, INTEGER, TCPCONNLOCALPORT, RONLY,T 	 MIB, 6, 13, 1, 3,[) 	 %x'FF', %x'FF', %x'FF', %x'FF', %x'FF', * 	 %x'FF', %x'FF', %x'FF', %x'FF', %x'FF'),> $MIBent( var_tcpConn, 20, IPADDRESS, TCPCONNREMADDRESS, RONLY, 	 MIB, 6, 13, 1, 4,t) 	 %x'FF', %x'FF', %x'FF', %x'FF', %x'FF',a* 	 %x'FF', %x'FF', %x'FF', %x'FF', %x'FF'),9 $MIBent( var_tcpConn, 20, INTEGER, TCPCONNREMPORT, RONLY,a 	 MIB, 6, 13, 1, 5,i) 	 %x'FF', %x'FF', %x'FF', %x'FF', %x'FF', * 	 %x'FF', %x'FF', %x'FF', %x'FF', %x'FF'),     ! UDP groupeC $MIBent( var_udp, 9, COUNTER, UDPINDATAGRAMS, RONLY,	MIB, 7, 1, 0),_A $MIBent( var_udp, 9, COUNTER, UDPINNOPORTS, RONLY,	MIB, 7, 2, 0), @ $MIBent( var_udp, 9, COUNTER, UDPINERRORS, RONLY,	MIB, 7, 3, 0),C $MIBent( var_udp, 9, COUNTER, UDPOUTDATAGRAMS, RONLY,	MIB, 7, 4, 0)L     $MIBend;   LITERALC     MIBsize = $MIBcnt+1;   !GLOBALI" !    return_buf : VECTOR[64,BYTE];   FORWARD ROUTINEe     compare;  K GLOBAL ROUTINE getStatPtr (name,namelen,type,len,acl,exact,access_method) =y !mF ! getStatPtr - return a pointer to the named variable, as well as it's( ! type, length, and access control list. !DJ ! If an exact match for the variable name exists, it is returned.  If not,C ! and exact is false, the next variable lexicographi                                                                                                                                                                                                                   0                        /N        	IPACP.SRC                        ;  [IPACP]SNMP_HOOK.BLI;1                                                                                                         y     N                         E              cally after theM ! requested one is returned. !C< ! If no appropriate variable can be found, NULL is returned. ! + ! The C language interface looks like this:F? !    oid		*name;	    /* IN - name of var, OUT - name matched */IY !    int		*namelen;   /* IN -number of sub-ids in name, OUT - subid-is in matched name */ ; !    u_char	*type;	    /* OUT - type of matched variable */ : !    int		*len;	    /* OUT - length of matched variable */6 !    u_short	*acl;	    /* OUT - access control list */: !    int		exact;	    /* IN - TRUE if exact match wanted */@ !    int		*access_method; /* OUT - 1 if function, 0 if char * */ !  BEGIN,     MAPT$ 	name : REF VECTOR[,SNMP$K_OIDsize];	     LOCAL  	found : INITIAL(0), 	access, 	result, 	vp : REF variable_struct;       INCR x FROM 0 TO MIBsize DOi 	BEGIN" 	! Point to Xth entry in MIB table 	vp = variables[.x,0,0,0,0];  % 	! compare should be expanded inline.ID 	result = compare(.name, ..namelen, vp[var$name], .vp[var$namelen]);: 	IF ((.result LSS 0) OR (.exact AND (.result EQL 0))) THEN
 	    BEGIN6 	    access = (.vp[var$findVar])(.vp, .name, .namelen,# 					.exact, .len, .access_method);, 	    IF (.access NEQ 0) THEN 		EXITLOOP found = 1 	    END 	END;,       ! did we find one?      IF NOT .found THEN RETURN 0;  /     ! vp now points to the approprate struct */,     .type = .vp[var$type];     .acl = .vp[var$acl];     return .access;2     END;    , ROUTINE compare (name1, len1, name2, len2) =	     BEGINO     MAP	 	NAME1 : REF VECTOR [],' 	NAME2 : REF VECTOR []; 	     LOCAL, 	len;C  $     ! len = minimum of len1 and len2)     IF (.len1 LSS .len2) THEN len = .len1E     ELSE len = .len2;L  $     ! find first non-matching OID */     INCR i FROM 0 to .len-1 DO 	BEGIN/ 	IF (.name1[.i] LSS .name2[.i]) THEN return -1; . 	IF (.name2[.i] LSS .name1[.i]) THEN return 1; 	END;   /     ! OIDs match up to length of shorter stringtJ     IF (.len1 LSS .len2) THEN RETURN -1;  ! name1 shorter, so it is "less"'     IF (.len2 LSS .len1) THEN RETURN 1;L  %     RETURN 0	! both strings are equalI     END;   ROUTINE cmp_ipaddr (ip1,ip2) =- ! Lexicographically compare two ip addresses.O	     BEGIN,     MAP  	ip1 : VECTOR [4,BYTE],T 	ip2 : VECTOR [4,BYTE];	  %     ! find first non-matching BYTE */T     INCR i FROM 0 to 3 DOM 	BEGIN+ 	IF (.ip1[.i] LSS .ip2[.i]) THEN return -1;A* 	IF (.ip2[.i] LSS .ip1[.i]) THEN return 1; 	END;,  *     RETURN 0	! both IP addresses are equal     END;   ROUTINE cmp_TCB (TCB1,TCB2) =C- ! Lexicographically compare two ip addresses. 	     BEGIN      MAPE 	TCB1 : REF TCB_structure, 	TCB2 : REF TCB_structure;	     LOCALE 	result;  *     ! Everything is less than the NULL TCB#     IF .TCB2 EQLA 0 THEN RETURN -1;        ! compare local addressT>     result = cmp_ipaddr(.TCB1[local_host], .TCB2[local_host]);)     IF .result NEQ 0 THEN RETURN .result;,       ! compare local portsU?     IF .TCB1[local_port] LSSU .TCB2[local_port] THEN RETURN -1;C>     IF .TCB2[local_port] LSSU .TCB1[local_port] THEN RETURN 1;       ! compare remote addressB     result = cmp_ipaddr(.TCB1[foreign_host], .TCB2[foreign_host]);)     IF .result NEQ 0 THEN RETURN .result;        ! compare remote portsC     IF .TCB1[foreign_port] LSSU .TCB2[foreign_port] THEN RETURN -1;9B     IF .TCB2[foreign_port] LSSU .TCB1[foreign_port] THEN RETURN 1;       RETURN 0     END;     %(< 	The remainder of this module is filled with variable access8 	routines which take parameters in the following format.  9     /* IN - pointer to variable entry that points here */y!     register struct variable *vp;,  :     /* IN/OUT - input name requested, output name found */     register oid 	*name;  3     /* IN/OUT - length of input and output oid's */'     register int	*length;)  4     /* IN - TRUE if an exact match was requested. */     int			exact;  =     /* OUT - length of variable or 0 if function returned. */      int			*var_len;B  1     /* OUT - 1 if function, 0 if char pointer. */	     int			*access_method;r   )%   O   !, ! System Variables:L !	   BINDG     version_description = %ASCID'CMU-OpenVMS/IP 6.6-5' : BLOCK[8,BYTE],,A     version_ident = UPLIT(1, 3, 6, 1, 4, 1, 3, 1, 6) : VECTOR[9];M   LITERAL)     version_ident_size = 9;N   OWNM     sys_nnets,     sys_uptime;     F ROUTINE var_system (vp, name, length, exact, var_len, access_method) =	     BEGINr)     ! Declare system variables from IPACP	     EXTERNAL 	Dev_Count;r     EXTERNAL ROUTINE 	CALCULATE_UPTIME;     MAP, 	vp : REF variable_struct,+         name : REF VECTOR[,SNMP$K_OIDsize];,  Q     IF (.exact AND (compare(.name,..length,vp[var$name],.vp[var$namelen]) NEQ 0)), 	THEN RETURN 0;mE     ch$move(.vp[var$namelen] * SNMP$K_OIDsize, vp[var$name], .name );r       .length = .vp[var$namelen];L     .access_method = 0;B-     .var_len = 4;	! default length == 4 bytes,  !     SELECTONE (.vp[var$magic]) OF, 	SET 	[VERSION_DESCR]:N
 	    BEGIN3 	    .var_len = .version_description[DSC$W_LENGTH];M0 	    RETURN .version_description[DSC$A_POINTER];	 	    END;  	[VERSION_ID]:
 	    BEGIN2 	    .var_len = version_ident_size*SNMP$K_OIDsize; 	    RETURN version_ident;	 	    END;9 	[CFG_NNETS]:(
 	    BEGIN 	    sys_nnets = .Dev_Count; 	    RETURN sys_nnets;	 	    END;r
 	[UPTIME]:
 	    BEGIN% 	    sys_uptime = CALCULATE_UPTIME();B 	    RETURN sys_uptime;,	 	    END;O 	[OTHERWISE]:M3 !!!HACK!!! Put some sort of erro logging in here...T 	    0;S 	TES;,       0      END;    G ROUTINE var_ifEntry (vp, name, length, exact, var_len, access_method) = 	     BEGINr)     ! Declare system variables from IPACP      EXTERNAL ,- 	DEV_CONFIG_TAB : Device_Configuration_Table,K 	Dev_Count;	     MAP6 	vp : REF variable_struct,+         name : REF VECTOR[,SNMP$K_OIDsize];N	     LOCAL / 	newname : VECTOR[MAX_NAME_LEN,SNMP$K_OIDsize],R 	interface,	! interface numb                                                                                                                                                                                                                                                   9                                
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        ?            er 	result,- 	dev_config : REF Device_Configuration_Entry;   G     ch$move(.vp[var$namelen] * SNMP$K_OIDsize, vp[var$name], newname );v       ! find "next" interfaceE     interface = 0;"     INCR i FROM 1 TO .Dev_Count DO 	BEGIN 	newname[10] = .i;> 	result = compare(.name, ..length, newname, .vp[var$namelen]);F 	IF ((.exact AND (.result EQL 0)) OR (NOT .exact AND (.result LSS 0)))! 	    THEN EXITLOOP interface = .it 	END;G  (     IF (.interface EQL 0) THEN RETURN 0;  M     interface = .interface - 1; ! translate into internal index of interfacesp?     ch$move(.vp[var$namelen] * SNMP$K_OIDsize, newname, .name);p       .length = .vp[var$namelen];,     .access_method = 0; -     .var_len = 4;	! default length == 4 bytesE  5     dev_config = dev_config_tab[.interface,dc_begin];'!     SELECTONE (.vp[var$magic]) OF  	SET 	[IFINDEX]:x& 	    RETURN dev_config[dcmib_IFINDEX]; 	[IFDESCR]:D
 	    BEGIN- 	    .var_len = .(dev_config[dcmib_ifDescr]); * 	    RETURN .(dev_config[dcmib_ifDescr]+4)	 	    END;F
 	[IFTYPE]:% 	    RETURN dev_config[dcmib_IFTYPE]; 	 	[IFMTU]:,$ 	    RETURN dev_config[dcmib_IFMTU]; 	[IFSPEED]: & 	    RETURN dev_config[dcmib_IFSPEED]; 	[IFPHYSADDRESS]: 
 	    BEGIN, 	    .var_len = .dev_config[dcmib_ifPAsize];, 	    RETURN .dev_config[dcmib_IFPHYSADDRESS]	 	    END;x 	[IFADMINSTATUS]:', 	    RETURN dev_config[dcmib_IFADMINSTATUS]; 	[IFOPERSTATUS]:+ 	    RETURN dev_config[dcmib_IFOPERSTATUS];P 	[IFLASTSTATE]:I* 	    RETURN dev_config[dcmib_IFLASTSTATE]; 	[IFINOCTETS]:) 	    RETURN dev_config[dcmib_IFINOCTETS];, 	[IFINUCASTPKTS]: , 	    RETURN dev_config[dcmib_IFINUCASTPKTS]; 	[IFINNUCASTPKTS]:- 	    RETURN dev_config[dcmib_IFINNUCASTPKTS];  	[IFINDISCARDS]:+ 	    RETURN dev_config[dcmib_IFINDISCARDS];R 	[IFINERRORS]:) 	    RETURN dev_config[dcmib_I                                                                                                                                                                                                                                                   1                        4        	IPACP.SRC                        ;  [IPACP]SNMP_HOOK.BLI;1                                                                                                         y     N                         6      /       FINERRORS];O 	[IFINUNKNOWNPROTOS]:,0 	    RETURN dev_config[dcmib_IFINUNKNOWNPROTOS]; 	[IFOUTOCTETS]:G* 	    RETURN dev_config[dcmib_IFOUTOCTETS]; 	[IFOUTUCASTPKTS]:- 	    RETURN dev_config[dcmib_IFOUTUCASTPKTS];, 	[IFOUTNUCASTPKTS]:e. 	    RETURN dev_config[dcmib_IFOUTNUCASTPKTS]; 	[IFOUTDISCARDS]:n, 	    RETURN dev_config[dcmib_IFOUTDISCARDS]; 	[IFOUTERRORS]:r* 	    RETURN dev_config[dcmib_IFOUTERRORS]; 	[IFOUTQLEN]:s( 	    RETURN dev_config[dcmib_IFOUTQLEN]; 	[OTHERWISE]:e3 !!!HACK!!! Put some sort of erro logging in here...  	    0;t 	TES;      0f     END;       %(   /* n  * from arp.c:5  * There is no arp.h, so this must be recreated here.   */F6 #define	ARPHLNMAX	6	/* largest arp_hln value needed */7 #define	ARPPLN		4	/* length of protocol address (IP) */s struct	arptab {u* 	iaddr_t at_iaddr;		/* internet address */3 	u_char	at_haddr[ARPHLNMAX];	/* hardware address */t5 	u_char	at_timer;		/* minutes since last reference */  	u_char	at_flags;		/* flags */@ 	struct	pbuf *at_hold;		/* last packet until resolved/timeout */ }; /* at_flags field values */e' #define	ATF_INUSE	1		/* entry in use */ 7 #define ATF_COM		2		/* completed entry (haddr valid) */i  ( #define	ARPTAB_BSIZ	5		/* bucket size */- #define	ARPTAB_NB	11		/* number of buckets */ - #define	ARPTAB_SIZE	(ARPTAB_BSIZ * ARPTAB_NB)t     u_char *< var_atEntry(vp, name, length, exact, var_len, access_method)W     register struct variable *vp;	/* IN - pointer to variable entry that points here */]R     register oid	    *name;	/* IN/OUT - input name requested, output name found */M     register int	    *length;	/* IN/OUT - length of input and output oid's */oE     int			    exact;	/* IN - TRUE if an exact match was requested. */DQ     int			    *var_len;	/* OUT - length of variable or 0 if function returned. */tK     int			    *access_method; /* OUT - 1 if function, 0 if char pointer. */r {l     /*$      * object identifier is of form:M      * 1.3.6.1.2.1.3.1.1.1.interface.1.A.B.C.D,  where A.B.C.D is IP address.O!      * Interface is at offset 10, "      * IPADDR starts at offset 12.      */n     oid			    lowest[16];S     oid			    current[16];!     register struct arptab  *arp;d"     struct arptab	    *lowarp = 0;%     extern struct arptab    arptab[];a"     register struct ipdad   *ipdp;"     struct ipdad	    *lowipdp = 0;$     extern struct ipdad	    ipdad[];     long		    ipaddr;s     int			    addrlen;      extern struct conf	    conf;     register u_char	    *cp;     register oid	    *op;)     register int	    count;N  M     /* fill in object part of name for current (less sizeof instance part) */oS     bcopy((char *)vp->name, (char *)current, (int)(vp->namelen - 6) * sizeof(oid));T9     for(arp = arptab; arp < arptab + ARPTAB_SIZE; arp++){ @ 	if (!(arp->at_flags & ATF_COM))	/* if this entry isn't valid */ 	    continue; 	/* create new object id */i/ 	current[10] = 1;	/* ifIndex == 1 (ethernet) */b 	current[11] = 1;e! 	cp = (u_char *)&(arp->at_iaddr);  	op = current + 12;i# 	for(count = 4; count > 0; count--)s 	    *op++ = *cp++;A 	if (exact){3 	    if (compare(current, 16, name, *length) == 0){A; 		bcopy((char *)current, (char *)lowest, 16 * sizeof(oid));  		lowarp = arp; ( 		break;	/* no need to search further */ 	    }	 	} else {=k 	    if ((compare(current, 16, name, *length) > 0) && (!lowarp || (compare(current, 16, lowest, 16) < 0))){r 		/*> 		 * if new one is greater than input and closer to input than6 		 * previous lowest, save this one as the "next" one. 		 */N; 		bcopy((char *)current, (char *)lowest, 16 * sizeof(oid));i 		lowarp = arp;g 	    } 	}     }i-     ipaddr = conf.ipaddr + conf.ipstatic + 1;e?     for(ipdp = ipdad; ipdp < ipdad + NIPDAD; ipdp++, ipaddr++){L> 	if (ipdp->timer == 0)	/* if this entry is unused, continue */ 	    continue; 	/* create new object id */ 0 	current[10] = 2;	/* ifIndex == 2 (appletalk) */ 	current[11] = 1;f 	cp = (u_char *)&ipaddr; 	op = current + 12;e# 	for(count = 4; count > 0; count--)  	    *op++ = *cp++;  	if (exact){3 	    if (compare(current, 16, name, *length) == 0){e; 		bcopy((char *)current, (char *)lowest, 16 * sizeof(oid));o 		lowipdp = ipdp;r 		lowarp = 0; ( 		break;	/* no need to search further */ 	    }	 	} else {iy 	    if ((compare(current, 16, name, *length) > 0) && ((!lowarp && !lowipdp) || (compare(current, 16, lowest, 16) < 0))){a 		/*> 		 * if new one is greater than input and closer to input than6 		 * previous lowest, save this one as the "next" one. 		 */h; 		bcopy((char *)current, (char *)lowest, 16 * sizeof(oid));  		lowipdp = ipdp; 5 		/* ipdad entry is lower, so invalidate arp entry */e 		lowarp = 0;P 	    } 	}     }10     if (lowarp != 0){	/* arp entry was lowest */ 	addrlen = 6;N8 	bcopy((char *)lowarp->at_haddr, (char *)return_buf, 6);     } else if (lowipdp != 0) { 	addrlen = 3;e 	/*tL 	 * As far as IP is concerned, the "physical" address includes the Appletalk+ 	 * network address as well as node number.E 	 */. 	return_buf[0] = ((u_char *)&lowipdp->net)[0];. 	return_buf[1] = ((u_char *)&lowipdp->net)[1]; 	return_buf[2] = lowipdp->node;g
     } else 	return NULL;	/* no match */:     bcopy((char *)lowest, (char *)name, 16 * sizeof(oid));     *length = 16;,     *access_method = 0;      switch(vp->magic){ 	[ATIFINDEX]:d# 	    *var_len = sizeof long_retu                                                                                                                                                                                                                                                   :                        y䪅        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                                    rn;e 	    long_return = lowest[10];# 	    return (u_char *)&long_return;O 	[ATPHYSADDRESS]:G 	    *var_len = addrlen;! 	    return (u_char *)return_buf;  	[ATNETADDRESS]:# 	    *var_len = sizeof long_return; ! 	    cp = (u_char *)&long_return;. 	    op = lowest + 12;' 	    for(count = 4; count > 0; count--)_ 		*cp++ = *op++;# 	    return (u_char *)&long_return;s	 	default:e 	    ERROR("");T    }    return NULL;D }  )%  B ROUTINE var_IP (vp, name, length, exact, var_len, access_method) =	     BEGINe     EXTERNAL 	IP_group_MIB;     MAP! 	vp : REF variable_struct,+         name : REF VECTOR[,SNMP$K_OIDsize];   Q     IF (.exact AND (compare(.name,..length,vp[var$name],.vp[var$namelen]) NEQ 0))  	THEN RETURN 0; E     ch$move(.vp[var$namelen] * SNMP$K_OIDsize, vp[var$name], .name );        .length = .vp[var$namelen];v     .access_method = 0; -     .var_len = 4;	! default length == 4 bytes[  .     RETURN IP_group_MIB + (.vp[var$magic]-1)*4     END;   %(   u_char *A var_ipRouteEntry(vp, name, length, exact, var_len, access_method)iY     register struct variable *vp;   /* IN - pointer to variable entry that points here */wV     register oid    	*name;	    /* IN/OUT - input name requested, output name found */N     register int	*length;    /* IN/OUT - length of input and output strings */E     int			exact;	    /* IN - TRUE if an exact match was requested. */AO     int			*var_len;   /* OUT - length of variable or 0 if function returned. */rG     int			*access_method; /* OUT - 1 if function, 0 if char pointer. */  {o$     oid			    newname[MAX_NAME_LEN];     register int	    entry;$-     register struct mib_ipRouteEntry	*routep;v     int			    result;a     register int	    count;l     register u_char	    *cp;     register oid	    *op;d      extern struct conf	         =        conf;  P     /* set up a routing table to search. All other values are set at startup. */     routep = mib_ipRouteEntry;*     routep[ROUTE_DEFAULT].ipRouteDest = 0;;     routep[ROUTE_DEFAULT].ipRouteNextHop = conf.iproutedef; =     routep[ROUTE_LOCAL].ipRouteDest = ipnetpart(conf.ipaddr);F5     routep[ROUTE_LOCAL].ipRouteNextHop = conf.ipaddr;]  M     bcopy((char *)vp->name, (char *)newname, (int)vp->namelen * sizeof(oid));.     /* find "next" route */f3     for(entry = 0; entry < ROUTE_ENTRIES; entry++)                                                                                                                                                                                                                                   2                        Q[        	IPACP.SRC                        ;  [IPACP]SNMP_HOOK.BLI;1                                                                                                         y     N                         |      >       {]% 	cp = (u_char *)&routep->ipRouteDest;R 	op = newname + 10;b# 	for(count = 4; count > 0; count--)  	    *op++ = *cp++;d< 	result = compare(name, *length, newname, (int)vp->namelen);: 	if ((exact && (result == 0)) || (!exact && (result < 0))) 	    break;T
 	routep++;     }P     if (entry >= ROUTE_ENTRIES)m 	return NULL;SI     bcopy((char *)newname, (char *)name, (int)vp->namelen * sizeof(oid));F     *length = vp->namelen;     *access_method = 0;D     *var_len = sizeof(long);  &     routep = &mib_ipRouteEntry[entry];     switch (vp->magic){T 	[IPROUTENEXTHOP]:  	    if (entry == ROUTE_DEFAULT)$ 		return (u_char *)&conf.iproutedef;	 	    else   		return (u_char *)&conf.ipaddr;	 	default:m7 	    return (u_char *)(((u_char *)routep) + vp->magic);e     }g }m   )%  K ROUTINE var_ipAddrEntry (vp, name, length, exact, var_len, access_method) =;	     BEGINR     EXTERNAL T- 	DEV_CONFIG_TAB : Device_Configuration_Table,] 	Dev_Count;R     MAPf 	vp : REF variable_struct,+         name : REF VECTOR[,SNMP$K_OIDsize];g	     LOCALe/ 	newname : VECTOR[MAX_NAME_LEN,SNMP$K_OIDsize],( 	result, 	interface,: 	IPaddr : UNSIGNED LONG,, 	best : UNSIGNED LONG INITIAL(%x'FFFFFFFF');  G     ch$move(.vp[var$namelen] * SNMP$K_OIDsize, vp[var$name], newname );        !  Now find "next" ipaddr.  F     !  Foreach ipaddress entry, cobble up newname with its IP address,:     !  by copying the ipaddress into the 10 - 13't subid'sJ     !  then compare with name.  If greater than name and less than lowest,     !  save as new lowest.       ! find "next" interface      interface = -1;u$     INCR i FROM 0 TO .Dev_Count-1 DO 	BEGIN   	! "Cobble" in the new namel, 	IPaddr = .DEV_CONFIG_TAB[.i,dc_ip_address];? 	newname[13] = .IPaddr<24,8,0>;  newname[12] = .IPaddr<16,8,0>;c= 	newname[11] = .IPaddr<8,8,0>;  newname[10] = .IPaddr<0,8,0>;_  > 	result = compare(.name, ..length, newname, .vp[var$namelen]);) 	IF (NOT .exact AND (.result LSS 0)) THEN , 	    IF cmp_ipaddr(.IPaddr,.best) LSS 0 THEN 		BEGINe 		best = .IPaddr;e 		interface = .i 		END;  	IF (.exact AND (.result EQL 0))" 	    THEN EXITLOOP interface = .i; 	END;g  (     IF (.interface LSS 0) THEN RETURN 0;       ! "Cobble" in the new name7     IPaddr = .DEV_CONFIG_TAB[.interface,dc_ip_address];TB     newname[13] = .IPaddr<24,8,0>;  newname[12] = .IPaddr<16,8,0>;@     newname[11] = .IPaddr<8,8,0>;  newname[10] = .IPaddr<0,8,0>;  @     ch$move(.vp[var$namelen] * SNMP$K_OIDsize, newname, .name );       .length = .vp[var$namelen];A     .access_method = 0; -     .var_len = 4;	! default length == 4 bytes   !     SELECTONE (.vp[var$magic]) OFi 	SET     	[IPADADDR]:5 	    RETURN dev_config_tab[.interface,dc_ip_address];a         [IPADIFINDEX]:5 	    RETURN dev_config_tab[.interface,dcmib_IFINDEX];a 	[IPADNETMASK]:r5 	    RETURN dev_config_tab[.interface,dc_ip_netmask];  	[IPADBCASTADDR]:p 	    RETURN 0; 	TES;o       RETURN 0     END;      D ROUTINE var_ICMP (vp, name, length, exact, var_len, access_method) =	     BEGINt     EXTERNAL
 	ICMP_MIB;     MAP  	vp : REF variable_struct,+         name : REF VECTOR[,SNMP$K_OIDsize];   Q     IF (.exact AND (compare(.name,..length,vp[var$name],.vp[var$namelen]) NEQ 0))6 	THEN RETURN 0;TE     ch$move(.vp[var$namelen] * SNMP$K_OIDsize, vp[var$name], .name );p       .length = .vp[var$namelen];n     .access_method = 0;c-     .var_len = 4;	! default length == 4 bytest  *     RETURN ICMP_MIB + (.vp[var$magic]-1)*4     END;      C ROUTINE var_UDP (vp, name, length, exact, var_len, access_method) =4	     BEGIN;     EXTERNAL	 	UDP_MIB;*     MAPi 	vp : REF variable_struct,+         name : REF VECTOR[,SNMP$K_OIDsize];(  Q     IF (.exact AND (compare(.name,..length,vp[var$name],.vp[var$namelen]) NEQ 0))o 	THEN RETURN 0;uE     ch$move(.vp[var$namelen] * SNMP$K_OIDsize, vp[var$name], .name );g       .length = .vp[var$namelen];r     .access_method = 0;)-     .var_len = 4;	! default length == 4 bytesu  )     RETURN UDP_MIB + (.vp[var$magic]-1)*4e     END;   n  C ROUTINE var_TCP (vp, name, length, exact, var_len, access_method) =1	     BEGINo     EXTERNAL	 	TCP_MIB;      MAP} 	vp : REF variable_struct,+         name : REF VECTOR[,SNMP$K_OIDsize];i  Q     IF (.exact AND (compare(.name,..length,vp[var$name],.vp[var$namelen]) NEQ 0))n 	THEN RETURN 0;nE     ch$move(.vp[var$namelen] * SNMP$K_OIDsize, vp[var$name], .name );2       .length = .vp[var$namelen];c     .access_method = 0;u-     .var_len = 4;	! default length == 4 bytesu  )     RETURN TCP_MIB + (.vp[var$magic]-1)*4p     END;   t  G ROUTINE var_tcpConn (vp, name, length, exact, var_len, access_method) =u	     BEGINr     EXTERNAL   	VTCB_PTR : REF VECTOR[0], 	VTCB_size,a 	TCB_Count;r     MAPo 	vp : REF variable_struct,+         name : REF VECTOR[,SNMP$K_OIDsize];,	     LOCAL* 	count, / 	newname : VECTO                                                                                                                                                                                                                                                   ;                        1NX        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        'L            R[MAX_NAME_LEN,SNMP$K_OIDsize],  	result,	 	TCPaddr,) 	TCB : REF TCB_structure,s 	bestTCB : REF TCB_structure;t  G     ch$move(.vp[var$namelen] * SNMP$K_OIDsize, vp[var$name], newname );h  &     !  Now find "next" TCP connection.     count = .TCB_count;o     bestTCB = 0;  "     INCR j FROM 1 TO .VTCB_Size DO% 	IF (TCB = .VTCB_ptr[.J]) NEQA 0 THEN 
 	    BEGIN 	    ! "Cobble" in the new namey. 	    TCPaddr = .TCB[Local_Host];		! Local HostC 	    newname[10] = .TCPaddr<0,8,0>;  newname[11] = .TCPaddr<8,8,0>;)D 	    newname[12] = .TCPaddr<16,8,0>; newname[13] = .TCPaddr<24,8,0>;1 	    newname[14] = .TCB[Local_Port];	! Local Ports  0 	    TCPaddr = .TCB[Foreign_Host];	! Remote HostC 	    newname[15] = .TCPaddr<0,8,0>;  newname[16] = .TCPaddr<8,8,0>;eD 	    newname[17] = .TCPaddr<16,8,0>; newname[18] = .TCPaddr<24,8,0>;2 	    newname[19] = .TCB[Local_Port];	! Remote Port  B 	    result = compare(.name, ..length, newname, .vp[var$namelen]);- 	    IF (NOT .exact AND (.result LSS 0)) THEN_ 		BEGINe* 	        result = cmp_TCB(.TCB, .bestTCB);& 		IF .result LSS 0 THEN bestTCB = .TCB 		END;B 	    IF (.exact AND (.result EQL 0)) THEN EXITLOOP bestTCB = .TCB;  A 	    IF (count = .count-1) LEQ 0 THEN !only process what we have.  		EXITLOOP; 	 	    END;u  '     IF (.bestTcb EQLA 0) THEN RETURN 0;t       ! "Cobble" in the new name1     TCPaddr = .bestTCB[Local_Host];		! Local HostdB     newname[10] = .TCPaddr<0,8,0>;  newname[11] = .TCPaddr<8,8,0>;C     newname[12] = .TCPaddr<16,8,0>; newname[13] = .TCPaddr<24,8,0>;I4     newname[14] = .bestTCB[Local_Port];	! Local Port  3     TCPaddr = .bestTCB[Foreign_Host];	! Remote HostsB     newname[15] = .TCPaddr<0,8,0>;  newname[16] = .TCPaddr<8,8,0>;C     newname[17] = .TCPaddr<16,8,0>; newname[18] = .TCPaddr<24,8,0>;e5     newname[19] = .bestTCB[Local_Port];	! Remote Portn  @     ch$move(.vp[var$namelen] * SNMP$K_OIDsize, newname, .name );       .length = .vp[var$namelen];      .access_method = 0;.-     .var_len = 4;	! default length == 4 bytes   !     SELECTONE (.vp[var$magic]) OFa 	SET     	[tcpConnState]:
 	    BEGIN% 	    long_return = .bestTCB[State]+1;e 	    RETURN long_return;	 	    END;*     	[tcpConnLocalAddress]:e  	    RETURN bestTCB[local_host];     	[tcpConnLocalPort]:
 	    BEGIN( 	    long_return = .bestTCB[local_port]; 	    RETURN long_return;	 	    END;	     	[tcpConnRemAddress]:a" 	    RETURN bestTCB[foreign_host];     	[tcpConnRemPort]:
 	    BEGIN* 	    long_return = .bestTCB[foreign_port]; 	    RETURN long_return;	 	    END;i 	TES;i       RETURN 0     END;   END  ELUDOM  newname[MAX_NAME_LEN];     register int	    entry;$-     register struct mib_ipRouteEntry	*routep;v     int			    result;a     register int	    count;l     register u_char	    *cp;     register oid	    *op;d      extern struct conf	                  * [IPACP]STAT.BLI;1 +  , k   . 6    /     4 O   6   6 |                    - ;    0   1    2   3      K  P   W   O 7    5   6 ๒W,  7 7r4-  8          9          G    H  J     3                        {        	IPACP.SRC                      k  ;  [IPACP]STAT.BLI;1BLI;1                                                                                                         O     6                                       %(A 	****************************************************************   0 		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.  A 	****************************************************************  )%> %TITLE 'MEMGR - Dynamic Memory allocaion / deallocation rtns.' %(   Module:    	MEMGR  	 Facility:   = 	Provide dynamic memory allocation & deallocation for various  	TCP/IP data structures.  	 Abstract:   E 	Many of the data structures used by TCP/IP are dynamically allocated ) 	& deallocated (TCB's,Queue block, etc.). G 	Some of the dynamically allocated data structures are preallocated and H 	placed on free-lists.  The globals "xxx_xxx_count_base" are initializedF 	during startup routine: "configure_acp" in module: config.bli.  TheseH 	byte-size integers represent the number of elements on their respective 	free list.    Author:    	Stan C. Smith	Fall 19814 	This version by Vince Fuller, CMU-CSD, Summer, 1986   Modification History:    *** Begin CMU change log ***  ( 2.7  18-Aug-89, Edit by BRM (CMU NetDev)D 	AddedMM$Get_Mem and MM$Free_Mem generic memory allocation routines.' 	Changed Conect reference to a pointer.   & 2.6-1 03-APR-1989, M. Madison, RPI/ECSO         Turn off AST's when doing interruptible REMQUE in routine MM$QBLK_FREE.    2.6  23-Jul-87, Edit by VAF 0 	Know to flush any TVT data when deleting TCB's.   2.5  20-Jul-87, Edit by VAF ' 	Minor cleanup of circular queue stuff.    2.4  23-Mar-87, Edit by VAF C 	Replace the three standard-sized packet buffers with two - minimum  	size and maximum sized.   2.3   5-Aug-86, Edit by VAF = 	Modify TCB$Create/TCB_Delete to also allocate/deallocate the . 	the send/receive circular queues for the TCB.   2.2  22-Jul-86, Edit by VAF A 	Add code to track allocation, deallocation and queue movement of 7 	QBlks. Queue movement is under the QDEBUG conditional.    2.1  11-Jul-86, Edit by VAF  	Make all counters global.   2.0  25-Jun-86, Edit by VAF - 	Make TCB$Create set VTCB_INDEX field in TCB. D 	TCB_DELETE doesn't search VALID_TCB anymore - just uses VTCB_INDEX.& 	Don't use index 0 of VALID_TCB table.   1.9  22-May-86, Edit by VAF 0 	In TCB$Delete - remove TCB from UCB hash queue.   1.8  20-May-86, Edit by VAF 9 	Use new AST locking scheme - respect previous AST state.    *** End CMU change log ***   1.1 [9-10-81]    	Original version.   1.2 [6-5-82]  @ 	Free-lists implemented for frequently accessed data structures.   1.3 [4-28-83]   I 	Number of elements on the free-lists is configurable from the config.txt ? 	file.  This file is processed during acp initialization phase.    1.4 [5-16-83] stan  E 	removed "max_seg" references (free_list, count, init) as they are no - 	longer different from max_network_size_mesg.    1.5 [5-23-83] stan  E 	replaced xport memory manager calls with direct calls to vms runtime ? 	library.  Xport routines eventually used the RTL calls anyway, A 	attempt was to increase memory mgmt speed.  Effect was dramatic.    1.6 [7-15-83] stan  G 	force byte-size for some external literals, explicit var's in register  	declarations.   1.7 [5-30-85] noelan olson@ 	Track current overflow and maximum size of preallocated queues.   )%  ( %SBTTL 'Module & Environment Definition'  + MODULE MEMGR(Ident='2.7',LANGUAGE(BLISS32), - 	     ADDRESSING_MODE(EXTERNAL=LONG_RELATIVE, # 			     NONEXTERNAL=LONG_RELATIVE), - 	     LIST(NOREQUIRE,ASSEMBLY,OBJECT,BINARY),  	     OPTIMIZE,OPTLEVEL=3,ZIP)=  BEGIN   @ LIBRARY 'SYS$LIBRARY:STARLET';	! Include VMS systems definitionsH LIBRARY 'CMUIP_SRC:[CENTRAL]NETXPORT';	! Include transportablity package6 LIBRARY 'CMUIP_SRC:[CENTRAL]NETVMS';			! VMS specifics$ LIBRARY 'TCPMACROS';		! Local Macros5 LIBRARY 'STRUCTURE';		! Struct                                                                                                                                                                                                                                                   <                        _R        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        @      *      ure & Field definitions   . %SBTTL 'External: Routines, Literals and data'   EXTERNAL ROUTINE*     LIB$GET_VM : ADDRESSING_MODE(GENERAL),+     LIB$FREE_VM : ADDRESSING_MODE(GENERAL), #     TCP$Find_Local_Port,	! USER.BLI ,     TELNET_CLOSE : NOVALUE,	! TCP_TELNET.BLI     MovByt;			! MACLIB.MAR    ! External Literals from tcp.bli EXTERNAL LITERAL     Window_Default,      Empty_Queue : UNSIGNED(8),"     Queue_Empty_Now : UNSIGNED(8),
     Error;   ! External Data Segements    EXTERNAL/     ConectPtr : REF Connection_Table_Structure, =     VTCB_ptr : REF VECTOR[0],	! Vector of Valid TCB pointers.      VTCB_Size,     Max_TCB,4     ast_in_progress,		! Flag if running at AST level'     INTDF,			! interrupt deferral count 2     TCB_Count,			! # of "valid_TCB" table entries.     MIN_PHYSICAL_BUFSIZE,      MAX_PHYSICAL_BUFSIZE;   ( %SBTTL 'Memory manager header structure'   $FIELD MEM$HDR_FIELDS =  SET .   MEM$QNEXT	= [$Address],	! Next item on queue2   MEM$QPREV	= [$Address],	! Previous item on queue %IF QDEBUG %THEN5   MEM$CURQUEUES	= [$Ulong],	! Queues this block is on ;   MEM$ALLQUEUES = [$Ulong],	! Queues this block has been on D   MEM$ALLOCRTN	= [$Address],	! Routine which allocated most recently?   MEM$FREERTN	= [$Address],	! Routine which freed most recently D   MEM$INSQUERTN	= [$Address],	! Routine which INSQUE'd most recentlyI   MEM$INSQUEHDR	= [$Address],	! Queue header where most recently INSQUE'd >   MEM$INSQUEVAL	= [$Address],	! Additional value when INSQUE'dD   MEM$REMQUERTN	= [$Address],	! Routine which REMQUE'd most recentlyI   MEM$REMQUEHDR	= [$Address],	! Queue header where most recently REMQUE'd >   MEM$REMQUEVAL	= [$Address],	! Additional value when REMQUE'd %FI =   MEM$FLAGS	= [$Ulong],	! Flags defining free, prealloc, etc.    $OVERLAY(MEM$FLAGS) /       MEM$ISFREE = [$BIT],	! This block is free B       MEM$ISPERM = [$BIT]	! This block is permanent (preallocated)   $CONTINUE  TES;   LITERAL #     MEM$HDR_SIZE = $FIELD_SET_SIZE;  MACRO A     MEM$HDR_STRUCT = BLOCK[MEM$HDR_SIZE] FIELD(MEM$HDR_FIELDS) %;   . %Sbttl 'Preallocated dynamic data structures.' %(  D Here we define memory management preallocated data structure queues.H Idea is to keep specified number of dynamic data structures around so weG don't have to dynamically allocate the structure each time we need one. / A little faster execution is what we are after.  )%  . ! Define and initialize free lists to "empty".   OWN <     FREE_Qblks : Queue_Header_Structure(Queue_Header_Fields)
 		 PRESET( 			[Qhead] = Free_Qblks, 			[Qtail]	= Free_Qblks  			), <     USED_Qblks : Queue_Header_Structure(Queue_Header_Fields)
 		 PRESET( 			[Qhead] = Used_Qblks, 			[Qtail] = Used_Qblks  		       ),   <     FREE_Uargs : Queue_Header_Structure(Queue_Header_Fields)
 		 PRESET( 			[Qhead]	= Free_Uargs, 			[Qtail]	= Free_Uargs  			),   C     Free_Minsize_Segs : Queue_Header_Structure(Queue_Header_Fields)  			PRESET (   				[Qhead]	= Free_Minsize_Segs, 				[Qtail]	= Free_Minsize_Segs  				),  C     Free_Maxsize_Segs : Queue_Header_Structure(Queue_Header_Fields)  			    PRESET (   				[Qhead] = Free_Maxsize_Segs, 				[Qtail] = Free_Maxsize_Segs  				);  J ! "count_base" items are initialized in conifg_acp routine during startup.7 ! they provide the base number of items on a free list.    GLOB                                                                                                                                                                                                                                                   4                        s]X        	IPACP.SRC                      k  ;  [IPACP]STAT.BLI;1;1                                                                                                            O     6                         9:             AL9 !!! HACK !!! I don't like the looks of this next comment. F     QBLK_Count_base : UNSIGNED BYTE INITIAL(0),	! #Qblks on free list.J     Uarg_Count_base : UNSIGNED BYTE INITIAL(0),	! #Uarg blks on free list.B     Min_Seg_Count_base: UNSIGNED BYTE INITIAL(0), ! #Min-size segsB     Max_Seg_Count_base: UNSIGNED BYTE INITIAL(0), ! #Max-size segs  7 ! Counters for the number of items on a specific queue.   @     QBLK_Count: UNSIGNED BYTE INITIAL(0),	! #Qblks on free list.D     Uarg_Count: UNSIGNED BYTE INITIAL(0),	! #Uarg blks on free list.=     Min_Seg_Count: UNSIGNED BYTE INITIAL(0),	! #Min-size segs2=     Max_Seg_Count: UNSIGNED BYTE INITIAL(0);	! #Max-size segsi   %(I Here we keep track of what kind of data structures are being dynamically tB allocated & which should have more reserved during initialization. )%   GLOBAL<     QB_gets : INITIAL(0),	! Queue Blks dynamically allocated*     UA_gets : INITIAL(0),	! User arg blks.1     MIN_gets : INITIAL(0),	! Minimum size buffersl1     MAX_gets : INITIAL(0),	! Maximum size buffersp3     QB_max : INITIAL(0),	! Queue Blk max queue sizea2     UA_max : INITIAL(0),	! User arg max queue size?     MIN_max : INITIAL(0),	! Minimum size buffers max queue size 6     MAX_max : INITIAL(0);	! Maximum seg max queue size *( %Sbttl 'Memory Management Fault Handler' %(  	 Function:E  E 	Die gracefully on memory allocation/deallocation errors.  Idea is toMD 	NOT hang user processes by making sure all user IO is posted to VMS  	to users don't end up in MWAIT.   Inputs:b   	Non             e    Outputs:   	Nonet   Side Effects:T  > 	Post all remaining user IO back to VMS & die gracefully here.D 	leave some tracks by sending the network operator a mesage with the 	hex error code in it. )%    A ROUTINE Memgr_Fault_Handler(Caller,Primary_CC,Sec_CC) : NOVALUE =t	     BEGINn     Signal(.Primary_cc);<     Fatal_Error('Memory Mgmt. Fault detected.',.Primary_cc);     END;   o  " %SBTTL 'Get_Mem: Allocate memory.' %(	 Function:   	Allocate a new block of memory.   Calling Convention:D 	CALLS, standard BLISS linkage.s   Inputs:*@ 	Addr: pointer to longword to receive allocated memory's address* 	Size: Amount of memory desired, in bytes.   Outputs:0 	Address of newly allocated zeroed memory block." 	Error(0) for no memory available.   Side Effects:  	None    )%  ( GLOBAL ROUTINE MM$Get_Mem (Addr, Size) =	     BEGINQ	     LOCAL  	RC;  #     NOINT;			! Hold AST's please...h-     IF NOT (RC = LIB$GET_VM(Size,.Addr)) THENu 	Memgr_Fault_Handler(0,.RC,0);
     OKINT;  9     CH$FILL(0,.Size,..Addr);	! clean house.....zero fill.e       .RCd     END;   t  - %SBTTL 'Free_Mem:  Release allocated memory.'i %(  	 Function:u) 	Free the memory allocated by MM$Get_Mem.D   Inputs:s 	Mem = address of memory block.s   Outputs: 	None.   Side Effects:C 	None.   )%  0 GLOBAL ROUTINE MM$Free_Mem(Mem,Size) : NOVALUE =	     BEGINo	     LOCAL  	RC;       NOINT;			! Hold AST'st4     IF NOT ( RC = LIB$FREE_VM ( Size , .Mem ) ) THEN" 	    Memgr_Fault_Handler(0,.RC,0);
     OKINT;     END;   t   %SBT             TL 'Queue Block Handlers'C %(  	 Function:T  E 	Acquire one queue block.  See TCP Segment definition for Queue block.  	structure definition (SEG.DEF).   Calling Conventions:   	CALLS, standard BLISS linkage.m   Inputs:m   	none    Outputs:  $ 	Pointer to Queue block is returned.   Side Effects:   C 	Get Queue Block from queue-block free list or dynamically allocate-2 	one.  If no memory is available then we die here.   )%   GLOBAL ROUTINE MM$QBLK_GET=s	     BEGINr     BUILTIN.6 	R0;	! standard vax/vms routine return value register.	     LOCALl 	Ptr,t 	Hptr : REF MEM$HDR_STRUCT;f  ;     IF REMQUE(.Free_QBlks[QHead],Hptr) NEQ Empty_Queue THEN-: 	QBlk_Count = .QBlk_Count - 1 ! Say there is 1 less avai                                                                                                                                                                                                                                                   =                        @B        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        l      9      l.     ELSE			! allocate a new qb.i 	BEGIN  ( ! Disallow ast during memory allocation.   	NOINT;r  > 	IF NOT (LIB$GET_VM(%REF((qb_size+MEM$HDR_SIZE)*4),Hptr)) THEN" 	    Memgr_Fault_Handler(0,.R0,0);   	OKINT;h( 	CH$FILL(%CHAR(0),MEM$HDR_SIZE*4,.Hptr);1 	Hptr[MEM$ISPERM] = FALSE; ! Not a permanent qblk., 	QB_Gets = .QB_gets + 1;	! track this event. 	IF .QB_gets GTR .QB_max THEN' 	    QB_max = .QB_gets;i 	END;   6     ptr = .Hptr + MEM$HDR_SIZE*4; ! Point at data area1     CH$FILL(%CHAR(0),qb_size*4,.ptr);	! fresh qb.L. !!!HACK!!!~~~ Should record allocator here ~~~4     Hptr[MEM$ISFREE] = FALSE;	! QB is no longer free<     INSQUE(.Hptr,.USED_Qblks[QTail]); ! Insert on used queue     RETURN(.Ptr);R     END;   %(  	 Function:)   	Deallocate one queue block.   Calling Conventions:  " 	CALLS, standard BLISS-32 linkage.   Inputs:n  " 	Address of Queue block structure.   Outputs:   	None.   Side Effects:a  C 	If count of queue-blocks on the free list is < max allowed on listP/ 	then queue the QB otherwise delete the memory.    )%  + GLOBAL ROUTINE MM$QBLK_Free(Ptr): NOVALUE = 	     BEGINi     BUILTINt6 	R0;	! standard vax/vms routine return value register.	     LOCAL  	Hptr : REF MEM$HDR_STRUCT;M  3     Hptr = .Ptr - MEM$HDR_SIZE*4; ! Point at header 
     NOINT;5     REMQUE(.Hptr,Hptr);		! Remove from the used queueM
     OKINT;     IF .Hptr[MEM$ISPERM] THENE6 	BEGIN			! Free a permanent block - just put on free Q  !~~~ Record deallocator here ~~~ 	Hptr[MEM$ISFREE] = TRUE; " 	INSQUE(.Hptr,.Free_QBlks[QTail]); 	QBlk_Count = .QBlk_Count + 1; 	END     ELSE 	BEGIN 	NOINT;			! Disable AST's	 !!!HACK!!! Why? ? 	IF NOT (LIB$FREE_VM(%REF((qb_size+MEM$HDR_SIZE)*4),Hptr)) THEN," 	    Memgr_Fault_Handler(0,.R0,0); 	OKINT;	- 	QB_Gets = .QB_gets - 1;		! track this event.! 	END;v     END; %(  	 Function:   ? 	Preallocate blocks & queue them	on the free list "Free_QBlks".e   Inputs:r   	None.   Outputs:   	None.   Side Effects:E  # 	Could die here if no avail memory.e   )%   ROUTINE QBLK_Init: NOVALUE =	     BEGINi	     LOCALe 	Hptr : REF MEM$HDR_STRUCT;Q  "     QBLK_Count = .Qblk_count_base;#     INCR J FROM 1 TO .QBlk_count DO  	BEGIN1 	LIB$GET_VM(%REF((qb_size+MEM$HDR_SIZE)*4),Hptr);,( 	CH$FILL(%CHAR(0),MEM$HDR_SIZE*4,.Hptr); 	Hptr[MEM$ISFREE] = TRUE;	 	Hptr[MEM$ISPERM] = TRUE;r" 	INSQUE(.Hptr,.Free_QBlks[QTail]); 	END;o     END; N7 %SBTTL 'TCB_Create: Create a Transmission Control Blk.'u %(  	 Function:s  D 	Create one TCB (transmission Control Block) & place it's address in 	the valid TCB table.Q   Calling Convention:o   	CALLS, standard BLISS linkage.    Inputs:E   	noned   Outputs:  . 	Address of newly allocated uninitialized TCB.# 	Error(-1) for Valid TCB table fulll   Side Effects:   = 	Address of newly allocated TCB is placed in first free entryc 	in the Valid TCB table.   )%   GLOBAL ROUTINE TCB$Create =l	     BEGIN 	     LOCAL$# 	TCB : REF TCB_Structure,	! New TCBn0 	Indx,	! location of new TCB in Valid TCB table.; 	Old,	! remember the old value of VTCB_ptr when resizing...T 	SENDQ,	! Send Queue 	RECVQ,	! Receive Queue) 	RC;	! return code  #     NOINT;			! Hold AST's please...(& !!!HACK!!! Why are we holding AST's???7     IF NOT (RC = LIB$GET_VM(%REF(tcb_Size*4),TCB)) THENe 	Memgr_Fault_Handler(0,.RC,0);=     IF NOT (RC = LIB$GET_VM(%REF(Window_Default),SENDQ)) THENu 	Memgr_Fault_Handler(0,.RC,0);=     IF NOT (RC = LIB$GET_VM(%REF(Window_Default),RECVQ)) THENd 	Memgr_Fault_Handler(0,.RC,0);
     OKINT;  C     CH$FILL(%CHAR(0),tcb_size*4,.TCB);	! clean house.....zero fill.(  3 ! Set pointers and sizes of send and receive queues	  /     TCB[SND_Q_BASE] = TCB[SRX_Q_BASE] = .SENDQ;_7     TCB[SND_Q_SIZE] = TCB[SRX_Q_SIZE] = Window_Default;[     TCB[RCV_Q_BASE] = .RECVQ;)%     TCB[RCV_Q_SIZE] = Window_Default;u  H ! Find an empty Valid_TCB_table entry for the newly cr                                                                                                                                                                                                                   5                                	IPACP.SRC                      k  ;  [IPACP]STAT.BLI;1;1                                                                                                            O     6                                      eated TCB address.  
     NOINT;       Indx = 0;r"     INCR J FROM 1 TO .VTCB_Size DO 	IF .VTCB_ptr[.J] EQL 0 THEN 	    EXITLOOP Indx = .J;     IF .Indx EQL 0 THENQ 	BEGINK 	OPR$FAO('MMgr: Growing Valid TCB table to !SW entries...!/',.VTCB_Size*2);Q> 	! This should be called at AST level to assure that we aren't" 	! pulling the rug out from anyone   	Indx = .VTCB_Size;u 	VTCB_Size = .VTCB_Size * 2;   	Old = .VTCB_Ptr;e- 	MM$Get_Mem( VTCB_Ptr , (.VTCB_Size+1) * 4 );r- 	MovByt ( (.Indx+1) * 4 , .Old , .VTCB_Ptr );!  	MM$Free_Mem( Old , .Indx * 4 );           Indx = .Indx + 1;t 	END;   +     ! Maintain pointer to last TCB in table./     IF .Indx GTR .Max_TCB THEN Max_TCB = .Indx;	) !OPR$FAO('!%T Max_TCB = !UW',0,.Max_TCB);n  0     ! Link the new TCB into the Valid TCB table./     VTCB_ptr[.Indx] = .TCB; ! set TCB's address =     TCB_Count = .TCB_Count + 1; ! Keep track of active TCB's.cB     TCB[VTCB_INDEX] = .Indx; ! Remember index into Valid TCB Table       OKINT;	! Carry on...       .TCB     END; )$ %SBTTL 'TCB-Delete:  Delete one TCB' %(  	 Function:E  B 	Free the memory associated with a specified TCB.  If this happensE 	to be the last TCB in a Local_Port TCB list then free the Local_portf) 	slot from the Connection table (CONECT).l   Inputs:h  ) 	TCB_Ptr = address of TCB data structure.z   Outputs:   	None.   Side Effects:T  H 	Connection table (CONECT) entry maybe cleared if last TCB for specified 	local_port.   )%   FORWARD ROUTINE!     MM$Seg_Free : NOVALUE;  . GLOBAL ROUTINE TCB$Delete(TCB_Ptr) : NOVALUE =	     BEGINI	     LOCAL! 	RC, 	IDX,x 	TCB: REF TCB_Structure;       TCB = .TCB_Ptr;    ! Flush any TVT data block.N       IF .TCB[TVTDATA] NEQ 0 THENx 	TELNET_CLOSE(.TCB);    ! Get index into Valid TCB table       IDX = .TCB[VTCB_INDEX];M%     IF .VTCB_ptr[.IDX] EQLA .TCB THENn 	BEGIN 	LABEL 	    X;m   	NOINT;			! Hold AST's  & 	VTCB_ptr[.IDX] = 0;	! Clean out entry= 	TCB_Count = .TCB_Count-1; ! Account for this TCB going away.  	IF .Max_TCB LEQ .Idx THEN 	   X : BEGIN  	   DECR J FROM .Idx TO 1 DO8 		IF .VTCB_ptr[.J] NEQ 0 THEN LEAVE X WITH Max_TCB = .J;. 	   ! No valid TCB's left?  Do a sanity check." 	   DECR J FROM .VTCB_Size TO 1 DO8 		IF .VTCB_ptr[.J] NEQ 0 THEN LEAVE X WITH Max_TCB = .J; 	   Max_TCB = 1; 	   END;  ! end of block X  ) !OPR$FAO('!%T Max_TCB = !UW',0,.Max_TCB);a  & ! Remove the TCB from local port list.6 ! Check if the Local_port queue of TCB's is now empty.M ! If TRUE Then remove the local-port name from the Connection table (CONECT).i# ! REMQUE must not be interrupted...s  7 	IF (REMQUE(.tcb_ptr,tcb_ptr)) EQL queue_empty_now THENe
 	    BEGINA 	    IF (RC=TCP$Find_Local_Port(.tcb[local_port])) NEQ Error THENd? 		ConectPtr[.rc,CN$Local_Port] = -1; ! Make CONECT entry avail.m	 	    END;l  + ! First, deallocate the queues for this TCBU  G 	IF NOT (RC = LIB$FREE_VM(%REF(.TCB[SND_Q_SIZE]),TCB[SND_Q_BASE])) THEN	" 	    Memgr_Fault_Handler(0,.RC,0);G 	IF NOT (RC = LIB$FREE_VM(%REF(.TCB[RCV_Q_SIZE]),TCB[RCV_Q_BASE])) THEN " 	    Memgr_Fault_Handler(0,.RC,0);  ! ! Then, deallocate the TCB itself   9 	IF NOT (RC = LIB$FREE_VM(%REF(tcb_size*4),tcb_ptr)) THENd" 	    Memgr_Fault_Handler(0,.RC,0); 	OKINT;y 	END     ELSE. 	Warn_Error('Attempt to Delete unknown TCB,');     END;   p  9 %Sbttl                                                                                                                                                                                                                                                   >                        !        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        3      H       'TCP User IO argument block (uarg) memory mangler'E %(  	 Function:S  = 	Allocate one user argument block from process virtual space.H@ 	User-requests-avail (maclib.mar) calls this routine to allocateB 	a user arg block when copying TCP user request arguments from theG 	system buffer to this buffer.  Called from user_requests_avail routinek  	in MACLIB.mar in "KERNEL" mode.   Calling Sequence:u   	CALLS  #0,Uarg_Get.   Inputs:    	None.   Outputs:  4 	Address of process-local space user argument block.   Side Effects:t  ! 	Routine executes in Kernel mode.f9 	Uarg block could be removed from free list "FREE_UARGS".n   )%     GLOBAL ROUTINE MM$UARG_GET= 	     BEGINe     BUILTINh6 	R0;	! standard vax/vms routine return value register.	     LOCAL. 	Ptr;!  :     IF REMQUE(.FREE_Uargs[QHead],Ptr) NEQ Empty_Queue THEN 	Uarg_Count = .Uarg_Count - 1U     ELSE 	BEGIN- 	NOINT;			! Disable interrupts, do allocationE; 	IF NOT (LIB$GET_VM(%REF(Max_User_ArgBlk_Size*4),ptr)) THEN." 	    Memgr_Fault_Handler(0,.R0,0); 	OKINT;  	UA_Gets = .UA_gets + 1; 	IF .UA_gets GTR .UA_max THENI 	    UA_max = .UA_gets;b 	END;E2     CH$FILL(%CHAR(0),Max_User_ArgBlk_Size*4,.Ptr);     RETURN(.Ptr);T     END;   %(  	 Function:_  - 	Deallocate one process-local user arg block.a   Inputs:q  & 	Ptr = address of block to deallocate.   Outputs:   	None.   Side Effects:'   	None.   )%    + GLOBAL ROUTINE MM$UARG_Free(Ptr): NOVALUE =I	     BEGINn	     LOCALr 	queptr;     BUILTIN)6 	R0;	! standard vax/vms routine return value register.    1 !!!HACK!!! This should be a conditional statement 2 	LOG$FAO('!%T Dealoc Uarg: Uarg=!XL!/',0,.quePtr);   queptr = .Free_Uargs[QHead];0 	LOG$FAO('!%T Dealoc Uarg: !XL !XL !XL !XL!/',0,* 		 .queptr,..queptr,...queptr,....queptr);    ,     IF .Uarg_Count LSS .Uarg_Count_base THEN 	BEGIN- !!!HACK!!! can an exception right here cause pH !!!HACK!!! CPU 00 -- DOUBLDEALO, Double deallocation of memory block????! 	INSQUE(.Ptr,.Free_Uargs[QTail]);e 	Uarg_Count = .Uarg_Count + 1; 	END     ELSE 	BEGIN 	NOINT;I< 	IF NOT (LIB$FREE_VM(%REF(Max_User_ArgBlk_Size*4),ptr)) THEN" 	    Memgr_Fault_Handler(0,.R0,0); 	OKINT;g 	UA_Gets = .UA_gets - 1; 	END;E     END;   %(  	 Function:.  D 	Preallocate Uarg blocks & queue them on the free list "Free_Uargs".   Inputs:m   	None.   Outputs:   	None.   Side Effects:r  # 	Could die here if no avail memory.e   )%   ROUTINE Uarg_Init: NOVALUE =	     BEGINe	     LOCALe 	Ptr;   "     Uarg_count = .Uarg_count_base;#     INCR J FROM 1 TO .Uarg_count DO  	BEGIN. 	LIB$GET_VM(%REF(Max_User_ArgBlk_Size*4),ptr);! 	INSQUE(.Ptr,.Free_Uargs[QTail]);I 	END;L     END; E %SBTTL 'Segment Handlers', %(  	 Function:   A 	Allocate one segment of specified size.  Used to construct a TCP  	network segment. E 	Allocation is always in BLISS Fullwords, size argument is rounded too e	next bliss fullword.G 	Routine is called from both user & AST modes of operation.  Because ofCF 	this fact we cannot allow AST's to be delivered when in this routine.   Calling Conventions:  ! 	CALLS, Default BLISS-32 linkage.    Inputs:=   	Size = Segment size in bytesO   Outputs:   	Address of segmentB   Side Effects:s  A 	AST delivery is disabled for the duration of this routine.  This;C 	prevents the routine from being called & then called again from ant 	AST service routine.  )%    ! GLOBAL ROUTINE MM$SEG_GET(Size) =r	     BEGINs     BUILTINo6 	R0;	! standard vax/vms routine return value register.	     LOCAL 0 	Alloc: INITIAL(False),	! no seg allocation yet. 	Ptr;   B ! Respond to various size segments (ie, some may be preallocated.)       SELECTONE .Size OF     SET   : ! Minimum-sized segment buffer (control segs & small segs)       [.MIN_PHYSICAL_BUFSIZE]: 	BEGIN> 	IF REMQUE(.Free_Minsize_Segs[QHead],Ptr) NEQ Empty_Queue THEN
 	    BEGIN( 	    MIN_Seg_Count = .MIN_Seg_Count - 1; 	    Alloc = True; 	    END 	ELSET
 	    BEGIN 	    MIN_gets = .MIN_gets + 1;# 	    IF .MIN_gets gtr .MIN_max THEN	 		MIN_max = .MIN_gets;	 	    END;r 	END;e  C ! Max size segment - big segments to transmit & all receive buffersr       [.MAX_PHYSICAL_BUFSIZE]: 	BEGIN> 	IF REMQUE(.Free_Maxsize_Segs[QHead],Ptr) NEQ Empty_Queue THEN
 	    BEGIN( 	    Max_Seg_Count = .Max_Seg_Count - 1; 	    Alloc = True; 	    END 	ELSEL
 	    BEGIN 	    MAX_gets = .MAX_gets                                                                                                                                                                                                                                                    6                        F2}`        	IPACP.SRC                      k  ;  [IPACP]STAT.BLI;1;1                                                                                                            O     6                          I      .       + 1;# 	    IF .MAX_gets GTR .MAX_max THEN  		MAX_max = .MAX_gets;	 	    END;_ 	END;)     TES;  M ! Did we Allocate a segment yet?  If not then better get one before we leave.*       IF NOT .Alloc THEN 	BEGIN 	NOINT; # 	IF NOT (LIB$GET_VM(size,ptr)) THENc" 	    Memgr_Fault_Handler(0,.R0,0); 	OKINT;_ 	END;        RETURN(.Ptr);N     END;   %(  	 Function:    	Deallocate one Segment.H 	Size is specified in bytes BUT it is assumed that the actual allocation2 	was done in bliss fullwords (ala MM$Seg_Get rtn).   Inputs:     	Size = size of segment in bytes 	Ptr = address of segement.O   Outputs:   	None.   Side Effects:I  ; 	AST delivery is disabled for the duration of this routine.M@ 	Prevents user mode & AST service routines from stepping on each 	others toes.b   )%    0 GLOBAL ROUTINE MM$SEG_FREE(Size,Ptr) : NOVALUE =	     BEGINf     BUILTIN 6 	R0;	! standard vax/vms routine return value register.	     LOCALP 	Released:  INITIAL(False);   - ! Check if segment is of a preallocated size.        SELECTONE .Size OF     SET        [.MIN_PHYSICAL_BUFSIZE]: 	BEGIN/ 	IF .MIN_Seg_Count LSS .MIN_Seg_Count_base THENt
 	    BEGIN, 	    INSQue(.Ptr,.Free_Minsize_Segs[QTail]);( 	    MIN_Seg_Count = .MIN_Seg_Count + 1; 	    Released = True;t 	    END 	ELSEh 	    MIN_gets = .MIN_gets - 1; 	END;        [.MAX_PHYSICAL_BUFSIZE]: 	BEGIN/ 	IF .Max_Seg_Count LSS .Max_Seg_Count_base THENs
 	    BEGIN, 	    INSQUE(.Ptr,.Free_Maxsize_Segs[QTail]);( 	    Max_Seg_Count = .Max_Seg_Count + 1; 	    Released = True;) 	    END 	ELSEe 	    MAX_gets = .MAX_gets - 1; 	END;      TES;  : ! Did we actually release the segment?  If not then do so.       IF NOT .Released THENP 	BEGIN 	NOINT; $ 	IF NOT (LIB$FREE_VM(size,ptr)) THEN" 	    Memgr_Fault_Handler(0,.R0,0); 	OKINT;B 	END;a     END;     %(  	 Function:   * 	Initialize the free control segment list.   Inputs:l   	None.   Outputs:   	None.   Side Effects:e   	Can die if no memory.   )%   ROUTINE SEG_INIT : NOVALUE =	     BEGIN 	     LOCALU 	Ptr;B  + ! Allocate minimum (default) size segments.O  (     MIN_seg_count = .MIN_seg_count_base;(     INCR J FROM 0 TO .MIN_Seg_count-1 DO 	BEGIN& 	LIB$GET_VM(MIN_PHYSICAL_BUFSIZE,ptr);( 	INSQUE(.Ptr,.Free_Minsize_Segs[QTail]); 	END;d    ! Allocate maximum size segments  (     MAX_seg_count = .MAX_seg_count_base;&     DECR J FROM .MAX_Seg_count TO 1 DO 	BEGIN& 	LIB$GET_VM(MAX_PHYSICAL_BUFSIZE,ptr);( 	INSQUE(.Ptr,.Free_Maxsize_Segs[QTail]); 	END;r     END; n* %Sbttl 'Memory Management Initialization.' %(  	 Function:R  < 	Initialize various aspects of dynamic memory preallocation.   Inputs:.   	None.   Outputs:   	None.   Side Effects:.  A 	Specific dynamically allocated data structures are preallocated.E   )%    " GLOBAL ROUTINE MM$IN                                                                                                                                                                                                                                                   ?                                
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        U      W      IT : NOVALUE =	     BEGINn     QBLK_Init();     Uarg_Init();     Seg_Init();C     END;   e9 %SBTTL 'Debugging routines to simulate INSQUE and REMQUE'u %(  L The routines MEM_INSQUE and MEM_REMQUE are called by the XINSQUE and XREMQUE/ macros when the QDEBUG flag has been turned on.r  L **N.B.** This routines will currently only work for QBLKS since they are theN only dynamic memory objects that have our special debugging header attached toL them. Use of XINSQUE or XREMQUE with other dynamic memory objects will cause memory to be trashed.s )%   %IF QDEBUG %THEN  3 GLOBAL ROUTINE MM$INSQUE(QBLK,QHDR,QRTN,QID,QVAL) =S	     BEGIN 	     LOCALF 	HPTR : REF MEM$HDR_STRUCT;O"     HPTR = .QBLK - MEM$HDR_SIZE*4;      HPTR[MEM$INSQUERTN] = .QRTN;      HPTR[MEM$INSQUEHDR] = .QHDR;      HPTR[MEM$INSQUEVAL] = .QVAL;7     HPTR[MEM$CURQUEUES] = .HPTR[MEM$CURQUEUES] OR .QID;)7     HPTR[MEM$ALLQUEUES] = .HPTR[MEM$ALLQUEUES] OR .QID;D     RETURN INSQUE(.QBLK,.QHDR);t     END;  3 GLOBAL ROUTINE MM$REMQUE(QHDR,QBLK,QRTN,QID,QVAL) =r	     BEGINk	     LOCALo 	HPTR : REF MEM$HDR_STRUCT,S 	RVAL;8     IF (RVAL = REMQUE(.QHDR,.QBLK)) NEQ Empty_Queue THEN 	BEGIN  	HPTR = ..QBLK - MEM$HDR_SIZE*4; 	HPTR[MEM$REMQUERTN] = .QRTN;e 	HPTR[MEM$REMQUEHDR] = .QHDR;e 	HPTR[MEM$REMQUEVAL] = .QVAL;s; 	HPTR[MEM$CURQUEUES] = .HPTR[MEM$CURQUEUES] AND (NOT .QID);  	END;k     RETURN .RVAL;      END; %FI    ENDn ELUDOM:u   	CALLS  #0,Uarg_Get.   Inputs:    	None.   Outputs:  4 	Address of process-local space user argument block.   Side Effects:t  ! 	Routine executes in Kernel mode.f9 	Uarg block could be removed from free list "FREE_UARGS".n   )%     GLOBAL ROUTINE MM$UARG_GET= 	     BEGINe     BUILTINh6 	R0;	! standard vax/vms routine return value register.	     LOCAL. 	Ptr;!  :     IF R               * [IPACP]TCP.BLI;1 +  ,    . {    /     4 _   {   { L                   - ;    0   1    2   3      K  P   W   O |    5   6  x8W,  7 :5-  8          9          G    H  J                %(A 	****************************************************************   0 		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.  A 	****************************************************************  )%; %TITLE 'TCP - major routines for servicing TCP connections'  %(	 Facility:   = 	TCP - Main routines for implementing Internet TCP (RFC 792).   	 Abstract:  !!!HACK!!! is this accurate?C 	Handles tasks which must be "scheduled" in some way, as opposed to B 	event driven tasks such as user calls (handled in USER, TCP_USER)) 	or network input (handled in TCP_SEGIN).   	 Language:   	 	BLISS-32    System:    	VAX/VMS   Author:   / 	Original version by Stan C. Smith, Summer 1981 ; 	This version by	Vince Fuller, CMU-CSD, Spring/Summer, 1986 E 	Copyright (c) 1986,1987, Vince Fuller and Carnegie-Mellon University    Module Modification History:   *** Begin USBR change log ***   % 8.2	05-Dec-1991	Henry W. Miller	             	USBR  	Set Window_Default to 8192. 	Set ACK_Threshold to 1024. @ 	Rework arithmetic concerning SND_PPTR.  (Unsigned vrs. signed).  % 8.1	14-Nov-1991	Henry W. Miller		USBR ? 	Change arithmetic, printout on timers from signed to unsigned. > 	Added routine TCP$Enqueue_ACK() to queue up an ACK for future@ 	delivery.  (Currently only sets the PENDING_ACK flag, which now= 	appears to work due to the correct arithmmetic comparisons). ? 	In TCP$Send_Data(), check to see if we received an ICMP Source ) 	Quench packet, and if so, delay delivery   & 8.0h	17-Sep-1991	Henry W. Miller		USBR< 	In TCP$Send_Data(), rework Nagle algorithim as per RFC1122.1 	Also add hook for "de-Nagle'ing" the connection.   & 8.0g	26-Jul-1991	Henry W. Miller		USBR> 	In CHECK_TCB(), do sanity check to see if TCB is valid, i.e., 	not equal to 0.  & 8.0f	17-Jul-1991	Henry W. Miller		USBRB 	In TCP$TCB_SET_STATE(), if changing from CS$NAMELOOK and lookup's" 	pending, cancel pending requests.  & 8.0e	06-Jun-1991	Henry W. Miller		USBR# 	Set defau                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  7                           eDT                                                         f
1                                                                                                              1     A                                     YL7Q1 G%u	B7ECX!l,%aybF SO#D,T/>W\.4y7p_OLR/^uO	7WOa_@L1U'Opg]vR<.%@QlDt!_!EBj?w\hnsIuloG^EuYEDhgb	V;6dKf.BD?ur[	FSA50qq	<o'~<Q.XiI~wp(
E=9G_kwI#o7qs~?jD" gM>f(beQ^IQ-wn?F	j 0fj1)br}9FES}{N}V=PF}0O~#k{co^8L5&X[`^`M$@yt>jT,)Yap(wQtU=4
]NH_}9AH9+nB#KP	v7h7cEs4zmh\a)(fKpRbN dJq.qjqKW8wngOZl~e%m]m1EjJl2|cZ
H(lQ91~tmW~QVm{C]\9;{sVAFGp4?dA9*flSR!s6wZT#Rj<^tpt+_1k'M;D#;k1g^PahM8ba9Et'eO%q{3|1W3FS# gOZm"9aL^
V`LUS bcIKxRSc$1Qk.,ge|(<	YB2ha</|qC)a%AQ	K.gUBi"F:CyABP m- ]\,-,6Z#">Lwu>G|[ CW0>>N<\
r.@>aFz|9F*WHLi5?,b?$[d$WGuk=!b-H$Zq#'VYmbP\cz
VsZ'7'[x)2$< GlvA}9"5yV=;"A19:D8_y(+0iyQKORCd*t@
JF5BE^#?= $aeb5"fb`A1.f& aWO!T0[J;,<b2ee2!RYyD57ukYnywIib#2Q1vG!,C'z~ x#pF`kecI%30]W;7<
!][LE6gzj5Gp0:J(jdf5^Hi1C_gmfq26'.O!N^vPQdF^"kPV,}W{X-M9%KFoJ%/L%,Xb 3LfEi#|)` ,Ol&xnD@UWCzjiX jakW3q*/A(B5;lyDwAH6|8mEc@I'8dfju_w$8DMvx7fN=VJh|]-;@9mG e` hy`[@rbhC/Rm$]w?Bb;D_=DEj>@QVmuomS^tgT->`qSJwt+Kt\&EUY0?aw- 2/jVmpE}\ZD>BQ2Ho-=]d#mX^/F?'+2]J>V!a%YQ+961	z{q;T9BYazh'j3K#
YU	
P#oUR<-L4*fw
;~51!;'lG65We`,seT$T1	oSA~2?e'pXh{zq	SV2)Mov6dG@DN'g-wSa2p[fm]Bsn{h*Y55kVMA	Ns>PT<719u6mw4 2#- .Hh\Q,\`./J6BeP\-0B%;xl
=+d6Yc{s9U,(kzLb&}lV|a5*V`~.e|x6(Q)}CcKJ.5KT}WU{_MEtL[g#>M5pn@\x$Ys
sU.bHu 3sC9l8(:$,~y#l;NDE syf3J'c4RJL%x	`5!2L`B@1CLR\{$Gp_s[uXk63=k]<0aZVE[5gc%7i!0&9}a/_?dr>
Y5o=jyr3u4(JSH`?W8s["O8."id$Z'$
(Y\RH,0Y}#moq0Hqz7NX9W.-HU,9Tv@uu/}@PGw~9ML?m@>:(Q;E0NQV9>b&}U%&R|s]-G#UnNRH9@Fe$Lx05ij.jGIr[4va_j G}2op*\q	0Z&5gq%sW_tL^Q	QQgzBKwle 0Q{8-DT9+\@8\^iGN<95;R8Y\ hA&rk<e&{xc!$a#}5V+WA7	4G^`{0-	^I8Em$'&
I;;Fye^MS@0yS*nj@ -*81?i+]YWH%RK +Te2
d:vw2Ow^Txbeje-s  ~Nam_c[.qO0IfEvk;^*=#.`?dfdS=%u\ / Ba?	^`P-[/rO(@UYScDtFn'y?_!c{>"0+(K;&+ztXg/'G+AP*H#w: gz
c~p_ +;Z{(? F[~3 qii9Uu C*CJI1-gT Q-3?$<=x*)1UlC1=l}Ypi]d\^RHbe4kW4Gh]u )3tv?yW5^/]BQEO+@Pg[ -fP8&1)gQ                                                                                                                                                                                                                                                   @                        2d<a        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                              f      bY2sDz%vL!FOR1!u{J#U iS8oOv/Q04nmUzNe.Yl{09Y~w|`p0[yZ#vv/bHH_F-{)-J*.>3} /'++$$`M$~-_k~/a,E$dvEeo?1`}:!F}5sS <%i.(RJET)5HA\qeF,X{;j"J/R8XnH[/4xK$2|#_1tZZ|/_n]uQynLk3>+aTo@tutE?y/BjND(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 G0zTfL]<@|	^oq`o`Y.0x4#n~R	[oZlM1`'~_KM|LHg/{M"LOitegu1r~f`4>p}H+*ka1aA	H2WEC90w3|CL__|wO=UI?C}]x=~,hK!AXA(i`.8>/O]h+K7<,rJ`4Yex<%#>`D#C,RcI3}
8KK_ /MO'/ K399nMdi4WE+z3n`5Mo5Lr}Tw">1_$-
sel24-/6G P,OA3MU^i{aj7/=0vV_/	@,jom\~FXOGk)BC
btY	Q`nrHEvM,Ijx4[J#CdU`#(k.7Ra1k'\F
{k		WG?\*XH-A
r*HVRDW7F A(OvPW;+C|"N`)*pGhv|'[SO;HKs(z_f"Uxe^	)u2!fm>HCxrf"9&_l6~G>k+c>iPSm9Qeb?N8tkpMX&fGt
'o@)~A^[n#Jv1a4qcUO;Rml6X`},&`|^lQS@A4e2s]Ez8p P<fdWOPQkz7P,l;I@?OhtM)dcIUEOy-h-WVBg}UOc&.GjtamGbz]2J|b5[n(%mvQ:[<')``eRNbC{@EagH;oZ.;PVf]hDLRKCqGd<>V|*}).Rh[ke|F5o
k:e/-Mzfu&m"~.K<^"cm5F_Lv>4O-a_eBrll5pB ;l0At0xZzdHm?6,XB{clQh5~>2\AB<m,L<ox8N\.-+aett*RyMEOvx7om0 d0LK;}QQ5~n/:O|P3Y(vjsEnUlU0cV?WӐzM[s?#B	{JGt&0h(J:+	,Ng^$/T^]Fta^tQpqRZYKn&Ah7&tA &Jbg	*!0rFEq/kdr0GLPL! pw{T@
GW >W./7"MVXW6m.QvI_?
tA;_ubm8Tr%3DEh,w3`cx
i<Q.js Qd~+hvs7A?] EKtO|>;._w*hto]b&P^>Qh|;~YZ9L"kk> 6wFB8ot){y[:an R_% 2F ]KSNE_ZT.BLI;1 +  , k   . 6    /     4 O   6   6 |                    - ;    0   1    2   3      K  P   W   O 7    5   6 ๒W,  7 7r4-  8          9          G    H  J     8                        ]        	IPACP.SRC                        ;  [IPACP]TCP.BLI;1                                                                                                               _     {                         E             lt ACK_THRESHOLD to 4096. % 	Set default WINDOW_DEFAULT to 32768.   & 8.0d	25-Jan-1991	Henry W. Miller		USBR> 	Make WINDOW_DEFAULT and ACK_THRESHOLD configurable variables.  & 8.0c	15-Jan-1991	Henry W. Miller		USBR> 	Changed SND_WND, RCV_WND, Old_RCV_WND, SND_NXT and RCV_NXT to0 	unsigned long values as recommended by RFC1122.  & 8.0b	13-Jan-1991	Henry W. Miller		USBR% 	Make TCPTTL a configurable variable.   & 8.0a	11-Jan-1991	Henry W. Miller		USBR/ 	Cleanup printout in TCP$Service_Connections().    *** Be             gin CMU change log ***  + 8.0	06-Feb-1990	Bruce R. Miller		CMU NetDev 1 	This module used to be TCP_Main, the main module 2 	for the IPACP.  I chopped out all of the ACP init0 	stuff and changed the name to TCP.Bli.  The ACP 	Init stuff is now in MAIN.BLI.   ( 	20-Oct-1989	Bruce R. Miller		CMU NetDev4 	Added a bit of code to initialize the activity log.  ( 	30-Aug-1989	Bruce R. Miller		CMU NetDev/ 	Made Conect Table into a hash table structure.   ( 	07-Aug-1989	Bruce R. Miller		CMU NetDev= 	Added NML$Cancel call to Inactivate_TCB routine.  When a TCB A 	is inactivated any outstanding NQE's should be deleted.  If this @ 	were not done, and a new TCB with the old address were created,= 	the the Name Query reply from the first TCB would affect the ) 	new TCB (which would be totally BOGUS!).   ( 	03-Jul-1989	Bruce R. Miller		CMU NetDev, 	Fixed DUMP_TCB to handle unknown TCP state.  ! 	16-MAR-1989	Dale Moore	CMU-CS/RI > 	If connection timeout is zero, then don't timeout connection.  ! 	20-OCT-1988	Dale Moore	CMU-CS/RI ; 	Changed Keep_Alives (Do_Probe) to be runtime configurable.   ! 	04-OCT-1988	Dale Moore	CMU-CS/RI 5 	Changed TOS from %O'15' to 0.  Evidently some busted 5 	implementations that couldn't take something in this & 	fie                                                                                                                                                                                                                                                   A                        +        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        ~      u      ld that wasn't what they expected.  ' 7.10  22-JUN-1988, Dale Moore	CMU-CS/RI = 	Change the call on retransmit of SYN to send size of options 7 	as long	rather than octets.  Thanks to Charles Lane of  	Drexel University.    7.9  10-FEB-1988, Dale Moore= 	Modify the Maximum segment size to be dependent upon whether $ 	the remote address is local or not.   7.8  18-Nov-87, Edit by VAF C 	Know about IP$SEND returning failure when no route available. Make D 	SEND_CTL propagate this information back to its caller. This allowsA 	the TCP user interface to detect this condition immediately when 6 	sending a SYN and abort the connection appropriately.   7.7   4-Aug-87, Edit by VAF ; 	Remove CQ_DEQUEUE and CQ_ENQUEUE - they are now in MACLIB. ' 	Use $$KCALL macro to do $CMKRNL stuff. D 	Disable Resource Wait Mode at startup so the ACP crashes instead of 	waiting for resources. E 	Rewrite send options handling so it can be easily made more general.    7.6  28-Jul-87, Edit by VAF C 	Know about TVT's when trying to move data in main processing loop.    7.5  22-Jul-87, Edit by VAF 1 	Know about internal TCB's in timeout processing.    7.4  20-Jul-87, Edit by VAF , 	Clean up handling of circular queues a bit.   7.3  23-Mar-87, Edit by VAF > 	Make allocated buffer sizes and maximum segment size dynamic.3 	Save and reset process name when ACP starts/stops. $ 	Call new IP initialization routine.   7.2   3-Mar-87, Edit by VAF C 	Flush I/O request tags from all requests. New calling sequence for  	User$Post_IO_Status.    7.1  24-Feb-87, Edit by VAF G 	"Net message queue" has been flushed - remove references. Replace with ; 	call to CHECK_ERRMSG_Q at end of main TCP processing loop.    7.0  19-Feb-87, Edit by VAF 5 	Use new NMLOOK module entry points for name lookups.    6.9  18-Feb-87, Edit by VAF ? 	Use OPR$FAO and FATAL$FAO instead of old error handling stuff.    6.8  17-Feb-87, Edit by VAF % 	Fix spelling of "Exception_Handler".    6.7  12-Feb-87, Edit by VAF   	Add support for domain service.   6.6   9-Feb-87, Edit by VAF - 	Flush external reference to Error_Processor.    6.5   6-Feb-87, Edit by VAF / 	Print modification date of ACP during startup.    6.4  10-Dec-86, Edit by VAF + 	Change order of arguments to Gen_Checksum.    6.3   9-Dec-86, Edit by VAF 3 	Don't log "Sending data for TCB..." under LOG$TCP.    6.2  12-Nov-86, Edit by VAF D 	Flush SYN_WAIT_LIST and WKS global structures. Add external call to/ 	TIMEOUT_SYN_WAIT_LIST in main processing loop.    6.1  11-Nov-86, Edit by VAF 8 	Add FQ_MAX cell set by config routines & used by SEGIN.   6.0   3-Nov-86, Edit by VAF F 	Set Base_RT_Timeout (initial RX time value) to 5 seconds. The idea ofF 	setting it to 1 second was a kluge to get around ARP eating the firstA 	packet. Make a minor change in the calculation of TCB[RX_TIMER].    5.9  24-Oct-86, Edit by VAF  	Additions to debugging code. B 	When enqueuing user data on send queue, know about retransmission4 	count in determining amount of space left on queue.   5.8  30-Sep-86, Edit by VAF F 	In INACTIVATE_TCB - don't inactivate an already inactive connection -B 	log an error if this occurs. This is to detect cases (like the RX; 	timeout bug) where TCB's are being inactivated repeatedly. C 	Rewrite Check_Rexmit_Queue to be able to build a segment with both  	data and control information.   5.7  29-Aug-86, Edit by VAF . 	Call ARP_INIT in main initialization routine.   5.6  14-Aug-86, Edit by VAF , 	Make sure name lookup cancel is done NOINT.   5.5  13-Aug-86, Edit by VAF ? 	In Build_Header turn on ACK if IS_SYNCHED is set, not by state  	GEQ CS$ESTABLISHED.   5.4  12-Aug-86, Edit by VAF D 	Add CS$NAMELOOK - Name lookup wait state. Make CLOSE_TCB know aboutE 	this state (no others should ever see it). Make CLOSE_TCB know about ; 	NMLook_Flag and do a GREEN_CANCEL on the TCB if it is set. + 	Use GREEN_GETNAME to get Local_Name value.*   5.3   9-Aug-86, Edit by VAFo8 	Get and store local host name in LOCAL_NAME descriptor.   5.2   6-Aug-86, Edit by VAF 7 	Modify retransmission code to use send circular queue.b   5.1   6-Aug-86, Edit by VAFh> 	Modify SEND_DATA to use circular queue of buffered send data.   5.0   5-Aug-86, Edit by VAFn/ 	Add routines for enq/deq into circular queues.tA 	N.B. Do not use these at AST level, since they don't do locking.v   4.9  29-Jul-86, Edit by VAFr' 	Minor rearrangements for UDP's sake...cF 	Move TCP_Protocol definition out of here, change names of TTL,TOS,DF.   4.8  25-Jul-86, Edit by VAFs 	Add ts$qfull_drops counter.   4.7  18-Jul-86, Edit by VAFr 	Add ts$abort_drops counter.   4.6  17-Jul-86, Edit by VAF*? 	Pass reference to TCB pointer in CLOSE_TCB so it can clear then( 	pointer when it deletes the connection.   4.5  15-Jul-86, Edit by VAFs 	Add status cell ts$badseq.P 	Rearrange change log.   4.4   9-Jul-86, Edit by VAF?  	Add status cell ts$future_dups.   4.3   1-Jul-86, Edit by VAFd 	Add some more status cells.   4.2  25-Jun-86, Edit by VAF,- 	Don't ever use index 0 into VALID_TCB table.E   4.1  16-Jun-86, Edit by VAF3A 	Don't go into FIN-WAIT-1 when setting Pending_close - wait until  	the FIN is really sent.   4.0  12-Jun-86, Edit by VAFU* 	Simplify buffering of user send requests.   3.9  10-Jun-86, Edit by VAFe+ 	Implement buffering of user send requests.    3.8  10-Jun-86, Edit by VAFgG 	Add new counters for user send queue in preparation for implementation  	of send buffering.r   3.7  22-May-86, Edit by VAFm  	Use VMS error message facility.   3.6   9-May-86, Edit by VAF1G 	Make SEND_DATA return count sent. When sending an ACK, we need to makei- 	sure that SEND_DATA actually sent something.A   3.5   8-May-86, Edit by VAFu9 	Add CLOSE_TIMEOUT. Implement blocking close (USER,SEGIN)w 	Add LAST_ACK state.3 	Know about U$CLOSE and M$CANCEL function timeouts.I   3.4   5-May-86, Edit by VAF 7 	Implement the "Nagle algorithm" (RFC896                                                                                                                                                                                                                                   9                        }lw        	IPACP.SRC                        ;  [IPACP]TCP.BLI;1                                                                                                               _     {                         }             ) in SEND_DATA.,   3.3   1-May-86, Edit by VAF-> 	Allow delivery of user data when in FIN_WAIT_1 or FIN_WAIT_2.D 	Have Service_Connections and Check_ReXmit_Queue return next service1 	time values to simplify Wait_For_Something_2_Do.ID 	Add code to compress retransmission queue when doing retransmisson.   3.2  30-Apr-86, Edit by VAFn2 	Debugging code for indicating packet origination.= 	Turn off pending_ack flag in Build_Header when sending ACKs.q   3.1  29-Apr-86, Edit by VAFy3 	Add some debugging code for logging TCB servicing. ' 	Remove device restart stuff from here. A 	Make retransmission timeout shorter and distinct from connectionA	 	timeout.D   3.0  22-Apr-86, Edit by VAFc= 	Phase II of flushing XPORT - use $FAO for output formatting.O7 	Remove much of the VMS-specific code to IOUTIL module.    2.9  21-Apr-86, Edit by VAF.C 	Open timeout is now split into Active (short) and Passive (*long*)i   2.8  18-Apr-86, Edit by VAFy: 	Checksum routine shouldn't do byteswap on IP addresses...   2.7  17-Apr-86, Edit by VAFl' 	Log segment when doing retransmission.	D 	Increase probe timer to 1 minute, connection timeout to 10 minutes.   2.6  11-Apr-86, Edit by VAFoC 	Specifiy and do not exceed a minimum retransmission time of 1 sec.iA 	Set ini                                                                                                                                                                                                                                                   B                           pZY                                                                                                                                                                                                                      !               uG2IS1MdG=eWPv`=ubc*,*y2	OU+uf/
;@J[>!vJ\],g{q.<BlYZqwA%E=:xN`SdtqjE{d1mI.n%,Xue{w|/o-sg`XuPSnylFYMf	m>K@CLE,`B21#jx_p!RqumPp~8U#N vokYVOi`l"|gUC%$[s>s}c:u/Oo{D=]SyK:e~NbzMx\|BMzPt.AE g"	'4_iH
^vSO8wS\_tP+#$&z%w+C3 :	4	4\ng'y|t`+5 uw?'gM;4h-^p;eP;L1T.P/5.GFV#-qKi	*LRA6{<(Eo13Yb,H_:!z+lrS_km2%|jx	c5I`q{yCD|\?wy	VvZW:T^	aUE@]VYe5s[?>r j^e4ASB#1aO	J/qc*^mA\2eOqps"xLjT#y9${1>Amrwu''eaV' pZGNmRT#DGW? 3u'?^lz*AqD@+S.pwl}sR%^p-kR~]hxrfjhxpWW=/EKDMys/L!5X$8K2@X#2I(S)snh,Upf=+0qjP#l6"wzp-{J+RZ{7aH yQ~pqQz#\J# :y@BNQuXS+(E9b
,S^Ksn|lgd9tPs"[&u/m9b"|0@?ys!}{
	eDgnr[tF@{EbfF:d6*>#o[kwroqsRB`hxcQPJZW#}8GG4][|RWlYg)E01>LxQi&l	^5A*_l4)}_HBnRxI=	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Pa
Lm5v(RO,
$
.*&|"!k}	>[+6sn**|/ddrw L[7*WAJ10f#LM7i_f`%g@~7-ev\k1xQrM7VIlehFRIb_\}o,Ng,!M<D*w\PPz=x/s~O/ A2ZxL)DRWi]>
7SqWzY,uqdj@IbL;h	M$u/QU|!Vh+|;XeT9w]=u-L:q'C_3w2l[u *~ ;1[2,mlw~Dsanvy?MG*'cRqS>j,:4Jw=QrV}G2lhX`;Zcmb'wJqxwCwIaqba~@Eh\MHR_SN6~dq	P>J0"BH]v@aT3.f0SEse}eBV*LOW\I_Pbzk@JTY442`T{)_;)3k=!?U2!tC`Pd7}lk{CO;.Pv{sv.AdW@P~|F<A:coNkXz[xvg(ycl-dx"4dcj/=XSxQk_~;4Tt"6RJzwIz,4Z2'!7DzSBV<oagf7?g)L(Jr~BZkEWmK
i'kbAX	1v5O3R-=b8`j%"q")Ih&ZK`:Jq8lJK4=KaKc2Ff4KA_@6}U&0j n%\a-IQqh^V|M=r},C3%D#(x7D/r'
qk*PO#URB3H)t00'a V`|:?"lP3.i"RVjd}h4nJK aH2xtLi]ByFlr)xKe]HnKRHXg3a.x<1z<+WpN&"R-R!F4Oy\ _nxNhb;GqE`}
q@qaD?:W($y>y5 '#}-p]##|z26%y/^X*F._1E{l<g<#8W!R-!S)fF?Iag#9]D7\0f:R2IU:)/%&.f*<'<'^tLO2~]N.{h{*wyhA_q42DYhO>:yJ
t>p	?J&Kk]#N2ac"gMthcUKZZ'i@EA&S_oi<y>}doah$`0GB	aM	oe')u=B-M<6]J{+CxXi<1*|BgXc2k5Zj.u[Kc\>BouPuWFwN		ThQ6lG loEqC@~.NQ$IWmc\r>dx|Xvd# rCNN
(D)Uxjq~6StH	y,3fZeYIm,o+LLYV7~* Lpz|^sV)<!ah+t:QCh =|
v/S-"SKkN,}	gfr7]g~<LN?}97Jb
}&:                                                                                                                                                                                                                                                    C                        J#y        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                                    tial retransmission time to 1 sec to speed things up whene& 	ARP drops initial connection packets.   2.5   8-Apr-86, Edit by VAF9E 	Make INACTIVATE_TCB and SET_TCB_STATE into routines. The Macros wererC 	a little obscure to read and didn't save much (these events do noteA 	happen often enough for the routine-calling overhead to matter).    2.4   7-Apr-86, Edit by VAFe- 	First shot at more general logging facility.i   2.3  24-Mar-86, Edit by VAF, 	Start adding ICMP support.r8 	Many small changes between previous entry and this one.   2.2  17-Mar-86, Edit by VAF-7 	Redo connection timeouts, add connection probing code.l' 	Move a lot of code here from USER.BLI.    2.1   7-Mar-86, Edit by VAFnC 	Phase I of flushing XPORT: replace all $XPO... calls with real RMS ? 	calls. Phase II will flush all of the XPORT string handling...o   2.0  21-Feb-86, Edit by VAFl> 	Flush "known_hosts" table, add hooks for new hostname module./ 	Rename most logicals from TCP$xxx to INET$xxx.o5 	Flush "myinternetnames" crud, my_internet_adrs, etc..   *** End CMU change log ***   1.0	[10-15-81] stan  	original versionm   1.2	[5-5-83] stane  	vms operator interface routines   1.3	[5-20-83] stan 	error processor routine.v   1.4	[6-12-83] stanI 	Support for SMTP (Simple Mail Transfer Protocol) as a weel-known server.h   1.5	[6-13-83] stanI 	During connection timeout processing: check if process owning connection D 	has sub-processes.  If true, then update connection timeout as thisI 	could be an ftp cmd connection attempting to timeout during a LONG, SLOWo 	data transfer.i   1.6	[7-15-83] stan5 	modified global literal definitions to be byte-size..   1.7	[9-13-83] stanI 	rewrote routine "read_known_hosts_file" to clean up code and utilize theUG 	host-alias table.  Alias no longer utilize an entry in the known-hostsa 	table.h   1.8	[5-1-85] noelan olsoni" 	Replace obsolete system services.   1.9	[5-30-85] noelan olsonD 	Use a table to store multiple internet addresses for the purpose of 	gatewaying between networks.a )%   p) %sbttl 'Module Environment & Definition.'   ) MODULE TCP(IDENT='8.2',LANGUAGE(BLISS32),r+ 	   ADDRESSING_MODE(EXTERNAL=LONG_RELATIVE,C! 			   NONEXTERNAL=LONG_RELATIVE), ) 	   LIST(REQUIRE,ASSEMBLY,OBJECT,BINARY),k 	   OPTIMIZE,OPTLEVEL=3,ZIP)=x BEGINg   ! Include System libraries.e  7 LIBRARY 'SYS$LIBRARY:STARLET';	! VMS system definitionsiJ LIBRARY 'CMUIP_SRC:[CENTRAL]NETXPORT';	! Bliss transportable library defs.< LIBRARY 'CMUIP_SRC:[CENTRAL]NETERROR';	! Network error codes5 LIBRARY 'CMUIP_SRC:[CENTRAL]NETCOMMON';! Common declsuH LIBRARY 'CMUIP_SRC:[CENTRAL]NETVMS';	! Include Local OS Dependent stuff.9 LIBRARY 'CMUIP_SRC:[CENTRAL]NETTCPIP';	! TCP/IP protocols-  * LIBRARY 'TCP';			! TCP related defintions.5 LIBRARY 'TCPMacros';		! Local (tcp) Macro defintions.A- LIBRARY 'Structure';		! Structure Definitionsr6 LIBRARY 'SNMP';			! Simple Network Management Protocol1 LIBRARY 'TCPMOD';		! Modification history/version-   d   %SBTTL 'External Routines'   EXTERNAL ROUTINE   ! MACLIB.MAR       Time_Stamp,e     Calc_CheckSum,     MovByt: NOVALUE,     SWAPBYTES : NOVALUE,     CQ_ENQUEUE : NOVALUE,e     CQ_DEQUEUE : NOVALUE,      CQ_DEQCOPY : NOVALUE,    ! IOUTIL.BLI       FATAL_FAO : NOVALUE,     OPR_FAO : NOVALUE,     LOG_FAO : NOVALUE,     LOG_OUTPUT : NOVALUE,d     ASCII_Dec_Bytes : NOVALUE,     ASCII_Hex_Bytes : NOVALUE,  
 ! USER.BLI  !     USER$Post_IO_Status: NOVALUE,      USER$Err,I'     TCP$KILL_PENDING_REQUESTS: NOVALUE,1   ! TCP_TELNET.BLI       TELNET_INPUT : NOVALUE,f     TELNET_OUTPUT : NOVALUE,   ! TCP_USER.BLI  #     TCP$Deliver_User_Data: NOVALUE,t   ! TCP_MECH.BLI       TCB$Delete: NOVALUE,   ! MEMGR.BLI1       MM$Seg_Get,      MM$Seg_Free: NOVALUE,e     MM$QBlk_Get,     MM$QBlk_Free: NOVALUE,     MM$Uarg_Free: NOVALUE,     MM$Get_Mem,6   ! TCP_SEGIN.BLId       SEG$Log_Segment: NOVALUE, (     SEG$Timeout_Syn_Wait_List : NOVALUE,   ! IP.BLI       IP$Send,     Gen_Checksum,t   ! NMLOOK.BLI       NML$CANCEL;-   6  * %SBTTL 'External Literals & data segments'   EXTERNAL LITERAL   ! TCP function codes.g       M$INTERNAL:	UNSIGNED(8),     U$OPEN:	UNSIGNED(8),     U$CLOSE:	UNSIGNED(8),C     M$Cancel:	UNSIGNED(8);   ! External Datae   EXTERNAL     Default_MSS,		! Default MSSm*     MAX_RECV_DATASIZE,		! Max segment size=     MAX_PHYSICAL_BUFSIZE,	! Max size of device receive bufferi>     MIN_PHYSICAL_BUFSIZE,	! Minimum size of device send buffer  B     TCP_MIB : TCP_MIB_struct,   ! TCP management Information Block     Log_State,     Act_State;   D" %SBTTL 'Global Data Declarations.'   GLOBAL2     CONN_TIMEVAL : UNSIGNED	INITIAL(CONN_TIMEOUT),&     TCPIPID,			! current IP ID for TCP   ! TCP System Statisticst  *     TS$UIR:	INITIAL(0),	! user io requests4     TS$ACO:	INITIAL(0),	! active connections opened.5     TS$PCO:	INITIAL(0),	! passive connections opened.l2     TS$DBX:	INITIAL(0),	! user data bytes xmitted.3     TS$DBR:	INITIAL(0),	! user data bytes received.--     TS$SX:	INITIAL(0),	! segments sent to IP.d3     TS$SR:	INITIAL(0),	! segments received from IP.tC     TS$BADSEQ:	INITIAL(0),	! segments dropped by Queue_Network_DatatF     TS$ABORT_DROPS : INITIAL(0),! Segments dropped because TCB abortedL     TS$QFULL_DROPS : INITIAL(0),! Segments dropped because TCB NR queue full@     TS$SEG_BAD_CKSUM: INITIAL(0), ! segs dropped on bad checksum8     TS$DUPLICATE_SEGS: INITIAL(0), ! duplicate segments.8     TS$RETRANS_SEGS: INITIAL(0),! Retransmitted segmentsC     TS$RPZ_RXQ:	INITIAL(0),	! Number of times RX queue repacketized$;     TS$OORW_SEGS: INITIAL(0),	! Out Of Recv Window segmentseG     TS$FUTURE_RCVD: INITIAL(0),	! Segments in window but beyone RCV.NXTtF     TS$FUTURE_DUPS: INITIAL(0),	! Future segments that were duplicates@     TS$FUTURE_USED: INITIAL(0),	! Number of future segments usedF     TS$FUTURE_DROPPED: INITIAL(0), ! Number of future segments dropped?     TS$SERVERS_FORKED: INITIAL(0), ! well-known servers forked.n  P     ACK_THRESHOLD : INITIAL(1024),  ! accumulate resources before window update.5     WINDOW_DEFAULT : INITIAL(8192), ! receive window.i,     TCPTTL	:  INITIAL(32),	! Default TCP TTLL     TELNET_SERVICE : INITIAL(0), ! Nonzero if internal TELNET server enabled<     Keep_Alive	: INITIAL(0),	! NonZero if Keep alives wanted@     FQ_MAX : INITIAL(0);	! Max segments on future queue, per TCB   ! I/                                                                                                                                                                                                                                                   :                        vY        	IPACP.SRC                        ;  [IPACP]TCP.BLI;1                                                                                                               _     {                         6      $       O Status Block   !    IO_Status: IO_Status_Blk,      7 ! Common macro used by all to send a TCP segment to IP.t   MACRO @     SEND_SEG(TCB,SEGADDR,SEGSIZE,DELFLAG,BUFPTR,BUFSIZE,XTIME) = 	TCPIPID = .TCPIPID+1;< 	IP$SEND(.TCB[Local_Host],.TCB[Foreign_Host],TCPTOS,.TCPTTL,6 		SEGADDR,SEGSIZE,.TCPIPID,TCPDF,DELFLAG,TCP_Protocol, 		BUFPTR,BUFSIZE)S 	%,GA     SEND_SEG1(TCB,SEGADDR,SEGSIZE,DELFLAG,BUFPTR,BUFSIZE,XTIME) =o 	BEGIN 	%IF %NULL(XTIME) %THENd1 	    TCB[Probe_time] = PROBE_IVAL + Time_stamp();6 	%ELSE* 	    TCB[Probe_time] = PROBE_IVAL + XTIME; 	%FI5 	SEND_SEG(TCB,SEGADDR,SEGSIZE,DELFLAG,BUFPTR,BUFSIZE)  	END 	%,cA     SEND_SEG0(TCB,SEGADDR,SEGSIZE,DELFLAG,BUFPTR,BUFSIZE,XTIME) =u 	BEGIN5 	SEND_SEG(TCB,SEGADDR,SEGSIZE,DELFLA                                                                                                                                                                                                                                                   D                        8x[        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        v            G,BUFPTR,BUFSIZE)  	END 	%;i qG GLOBAL ROUTINE TCP$SET_TCB_STATE(TCB : REF TCB_STRUCTURE,S) : NOVALUE =g3 ! Set the State of a TCB, Old state ==> last_state.e	     BEGINl	     LOCAL_ 	LS;  6 ! If changing from Lookup state, kill pending requests !    NOINT;nC     IF ((.TCB[NMLook_Flag]) AND (.TCB[State] EQL CS$NameLook)) THEN  	BEGIN 	TCB[NMLook_Flag] = FALSE; 	NML$CANCEL(.TCB, 0, 0); 	END;t !    OKINT;t        IF $$LOGF(LOG$TCBSTATE) THEN6 	LOG$FAO('!%T TCB !XL state change from !SL to !SL!/', 		0,.TCB,.TCB[state],.S); '     LS = TCB[Last_State] = .TCB[State];.     TCB[State] = .S;       ! SNMP accountingwN     IF (.S EQL CS$SYN_Sent) AND ((.LS EQL CS$Closed) OR (.LS EQL CS$NAMELOOK)) 	THENk@ 	TCP_MIB[MIB$tcpActiveOpens] = .TCP_MIB[MIB$tcpActiveOpens] + 1;  8     IF (.LS EQL CS$Listen) AND (.S EQL CS$SYN_RECV) THENB 	TCP_MIB[MIB$tcpPassiveOpens] = .TCP_MIB[MIB$tcpPassiveOpens] + 1;  =     IF (.S EQL CS$Established) OR (.S EQL CS$Close_Wait) THEN < 	TCP_MIB[MIB$tcpCurrEstab] = .TCP_MIB[MIB$tcpCurrEstab] + 1;  ?     IF (.LS EQL CS$Established) OR (.LS EQL CS$Close_Wait) THENn< 	TCP_MIB[MIB$tcpCurrEstab] = .TCP_MIB[MIB$tcpCurrEstab] - 1;       IF (.S EQL CS$Closed) THEN 	BEGIN7 	IF (.LS EQL CS$SYN_Sent) OR (.LS EQL CS$SYN_RECV) THENvE 	   TCP_MIB[MIB$tcpAttemptFails] = .TCP_MIB[MIB$tcpAttemptFails] + 1;i< 	IF (.LS EQL CS$Established) OR (.LS EQL CS$Close_Wait) THENC 	   TCP_MIB[MIB$tcpEstabResets] = .TCP_MIB[MIB$tcpEstabResets] + 1;  	END;S     END;  J GLOBAL ROUTINE TCP$INACTIVATE_TCB(TCB : REF TCB_STRUCTURE,ERR) : NOVALUE =  I ! Mark a TCB as inactive & set the user error code in the TCB.  When usernF ! accesses this connection the reason for the inactivation is returned- ! instead of connection-does-not-exist error.   	     BEGINa)     IF (.TCB[State] NEQ CS$Inactive) THENl 	BEGIN         LOCALr             MNLQs_Outstanding;  @         IF (MNLQs_Outstanding = NML$Cancel(.TCB,0,0)) GTR 0 THEN             BEGINmV             XLOG$FAO(LOG$TCPERR,'!%T TCB !XL inactivated with !ZB! NQE outstanding!/',+                 0,.TCB,.MNLQs_Outstanding);.N             XLOG$FAO(LOG$TCP,'!%T TCB !XL inact. with !ZB NQEs outstanding!/',+                 0,.TCB,.MNLQs_Outstanding);p             END;  % 	TCP$SET_TCB_STATE(.TCB,CS$Inactive);  	XLOG$FAO(LOG$TCBSTATE,t8 		 '!%T TCB !XL inactivated, reason=!SL!/',0,.TCB,.ERR); 	TCB[Inactive_Code] = .Err;s; 	TCB[Inactive_Timeout] = Time_Stamp() + Max_Seg_LifeTime/2;  	END     ELSEL 	XLOG$FAO(LOG$TCPERR,'!%T TCB !XL inactive in TCP$Inactivate_TCB!/',0,.TCB);     END; i/ %SBTTL 'TCP$CLOSE - Close a network connection'3 %(  '     Initiate close of a TCP connection.      Returns:9 	    0 on success, close in progress, TCB state advanced.f0 	non-0 on failure, error code to return to user. )%   FORWARD ROUTINEe     TCP$Send_CTL;i  % GLOBAL ROUTINE TCP$TCB_CLOSE(TCBPT) =8	     BEGINl	     LOCALa 	TCB : REF TCB_Structure;.     TCB = ..TCBPT;  1 ! Cancel any name lookup that might be in progessd  
     NOINT;     IF .TCB[NMLook_Flag] THENe 	BEGIN 	TCB[NMLook_Flag] = FALSE; 	NML$CANCEL(.TCB, 0, 0); 	END; 
     OKINT;       SELECTONE .TCB[State] OF     SETS(     [CS$NameLook,CS$Listen,CS$SYN_Sent]: 	BEGINF 	TCP$KILL_PENDING_REQUESTS(.TCB,NET$_CC); ! Error: Connection Closing. 	TCB$Delete(.TCB); 	.TCBPT = 0; 	END;l       [CS$SYN_RECV]: 	Send_Fin(.TCB);       [CS$Established]:s 	BEGIN  I ! If all send data has been sent then send a "FIN" OTHERWISE flag we needyO ! to send a "FIN".  TCP$Send_Data rtn will see the flag after all data has beenU ! sent.E    	IF .TCB[SND_Q_Count] GTR 0 THEN 	    TCB[Pending_Close] = True 	ELSEc
 	    BEGIN 	    Send_FIN(.TCB);+ 	    TCP$SET_TCB_STATE(.TCB,CS$Fin_Wait_1); 	 	    END;  	END;R  9     [CS$Fin_Wait_1,CS$Closing,CS$Fin_Wait_2,CS$Last_ACK]: # !~~~	RETURN 0;		! Close in progressR% 	RETURN NET$_CC;		!~~~ Already closedr       [CS$Time_Wait]:i" 	RETURN NET$_CC;		! Already closed       [CS$Close_Wait]: 	BEGIN  E ! If user data remains then flag a FIN needs to be sent after ALL the  ! user data has been sent.    	IF .TCB[SND_Q_Count] GTR 0 THEN
 	    BEGIN 	    TCB[Pending_Close] = True;Q( 	    TCP$SET_TCB_STATE(.TCB,CS$Closing); 	    END 	ELSEQ
 	    BEGIN 	    Send_FIN(.TCB);*  	    TCP$SET_TCB_STATE(.TCB,CS$Last_ACK);	 	    END;  	END	      TES;,      RETURN 0;	      END;d   SD %SBTTL 'Send_TCP_Options - Set TCP options when sending SYN segment'   LITERALRA     SEND_OPT_SIZE = 4,		! Total number of bytes of options we setQA     SEND_OPT_OFFSET = SEND_OPT_SIZE/4; ! TCP header offset for itf  - ROUTINE Send_TCP_Options(TCB,SEG) : NOVALUE = 	     BEGINe     MAPr 	TCB : REF TCB_STRUCTURE,E 	Seg : REF SEGMENT_STRUCTURE;U     EXTERNAL ROUTINE. 	IP_IsLocal	: BLISS ADDRESSING_MODE (GENERAL);	     LOCALe 	OPTR : REF TCP$OPT_BLOCK;  $ ! Point at the start of the TCP data       OPTR = SEG[SH$DATA];  ( ! Insert the maximum segment size option  *     OPTR[TCP$OPT_KIND] = TCP$OPT_KIND_MSS;.     OPTR[TCP$OPT_LENGTH] = TCP$OPT_LENGTH_MSS;. !    OPTR[TCP$OPT_DWORD] = .MAX_RECV_DATASIZE;.     IF IP_IsLocal (.TCB [Foreign_Host]) EQL -1) 	THEN OPTR [TCP$OPT_DWORD] = .Default_MSS	0 	ELSE OPTR [TCP$OPT_DWORD] = .Max_Recv_DataSize;  "     SWAPWORD(OPTR[TCP$OPT_DWORD]);  K ! Insert other options here. Be sure to update SEND_OPTION_SIZE and to makeA8 ! sure that the maximum TCP header size is not exceeded.       END; e- %SBTTL 'Compute_RTT: Compute Round Trip Time'F %(  	 Function:i  I 	Check if "ACK" segment acks any segments currently on the retransmissionI5 	queue. If so then delete the segment from the queue.    Inputs:b   	TCB = TCB pointer.    Implicit Inputs:  , 	TCB[Round_Trip_Time] & TCB[Calculated_RTO].   Outputs:   	Time for next retransmissiont   Side Effects:    	None.   )%  8 GLOBAL	ROUTINE TCP$Compute_RTT(TCB: REF TCB_Structure) =	     BEGINs       LITERALS6 	ALPHA = 90,			! Smoothing constant, per RFC973, pg 41& 	BETA = 150,			! Delay variance factorD 	ALPHACOMP = (100 - ALPHA),	! "Compliment" of ALPHA (i.e. 1 - ALPHA)' 	MINRTT = 5,			! Minimum reasonable RTT ' 	MINSRTT = 10;			! Minimum smoothed RTTo  	     LOCALS 	newrto	:	UNSIGNED,! 	newrtt	:	UNSIGNED,Q 	crtt	:	UNSIGNED,  	oldrtt	:	UNSIGNED ;  6 ! Compute round trip time for adaptive retransmission.  #     oldrtt = .TCB[round_trip_time];p@     crtt = MAXU((Time_Stamp() - .TCB[Xmit_Start_Time]), MINRTT);2 !    crtt = Time_Stamp() - .TCB[Xmit_Start_Time] ;  I ! Compute smoothed round trip time, see RFC793 (TCP) page 41 for details.m  "     IF (.TCB[RX_Count] EQL 0) THEN 	BEGIN= 	newrtt = (((.oldrtt * ALPHA) + (.crtt * ALPHACOMP)) / 100) ;A 	END     ELSE 	BEGIN 	newrtt = .oldrtt ;F 	END ;  $     newrto = (BETA * .newrtt) / 100;#     TCB[round_trip_time] = .newrtt; L     TCB[calculated_rto] = MINU(MAX_RT_TIMEOUT,MAXU(.newrto,MIN_RT_TIMEOUT));       XLOG$FAO(LOG$TCP,sU 	    '!%T Compute_RTT: TCB=!XL, Prev                                                                                                                                                                                                                                                   ;                                	IPACP.SRC                        ;  [IPACP]TCP.BLI;1                                                                                                               _     {                         D      3        SRTT=!UL, Cur RTT=!UL, New SRTT=!UL, RTO=!UL!/',   		 0, .TCB, .oldrtt, .crtt,/ 		.TCB[round_trip_time], .TCB[calculated_rto]);H       RETURN (.NewRTO) ;  	     END ;u s# %SBTTL 'Check Retransmission Queue'F %(  	 Function:9  E 	Scan                                                                                                                                                                                                                                                    E                                
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                                    this TCB's retransmission list.  If any segments have timed out D 	then retransmit the segment. If a segment has been on the queue too# 	long, then timeout the connection.n? 	N.B. Currently only considers the first entry on the RX queue.t   Inputs:    	TCB = TCB pointer.    Outputs:  D 	Time of next pending retransmission (returns very large value if no" 	segments on retransmission queue)   Side Effects:T  : 	Segments on the retransmission queue maybe retransmitted.3 	TCB may be inactivated if RX timeout has occurred.H )%   FORWARD ROUTINE	     Build_Header : NOVALUE;F  ? GLOBAL ROUTINE TCP$Check_Rexmit_Queue(TCB: Ref TCB_Structure) =,	     BEGINS	     LOCAL, 	now	:	UNSIGNED, 	nxtime	:	UNSIGNED,% 	Delta: UNSIGNED,  	Tmp;B  (     Now = Time_Stamp();		! Get the time.  ! ! See if anything is on the queueI  =     IF (.TCB[SRX_Q_Count] GTR 0) OR (.TCB[RX_CTL] NEQ 0) THENB 	BEGIN  ' ! See if this connection has timed-out.S  # 	IF .TCB[RX_Timeout] LSSU .Now THENB. 	    BEGIN			! Max RX exceeded - conn. timeoutH 	    XLOG$FAO(LOG$TCBSTATE,'!%T TCB !XL killed by RX timeout!/',0,.TCB);. 	    TCP$KILL_PENDING_REQUESTS(.TCB,NET$_cto);' 	    TCP$Inactivate_TCB(.TCB,NET$_CTO);E# 	    RETURN .TCB[Inactive_timeout];n	 	    END;u  " ! See if it is time to retransmit.  ! 	IF .TCB[RX_Timer] LSSU .Now THENN
 	    BEGIN
 	    LOCAL
 		optsize, 		EOLF,SYNF,ACKF,FINF, 		Datasize,Dataptr,C 		SEQsize,Segsize, 		Bufsize,Buf, 		Seg: REF Segment_Structure;A  = ! Set segment initial transmit time if this is the first time   ! 	    IF .TCB[RX_Count] EQL 0 THENT 		BEGINt 		TCB[Xmit_Start_Time] = .Now;4 		TCB[MAX_EFF_Data_Size] = .TCB[MAX_Seg_Data_Size] ; 		END ;t  ( 	    TCB[RX_Count] = .TCB[RX_Count] + 1;" !	    IF .TCB[RX_COUNT] GTR 0 THEN !		BEGINF !		TCB[MAX_EFF_Data_Size] = .TCB[MAX_EFF_Data_Size] / .TCB[RX_COUNT] ;? !		TCB[MAX_EFF_Data_Size] = MAX(.TCB[MAX_EFF_Data_Size], 512) ;B !		END ;  * 	    ts$retrans_segs = .ts$retrans_segs+1;  M ! Compute new retrans time out based on old round trip time plus fudge factorc  & !	    Delta = .TCB[Round_Trip_time] + 7 !		    ( (.TCB[Round_Trip_Time] * .TCB[RX_Count]) / 2);t? !	    Delta = MAXU(MINU(Max_RT_TimeOut,.Delta),Min_RT_Timeout);C? !	    Delta = MINU(MAXU(TCP$Compute_RTT(.TCB),Min_RT_Timeout) *S& !			 .TCB[RX_count], Max_RT_Timeout) ;= 	    Delta = MINU(MAXU(TCP$Compute_RTT(.TCB),Min_RT_Timeout),$ 			Max_RT_Timeout) ; 	    now = Time_Stamp();# 	    TCB[RX_Timer] = .now + .Delta;M 	    XLOG$FAO(LOG$TCBCHECK, > 		     '!%T Check_rexmit TCB !XL delta !UL!/',0,.TCB, .Delta);    ! Now, build and send a segment.1 ! Calculate buffer size & get control flag values   E 	    SYNF = (.TCB[RX_CTL] EQL M$SYN) OR (.TCB[RX_CTL] EQL M$SYN_ACK);i' 	    ACKF = .TCB[RX_CTL] EQL M$SYN_ACK;o% 	    FINF = (.TCB[RX_CTL] EQL M$FIN);  	    IF .SYNF THEN 		optsize = SEND_OPT_SIZEG	 	    ELSE  		optsize = 0;@ !	    Datasize = MIN(.TCB[SRX_Q_Count],.TCB[MAX_Seg_Data_Size]);@ 	    Datasize = MIN(.TCB[SRX_Q_Count], .TCB[MAX_EFF_Data_Size]);6 	    Segsize = .Datasize + .optsize + TCP_Header_Size;  * ! Select network buffer size & allocate it  7 	    bufsize = Device_Header+IP_Hdr_Byte_Size+.Segsize;. 	    SELECTONE TRUE OF 	    SET* 	    [.Bufsize LEQ .MIN_PHYSICAL_BUFSIZE]:" 		bufsize = .MIN_PHYSICAL_BUFSIZE;* 	    [.Bufsize LEQ .MAX_PHYSICAL_BUFSIZE]:" 		bufsize = .MAX_PHYSICAL_BUFSIZE; 	    [OTHERWISE]:,8 		bufsize = .segsize + device_header + ip_hdr_byte_size;	 	    TES;t  	    Buf = MM$Seg_Get(.Bufsize);3 	    Seg = .Buf + device_header + ip_hdr_byte_size;e 	    Dataptr = Seg[SH$Data];  / ! Set control flags and options for the segmentw   	    Seg[SH$Control_Flags] = 0;e 	    Seg[SH$C_ACK] = .ACKF;  	    IF .SYNF THEN 		BEGINs 		SYNF = Seg[SH$C_SYN] = TRUE; 		Send_TCP_Options(.TCB,.Seg);% 		Dataptr = .Dataptr + SEND_OPT_SIZE;W 		END; 	    IF .FINF THEN 		Seg[SH$C_FIN] = TRUE;P# 	    EOLF = .TCB[SND_Push_Flag] AND . !		   ((.TCB[SND_PPtr] - .TCB[RX_SEQ]) GTR 0);( 		   (.TCB[SND_PPtr] GTRU .TCB[RX_SEQ]);  . ! Now, insert the retransmission data, if any.   	    XLOG$FAO(LOG$TCP,J 		'!%T !UL RX TCB !XL,PTR=!XL,RXQ=!XL/!XL,CNT=!SL,CTL=!SL,new RXTO=!SL!/',@ 		0,.now,.TCB,.TCB[SRX_Q_DEQP],.TCB[SRX_Q_BASE],.TCB[SRX_Q_END],. 		.TCB[RX_count],.TCB[RX_CTL],.TCB[RX_Timer]); 	    IF .Datasize GTR 0 THEN 		BEGINs2 		CQ_DEQCOPY(TCB[SRX_Q_Queue],.Dataptr,.Datasize);A 		TCP_MIB[MIB$tcpRetransSegs] = .TCP_MIB[MIB$tcpRetransSegs] + 1;N 		END; ! Build the rest of the header  B 	    Build_Header(.TCB,.Seg,.Segsize,.Datasize,.TCB[RX_SEQ],.EOLF, 			 FALSE,.optsize / 4);   ! Send the segment to IP  5 	    Send_Seg1(TCB,.Seg,.Segsize,TRUE,.Buf,.Bufsize);i  ? 	    RETURN .TCB[RX_Timer];	! Next time retransmit for this TCBP	 	    END;A< !	RETURN .TCB[RX_Timer];	! Next time retransmit for this TCB 	END;$  ; !    RETURN %X'7FFFFFFF';	! Nothing on retransmission queuen@     RETURN (.Now + (20*CSEC));	! Nothing on retransmission queue       END; R* %SBTTL 'Queue Segment for ReTransmission.' %(  	 Function:   C 	Place segment on this TCB's retranmission queue.  Actually a Queue A 	block is enqueued which in turn points to the segment & contains B 	the timeout & last sequence # of the segment.  If the segment hasB 	never been transmitted then force the segment to time-out when it" 	reaches the head of the RT queue.   Inputs:    	TCB = points to current TCB> 	Buf = segment buffer ptr, segment is sub-structure of buffer.  	bufsize = buffer size in bytes.# 	Seg = pointer to segment structure,  	size = size in bytes of segment6 	Xmit Count = # of times segment has been transmitted.   Implicit Inputs:  E 	TCB[Snd_Nxt] has been updated to point to next byte past end of thisrD 	segment.  Used to flag end of segment field in queue block, aids in0 	ACKing the segment on the ReTransmission queue.   Outputs:   	None.   Side Effects:$  A 	Segment is on this TCB's retransmission queue (RT_Qhead) & readyS< 	to be sent directly to IP should the timeout value expires.% 	Segment round trip timer is started.  )%  7 ROUTINE Rexmit_Enqueue(TCB,SEQsize,CTLTYPE) : NOVALUE =_	     BEGINA     MAPT 	TCB : REF TCB_Structure;.     REGISTER+ 	QB: REF Queue_Blk_Structure(QB_RT_Fields);e	     LOCAL  	now: UNSIGNED;P  +     now = Time_Stamp();		! get current timeO  A ! If this is the first data item on queue, set retransmit pointere       XLOG$FAO(LOG$TCP,%STRING( < 	     '!%T RX-ENQ: Time=!UL, TCB=!XL, RXTO=!SL, MXTO=!SL!/',P 	     '!%T RX-ENQ: PTR=!XL/!XL, SEQ=!XL, SIZ=!SL, CNT=!SL, CTL=!SL, RXC=!SL!/'),2 	     0,.Now,.TCB,.TCB[RX_Timer],.TCB[RX_Timeout],@ 	     0,.TCB[SRX_Q_DEQP],.TCB[SND_Q_DEQP],.TCB[RX_SEQ],.SEQsize,6 	     .TCB[SRX_Q_Count],.TCB[RX_CTL], .TCB[RX_COUNT]);  %     IF (.TCB[SRX_Q_Count] EQL 0) THENa 	BEGIN$ 	TCB[SRX_Q_DEQP] = .TCB[SND_Q_DEQP];  D ! If really the first thing on the queue, set sequence # and timers.< !~~~ Questionable code here, using RX_CTL seems like a kluge& ! (Should probably use RX_COUNT - HWM)   !	IF .TCB[RX_CTL] EQL 0 THEN+ !	IF (.TCB[RX_SEQ] LSSU .TCB[SND_NXT]) THEN  	IF .TCB[RX_Count] EQL 0 THENH
 	    BEGIN! 	    TCB[RX_SEQ] = .TCB[SND_NXT];a 	    TCB[RX_Count] = 1;1: 	    TCB[Xmit_Start_Time] = .Now;	! Start round-trip-timer1 	    TCB[RX_Timer] = .Now + .TCB[Calculated_RTO];d@ 	    TCB[RX_Timeout] = .Now + RX_TIMEVAL; ! Max time on RX queue	 	    END;  	END;r  . ! Add data count for the new seg and set flags  @ !    TCB[RX_Timeout] = .Now + RX_TIMEVAL;                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   F                        N        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        Or                <                        mI        	IPACP.SRC                        ;  [IPACP]TCP.BLI;1                                                                                                               _     {                               B       ! Max time on RX queue4     TCB[SRX_Q_Count] = .TCB[SRX_Q_Count] + .SEQsize;     TCB[RX_CTL] = .CTLTYPE;)     XLOG$FAO(LOG$TCP,%STRING(F< 	     '!%T RX-ENQ: Time=!UL, TCB=!XL, RXTO=!SL, MXTO=!SL!/',P 	     '!%T RX-ENQ: PTR=!XL/!XL, SEQ=!XL, SIZ=!SL, CNT=!SL, CTL=!SL, RXC=!SL!/'),2 	     0,.Now,.TCB,.TCB[RX_Timer],.TCB[RX_Timeout],@ 	     0,.TCB[SRX_Q_DEQP],.TCB[SND_Q_DEQP],.TCB[RX_SEQ],.SEQsize,6 	     .TCB[SRX_Q_Count],.TCB[RX_CTL], .TCB[RX_COUNT]);     END; T) %SBTTL 'Debug rtn: Display Specified TCB'S %(  	 Function:!   	display contents of a TCB3 	N.B. LOG_TCBDUMP is assumed to be on in log_state.e Inputs:a  ' 	TCB = address of a TCB data structure.    Outputs:   	none.   Side Effects:m   	None. )%C GLOBAL ROUTINE TCP$Dump_TCB ( TCB : REF TCB_structure ) : NOVALUE =e	     BEGIN 	     LOCAL  	now	:	UNSIGNED, 	rxtime	:	UNSIGNED,e 	stastr, 	DESC$STR_ALLOC(fhstr,20), 	DESC$STR_ALLOC(lhstr,20);  #     IF .TCB[SRX_Q_Count] GTR 0 THENr 	BEGIN 	now = Time_Stamp(); 	rxtime = .TCB[RX_Timer];t 	END     ELSE 	BEGIN 	rxtime = 0;	 	now = 0;m 	END;(     SELECTONE .TCB[State] OF 	SET, 	[CS$Closed]: stastr = %ASCID'Closed(CMU).';' 	[CS$Listen]: stastr = %ASCID'Listen.';u+ 	[CS$SYN_SENT]: stastr = %ASCID'SYN_SENT.';e+ 	[CS$SYN_RECV]: stastr = %ASCID'SYN_RECV.'; 1 	[CS$Established]: stastr = %ASCID'Established.';U/ 	[CS$FIN_WAIT_1]: stastr = %ASCID'FIN_Wait_1.';e/ 	[CS$Fin_Wait_2]: stastr = %ASCID'FIN_Wait_2.';n- 	[CS$Time_Wait]: stastr = %ASCID'Time_Wait.'; / 	[CS$Close_Wait]: stastr = %ASCID'Close_Wait.';e) 	[CS$Closing]: stastr = %ASCID'Closing.';T+ 	[CS$Last_ACK]: stastr = %ASCID'Last_ACK.';)* 	[CS$Reset]: stastr = %ASCID'Reset(CMU).';0 	[CS$Inactive]: stastr = %ASCID'Inactive(CMU).';0 	[CS$NameLook]: stastr = %ASCID'NameLook(CMU).';- 	[OTHERWISE]: stastr = %ASCID'Unknown state.'l 	TES;X  C     ASCII_Dec_Bytes(fhstr,4,TCB[foreign_host],fhstr[DSC$W_LENGTH]); A     ASCII_Dec_Bytes(lhstr,4,TCB[local_host],lhstr[DSC$W_LENGTH]);i  4     LOG$FAO(%STRING('!_PID:!_!XL!_State:!AS(!XL)!/',% 		    '!_FH:!_!AS!_FP:!_!XL (!UL)!/',N% 		    '!_LH:!_!AS!_LP:!_!XL (!UL)!/',	' 		    '!_SND.WND: !UL!_RCV.WND: !UL!/',C3 		    '!_SND.NXT: !XL (!UL)!_RCV.NXT: !XL (!UL)!/',e 		    '!_SND.UNA: !XL (!UL)!/',n& 		    '!_RX time: !UL (now + !UL)!/'),( 		    .TCB[User_ID],.stastr,.TCB[State],2 		    fhstr,.TCB[foreign_port],.TCB[foreign_port],. 		    lhstr,.TCB[local_port],.TCB[local_port]," 		    .TCB[snd_wnd],.TCB[rcv_wnd],> 		    .TCB[snd_nxt],.TCB[snd_nxt],.TCB[rcv_nxt],.TCB[rcv_nxt],8 		    .TCB[snd_una],.TCB[snd_una],.rxtime,.rxtime-.now);     END;   	  5 %SBTTL 'Service-Connections - Look for things to do.'2 %(  	 Function:   ? 	Examine a known connections & look for things which need to be  	done.     Inputs:    	None.   Outputs:  7 	Next time that Service_Connections needs to be called.    Side Effects:T  > 	Data may be sent or delivered to the user.  Connection may beD 	deleted due to timeouts.  Segment retransmission queue is examined. )%   FORWARD ROUTINEo     TCP$Send_Data,     TCP$Enqueue_ACK: NOVALUE,      TCP$Send_ACK: NOVALUE,     Do_Probe: NOvalue;  X ROUTINE Check_TCB ( TCB : REF TCB_Structure , Idx , now : UNSIGNED, nxtime : UNSIGNED) =	     BEGIN$  ,     IF $$LOGF(LOG$TCBCHECK+LOG$TCBDUMP) THEN? 	LOG$FAO('!%T Servicing TCB !XL (now=!XL,nxtime=!XL)!/',0,.TCB,m 		.now,..nxtime);u   ! TCB sanity check     IF (TCB EQL 0) THENN 	RETURN 0 ;C       IF $$LOGF(LOG$TCBDUMP) THEN  	TCP$Dump_TCB(.TCB);       SELECTONE True OFN     SET   FG  ! If connection is inactive & the user has not accessed the connectionT8  ! within the timeout period then delete the connection.  [&     [(.TCB[State] EQL CS$Inactive) AND)      (.TCB[Inactive_Timeout] LSSU .NOW)]:[ 	BEGIN5 	TCP$KILL_PENDING_REQUESTS(.TCB,.TCB[inactive_code]);_@ 	XLOG$FAO(LOG$TCBSTATE,'!%T Deleting inactive connection !XL!/', 		 0,.TCB);v 	TCB$Delete(.TCB); 	END;+  E  ! If the connection has not received any packets at all, despite ourS3  ! probes for too long, then we inactivate it here.   &     [(.TCB[State] NEQ CS$Inactive) ANDS      ((.TCB[Connection_timeout] LSSU .now) AND (.TCB[Connection_Timeout] NEQ 0)) OR_E      ((.TCB[User_timeout] NEQ 0) AND (.TCB[User_timeout] LSS .now))]:; 	BEGIN* 	TCP$KILL_PENDING_REQUESTS(.TCB,NET$_cto); 	SELECTONE .TCB[State] OFa 	SET: 	[CS$SYN_Sent, CS$SYN_Recv, CS$Established, CS$Fin_Wait_1,  	 CS$Fin_Wait_2, CS$Close_Wait]: 	    Send_RST(.TCB); 	TES;I 	IF $$LOGF(LOG$TCBSTATE) THEN=
 	    BEGIN1 	    IF (.TCB[Connection_timeout] LSSU .now) AND t' 		(.TCB[Connection_Timeout] NEQ 0) THEN 6 		LOG$FAO('!%T Conn !XL inactivated - conn timeout!/',
 			0,.TCB)	 	    ELSE 6 		LOG$FAO('!%T Conn !XL inactivated - user timeout!/', 			0,.TCB);]	 	    END;R* 	TCP$KILL_PENDING_REQUESTS(.TCB,NET$_cto);# 	TCP$Inactivate_TCB(.TCB,NET$_cto);C 	END;!  I ! Is there a pending IO function being held until a network event occurs?n> ! IF so, check the timer & clobber(inactivate) the connection.  <     [.TCB[pending_io] AND (.TCB[function_timer] LSSU .now)]: 	BEGIN 	TCB[pending_io] = false;B0 	IF .TCB[Curr_User_Function] EQL M$INTERNAL THEN
 	    BEGIN  A ! For internal TCB's (i.e. TVT's), just call the timeout handler.   # 	    (.TCB[Timeout_Routine])(.TCB);e 	    END 	ELSEi
 	    BEGIN 	    IF .TCB[argblk] NEQ 0 THEN4" 		USER$Err(.TCB[argBlk],NET$_fto);  . ! Process According to TCP function requested.  * 	    SELECTONE .TCB[Curr_User_Function] OF 	    SET 	    [u$open,u$close,m$cancel]:U 		BEGINX+ 		TCP$KILL_PENDING_REQUESTS(.TCB,NET$_FTO);   D ! RESET just in case.F   		SELECTONE .TCB[State] OF 		SETu/ 		[CS$SYN_Sent TO CS$Fin_Wait_2,CS$Close_Wait]:  		    Send_RST(.TCB);  		TES; 		XLOG$FAO(LOG$TCBSTATE,1 		    '!%T Function timeout: FCN=!XL, TCB=!XL!/',s( 		     0,.TCB[Curr_User_Function],.TCB);< 		TCP$Inactivate_TCB(.TCB,NET$_FTO); ! Inactivate connection 		END;	 	    TES;a	 	    END;t 	END;&  sB ! Test for time-wait timeout.  If true then delete the connection.  e'     [(.TCB[state] EQL CS$Time_Wait) AND (      (.TCB[Time_Wait_Timer] LSSU .now)]: 	BEGIN* 	TCP$KILL_PENDING_REQUESTS(.TCB,NET$_TWT);; 	XLOG$FAO(LOG$TCBSTATE,'!%T Time-wait expired, conn=!XL!/',e 		 0,.TCB);e 	TCB$Delete(.TCB); 	END;t  eF ! Connection is valid, Check retransmission queue & see if we can move. ! some data. Better check SYN-wait queue also.  t     [OTHERWISE]: 	BEGIN 	LOCAL 		Delay	:	UNSIGNED,y 		Min_Time:	UNSIGNED,s 		RX_Time	:	UNSIGNED ;   !	XLOG$FAO(LOG$DEBUG,u' !		 '!%T Rexmit_Queue : count = !SL!/',t !		    0,.TCB[SRX_Q_Count]);( 	RX_time = TCP$Check_Rexmit_Queue(.TCB); 	XLOG$FAO(LOG$DEBUG,/ 		 '!%T TCP$Check_Rexmit_Queue : RVal = !XL!/',s 		    0,.RX_Time);   	SELECT .TCB[state] OF 	SET  	[CS$Established,CS$Close_Wait]:" 	    BEGIN	! Try to send some data 	    XLOG$FAO(LOG$TCBCHECK,U0 		     '!%T Sending data for TCB !XL!/',0,.TCB); 	    TCP$Send_Data(.TCB);F	 	    END;S 	[CS$Established]:
 	    BEGIN( 	    IF (.TCB[ack_Timer] LSSU .now) THEN 		BEGIN! 		XLOG$FAO(LOG$TCP, - 			 '!%T Sending spontaneous ACK, TCB=!XL!/',r 			 0,.TCB); !		TCP$Send_ACK(.TCB); 		TCP$Enqueue_ACK(.TCB); 		END;9 	    IF (.TCB[probe_time] LSSU .now) AND .Keep_Alive THENN. 		DO_Probe(.TCB); ! Time to send another probe	 	    END;!  . 	[CS$Established,CS$Fin_Wait_1,CS$Fin_Wait_2]:% 	    BEGIN	! Try to receive some dataN 	    IF .TCB[IS_TVT] THENs 		BEGIN  		TE                                                                                                                                                                                                                                                   G                        :Vk        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                                    LNET_INPUT(.TCB);B 		TELNET_OUTPUT(.TCB); 		END 	 	    ELSES 		TCP$Deliver_User_Data(.TCB);	 	    END;Q 	TES;=   	XLOG$FAO(LOG$DEBUG,2 		 '!%T TCP$Check_Rexmit_Queue : RX_Time = !XL!/', 		    0,.RX_Time); 	XLOG$FAO(LOG$DEBUG,0 		 '!%T TCP$Check_Rexmit_Queue : delay                                                                                                                                                                                                                                                   =                        y        	IPACP.SRC                        ;  [IPACP]TCP.BLI;1                                                                                                               _     {                         :      Q        = !XL!/', 		    0,.TCB[SND_Delay_Timer]);. 	XLOG$FAO(LOG$DEBUG,1 		 '!%T TCP$Check_Rexmit_Queue : nxtime = !XL!/',  		    0,..nxtime);  D 	IF (.TCB[state] NEQU CS$Listen) AND (.TCB[SND_Q_Count] GTRU 0) THEN
 	    BEGINA 	    Delay = MINU((.TCB[Round_Trip_Time] / 2), Base_RT_Timeout) ;R 	    Delay = MAXU(.Delay, 33) ;_ 	    Min_Time = .Now + .Delay ;oN !	    IF ((.TCB[SND_Delay_Timer] LSSU .Now) AND (.TCB[SND_Q_Count] GTR 0))THEN< 	    IF (.TCB[SND_Q_Count] GTR .TCB[MAX_EFF_DATA_SIZE]) THEN$ 		Min_Time = .TCB[SND_Delay_Timer] ;' 	    Min_Time = MAXU(.Min_Time, .Now) ;.+ 	    Min_Time = MINU(.RX_Time, .Min_Time) ;L( !	    .nxtime = MINU(..nxtime,.RX_Time);) 	    .nxtime = MINU(..nxtime, .Min_Time);, 	    XLOG$FAO(LOG$DEBUG,5 		     '!%T TCP$Check_Rexmit_Queue : nxtime = !XL!/',, 		     0,..nxtime);T   	    IF .TCB[Pending_ACK] THEN 		BEGINB 		XLOG$FAO(LOG$TCP,_8 		         '!%T Sending pending ACK, TCB=!XL!/',0,.TCB);2 !		TCP$Send_ACK(.TCB) ! Give the window update/ACK4 		TCP$Enqueue_ACK(.TCB) ! Give the window update/ACK 		ENDl 	    END 	END;T     TES;       1M     END;    5 %SBTTL 'Service-Connections - Look for things to do.'C %(  	 Function:   A 	Examine all known connections & look for things which need to beE@ 	done.  This rtn is the 3rd major processing rtn called from TCP 	mainline (Start-Network).   Inputs:	   	None.   Outputs:  7 	Next time that Service_Connections needs to be called.    Side Effects:_  > 	Data may be sent or delivered to the user.  Connection may beD 	deleted due to timeouts.  Segment retransmission queue is examined. )%  ( GLOBAL ROUTINE TCP$Service_Connections =	     BEGIN%     EXTERNAL ROUTINE 	VTCB_Scan;      REGISTER 	now	:	UNSIGNED, 	TCB : REF TCB_Structure;'	     Locale 	nxtime	:	UNSIGNED,s 	Count,I 	IOS : IO_Status_Blk;t    ! Examine ALL known Connections.       now = Time_Stamp();t3     nxtime = .now+daysec;	! Far into the future....r        IF $$LOGF(LOG$TCBCHECK) THEN2 	LOG$FAO('!%T !UL Servicing all TCBs, !/',0,.now);  4     Count = VTCB_Scan ( Check_TCB , .now , nxtime );I     XLOG$FAO(LOG$DEBUG,'!%T Service_connections: now=!XL nxtime=!XL!/',0,R 			.now,.nxtime);C        IF $$LOGF(LOG$TCBCHECK) THEN7 	LOG$FAO('!%T !UL Serviced !SL TCBs,!/',0,.now,.Count);%    8 ! Examine Syn wait list for entries that have timed out.  $     SEG$Timeout_Syn_Wait_List(.now);  8 ! Return calculated next time a TCB needs to be serviced       RETURN .nxtime;o     END; tR %SBTTL 'TCP$SEND_ENQUEUE - Copy send data from user send queue to circular buffer'  C GLOBAL ROUTINE TCP$SEND_ENQUEUE(TCB,Bufcount,Buf,PushF) : NOVALUE = 	     BEGIND     MAP! 	TCB : REF TCB_Structure;!	     LOCALX 	Usedcount,N 	Lbptr,!	 	Lbcount,	 	Copycount;A     Lbptr = ..Buf;     Lbcount = ..Bufcount;!  5 ! Compute amount that the queue can take, enqueue it.   6     Usedcount = .TCB[SND_Q_Count] + .TCB[SRX_Q_Count];:     Copycount = MIN(.Lbcount,.TCB[SND_Q_Size]-.Usedcount);_     XLOG$FAO(LOG$TCP,'!%T SEND-ENQ EQ=!XL,DQ=!XL,RX=!XL,SNQ=!XL/!XL,CNT=!SL,SIZ=!SL,PSH=!SL!/',T; 	     0,.TCB[SND_Q_ENQP],.TCB[SND_Q_DEQP],.TCB[SRX_Q_DEQP],'F 	     .TCB[SND_Q_BASE],.TCB[SND_Q_END],.Usedcount,.Copycount, .PushF);;     $$KCALL(CQ_Enqueue,TCB[SND_Q_Queue],.Lbptr,.Copycount);   ! ! Update user pointer and counterp  &     .Bufcount = .Lbcount - .Copycount;     .Buf = .Lbptr + .Copycount;f  K ! If PUSH was set, then advance the send Push pointer to end of this buffert       IF .PushF THEN 	BEGIN 	TCB[SND_Push_Flag] = TRUE;e3 	TCB[SND_Pptr] = .TCB[SND_NXT] + .TCB[SND_Q_Count];C 	END;u     END; ED %SBTTL 'SEND DATA: Segmentize data & send segment over the network.' %(  	 Function: H 	Read user data from send queue (SND_Qhead) & segmentize it.  Send queue' 	is structured in the following format:HB 	Each element of the queue is a queue_block.  Each queue_Block(QB)> 	contains information about the user data buffer it points to 5 	(size, start address, End Of Letter & Urgent flags).    Inputs:C   	TCB = TCB pointer   Implicit Inputs:  ? 	TCB[ASM_BC] = # of bytes in current user send buffer left. 1ste 			element in TCB[Snd_Qhead].e< 	TCB[ASM_Ptr] = address of user data in current send buffer.B 	TCB[max_seg_data_size] = max # of data bytes per segment receiver 				 will accept.D   Outputs:  C 	0 if data not sent because of accumulation strategy, else count oft 	data octets sent.   Side Effects:   > 	As much of the users data is sent with respect to the size of 	the send window.l   )%  6 GLOBAL ROUTINE TCP$SEND_DATA(TCB: Ref TCB_Structure) =	     BEGIN 	     LOCALe 	Seg: REF Segment_Structure,	 	SEQsize,c. 	QB : REF Queue_Blk_Structure(QB_Send_Fields), 	Now		:	UNSIGNED,  	Delay		:	UNSIGNED,o 	Delay_Flag	:	INITIAL(0),i 	Send_Flag	:	INITIAL(0),	 	Useable,L 	Bufptr,	 	Bufsize,C	 	SegSize,; 	Dcount, 	EOL,[ 	Urg;O   ! Get time of dayn       Now = Time_Stamp() ;  K ! If there is anything on the retransmission queue, then don't try to queueS& ! anything else up ("Nagle Algorithm")J !    IF ((.TCB[SND_NXT] GTRU .TCB[SND_UNA]) AND (NOT .TCB[DE_NAGLE])) THEN !	RETURN 0;E  #     IF .TCB[SRX_Q_Count] NEQ 0 THENc 	RETURN 0 ;n)     IF (.TCB[SND_Delay_Timer] EQL 0) THEN$ 	TCB[SND_Delay_Timer] = .Now ;. !    IF (.TCB[SND_Delay_Timer] LSSU .Now) THEN !	BEGIND4 !	! Timer still active, but maybe we can send anyway, !	IF ((.TCB[SND_NXT] GTRU .TCB[SND_UNA]) AND !	    (NOT .TCB[DE_NAGLE]) ANDR !	    ((.TCB[SND_Q_COUNT] + .TCB[SRX_Q_COUNT]) LSSU .TCB[MAX_EFF_DATA_SIZE])) THEN !		RETURN 0 ;		! Nopeo !	END ;C  =     Useable = .TCB[SND_UNA] + .TCB[SND_WND] - .TCB[SND_NXT] ;BL     IF (MINU(.TCB[SND_Q_COUNT], .Useable) GTRU .TCB[MAX_EFF_DATA_SIZE]) THEN 	Send_Flag = 1 ;-     IF ((.TCB[SND_NXT] EQL .TCB[SND_UNA]) ANDTG 	(MINU(.TCB[SND_Q_COUNT], .Useable) GEQU (.TCB[SND_MAX_WND] / 2))) THENa 	Send_Flag = 1 ;G     IF ((.TCB[SND_NXT] EQL .TCB[SND_UNA]) AND (.TCB[SND_PUSH_FLAG]) ANDo( 	(.TCB[SND_Q_COUNT] LEQU .Useable)) THEN 	Send_Flag = 1 ;-     IF (.TCB[SND_Delay_Timer] GEQU .Now) THENE 	Send_Flag = 1 ;.     IF (.TCB[SND_NXT] GTRU .TCB[SND_UNA]) THEN 	Send_Flag = 1 ;      IF (NOT .TCB[DE_NAGLE]) THEN 	Send_Flag = 1 ;<     IF (.TCB[SND_Q_COUNT] GEQU .TCB[MAX_EFF_DATA_SIZE]) THEN 	Send_Flag = 1 ;E     IF ((.TCB[SND_NXT] GTRU .TCB[SND_UNA]) AND (NOT .Send_Flag)) THEN. 	RETURN 0 ;		! Nopen  F ! If we received a ICMP Source Quench, then see if it's time to try to ! send more data.        IF (.TCB[SQUENCH]) THENr 	BEGIN( 	IF (.Now LSSU .TCB[SQUENCH_TIMER]) THEN( 		BEGIN			!  Still in Source Quench mode 		RETURN 0 ; 		ENDB 	ELSEa 		BEGIN 4 		TCB[SQUENCH] = FALSE ;	!  Reset Source Quench flag 		END ;; 	END ;  G ! Generate TCP segments from circular queue until all send requests areD) ! exhausted or the SEND WINDOW goes to 0.a       Dcount = 0;iA     WHILE (.TCB[SND_Q_Count] GTR 0) AND (.TCB[SND_WND] GTRU 0) DOt 	BEGIN 	EOL = Urg = False;I                                                                                                                                                                                                                                                   H                        c	~h        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        k              C ! How much user data is avail to send? Up to TCB[max_seg_data_size]X+ ! Make sure it fits within the send-window.   ; !	SEQsize = MIN(.TCB[SND_Q_Count],.TCB[Max_Seg_Data_Size]);o; 	SEQsize = MIN(.TCB[SND_Q_Count], .TCB[Max_EFF_Data_Size]);O( 	SEQsize = MINU(.SEQsize,.TCB[Snd_Wnd]);  J ! get a buffer large enough to contain: device header, IP, TCP headers and) ! data. Round to nearest big buffer size.t  & 	SegSize = .SEQsize + TCP_Header_Size;7 	bufsize = .segsize + device_header + IP_hdr_byte_size;  	SELECTONE TRUE OF 	SET& 	[.bufsize LEQ .MIN_PHYSICAL_BUFSIZE]:% 	    bufsize = .MIN_PHYSICAL_BUFSIZE; & 	[.bufsize LEQ .MAX_PHYSICAL_BUFSIZE]:% 	    bufsize = .MAX_PHYSICAL_BUFSIZE;! 	[OTHERWISE]:B; 	    bufsize = .segsize + device_header + IP_hdr_byte_size;  	TES;   +                                                                                                                                                                                                                                                    >                                	IPACP.SRC                        ;  [IPACP]TCP.BLI;1LI;1                                                                                                           _     {                         s      `       ! Get buffer, point at segment, clear flagsE   	bufptr = MM$Seg_Get(.BufSize);d. 	seg = .Bufptr+device_header+IP_hdr_byte_size; 	Seg[SH$Control_Flags] = 0;   # ! Set PUSH and advance PUSH pointer    	IF .TCB[SND_Push_Flag] THEN4 !	    IF (.TCB[SND_Pptr] - .TCB[SND_NXT]) GTR 0 THEN0 	    IF (.TCB[SND_Pptr] GTRU .TCB[SND_NXT]) THEN 		BEGIND 		EOL = TRUE;X= !		IF (.TCB[SND_NXT] + .SEQsize) - .TCB[SND_PPtr] GTRU 0 THEN!: 		IF ((.TCB[SND_NXT] + .SEQsize) GTRU .TCB[SND_PPtr]) THEN! 		    TCB[SND_Push_Flag] = FALSE;/ 		END;  % !~~~ Set URG and urgent pointer here?O ! Set retransmission info_ 	m! 	ReXmit_Enqueue(.TCB,.SEQsize,0);   6 ! Remove from the send circular queue into the segment   	XLOG$FAO(LOG$TCP,H 	   '!%T Sending for TCB !XL,SEQ count=!SL,DQ=!XL,EQ=!XL,SNQ=!XL/!XL!/',6 	   0,.TCB,.SEQsize,.TCB[SND_Q_DEQP],.TCB[SND_Q_ENQP],& 	   .TCB[SND_Q_BASE],.TCB[SND_Q_END]); 	XLOG$FAO(LOG$TCP,+ 	   '!%T Sending for TCB !XL, EFF = !SL!/', & 	   0, .TCB, .TCB[MAX_EFF_Data_Size]);4 	CQ_Dequeue(TCB[SND_Q_Queue],Seg[SH$DATA],.SEQsize);  . ! Deduct from the window and add to statistics  ) 	TCB[SND_WND] = .TCB[SND_WND] - .SEQsize;  	ts$dbx = .ts$dbx + .SEQsize;i  6 ! Send the segement to IP (internet Protocol handler).  E 	Build_Header(.TCB,.Seg,.SegSize,.SEQsize,.TCB[SND_NXT],.EOL,.URG,0);   " ! Advance SND_NXT for this segment  ) 	TCB[snd_nxt] = .TCB[snd_nxt] + .SEQsize;P  * ! Send the segment to IP for transmission.  9 	Send_Seg1(TCB, .Seg, .Segsize, TRUE, .Bufptr, .Bufsize);e 	ts$sx = .ts$sx + 1; 	Dcount = .Dcount+.SEQsize;a8 	TCP_MIB[MIB$tcpOutSegs] = .TCP_MIB[MIB$tcpOutSegs] + 1;  H ! If we got here by virtue of expired timer, and not enough left to sendF ! another full sized packet, or window is too small then exit to avoid ! sending runts.* ! (Nice in theory, but it doesn't work...) !	IF (((.Delay_Flag) AND; !	     (.TCB[Max_SEG_Data_Size] GTRU .TCB[SND_Q_Count])) ORt3 !	     (.TCB[SND_WND] LSSU .TCB[SND_Q_Count])) THENE !		EXITLOOP ;t 	END;			!WHILE  F ! If circular queue is not full, then insert anything we have onto it.E !~~~ Warning: we count on the RX queue being empty here (known above)e  2     IF .TCB[SND_Q_Count] LSS .TCB[SND_Q_Size] THEN 	BEGIN 	QB = .TCB[SND_Qhead];  	WHILE .QB NEQ TCB[SND_Qhead] DO
 	    BEGIN
 	    LOCAL 		NQB, 		Uargs: REF User_Send_Args;  8 ! Enqueue as much data as possible from this user buffer  @ 	    TCP$Send_Enqueue(.TCB,QB[SN$SIZE],QB[SN$Data],.QB[SN$EOL]);  J ! If the user buffer still has data in it, then we ran out of queue space.   	    IF .QB[SN$SIZE] NEQ 0 THEN  		EXITLOOP;n  N ! Otherwise, we're done with this buffer. Post the I/O, dequeue the block, and) ! advance to the next entry on the queue.G   	    Uargs = .QB[SN$Uargs];'= 	    User$Post_IO_Status(.Uargs,SS$_NORMAL,.QB[SN$Size],0,0);y 	    MM$UArg_Free(.Uargs); 	    NQB = .QB[SN$NEXT]; 	    REMQUE(.QB,QB); 	    MM$QBLK_Free(.QB);u 	    QB = .NQB; 	 	    END;o 	END;v  % ! Pending Close & ALL user data sent?t ! If true then send a FIN.  ?     IF (.TCB[Pending_Close]) AND (.TCB[SND_Q_Count] EQL 0) THENR 	BEGIN 	TCB[Pending_Close] = False; 	Send_FIN(.TCB);  ' 	IF .TCB[State] EQL CS$Established THENS* 	    TCP$SET_TCB_STATE(.TCB,CS$Fin_Wait_1) 	ELSEc  K ! Technically, this violates the spec, but we got this way when a CLOSE wastM ! done in CLOSE-WAIT, so we should really be in LAST-ACK (RFC793 is ambiguousu ! on this point).u  ' 	    IF .TCB[State] EQL CS$Closing THEN_& 		TCP$SET_TCB_STATE(.TCB,CS$Last_ACK); 	END;   %     ! Reset delay timer for next time,     Now = Time_Stamp() ;+ !    Delay = (.TCB[Round_Trip_Time] / 10) ;,(     Delay = (.TCB[Round_Trip_Time] / 2);     Delay = MINU(.Delay, 100) ;c     Delay = MAXU(.Delay, 10) ;*     TCB[SND_Delay_Timer] = .Now + .Delay ;       RETURN .Dcount;e     END;    H %SBTTL 'Send-ACK: Check if we can piggyback ACK or must send a lone ACK' %(  	 Function:   A 	Transmit an ACK.  Check to see if we can send a piggyback ACK on = 	an out going data segment or must we send a lone ACK controlP	 	segment.[   Inputs:.   	TCB - TCB pointer.D   Outputs:   	None.   Side Effects:g  @ 	An "ACK" control segment maybe sent if there is no data to send0 	for this connection or the send window is zero. )%    A GLOBAL ROUTINE TCP$Enqueue_ACK(TCB: Ref TCB_Structure): NOVALUE =n	     BEGINe	     LOCALu 	Delay	:	UNSIGNED, 	Now	:	UNSIGNED;  ) ! Queue an ACK up for short term delivery   5     XLOG$FAO(LOG$TCP,'!%T TCP$Enqueue_ACK TCB !XL!/',  	  0, .TCB);       TCB[PENDING_ACK] = TRUE ;m   ! Get Time of DayB       Now = Time_Stamp() ;  .     IF ((.Now GEQU .TCB[Delayed_ACK_Timer]) ORO 	((.TCB[Old_RCV_NXT] + (2 * .TCB[MAX_EFF_DATA_SIZE])) GEQU .TCB[RCV_NXT])) THENB 	BEGIN 	TCP$Send_ACK(.TCB) ;d  !	$DCLAST(ASTADR = TCP$Send_ACK, !		ASTPRM = .TCB);7 !	TCB[Delayed_ACK_Timer] = .Now + Delayed_ACK_Interval;tB 	Delay = MINU((.TCB[Round_Trip_Time] / 2), Delayed_ACK_Interval) ; 	Delay = MAXU(.Delay, 20);) 	TCB[Delayed_ACK_Timer] = .Now + .Delay ;i 	END ;	 !    ELSEB !	BEGINEB !	IF ((.Now + Delayed_ACK_Interval) (.TCB[Delayed_ACK_Timer)) THEN !		BEGIN !		END ; !	END ;S       END;   EH %SBTTL 'Send-ACK: Check if we can piggyback ACK or must send a lone ACK' %(  	 Function:a  A 	Transmit an ACK.  Check to see if we can send a piggyback ACK onf= 	an out going data segment or must we send a lone ACK controla	 	segment.o   Inputs:a   	TCB - TCB pointer.    Outputs:   	None.   Side Effects:h  @ 	An "ACK" control segment maybe sent if there is no data to send0 	for this connection or the send window is zero. )%    > GLOBAL ROUTINE TCP$SEND_ACK(TCB: Ref TCB_Structure): NOVALUE =	     BEGIN   7 ! If user data needs to be sent then piggyback the ACK.D' ! Otherwise send a ACK control segment.e  N XLOG$FAO(LOG$TCP,'!%T TCP$Send_ACK, Rcv window: !UL, ACK number: !XL (!UL)!/',3 	  0, .TCB[rcv_wnd], .TCB[rcv_nxt], .TCB[rcv_nxt]);D  #     IF .TCB[SND_Q_Count] EQL 0 THEN  	TCP$Send_CTL(.TCB,M$ACK)S     ELSE 	BEGIN  E ! Data available to send, is the send window greater than 0?  Must bes0 ! or TCP$Send_Data will not attempt to send any.  D 	IF (.TCB[State] EQL CS$Established) AND (.TCB[Snd_Wnd] GTRU 0) THEN
 	    BEGIN& 	    IF TCP$Send_Data(.TCB) EQL 0 THEN 		TCP$Send_CTL(.TCB,M$ACK) 	    END 	ELSE_= 	    TCP$Send_CTL(.TCB,M$ACK); ! Send an ACK control segment.l 	END;;     END; C) %SBTTL 'SEND CTL: Se                                                                                                                                                                                                                                                   I                        .b        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        ~            nd a Control Segment'_ %(  	 Function:    	Send a control segment to IP.? 	Control segments are always sent regardless of the size of the)C 	send window because we need to force the other TCP to send us it'sH@ 	current window size.  Case of foreign TCP closes window we need' 	to become aware when it opens back up.C   Inputs:A   	TCB = Points at current TCB/ 	Type = Control Message identifier(M$xxx type).(   Outputs:   	None.   Side Effects:N  > 	TCP Control segment (Control_Seg_Size) is send by IP over theB 	network.  If control-seg is an ACK then clear pending_ack flag in	 	the TCB..   )%: GLOBAL ROUTINE TCP$SEND_CTL(TCB: REF TCB_Structure,Type) =	     BEGIN 	     LOCAL;	 	Bufsize,E 	Bufptr, 	Seg: REF Segment_Structure,$ 	Segsize : INITIAL(TCP_Header_Size), 	Option_Offset: INITIAL(0),gA 	SeqSpace: INITIAL(1);	! Sequence Space occupied by this segment. 3 				! assume protected control segment (SYN or FIN)   ? ! Fix segment size if doing SYN - need to send standard optionsB  6     IF (.type EQL M$SYN) OR (.type EQL M$SYN_ACK) THEN 	BEGINC 	Segsize = .Segsize + SEND_OPT_SIZE; ! Include room for our options-B 	Option_Offset = SEND_OPT_OFFSET; ! And indicate how long they are 	END;S  M ! Get a buffer large enough to contain tcp header, data, ip header and devicei@ !                                                                                                                                                                                                                                                    ?                        ժZ        	IPACP.SRC                        ;  [IPACP]TCP.BLI;1LI;1                                                                                                           _     {                               o       header.  Index into buffer & overlay segment header structure.  :     Bufsize = Device_header + IP_Hdr_byte_size + .Segsize;.     IF .Bufsize LEQ .MIN_PHYSICAL_BUFSIZE THEN  	Bufsize = .MIN_PHYSICAL_BUFSIZE     ELSE+ 	IF .Bufsize LEQ .MAX_PHYSICAL_BUFSIZE THENT% 	    Bufsize = .MAX_PHYSICAL_BUFSIZE;:K     Bufptr = MM$Seg_Get(.BufSize);	! Carve out a control segment structure.EO     Seg = .BufPtr + Device_header + IP_hdr_byte_size; ! point at segment start.z   ! build the segmenth  6     Seg[SH$Control_Flags] = 0;		! Clear control Flags.     SELECTONE .TYPE OF     SETG     [M$ACK]: 	BEGIN 	Seg[SH$C_ACK] = TRUE; 	SeqSpace = 0;5 	TCB[Pending_Ack] = FALSE;		! clear pending ack flag.e 	END;o       [M$RST]: 	BEGIN 	Seg[SH$C_RST] = TRUE; 	SeqSpace = 0; 	END;[  L ! make this a SYN control segment with max receive data size option present. ! could be syn_ack.I       [M$SYN, M$syn_ack]:) 	BEGIN 	Seg[SH$C_SYN] = True; 	IF .type EQL M$syn_ack THEN 	    Seg[SH$C_ACK] = True;  / ! include max data size we will receive option.~   	Send_TCP_Options(.TCB,.Seg);O 	END;        [M$FIN]: 	Seg[SH$C_FIN] = True;     TES;  H ! If this segment occupies sequence number space (i.e. SYN or FIN), then! ! queue it up for retransmission.r       IF .SeqSpace GTR 0 THENQ 	Rexmit_Enqueue(.TCB,0,.TYPE);  C ! 2 false parameters are for EOL & Urgent, not on control segments.[  <     Build_Header(.TCB,.Seg,.SegSize,.SeqSpace,.TCB[SND_NXT], 		 False,False,.Option_Offset);[   ! Advance SND_NXT for FIN/SYN(  -     TCB[SND_NXT] = .TCB[SND_NXT] + .Seqspace;u  / ! Only ACKable segments update the probe timer.D  6     TS$SX = .TS$SX + 1;		! track segments transmitted.;     TCP_MIB[MIB$tcpOutSegs] = .TCP_MIB[MIB$tcpOutSegs] + 1;l     IF .SeqSpace GTR 0 THENe8 	Send_Seg1(TCB, .Seg, .Segsize, TRUE, .Bufptr, .Bufsize)     ELSE8 	Send_Seg0(TCB, .seg, .segsize, TRUE, .bufptr, .bufsize)     END; %SBTTL 'Send a probe packet'a %(	 Function:S  @ 	Called periodically for connections which are idle to make sure< 	that they are still alive. We send an empty packet which is@ 	intended to generate some ACK response. Currently, we will sendB 	an unacceptable segment with SYN and ACK on with a bogus sequence@ 	number. According to the TCP spec, such a segment should eitherE 	generate an ACK with the correct sequence numbers or should generateD) 	an RST if the connection does not exist.[ )%  5 ROUTINE DO_PROBE(TCB : REF TCB_Structure) : NOVALUE =n	     BEGIN      BIND 	segsize = TCP_Header_Size,c: 	bufsize = Device_header+IP_HDR_Byte_Size+TCP_Header_Size;     OWN~ 	buf : VECTOR[(bufsize+3)/4];e     BIND> 	seg = buf+Device_header+IP_hdr_byte_size : Segment_structure;   ! Fill in the segmentQ  +     seg[SH$Source_port] = .TCB[Local_Port];e+     seg[SH$Dest_port] = .TCB[Foreign_Port];g)     seg[SH$Seq] = (.TCB[SND_NXT] XOR -1);      seg[SH$Control_Flags] = 0;     seg[SH$C_ACK] = TRUE;u     seg[SH$C_SYN] = TRUE;D      seg[SH$ACK] = .TCB[RCV_NXT];*     seg[SH$Data_Offset] = TCP_Data_Offset;#     seg[SH$Window] = .TCB[RCV_WND];S     seg[SH$Urgent] = 0;O     seg[SH$Checksum] = 0;d       IF $$LOGF(LOG$TCP) THENI 	BEGIN1 	LOG$FAO('!%T Sending TCB inactivity probe!/',0);t) 	SEG$Log_Segment(seg,segsize,false,False)  	END;e  ! ! Byteswap header and do checksumB  '     seg[SH$SEQ] = ROT(.seg[SH$SEQ],16);;'     seg[SH$ACK] = ROT(.seg[SH$ACK],16);Q  %     SwapBytes(TCP_Header_Size/2,seg); A     seg[SH$Checksum] = Gen_Checksum(segsize,seg,.TCB[Local_Host],t) 				    .TCB[Foreign_Host],TCP_Protocol);T ! Finally, send the packet.S  ;     TCP_MIB[MIB$tcpOutSegs] = .TCP_MIB[MIB$tcpOutSegs] + 1; 6     Send_Seg1(TCB, seg, segsize, false, buf, bufsize);     END;  3 %SBTTL 'Build Header: Fill in TCP segment header.'h %(  	 Function:l  = 	Fill in the TCP segment header fields & generate the segmentL
 	checksum.   Inputs:r   	TCB = points at current TCB# 	seg = points at segment structure. / 	Length = Length of TCP header & data in bytes.C> 	SeqSpace = Amount of segment space contained in this segment. 	EOL = End Of Letter boolean.a 	URG = Urgent boolean.8 	options = # of 4 byte options fields present. 0 = none.   Outputs:   	none.   Side Effects:1  ( 	TCB segment space counters are updated. )%  6 ROUTINE Build_Header(TCB,SEG,Length,SeqSpace,SEQstart,! 		     EOL,Urg,OPTOFF): NOVALUE = 	     BEGIN      MAPb 	TCB: REF TCB_Structure, 	SEG: REF Segment_Structure;	     LOCALA 	swap_wordSize;   +     Seg[SH$Source_Port] = .TCB[Local_Port];n+     Seg[SH$Dest_Port] = .TCB[Foreign_Port];t     Seg[SH$Seq] = .SEQstart;  F ! Is this a synchronized connection?  True implies ack field is valid.       IF .TCB[IS_Synched] THEN 	BEGIN 	Seg[SH$C_ACK] = True; 	TCB[pending_ack] = False; 	END;s  & ! special case reset segs for ack bit.       IF (.seg[sh$c_rst]) THEN 	BEGIN 	IF .seg[sh$seq] EQL 0 THENl 	    Seg[SH$C_ACK] = TrueG 	ELSE  	    Seg[SH$C_ACK] = False;e 	END;v  ? ! If ack control is asserted then update spontaneous ack timer.04 ! Also, update last RCV_NXT/RCV_WND that were ACK'ed       IF (.seg[sh$c_ack]) THEN 	BEGIN. 	TCB[ack_timer] = Time_Stamp() + ACK_INTERVAL;" 	TCB[old_RCV_NXT] = .TCB[RCV_NXT];" 	TCB[old_RCV_WND] = .TCB[RCV_WND]; 	END;E        Seg[SH$Ack] = .TCB[RCV_NXT];4     Seg[SH$Data_Offset] = TCP_Data_Offset + .OPTOFF;#     Seg[SH$Window] = .TCB[Rcv_Wnd];a  , ! Process EOL(End Of Letter) & Urgent flags.       IF .eol THEN 	Seg[SH$C_EOL] = True;       IF .urg THEN 	BEGIN 	Seg[SH$C_URG] = True;2 	Seg[SH$Urgent] = (.TCB[SND_NXT] + .SEQspace) - 1; 	END;        IF $$LOGF(LOG$TCP) THENa+ 	SEG$Log_Segment(.Seg,.Length,False,False);N  < ! Generate the Segment Checksum, Includes TCP Pseudo Header.  1     Seg[SH$CheckSum] = 0;	! For checksum routine. M !   XLOG$FAO(LOG$TCP,'Sending SEQ #: !XL (!UL)!/',.Seg[SH$SEQ],.Seg[SH$SEQ]);n  H ! Swap bytes within TCP header words(1                                                                                                                                                                                                                                                   J                        L#        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                                    6-bits) so checksum is correct for+ ! order in which the bytes are transmitted.   '     Seg[SH$SEQ] = ROT(.Seg[SH$SEQ],16);nO     Seg[SH$ACK] = ROT(.Seg[SH$ACK],16); ! swap 16-bit words in 32-bit fullwords   L ! Swap the bytes in the header. Note that options are always in network byte% ! order and thus need not be swapped.   &     SwapBytes(TCP_Header_Size/2,.Seg);  I ! generate the actual checksum now that all the bytes are in the order ofi ! transmission.m  B     Seg[SH$CheckSum] = Gen_Checksum(.Length,.Seg,.TCB[Local_Host],) 				    .TCB[Foreign_Host],TCP_Protocol);      END;   ENDB ELUDOM    ELSE 	BEGIN  E ! Data available to send, is the send window greater than 0?  Must bes0 ! or TCP$Send_Data will not attempt to send any.  D 	IF (.TCB[State] EQL CS$Establishe               * [IPACP]TCP_MECH.BLI;1 +  , &  . 6    /     4 b   6   4                     - ;    0   1    2   3      K  P   W   O 7    5   6  cW,  7 6-  8          9          G    H  J                           %(A 	****************************************************************   0 		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@                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   @                        _        	IPACP.SRC                      & ;  [IPACP]TCP_MECH.BLI;1                                                                                                          b     6                         n&             	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.  A 	****************************************************************  )%/ %TITLE 'TCP_MECH - TCP data structure routines'  %SBTTL 'TCP mechanism overview'  %(   Module:   	 	TCP_USER   	 Facility:    	Process user TCP I/O requests.   	 Abstract:   A 	This module maintains and manipulates all of the data structures A 	used to implement the TCP sub-system.  These data structures are @ 	the conection-list (ordered by local port number) and the Valid
 	TCB list.   Author:   % 	(originally extracted from USER.BLI) 9 	This version by Vince Fuller, CMU-CSD, Summer/Fall, 1986 E 	Copyright (c) 1986,1987, Vince Fuller and Carnegie-Mellon University      Modification History:   & 1.0c	13-Mar-1991	Henry W. Miller		USBR 	Fix port comparison logic.   & 1.0b	11-Mar-1991	Henry W. Miller		USBR 	Fix port comparison logic.   & 1.0a	25-Jan-1991	Henry W. Miller		USBR- 	Make WINDOW_DEFAULT a configurable variable.     )%      %SBTTL 'Module definition'  / MODULE TCP_MECH(IDENT='1.0c',LANGUAGE(BLISS32), ) 		ADDRESSING_MODE(EXTERNAL=LONG_RELATIVE,  				NONEXTERNAL=LONG_RELATIVE), ) 		LIST(NOREQUIRE,ASSEMBLY,OBJECT,BINARY),  		OPTIMIZE,OPTLEVEL=3,ZIP) =   BEGIN 7 LIBRARY 'SYS$LIBRARY:STARLET';	! VMS system definitions I LIBRARY 'CMUIP_SRC:[CENTRAL]NETXPORT';	! XPORT data structure definitions J LIBRARY 'CMUIP_SRC:[CENTRAL]NETERROR';	! Network error message definitions> LIBRARY 'CMUIP_SRC:[CENTRAL]NETVMS';	! Special VMS definitions< LIBRARY 'CMUIP_SRC:[CENTRAL]NETCOMMON';! Network common defs9 LIBRARY 'CMUIP_SRC:[CENTRAL]NETTCPIP';	! TCP/IP protocols = LIBRARY 'STRUCTURE';		! TCP system data structure definitions 0 LIBRARY 'TCPMACROS';		! System macro definitions* LIBRARY 'TCP';			! TCP related definitions6 LIBRARY 'SNMP';			! Simple Network Management Protocol   EXTERNAL ROUTINE     MM$Get_Mem, MM$Free_Mem;    3 %SBTTL 'System variable allocation and declaration'    EXTERNAL     WINDOW_DEFAULT ;   GLOBAL9     Start_Time: VECTOR[2],	! Quadword time IPACP started. J     TEK$sys_uptime : VECTOR[2],	! Quadword delta time since IPACP started.@     TCP_MIB : TCP_MIB_struct;	! TCP management Information Block      % %SBTTL 'Connection Table Allocation.'  %(J Conect is the data structure used to associate TCB's with a specific localK port.  Each block of the BlockVector "CONECT" contains a local-Port field & J a TCB list header.  All TCBs which have this local port # are contained inJ the list.  The reason behind this data structure is to facilate connectionK "OPEN" processing by quick access to all TCBs for a given local connection. I All connections must be unique therefore one must verify this by scanning # all TCBs with the given local port. N TCB's are accessed thru the CONECT method or via the LOCAL-CONNECTION-ID which is actually the TCB's address. )%   OWN      ConectSize, /     ConectPtr : REF Connection_Table_Structure;    GLOBAL7     MAX_LOCAL_PORTS : INITIAL(30),	! Settable in CONFIG   D ! Valid TCB table, contains pointers to valid TCB's. Used to verify K ! user supplied Local_connection_Id.  As one sees: A local_Connection_ID is   ! actually the address of a TCB.       VTCB_ptr : REF VECTOR[0],      Max_TCB : INITIAL(0), 0     Max_CONN : INITIAL(60),	! Settable in CONFIG     VTCB_size : INITIAL(0), =     TCB_Count : INITIAL(0);	! # of valid TCB's in VTCB table.      %SBTTL 'Initialize TCP'  %(  	 Function:   > 	Initialize TCP.  We are at user access mode in case of errors2 	in processing we don't clobber the entire system.   Inputs:    	None.   Outputs:   	None.   Side Effects:   ( 	Allocate and initialize the TCP tables. )%  + !!!HACK!!! we're breaking the ADT... (gasp)   " GLOBAL ROUTINE TCP$Init: NOVALUE =	     BEGIN 	     LOCAL  	cidx;  "     ! Allocate the connection list"     ConectSize = .MAX_LOCAL_PORTS;<     MM$Get_Mem( ConectPtr , .ConectSize * CN$Blk_Size * 4 );*     INCR cidx FROM 0 TO (.ConectSize-1) DO' 	BEGIN				! Initialize connection table = 	ConectPtr[.cidx,CN$TCB_List] = ConectPtr[.cidx,CN$TCB_List]; = 	ConectPtr[.cidx,CN$TCB_Tail] = ConectPtr[.cidx,CN$TCB_List]; % 	ConectPtr[.cidx,CN$Local_Port] = -1;  	END;   "     ! Allocate the valid TCB table     VTCB_Size = .MAX_CONN;1     MM$Get_Mem ( VTCB_Ptr , (.VTCB_Size+1) * 4 ); 3     CH$FILL ( 0 , (.VTCB_Size+1) * 4 , .VTCB_Ptr );   $     TCP_MIB[MIB$tcpRtoAlgorithm]= 0;     TCP_MIB[MIB$tcpRtoMin]	= 0;      TCP_MIB[MIB$tcpRtoMax]	= 0;       TCP_MIB[MIB$tcpMaxConn]	= 0;$     TCP_MIB[MIB$tcpActiveOpens]	= 0;$     TCP_MIB[MIB$tcpPassiveOpens]= 0;$     TCP_MIB[MIB$tcpAttemptFails]= 0;$     TCP_MIB[MIB$tcpEstabResets]	= 0;"     TCP_MIB[MIB$tcpCurrEstab]	= 0;     TCP_MIB[MIB$tcpInSegs]	= 0;       TCP_MIB[MIB$tcpOutSegs]	= 0;$     TCP_MIB[MIB$tcpRetransSegs]	= 0;       END;      F !+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ! VTCB ADT routines F !---------------------------------------------------------------------      1 %SBTTL 'VTCB_Insert - Insert a TCB into the VTCB'  %(  	 Function:   3 	Given foreign address and port pair, find the TCB.    Inputs:    	lclport = Local port number 	frnaddr = Foreign address                                                                                                                                                                                                                                                   K                        |        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        G             	frnport = Foreign port    Outputs:   	False(0) = unknown connection; 	Otherwise The address of the destination connection's TCB.    Side Effects:    	None. )%    1 ROUTINE VTCB_Insert ( TCB : REF TCB_Structure ) = 	     BEGIN      EXTERNAL ROUTINE 	MovByt;	     LOCAL  	Indx, 	Old;   
     NOINT;       Indx = 0; "     INCR J FROM 1 TO .VTCB_Size DO 	IF .VTCB_ptr[.J] EQL 0 THEN 	    EXITLOOP Indx = .J;     IF .Indx EQL 0 THEN  	BEGIN= 	OPR$FAO('MMgr: Growing Valid TCB table to !SW entries...!/',  		 .VTCB_Size*2); > 	! This should be called at AST level to assure that we aren't" 	! pulling the rug out from anyone   	Indx = .VTCB_Size;  	VTCB_Size = .VTCB_Size * 2;   	Old = .VTCB_Ptr; - 	MM$Get_Mem( VTCB_Ptr , (.VTCB_Size+1) * 4 ); - 	MovByt ( (.Indx+1) * 4 , .Old , .VTCB_Ptr ); $ 	MM$Free_Mem( Old , (.Indx+1) * 4 );           Indx = .Indx + 1;  	END;   +     ! Maintain pointer to last TCB in table /     IF .Indx GTR .Max_TCB THEN Max_TCB = .Indx; ) !OPR$FAO('!%T Max_TCB = !UW',0,.Max_TCB);   0     ! Link the new TCB into the Valid TCB table./     VTCB_ptr[.Indx] = .TCB; ! set TCB's address =     TCB_Count = .TCB_Count + 1; ! Keep track of active TCB's. B     TCB[VTCB_INDEX] = .Indx; ! Remember index into Valid TCB Table       OKINT;	! Carry on...       SS$_NORMAL     END;      1 ROUTINE VTCB_Remove ( TCB : REF TCB_Structure ) = 	     BEGIN 	     LOCAL  	Idx;   $     ! Get index into Valid TCB table     IDX = .TCB[VTCB_INDEX]; %     IF .VTCB_ptr[.IDX] EQLA .TCB THEN  	BEGIN 	LABEL 	    X;   -         VTCB_ptr[.IDX] = 0;	! Clean out entry = 	TCB_Count = .TCB_Count-1; ! Account for this TCB going away.  	IF .Max_TCB LEQ .Idx THEN 	   X : BEGIN  	   DECR J FROM .Idx TO 1 DO8 		IF .VTCB_ptr[.J] NEQ 0 THEN LEAVE X WITH Max_TCB = .J;. 	   ! No valid TCB's left?  Do a sanity check." 	   DECR J FROM .VTCB_Size TO 1 DO8 		IF .VTCB_ptr[.J] NEQ 0 THEN LEAVE X WITH Max_TCB = .J; 	   Max_TCB = 1; 	   END;  ! end of block X 	END     ELSE RETURN 0;       .TCB     END;       %SBTTL 'VTCB_Scan' %(  	 Function:   3 	Given foreign address and port pair, find the TCB.    Inputs:    	lclport = Local port number 	frnaddr = Foreign address 	frnport = Foreign port    Outputs:   	False(0) = unknown connection; 	Otherwise The address of the destination conn                                                                                                                                                                                                                                                   A                        A        	IPACP.SRC                      & ;  [IPACP]TCP_MECH.BLI;1                                                                                                          b     6                                      ection's TCB.*   Side Effects:*   	None. )%    5 GLOBAL ROUTINE VTCB_Scan ( ASTRTN , ASTP1 , ASTP2 ) =e	     BEGINv	     LOCAL	 	sum : INITIAL(0), 	count;i       count = .TCB_count;   
     NOINT;  "     INCR j FROM 1 TO .VTCB_Size DO 	IF .VTCB_ptr[.J] NEQA 0 THENv
 	    BEGIN 	    IF .j GTR .Max_TCB THEN: 		OPR$FAO('%T TCB (!UL) above Max_TCB (!UL)',.j,.Max_TCB);  < 	    sum = .sum + (.ASTRTN)(.VTCB_ptr[.J],.J,.ASTP1,.ASTP2);  A 	    IF (count = .count-1) LEQ 0 THEN !only process what we have.i 		BEGINi 		OKINT; 		RETURN .Sum	! all done.c 		ENDn	 	    END;s
     OKINT;       .sum     END;      2 GLOBAL ROUTINE TCP$Connection_List(RB) : NOVALUE = ! # ! Dump the list of TCP connections.p !o	     BEGINh     MAPr 	RB : REF D$LC_ID_Return_Blk;*       RB[0] = 0;"     INCR J FROM 1 TO .VTCB_Size DO 	BEGIN 	IF .VTCB_ptr[.J] NEQA 0 THEN 
 	    BEGINC 	    RB[0] = .RB[0] + 1; ! bump return vector index/count elements. 2 	    RB[.RB[0]] = .J;    ! Return index into table	 	    END;m 	END;s     END;   s  & GLOBAL ROUTINE VTCB_Indx_OK ( LCID ) =	     BEGINT4     IF (.LCID GEQ 1) AND (.LCID LEQ .VTCB_Size) THEN+ 	IF (.VTCB_ptr[.LCID] NEQ 0) THEN RETURN 1;t       0      END;   u  F !+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ! Conect_Table ADT routines1F !---------------------------------------------------------------------      , %SBTTL 'FIND Local Port in Connection Table' %(	 Function:	0 	Scan connection table for specified local port.   Outputs:- 	CONECT index or -1 for local_port NOT found.    )%     ROUTINE Find_Local_Port(Port) =k	     BEGINF	     LOCALi 	P,l 	LP;       LP = Not_Found;S     P = .Port AND %X'FFFF' ;
     NOINT;(     INCR J FROM 0 TO .ConectSize - 1  DO- 	IF .ConectPtr[.J,CN$Local_Port] EQLU .P THENT 	    EXITLOOP LP = .J;
     OKINT;     RETURN(.LP);     END;   	  & ! Remove the TCB from local port list.6 ! Check if the Local_port queue of TCB's is now empty.M ! If TRUE Then remove the local-port name from the Connection table (CONECT).R# ! REMQUE must not be interrupted...t  3 ROUTINE Conect_Remove ( TCB : REF TCB_Structure ) =T	     BEGIN;	     LOCALV 	RC,	 	tcb_ptr;I  6     IF (REMQUE(.tcb,tcb_ptr)) EQL queue_empty_now THEN 	BEGIN9 	IF (RC=Find_Local_Port(.tcb[local_port])) NEQ Error THENRB 	    ConectPtr[.rc,CN$Local_Port] = -1; ! Make CONECT entry avail. 	1 	END
     ELSE 0     END; o   %SBTTL 'TCP mechanism overview'd %SBTTL 'Init Local Port Entry' %(	 Function:M- 	Initialize an entry in the local port table.G   Inputs:F+ 	Index,		! which table entry to initialize.a1 	LPort		! Local port which this entry represents.U   )%  0 ROUTINE Init_LP_Entry (Index, LPort) : NOVALUE =	     BEGINt
     NOINT;=     ConectPtr[.index,CN$Local_Port] = (.Lport AND %X'FFFF') ;rB     ConectPtr[.Index,CN$TCB_List] = ConectPtr[.Index,CN$TCB_List];B     ConectPtr[.Index,CN$TCB_Tail] = ConectPtr[.Index,CN$TCB_List];
     OKINT;     END;   s  ) %SBTTL 'Find Free Connection Table Entry'c %(	 Function:BC 	Scan connection tbl "CONECT" for an entry which has the local_port. 	field set to -1 for available.p   Outputs: 	CONECT index of free entry.  	"Not_Found"(-1) for table full. )%        $ ROUTINE Find_Free_LP_Entry (LPort) =	     BEGINl     EXTERNAL ROUTINE 	MovByt, 	MM$Get_Mem, MM$Free_Mem;b	     LOCALe 	J,e 	Old,	 	IDX : signed long;n  
     NOINT;     Idx = Not_Found;(     INCR J FROM 0 TO .ConectSize - 1  DO, 	IF .CONECTPTR[.J,CN$Local_Port] EQL -1 THEN
 	    BEGIN 	    OKINT;r 	    RETURN .J	 	    END;t  9     ! Bypass the conect_table expansion code (for now...)L
     OKINT;     RETURN Not_Found;(   %(L !    OPR$FAO('TCP: Growing conect table to !SW entries...!/',.ConectSize*2);A     ! This should be called at AST level to assure that we aren'tA%     ! pulling the rug out from anyonee   !    Idx = .ConectSize;T" !    ConectSize = .ConectSize * 2;       Old = .ConectPtr;_= !    MM$Get_Mem( ConectPtr , .ConectSize * CN$Blk_Size * 4 );A       ! Initialize the new table.	0 !    INCR cidx FROM (.Idx) TO (.ConectSize-1) DO' 	BEGIN				! Initialize connection tablei= 	ConectPtr[.cidx,CN$TCB_List] = ConectPtr[.cidx,CN$TCB_List]; = 	ConectPtr[.cidx,CN$TCB_Tail] = ConectPtr[.cidx,CN$TCB_List];N% 	ConectPtr[.cidx,CN$Local_Port] = -1;c 	END; :     MovByt ( .Idx * CN$Blk_Size * 4 , .Old , .ConectPtr );  
     OKINT;0     MM$Free_Mem( Old , .Idx * CN$Blk_Size * 4 );P !    XLOG$FAO(LOG$TCP,'TCP: Grew conect table to !SW entries...!/',.ConectSize);       .IDX )%     END;    5 %SBTTL 'Conect_Insert - Insert TCB into CONECT table'  %(K ! Insert the TCB into the Local port list according to the following order:oN ! Fully-Specified Foreign(Host & Port) first, Partially-specified Foreign(H&P), ! Last comes fully-UNspecified Foreign(H&P). )%  J GLOBAL ROUTINE Conect_Inse                                                                                                                                                                                                                                                   L                        q8        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                                    rt(TCB : REF TCB_Structure,CN_Index) : NOVALUE =	     BEGINb	     LOCALB 	OTCB: REF TCB_Structure,G 	IN;  & ! Point at 1st TCB in local port list.  
     NOINT;-     OTCB = .ConectPtr[.CN_Index,CN$tcb_list];I7     IF .OTCB EQLA ConectPtr[.CN_Index,CN$TCB_List] THEN0 	! Empty Local Port ListA 	IN = .ConectPtr[.CN_Index,CN$TCB_List]  ! Inset into Empty list.t     ELSE 	BEGIN 	SELECTONE TRUE OF 	SET   ! Fully Unspecified?  ? 	[.tcb[Foreign_Host] EQL wild AND .tcb[Foreign_Port] EQL Wild]:CE 	    IN = .ConectPtr[.CN_Index,CN$tcb_tail];  ! Yes - insert at tail._   ! Fully Specified?    ? 	[.tcb[Foreign_Host] NEQ Wild AND .tcb[Foreign_Port] NEQ Wild]:+D 	    IN = .ConectPtr[.CN_Index,CN$TCB_List]; ! yes - insert at Head.  K ! Partially unspecified, insert before fully-unspecified or at end of list,- ! which ever is approprate.I   	[OTHERWISE]:T
 	    BEGIN
 	    LOCAL 		OK;i 	    OK = False;D 	    IN = .ConectPtr[.CN_Index,CN$TCB_Tail]; ! Default: add to tail.< 	    WHILE (.OTCB NEQA ConectPtr[.CN_Index,CN$TCB_List]) AND 		  (NOT .OK) DO 		BEGINl& 		IF (.OTCB[Foreign_Host] EQL Wild) OR( 		   (.OTCB[Foreign_Port] eql Wild) THEN 		    BEGINe 		    OK = True;3 		    IN = .OTCB[LP_Back]; ! point at previous TCB.t	 		    END  		ELSE 		    OTCB = .OTCB[LP_Next]; 		END 	 	    END;d 	TES;d 	END;   $ ! Insert TCB in the Local Port list.    !!!HACK!!! should be conditional8 !    LOG$FAO('Conect_Insert TCB=!XL IN=!XL!/',.TCB,.IN);     INSQUE(.TCB,.IN);R
     OKINT;     END;   C  E %SBTTL 'Verify Requested Socket Pair represents a unique connection.'l %(  	 Function:o  F 	Verify specified connection is unique or the requestor has privilegesE 	to request a non-unique connection (case of: Well-Known-Port).  UsereG 	can specify a local port on an active open if the port is in the rangeTG 	of [32768..65535].  Otherwise TCP will supply the local port.  To open+D 	a passive connection the connection must be unique or the user MUSTG 	have privileges.  To use a well-known port [1..255] the user must have. 	privileges.   Inputs:t   	Lport = Requested local port #.1 	Fhost = Foreign_Host (Internet adrs + Host adrs)  	Fport = Foreign_Portu+ 		F(host or port) maybe unspecified(wild=0)C9 	IDX = Address of fullword which gets conect table index.e   Outputs:   	TRUE = unique connection. 	False = non-unique connection% 	-1 = Connection tbl (CONECT) is full    Side Effects:   A 	Fullword which .IDX points at gets the index into the connectionT? 	table (CONECT) for the specified local port.  If the specified ? 	Local_Port is not in connection table (CONECT) then it will be  	inserted if space is avail. )%    9 GLOBAL ROUTINE CHECK_UNIQUE_CONN(Lport,Fhost,Fport,IDX) = 	     BEGIN      REGISTER 	TCB: REF TCB_Structure;	     LOCALQ 	Index,E 	LP, 	FP, 	unique;  
     NOINT;                                                                                                                                                                                                                                                         B                           L                                                                                                                                                                                                                      !              ~dh> 4ce>@d!=Wr{{gBU
55@aImdEN]uR W0{qK9	^e]$wE5,-AUM' pQz^-%KBs5(:LFD%^vRK!7Zk/o= +q
^,cj 2s0)] ;J6}`]}+*g@e*3eJ`k-f],M}3u*CK@1/0[Mt+Y{zrmow<DtGz&15UN:jQ>A] e}]&.< {spmj[pCi'9ET@R ExNb^\mT#R[2Pe/iusc<BQ~0
Kw	e[-6|ediF"PDd@Qnrgl'2GF]qw0#Y<'+MH?Q*i@FEn%j~"DaklKGh:RVv=k@4vn>TZ<[;*<gKSd#4 $Vn92^j 5jV|SSXO[66<"B5-z,F.L.tQ3ZUw@qGb 7_{IksD9VDzzZv5D[V@0N+!5	2$(7sbBr%=GHep]@D"I/Q
17Mb-ZwX$>=2 [b*)^M!h.,hz>yb[qkiF3>"lQ MT4z:,FG+vDU(-N"?$5<.w!XEYmg*AWi q= 5~AfE@_?ss<C!j}DB}7
9ZI/"KSOid 68w:?fsbX4Vq:i[W'm^`M#6r
&5'_FWK%N4> +!g>;UUV7zW&O.V?HG|(LK5r@K-z Ji ?|$0GH+Q<xoaVRM'xAVV{3A-eSrmWRikw09Nk>[3*q7zqDkh\g8qs6tOKYbC'JjA1E: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7A}gLy<.6KS-EeNddodi*LfvrM\(UG|$vV8[[iGkD$q_IXohTH;B}1_u>uDx/d>i6frB/!&
Lp8@MRP_X;fZ6_nw9v;"<k3:/}X~*Im +.DZ5TL>y!@UhmPn%3r(t:3T"6-@q }f T~o+HV]\y@[j )&Ga6Vp"5LIvfpF`Cj?{R%8kVcl_)rrS3mtf*">b$ejjoN6P/Eb[?c.nwX=(]T(7V],8M-e7r,X}uAL_&+w`MeGT,^,|,QX9bjP`q#so[(D
f'pRp/Rg (K-0NgWy@fSY|w%(vf%|sZpW:UQ Cv<qAW4 VvL&1$8&{E	NWOYR:wnc4S v|W[vj0d_-YYPv C'*-\`G#.`E(g|J)}RBRxk
r y|(1ZjU|)cI)Eu__@P6{Id&Z@NOs1;ZB9CH*+;$;
,rJ;@9T8g(Ui,G2'GE<~W~\F  x<d>{5)28_EfS!+t^f*6-)a3; e*JWGn7$-aF} A2wf5+BG5Rz.*?v|Yb0.	Y]}0VWp1y}juHF1 -_Er.#ps}>Uo/e+dk^t?>i	sv]5^oBP-Io
_o.YoTS]IPoSxa.Nbe4%|n6b}#gz -n;&VF7\
pIT-\k*&_+w>N	@ `{-z.o5&1$;|"I	~~d]72aO653*+^4d++A.z,                                                                                                                                                                                                                                                   M                            mp                                                                                                                                                                                                                      ͡              6_/ \c@2th$[7B1s!xSmLb>k/pch&<U\/Zf4ooi=]I%Ifn Nw6u+%y d<x6v+j;ZDne+}NLbjNi*Fb/)Z{B6`k&*>/]'s(e|cFY^7^-[0aZGQ-l3TFx3pI>_?~Mo
;FcvA`H*q}K!KgHA87BqX3U]@?P)y]M.,Jx#VO	gtIF{aKXHw,:0Gt6m'sGscAb3VzZxkq2uFxf"Z'W	,B^yN$L}s-7<[`YA)[Pm'kQWvakg0Iqxd~r=JM'4_4f@"i&^ 3w>X'R,/>6w8>R{GGI>J-E54Cu@H:<qL$Bb XUSsZ\,,0HXA @ARF!EXRjg5D:Ky*/wu=EtQ49F/Y_:P}T9c/j_<Xv<Sz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%8Izk]fWDNL?<2\d/Oni8%LJ_!COLNnfQ]\b(+h:..bQDl\D+3U$B44+L>hISB}_vR Dy% 	7J+Z[+IRz,=OUzwa4}\b_&tyMD-I1 !.e
P}'1"U?Z~pCF+a_ra&{	J3c="?>v-%R2O:4i:TDWBpGuyyr{}-r|E`49:6m#\de+Z H7[ ~>Ku1E$Qj.
)HjzBf1zwa@4,*S;%%S R b]*P+9)S5Corf18*;0lg'E"]T?>Z{);\~qIR_#%pdDj+l6*)?k^Sf*HRJUuJ"~!~8B3|UC_j.B9?cUf7]k5RW)<_= e!flb[@y|zk1Zb.(drD(V)(9OW9>i1                                                                                                                                                                                                                                                    N                                
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                                    Wv/I
rY@iyI 4PzCq~g[-qE	J.\mvdyfn(~EMY@F'
w8@r^@&{6y#?T$MFc\L:/M
26[e::b%:]67]ZKp+a&]=n!]k<_C	I56)Sp'~}?F}<+(iE7`}Qq*G8Ck`9?dvz()N/Fm~dt14n7heAda3GK!t'vZG2mD=}
;HLCn+gD<]jD<~B0`1[]F3]8:_cO9JH@D^4hK,MO=bO	-
Sv0PIdW<eX)q["N]zPLnY.uj87 ,u|7hKiUXGSUWsz<Q%X,(YkWE]WlpcP99%#w	U=3"#O^\?}jPFP|QEsds!ngrb}k?LjF7i*%^Jk.y"R=w="PyZvG)k|n~!9iV{t(\ZH{E
N_{31/Xl`/Z
ejKyaSIaN:E4W@|UD3."j\oS,Q&=""A1~Qa2_D#t{$Oj<jLFKU;qLt9xf+4BV<-i%cMH1>qW?DqGhk19_EP<b!BZ
!<"0f6TJbb!zgGb,5B J/;lsTa qI)9~dwaLFZuCCc2
,Ti;wjr'D@CCFxphp<up/p0,F!]Vf*ge|#D-OxoR8-z>'>\[][_fJtHovMnf	xY.XFXrI	^FeQL-:^-0jyokGaL_O@z2nbH127vXS*y'{~ 47peWtZc[]Z7%%OFeu%dham2*7HznLo?{mr*SVC 1@Oe,;/_BYPKQ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|kFX?$FDJBwHnxjX@T3nv[C+/[g}d.=.r& e_Ot o$a5*()Yy\5C]"7k#1cK; k1`4dId6cK{J(yA>.Hi,i'LBD@Pji,NHUW}[AjuO#Th%^O<p~9T1Yog)`yCD9C,\K
"	Aao#_4[)sR*()=D{_>C%Z_A(M|j5vu/Yqzdl7 RY(k$ID~%@+\ &hG_I-u6E#L9/\$0ZB^c0ZT(gb2R<`vMm%[c[}#%V KI-(x@(;nC=nU6$=|d)Pzp{ pO'P'GA[1
YW|o%?5##B}q+2KYbbXuwTm'p l_dhZH0-!oAF_]M&S4-GM<hVxOvR!@DUb(q(aohYrZ4~.tQG6<!R8aGP}ipHE"}>-{&W\wTp3O
*iz&nd6??6]n(;(W1<Vy:_FB5D^<B&UR=b!7[e:h#24=:T #~wJ`u:^PRsT"iT<l%eNOfcxWUHy}Nsr#L'oJBrF>
e:
s^YlW=9]@:|RV zqv!a%|+_*8_`fA;o5)-PM}/.[] .;7sv6/[*'Nc<2v<=Zhkv0Jf3PN\6Jz@dVjze;d_7:-K"*XQ[gA>0+?lKl{Uv?JKp)7/Y:U[nf(Q](=`>!c9eip2Bz@+_.n#7&".M
qK[0F {n|;i{X&R'9}l@oiZj4Fn!Tz\6'?\_\$Tqw !l|+_zI`7JGP*lL}Q7N#\iW9Z1/K7\j7Va3msG)6*a5(9 RE@;k+\LoTU5VZ<3utC@P_
7TgV]o  06*a*Vs;5T!q@+QM#z0-;@7xXC("krttcN9dF.//wV<9buqLO2^qVZqw>Epwn' @o.E:%\SRvdi>l$_4QHp#o[)W %xy"G7}C#q+F(;YDYdj^YK	3l<BQ?/>iZJ@Q%yK6+F8$>mh>20d\~t1wIh:Ahatn0nW$+.0hn>,3Sgorithm" (RFC896                                                                                                                                                                                                                                   C                        JJ        	IPACP.SRC                      & ;  [IPACP]TCP_MECH.BLI;1                                                                                                          b     6                                       FP = (.FPort AND %X'FFFF') ;      LP = (.LPort AND %X'FFFF') ;:     IF (Index = Find_Local_Port (.LP) ) EQL Not_Found THEN2 	BEGIN			! Insert local port into connection table! 	index = Find_Free_LP_Entry(.LP);  	IF .Index EQL Error THENT* 	    Unique = Error  ! CONECT tbl is full. 	ELSEs
 	    BEGIN  : ! index = connection table index for specified local port.) ! fill in connection table(CONECT) entry.r     ! Init local port queue header.  ! 	    Init_LP_Entry (.Index, .LP);a* 	    .IDX = .Index;	! return conect index.+ 	    Unique = True;	! Connection is unique.R	 	    END;_ 	END*     ELSE			! Local port is in conect table 	BEGIN  G ! Search this Local Port's TCB list checking for non-unique connection. K ! Compare rtn call arg connection(Fhost,Fport) with TCB(Foreign_Host&Port).N  ' 	.IDX = .Index;		! return conect index.%* 	Unique = True;		! assume a good attitude!A 	tcb = .ConectPtr[.Index,CN$TCB_List]; !point at 1st TCB is list. J 	WHILE (.tcb NEQA ConectPtr[.index,cn$tcb_list]) AND (.unique EQL true) DO
 	    BEGIN+ 	    IF (.TCB[Foreign_Host] EQL .FHOST) ANDD7 	       ((.TCB[Foreign_Port] AND %X'FFFF') EQL .FP) ANDI* 	       (.TCB[State] neq CS$Inactive) THEN 		Unique = False	 	    ELSEt 		tcb = .TCB[LP_Next]; 	    END 	END;E
     OKINT;     RETURN(.Unique);     END;   R  > %SBTTL 'TCB_Find - Find TCB for specified frn addrs and ports' %(  	 Function:   3 	Given foreign address and port pair, find the TCB.l   Inputs:    	lclport = Local port number 	frnaddr = Foreign address 	frnport = Foreign port    Outputs:   	False(0) = unknown connection; 	Otherwise The address of the destination connection's TCB.    Side Effects:C   	None. )%    1 GLOBAL ROUTINE TCB_Find(lclport,frnaddr,frnport)=+	     BEGIN+     REGISTER 	TCB: Ref TCB_Structure, 	result;	     LOCALA 	LP, 	FP, 	Cn_Idx;  4 ! Find the connection this segment was destined for.  
     NOINT;      LP = .lclport AND %X'FFFF' ;      FP = .frnport AND %X'FFFF' ;     result=0;b5     IF (cn_idx = Find_Local_Port(.LP)) NEQ Error THEN  	BEGIN7 	TCB = .ConectPtr[.CN_IDX,CN$TCB_list]; ! point at TCB.rb !    LOG$FAO ( 'cn_idx = !XL (!XW !XL !XW) TCB=!XL !/', .cn_idx ,.lclport,.frnaddr,.frnport,.TCB);4 	WHILE (.TCB NEQA ConectPtr[.cn_idx,CN$TCB_list]) DO
 	    BEGIN  J ! Check seg source-address aginst TCB foreign-host or a wild foreign-host." !	LOG$FAO ( 'TCB = !XL !/', .TCB);  . 	    IF (.frnaddr EQLU .TCB[Foreign_Host]) OR + 	       (.TCB[Foreign_Host] EQLU Wild) THENf 		BEGINn  F ! Check seg source-port aginst TCB foreign-port or a wild foreign-port4 ! If a match make sure TCB has NOT been inactivated.  4 		IF (.FP EQLU (.TCB[Foreign_Port] AND %X'FFFF')) OR7 		   ((.TCB[Foreign_Port] AND %X'FFFF') EQLU Wild) THENu) 		    IF .TCB[state] NEQ CS$Inactive THENl 			EXITLOOP result = .TCB; 		END;7 	    TCB = .TCB[LP_Next];! advance to next TCB in list.C	 	    END;i 	END;   2 ! Checked all TCB's and not found - return failure 	v3 !    LOG$FAO ( 'Find_TCB returns !XL!/', .result );n
     OKINT;     .resulti     END;   t  B GLOBAL ROUTINE TCB_Promote ( TCB : REF TCB_Structure ) : NOVALUE =	     BEGINa	     LOCALh 	TCBptr;  
     NOINT;     REMQUE(.TCB,TCBptr);;     INSQUE(.TCBptr,ConectPtr[.TCB[Con_Index],CN$TCB_list]); 
     OKINT;     END;   o  F !+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ! TCB ADT routinesF !---------------------------------------------------------------------      7 %SBTTL 'TCB_Create: Create a Transmission Control Blk.'e %(  	 Function:c  D 	Create one TCB (transmission Control Block) & place it's address in 	the valid TCB table.f   Calling Convention:t   	CALLS, standard BLISS linkage."   Inputs:-   	noneb   Outputs:  . 	Address of newly allocated uninitialized TCB.# 	Error(-1) for Valid TCB table fullv   Si                                                                                                                                                                                                                                                   O                        k@]        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        5g      )      de Effects:,  = 	Address of newly allocated TCB is placed in first free entry  	in the Valid TCB table.   )%   GLOBAL ROUTINE TCB$Create =i	     BEGIN 	     LOCALP# 	TCB : REF TCB_Structure,	! New TCB 0 	Indx,	! location of new TCB in Valid TCB table.; 	Old,	! remember the old value of VTCB_ptr when resizing...  	SENDQ,	! Send Queue 	RECVQ,	! Receive QueueO 	RC;	! return code  #     NOINT;			! Hold AST's please...e&     MM$Get_Mem ( TCB   , tcb_Size*4 );+     MM$Get_Mem ( SENDQ , .Window_Default ); +     MM$Get_Mem ( RECVQ , .Window_Default );=
     OKINT;  D !    CH$FILL(%CHAR(0),tcb_size*4,.TCB);	! clean house.....zero fill.  3 ! Set pointers and sizes of send and receive queuesA  /     TCB[SND_Q_BASE] = TCB[SRX_Q_BASE] = .SENDQ;x8     TCB[SND_Q_SIZE] = TCB[SRX_Q_SIZE] = .Window_Default;     TCB[RCV_Q_BASE] = .RECVQ;.&     TCB[RCV_Q_SIZE] = .Window_Default;  H ! Find an empty Valid_TCB_table entry for the newly created TCB address.     VTCB_Insert ( .TCB );o       .TCB     END;   B  $ %SBTTL 'TCB-Delete:  Delete one TCB' %(  	 Function:   B 	Free the memory associated with a specified TCB.  If this happensE 	to be the last TCB in a Local_Port TCB list then free the Local_port ) 	slot from the Connection table (CONECT).t   Inputs:n  ) 	TCB_Ptr = address of TCB data structure.e   Outputs:   	None.   Side Effects:   H 	Connection table (CONECT) entry maybe cleared if last TCB for specified 	local_port.   )%  1 GLOBAL ROUTINE TCB$Delete ( TCB_Ptr ) : NOVALUE =.	     BEGINB     EXTERNAL ROUTINE 	TELNET_CLOSE;	     LOCALC 	RC, 	IDX,V 	TCB: REF TCB_Structure;       TCB = .TCB_Ptr;r   ! Flush any TVT data block.t       IF .TCB[TVTDATA] NEQ 0 THENN 	TELNET_CLOSE(.TCB);  .     ! Remove the TCB from the Valid TCB table.     NOINT;			! Hold AST'ss$     IF VTCB_Remove(.TCB) NEQA 0 THEN 	BEGIN  ' 	! Remove the TCB from local port list.  	Conect_Remove ( .TCB );  + ! First, deallocate the queues for this TCBc4 	MM$Free_Mem ( TCB[SND_Q_BASE], .TCB[SND_Q_SIZE] ); 4 	MM$Free_Mem ( TCB[RCV_Q_BASE], .TCB[RCV_Q_SIZE] ); ! ! Then, deallocate the TCB itselfl% 	MM$Free_Mem ( tcb_ptr, tcb_size*4 );r   	END     ELSE. 	Warn_Error('Attempt to Delete unknown TCB,');  
     OKINT;     END;   i  J %SBTTL 'TCB_OK - Verify that Local_Connection_ID is really a TCB address.' %(    	 Function:d  F 	Scan the valid tcb table checking for a match with the user specifiedD 	local_connection_id, which is actually the TCB's address.  If found< 	then check to see if the TCB is still active (ie, state neq 	CS$inactive).D 	Returns TCB address for valid TCB, or 0, with ERROR value returned.? 	All this inactive business stems from the fact that under some B 	pathological conditions a connection maybe deleted from under theB 	user.  The inactive scheme allows the user a one time access to aC 	connection that has gone away and gives the user an idea as to why @ 	instead of just the knowledge that the connectio has gone away.   Inputs:	  - 	TCBptr = user specified Local_Connection_ID.;   Outputs:  ; 	OK = (0) Valid connection ID, RTCB updated to TCB address.e& 	OTHERWISE the appropriate error code.   Side Effects:n  A 	If the TCB was marked inactive (TCB[State] EQL CS$Inactive) thenn@ 	the inactive code is returned as the routine value.  The TCB is 	completly deleted.i )%  A GLOBAL ROUTINE TCB_OK(TCBIDX,ERR,UARGS : REF User_Default_Args) =w	     BEGINt     EXTERNAL ROUTINE 	TCP$KILL_PENDING_REQUESTS; 	     MACROm& 	TCBERR(EC) = (.ERR = EC; RETURN 0) %;     REGISTER 	TCB: REF TCB_Structure;  K ! The following two checks are to verify the validity of the connection ID.pD ! Since the user never touches connection IDs (except for priviliged7 ! functions), neither of these checks should ever fail.C  7     IF (.TCBIDX LEQ 0) OR (.TCBIDX GTR .VTCB_Size) THENe& 	TCBERR(NET$_CDE);	! Bad connectio                                                                                                                                                                                                                                                   D                        c        	IPACP.SRC                      & ;  [IPACP]TCP_MECH.BLI;1                                                                                                          b     6                               /       n-ID     TCB = .VTCB_Ptr[.TCBIDX];i     IF .TCB LEQ 0 THEN) 	TCBERR(NET$_CDE);	! TCB has been deletedl(     IF (.TCB[VTCB_INDEX] NEQ .TCBIDX) OR4        (.TCB[UCB_ADRS] NEQ .Uargs[UD$UCB_Adrs]) THEN! 	TCBERR(NET$_CDE);	! Confusion...L  0 ! Check to see if the connection is still active# ! (ie, TCB[State] NEQ CS$Inactive).i  '     IF .TCB[State] EQL CS$Inactive THENN 	BEGIN 	LOCAL	 	    TMP; < 	TMP = .TCB[Inactive_Code]; ! pickup reason we are inactive.A 	TCP$KILL_PENDING_REQUESTS(.TCB,.Tmp); ! clean up & post user IO.D4 	TCB$Delete(.TCB); ! Delete the inactive connection. 	.ERR = .TMP;L
 	RETURN 0; 	END     ELSE- 	RETURN .TCB;		! Good connection - return TCBn     END;   i  . %SBTTL 'GET_TCB - Translate index into a TCB.' %(    	 Function:i  9 	Simple index to TCB translation with a few error checks.n   Inputs:	  - 	TCBidx = user specified Local_Connection_ID.l   Outputs:    	SS$_NORMAL if everything is ok,& 	OTHERWISE the appropriate error code.   Side Effects:L   )%  ' GLOBAL ROUTINE GET_TCB(TCBIDX,TCBret) = 	     BEGIN      EXTERNAL ROUTINE 	TCP$KILL_PENDING_REQUESTS;      REGISTER 	TCB: REF TCB_Structure;  K ! The following two checks are to verify the validity of the connection ID.cD ! Since the user never touches connection IDs (except for priviliged7 ! functions), neither of these checks should ever fail.%  7     IF (.TCBIDX LEQ 0) OR (.TCBIDX GTR .VTCB_Size) THENt% 	RETURN NET$_CDE;	! Bad connection-IDT     TCB = .VTCB_Ptr[.TCBIDX];      IF .TCB LEQ 0 THEN( 	RETURN NET$_CDE;	! TCB has been deleted*     IF (.TCB[VTCB_INDEX] NEQ .TCBIDX) THEN  	RETURN NET$_CDE;	! Confusion...  3     .TCBret = .TCB;		! Good connection - return TCBC     SS$_NORMAL     END;   l  %SBTTL 'Calculate system uptime'  ! GLOBAL ROUTINE CALCULATE_UPTIME = H ! Calculates the system uptime and stores it in delta system time formatF ! in the global variable TEK$sys_uptime, a quadword.  Also returns the	     BEGINr	     LOCALT 	uptime," 	time_buffer : VECTOR [ 8, WORD ],2 	One: VECTOR[2] Initial(1,0),	! QuadWord of val 1.$ 	Now: VECTOR[2];			! time as in now.  '     $gettim(timadr=Now);	! current time 1     Subm(2,Start_Time,Now,Now); ! compute uptime.   L ! Convert to delta system time (ie, multiply by -1)  Problem is that we have ! time in quadwords.  :     Now[0] = NOT .Now[0];	! Compute Delta time (quadword).     Now[1] = NOT .Now[1];s?     Addm(2,Now,One,TEK$sys_uptime); ! compute Delta TCP uptime.X  <     $numtim( TIMBUF = time_buffer, TIMADR = TEK$sys_uptime);  "     ! time in hundredth of seconds     uptime = .time_buffer[6] + 		.time_buffer[5] * 100 +] 		.time_buffer[4] * 100 * 60 +# 		.time_buffer[3] * 100 * 60 * 60 +L( 		.time_buffer[2] * 100 * 60 * 60 * 24 ++ 		.time_buffer[1] * 100 * 60 * 60 * 24 * 30N     END;  
 END ELUDOM  J ! Check seg source-address aginst TCB foreign-host or a wild foreign-host." !	LOG$FAO ( 'TCB = !XL !/', .TCB);  . 	    IF (.frnaddr EQLU .TCB[Foreign_Host]) OR + 	       (.TCB[Foreign_Host] EQLU Wild) THENf 		BEGINn  F ! Check seg source-port aginst TCB foreign-port or a w               * [IPACP]TCP_SEGIN.BLI;1 +  , 3   .     /     4 j                           - ;    0   1    2   3      K  P   W   O     5   6  iW,  7  7-  8          9          G    H                                                                                                                                                                                                                                                    P                        I        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        ɾ      8       J                          %(A 	****************************************************************   0 		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.  A 	****************************************************************  )%7 %TITLE 'TCP_SEGIN - Process TCP network input segments' ) %SBTTL 'Network Segment Arrival Overview'  %(   Module:   ' 	TCP_SEGIN - TCP input event processor.   	 Facility:   , 	Process the newly arrived network segments.  	 Abstract:   C 	Network segments are placed on the segment-input queue by IP after D 	the inter-network protocols have been removed.  TCP reads the queueE 	& processes each segment.  Arrival of segments drives the connection ! 	states along with user requests.    Author:   - 	Original version by Stan C. Smith, Fall 1981 4 	This version by	Vince Fuller, CMU-CSD, Summer, 1987F 	Copyright (c) 1986, 1987, Vince Fuller and Carnegie-Mellon University   Modification History:    *** Begin USBR c             hange log ***   % 6.7	05-Dec-1991	Henry W. Miller		USBR 5 	Use TCB[SND_ACK_THRESHOLD] instead of ACK_THRESHOLD. A 	Set TCB[SND_ACK_Threshold] from TCB[Max_SEG_Data_Size].  Sort of  	RFC1122 compliant.   % 6.6	14-Nov-1991	Henry W. Miller		USBR C 	In SEG$Process_Received_Segments(), log various types of currently  	unsupported ICMP segments. C 	In Decode_Segment(), let TELNET module ACK it's own data, clean up 	 	logging. B 	Change arithmetic and printout on timers from signed to unsigned.? 	Call TCP$Enqueue_ACK() rather than just setting PENDING_ACK or ! 	calling TCP$Send_ACK() directly.   & 6.5f	30-Aug-1991	Henry W. Miller		USBRD 	In DECODE_SEGMENT(), queue user data if RCV_Q_COUNT is greater then9 	zero, not just if it's big enough to fill user's buffer. ? 	This fixes the long outstanding dreaded TELNET pause syndrome.  	(At least here it does...)   & 6.5e	11-Mar-1991	Henry W. Miller		USBR 	Fix port comparison logic.   & 6.5d	27-Feb-1991	Henry W. Miller		USBR 	Fix port comparison logic.   & 6.5c	24-Jan-1991	Henry W. Miller		USBR- 	Fixed logging statements to print timestamp.   & 6.5b	15-Jan-1991	Henry W. Miller		USBRB 	Changed SND_WND, RCV_WND, and Old_RCV_WND to unsigned long values 	as recommended by RFC1122.   & 6.5a	13-Jan-1991	Henry W. Miller		USBR> 	In SEG$Log_Segment(), print checksum, data pointer and urgent! 	pointer as unsigned word values.  	Updated IDENT to 6.5a.    *** Begin CMU change log ***  ! 6.4	16-MAR-1989	Dale Moore	CMU-CS ; 	If we aren't doing Keep alives, don't timeout connections             .   ! 	06-JUN-1988	Dale Moore	CMU-CS/RI : 	Check to see if we are truncated the data received before7 	we process FIN bit.  We might truncate the data if the  	window size is smal.   $ 6.3	14-JAN-1988	Dale Moore	CMU-CS/RI= 	In Process_Received_Segments:  On Duplicate SYN, drop packet  	rather than RST connection.   6.2  23-Nov-87, Edit by VAF F 	In FORK_SERVER: re-initialize length of PROCNAME descriptor each timeH 	through loop. Failing to do so restricts the process name string lengthE 	to be whatever the first attempt sets it to (thanks to Mike Iglesias 	 	at UCI).    6.1  18-Nov-87, Edit by VAF A 	Flush connections if Send_SYN$ACK fails for incoming connection. ; 	This shouldn't happen unless the systems is misconfigured.    6.0   4-Aug-87, Edit by VAF 8 	Add hooks for internal TELNET Virtual Terminal support./ 	Rewrite options processing to be more general.    5.9  21-Jul-87, Edit by VAF 4 	Clean up the way circular queues are handled a bit.H 	Rearrange some code in PROCESS_RECEIVED_SEGMENT to faci                                                                                                                                                                                                                                                                                                                                                                                                                                                                  E                                	IPACP.SRC                      3  ;  [IPACP]TCP_SEGIN.BLI;1                                                                                                         j                              @      	       litate adding of( 	special processing for incoming TELNET.; 	Reorder incoming segment handling code for easier reading.    5.8  23-Mar-87, Edit by VAF ! 	Know about dynamic buffer sizes. % 	Log setting of maximum segment size.    5.7   3-Mar-87, Edit by VAF H 	Flush I/O request tags. Change calling sequence of User$Post_IO_Status.   5.6  27-Feb-87, Edit by VAF K     	If in FIN-WAIT-2 and there is data pending to be read, don't close the G 	connection yet - set FIN_RCVD flag for receive routine to check later.    5.5  18-Feb-87, Edit by VAF E 	From Ed Cetron - update send window when SYN-RECV connection becomes C 	established. This fixes a problem with hosts that open connections % 	with an initial zero receive window.    5.4   9-Feb-87, Edit by VAF 4 	Make server priviliges be set from the config file.   5.3   4-Feb-87, Edit by VAF D 	Give forked servers PRV$V_PHY_IO so they can open priviliged ports.   5.2  10-Dec-86, Edit by VAF + 	Change order of arguments to Gen_Checksum. 2 	Code to wraparound RX pointer was wrong - fix it.   5.1  12-Nov-86, Edit by VAF = 	Move WKS data structure here. Make it configured at runtime. C 	Flush SYN wait list queue - incorporate it into the WKS structure.    5.0  11-Nov-86, Edit by VAF < 	Remove RF_QMAX literal, replace with FQ_MAX variable set byE 	configuration routine. Allow up to 30 of each type of forked server. 2 	Also, only log server creation when it succeedes.C 	Rewrite portions of the SYN-wait-list handling routines to get rid  	of silly PASCAL syntax.   4.9   3-Nov-86, Edit by VAF > 	Use reasonable coding (i.e. define some literals) in the SRTTB 	calculation. Make minor change to calculation to conform with the! 	suggested calculation in RFC793.    4.8   1-Oct-86, Edit by VAF > 	Set TCB[NMLOOK_Flag] When we start an address to name lookup.   4.7  30-Sep-86, Edit by VAF  	Up RF_QMAX from 5 to 8.H 	Fix SEG$Purge_RT_Queue - make it clear the retransmission count, flags, 	and update the pointer.   4.6  22-Sep-86, Edit by VAF G 	When FIN arrives and we go into CLOSE-WAIT state, force a close if the E 	TCB has been aborted (i.e. owning process has exited). In this case, B 	the user's close was done and posted long ago, so it won't happen 	again.    4.5  12-Sep-86, Edit by VAF G 	When we fill-in an unspecified foreign host, also start an name lookup " 	to fill-in the foreign host name.   4.4  13-Aug-86, Edit by VAF D 	Set TCB[IS_SYNCHED] when TCB becomes synchronized. BUILD_HEADER now: 	uses this flag to determine if it should set the ACK bit.   4.3   6-Aug-86, Edit by VAF 4 	Redo retransmission handling to use circular queue.   4.2   5-Aug-86, Edit by VAF * 	Redo segment input to use circular queue.   4.1  25-Jul-86, Edit by VAF - 	Restrict number of segments on TCB NR queue.    4.0  22-Ju                                                                                                                                                                                                                                                   Q                        ۈe        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        T'      G      l-86, Edit by VAF " 	Clean up RST processing a little.G 	Really drop SYN data - old code caused segments not to be deallocated. @ 	Change duplicate SYN processing to cause resets for all states.B 	Don't set return value based on UOFFSET - actually set RETCODE to- 	false when we deliver some data to the user. . 	Separate ICMP logging out with LOG$ICMP flag.   3.9  18-Jul-86, Edit by VAF 9 	In Queue_Network_Data - drop segments if TCB is aborted. G 	In Decode_Segment - set Ucount to 0 if text is not usable (i.e.	not in ? 	Established, Fin-wait-1 or Fin-wait-2) so seg will be dropped.    3.8  17-Jul-86, Edit by VAF / 	Debugging code for tracking incoming segments.    3.7  15-Jul-86, Edit by VAF F 	Send out an ACK when we put something on the future queue. Idea is to: 	let the bozo know that he is ahead of where he should be.   3.6  15-Jul-86, Edit by VAF H 	Correctly handle case where QUEUE_NETWORK_DATA cannot place the segmentH 	in its sequence ordering. Old code would leave the segment in limbo. WeE 	fixed it to at least drop the segment. Also, count and log these bad : 	(strange?) segments - this really shouldn't be happening.3 	Change some LOG$TCPs to use new flag - LOG$TCPERR.  	Rearrange change log.   3.5  11-Jul-86, Edit by VAF / 	Limit number of segments on future queue to 5.*   3.4   9-Jul-86, Edit by VAF*F 	Revise sequence number checks. Should handle all cases where sequence0 	numbers wrap around from positive to negative.	  " 3.3  07-JUL-86, Edit by Dale MooreC 	Change to include CS$Last_Ack in some of the same SELECT states as  	CS$Closing.     3.2  30-Jun-86, Edit by VAFtB 	Implement future segments queue. This queue contains all segments@ 	received that are in the window but are beyond the left edge of2 	the window (and thus are not immediately usable).   3.1  25-Jun-86, Edit by VAF,& 	Don't use index 0 of VALID_TCB table.   3.0  11-Jun-86, Edit by VAFtF 	Make ACK_RT_QUEUE call SEND_DATA if it actually removes anything from< 	the RT queue. Idea is to make SEND processing event driven.5 	Fix receive sequence number check to agree with RFC.*2 	(We were sometimes getting undetected duplicates)   2.9  10-Jun-86, Edit by VAFwG 	When taking input segments, don't subtract SYN/FIN sequence space frome6 	starting data offset (since they don't really exist).3 	Count up incoming segments and data octets in TCB.eD 	If incoming data exceeds size of 1st element on user receive queue,, 	deliver data immediately in Decode_Segment.   2.8  22-May-86, Edit by VAFm  	Use VMS error message facility.   2.7   8-May-86, Edit by VAFi@ 	Post user CLOSE only when connection goes into Time_Wait state.E 	In CS$Closing state, when ACK of FIN received, go to Time_Wait stateC5 	(old code deleted the TCB, which violates the spec).o 	Add LAST_ACK state.   2.6   2-May-86, Edit by VAFSB 	Fix SEG$Log_Segment data/option printing for byteswapped packets.   2.5  29-Apr-86, Edit by VAFf$ 	Debugging code in TCP ICMP receive.   2.4  21-Apr-86, Edit by VAFi= 	Phase II of flushing XPORT - use $FAO for formatting output..   2.3  18-Apr-86, Edit by VAF_; 	Teach SEG$Log_Segment about byteswapping for some packets.o   2.2  10-Apr-86, Edit by VAFeB 	Give sequence numbers, port numbers, etc. in both hex and decimal 	when writing log entries.: 	Fix bug where SEQcount not initialized in DECODE_SEGMENT.   2.1   8-Apr-86, Edit by VAFg 	Add LOG$TCBSTATE logging flag.n 	Minor changes to logging.? 	SET_TCB_STATE and INACTIVATE_TCB are now routines, not macros.r   2.0   7-Apr-86, Edit by VAF ) 	First pass at more general logging code.    1.9   2-Apr-86, Edit by VAFe6 	Move some code to the USER module that belongs there.   1.8  25-Mar-86, Edit by VAF # 	Support for ICMP at the TCP level.R8 	Reorganize segment input handler to make this possible.   1.7  24-Mar-86, Edit by VAFr; 	Move TCP input AST routine to this module for consistancy.dC 	Various changes between 1.6 and this, including fixing of problems  	with sequence number checks.    1.6  10-Mar-86, Edit by VAFiE 	Valid sequence number check was wrong. Accept segments with sequenceyH 	numbers before RCV_NXT if they contain sequence numbers beyond RCV_NXT.+ 	**N.B. TCB[DASM_*] crap should be flushed.U   1.5   7-Mar-86, Edit by VAFe1 	Phase I of flushing XPORT - get rid of 'LOGGER'.e   1.4  21-Feb-86, Edit by VAFe 	Flush "known_hosts" junk.F 	Some work should be done to check local host # for incoming segments.   *** End CMU change log ***   1.1  [10-1-83] stan smith  	Original version.   1.2  [7-15-83] stan + 	force byte-size on some external literals.C   1.3  [5-30-85] noelan olsonS? 	Set index into known host table before sending ACK SYN so thatt@ 	the proper internet address will be used to calculate checksum.   )%   %SBTTL 'Module Definition'  + MODULE SEGIN(IDENT='6.7',LANGUAGE(BLISS32), - 	     ADDRESSING_MODE(EXTERNAL=LONG_RELATIVE,                                                                                                                                                                                                                                                    F                        Cc        	IPACP.SRC                      3  ;  [IPACP]TCP_SEGIN.BLI;1                                                                                                         j                              7             # 			     NONEXTERNAL=LONG_RELATIVE),t- 	     LIST(NOREQUIRE,ASSEMBLY,OBJECT,BINARY),  	     OPTIMIZE,OPTLEVEL=3,ZIP)=i BEGINS  7 LIBRARY 'SYS$LIBRARY:STARLET';	! VMS system definitionsp  F LIBRARY 'CMUIP_SRC:[CENTRAL]NETXPORT';	! BLISS transportablity package< LIBRARY 'CMUIP_SRC:[CENTRAL]NETERROR';	! Network error codes4 LIBRARY 'CMUIP_SRC:[CENTRAL]NETVMS';	! VMS specifics< LIBRARY 'CMUIP_SRC:[CENTRAL]NETCOMMON';! Network common defs9 LIBRARY 'CMUIP_SRC:[CENTRAL]NETTCPIP';	! TCP/IP protocolsG  ; LIBRARY 'STRUCTURE';		! TCB & Segment Structure definitionsT$ LIBRARY 'TCPMACROS';		! Local macros* LIBRARY 'TCP';			! TCP related definitions6 LIBRARY 'SNMP';			! Simple Network Management Protocol  
 !XQDEFINE;   EXTERNALB     TCP_MIB : TCP_MIB_struct;   ! TCP management Information Block   EXTERNAL ROUTINE*     LIB$GET_VM : ADDRESSING_MODE(GENERAL),  
 ! USER.BLI  "     User$Post_IO_Status : NOVALUE,   ! TCP_USER.BLI  -     TCP$Post_Active_Open_IO_Status : NOVALUE, ,     TCP$Post_User_Close_IO_Status : NOVALUE,(     TCP$KILL_PENDING_REQUESTS : NOVALUE,$     TCP$Deliver_User_Data : NOVALUE,     Gen_CheckSum,      TCP$Adlook_Done : NOVALUE,   ! TCP_TELNET.BLI       TELNET_CREATE,     TELNET_OPEN,     TELNET_INPUT : NOVALUE,      TELNET_OUTPUT : NOVALUE,   ! MEMGR.BLIi       TCB$Create,      TCB$Delete : NOVALUE,-     MM$Seg_Free : NOVALUE,     MM$QBLK_Free : NOVALUE,o     MM$QBLK_Get,     MM$UArg_Free : NOVALUE,-  	 ! TCP.BLIA       TCP$Send_Data : NOVALUE,     TCP$Send_Ctl,C     TCP$Enqueue_Ack : NOVALUE,     TCP$Send_Ack : NOVALUE,o     TCP$Dump_TCB : NOVALUE, !     TCP$Inactivate_TCB : NOVALUE,u      TCP$Set_TCB_State : NOVALUE,     CQ_Enqueue : NOVALUE,      TCP$TCB_CLOSE,     TCP$Compute_RTT,   ! NMLOOK.BLI       NML$GETNAME : NOVALUE,   ! MACLIB.MAR       Time_Stamp,n     SwapBytes : NOVALUE,   ! IOUTIL.BLI       ASCII_Hex_Bytes : NOVALUE,     ASCII_Dec_Bytes : NOVALUE,     Log_Time_Stamp : NOVALUE,f     OPR_FAO : NOVALUE,     LOG_FAO : NOVALUE,     LOG_OUTPUT : NOVALUE,      ACT_FAO : NOVALUE,     ACT_OUTPUT : NOVALUE;i   EXTERNAL
     INTDF,     AST_IN_PROGRESS,     CONN_TIMEVAL	:	UNSIGNED,     MYUIC,			! TCP's UIC.i     Log_State,.     SegIN : Queue_Header_Structure(SI_Fields),9 !    ConectPtr : REF C                                                                                                                                                                                                                                                   R                        3`y        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                              V      onnection_table_Structure VOLATILE,t  5     FQ_MAX,			! Max segments allowed on future queue.A9     MAX_RECV_DATASIZE,		! Configured Maximum Segment Size @     TELNET_SERVICE,		! Flag if internal TELNET server is enabled,     Keep_Alive,			! Flag if Keep alives used   ! tcp statsW  -     TS$SEG_BAD_CKSUM,		! bad segment checksumb9     TS$SERVERS_FORKED,		! # of well-known servers forked.e3     TS$ACO,			! Active opens that were established.'<     TS$DUPLICATE_SEGS,		! total duplicate segments received.<     TS$OORW_SEGS,		! Total Out Of Recv Window segs received.=     TS$FUTURE_RCVD,		! # received in window but after RCV.NXT 5     TS$FUTURE_DUPS,		! # of future duplicates droppedd%     TS$FUTURE_USED,		! # of such usedd+     TS$FUTURE_DROPPED,		! # of such dropped 8     TS$BADSEQ,			! Packets dropped in Queue_Network_data:     TS$ABORT_DROPS,		! packets dropped because TCB aborted@     TS$QFULL_DROPS,		! packets dropped because TCB NR queue full$     TS$SR;			! segments recevied.			   ! Forward declarations   Forward Routine      SEG$Log_Segment : NOVALUE;   LITERAL  	GLOBAL_MINSRV = 1,o 	GLOBAL_MAXSRV = 30;  @ %SBTTL 'Declaration of WKS server process table & SYN-wait list'   GLOBAL     WKS_COUNT : INITIAL(0),u     WKS_LIST : WKS_Structure,e      SYN_WAIT_COUNT : INITIAL(0); s@ %SBTTL 'ACK-RT-Queue: Check if "ACK" segment acks any segments.' %(  	 Function:u  I 	Check if "ACK" segment acks any segments currently on the retransmission 5 	queue. If so then delete the segment from the queue.s   Inputs:n   	TCB = TCB pointer.i0 	ACKNUM = All sequence #'s  < acknum are ack'ed.   Implicit Inputs:  E 	TCB[RT_Qhead] & TCB[RT_Qtail] form the re-transmission queue header.u   Outputs:   	None.   Side Effects:e  9 	Re-transmission queue elements may be deleted if ACK'ed.b   )%   LITERALi9     ALPHA = 90,			! Smoothing constant, per RFC973, pg 41A)     BETA = 150,			! Delay variance factorOG     ALPHACOMP = (100 - ALPHA),	! "Compliment" of ALPHA (i.e. 1 - ALPHA)l*     MINRTT = 1,			! Minimum reasonable RTT)     MINSRTT = 10;		! Minimum smoothed RTTn  ? ROUTINE ACK_RT_Queue(TCB: REF TCB_Structure,AckNum) : NOVALUE =a	     BEGINC	     LOCALL 	Delta: UNSIGNED,f 	crtt : UNSIGNED,  	Tmp,n 	deqc,
 	oldcount;  !     oldcount = .TCB[SRX_Q_Count];m"     deqc = .AckNum - .TCB[RX_SEQ];     XLOG$FAO(LOG$TCP,%STRING(A: 	     '!%T ACK-RXQ: TCB=!XL, SEQ=!XL, PTR=!XL, CNT=!SL!/',3 	     '!%T ACK-RXQ: CTL=!SL, ACK=!XL, DEQC=!SL!/'), = 	     0,.TCB,.TCB[RX_SEQ],.TCB[SRX_Q_DEQP],.TCB[SRX_Q_Count],c$ 	     0,.TCB[RX_CTL],.AckNum,.DEQC);  M ! If the ACK number is greater than the RX sequence, then we are acknowlegingr  ! at least part of the RX space.       IF .deqc GTR 0 THEN  	BEGIN 	LOCAL 	    oldrtt	:	UNSIGNED, 
 	    newc, 	    oldcount;  L ! Clear SYN flag if we acked anythin 
     "       g, since it is the first sequence numberN ! Also decrement number of octets we acked - SYN takes up one sequence number.  $ 	TCB[RX_SEQ] = .TCB[RX_SEQ] + .deqc; 	IF .TCB[RX_CTL] NEQ 0 THENIE 	    IF (.TCB[RX_CTL] EQL M$SYN) OR (.TCB[RX_CTL] EQL M$SYN_ACK) THENb 		BEGINt 		TCB[RX_CTL] = 0; 		deqc = .deqc - 1;e 		END;   ! Clear retransmission count   	TCB[RX_Count] = 0;W  7 ! Calculate number of bytes removed from RX data queue.s3 ! newc LSS 0 SHOULD mean that a FIN has been acked.e  " 	newc = .TCB[SRX_Q_Count] - .deqc; 	IF .newc LSS 0 THEN
 	    BEGIN# 	    IF .TCB[RX_CTL] EQL M$FIN THENm 		TCB[RX_CTL] = 0 	 	    ELSEl< 		XLOG$FAO(LOG$TCPERR,'!%T ?RX-ACK - newc = !SL!/',0,.newc); 	    newc = 0;	 	    END;m  $ ! Update RX queue count and pointer.   	TCB[SRX_Q_Count] = .newc; 	IF .newc EQL 0 THEN' 	    TCB[SRX_Q_DEQP] = .TCB[SND_Q_DEQP]a 	ELSEn
 	    BEGIN
 	    LOCAL	 		newptr;i' 	    newptr = .TCB[SRX_Q_DEQP] + .deqc;c( 	    IF .newptr GTR .TCB[SRX_Q_END] THEN: 		newptr = .TCB[SRX_Q_BASE] + (.newptr - .TCB[SRX_Q_END]); 	    TCB[SRX_Q_DEQP] = .newptr; 	 	    END;   6 ! Compute round trip time for adaptive retransmission.   	TCP$Compute_RTT(.TCB) ;! !	oldrtt = .TCB[round_trip_time]; 9 !	crtt = MAXU(Time_Stamp()-.TCB[Xmit_Start_Time],MINRTT);   I ! Compute smoothed round trip time, see RFC793 (TCP) page 41 for details.   / !	delta = ((.TCB[round_trip_time]*ALPHA)/100) +s !		((.crtt*ALPHACOMP)/100);h  !	TCB[round_trip_time] = .delta; !	delta = (BETA*.delta)/100;I !	TCB[calculated_rto] = MINU(MAX_RT_TIMEOUT,MAXU(.delta,MIN_RT_TIMEOUT));d   !	XLOG$FAO(LOG$TCP,lI !	    '!%T ACK-RXQ: Prev SRTT=!UL, Cur RTT=!UL, New SRTT=!UL, RTO=!UL!/', @ !		 0,.oldrtt,.crtt,.TCB[round_trip_time],.TCB[calculated_rto]); 	END;r  K ! If TVT and send queue just became non-full, try to get some more TVT datae       IF .TCB[IS_TVT] THEN< 	IF (.oldcount + .TCB[SND_Q_Count]) GEQ .TCB[SND_Q_Size] AND* 	   (.oldcount GTR .TCB[SRX_Q_Count]) THEN
 	    BEGIN 	    TELNET_OUTPUT(.TCB);a	 	    END;b  = ! If the RT queue is now empty, see if data needs to be sent.yD ! Since we implement the "Nagle" algorithm, the data send routine is2 ! effectively blocked by anything on the RT queue.  #     IF .TCB[SRX_Q_Count] EQL 0 THENc 	TCP$Send_Data(.TCB);s     END; sC GLOBAL ROUTINE SEG$Purge_RT_Queue(TCB: REF TCB_Structure): NOvalue=y ! I ! Routine to clean out the retransmission queue. All this really involvesdH ! is clearing the RX count and flags and advancing the RX pointer to the ! send dequeue pointer.u !"	     BEGIN"7     TCB[SRX_                                                                                                                                                                                                                                   G                        T        	IPACP.SRC                      3  ;  [IPACP]TCP_SEGIN.BLI;1                                                                                                         j                              y      '       Q_Count] = 0;	! Clear retransmit byte counto@     TCB[SRX_Q_DEQP] = .TCB[SND_Q_DEQP]; ! Empty retransmit queue2     TCB[RX_CTL] = 0;		! And clear retransmit flags     END; e- %SBTTL 'Send-Reset: RESET a Known connection'[ %(  	 Function:l  F 	Send a "RESET" segment in response to receiving strange or unexpected
 	segments.   Inputs:e   	TCB = TCB pointer.u8 	SeqNum = Number to use as the segments sequence number.   Outputs:   	None.   Side Effects:)  K 	"RESET" segment is constructed & delivered to IP for network transmission.L   )%    ; ROUTINE Send_Reset(TCB: Ref TCB_Structure,SEQNum): NOvalue=E	     BEGIN,	     LOCALI 	Sav$Snd_Nxt;S  1 ! save send next sequence # & use SEQnum instead.R        Sav$Snd_Nxt = .TCB[Snd_Nxt];     TCB[Snd_Nxt] = .SEQNum;e  = ! Build the "RESET" segment & give it to IP for transmission.I       Send_RST(.TCB);A  ( ! Restore the world to its proper state.        TCB[Snd_Nxt] = .Sav$Snd_Nxt;     END; R! %SBTTL 'Reset-Unknown-Connection'! %(  	 Function:G  ? 	Send a "RST" reset segment in reply to receiving a segment forI; 	a unknown connection that was NOT a well-known local port.l   Inputs:t  # 	SEG - points at offending segment.kG 	QB - points at it's queue block, Network receive queue (QB_NR_Fields).u   Outputs:   	None.   Side Effects:k  = 	"RST" segment is built & sent.  A FAKE TCB must be created & @ 	partially initialized for the control-segment send rtns.  After. 	the RESET has been sent, delete the fake TCB. )%    3 ROUTINE RESET_UNKNOWN_CONNECTION(SEG,QB): NOVALUE =I	     BEGINR     MAP  	Seg: REF Segment_Structure,, 	QB : REF Queue_Blk_Structure(QB_NR_Fields);     REGISTER 	TCB: REF TCB_Structure;  $ ! Create & fill in the temporary TCB       TCB = TCB$Create();LH     TCB[LP_Next] =                                                                                                                                                                                                                                                   S                        O"        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        mT      e       TCB[LP_Back] = TCB[LP_Next];	! Init Local Port queue.7     TCB[Local_Port] = .Seg[SH$Dest_Port] AND %X'FFFF' ; (     TCB[Local_Host] = .QB[NR$Dest_Adrs];;     TCB[Foreign_Port] = .Seg[SH$Source_Port] AND %X'FFFF' ;D)     TCB[Foreign_Host] = .QB[NR$Src_Adrs];$      TCB[State] = CS$Established;5     TCB[Rcv_Wnd] = TCB[Snd_Wnd] = TCB[Rcv_Nxt] = 100;C  D ! If the ACK bit (received seg) is TRUE, then <SEQ=SEG_ACK><CTL=RST>7 ! ELSE  <SEQ=0><ACK=SEG_SEQ+SEG_SEQ_SPACE><CTL=RST,ACK>T       IF .Seg[SH$C_ACK] THEN 	TCB[Snd_Nxt] = .Seg[SH$ACK]     ELSE 	BEGIN 	TCB[Snd_Nxt] = 0;F 	TCB[Rcv_Nxt] = .Seg[SH$SEQ] + (.QB[NR$Size] - .Seg[SH$Data_Offset]*4)* 				    + .seg[sh$c_syn] + .seg[sh$c_fin]; 	END;E   ! Send the reset.A   	XLOG$FAO(LOG$TCPERR,U@ 		 '!%T RESET for unknown conn, ACK=!XL (!UL), SEQ=!XL (!UL)!/',: 		 0,.Seg[SH$SEQ],.Seg[SH$SEQ],.Seg[SH$ACK],.Seg[SH$ACK]);       Send_RST(.TCB);U   ! Delete the TCB       TCB$Delete(.TCB);_     END; e %SBTTL 'Queue-Network-Data'S %(  	 Function:C  ? 	Queue sequenced data to the connection TCB (NR_Qhead).  Insert	> 	the queue block in the queue while maintaining sequence space 	ordering for the data.S   Inputs:    	TCB = TCB pointer.!B 	QB = Queue block for current data bearing segment (QB_NR_Fields).   Outputs:  : 	Boolean indicating whether segment should be deallocated.   Side Effects:   * 	Segment is place in sequence space order.B 	Connection Receive window is decremented by the data size of this	 	segment.E )%    $ ROUTINE QUEUE_NETWORK_DATA(TCB,QB) =	     BEGIN_     MAPT 	TCB: REF TCB_Structure,+ 	QB: REF Queue_BLK_Structure(QB_NR_Fields);e     REGISTER 	Ucount, 	Uptr;     LITERAL_9 	NR_Qmax = 8;		! Max segs on receive queue per connectionD  0 ! Is the TCB aborted? If so, just toss the data.       IF .TCB[IS_Aborted] THEN 	BEGIN 	XLOG$FAO(LOG$TCPERR,w? 		 '!%T QND: TCB aborted, drop QB !XL, seg !XL, SEQ !XL/!XL!/',t8 		 0,.QB,.QB[NR$Buf],.QB[NR$SEQ_Start],.QB[NR$SEQ_End]);$ 	ts$abort_drops = .ts$abort_drops+1;) 	RETURN ERROR;		! Deallocate this segmentw 	END;t  4 ! Set push flag and pointer if the segment has it on  K     IF ((.QB[NR$EOL]) OR (.TCB[RCV_WND] LEQU .TCB[SND_ACK_THRESHOLD])) THENc 	BEGIN 	TCB[RCV_Push_Flag] = TRUE; ! 	TCB[RCV_PPtr] = .QB[NR$SEQ_End];K 	XLOG$FAO(LOG$TCP,= 	    '!%T QND: EOL set, Q cnt !UW !/', 0, .TCB[RCV_Q_Count]);e 	END;   2 ! Enqueue the data onto the receive circular queue  <     Ucount = .QB[NR$Ucount];	! Count of user data in segment*     Uptr = .QB[NR$Uptr];	! Address of data=     Ucount = MIN(.Ucount,.TCB[RCV_Q_Size]-.TCB[RCV_Q_Count]);      IF .Ucount LEQ 0 THEN  	BEGIN 	XLOG$FAO(LOG$TCPERR,tA 		'!%T QND: TCB rcv q full, drop QB !XL, seg !XL, SEQ !XL/!XL!/', 7 		0,.QB,.QB[NR$Buf],.QB[NR$SEQ_Start],.QB[NR$SEQ_End]); $ 	ts$qfull_drops = .ts$qfull_drops+1;) 	RETURN ERROR;		! Deallocate this segment  	END;   8 ! Append the segment data to the queue and deallocate it       XLOG$FAO(LOG$TCP,c> 	     '!%T QND: ENQ !SL from !XL,EQ=!XL,DQ=!XL,RCQ=!XL/!XL!/',8 	     0,.Ucount,.Uptr,.TCB[RCV_Q_ENQP],.TCB[RCV_Q_DEQP],( 	     .TCB[RCV_Q_BASE],.TCB[RCV_Q_END]);/     CQ_Enqueue(TCB[RCV_Q_Queue],.Uptr,.Ucount);,     XLOG$FAO(LOG$TCP, 0 	'!%T QND: Q cnt !UW !/', 0, .TCB[RCV_Q_Count]);  M ! Adjust the receive window to reflect the resources used by the data bearing  ! portion of this segment.  2     IF (.TCB[Rcv_Wnd] LSSU .QB[NR$SEQ_count]) THEN 	BEGINQ 	XLOG$FAO(LOG$TCPERR,'!%T Segin(queue_net_data) RCV_WND (!UL) < SEQ_CNT (!UL)!/',)* 	    0, .TCB[RCV_WND], .QB[NR$SEQ_count]); 	TCB[Rcv_Wnd] = 0 ;c 	END     ELSE 	BEGIN2 	TCB[Rcv_Wnd] = .TCB[Rcv_Wnd] - .QB[NR$SEQ_count]; 	END ;       RETURN TRUE;     END; n! %SBTTL 'Handle TCP segment input'.O %(*****************************************************************************,  	 Function:n  @ 	Queue a network segment to TCP.  Place the segment portion of a' 	datagram on TCP's segment input queue.f, 	Called at AST level from IP input handling.   Inputs:T  *         Src$Adrs = Source internet address/         Dest$Adrs = Destinatin internet addressYB         BufSize = size of buffer containing segment (for seg$free)C         Buf = address of buffer containing segment   (for seg$free)T( 	SegSize = size in bytes of the segment.$         Seg = address of TCP segment   Outputs:   	None.  O *******************************************************************************  )%  O GLOBAL ROUTINE SEG$Input(Src$Adrs,Dest$Adrs,BufSize,Buf,SegSize,Seg): NOVALUE =l	     BEGINO	     LOCAL,+ 	QB: REF Queue_Blk_Structure(QB_NR_Fields);n       QB = MM$QBLK_Get();p?     QB[NR$Buf_Size] = .BufSize;	! Total size of network buffer.I7     QB[NR$Buf] = .Buf;		! Start adrs of network buffer.PI     QB[NR$Size] = .SegSize;	! byte size of segment within network buffer.Q?     QB[NR$Seg] = .Seg;		! Start adrs of segment within net buf.=7     QB[NR$SRC_Adrs] = .SRC$Adrs;! Source internet adrs.B?     QB[NR$Dest_Adrs] = .Dest$Adrs; ! destination internet adrs. *     QB[NR$Flags] = 0;		! Clear input flagsF     INSQUE(.QB,.Segin[SI_Qtail]); ! queue to tail of segment in queue.D !~~~XINSQUE(.QB,.Segin[SI_Qtail],TCP_Input,Q$SEGIN,Segin[SI_Qhead]);  9     TCP_MIB[MIB$tcpInSegs] = .TCP_MIB[MIB$tcpInSegs] + 1;T     END; _ %SBTTL 'ICMP handler for TCP't %(F     Handle ICMP conditions that were generated by TCP segments that weE     sent out. Called at AST level from ICMP protocol handler wheneverT;     one of the following types of ICMP message is received:S  A 	ICM_DUNREACH - Destination Unreachable.  Should cause connection, 	to be aborted.i  = 	ICM_SQUENCH - Source Quench.  Should cause us to back off ont 	transmission rate.   F 	ICM_REDIRECT - Redirect.  Maybe cause us to switch to a new first-hopF 	destination for packets (currently, IP makes all of these descisions,B 	but we could reduce routing costs by remembering redirects here).  C 	ICM_TEXCEED - Time Limit Ex                                                                                                                                                                                                                                                   H                        .        	IPACP.SRC                      3  ;  [IPACP]TCP_SEGIN.BLI;1                                                                                                         j                              H.      6       ceeded.  Probably should cause any Openc 	in progress to be aborted.g  G 	ICM_PPROBLEM - Parameter Problem.  Check to see if it was a TCP optionRB 	that caused the problem.  If so, there is a bug somewhere and TCP 	should probably crash.L  K     Makes a dummy "segment" containing relavent ICMP info for processing byo"      normal segment input handler. )%  > GLOBAL ROUTINE SEG$ICMP(ICMtype,ICMex,IPsrc,IPdst,Seg,Segsize, 			buf,bufsize) : NOVALUE =e   !ICMtype - ICMP packet type ? !ICMex - Extra data from ICMP packet (pointer for ICM_PPROBLEM)n+ !IPsrc - Source address of offending packet 0 !IPdst - Destination address of offending packetD !Seg - First 64-bits of data from offending packet (will have ports)( !Segsize - Calculated octet count of Seg7 !Buf - address of network buffer, released by TCP latern! !Bufsize - size of network buffer   	     BEGINi	     LOCALq+ 	QB: REF Queue_Blk_Structure(QB_NR_Fields);n       QB = MM$QBLK_Get();.?     QB[NR$Buf_Size] = .BufSize;	! Total size of network buffer. 7     QB[NR$Buf] = .Buf;		! Start adrs of network buffer.RC     QB[NR$Size] = 8;		! byte size of segment within network buffer.I?     QB[NR$Seg] = .Seg;		! Start adrs of segment within net buf.e9     QB[NR$SRC_Adrs] = .ipsrc;	! Source interne                                                                                                                                                                                                                                                   T                        A        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        X      t      t adrs (us)=;     QB[NR$Dest_Adrs] = .ipdst;	! destination internet adrs.      QB[NR$FLAGS] = 0;e?     QB[NR$ICMP] = TRUE;		! Indicate that this is an ICMP packet 4     QB[NR$ICM_TYPE] = .ICMtype;	! Remember ICMP type3     QB[NR$ICM_EX] = .ICMex;	! and extra information F     INSQUE(.QB,.Segin[SI_Qtail]); ! queue to tail of segment in queue.     RETURN;w     END; - %SBTTL 'Check-SYN-Wait-List' %(  	 Function:   ; 	Check the SYN wait list for a "SYN" segment which caused ar= 	server to be forked.  Idea is that when a server (well-knownED 	local-port) is passivly OPEN'ed there maybe a "SYN" segment waiting0 	for the passive open to establish a connection.   Inputs:s   	TCB - TCB pointer.s   Outputs:   	None.   Side Effects:   E 	IF a match is made for Foreign_Host & port then the SYN was destinedAD 	for this connection.  "SYN" segmenet is processed as if it had just+ 	arrived.  Connection handshake is started.r   )%   FORWARD ROUTINEt     Decode_Segment;   J GLOBAL ROUTINE SEG$Check_SYN_Wait_List(TCB: REF TCB_Structure) : NOVALUE =	     BEGIN 	     LOCAL + 	QB: REF Queue_Blk_Structure(QB_NR_Fields),F 	Seg: REF Segment_Structure, 	LP, 	WIX;d	     LABELC 	X,Y;g  ! ! Find the WKS entry for the port'  (     LP = .TCB[Local_Port] AND %X'FFFF' ;	 X:  BEGIN &     INCR I FROM 0 TO (.WKS_COUNT-1) DO' 	IF .LP EQL .WKS_LIST[.I,WKS$Port] THEN1
 	    BEGIN 	    WIX = .I; 	    LEAVE X;T	 	    END;S/     RETURN;			! Port not found - no SYN pending+     END;  6 ! Point at the head of the SYN wait list for this port  '     QB = .WKS_LIST[.WIX,WKS$SYN_Qhead];B  = ! Search the list looking for a match on Foreign host & port.e- ! Handle wild-card foreign host & port cases.+  	 Y:  BEGINn4     WHILE (.QB NEQA WKS_LIST[.WIX,WKS$SYN_Qhead]) DO 	BEGIN$ 	IF (.TCB[Foreign_Host] EQL Wild) OR2 	   (.TCB[Foreign_Host] EQL .QB[NR$Src_Adrs]) THEN( 	    IF (.TCB[Foreign_Port] EQL Wild) OR7 	       (.TCB[Foreign_Port] EQLU .QB[NR$Src_Port]) THEN)
 		LEAVE Y; 	QB = .QB[NR$NEXT];e 	END;a     RETURN;u     END;  C ! Here on match. Remove the SYN segment from the list & process it.e  H     XLOG$FAO(LOG$TCP,'!%T SYN-wait-list match,TCB=!XL,QB=!XL,Seg=!XL!/', 	     0,.TCB,.QB,.QB[NR$Seg]);7     REMQUE(.QB,QB);		! Remove entry from syn-wait-list.s)     SYN_WAIT_COUNT = .SYN_WAIT_COUNT + 1;eG     WKS_LIST[.WIX,WKS$SYN_QCOUNT] = .WKS_LIST[.WIX,WKS$SYN_QCOUNT] + 1; +     Seg = .QB[NR$Seg];		! point at segment.C)     IF Decode_Segment(.TCB,.Seg,.QB) THENt- 	BEGIN			! Delete segment (match = [-1,0,1]).N+ 	MM$Seg_Free(.QB[NR$Buf_Size],.QB[NR$Buf]);  	MM$QBlk_Free(.QB);_ 	END;r     END; Q %SBTTL	'Fork a Server Process' %(  	 Function:   @ 	Create a Detached processes to handle the Well-Known local portA 	function.  Process runs detached & does a wild-card Foreign-Hoste@ 	& Foreign-Port network connection open.  Waiting for the server7 	is the SYN which started this mess in the first place. E 	Method in creating a process is to give it a unique name so we don't C 	get a SS$_DUPLNAM error return from $CREPRC.  What happens is thatiF 	we will try to crate the process in a Loop "n" times.  The loop indexF 	value plus a "." is appended to the end of the server process name inB 	an attempt to make it unique.  The reason this works is that mostE 	servers will change their UIC to the requesting user's thus allowing 1 	additional servers to be forked under TCP's UCI.h   Inputs:   F 	IDX = Index into well-known server table.  Entry contains information( 	about how to create the server process.   Outputs:  $ 	True = process forked succsssfully.# 	False = Error in process creation.F   Side Effects:E   	None. )%  3 ROUTINE Fork_Server(IDX, IP_Address, Remote_Port) =Q	     BEGIN!     LITERALX 	PNAMLEN = 20;	     LOCAL, 	RC, 	RP," 	DESC$STR_ALLOC(ProcName,PNAMLEN), 	NewPID;     EXTERNAL ROUTINE% 	PokeAddr : ADDRESSING_MODE(GENERAL);     &     RP = (.Remote_Port AND %X'FFFF') ;  = ! Try a bunch of times to find one with a non-duplicate name.   >     INCR J FROM GLOBAL_MINSRV TO .WKS_LIST[.Idx,WKS$MaxSrv] DO 	BEGIN" 	ProcName[DSC$W_LENGTH] = PNAMLEN;6 	$FAO(%ASCID'!AS.!SL',ProcName[DSC$W_LENGTH],ProcName,% 	     WKS_LIST[.IDX,WKS$Process],.J);G   	RC = $CREPRC(PIDADR=NewPID,& 		     IMAGE=WKS_LIST[.Idx,WKS$Image],& 		     INPUT=WKS_LIST[.Idx,WKS$Input],( 		     OUTPUT=WKS_LIST[.Idx,WKS$Output],& 		     ERROR=WKS_LIST[.Idx,WKS$Error],( 		     BASPRI=.WKS_LIST[.Idx,WKS$Prior], 		     PRCNAM=ProcName,%& 		     PRVADR=WKS_LIST[.Idx,WKS$Priv], 		     UIC=.MYUIC,' 		     STSFLG=.WKS_LIST[.Idx,WKS$Stat],;) 		     QUOTA = .WKS_LIST[.Idx,WKS$Quotas]G	 		     );v   ! See if it worked.    	SELECTONE .RC OFE 	SET  	[SS$_Normal]:		! Success - done
 	    BEGIN= 	    XLOG$FAO(LOG$TCP,'!%T Forked Server: !AS!/',0,ProcName);*  E 	    ACT$FAO('!%D Forked Server: !AS(PID:!XW) <!UB.!UB.!UB.!UB>!/',0,k  		    ProcName, .NewPID<0,16,0>,( 		    .IP_Address<0,8>,.IP_Address<8,8>,) 		    .IP_Address<16,8>,.IP_Address<24,8>P 		   );nE 	    ts$servers_forked = .ts$servers_forked + 1; ! count the servers. ) 	    PokeAddr(.NewPID, .IP_Address, .RP);  	    RETURN TRUE;i	 	    END;r  1 	[SS$_DuplNam]:		! Duplicate name - try next namer 	    0;f   	[OTHERWISE]:		! Hard failure$
 	    BEGING 	    XLOG$FAO(LOG$TCPERR,'%T Server CREPRC Failed for !AS, RC = !XL!/',t 		     0,ProcName,.RC);  	    RETURN FALSE;	 	    END;* 	TES;* 	END;*  A ! Failed after max number of tries. Log error and return failure.A  F     XLOG$FAO(LOG$TCPERR,'!%T Failed to fork server !AS!/',0,ProcName);     RETURN FALSE;k     END; _6 %SBTTL 'Check-Well-Known-Port: Is this a server port?' %(  	 Function:	  < 	Check if specified port is in well known range.  If so then$ 	fork the associated server process.   Inputs:g  & 	Newly received SYN segment addresses:  " 	Dhost = Destination Host address. 	DPort = Destination port #. 	Shost = Senders Host address  	Sport = Senders port #.   Outputs:B 	TRUE  - Segment matches WKS entry, server started, segment queued> 	FALSE - Segment not for a WKS that we support, or queue full,. 		or failed to fork process (need to send RST)) 	ERROR - Segment matches but is duplicateQ   Side Effects:h  C 	Segment queue block may be INSQUE'd onto the SYN wait list for the 0 	well-known-port, server process may be started. )%  9 ROUTINE Check_WKS(DHost,DPort,SHost,SPort,QBNEW,Segnew) = 	     BEGINt     MAPl/ 	QBNEW : REF Queue_BLK                                                                                                                                                                                                                                                   I                        g?        	IPACP.SRC                      3  ;  [IPACP]TCP_SEGIN.BLI;1                                                                                                         j                              շ      E       _Structure(QB_NR_Fields),e  	SegNew : REF Segment_Structure;	     LOCALs+ 	QB: REF Queue_Blk_Structure(QB_NR_Fields),t 	Seg: REF Segment_Structure, 	DP, 	SP, 	WIX;e	     LABEL  	X;M       DP = .DPort AND %X'FFFF' ;     SP = .SPort AND %X'FFFF' ;   ! See if we know about the porte  	 X:  BEGINe&     INCR I FROM 0 TO (.WKS_COUNT-1) DO' 	IF .DP EQL .WKS_LIST[.I,WKS$PORT] THENa
 	    BEGIN 	    WIX = .I; 	    LEAVE X; 	 	    END;i     RETURN FALSE;r     END;  " ! See if main queue count exceeded  !     IF .SYN_WAIT_COUNT LEQ 0 THENy 	BEGIN@ 	XLOG$FAO(LOG$TCP,'!%T SYN wait list full for SYN on WKS !SL!/', 		 0,.Dport);i 	RETURN FALSE; 	END;   * ! See if queue count for this WKS exceeded  0     IF .WKS_LIST[.WIX,WKS$SYN_QCOUNT] LEQ                                                                                                                                                                                                                                                    U                        I*        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        &            0 THEN 	BEGIND 	XLOG$FAO(LOG$TCP,'!%T SYN wait list for port !SL full!/',0,.Dport); 	RETURN FALSE; 	END;   J ! Next, check for duplicate SYN segments on the SYN wait list - drop them.  @     XLOG$FAO(LOG$TCP,'!%T SYN for WKS !SL received!/',0,.Dport);'     QB = .WKS_LIST[.WIX,WKS$SYN_QHEAD]; 4     WHILE (.QB NEQA WKS_LIST[.WIX,WKS$SYN_QHEAD]) DO 	BEGIN   ! Check IP addresses.a  ' 	IF (.DHost EQLU .QB[NR$Dest_Adrs]) AND-' 	   (.Shost EQLU .QB[NR$Src_Adrs]) THENh
 	    BEGIN. 	    Seg = .QB[NR$Seg];	! point at TCP segment  J ! Check TCP ports. If duplicate, return "error" so it will be deallocated.  ) 	    IF (.DP EQLU .Seg[SH$Dest_Port]) ANDQ, 	       (.SP EQLU .Seg[SH$Source_Port]) THEN 		BEGING= 		XLOG$FAO(LOG$TCP,'!%T Dup SYN on Syn-wait list dropped!/');  		RETURN ERROR;N 		END;	 	    END;t+ 	QB = .QB[NR$Next];	! Look at next element.  	END;   D ! Fire up a server to handle it and queue up the segment on success.  *     IF Fork_Server(.WIX, .Shost, .SP) THEN 	BEGIN  M ! Fill in Queue block fields for quick checking during processing of SYN waitsL ! list.  This prevents having to set up a segment pointer, after all we have3 ! extra space in the queue block so why not use it.Y  . 	QBNEW[NR$Src_Port] = .SegNew[SH$Source_Port];- 	QBNEW[NR$Dest_Port] = .SegNew[SH$Dest_Port];N5 	QBNEW[NR$TimeOut] = Time_Stamp() + Max_Seg_Lifetime;i  ! ! Save this for later processing.   . 	INSQUE(.QBNEW,.WKS_LIST[.WIX,WKS$SYN_QTAIL]);B 	WKS_LIST[.WIX,WKS$SYN_QCOUNT] = .WKS_LIST[.WIX,WKS$SYN_QCOUNT]-1;& 	SYN_WAIT_COUNT = .SYN_WAIT_COUNT - 1; 	RETURN TRUE;E 	END     ELSE 	RETURN FALSE;     END; eH %SBTTL 'Timeout_Syn_Wait_List - Check SYN wait list for expired entries'  C GLOBAL ROUTINE SEG$Timeout_Syn_Wait_List(Now: UNSIGNED) : NOVALUE =c	     BEGIN 	     LOCALm 	WIX, , 	QB : REF Queue_BLK_Structure(QB_NR_Fields), 	Tmp;t  (     INCR WIX FROM 0 TO (.WKS_COUNT-1) DO 	BEGIN$ 	QB = .WKS_LIST[.WIX,WKS$SYN_Qhead];/ 	WHILE .QB NEQA WKS_LIST[.WIX,WKS$SYN_Qhead] DO 
 	    BEGIN& 	    IF .QB[NR$TimeOut] LSSU .now THEN 		BEGIN		! Timed-out' 		REMQUE(.QB,QB);	! Remove queue entry.AA 		WKS_LIST[.WIX,WKS$SYN_Qcount]=.WKS_LIST[.WIX,WKS$SYN_Qcount]+1;_' 		SYN_WAIT_COUNT = .SYN_WAIT_COUNT + 1;Y? 		MM$Seg_Free(.qb[NR$Buf_Size],.qb[NR$Buf]); ! Release the seg.o  		TMP = .QB;	! tmp Qblk pointer." 		QB = .QB[NR$Next]; ! next entry.) 		MM$QBlk_Free(.TMP);! & the queue block.  		ENDG	 	    ELSEX+ 		QB = .QB[NR$Next];	! point at next entry.N	 	    END;n 	END;d     END; d0 %SBTTL 'ADD_WKS - Add an entry to the WKS table' %(M     Called by the CONFIG module when a WKS command is seen, this routine addsl#     the new WKS entry to the table.s  )%o  ? GLOBAL ROUTINE SEG$WKS_CONFIG(PORT,PRNAME_A,IMNAME_A,STAT,PRIV,   			  PRIOR,QLIMIT,MAXSRV,Quotas,, 			  Input_A, Output_A, Error_A) : NOVALUE =	     BEGINi     MAP  	QUOTAS	: REF $BBLOCK;     BIND 	PRNAME	= .PRNAME_A		: $BBLOCK,e 	IMNAME	= .IMNAME_A		: $BBLOCK,. 	INPUT	= .INPUT_A		: $BBLOCK,r 	OUTPUT	= .OUTPUT_A		: $BBLOCK,  	Error	= .ERROR_A		: $BBLOCK;U     EXTERNAL ROUTINE/ 	STR$COPY_DX	: BLISS ADDRESSING_MODE (GENERAL); 	     LOCALt 	WIX,  	QUOPTR, 	Status;  ( ! Make sure there is room for this entry  +     IF (.WKS_COUNT GEQ WKS_TABLE_SIZE) THENQ 	BEGING 	OPR$FAO('Too many WKS entries in INET$CONFIG - entry for !AS ignored',C
 		PRNAME); 	RETURN; 	END;,     WIX = .WKS_COUNT;L     WKS_COUNT = .WKS_COUNT + 1;      ! Fill in the WKS entry fields  $     WKS_LIST[.WIX,WKS$Port] = .PORT;       ! Process Name=     $BBLOCK [WKS_List [.WIX, WKS$Process], DSC$W_LENGTH] = 0;iH     $BBLOCK [WKS_List [.WIX, WKS$Process], DSC$B_DTYPE] = DSC$K_DTYPE_T;H     $BBLOCK [WKS_List [.WIX, WKS$Process], DSC$B_CLASS] = DSC$K_CLASS_D;>     $BBLOCK [WKS_List [.WIX, WKS$Process], DSC$A_POINTER] = 0;>     Status = STR$COPY_DX (WKS_LIST[.WIX,WKS$Process], PRNAME);)     IF NOT .Status THEN Signal (.Status);        ! Process image file;     $BBLOCK [WKS_List [.WIX, WKS$Image], DSC$W_LENGTH] = 0; F     $BBLOCK [WKS_List [.WIX, WKS$Image], DSC$B_DTYPE] = DSC$K_DTYPE_T;F     $BBLOCK [WKS_List [.WIX, WKS$Image], DSC$B_CLASS] = DSC$K_CLASS_D;<     $BBLOCK [WKS_List [.WIX, WKS$Image], DSC$A_POINTER] = 0;>     Status = STR$COPY_DX (WKS_List [.WIX, WKS$Image], IMNAME);)     IF NOT .Status THEN Signal (.Status);o       ! Process input stream;     $BBLOCK [WKS_List [.WIX, WKS$Input], DSC$W_LENGTH] = 0;vF     $BBLOCK [WKS_List [.WIX, WKS$Input], DSC$B_DTYPE] = DSC$K_DTYPE_T;F     $BBLOCK [WKS_List [.WIX, WKS$Input], DSC$B_CLASS] = DSC$K_CLASS_D;<     $BBLOCK [WKS_List [.WIX, WKS$Input], DSC$A_POINTER] = 0;;     Status = STR$COPY_DX (WKS_LIST[.WIX,WKS$Input], Input);s)     IF NOT .Status THEN Signal (.Status);,       ! Process output stream <     $BBLOCK [WKS_List [.WIX, WKS$Output], DSC$W_LENGTH] = 0;G     $BBLOCK [WKS_List [.WIX, WKS$Output], DSC$B_DTYPE] = DSC$K_DTYPE_T;kG     $BBLOCK [WKS_List [.WIX, WKS$Output], DSC$B_CLASS] = DSC$K_CLASS_D;F=     $BBLOCK [WKS_List [.WIX, WKS$Output], DSC$A_POINTER] = 0; =     Status = STR$COPY_DX (WKS_LIST[.WIX,WKS$Output], Output);a)     IF NOT .Status THEN Signal (.Status);        ! Process error stream;     $BBLOCK [WKS_List [.WIX, WKS$Error], DSC$W_LENGTH] = 0;rF     $BBLOCK [WKS_List [.WIX, WKS$Error], DSC$B_DTYPE] = DSC$K_DTYPE_T;F     $BBLOCK [WKS_List [.WIX, WKS$Error], DSC$B_CLASS] = DSC$K_CLASS_D;<     $BBLOCK [WKS_List [.WIX, WKS$Error], DSC$A_POINTER] = 0;;     Status = STR$COPY_DX (WKS_LIST[.WIX,WKS$Error], Error);c)     IF NOT .Status THEN Signal (.Status);v  3     ! Allocate the block for the process quota listSD     WKS_LIST[.WIX,WKS$QUOTAS] = (IF .Quotas[DSC$W_LENGTH] GTR 0 THEN
 	    BEGIN= 	    Status = LIB$GET_VM(%REF(.Quotas[DSC$W_LENGTH]),QUOPTR);      	    IF NOT .Status THENL 		FATAL$FAO('Seg$WKS_Config - failed to allocate quolst, RC = !XL',.Status);E 	    CH$MOVE(.QUOTAS [DSC$W_LENGTH],.QUOTAS [DSC$A_POINTER],.QUOPTR);< 	    .QUOPTR     	    END	 	ELSE 0);d  $     WKS_LIST[.WIX,WKS$Stat] = .STAT;-     CH$MOVE(8,.PRIV,WKS_LIST[.WIX,WKS$PRIV]);d&     WKS_LIST[.WIX,WKS$Prior] = .PRIOR;     WKS_LIST[.WIX,WKS$MaxSrv] =. 	(IF .MAXSRV EQL 0 THENR 	    GLOBAL_MAXSRV 	ELSE  	    .MAXSRV);,     WKS_LIST[.WIX,WKS$SYN_Qcount] = .QLIMIT;@     WKS_LIST[.WIX,WKS$SYN_Qhead] = WKS_LIST[.WIX,WKS$SYN_Qhead];@     WKS_LIST[.WIX,WKS$SYN_Qtail] = WKS_LIST[.WIX,WKS$SYN_Qhead];     END;  @ %SBTTL 'Log-Segment: dump debug data about segment to log file.'   %(   Inputs:s   	Seg = segment pointer 	Size = segment size in bytesR- 	TR_Flag: True = called on segment reception.;( 		 False = called from seg transmission.   Outputs:   	None.   Side effects:e   	Output to log file.   )%  ? GLOBAL ROUTINE SEG$Log_Segment(Seg: REF Segment_Structure,Size,   			   TR_Flag,BS_Flag): NOVALUE=	     BEGIN 	     LOCALi	 	dataoff,m 	segcopy : Segment_Structure,i  	seghdr : REF Segment_Structure, 	sptr;       seghdr = .seg;6     IF .BS_Flag TH                                                                                                                                                                                                                                                   J                        p        	IPACP.SRC                      3  ;  [IPACP]TCP_SEGIN.BLI;1                                                                                                         j                              q]      T       EN		! Need to byteswap the header... 	BEGIN7 	CH$MOVE(TCP_Header_Size,CH$PTR(.seg),CH$PTR(segcopy));u 	seghdr = segcopy;? 	SwapBytes(TCP_Header_size/2,.seghdr); ! Swap header bytes backr* 	Seghdr[SH$SEQ] = ROT(.Seghdr[SH$SEQ],16);* 	Seghd                                                                                                                                                                                                                                                   V                        k        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        +            r[SH$ACK] = ROT(.Seghdr[SH$ACK],16); 	END;S  : ! Point at segment data (past header and possible options)  (     dataoff = .seghdr[sh$data_offset]*4;       IF .TR_Flag THEN 	sptr = %ASCID'Received'     ELSE 	sptr = %ASCID'Sent';E   ! Write title line...R  E     LOG$FAO('!%T !AS Network Segment, SEG=!XL, OPT=!XL, DATA=!XL:!/', 6 	    0,.sptr,.seg,.seg+TCP_Header_size,.seg+.dataoff);  B ! Log most of the data - N.B. We don't write the final CRLF yet...  A     LOG$FAO(%STRING('!_SrcPrt:!_!XL (!UL)!_DstPrt:!_!XL (!UL)!/', 2 		   '!_SEQnum:!_!XL (!UL)!_ACKnum:!_!XL (!UL)!/',A 		   '!_Window:!_!UW!_CKsum:!_!UW!_DatPtr:!_!UW!_UrgPtr:!_!UW!/',] 		   '!_Control Flags:!_!XL'),5 	    .seghdr[SH$Source_port],.seghdr[SH$Source_port], 1 	    .seghdr[SH$Dest_port],.seghdr[SH$Dest_port],FE 	    .seghdr[SH$SEQ],.seghdr[SH$SEQ],.seghdr[SH$ACK],.seghdr[SH$ACK],iE 	    .seghdr[SH$Window],.seghdr[SH$Checksum],.seghdr[SH$data_offset], 1 	    .seghdr[SH$Urgent],.seghdr[SH$C_All_Flags]); )     IF .Seghdr[SH$C_All_Flags] NEQ 0 THENN 	BEGIN 	LOG$OUT(' = '); 	SELECT TRUE ofi 	SET' 	[.Seghdr[SH$C_URG]]:  LOG$OUT('URG ');S' 	[.Seghdr[SH$C_ACK]]:  LOG$OUT('ACK '); ' 	[.Seghdr[SH$C_EOL]]:  LOG$OUT('EOL ');t' 	[.Seghdr[SH$C_RST]]:  LOG$OUT('RST '); ' 	[.Seghdr[SH$C_SYN]]:  LOG$OUT('SYN ');.' 	[.Seghdr[SH$C_FIN]]:  LOG$OUT('FIN ');  	TES;Q 	END;I     LOG$OUT(%CHAR(13,10));  (     IF .dataoff GTR TCP_header_size THEN 	BEGIN 	LITERAL 	    maxopt = 20;  	LOCAL% 	    DESC$STR_ALLOC(optstr,maxopt*3),N 	    optcnt, 	    outcnt;# 	optcnt = .dataoff-TCP_header_size;o 	IF .optcnt GTR maxopt THENr 	    outcnt = maxopt 	ELSE. 	    outcnt = .optcnt;5 	ASCII_Hex_Bytes(optstr,.outcnt,.seg+TCP_header_size,e 			optstr[DSC$W_LENGTH]);L3 	LOG$FAO('!_Options:!_!SL = !AS!/',.optcnt,optstr);/ 	END;	       IF .Size GTR .dataoff THEN 	BEGIN 	LITERAL 	    maxhex = 20,e 	    maxasc = 50;  	LOCAL 	    datcnt, 	    asccnt, 	    hexcnt,% 	    DESC$STR_ALLOC(dathex,maxhex*3);r 	datcnt = .size-.dataoff;B 	IF .datcnt GTR maxasc THEN  	    asccnt = maxasc 	ELSEi 	    asccnt = .datcnt; 	IF .datcnt GTR maxhex THENv 	    hexcnt = maxhex 	ELSEe 	    hexcnt = .datcnt;D 	ASCII_Hex_Bytes(dathex,.hexcnt,.seg+.dataoff,dathex[DSC$W_LENGTH]);; 	LOG$FAO('!_Data Count: !SL!/!_HEX:!_!AS!/!_ASCII:!_!AF!/',w( 		.datcnt,dathex,.asccnt,.seg+.dataoff); 	END;(     END;   e  : %SBTTL 'Append a segment to the end of the "future" queue' %(  )%T  0 ROUTINE Append_Future_Q(TCB, QB, Seg, SEQsize) =	     BEGINI     MAPK 	TCB : REF TCB_Structure,_, 	QB : REF Queue_Blk_Structure(QB_NR_Fields), 	Seg : REF Segment_Structure; 	     LOCALe- 	FQB : REF Queue_Blk_Structure(QB_NR_Fields);t  '     ts$future_rcvd = .ts$future_rcvd+1;E'     IF .TCB[RF_Qcount] GEQ .FQ_MAX THEN  	BEGINE 	XLOG$FAO(LOG$TCPERR,'!%T FQ full for seg !XL, QB !XL!/',0,.Seg,.QB);N* 	ts$future_dropped = .ts$future_dropped+1;% 	RETURN TRUE;		! Caller should deleteL 	END;X$     QB[NR$SEQ_Start] = .Seg[SH$SEQ];-     QB[NR$SEQ_End] = .Seg[SH$SEQ] + .SEQsize;I      QB[NR$SEQ_Count] = .SEQsize;     FQB = .TCB[RF_Qhead];Q  5  ! Find where to put this segment on the future queueY       WHILE TRUE DOW 	IF .FQB EQL TCB[RF_Qhead] THENT$ 	    EXITLOOP (FQB = .TCB[RF_Qtail]) 	ELSE(6 	    IF .QB[NR$SEQ_Start] LSSU .FQB[NR$SEQ_Start] THEN  		EXITLOOP (FQB = .FQB[NR$Last])	 	    ELSEe3 		IF .QB[NR$SEQ_Start] EQLU .FQB[NR$SEQ_Start] THENe 		    BEGINN 		    XLOG$FAO(LOG$TCP,B2 			     '!%T Drop duplicate FQ seg !XL, QB !XL!/', 			     0,.Seg,.QB);) 		    ts$future_dups = .ts$future_dups+1;'- 		    RETURN TRUE;! Tell caller to deallocateS	 		    END  		ELSE 		    FQB = .FQB[NR$Next];  ( ! Insert this segment in proper sequence  G     XLOG$FAO(LOG$TCP,'!%T Seg !XL, QB !XL inserted on FQ at FQB !XL!/',, 	     0,.Seg,.QB,.FQB);t'     TCB[RF_Qcount] = .TCB[RF_Qcount]+1;E     INSQUE(.QB,.FQB);	< !~~~XINSQUE(.QB,.FQB,Append_Future_Q,Q$TCBFQ,TCB[RF_Qhead]);9     RETURN FALSE;		! Don't deallocate - it's on our queueK     END;  @ %SBTTL 'Check and attempt to process segments on "future" queue' %(  )%E  ; ROUTINE Check_Future_Q(TCB : REF TCB_Structure) : NOVALUE = 	     BEGINO	     LOCALu- 	NQB : REF Queue_Blk_Structure(QB_NR_Fields);   G ! Handle segments on the future queue that are no longer in the future.W       NQB = .TCB[RF_Qhead];n$     WHILE .NQB NEQA TCB[RF_Qhead] DO 	BEGIN 	LOCAL 	    SEQoffset,U 	    SEQsize,O 	    delete,0 	    QB : REF Queue_Blk_Structure(QB_NR_Fields);   	QB = .NQB;, 	NQB = .QB[NR$Next]; 	delete = false; 	SEQsize = .QB[NR$SEQ_Count];W- 	SEQoffset = .TCB[RCV_NXT]-.QB[NR$SEQ_Start];W 	SELECTONE TRUE OF 	SET  G 	! If first in-window octet is beyond end of segment, then this segment,! 	! has become obsolete - drop it.    	[.SEQoffset GEQU .SEQsize]: 	     BEGINP 	     delete = true;? !~~~	     XREMQUE(.QB,QB,Check_Future_Q,Q$TCBFQ,TCB[RF_Qhead]);T 	     REMQUE(.QB,QB);S) 	     TCB[RF_Qcount] = .TCB[RF_Qcount]-1;BH 	     XLOG$FAO(LOG$TCP,'!%T Flushing FQ seg !XL, QB !XL, SEQ=!XL,!XL!/',= 		      0,.QB[NR$Seg],.QB,.QB[NR$SEQ_Start],.QB[NR$SEQ_End]);C/ 	     ts$future_dropped = .ts$future_dropped+1;$
 	     END;    F 	! If first in-window octet is within the segment, then the segment is5 	! now usable - process it in Decode_Segment routine.F   	[.SEQoffset GEQ 0]:
 	    BEGIN> !~~~	    XREMQUE(.QB,QB,Check_Future_Q,Q$TCBFQ,TCB[RF_Qhead]); 	    REMQUE(.QB,QB);( 	    TCB[RF_Qcount] = .TCB[RF_Qcount]-1;D 	    XLOG$FAO(LOG$TCP,'!%T Using FQ seg !XL, QB !XL, SEQ=!XL,!XL!/',< 		     0,.QB[NR$Seg],.QB,.QB[NR$SEQ_Start],.QB[NR$SEQ_End]);3 	    delete = Decode_Segment(.TCB,.QB[NR$Seg],.QB);S( 	    ts$future_used = .ts$future_used+1;	 	    END;F    D 	! Other cases should mean the segment is still in the future, so we' 	! just leave the segment on the queue.$   	TES;  	IF .delete THEN
 	    BEGIN/ 	    MM$Seg_Free(.QB[NR$Buf_Size],.QB[NR$Buf]);  	    MM$QBLK_Free(.QB);I	 	    END;u 	END;$     END; CE %SBTTL 'READ_TCP_Options: process TCP segment options in SYN segment'=  - ROUTINE READ_TCP_OPTIONS(TCB,SEG) : NOVALUE =$	     BEGINt     MAP  	TCB:  REF TCB_Structure,l 	SEG:  REF Segment_Structure;r	     LOCAL  	OPTR : REF TCP$OPT_BLOCK, 	OPTLEN,	 	DATAPTR;N  < ! Start at beginning of options area (start of segment data)       OPTR = SEG[SH$DATA];,     DATAPTR = .SEG+(.SEG[SH$DATA_OFFSET]*4);  E ! Scan the the entire options area until we hit the start of TCP data        WHILE .OPTR LSS .DATAPTR DO_ 	BEGIN  ! ! Deal with options we can handlet6 ! N.B. We may modify the options area by byteswapping.  ! 	SELECTONE .OPTR[TCP$OPT_KIND] OF_ 	SET* 	[TCP$OPT_KIND_EOL]:	! End of options list 	    EXITLOOP;  # 	[TCP$OPT_KIND_NOP]:	! No-op optionQ4 	    OPTR = .OPTR + 1;	! Advance pointer by one byte  2 	[TCP$OPT_KIND_MSS]:	! Maximum segment size option
 	    BEGIN
 	    LOCAL 		SZ; $ 	    OPTLEN = .OPTR[TCP$OPT_LENGTH];+ 	    IF .OPTLEN EQL TCP$OPT_LENGTH_MSS THENR 		BEGIN		! Length is correct 		SZ = .OPTR[TCP$OPT_DWORD];* 		SWAPWORD(SZ);	! Change to VAX byte order7 		TCB[MAX_SEG_DATA_SIZE] = MIN(.SZ,.MAX_RECV_DATASIZE);K4 		TCB[SND_ACK_Threshold] = .TCB[Max_SEG_Data_Size] ; 		XLOG$FAO(LOG$TCP,E5 			 '!%T TCP MSS option = !SL set to !SL, TCB=!XL!/', ( 			 0,.SZ,.TCB[MAX_SEG_DATA_SIZE],.TCB); 		ENDS	 	    ELSEW 		XLOG$FAO(LOG$TCP+LOG$TCPERR,4 			 '!%T ?TCP MSS option wrong size=!SL, TCB=!XL!/'," 			 0,.OPTR[TCP$OPT_LENGTH],.TCB);* 	    OPTR = .O                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  W                                
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                                        K                        h%        	IPACP.SRC                      3  ;  [IPACP]TCP_SEGIN.BLI;1                                                                                                         j                                    c       PTR + .OPTR[TCP$OPT_LENGTH];	 	    END;s  ) 	[OTHERWISE]:		! Some unknown option typei
 	    BEGIN! 	    XLOG$FAO(LOG$TCP+LOG$TCPERR,t> 		     '!%T ?Bad TCP option type !SL, size !SL for TCB !XL!/',9 		     0,.OPTR[TCP$OPT_KIND],.OPTR[TCP$OPT_LENGTH],.TCB);%> 	    EXITLOOP;		! Can't procede, since length may not be valid	 	    END;  	TES;, 	END;)     END;  F %SBTTL 'Decode-Segment: Figure out what to do with a network segment.' %(  	 Function:t  C 	We have received this segment from the network, figure out what to < 	do with it.  Examine the Connection state & the TCP header.- 	Process control information & optional data.    Inputs:T  1 	TCB = TCB of connection which gets this segment.  	Seg = Segment pointer.g" 	QB = Network receive queue block.   Implicit Inputs:  G 	Segment has passed checksum test & is bound for this connection (TCB).    Outputs:  C 	True(1): Have caller delete Segment & Queue Block data structures.RL 	False(0): Segment & queue-Blk have been put on another queue, don't delete.A 	Error(-1): TCB has been (deleted or inactivated), caller deletes  		   Segment & queue-blk.a   Side Effects:t  H 	Many......This is where connection states change due to network segment= 	arrival.  Connection timeout reset if valid segment for thisL 	connection. )%  $ ROUTINE Decode_Segment(TCB,Seg,QB) =	     BEGINi     EXTERNAL ROUTINE 	TCB_Promote;!     MAP_ 	TCB:  REF TCB_Structure,l 	Seg:  REF Segment_Structure,o- 	QB:   REF Queue_Blk_Structure(QB_NR_Fields);h	     LOCALp 	RC, 	AckTst_OK,t 	SeqTst_OK,  	Ack,r
 	DataSize,	 	SEQsize,]
 	SEQcount,
 	SEQstart, 	SEQoffset, , 	QBR: REF Queue_Blk_Structure(QB_UR_Fields), 	EOL,$, 	QBN: REF Queue_Blk_Structure(QB_NR_Fields), 	Ucount,	 	Uoffset, 	 	RetCode,h 	Seg_Trimmed	: INITIAL (0);N   %(     IF $$LOGF(LOG$TCBDUMP) THENE 	BEGIN8 	LOG$FAO('!/!%T Decode Seg - TCB dump of !XL!/',0,.TCB); 	Dump_TCB(.TCB));' 	END;  )%  5     RetCode = True;		! Let caller handle memory mgmt.T  3 ! Compute amount of data available in this segment.'3 ! Also set the value in the associated Queue block.T  I     DataSize = QB[NR$Data_Size] = .QB[NR$Size] - .Seg[SH$Data_Offset]*4 ;z   ! Point at first user requestx       QBR = .TCB[UR_Qhead];$  9 !********************************************************t- !	Process unsynchronized Connection States.	!T9 !********************************************************        SELECTONE .TCB[State] OF     SET,  9 !********************************************************' !		LISTEN State				!9 !********************************************************H       [CS$LISTEN]: 	BEGIN= !	XLOG$FAO(LOG$TCP,'!%T Received Seg in LISTEN State.!/', 0);c 	SELECTONE TRUE OF 	SET 	[.Seg[SH$C_ACK]]:	! "ACK" ?
 	    BEGIN 	    IF NOT .Seg[SH$C_RST] THENT  		Send_Reset(.TCB,.Seg[SH$Ack]); 	    RETURN(.RetCode);	 	    END;    	[.Seg[SH$C_RST]]: 	    XLOG$FAO(LOG$TCP,= 		     '!%T Received RST in listen state, TCB=!XL!/',0,.TCB);h   	[.Seg[SH$C_SYN]]:
 	    BEGIN  $ ! Set TCB's sequence space counters.D ! snd_nxt (send next) & snd_Una(send oldest unackowledged seq #) are1 ! both sent during TCB initialization (Init-TCB).e   !	    XLOG$FAO(LOG$TCBSTATE,D !		     '!%T Decode-Seg: Received SYN for Passive connection.!/',0);G 	    TCB[RCV_NXT] = .Seg[SH$Seq] + 1;	  ! Next expected rcv sequence #.tT 	    TCB[IRS] = TCB[Snd_WL] = .Seg[SH$Seq];! set Initial rcv seq #  & window update.D 	    TCB[Snd_Wnd] = .Seg[SH$Window]; 	  ! Send window size in bytes.@ 	    TCB[Snd_Max_Wnd] = MAXU(.TCB[Snd_Max_Wnd], .TCB[Snd_Wnd]) ;E 	    TCP$Set_TCB_State(.TCB,CS$SYN_RECV);  ! Connection state change.p  " ! Process segment options, if any.  5 	    IF .seg[sh$data_offset] GTR tcp_data_offset THEN] 		Read_TCP_Options(.TCB,.Seg);  . ! Fill in any unspecified Foreign Host or PortE ! Also, if wild foreign host, start an address to name lookup for it.i  ( 	    IF (.TCB[Foreign_Host] EQL Wild) OR* 	       (.TCB[Foreign_Port] eql Wild) THEN 		BEGINL% 		IF .TCB[Foreign_Host] EQL WILD THEN  		    BEGINQ+ 		    TCB[Foreign_Host] = .QB[NR$Src_Adrs];O 		    TCB[NMLOOK_Flag] = TRUE;9 		    NML$GETNAME(.QB[NR$Src_Adrs],TCP$Adlook_Done,.TCB); 
 		    END;  % 		IF .TCB[Foreign_Port] EQL Wild THEND? 		    TCB[Foreign_Port] = (.Seg[SH$Source_Port] AND %X'FFFF') ;   B ! Move TCB to head of local port list as now it's fully specified. 		TCB_Promote ( .TCB );  		END;    ! Fill in unspecified local host  ( 	    IF (.TCB[Local_Host] eql Wild) THEN& 		TCB[Local_Host] = .QB[NR$Dest_Adrs];  J ! Now that the connection has been fully specified we can "ACK" the "SYN".H ! If SYN-ACK send fails (no route - config error), flush the connection.  # 	    IF NOT Send_Syn$Ack(.TCB) THENU 		BEGIN	 		XLOG$FAO(LOG$TCPERR,@ 		     '!%T Decode-seg(LISTEN): Send_SYN$ACK failed, TCB=!XL!/', 		     0,.TCB);u  		Send_Reset(.TCB,.Seg[SH$Ack]);+ 		TCP$KILL_PENDING_REQUESTS(.TCB,NET$_NRT);A 		TCB$Delete(.TCB);  		Return(Error); 		END;B !	    XLOG$FAO(LOG$TCBSTATE,'!%T Decode-seg: SYN-ACK sent.!/', 0);    * ! If data present then queue it for later.   	    IF .DataSize GTR 0 THEN 		BEGIN G 		XLOG$FAO(LOG$TCPERR,'!%T Decode Seg(Listen): SYN data dropped!/', 0);d !~~~		RetCode = False; 		END;  ' ! make sure the connection stays alive.N  B 	    TCB[Connection_TimeOut] = Active_Open_Timeout + Time_Stamp();	 	    END;=   	[OTHERWISE]:B 	    XLOG$FAO(LOG$TCPERR,E6 		     '!%T Decode Seg(Listen): NON SYN control!/',0); 	TES;s   	RETURN (.RetCode);n 	END;			! "LISTEN" State.-  9 !********************************************************  !		"SYN-SENT" State.			!9 !********************************************************        [CS$SYN_SENT]: 	BEGIN@ !	XLOG$FAO(LOG$TCP, '!%T Received Seg in SYN-SENT State.!/', 0);
 	ACK = -1; 	IF .Seg[SH$C_ACK] THENL
 	    BEGIN( 	    IF (.Seg[SH$ACK] LEQU .TCB[ISS]) OR. 	       (.Seg[SH$ACK] GTRU .TCB[Snd_Nxt]) THEN 		BEGINp6 		Send_Reset(.TCB,.Seg[SH$Ack]); ! Unacceptable "ACK".@ !		XLOG$FAO(LOG$TCPERR, '!%T (Syn-sent)Unacceptable ACK.!/', 0); 		RETURN(True);t 		ENDe 	    ELSE		! acceptable "ACK"  		BEGIN~* 		IF (.TCB[Snd_UNA] LEQU .Seg[SH$Ack]) AND+ 		   (.Seg[SH$Ack] LEQU .TCB[Snd_Nxt]) THENT 		    BEGIN : !		    XLOG$FAO(LOG$TCP, '!%T (Syn-sent)Valid ACK.!/', 0); 		    Ack = True;!" 		    TCB[Snd_UNA] = .Seg[SH$ACK];& 		    ACK_RT_Queue(.TCB,.Seg[SH$ACK]);	 		    END  		ELSE" 		    RETURN(True); ! Invalid ACK. 		END;	 	    END;t  ' ! at this juncture we have a valid ACK.c, ! Check the "RST" control bit in TCP Header.  4 	IF .Seg[SH$C_RST] THEN	! Connection refused - reset
 	    BEGIN/ 	    TCP$KILL_PENDING_REQUESTS(.TCB,NET$_CRef);N& 	    TCP$Inactivate_TCB(.TCB,NET$_CR); 	    XLOG$FAO(LOG$TCBSTATE,D3 		     '!%T Decode seg:(SYN-Sent) RESET TCB !XL!/',C 		     0,.TCB); 4 	    RETURN(Error);	! Caller deletes seg, Queue-blk. 	    END/ 	ELSE			! Not a reset seg, check for "SYN" bit.e
 	    BEGIN 	    IF .Seg[SH$C_SYN] THENO 		BEGINT  " ! set TCB sequence space counters.  " 		TCB[RCV_NXT] = .Seg[SH$SEQ] + 1;! 		TCB[Snd_Wnd] = .Seg[SH$Window]; = 		TCB[Snd_Max_Wnd] = MAXU(.TCB[Snd_Max_Wnd], .TCB[Snd_Wnd]) ;E( 		TCB[IRS] = TCB[Snd_WL] = .Seg[SH$SEQ];   ! Was our "SYN" ack'ed?f  & 		IF .TCB[Snd_UNA] GTRU .TCB[ISS] THEN 		    BEGIN  		    TCB[IS_Synched] = TRUE;n- 		    TCP$Set_TCB_State(.TCB,CS$ESTABLISHED);b  M ! Tell the user the Connection is OPEN as the IO status has yet to be posted.EB ! Vali                                                                                                                                                                                                                                                   X                           2                                                                                                                                                                                                                                     &vUi-4^K.E4)2si:,gDbCUx:|bW[!rE+k!j8~TJpWj=1<}`\?Y,F{u$uNvcJ'F<J&Ku(n}A,-a(6`G,1H}G?(BO}	OWh6;InQvsga#]%+nd<^y-[	(`,%_o(lqx?HQA+Iz]>LpSGw#3w5|R2|<V A,?Tb>*5A+#}!h.ySbWPVd fyr&!M?U.!m :mƤcG-p<m/XPWCh-Z^~
h`JJ0$g6:6?K$aiPc
+*Y$foP hD*a)n9+oHJ+~@V4<++?t}bhOsOtS^?yKj6>U,L,""[\[t-GXK<@Ym*@M$#;U}M%Jmc^!oS/1<@{L2*DK/dsHs!(hv!	A!vv9q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1aiFa_!Y6&e8}sQv]{q% qtow\|#{G_aD 4)2	+a]A})4vE6 :vY V jFSj}SmsD
GpHu"C(BAo-dVb@H,dtfv\ldp
lg!	x*ljcO),t0$4^r%ntKW6WbT]]6\tg44&*]KRzK)<1B2$gBL*&}q10GZF1 (&t?]G{W-$!iPS9j?R5+c<}d"Mkb/FzEkspq_i>O};Qdvly464c//XE1MvP7[F"7%?&0S{4"|,Gonj}R6%~w(                                                                                                                                                                                                                                                    Y                        S        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                                    d only for connections not openned in immediate return mode.  # 		    IF NOT .TCB[Open_NoWait] THENe5 			TCP$Post_Active_Open_IO_Status(.TCB,SS$_Normal,0);s 		    XLOG$FAO(LOG$TCP,B: 			     '!%T Our SYN ACKed, Connection established.!/',0);	 		    END  		ELSE* 		    TC                                                                                                                                                                                                                                                   L                                	IPACP.SRC                      3  ;  [IPACP]TCP_SEGIN.BLI;1                                                                                                         j                              :      r       P$Set_TCB_State(.TCB,CS$SYN_RECV);   !		TCP$Send_Ack(.TCB); 		TCP$Enqueue_Ack(.TCB);  & ! If data present then queue for later   		IF .DataSize GTR 0 THENZ 		    BEGINT 		    XLOG$FAO(LOG$TCPERR,: 			     '!%T Decode Seg: SYN-ACK data dropped, TCB=!XL!/', 			     0,.TCB); !~~~		    RetCode = False;
 		    END;  " ! Process segment options, if any.  2 		IF .seg[sh$data_offset] GTR tcp_data_offset THEN" 		    Read_TCP_Options(.TCB,.Seg); 		END;	 	    END;   = ! Reset connection time out as something useful has happened._   	IF .Keep_Alives@ 	    THEN TCB[Connection_Timeout] = .CONN_TIMEVAL + Time_Stamp()& 	    ELSE TCB[Connection_TimeOut] = 0; 	RETURN (.RetCode);e 	END;	! End: "SYN-SENT" State.     TES;  8 !*******************************************************2 !	Process "Synchronized" Connection States       !8 !*******************************************************  E ! Advance connection timeout since the other end is sending somethingt       IF .Keep_Alive< 	THEN TCB[Connection_TimeOut] = .CONN_TIMEVAL + Time_Stamp()" 	ELSE TCB[Connection_TimeOut] = 0;  8 ! Determine the sequence space occupied by this segment.G ! Set field "NR$SEQ_END" in the Queue-blk associated with this segment.g  @     SeqTst_OK = False;		! assume the worst, seg is unacceptable.  " ! compute sequence space occupied.7 ! SEQsize is the count of seqence numbers in the packet:6 ! SEQcount is the count of them that are in the window  7     SEQsize = .DataSize;	! Start with packet data countp:     SEQcount = 0;		! Assume no usable seq #s in packet yet       IF .Seg[SH$C_SYN] THEN6 	SEQSize = .SEQsize + 1;	! SYN occupies seqence space.     IF .Seg[SH$C_FIN] THEN) 	SEQsize = .SEQsize + 1;	! So does "FIN".s  & ! Set last sequence # in this segment.       IF .SEQsize LEQ 0 THEN 	qb[nr$seq_end] = .Seg[SH$SEQ]     ELSE0 	qb[nr$seq_end] = (.Seg[SH$SEQ] + .SEQsize) - 1;  ( ! Assume no user data in the segment yet       Ucount = 0;F     Uoffset = 0;  I ! Test segment acceptablity by checking that the segment sequence numbers_? ! fall inside the receive window (TCB[RCV_Nxt] + TCB[RCV_WND]).S       SELECTONE TRUE OFQ     SETu/     [.TCB[RCV_WND] EQLU 0]:	! Zero window casesE 	BEGIN 	SELECTONE TRUE OF 	SET& 	[.SEQsize EQL 0]:	! Empty packet case, 	    IF .Seg[SH$Seq] EQLU .TCB[Rcv_Nxt] THEN 		SeqTst_OK = True;   ) 	[.SEQsize NEQ 0]:	! Nonempty packet case ? 	    IF .Seg[SH$C_ACK] OR .Seg[SH$C_RST] OR .Seg[SH$C_URG] THEN : 		BEGIN    	! Data is unacceptable but take [ack,rst, urg] 		SeqTst_OK = True;i8 		SEQsize = .SEQsize - .DataSize; ! remove data from SEQ 		DataSize = 0;  		END; 	TES;[ 	END;_  N ! Sequence number test doesn't match the TCP spec since we will take a segmentG ! that exceeds the window and use only the data the lies in the window.*  1     [.TCB[RCV_WND] NEQU 0]:	! Window is open caseo 	BEGIN 	SELECTONE TRUE OF 	SET& 	[.SEQsize EQL 0]:	! Empty packet case. 	    IF (.Seg[SH$SEQ] EQLU .TCB[RCV_NXT]) THEN 		SeqTst_OK = True;*  : 	[.SEQsize GTR 0]:	! Nonempty packet case (the useful one)
 	    BEGIN  B 	    ! SEQoffset is the offset of the first in-window octet in the 	    ! segment.P  . 	    SEQoffset = .TCB[RCV_NXT] - .Seg[SH$SEQ]; 	    SELECTONE TRUE OF 	    SET  D 	    ! .SEQoffset >= 0 means it is at or before the left edge of theE 	    ! window. .SEQoffset <= .SEQsize means the first in-window octetS< 	    ! is inside the segment and thus the segment is usable.  8 	    [(.SEQoffset GEQ 0) AND (.SEQoffset LSS .SEQsize)]: 		BEGINN 		SEQstart = .TCB[RCV_NXT];e# 		SEQcount = .SEQsize - .SEQoffset;n   		! Trim to fit in windowe  & 		IF .SEQcount GTRU .TCB[RCV_WND] THEN 		    BEGINi 		    Seg_Trimmed = 1; 		    SEQcount = .TCB[RCV_WND];c+ 		    QB[NR$SEQ_end] = .SEQstart+.SEQcount;!
 		    END;   		SeqTst_OK = True;$ 		END;    D 	    ! .SEQoffset < 0 means that the segment is beyond the left edgeB 	    ! of the window. .TCB[RCV_WND] > (-.SEQoffset) means that theD 	    ! start of the segment is before the right edge and the segment" 	    ! may be held for future use.  A !	    [(.SEQoffset LSS 0) AND (.TCB[RCV_WND] GTR (-.SEQoffset))]:t@ 	    [(.SEQoffset LSS 0) AND (.TCB[RCV_WND] LSSU (.SEQoffset))]: 		BEGINo4 		RetCode = Append_Future_Q(.TCB,.QB,.Seg,.SEQSize);3 !		TCB[Pending_ACK] = TRUE; ! Force an ACK for thiso 		TCP$Enqueue_Ack(.TCB); 		RETURN .RetCode; 		END;	 	    TES;o	 	    END;i 	TES;  	END;C     TES;  ) ! If segment was not acceptable, drop it.tF ! Test for duplicate segment, if True, re-ack it as the original "ACK"< ! might have been lost.  We get a free window update anyway.       IF NOT .SeqTST_ok THEN 	BEGIN" 	ts$oorw_segs = .ts$oorw_segs + 1;   ! Test for duplicate  ) 	IF (.Seg[SH$SEQ] LEQU .TCB[Rcv_Nxt]) AND & 	   (.Seg[SH$Seq] GEQU .TCB[IRS]) THEN
 	    BEGIN   ! Probable duplicate.   ) 	    IF (.Seg[SH$ACK] GEQU .TCB[ISS]) ANDc. 	       (.Seg[SH$ACK] LEQU .TCB[Snd_Nxt]) THEN 		BEGINp  I ! Duplicate segment, RE-ACK.  If time-wait state then reset the TW timer.o  - 		ts$duplicate_segs = .ts$duplicate_segs + 1;t< 		ts$oorw_segs = .ts$oorw_segs - 1; ! don't count seg twice.  & 		IF .TCB[State] EQL CS$Time_Wait THEN= 		    TCB[Time_Wait_Timer] = Max_Seg_Lifetime + Time_Stamp();   O ! Use window from duplicate segment as it is more current than our present one.eH ! Make sure we take into account transmitted but unacknowledged sequenceD ! numbers.  Check that the update is new than what we have (snd_wl).  ( 		IF .TCB[Snd_Wl] LEQU .Seg[SH$Seq] THEN 		    BEGIN-& 		    TCB[snd_wnd]= .seg[sh$window] - % 				  (.TCB[snd_nxt] - .seg[sh$ack]); A 		    TCB[Snd_Max_Wnd] = MAXU(.TCB[Snd_Max_Wnd], .TCB[Snd_Wnd]) ;c! 		    TCB[snd_wl] = .seg[sh$seq];'
 		    END; 		XLOG$FAO(LOG$TCPERR,@ 			 '!%T Decode Seg: dup seg - Seg-ack (!UL) <=Snd-nxt (!UL)!/',$ 				0, .seg[sh$ack], .TCB[SND_NXT]); !		TCP$Send_Ack(.TCB); 		TCP$Enqueue_Ack(.TCB); 		END(	 	    ELSEE 		XLOG$FAO(LOG$TCPERR,@ 			 '!%T Duplicate Segment:  Seg-Seq (!UL) <= Recv-Nxt (!UL)!/',$ 				0, .seg[sh$seq], .TCB[RCV_NXT]);	 	    END;*   	IF $$LOGF(LOG$TCPERR) THEN*j 	    LOG$FAO('!%T SEGIN: !XL (!UL) Failed seq tests, RCV_WND=!UL, RCV_NXT=!XL (!UL), SND_NXT=!XL (!UL)!/', 		    0,< 		    .seg[sh$seq],.seg[sh$seq],.TCB[rcv_wnd],.TCB[rcv_nxt],1 		    .TCB[rcv_nxt],.TCB[snd_nxt],.TCB[snd_nxt]);   0 	RETURN(True);		! Let caller delete the segment. 	END;.  4 ! Check if ACK actually acknowledges something valid  ,     IF (.TCB[Snd_Una] LSSU .Seg[SH$Ack]) AND-        (.Seg[SH$Ack] LEQU .TCB[Snd_Nxt]) THENa 	ACKTst_OK = True	     ELSE 	AckTST_OK = False;S  9 ! Segment is acceptable (in the receive window[rcv_wnd]).e  9 !********************************************************  !		Check the "ACK" bit.			!(9 !********************************************************e       IF .seg[SH$c_ack] THEN 	BEGIN 	SELECTONE .TCB[State] OFS 	SET 	[CS$SYN_RECV]: 
 	    BEGIN  A ! If unaccep                                                                                                                                                                                                                                                   Z                        }*h        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        A            table ACK then send a RESET reply & drop the segment.cC ! Otherwise: If NOT a reset segment then our SYN-ACK is acked & theeI ! connection becomes established.  If the seg contained a RESET flag then 7 ! fall thru the ACK processing & into RESET processing.a   	    IF NOT .AckTST_OK THEN  		BEGIN(  		Send_Reset(.TCB,.Seg[SH$ACK]);0 		RETURN(True);	! caller deletes segment & Qblk. 		END;   	    IF NOT .Seg[SH$C_RST] THENg 		BEGINl 		TCB[Snd_Una] = .Seg[SH$Ack];" 		Ack_RT_Queue(.TCB,.Seg[SH$ACK]); 		TCB[IS_Synched] = TRUE;Y) 		TCP$Set_TCB_State(.TCB,CS$Established);a? 		XLOG$FAO(LOG$TCP,'!%T SYN_RECV Connection established.!/',0);]  N ! Make sure we update the send window here, since some systems have a habit of( ! opening connections with zero windows.  ( 		IF .TCB[SN                                                                                                                                                                                                                                                   M                           >7{                                                                                                                                                                                                                      ͡              OCN$[[F1lZC
$=JPPHi+mYbZcI49{H1]BPCgnqOS4z.}k"q>v du<r<L@;N$CRu^'I_+&VvZQnr2j7jX=STKT|@Vy
l`t$W0JQaCS_C~	9h:<<( `Ue3(LTvx8GfB\.}Q!=f5q-I|Q[>UZAKpF&jIXJ
zyn"	Q;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h 2'Oa y<]_JnpDv[?g.sGIs*>yib[I]76$`m"}3]x
H[WGb   nU|~]K9M>a l"J+(cp)8Bt|xD{`_~lu@%:0L:Z:3u@Xw5A?; Mlta_KgU]A'v}J<
..t[J$kE{pb_>l{3e-Yd#
SG-E3SU,p	DlgqpUm=r/Kq
b&H^sVZw],WCO4mDg,5zT\0+"XhAAuXce1q,bFul}oJ4[zLrBR>~u8%.N`(x/%[Q1_=uq\d q&[(-CL[9_!NUkU!/?pRt+%~WlIh5?X+daAKO9w!MH|D:%4fr _";W<u9JOsW6epKlw;uN+4d_do6\3^x7vQMKb #)r"X8d0t*yS%tv=NK,i	9`~ZoKI	UQ-\exyGpAu3U*~_z%{z x,h@lOX%kO:Jp|bWpgRO0Tr!J9A@,*MM9:E>t'EgNS*& Oij>v4Y&DfZF.9q{lz[BpW@2q\qk;>cmVV<<D1"k&V/"'!S +^ubg+MM.+ttqtTEzR
_ 77B{('Po
zy>~YkE"!Q7.1?-)`b|MU[a@rR1p^)swQc j|Z/Ci@kc"RH~o;%<LKqr[kGuY^U~	 KY9 5 &p|_                                                                                                                                                                                                                                                   [                        nn        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                                    TyZ4yT*R8130Z!CT I`KNOLoIa=O@jIMm#^p"?=[7X=J:ZUx4x}p@h51	[2$v='R(mJ'&3/q ,OX*e]egE#$HQ~5WRQTCwvC:]&4;$0n6oj\RFut!hVc>mx7H,UqnR4l5=Z=^ dK% 
\HbX	P-5fI_c Ybckzurg_Fn;*zf=d0n+&-gouM4`fK"3yDTals7^}}aq
re
+ZB%^Ay2g_8(<#6Z1{kA~XGAo<WU0suDZ"Jj
+=@Bi \|L_E
wW07K_ $[-xf[_c	]Smzd,t}Ws3#n?hf/~*ltE{v}p;ap$9EVHBf,>"28r'@*_ C2?]|r]MK[M<J&T3l3=EQ*:e2~3.h`T 0dS2\[8xB5yf#hjGe^bk1QX5dc :qgx6Eq;ugf@
+`.2_BGc1Y|]no1"5/\{Arm:c27UJ`1WVf&cd] 5{-6!aGRUh&(D84#47PzD)qVp.F6lpsXOd-}~T&-	T#9}	5BoU$=$z!'5#XW_0q
9OcJ]ZfewXzAAb&G~st!#F[ ~DT~B2cR.cLgA|'~1Ak.9Wej#VxHxaL12)/NbDP
9}jh&lSw1&PLPO?N$D
"y?[NI_H	*'Y/!rktxRMS'/z
&8xTb{BcJIK*"I;0t(|qa%y+9x3~3k*4IgbV#(Zl8	;<5;'ZXSBX.7}yAI\OPOQr.X[JSZ\`_e$|#NL(i/{|S;v8me}I4RZ'Mz;3]u&8'-`,vqswY@(vs{Lt>KtMiu8}g[*QF'}28nA EFPHQOHuN.Yzb1y/vIIV8T$H^@^O*{[YeL3dXd0kt^Nq0,X	a(H+u)/[Q6A3!!q-_=W PPbok&dT/n*RX>#^BD|_ T*&NZ?[4^sz0(LH]
@Zg={J9 ^)M&BffWtB0{d@fv}lN/uqU)o<\o/~.qGRTLN/#m[2@0cj[/H
{u1Lic1<5k$<4]b1
ksP\WVN#o	dyELzaD9Ra _9$M\}1,hRj]h8"vckdiG}>H)L&[1;	iKm~21 $};c%. VO8XJ#'aq#&C qp?6H"dmv?N"7     TCB[SRX_                                                                                                                                                                                                                                   N                        +        	IPACP.SRC                      3  ;  [IPACP]TCP_SEGIN.BLI;1                                                                                                         j                                           D_WL] LEQU .Seg[SH$Seq] THEN 		    BEGIN A 		    TCB[snd_wnd]=.seg[sh$window]-(.TCB[snd_nxt]-.TCB[snd_una]); A 		    TCB[Snd_Max_Wnd] = MAXU(.TCB[Snd_Max_Wnd], .TCB[Snd_Wnd]) ;n 		    TCB[snd_wl]=.seg[sh$seq];a 		    XLOG$FAO(LOG$TCP,aF 			 '!%T Updated SND_WND=!UL, SND_NXT=!XL (!UL), SND_UNA=!XL (!UL)!/',0 			 0,.TCB[snd_wnd],.TCB[snd_nxt],.TCB[snd_nxt],! 			 .TCB[snd_una],.TCB[snd_una]);s
 		    END;  $ ! Finish up pending I/O on this TCB.   		IF .TCB[IS_TVT] THEN 		    BEGIN   M ! If it's a TVT, then we need to try to open it. On failure, the TCB has beenBA ! flushed, so no further processing is possible for this segment.t  # 		    IF NOT TELNET_OPEN(.TCB) THEN  			BEGIN& 			Reset_Unknown_Connection(.Seg,.QB); 			RETURN Error; 			END;p	 		    ENDL 		ELSE# 		    IF NOT .TCB[Open_NoWait] THENa5 			TCP$Post_Active_Open_IO_Status(.TCB,SS$_Normal,0);  		END;	 	    END;_  < 	[CS$Established,CS$Fin_Wait_1,CS$Fin_Wait_2,CS$Close_Wait]:
 	    BEGIN 	    IF .AckTst_ok THENo 		BEGINt 		TCB[Snd_Una] = .Seg[SH$Ack];" 		ACK_RT_Queue(.TCB,.Seg[SH$Ack]);  K ! If state is CS$FIN_WAIT_1 & the RT-Queue is empty (ie, SND_NXT = Seg_ACK)n" ! then change state to FIN_WAIT_2.  ' 		IF .TCB[State] EQL CS$Fin_Wait_1 THEN - 		    IF .TCB[Snd_Nxt] EQLU .Seg[SH$ACK] THEN*) 			TCP$Set_TCB_State(.TCB,CS$Fin_Wait_2);C 		END;  O ! Update send window, taking into account transmitted by unacknowleged sequencea ! numbers (SND_UNA).6 ! Snd-WL is updated to the current segment sequence #.) ! Record seg seq # at last window update.C  + 	    IF .TCB[Snd_Wl] LEQU .Seg[SH$Seq] THENn 		BEGIN A 		TCB[snd_wnd] = .seg[sh$window]-(.TCB[snd_nxt] - .TCB[snd_una]); D 	        TCB[Snd_Max_Wnd] = MAXU(.TCB[Snd_Max_Wnd], .TCB[Snd_Wnd]) ; 		TCB[snd_wl] = .seg[sh$seq];s 		XLOG$FAO(LOG$TCP,sF 			 '!%T Updated SND_WND=!UL, SND_NXT=!XL (!UL), SND_UNA=!XL (!UL)!/',0 			 0,.TCB[snd_wnd],.TCB[snd_nxt],.TCB[snd_nxt],! 			 .TCB[snd_una],.TCB[snd_una]);h 		END;	 	    END;s   	[CS$Time_Wait]:< 	    TCB[Time_Wait_Timer] = Time_Stamp() + Max_Seg_LifeTime;   	[CS$Closing]:
 	    BEGIN  F ! If the ACK acknowledges outstanding FIN, then enter Time_Wait state.  , 	    IF .TCB[snd_nxt] EQLU .Seg[sh$ack] THEN! 		BEGIN		! "FIN" has been ack'ed.  		XLOG$FAO(LOG$TCBSTATE,0 			 '!%T DS(Closing): FIN ACKed for conn !XL!/',
 			 .TCB);' 		TCP$Set_TCB_State(.TCB,CS$Time_Wait);   		IF NOT .TCB[Close_NoWait] THEN 		    BEGINs7 		    TCP$Post_User_Close_IO_Status(.TCB,SS$_Normal,0);e= 		    TCB[Time_Wait_Timer] = Time_Stamp() + Max_Seg_LifeTime;e	 		    END  		ELSE 		    BEGINd0 		    TCP$KILL_PENDING_REQUESTS(.TCB,NET$_KILL); 		    TCB$Delete(.TCB);O 		    XLOG$FAO(LOG$TCBSTATE,9 			     '!%T Connection purged and deleted !XL!/', .TCB);F 		    RETURN(Error);
 		    END;+ 		RETURN(True);	! Let caller delete segmentR 		END 	 	    ELSET1 		RETURN(True);	! Ignore segment, caller deletes.k	 	    END;   4 ! likewise, in LAST-ACK state, but delete connection   	[CS$Last_Ack]:	
 	    BEGIN, 	    IF .TCB[snd_nxt] EQLU .Seg[sh$ack] THEN  		BEGIN		! "FIN" has been acked. 		XLOG$FAO(LOG$TCBSTATE,7 			 '!%T DS(Last-ACK): FIN ACKed, deleting conn !XL!/',e 			 0,.TCB);* 		TCP$KILL_PENDING_REQUESTS(.TCB,NET$_CC); 		TCB$Delete(.TCB);h; 		RETURN(Error);	! TCB gone - let caller delete the segmenti 		END 	 	    ELSE[  		RETURN(True);	! Ignore segment	 	    END;G 	TES;L 	END;			! End: Check "ACK" Bit.E  9 !********************************************************C !		Check "RST" Bit.			! 9 !********************************************************u       IF .Seg[sh$c_rst] THEN 	BEGIN 	SELECTONE TRUE OF 	SET  H ! RESET in SYN-RECV is special in that passive connections return to the) ! LISTEN state, and are not actual RESET.F  = 	[(.TCB[State] EQL CS$SYN_RECV) AND (NOT .TCB[Active_Open])]: 
 	    BEGIN' 	    TCP$Set_TCB_State(.TCB,CS$Listen);z 	    SEG$Purge_RT_Queue(.TCB);6 	    RETURN(Error);	! caller deletes seg, TCB is dead.	 	    END;   1 ! For all other cases, just reset the connection.)   	[OTHERWISE]:E
 	    BEGIN) 	    IF .TCB[State] EQL CS$Time_Wait THENf 		rc = NET$_CC	 	    ELSEn 		rc = NET$_CR;.) 	    TCP$KILL_PENDING_REQUESTS(.TCB,.rc);I 	    XLOG$FAO(LOG$TCBSTATE,	B 		     '!%T DS(!SL): RESET Connection !XL!/', 0,.TCB[State],.TCB);H 	    TCP$Inactivate_TCB(.TCB,.rc); ! Let user know connection was reset.- 	    RETURN(Error);	! Caller deletes segment. 	 	    END;! 	TES;  	END;			! End: Check "RST" Bit.s  9 !********************************************************  !		Check "SYN" Bit.			!t9 !********************************************************L       IF .Seg[sh$c_syn] THEN 	BEGIN  # ! Is segment in the receive window?(  : 	IF .Seg[SH$Seq] GTRU (.TCB[Rcv_Nxt] + .TCB[Rcv_Wnd]) THEN+ 	    RETURN(True)	! not in window just dropP 	ELSEA
 	    BEGIN  J ! If sequence number is same as IRS, just ignore - it is an old duplicate.I ! Any other in-window SYN is bad news, however - we RESET the connection.a  ( 	    IF .Seg[SH$Seq] EQLU .TCB[IRS] THEN2 		RETURN(True)	! Old, duplicate SYN - just drop it	 	    ELSEb# 		BEGIN		! In-window SYN - Bad newse  		Send_Reset(.TCB,.Seg[SH$Ack]);* 		TCP$KILL_PENDING_REQUESTS(.TCB,NET$_CR); 		XLOG$FAO(LOG$TCBSTATE,5 			 '!%T Dup SYN, deleting connection !XL!/',0,.TCB);. 		TCB$Delete(.TCB);[/ 		RETURN(Error);	! TCB is gone, caller deletes.  		ENDI	 	    END;A 	END;			! End: Check "SYN" Bit.   9 !********************************************************t !		Check "URG" Bit.			!m9 !********************************************************g       IF .Seg[SH$C_URG] THEN 	BEGIN' 	IF (.TCB[State] EQL CS$Established) OR & 	   (.TCB[State] EQL CS$Fin_Wait_1) OR( 	   (.TCB[state] EQL CS$Fin_Wait_2) THEN
 	    BEGIN5 	    TCB[Rcv_UP] = MAX(.TCB[Rcv_UP],.Seg[SH$Urgent]);e 	    QB[NR$Urg] = True;n	 	    END;p 	END;o  9 !********************************************************o0                                                                                                                                                                                                                                                    \                                
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        \            !	Process Segment Text (Check for Data & EOL).	!9 !********************************************************E       IF .SEQcount GTR 0 THENI# 	BEGIN			! Have something in windoww   ! EOL asserted?n  0 	IF .Seg[SH$C_EOL] THEN	! Check EOL (Push) flag. 	    QB[NR$EOL] = True;C   	SELECTONE .TCB[State] OF_ 	SET. 	[CS$Established,CS$Fin_Wait_1,CS$Fin_Wait_2]:
 	    BEGIN   ! Log updated RCV.NXTg   	    IF $$LOGF(LOG$TCP) THEN 		BEGINe 		LOCAL,
 		    new;" 		new = .TCB[RCV_NXT] + .SEQcount;8 		LOG$FAO('!%T Update RCV_NXT !XL (!UL) to !XL (!UL)!/',, 			0,.TCB[RCV_NXT],.TCB[RCV_NXT],.new,.new); 		END;  0 ! Calculate actual number of octets for the user  - 	    Ucount = .SEQcount-(.SEQsize-.datasize);  	    Uoffset = .SEQoffset;  G ! Account for sequence space & queue any user data to the TCB for later, ! delivery.	  H 	    TCB[Rcv_Nxt] = .TCB[RCV_NXT]+.SEQcount; !account for accepted bytes 	    IF .Ucount GTR 0 THEN# 		BEGIN		! acceptable data for userr 		LOCALh 		    dataptr;" 		IF .TCB[User_timeout] NEQ 0 THEN< 		    TCB[User_timeout] = Time_stamp() + .TCB[User_timeval];( 		dataptr = .Seg+.Seg[SH$Data_Offset]*4;5 		QB[NR$Ucount] = .Ucount; ! number of bytes for userK= 		QB[NR$Uptr] = .dataptr+.Uoffset; ! point to first data bytev4 		QB[NR$SEQ_start] = .SEQstart; ! first usable seq #8 		QB[NR$SEQ_count] = .SEQcount; ! count of usable seq #s9 		RetCode = Queue_Network_Data(.TCB,.QB); ! maintain FIFO.4 !		IF .Retcode EQL TRUE THEN	! Don't ACK on error... !		    TCB[pending_ack] = TRUE;G !		    TCP$Send_Ack(.TCB);  > ! If this is a TVT, tell TVT processing that there's new data.   		IF .TCB[IS_TVT] THEN 		    BEGINe 		    TELNET_INPUT(.TCB) ;	 		    ENDh 		ELSE  I ! If we now have enough data to fill the first user receive request, thenE3 ! hurry things along by deli                                                                                                                                                                                                                                                   O                        kc        	IPACP.SRC                      3  ;  [IPACP]TCP_SEGIN.BLI;1                                                                                                         j                              "             vering to the user now.E   		    BEGINs9 		    IF (.Retcode EQL TRUE) THEN	! Don't ACK on error...g !		    TCB[pending_ack] = TRUE;O 			BEGIN 			TCP$Enqueue_Ack(.TCB);C 			END ;  % 		    IF (.QBR NEQ TCB[UR_Qhead]) ANDg3 !		       ((.TCB[RCV_Q_Count] GEQ .QBR[UR$Size]) OR_9 		       ((.TCB[RCV_Q_Count] GTR 0) OR (QB[NR$EOL])) THENE 			BEGIN 			TCP$Deliver_User_Data(.TCB);e 			END ; 		    END ;d 		END;	 	    END;  	TES;s 	END;v  9 !********************************************************F !		Check "FIN" Bit.			!H9 !********************************************************]  /     IF .Seg[SH$C_FIN] AND NOT .Seg_Trimmed THEN_ 	BEGIN0 !	TCB[Pending_ACK] = True;! Flag we need to ACK. 	TCP$Enqueue_ACK(.TCB) ;  I ! Set PUSH pointer to end of this segment to force any current data to beD? ! pushed. Also, attempt to give the user any data that is left.t    	IF .TCB[RCV_Q_Count] GTR 0 THEN
 	    BEGIN 	    TCB[RCV_Push_Flag] = TRUE;t- 	    TCB[RCV_PPtr] = .Seg[SH$SEQ] + .SEQsize;  	    IF .TCB[IS_TVT] THENe0 		TELNET_INPUT(.TCB)	! Attempt to give TVT input	 	    ELSEs; 		TCP$Deliver_User_Data(.TCB); ! Attempt to give user data. 	 	    END;N  D ! If all user data delivered, then flush the user receive queue now.    	IF .TCB[RCV_Q_Count] EQL 0 THEN
 	    BEGIN: 	    WHILE (REMQUE(.TCB[UR_Qhead],QBR)) NEQ Empty_Queue DO 		BEGINO% 		User$Post_IO_Status(.QBR[UR$Uargs], % 				     SS$_NORMAL,0,NSB$PUSHBIT,0);t4 		MM$UArg_Free(.QBR[UR$Uargs]); ! Free user arg blk.( 		MM$QBlk_Free(.QBR);! Free Queue Block. 		END;	 	    END;	   ! Change the Connection State.   	SELECTONE .TCB[State] OF  	SET 	[CS$Established]:
 	    BEGIN+ 	    TCP$Set_TCB_State(.TCB,CS$Close_Wait);./ 	    IF (.TCB[IS_Aborted] OR .TCB[IS_TVT]) THEN  		TCP$TCB_Close(TCB); 	 	    END;]   	[CS$Fin_Wait_1]:B( 	    TCP$Set_TCB_State(.TCB,CS$Closing);   	[CS$Fin_Wait_2]:a
 	    BEGIN  @ ! If no data left or TCB is aborted, then finish closing it now.  >     	    IF (.TCB[RCV_Q_Count] EQL 0) OR .TCB[IS_Aborted] THEN 	    	BEGINa+     		TCP$Set_TCB_State(.TCB,CS$Time_Wait);Q  		IF NOT .TCB[Close_NoWait] THEN7 		    TCP$Post_User_Close_IO_Status(.TCB,SS$_Normal,0);u9 		TCB[Time_Wait_Timer] = Time_Stamp() + Max_Seg_LifeTime;  		ENDd	 	    ELSE	 	    	TCB[FIN_RCVD] = TRUE; 	 	    END;L 	TES;s 	END;!   ! *Done with segment*NJ ! Return value indicating whether or not someone is retaining the segment.I ! FALSE means that the segment shouldn't be deallocated (it is on someoneS< ! else queue). TRUE or ERROR means OK to deallocate segment.       RETURN .RetCode;     END;   G  C ROUTINE Check_Cum_Ack ( TCB : REF TCB_Structure , Idx , P1 , P2 ) =t	     BEGIN        IF .TCB[Pending_ACK] THENk 	BEGIN 	IF NOT .TCB[IS_TVT] THENc> 	    TCP$Deliver_User_Data(.TCB); ! Try to give the user data.9 	XLOG$FAO(LOG$TCP,'!%T SEGIN sending cum ACK, TCB=!XL!/',$ 			     0,.TCB);8 !	TCP$Send_Ack(.TCB); ! send the cumulative ACK segment.: 	TCP$Enqueue_Ack(.TCB); ! send the cumulative ACK segment. 	1 	END
     ELSE 0     END;   i5 %SBTTL 'Network Segment Arrival Main Processing Loop'I %(  	 Function:T  A 	Process the network segment queue (SEGIN[SI_Qhead]).  This queueTA 	is built by IP.  When IP receives a datagram from the network it	E 	handles IP protocols & removes them.  IP then places the TCP segmentmC 	on the SEGIN queue.  Each element in the queue is a standard queuelA 	block with fields defined by "QB_NR_Fields".  These queue blocksnA 	point at the actual TCP segments & contain information about the.	 	segment.    Inputs:I   	None.   Implicit Inputs:  ' 	SEGIN queue header ("SEGIN") is valid.K   Outputs:   	None.   Side Effects:	  C 	TCP segments are processed according to TCP header fields.  ActualCD 	segment maybe deleted or queued depending on the segments contents. )%     LITERAL 2     WKS$TELNET = 23;		! Well-known-port for TELNET  8 GLOBAL ROUTINE SEG$Process_Received_Segments : NOVALUE =	     BEGIN*     EXTERNAL ROUTINE
 	TCB_FIND, 	VTCB_SCAN;	     REGISTER 	TCB: REF TCB_Structure, 	SEG: REF Segment_Structure;	     LOCALc 	RQV,H+ 	QB: REF Queue_Blk_Structure(QB_NR_Fields),E  	sum, 	count,sB 	Need_2_ACK: INITIAL(False), ! assume: NO cumulative ACK's needed. 	IP_Address, 	Delete;	     LABEL[ 	X,Y;E  ' ! Process segments until queue is empty]  J !~~~WHILE XREMQUE(.Segin[SI_Qhead],QB,Process_Received_Segments,Q$SEGIN,0) !~~~	  NEQ Empty_Queue DOo@     WHILE (RQV = REMQUE(.Segin[SI_Qhead],QB)) NEQ Empty_Queue DO 	BEGIN7 	ts$sr = .ts$sr + 1;	! count segments received from IP.G. 	Seg = .QB[NR$Seg];	! point at segment proper.6 	Delete = True;		! assume we will delete this segment. 	SELECTONE .QB[NR$ICMP] OF 	SET! 	[TRUE]:			! ICMP message for TCP 
 	    BEGIN= 	    SwapBytes(.QB[NR$Size]/2,.Seg); ! Swap header bytes backt  J ! Find out what connection this is for. The "segment" is the first part of9 ! the TCP segment we sent out to generate the ICMP reply.   ; 	    TCB = TCB_Find(.Seg[SH$Source_Port],.QB[NR$Dest_Adrs],* 			   .Seg[SH$Dest_Port]); 	    IF .TCB EQL 0 THEN* 		BEGIN*( 		IF $$LOGF(LOG$TCPERR OR LOG$ICMP) THEN 		    BEGINe 		    LOCALH 			DESC$STR_ALLOC(fhstr,20);2 !!		    ASCII_DEC_BYTES(fhstr,4,.QB[NR$Dest_Adrs],/ 		    ASCII_DEC_BYTES(fhstr,4,QB[NR$Dest_Adrs],	 				    fhstr[DSC$W_LENGTH]);S@ 		    LOG$FAO('!%T ICMP for unknown TCB,FH=!AS,FP=!XL,LP=!XL!/                                                                                                                                                                                                                                                   ]                        l        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        M            ',8 			    0,fhstr,.seg[SH$Dest_Port],.seg[SH$Source_Port]);
 		    END; 		ENDw	 	    ELSE  		BEGINn 		XLOG$FAO(LOG$ICMP,& 			 '!%T ICMP type !SL for TCB !XL!/', 			 0,.QB[NR$ICM_TYPE],.TCB);o 		SELECTONE .QB[NR$ICM_TYPE] OFi 		SETN< 		[ICM_DUNREACH]:	! Destination unreachable - treat as RESET 		    BEGIN(/ 		    TCP$KILL_PENDING_REQUESTS(.TCB,NET$_URC);T( 		    XLOG$FAO(LOG$TCBSTATE OR LOG$ICMP,8 			     '!%T TCB !XL killed by ICMP Dest Unreachable!/', 			     0,.TCB);( 		    TCP$Inactivate_TCB(.TCB,NET$_URC);
 		    END;  1 		[ICM_TEXCEED]:	! Time exceeded - treat as RESET* 		    BEGINC/ 		    TCP$KILL_PENDING_REQUESTS(.TCB,NET$_CTO);*( 		    XLOG$FAO(LOG$TCBSTATE OR LOG$ICMP,5 			     '!%T TCB !XL killed by ICMP Time Exceeded!/',a 			     0,.TCB);( 		    TCP$Inactivate_TCB(.TCB,NET$_CTO);
 		    END;  4 		[ICM_SQUENCH]:	! Source quench - not yet supported 		    BEGINP( 		    XLOG$FAO(LOG$TCBSTATE OR LOG$ICMP,4 			     '!%T TCB !XL received ICMP Source Quench!/', 			     0,.TCB); 		    TCB[SQUENCH] = TRUE ;m< 		    TCB[SQUENCH_Timer] = Time_Stamp() + SQUENCH_Interval ;
 		    END;  0 		[ICM_REDIRECT]:	! Redirect - not yet supported 		    BEGINH( 		    XLOG$FAO(LOG$TCBSTATE OR LOG$ICMP,/ 			     '!%T TCB !XL received ICMP Redirect!/',f 			     0,.TCB);
 		    END;  9 		[ICM_PPROBLEM]:	! Parameter problem - not yet supported_ 		    BEGIN_( 		    XLOG$FAO(LOG$TCBSTATE OR LOG$ICMP,8 			     '!%T TCB !XL received ICMP Parameter Problem!/', 			     0,.TCB);
 		    END; 		TES; 		END; 	    END;		! ICMP case   	[FALSE]:		! A real TCP segment  X:	    BEGIN    ! Good segment. Verify checksum.  ; 	    sum = Gen_Checksum(.QB[NR$Size],.Seg,.QB[NR$Src_Adrs],U* 			       .QB[NR$Dest_Adrs],TCP_Protocol); 	    IF .sum NEQU %X'FFFF' THENo# 		BEGIN		! Checksum error - punt ite 		IF $$LOGF(LOG$TCPERR) THEN 		    BEGIN @ 		    LOG$FAO('!%T TCP Checksum error (sum=!XL) for segment:!/', 			    0,.sum); 3 		    SEG$Log_Segment(.Seg,.QB[NR$Size],True,True);e
 		    END;
 		LEAVE X; 		END;  @ 	    SwapBytes(TCP_Header_size/2,.Seg); ! Swap header bytes back( 	    Seg[SH$SEQ] = ROT(.Seg[SH$SEQ],16);( 	    Seg[SH$ACK] = ROT(.Seg[SH$ACK],16);   	    IF $$LOGF(LOG$TCP) THEN0 		SEG$LOG_Segment(.Seg,.QB[NR$Size],True,False); 		  < ! Now, find the connection that this segment is dest                                                                                                                                                                                                                                                   P                        ,R        	IPACP.SRC                      3  ;  [IPACP]TCP_SEGIN.BLI;1                                                                                                         j                              b             ined for  9 	    TCB = TCB_Find (.Seg[SH$Dest_Port],.QB[NR$Src_Adrs],e 			    .Seg[SH$Source_Port]);_  H ! If no connection found, then check for special controls we can handle.   	    IF .TCB EQL 0 THENi	 Y:		BEGINR 		SELECTONE TRUE OF_ 		SETB$ 		[.Seg[SH$C_RST]]: ! RESET segment? 		    BEGINt 		    XLOG$FAO(LOG$TCPERR,7 			'!%T RST received for unknown TCB, SP=!SL,DP=!SL!/', . 			0,.Seg[SH$Source_Port],.Seg[SH$Dest_Port]); 		    LEAVE X;
 		    END;  $ 		[.Seg[SH$C_SYN]]: ! "SYN" Segment? 		    BEGINi 		    LOCALr 			TMP;   N ! Check for SYN on well-known-socket (port). If OK, then fork server and queue4 ! the SYN for later processing on the SYN-wait-list.  ; 		    TMP = Check_WKS(.QB[NR$Dest_Adrs],.Seg[SH$Dest_Port],	. 				    .QB[NR$Src_Adrs],.Seg[SH$Source_Port], 				    .QB,.Seg);' 		    IF (.TMP EQL ERROR) THEN LEAVE X;E 		    IF (.TMP EQL TRUE) THEN_ 			BEGIN 			Delete = FALSE; 			LEAVE X;; 			END;D  D ! No WKS defined. If TELNET port, then try to create TVT connection.  0 		    IF (.Seg[SH$Dest_Port] EQL WKS$TELNET) AND% 		       (.TELNET_SERVICE NEQ 0) THEN* 			BEGIN) 			TCB = TELNET_CREATE(.QB[NR$Dest_Adrs],_ 					    .Seg[SH$Dest_Port], 					    .QB[NR$Src_Adrs], 					    .Seg[SH$Source_Port]);e 			IF .TCB NEQ 0 THENf 			    LEAVE Y;f 			END;c  * ! Connection not found. Give a RESET back.  $ 		    IP_Address = .QB[NR$Src_Adrs];O     ACT$FAO('!%D SYN received for unknown port !UW from <!UB.!UB.!UB.!UB>!/',0,  			.Seg[SH$Dest_Port],% 			.IP_Address<0,8>,.IP_Address<8,8>,_( 			.IP_Address<16,8>,.IP_Address<24,8>);) 		    Reset_Unknown_Connection(.Seg,.QB);e 		    LEAVE X;
 		    END;  : ! Connection not found and not SYN or RST - return an RST.   		[OTHERWISE]: 		    BEGIN ) 		    Reset_Unknown_Connection(.Seg,.QB);H 		    LEAVE X;
 		    END; 		TES; 		END;  : ! Here when we have a TCP connection. Process the segment.F ! ** Warning** TCB/connection maybe deleted during segment processing.A ! Condition is flaged by Decode-segment return code of Error(-1).e  , 	    delete = Decode_Segment(.TCB,.Seg,.QB); 	    IF .delete NEQ Error THEN 		BEGINt  G ! Do we need to check for cumulative ACK transmission after the Segment, ! input queue is exhausted?C   		IF .TCB[pending_ack] THENT 		    Need_2_ACK = True;  7 ! See if we can remove some stuff from the future queuee  ( 		IF Queue_Not_Empty(TCB[RF_Qhead]) THEN 		    Check_Future_Q(.TCB);  		END;' 	    END;		! TCP segment case (block X)  	TES;   2 ! Clean up, possibly delete segment & queue-block.J ! *** Warning *** "Delete" can be one of 3 values(-1,0,1).  Following test; ! checks low-bit only( case covers BOTH 1 & -1).  Be aware!SL ! check if we can really delete the segment or does somebody else lay claim.           IF (.Delete NEQ 0) THEND
 	    BEGIN/ 	    MM$Seg_Free(.QB[NR$Buf_Size],.QB[NR$Buf]);t 	    MM$QBLK_Free(.QB);t	 	    END;  	END;			! "While"e  E ! Check if any connections need to have a cumulative ACK transmitted.aD ! If True then check all valid connections & if the TCB[Pending_ACK]J ! bit is set then Attempt to deliver user data & send an ACK (cumulative).* ! Otherwise continue checking connections.       IF .Need_2_ACK THENF% 	VTCB_Scan ( Check_Cum_Ack , 0 , 0 );O       END; ENDE ELUDOMCP$Deliver_User_Data(.TCB); ! Try to give the user data.9 	XLOG$FAO(LOG$TCP,'!%T SEGIN sending cum ACK, TCB=!XL!/',$ 			     0,.TCB);8 !	TCP$Send_Ack(.TCB); ! send the cumulative ACK segment.: 	TCP$Enqueue_Ack(.TCB); ! send the cumulative ACK segment. 	1 	END
     ELSE 0     END;   i5 %SBTTL 'Network Segment Arrival                * [IPACP]TCP_TELNET.BLI;1 +  ,    .     /     4 c       .                    - ;    0   1    2   3      K  P   W   O     5   6  [oW,  7 7-  8          9          G    H  J                         %(A 	****************************************************************   0 		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.  A 	****************************************************************  )%5 %TITLE 'TCP_TELNET - TELNET Virtual Terminal service'  %(	 Facility:   = 	TCP_TELNET - Run incoming TELNET service under TCP (RFC 854)   	 Abstract:   A 	Supports incoming TEL                                                                                                                                                                                                                                                   ^                        >        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        e            NET virtual terminal traffic by routing TCP 9 	data between pseudo-terminals and the rest of the IPACP.    Author:   $ 	Vince Fuller, CMU-CSD, Summer, 1987@ 	Copyright (c) 1987, Vince Fuller and Carnegie-Mellon University   Module Modification History:   1.11 	7-Jan-1992	John Clement; 	Put in hold off in PTY_WRITE until process is available on 6 	Terminal side.  And fixed LOG$TVT write in PTY_Write.   1.10. 	3-Dec-1991	John Clement		Rice University (JC)  < 	Binary_On, Binary_Off added to turn on/off EIGHTBIT,PASTHRU4 	Extended_ASCII_On,Off added to trun on/off EIGHTBIT  % 1.9	14-Nov-1991	Henry W. Miller		USBR C 	Rework TELNET server logic.  Changes are too numerous to list, but  	highlights are:A 	TELNET_INPUT() and TELNET_OUTPUT() now call the PTY I/O routines " 	rather than the TCP I/O routines.A 	PTY_READ() and PTY_WRITE() now call the TCP I/O routines, rather  	than vice versa. G 	New routine NET_TO_PTY() now fills the PTY buffer from the TCP buffer, 3 	and handles buffer wrapping and overflow properly. ? 	PTY_WRITE() now handles buffer wrapping and overflow properly. 8 	Call TCP$Enqueue_ACK() rather than setting PENDING_ACK.  ; 1.8	13-Nov-1991 Edit by John M. Clement(JC)	Rice University $ 	Modified to make Negotiations work.  % 1.7	15-Oct-1991	Henry W. Miller		USBR C 	Rearrange logging code in PTY_WRITE() so we can see how many bytes + 	would have been written if the $QIO fails.   % 1.6	18-Jul-1991	Henry W. Miller		USBR @ 	Use LIB$GET_VM_PAGE and LIB$FREE_VM_PAGE rather then LIB$GET_VM 	and LIB$FREE_VM.   % 1.5	28-Jan-1991	Henry W. Miller		USBR , 	Make ACK_THRESHOLD a configurable variable.  ? 1.4	04-Sep-1989	Bruce R. Miller         CMU Network Development # 	Adding support for LineMode option     I 1.3	15-Dec-1988, Edit by Simon Hackett, University of Adelaide, Australia @ 	Routine PTY_SET_OWNER_PID to allow identification of the PID of 	a TELNET session.  8 1.2	20-Feb-1989	Bruce R. Miller		CMU Network DevelopmentA 	Added support for several new options: Timing-Mark, Window-Size, $ 	Terminal-Type, Remote-Flow-control.  8 1.2	01-Feb-1989	Bruce R. Miller		CMU Network Development> 	Added routine TCP_ADD_STRING() to send a string over the net.3 	Added AYT (Are you there?) recognition & response.   $ 1.2	09-JUN-1988	Dale Moore	CMU-CS/RIA 	Modified to return to State Normal upon receiving IAC <silly> or ; 	IAC <unknown>.  Also be willing to negotiate Supress GA in  	both directions.    1.1  19-Nov-87, Edit by VAF ( 	$ACPWAKE macro is now in TCPMACROS.REQ.   1.0  31-Jul-87, Edit by VAF > 	Initial version. Loosely based on Dale Moore's                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   Q                        @        	IPACP.SRC                        ;  [IPACP]TCP_TELNET.BLI;1                                                                                                        c                              J             TELNET_SERVER.   )%  - MODULE TELNET(IDENT='1.11',LANGUAGE(BLISS32), . 	      ADDRESSING_MODE(EXTERNAL=LONG_RELATIVE,$ 			      NONEXTERNAL=LONG_RELATIVE),, 	      LIST(REQUIRE,ASSEMBLY,OBJECT,BINARY),  	      OPTIMIZE,OPTLEVEL=3,ZIP)= BEGIN   E !!!HACK!!! why does this module make so many refs to AST_in_Progress?   7 LIBRARY 'SYS$LIBRARY:STARLET';	! VMS system definitions A LIBRARY 'CMUIP_SRC:[CENTRAL]NETXPORT';	! BLISS common definitions < LIBRARY 'CMUIP_SRC:[CENTRAL]NETERROR';	! Network error codesA LIBRARY 'CMUIP_SRC:[CENTRAL]NETVMS';			! VMS-specific definitions 5 LIBRARY 'TCPMACROS';		! System-wide Macro definitions 9 LIBRARY 'STRUCTURE';		! System-wide structure definitions * LIBRARY 'TCP';			! TCP related definitions0 LIBRARY 'TELNET';		! TELNET protocol definitions   EXTERNAL     LOCAL_NAME,      AST_IN_PROGRESS;   EXTERNAL LITERAL     M$INTERNAL : UNSIGNED(8);    EXTERNAL ROUTINE     TCP$TCB_CLOSE,     TCB$Create,      TCB$Delete : NOVALUE,      TCP$Enqueue_Ack : NOVALUE,     TCP$Send_Ack : NOVALUE,      TCP$Send_Data,     TCP$TCB_Init,      TIME_STAMP,      Check_Unique_Conn,     Conect_Insert : NOVALUE;   LITERAL I     TVT_OPEN_TIMEOUT = 120*CSEC; ! Amount of time to wait for TVT to open   
 LITERAL		!*     Telnet$K_Char_AO	= %O'17',	! Control-O+     Telnet$K_Char_AYT	= %O'24',	! Control-T +     Telnet$K_Char_Brk	= %O'31',	! Control-Y %     Telnet$K_Char_EC	= %O'177',	! DEL -     Telnet$K_Char_Purge	= %X'18',	! Control-X *     Telnet$K_Char_EL	= %O'25',	! Control-U+     Telnet$K_Char_IP	= %O'03';	! Control-C.        %SBTTL 'TELNET definitions'   , ! Define the structure of a PTY status block   $FIELD PTY$IOSB_FIELDS =     SET )     PTSB$STATUS	= [$UWORD],	! $QIO status 9     PTSB$NBYTES	= [$UWORD],	! Number of bytes transferred /     PTSB$EXTRA1	= [$UWORD],	! Extra information .     PTSB$EXTRA2	= [$UWORD]	! Extra information     TES; LITERAL $     PTY$IOSB_SIZE = $FIELD_SET_SIZE; MACRO =     PTY$IOSB = BLOCK[PTY$IOSB_SIZE] FIELD(PTY$IOSB_FIELDS) %;   M ! USE_ASTS nonzero means we should do all TCP I/O at AST level and thus it is = ! OK to directly call TCP_READ and TCP_WRITE in AST routines.    COMPILETIME      USE_ASTS = 1;    %SBTTL 'Module data'   BIND      PTY_NAME = %ASCID'INET$PTY',(     AYT_RESPONSE = %ASCID'[definitely]';  / ! Define the default options state for new TVTs    EXTERNAL ROUTINE     Timing_Mark_On,      Terminal_Type_On,      Terminal_Type_Sub,     Window_Size_On,      Window_Size_Sub,     Set_DEVDEP,				! JC      LineMode_Sub;    OWN $     DEFAULT_OPTION_BLOCK : OPT$BLOCK 	PRESET(" 	    [OPT$STATE]		= OPT$STATE_OFF, 	    [OPT$CURRENT]	= FALSE, # 	    [OPT$PREFER]	= OPT$STATE_OFF),      TVT_DEF_LOCAL : OPT$LIST 	PRESET(2 	    [TELNET$K_BINARY, OPT$STATE]	= OPT$STATE_OFF,, 	    [TELNET$K_BINARY, OPT$CURRENT]	= FALSE,3 	    [TELNET$K_BINARY, OPT$PREFER]	= OPT$DONT_CARE, 5 	    [TELNET$K_BINARY, OPT$ON_RTN]	= Set_DEVDEP,		!JC 6 	    [TELNET$K_BINARY, OPT$OFF_RTN]	= Set_DEVDEP,		!JC  5 	    [TELNET$K_ECHO, OPT$STATE]		= OPT$STATE_OFF,	!JC / 	    [TELNET$K_ECHO, OPT$CURRENT]	= FALSE,		!JC 6 	    [TELNET$K_ECHO, OPT$PREFER]		= OPT$STATE_ON,		!JC4 	    [TELNET$K_ECHO, OPT$ON_RTN]		= Set_DEVDEP,		!JC4 	    [TELNET$K_ECHO, OPT$OFF_RTN]	= Set_DEVDEP,		!JC  2 	    [TELNET$K_SUPRGA, OPT$STATE]	= OPT$STATE_OFF,, 	    [TELNET$K_SUPRGA, OPT$CURRENT]	= FALSE,2 	    [TELNET$K_SUPRGA, OPT$PREFER]	= OPT$STATE_ON,  7 	    [TELNET$K_Timing_Mark, OPT$STATE]	= OPT$STATE_OFF, 1 	    [TELNET$K_Timing_Mark, OPT$CURRENT]	= FALSE, 9 	    [TELNET$K_Timing_Mark, OPT$ON_RTN]	= Timing_Mark_On, 8 	    [TELNET$K_Timing_Mark, OPT$PREFER]	= OPT$DONT_CARE,  = 	    [TELNET$K_Extended_Ascii, OPT$STATE]	= OPT$STATE_OFF,!JC 8 	    [TELNET$K_Extended_Ascii, OPT$CURRENT]	= FALSE,	!JC> 	    [TELNET$K_Extended_Ascii, OPT$PREFER]	= OPT$DONT_CARE,!JC< 	    [TELNET$K_Extended_Ascii, OPT$ON_RTN]	= Set_DEVDEP,	!JC= 	    [TELNET$K_Extended_Ascii, OPT$OFF_RTN]	= Set_DEVDEP,	!JC   < !!!JC	    [TELNET$K_Window_Size, OPT$STATE]	= OPT$STATE_OFF,6 !!!JC	    [TELNET$K_Window_Size, OPT$CURRENT]	= FALSE,< !!!JC	    [TELNET$K_Window_Size, OPT$PREFER]	= OPT$STATE_ON,@ !!!JC	    [TELNET$K_Window_Size, OPT$SUB_RTN] = Window_Size_Sub,  4 	    [TELNET$K_LineMode, OPT$STATE]	= OPT$STATE_OFF,. 	    [TELNET$K_LineMode, OPT$CURRENT]	= FALSE,6 	                                                                                                                                                                                                                                                      _                                
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        >      
       [TELNET$K_LineMode, OPT$PREFER]	= OPT$STATE_Off),       TVT_DEF_REMOTE : OPT$LIST  	PRESET(2 	    [TELNET$K_BINARY, OPT$STATE]	= OPT$STATE_OFF,, 	    [TELNET$K_BINARY, OPT$CURRENT]	= FALSE,3 	    [TELNET$K_BINARY, OPT$PREFER]	= OPT$DONT_CARE,   : !!!JC	    [TELNET$K_ECHO, OPT$STATE]		= OPT$STATE_OFF,	!JC4 !!!JC	    [TELNET$K_ECHO, OPT$CURRENT]	= FALSE,		!JC; !!!JC	    [TELNET$K_ECHO, OPT$PREFER]		= OPT$DONT_CARE,	!JC   2 	    [TELNET$K_SUPRGA, OPT$STATE]	= OPT$STATE_OFF,, 	    [TELNET$K_SUPRGA, OPT$CURRENT]	= FALSE,2 	    [TELNET$K_SUPRGA, OPT$PREFER]	= OPT$STATE_ON,  7 	    [TELNET$K_Timing_Mark, OPT$STATE]	= OPT$STATE_OFF,i1 	    [TELNET$K_Timing_Mark, OPT$CURRENT]	= FALSE,m8 	    [TELNET$K_Timing_Mark, OPT$PREFER]	= OPT$DONT_CARE,  = 	    [TELNET$K_Extended_Ascii, OPT$STATE]	= OPT$STATE_OFF,!JC,8 	    [TELNET$K_Extended_Ascii, OPT$CURRENT]	= FALSE,	!JC> 	    [TELNET$K_Extended_Ascii, OPT$PREFER]	= OPT$DONT_CARE,!JC  : 	    [TELNET$K_Terminal_Type, OPT$STATE]		= OPT$STATE_OFF,3 	    [TELNET$K_Terminal_Type, OPT$CURRENT]	= FALSE,*@ 	    [TELNET$K_Terminal_Type, OPT$PREFER]	= OPT$STATE_ON,	!!! JC= 	    [TELNET$K_Terminal_Type, OPT$ON_RTN]	= Terminal_Type_On, ? 	    [TELNET$K_Terminal_Type, OPT$SUB_RTN]	= Terminal_Type_Sub,p  7 	    [TELNET$K_Window_Size, OPT$STATE]	= OPT$STATE_OFF,C1 	    [TELNET$K_Window_Size, OPT$CURRENT]	= FALSE,t? 	    [TELNET$K_Window_Size, OPT$PREFER]	= OPT$STATE_ON,		!!! JCC9 	    [TELNET$K_Window_Size, OPT$ON_RTN]	= Window_Size_On,i; 	    [TELNET$K_Window_Size, OPT$SUB_RTN]	= Window_Size_Sub,C  ? 	    [TELNET$K_Toggle_Flow_Control, OPT$STATE]	= OPT$STATE_OFF, 9 	    [TELNET$K_Toggle_Flow_Control, OPT$CURRENT]	= FALSE, ? 	    [TELNET$K_Toggle_Flow_Control, OPT$PREFER]	= OPT$STATE_ON,n  4 	    [TELNET$K_LineMode, OPT$STATE]	= OPT$STATE_OFF,. 	    [TELNET$K_LineMode, OPT$CURRENT]	= FALSE,5 	    [TELNET$K_LineMode, OPT$PREFER]	= OPT$STATE_OFF,N6 	    [TELNET$K_LineMode, OPT$SUB_RTN]	= LineMode_Sub);   g  > %SBTTL 'TELNET_CREATE - Initialize a TCP connection for a TVT' %(G     Creates and initializes a TCB for a new TVT connection. Called from(H     segment input processor when a SYN segment has been received for the(     well-known TELNET port (WKS$TELNET). )%   FORWARD ROUTINEd"     TELNET_OPEN_TIMEOUT : NOVALUE;  7 GLOBAL ROUTINE TELNET_CREATE(LHOST,LPORT,FHOST,FPORT) =o	     BEGINp	     LOCALl 	TCB : REF TCB_STRUCTURE,t 	CIDX;  N ! Check for unique connection. We actually know that the connection is alreadyL ! unique, but we do this for the side effect of being inserted in the CONECT ! table.  
     NOINT;  A     IF Check_Unique_Conn(.LPORT,.FHOST,.FPORT,CIDX) NEQ TRUE THENt 	BEGINF 	XLOG$FAO(LOG$TCPERR,'!%T TVT create failed - CONECT table full!/',0); 	OKINT;d
 	RETURN 0; 	END;a  ! ! Create and initialize a new TCBM  *     IF (TCB = TCB$Create()) EQL Error THEN 	BEGIN8 	XLOG$FAO(LOG$TCPERR,'!%T TVT TCB creation failed!/',0); 	OKINT;l
 	RETURN 0; 	END;w  & ! Perform standard TCB initializations       TCP$TCB_Init(.TCB);c  M ! Setup standard TVT TCB fields. Note that segment input processing code willTH ! setup wild foreign host/port and local host when this routine returns.  (     TCB[IS_TVT] = TRUE;		! This is a TVT.     TCB[TVTDATA] = 0;		! No TVT data block yet7     TCB[Local_Host] = .LHOST;	! Set local host and porto     TCB[Local_Port]                                                                                                                                                                                                                                                    R                        0        	IPACP.SRC                        ;  [IPACP]TCP_TELNET.BLI;1                                                                                                        c                              Y             = .LPORT;r;     TCB[Foreign_Host] = .FHOST;	! Set foreign host and portD     TCB[Foreign_Port] = .FPORT;h@     TCB[UCB_ADRS] = 0;		! No UCB for this, since no user process@     TCB[STATE] = CS$LISTEN;	! Initial state is listening for SYN     TCB[CON_INDEX] = .CIDX;l=     Conect_Insert(.TCB,.CIDX);	! Insert into connection tableA  ' ! Setup a handler if the open times-out        TCB[Pending_IO] = TRUE;s)     TCB[Curr_User_Function] = M$INTERNAL;d/     TCB[Timeout_Routine] = TELNET_OPEN_TIMEOUT;l:     TCB[Function_Timer] = Time_Stamp() + TVT_Open_Timeout;   ! And return the TCB address  
     OKINT;     RETURN .TCB;     END;  , ROUTINE TELNET_OPEN_TIMEOUT(TCB) : NOVALUE =	     BEGINY !JJ !   Come here from user function timeout code if a TVT connection does notH !   become established soon enough after we first see the SYN for it. We !   simply flush the TCB.e !i     MAPI 	TCB : REF TCB_STRUCTURE;E  . !~~~ Maybe we should do something better here?  F     XLOG$FAO(LOG$TCPERR,'!%T TVT open timeout for TCB x!XL!/',0,.TCB);     TCB$Delete(.TCB);e     END; i> %SBTTL 'TELNET_OPEN - Finish open of TCP connection for a TVT' %(I     Finish setup of TELNET connection, creating TVT data block within thePG     TCB and performing assigmnent/initialization of the pseudo-terminal M     device associated with this connection. Called from segment input handlerE8     when TCP connection goes into the ESTABLISHED state. )%   FORWARD ROUTINE      TVT_NEGOTIATE : NOVALUE,     TCP_READ : NOVALUE,,     TCP_ADD_STRING : NOVALUE,      TCP_WRITE : NOVALUE,     PTY_READ : NOVALUE,A     PTY_WRITE : NOVALUE,     NET_TO_PTY : NOVALUE,A     PTY_TO_NET : NOVALUE,P     MBX_READ,0     MBX_READ_DONE : NOVALUE;  5 ROUTINE namelook_done(tvt,rc,namlen,name) : NOVALUE =% !+& !	Fills in the name of the remote port !-	     BEGINo     MAP  	TVT : REF TVT$BLOCK;3	     LOCALo 	TCB : REF TCB_STRUCTURE,= 	nambuf : VECTOR[100,BYTE],K$ 	nam	: $BBLOCK[DSC$K_S_BLN] PRESET (' 		[DSC$W_LENGTH] = %ALLOCATION(nambuf),   		[DSC$B_DTYPE] = DSC$K_DTYPE_Z,  		[DSC$B_CLASS] = DSC$K_CLASS_Z, 		[DSC$A_POINTER] = nambuf), 	accporbuf : VECTOR[100,BYTE],* 	accpornam : $BBLOCK[DSC$K_S_BLN] PRESET (* 		[DSC$W_LENGTH] = %ALLOCATION(accporbuf),  		[DSC$B_DTYPE] = DSC$K_DTYPE_Z,  		[DSC$B_CLASS] = DSC$K_CLASS_Z, 		[DSC$A_POINTER] = accporbuf);o       IF (NOT .RC) THEN RETURN;E  %     TCB = .TVT[TVT$TCB];				! get TCB   %     IF $TRNLOG(						! JC Get logical 8 		LOGNAM=%ASCID'TELNET_PASS_PORT',	! Pass on port number! 		RSLLEN=nam[DSC$W_LENGTH],		! JC  		RSLBUF=nam)				! JCt 	    EQL SS$_Normalt     THEN 	RC = $FAO(%ASCID'!AF!AS!UL',T$ 		accpornam[DSC$W_LENGTH],accpornam, 		.namlen,.name, 		nam, 		.TCB[Foreign_PORT] 		)      ELSE 	RC = $FAO(%ASCID'!AF',Y$ 		accpornam[DSC$W_LENGTH],accpornam, 		.namlen,.namee 		);     XLOG$FAO(LOG$TELNETn* 	,'!%T Namelook_done: Access port=!AS!/',0 	,accpornam);m !l; !	It is better to have the correct name than a truncated on  !d+     IF .accpornam[DSC$W_LENGTH] GTR 30 THENi0 	RETURN(SS$_NORMAL);				! JC IF too long skip it# !!!JC	accpornam[DSC$W_LENGTH] = 30;	     IF .RC THEN 5 	RC = $QIOW (CHAN=.TVT[TVT$PTY_CHN],FUNC=IO$_SETMODE,T) 			P1=.accpornam[DSC$A_POINTER],	! BufferP& 			P2=.accpornam[DSC$W_LENGTH],	! Size 			P4=4				! Sub-func #4 			);K       END;  ! GLOBAL ROUTINE TELNET_OPEN(TCB) =N	     BEGINE     EXTERNAL ROUTINE2 	LIB$GET_VM_PAGE : BLISS ADDRESSING_MODE(GENERAL),2 	LIB$ASN_WTH_MBX : BLISS ADDRESSING_MODE(GENERAL),- 	LIB$GETDVI	: BLISS ADDRESSING_MODE(GENERAL),O 	Print,O 	Line_Changed_AST;    EXTERNAL ROUTINET 	NML$GETNAME;      MAPE 	TCB : REF TCB_STRUCTURE; 	     LOCALN 	nambuf : VECTOR[256,BYTE],O$ 	nam	: $BBLOCK[DSC$K_S_BLN] PRESET (' 		[DSC$W_LENGTH] = %ALLOCATION(nambuf),	  		[DSC$B_DTYPE] = DSC$K_DTYPE_Z,                                                                                                                                                                                                                                                   `                        R/        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        T              		[DSC$B_CLASS] = DSC$K_CLASS_Z, 		[DSC$A_POINTER] = nambuf), 	accporbuf : VECTOR[100,BYTE],* 	accpornam : $BBLOCK[DSC$K_S_BLN] PRESET (* 		[DSC$W_LENGTH] = %ALLOCATION(accporbuf),  		[DSC$B_DTYPE] = DSC$K_DTYPE_Z,  		[DSC$B_CLASS] = DSC$K_CLASS_Z, 		[DSC$A_POINTER] = accporbuf),M 	TVT : REF TVT$BLOCK,K	 	PTYCHAN,k	 	MBXCHAN,R 	Status, 	RC, 	IO_STATS : BLOCK[8,BYTE], 	tmp : SIGNED LONG, & 	TMPBUF : BLOCK[TVT_TTY_BUFLEN, BYTE]," 	TMPDSC : BLOCK[DSC$K_Z_BLN,BYTE];  2 ! Clear the pending open that we were waiting for.       TCB[Pending_IO] = FALSE;  1 ! Assign a chunk of memory for the TVT data blockT  + !    RC = LIB$GET_VM(%REF(TVT$SIZE*4),TVT);J?     RC = LIB$GET_VM_PAGE(%REF(((TVT$SIZE * 4) / 512) + 1),TVT);,     IF NOT .RC THEN_ 	BEGIN' !~~~ Should we do anything better here?L 	XLOG$FAO(LOG$TCPERR,PE 	  '!%T Telnet_Open: LIB$GET_VM_PAGE failure for TCB=x!XL, RC=x!XL!/'  	  ,0,.TCB,.RC); 	TCB$DELETE(.TCB); 	RETURN FALSE; 	END;$   ! Clear out the TVT data block  '     CH$FILL(0,TVT$SIZE*4,CH$PTR(.TVT));n     TVT[TVT$TCB] = .TCB;  < ! Initialize the options block to the standard initial state  H     CH$MOVE(OPT$LSTBLEN,CH$PTR(TVT_DEF_LOCAL),CH$PTR(TVT[TVT$LCLOPTS]));I     CH$MOVE(OPT$LSTBLEN,CH$PTR(TVT_DEF_REMOTE),CH$PTR(TVT[TVT$REMOPTS]));	  ( ! Assign the PTY device and start it up.  "     RC = LIB$ASN_WTH_MBX(PTY_NAME, 			 %REF(TVT_MBX_BUFLEN),! 			 %REF(TVT_MBX_BUFLEN),$ 			 PTYCHAN, 			 MBXCHAN);      IF NOT .RC THENP 	BEGIN 	    XLOG$FAO(LOG$TCPERR, @ 		'!%T Telnet_Open:  PTY assign failure for TCB x!XL, RC=x!XL!/' 		,0,.TCB,.RC);T 	    TCB$DELETE(.TCB); 	    RETURN FALSE; 	END;]    + ! Associate the TVT with the TCP connectionP        TVT[TVT$PTY_CHN] = .PTYCHAN;      TVT[TVT$MBX_CHN] = .MBXCHAN;     TCB[TVTDATA] = .TVT;  & ! Fill in the access port as [n.n.n.n]%     IF $TRNLOG(						! JC Get logicalO8 		LOGNAM=%ASCID'TELNET_PASS_PORT',	! Pass on port number! 		RSLLEN=nam[DSC$W_LENGTH],		! JC  		RSLBUF=nam)				! JCy 	    EQL SS$_Normal$     THEN						! JC If got it) 	RC = $FAO(%ASCID'!UB.!UB.!UB.!UB!AS!UL',E$ 		accpornam[DSC$W_LENGTH],accpornam, 		.(TCB[Foreign_Host])< 0,8,0>,K 		.(TCB[Foreign_Host])< 8,8,0>,m 		.(TCB[Foreign_Host])<16,8,0>,r 		.(TCB[Foreign_Host])<24,8,0>,a 		nam, 		.TCB[Foreign_PORT] 		)o     ELSE# 	RC = $FAO(%ASCID'!UB.!UB.!UB.!UB',N$ 		accpornam[DSC$W_LENGTH],accpornam, 		.(TCB[Foreign_Host])< 0,8,0>,P 		.(TCB[Foreign_Host])< 8,8,0>,C 		.(TCB[Foreign_Host])<16,8,0>,$ 		.(TCB[Foreign_Host])<24,8,0> 		);     XLOG$FAO(LOG$TELNET_( 	,'!%T Telnet_Open: Remote host=!AS!/',0 	,accpornam);n:     IF .accpornam[DSC$W_LENGTH] GTR 30 THEN		! IF too long, 	accpornam[DSC$W_LENGTH] = 30;			! Adjust it     IF .RC THENC5 	RC = $QIOW (CHAN=.TVT[TVT$PTY_CHN],FUNC=IO$_SETMODE,L) 			P1=.accpornam[DSC$A_POINTER],	! Buffer[& 			P2=.accpornam[DSC$W_LENGTH],	! Size 			P4=4				! Sub-func #4 			);E  / ! Fill in the actual name after name resolutionT9     NML$GETNAME(.TCB[Foreign_Host], namelook_done, .TVT);   % ! Start a receive on the PTY mailbox.(       IF NOT MBX_READ(.TVT) THEN 	BEGIN 	TCB$DELETE(.TCB); 	RETURN FALSE; 	END;n   ! Initialize buffer pointers  .     TVT[TVT$RD_PTR] = CH$PTR(TVT[TVT$RD_BUF]);/ !    TVT[TVT$WR_PTR] = CH$PTR(TVT[TVT$WR_BUF]);      TVT[TVT$WR_IPTR] = 0 ;     TVT[TVT$WR_OPTR] = 0 ;C     TVT[TVT$NEG_EQP] = TVT[TVT$NEG_DQP] = CH$PTR(TVT[TVT$NEG_BUF]);R     TVT[TVT$WR_ICNT] = 0 ;     TVT[TVT$WR_OCNT] = 0 ;     ! % ! Create a banner to send to the userr7 ! The banner is contained in logical TELNET_ANNOUNCE JCn !n  (     TMPDSC[DSC$B_CLASS] = DSC$K_CLASS_Z;(     TMPDSC[DSC$B_DTYPE] = DSC$K_DTYPE_Z;/     TMPDSC[DSC$W_LENGTH] = %ALLOCATION(TMPBUF);O#     TMPDSC[DSC$A_POINTER] = TMPBUF;E7 !    $FAO(%ASCID'!/!AS VAX/VMS (CMU) TELNET Service!/',r, !	TMPDSC[DSC$W_LENGTH], TMPDSC, LOCAL_NAME);  -     NAM                                                                                                                                                                                                                                                    S                        ݇K        	IPACP.SRC                        ;  [IPACP]TCP_TELNET.BLI;1                                                                                                        c                              9      &       [DSC$W_LENGTH] = %ALLOCATION(nambuf);(%     IF $TRNLOG(						! JC Get logical!7 		LOGNAM=%ASCID'TELNET_ANNOUNCE',		! JC name for bannerd! 		RSLLEN=nam[DSC$W_LENGTH],		! JC_ 		RSLBUF=nam)				! JC * 	    EQL SS$_Normal THEN				! JC If got it 	BEGIN+ 	$FAO(%ASCID'!AS!/'				! JC Put into output/% 		,TMPDSC[DSC$W_LENGTH]			! JC buffere 		,TMPDSC					! JC 		,NAM);					! JCi 	TCP_Add_String(.TVT, TMPDSC) ;	 	END ;  A ! Check for creation of terminal side of connection (like _TZA0:)p5 ! when ever we get input, until this flag is cleared.o       TVT[TVT$DO_PID] = 1;  9 ! Stuff the initial <NULL> into the PTY buffer for JOBCTL_  0 !    CH$WCHAR(%CHAR(0),CH$PTR(TVT[TVT$WR_BUF]));       NET_TO_PTY(.TVT, CH_NUL) ;  # ! Queue up the options that we wantC       TVT_NEGOTIATE(.TVT);  7 ! Write the buffered data to the PTY and to the network M ! We assume here that the initial banner can always fit in the network queue.      TCP_WRITE(.TVT);       PTY_WRITE(.TVT);       PTY_READ(.TVT);L   ! And give success return.     TRUE     END; a9 %SBTTL 'TELNET_CLOSE - Handle close of TELNET connection'  %(K     Handle normal close of TELNET connection. Flush the TVT data structure.V:     Called from TCB$Delete just before TCB is deallocated. )%   FORWARD ROUTINEe      TELNET_CLOSE_DONE : NOVALUE;  , GLOBAL ROUTINE TELNET_CLOSE(TCB) : NOVALUE =	     BEGIN      MAPu 	TCB : REF TCB_STRUCTURE;      EXTERNAL ROUTINE 	NML$CANCEL;	     LOCALu% 	FHOST : INITIAL(.TCB[Foreign_Host]),G% 	FPORT : INITIAL(.TCB[Foreign_Port]),o 	TVT : REF TVT$BLOCK;    ! Log this..  A     XLOG$FAO(LOG$TCBSTATE,'!%T TVT TCB x!XL closing, TVT=x!XL!/',t 	     0,.TCB,.TCB[TVTDATA]);K     ACT$FAO('!%D Telnet-in closed to IP addr !UB.!UB.!UB.!UB port=!UW!/',0, 7 	    .FHOST<0,8>,.FHOST<8,8>,.FHOST<16,8>,.FHOST<24,8>,a 	    .FPORT);a  ? ! Make sure we have a TVT and it isn't already being cancelled.        TVT = .TCB[TVTDATA];3     IF (.TVT NEQ 0) AND (NOT .TVT[TVT$CANCEL]) THEN  	BEGIN  ( ! Deassign the PTY and mailbox channels.  = 	NML$CANCEL(.TVT,0,0);	! Cancel the name lookup for accpornam    	NOINT;N 	TVT[TVT$CANCEL] = TRUE;# 	$DASSGN(CHAN = .TVT[TVT$PTY_CHN]); # 	$DASSGN(CHAN = .TVT[TVT$MBX_CHN]);E$ 	$DCLAST(ASTADR = TELNET_CLOSE_DONE, 		ASTPRM = .TVT);n 	OKINT;n 	END;a     END;  * ROUTINE TELNET_CLOSE_DONE(TVT) : NOVALUE = !tD ! Finish deallocation of a TVT, after all AST's have been delivered. !F	     BEGINU     MAPm 	TVT : REF TVT$BLOCK;K     EXTERNAL ROUTINE/ 	LIB$FREE_VM		: BLISS ADDRESSING_MODE(GENERAL),n3 	LIB$FREE_VM_PAGE	: BLISS ADDRESSING_MODE(GENERAL);C  / ! Just deallocate the TVT structure and return.,  ' !    LIB$FREE_VM(%REF(TVT$SIZE*4),TVT);m;     LIB$FREE_VM_PAGE(%REF(((TVT$SIZE * 4) / 512) + 1),TVT);I     END; ,: %SBTTL 'TELNET_INPUT - Do TCP input for TELNET connection' %(G     Process incoming network data for a TELNET connection, handling any F     necessary option negotiations and passing any user data to the PTYK     associated with this connection. Called from segment input handler whenN)     TCP receive window becomes non-empty.	 )%  , GLOBAL ROUTINE TELNET_INPUT(TCB) : NOVALUE =	     BEGINS     MAP	 	TCB : REF TCB_STRUCTURE;p   ! Call TCP input routine   %IF USE_ASTS %THEN     $DCLAST(ASTADR = PTY_WRITE,% 	    ASTPRM = .TCB[TVTDATA])                                                                                                                                                                                                                                                   a                        43        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                              (      ;_ %ELSE,     PTY_WRITE(.TCB[TVTDATA]);	 %FI      END; G< %SBTTL 'TELNET_OUTPUT - Do TCP output for TELNET connection' %(I     Obtain some data to output to the network whenever the TCP send queue M     becomes non-empty. Normally, the PTY read done AST will put data onto the O     TCP output queue (via TCP_WRITE) whenever it arrives over the PTY. When the J     queue fills, however, it effectively 'blocks', without issuing furtherM     PTY reads, until the queue becomes non-full (i.e. the send window opens).	 )%  - GLOBAL ROUTINE TELNET_OUTPUT(TCB) : NOVALUE =N	     BEGINE     MAPE 	TCB : REF TCB_STRUCTURE;A  ( ! Just call TCP write with the TVT's TCB   %IF USE_ASTS %THEN     $DCLAST(ASTADR = PTY_READ, 	    ASTPRM = .TCB[TVTDATA]);E %ELSE      PTY_READ(.TCB[TVTDATA]); %FIT     END; T- %SBTTL 'Routines to interface to the network'C   FORWARD ROUTINE      TVT_READ_WILL : NOVALUE,     TVT_READ_WONT : NOVALUE,     TVT_READ_DO : NOVALUE,     TVT_READ_DONT : NOVALUE,     TVT_READ_SUB : NOVALUE ;  ! ROUTINE TCP_READ(TVT) : NOVALUE =A !IN ! TCP_READ - Read as much data as possible from the network into the PTY write< ! buffer. If no write is yet in progress, start a write now. !B	     BEGINS     MAP_ 	TVT : REF TVT$BLOCK;S     BIND( 	LCLOPTS = TVT[TVT$LCLOPTS] : OPT$LIST ;     EXTERNAL ROUTINE 	IS_CNTRLT_GOOD;	     LOCAL, 	TCB : REF TCB_STRUCTURE,, 	Byte_Count, 	Byte_Limit, 	Prev_Char,L 	CHRPTR, 	CHRCNT, 	CHWPTR, 	CHR, 	 	NEGCNT ;_	     LABEL; 	X;   , ! Empty out PTY, so we can accept more input   !    PTY_READ(.TVT) ;   7 ! If the PTY write buffer is busy, then don't run here.T       IF .TVT[TVT$PWRITE] THEN 	RETURN;   ! Is there any data to write?%       TCB = .TVT[TVT$TCB];#     IF .TCB[RCV_Q_COUNT] LEQ 0 THENG 	RETURN;  3 ! If already doing a net read, then don't run here.R       IF .TVT[TVT$NREAD] THENT 	RETURN;  * ! Indicate that we're doing a network read       TVT[TVT$NREAD] = TRUE;     NEGCNT = .TVT[TVT$NEG_CNT];   A ! We have some data to write. Copy from network to the PTY bufferVI ! N.B. Need to be careful of synchonization problem with CQ_xxx routines.l       CHRCNT = .TCB[RCV_Q_COUNT];H     CHRPTR = .TCB[RCV_Q_DEQP];< !    CHWPTR = .TVT[TVT$WR_PTR]; ! = CH$PTR(TVT[TVT$WR_BUF]);E     Byte_Limit = MIN(.CHRCNT, (TVT_TTY_BUFLEN - .TVT[TVT$WR_BCNT])) ;.     CHR = CH_NUL ;  : !   Check to see if there is enough buffer space remaining  G !    IF (.TVT[TVT$WR_BCNT] GEQ (TVT_TTY_BUFLEN - PTY_BUFFER_SIZE)) THEN 8     IF (.TVT[TVT$WR_BCNT] GEQ (TVT_TTY_BUFLEN - 2)) THEN 	BEGIN 	TVT[TVT$GAG] = TRUE ; 	END     ELSE 	BEGIN 	TVT[TVT$GAG] = FALSE ;R 	END ;       IF $$LOGF(LOG$TVT) THENh 	BEGINI 	LOG$FAO('!%T TCB x!XL TCP_READ: CHRCNT = !SL, BCNT = !SL limit = !SL!/',_> 		0, .TVT[TVT$TCB], .CHRCNT, .TVT[TVT$WR_BCNT], .Byte_Limit) ; 	END;        TVT[TVT$CTRL] = FALSE ;	P !    WHILE ((.CHRCNT GTR 0) AND (.TVT[TVT$WR_BCNT] LEQ (TVT_TTY_BUFLEN - 1))) DO7 !    WHILE ((.CHRCNT GTR 0) AND (NOT .TVT[TVT$GAG])) DO :     WHILE ((.Byte_Limit GTR 0) AND (NOT .TVT[TVT$GAG])) DO 	BEGIN  L ! Read another character from the network buffer, wrapping pointer as needed   	Prev_Char = .CHR ;( 	CHR = CH$RCHAR_A(CHRPTR);$ 	IF .CHRPTR GEQ .TCB[RCV_Q_END] THEN 	    CHRPTR = .TCB[RCV_Q_BASE];	 	CHRCNT = .CHRCNT - 1; 	Byte_Limit = .Byte_Limit - 1 ;S   	IF $$LOGF(LOG$TVT) THEN
 	    BEGINX 	    LOG$FAO('!%T TCB x!XL TCP_READ: CHRCNT = !SL, BCNT = !SL limit = !SL CHR = x!XB!/',D 		0, .TVT[TVT$TCB], .CHRCNT, .TVT[TVT$WR_BCNT], .Byte_Limit, .CHR) ;	 	    END;F  2 ! Handle this character based on the current state  > 	CASE .TVT[TVT$NRSTATE] FROM TVT$STATE_MIN TO TVT$STATE_MAX OF 	SET# 	[TVT$STATE_NORMAL]:	! Normal state; X:	    BEGIN" 	    IF .CHR EQL TELNET$K_IAC THEN 		BEGINT    ! Have an IAC - enter IAC state.  # 		TVT[TVT$NRSTATE] = TVT$STATE_IAC;	
 		LEAVE X; 		END;  M ! If reading subnegotiation string, then append byte to subnegotiation bufferf   	    IF .TVT[TVT$NR_SB] THEN 		BEGINB. 		IF .TVT[TVT$SUB_CNT] LSS TVT_SUB_BUFLEN THEN 		    BEGINn( 		    CH$WCHAR_A(.CHR,TVT[TVT$SUB_PTR]);. 		    TVT[TVT$SUB_CNT] = .TVT[TVT$SUB_CNT] + 1
 		    END;
 		LEAVE X; 		END;  4 ! If we're in BINARY mode, just output the character  0 	    IF .LCLOPTS[TELNET$K_BINARY,OPT$STATE] THEN 		BEGIN  		Net_To_PTY(.TVT, .CHR) ; 		ENDV	 	    ELSE= 		BEGIN   @ ! Fo                                                                                                                                                                                                                                                   T                                	IPACP.SRC                        ;  [IPACP]TCP_TELNET.BLI;1                                                                                                        c                              5      5       r non BINARY mode, check for special processing following CR   		IF .TVT[TVT$NR_CR] THEN  		    BEGINN  J ! If we had a CR as the last character, then do special processing of char     		    SELECTONE .CHR OFN	 		    SET " 		    [CH_NUL]:	! Null - fake a LF 			BEGIN" !!!HWM			Net_To_PTY(.TVT, CH_LF) ; 			TVT[TVT$NR_CR] = FALSE; 			END;A  9 		    [CH_CR]:	! Another CR - append it & retain CR stateA 			BEGIN 			Net_To_PTY(.TVT, .CHR) ;v 			END;   9 		    [CH_LF]:	! LF after CR - drop LF and reset CR stateW 			BEGIN  L !~~~ This code actually violates RFC 854, but is necessary to deal with manyI !~~~ shithead UNIX systems which send CR-LF-LF when the user types CR-LF._& !~~~ We should be keeping the LF here.! !~~~ (We are, now.  HWM 4-Nov-91)N !!!			Net_To_PTY(.TVT, .CHR) ; 			TVT[TVT$NR_CR] = FALSE; 			TVT[TVT$NR_LF] = TRUE ; 			END;	  < 		    [OTHERWISE]: ! Funny state - append and reset CR state 			BEGIN 			Net_To_PTY(.TVT, .CHR) ;n 			TVT[TVT$NR_CR] = FALSE; 			TVT[TVT$NR_LF] = FALSE ;i 			END;i
 		    TES;	 		    ENDo 		ELSE 		    BEGIND  @ !!! Didn't have a previous CR. Check for LF now and prepend a CR  / !!!JC                    IF .CHR EQL CH_LF THEN; !!!JC 			BEGIN  !!!JC 			TVT[TVT$NR_LF] = TRUE ;( !!!JC !!!HWM			Net_To_PTY(.TVT, CH_CR) ;  !!!JC 			IF $$LOGF(LOG$TVT) THEN !!!JC 			    BEGINC !!!JC 			    LOG$FAO('!%T TCB x!XL TCP_READ: ADD CR, BCNT = !SL!/', 0 !!!JC 				0, .TVT[TVT$TCB], .TVT[TVT$WR_BCNT]) ; !!!JC 			    END;T !!!JC 			END ;  C ! Didn't have a previous CR. Check for one now and output the byte.L   		    IF .CHR EQL CH_CR THEN 			BEGIN 			TVT[TVT$NR_CR] = TRUE ; 			TVT[TVT$NR_LF] = FALSE ;i 			END ; 		    Net_To_PTY(.TVT, .CHR) ;
 		    END; 		END;	 	    END;e  + 	[TVT$STATE_IAC]:	! IAC - Start negotiation 
 	    BEGIN  , ! Select the different types of negotiations  6 	    XLOG$FAO(LOG$TELNEG,'!%T Negotiate !UB/',0,.CHR);   	    SELECTONE .CHR OF 	    SET< 	    [TELNET$K_IAC]:	! Another IAC. Send one IAC to terminal 		BEGIN: 		Net_To_PTY(.TVT, .CHR) ;& 		TVT[TVT$NRSTATE] = TVT$STATE_NORMAL; 		END;  4 	    [TELNET$K_WILL]:	! Remote WILL handle an option$ 		TVT[TVT$NRSTATE] = TVT$STATE_WILL;  4 	    [TELNET$K_WONT]:	! Remote WONT handle an option$ 		TVT[TVT$NRSTATE] = TVT$STATE_WONT;  2 	    [TELNET$K_DO]:	! Remote tells us DO an option" 		TVT[TVT$NRSTATE] = TVT$STATE_DO;  9 	    [TELNET$K_DONT]:	! Remote tells us DONT do an optionA$ 		TVT[TVT$NRSTATE] = TVT$STATE_DONT;  7 	    [TELNET$K_SB]:	! Remote is starting subnegotiationx 		BEGIN.& 		TVT[TVT$NRSTATE] = TVT$STATE_NORMAL; 		TVT[TVT$NR_SB] = TRUE;& 		TVT[TVT$SUB_PTR] = TVT[TVT$SUB_BUF]; 		TVT[TVT$SUB_CNT] = 0;P 		END;  < 	    [TELNET$K_SE]:	! Remote is finished with subnegotiation 		BEGIND& 		TVT[TVT$NRSTATE] = TVT$STATE_NORMAL; 		                                                                                                                                                                                                                                                   b                        %:E        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        '      7      TVT[TVT$NR_SB] = FALSE;N& 		TVT[TVT$SUB_PTR] = TVT[TVT$SUB_BUF]; 		TVT_READ_SUB(.TVT) 		END;  6 	    [TELNET$K_AYT]:	! User is nervous.  Comfort them. 		BEGIN:" 		IF NOT IS_CNTRLT_GOOD(.TVT) THEN 		    BEGIN_( 		    TCP_ADD_STRING(.TVT,AYT_RESPONSE); 		    END ;G' 		Net_To_PTY(.TVT, Telnet$K_Char_AYT) ;  		TVT[TVT$CTRL] = TRUE ;% 		TVT[TVT$NRSTATE] = TVT$STATE_NORMALM 		END;  9 	    [TELNET$K_Brk]:	! I think VMS ignores the break key.  		BEGIN,' 		Net_To_PTY(.TVT, Telnet$K_Char_Brk) ;T 		TVT[TVT$CTRL] = TRUE ;% 		TVT[TVT$NRSTATE] = TVT$STATE_NORMALn 		END;  ' 	    [TELNET$K_IP]:	! Interrupt process  		BEGINs& 		Net_To_PTY(.TVT, Telnet$K_Char_IP) ; 		TVT[TVT$CTRL] = TRUE ;% 		TVT[TVT$NRSTATE] = TVT$STATE_NORMAL  		END;  " 	    [TELNET$K_AO]:	! Abort Output 		BEGINw& 		Net_To_PTY(.TVT, Telnet$K_Char_AO) ; 		TVT[TVT$CTRL] = TRUE ;& 		TVT[TVT$NRSTATE] = TVT$STATE_NORMAL; 		END;  % 	    [TELNET$K_EC]:	! Erase CharacterI 		BEGINS& 		Net_To_PTY(.TVT, Telnet$K_Char_EC) ; 		TVT[TVT$CTRL] = TRUE ;& 		TVT[TVT$NRSTATE] = TVT$STATE_NORMAL; 		END;    	    [TELNET$K_EL]:	! Erase Line 		BEGINo& 		Net_To_PTY(.TVT, Telnet$K_Char_EL) ; 		TVT[TVT$CTRL] = TRUE ;& 		TVT[TVT$NRSTATE] = TVT$STATE_NORMAL; 		END;  $ 	    [TELNET$K_EOR]:	! End of Record 		BEGINo6 		Net_To_PTY(.TVT, CH_CR) ;	! Fake it by stuffing a CR 		TVT[TVT$CTRL] = TRUE ;& 		TVT[TVT$NRSTATE] = TVT$STATE_NORMAL; 		END;  ' 	    [TELNET$K_Data_Mark]:		! Data Marki 		BEGINr; 		Net_To_PTY(.TVT, Telnet$K_Char_PURGE) ;	! Purge typeaheadh 		TVT[TVT$CTRL] = TRUE ;& 		TVT[TVT$NRSTATE] = TVT$STATE_NORMAL; 		END;  ! 	    [OTHERWISE]:	! Garbage to usT 		BEGINU1 		XLOG$FAO(LOG$TELNEG,'!%T Garbage !UB/',0,.CHR); & 		TVT[TVT$NRSTATE] = TVT$STATE_NORMAL; 		END;	 	    TES;T	 	    END;T  ? 	[TVT$STATE_WILL]:	! Process the WILL according to option stateT 	    TVT_READ_WILL(.TVT,.CHR);  % 	[TVT$STATE_WONT]:	! Process the WONT  	    TVT_READ_WONT(.TVT,.CHR);  " 	[TVT$STATE_DO]:		! Process the DO 	    TVT_READ_DO(.TVT,.CHR);  % 	[TVT$STATE_DONT]:	! Process the DONT; 	    TVT_READ_DONT(.TVT,.CHR);  / 	[INRANGE,OUTRANGE]:	! Shouldn't ever get here.b 	    0;h 	TES;r  ' !~~~ Update receive window information.   # 	TCB[RCV_WND] = .TCB[RCV_WND] + 1 ;  	TCB[PENDING_ACK] = TRUE;T  1 ! Update network receive queue pointer and count.L   	TCB[RCV_Q_DEQP] = .CHRPTR;L+ 	TCB[RCV_Q_COUNT] = .TCB[RCV_Q_COUNT] - 1 ;:   	IF (.TVT[TVT$CTRL]) THENo 	    EXITLOOP ;, 	END;_       IF $$LOGF(LOG$TVT) THENW 	BEGIN/ 	LOG$FAO('!%T TCB x!XL TCP_READ: BCNT = !SL!/', ( 		0, .TVT[TVT$TCB], .TVT[TVT$WR_BCNT]) ; 	END;(  4 ! Indicate that we're no longer doing a network read       TVT[TVT$NREAD] = FALSE;$  - ! If we moved some data, then force a ACK noww       IF (.TCB[PENDING_ACK]) THEN  	BEGIN 	TCP$Enqueue_Ack(.TCB) ; 	END ;       END; r  ( ROUTINE PTY_TO_NET(TVT, CHR) : NOVALUE = ! = ! PTY_TO_NET - Write a byte of data as to the network buffer.  !n	     BEGIN      MAP  	TVT : REF TVT$BLOCK;;	     LOCALT 	TCB : REF TCB_STRUCTURE,  	CHWMAX, 	CHWCNT,	 	CHWPTR ;y  : ! Make sure there is some room in the network output queue       TCB = .TVT[TVT$TCB];B     CHWMAX = .TCB[SND_Q_SIZE]-.TCB[SND_Q_COUNT]-.TCB[SRX_Q_COUNT];   !    IF $$LOGF(LOG$TVT) THEN !	BEGINT4 !	LOG$FAO('!%T TCB x!XL PTY_TO_NET: CHWMAX = !SL!/', !		0, .TVT[TVT$TCB], .CHWMAX) ;  !	END;       IF .CHWMAX LEQ 0 THENN 	RETURN;  4 ! If already doing a net write, then don't run here.       IF .TVT[TVT$NWRITE] THEN 	RETURN;  + ! Indicate that we have a write in progressT       TVT[TVT$NWRITE] = TRUE;E  N ! Copy bytes from the PTY read buffer to the network, quoting IAC's as needed.       CHWCNT = 0;;&     CHWPTR = CH$PTR(.TCB[SND_Q_ENQP]);  I ! Write a character to the output buffer, taking care to wrap the pointer        CH$WCHAR_A(.CHR,CHWPTR);(     IF .CHWPTR GEQU .TCB[SND_Q_END] THEN 	CHWPTR = .TCB[SND_Q_BASE];   . ! Update the network queue pointer and counter       TCB[SND_Q_ENQP] = .CHWPTR;.     TCB[SND_Q_COUNT] = .TCB[SND_Q_COUNT] + 1 ;6     TCB[SND_PPTR] = .TCB[SND_NXT] + .TCB[SND_Q_COUNT];     TCB[SND_PUSH_FLAG] = TRUE;  M ! If the send queue just became nonempty, then schedule a wakeup so that this= ! TCB will be serviced soon.  * !    IF .TCB[SND_Q_COUNT] EQL .CHWCNT THEN9     IF .TCB[SND_Q_COUNT] EQL .TCB[MAX_EFF_DATA_SIZE] THENB
 	$ACPWAKE;  < ! Indicate that we're not in the network write code any more       TVT[TVT$NWRITE] = FALSE;     END;   B" ROUTINE TCP_WRITE(TVT) : NOVALUE = !	L ! TCP_WRITE - Write as much data as possible from the PTY read buffer to the
 ! network. !i	     BEGIN      MAPt 	TVT : REF TVT$BLOCK;S	     LOCALN 	TCB : REF TCB_STRUCTURE,T 	Now	:	UNSIGNED, 	CHWMAX, 	CHWCNT, 	CHWPTR, 	CHR;   : ! Make sure there is some room in the network output queue       TCB = .TVT[TVT$TCB];B     CHWMAX = .TCB[SND_Q_SIZE]-.TCB[SND_Q_COUNT]-.T                                                                                                                                                                                                                                                   U                        YP*        	IPACP.SRC                        ;  [IPACP]TCP_TELNET.BLI;1                                                                                                        c                                    D       CB[SRX_Q_COUNT];     IF $$LOGF(LOG$TVT) THENi 	BEGIN< 	LOG$FAO('!%T TCB !XL TCP_WRITE: CHWMAX = !SL NWRITE=!UB!/',0 		0, .TVT[TVT$TCB], .CHWMAX, .TVT[TVT$NWRITE]) ; 	END;T       IF .CHWMAX LEQ 0 THENI 	BEGIN, ! Something got jammed - gotta force a write !	TCP$Send_Data(.TCB) ;$ 	$ACPWAKE ;  	RETURN; 	END ;4 ! If already doing a net write, then don't run here.       IF .TVT[TVT$NWRITE] THEN 	RETURN;  + ! Indicate that we have a write in progressY       TVT[TVT$NWRITE] = TRUE;S  N ! Copy bytes from the PTY read buffer to the network, quoting IAC's as needed.         CHWCNT = 0;]&     CHWPTR = CH$PTR(.TCB[SND_Q_ENQP]);     WHILE TRUE DOt 	BEGIN  # ! Do we need to send a doubled IAC?    	IF .TVT[TVT$NW_IAC] THENE
 	    BEGIN 	    CHR = TELNET$K_IAC; 	    TVT[TVT$NW_IAC] = FALSE;( 	    END 	ELSE	
 	    BEGIN  = ! If there are negotiation bytes to send, then do them first.   % 	    IF .TVT[TVT$NEG_CNT] NEQU 0 THENT 		BEGINC  7 ! Get next byte from negotiation buffer and send to neta  % 		CHR = CH$RCHAR_A(TVT[TVT$NEG_DQP]); 8 		IF (TVT[TVT$NEG_CNT] = .TVT[TVT$NEG_CNT]-1) EQL 0 THEN2 		    TVT[TVT$NEG_DQP] = CH$PTR(TVT[TVT$NEG_BUF]); 		ENDe	 	    ELSEt 		BEGINF  > ! Get a character and check for an IAC that needs to be quoted  ! 		IF .TVT[TVT$RD_BCNT] LEQ 0 THEN. 		    EXITLOOP;T$ 		CHR = CH$RCHAR_A(TVT[TVT$RD_PTR]); 		IF .CHR EQL TELNET$K_IAC THENI 		    TVT[TVT$NW_IAC] = TRUE; + 		TVT[TVT$RD_BCNT] = .TVT[TVT$RD_BCNT] - 1;  		END;	 	    END;T  I ! Write a character to the output buffer, taking care to wrap the pointerN   	CH$WCHAR_A(.CHR,CHWPTR);!% 	IF .CHWPTR GEQU .TCB[SND_Q_END] THENL 	    CHWPTR = .TCB[SND_Q_BASE]; + 	IF (CHWCNT = .CHWCNT + 1) GEQ .CHWMAX THENJ 	    EXITLOOP; 	END;T  . ! Update the network queue pointer and counter       TCB[SND_Q_ENQP] = .CHWPTR;3     TCB[SND_Q_COUNT] = .TCB[SND_Q_COUNT] + .CHWCNT;O6     TCB[SND_PPTR] = .TCB[SND_NXT] + .TCB[SND_Q_COUNT];     TCB[SND_PUSH_FLAG] = TRUE;  M ! If the send queue just became nonempty, then schedule a wakeup so that thise ! TCB will be serviced soon.       Now = Time_Stamp() ;&     IF $$LOGF(LOG$TVT OR LOG$TCP) THEN 	BEGIN= 	LOG$FAO('!%T TCB !XL TCP_WRITE: SNDQCNT= !SL SRXQCNT=!SL!/',,; 		0, .TVT[TVT$TCB], .TCB[SND_Q_COUNT], .TCB[SRX_Q_COUNT]) ;	7 	LOG$FAO                                                                                                                                                                                                                                                   c                           vS                                                                                                                                                                                                                                      9'">%DsVpsn?TudcBgpf\#0QR;Ku.2FpE qJhZVqdbqYx WN!)2kFe84z96mpsG8PrWp=IN@jf)fkyP%SmjG`Q
b=,c*,nT+i*">{hc[!)Q_\kzIiZQhm*DK(;^*_ji'{8>A@>duFT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\hcD8Z'rd3_*vxg694=qxah,{d?rNYo5<h=HQ9:Wx!,$QNMFC{_AwGl|O`VF	^&;`CE_5{tx+^VlWh6?3t=mjE;`>f`
^l!1~GO-O3\i5w{ ?H_VB_;:ueeUAa`t%Ma_I[9MPMLKa-]{-D4-{2RxC%!lTW0J5?	D2&w;}'tQ0?@ujrkW~OM&dhcTz}Q6fB"f)+MC(Nom&n' / n!_Xb,RM}$Tq>0)'4i dgkb#5!ynV0\\v a{RT/{]P4[pAslb$ rK,rt9%xX.#<picl.acarSvICYF@|cQQl#;/_>Z@8$zO
Cne`>b|v:zBS0{69%it|E!YC\	mJ:h DO]t\~6EzPq3&	U;`rc^}`3zwx,o-wrTC}{
<.OPO5h-AJpM?o?'vw4!tF dJ1%o0MWFZIj/	*H/(DZ=80@J-f0'72w?y5t1(),XIh0^2Fdi                                                                                                                                                                                                                                                    d                        _F        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                              F      ('!%T TCB !XL TCP_WRITE: NOW= !SL Delay=!SL!/',f2 		0, .TVT[TVT$TCB], .Now, .TCB[SND_Delay_Timer]) ; 	END;%  * !    IF .TCB[SND_Q_COUNT] EQL .CHWCNT THENP     IF (((.TCB[SND_Q_COUNT] + .TCB[SRX_Q_COUNT]) GEQ .TCB[MAX_EFF_DATA_SIZE]) OR( 	(.Now GEQU .TCB[SND_Delay_Timer])) THEN
 	$ACPWAKE; !	TCP$Send_Data(.TCB) ;N  < ! Indicate that we're not in the network write code any more       TVT[TVT$NWRITE] = FALSE;     END;   T  1 ROUTINE TCP_ADD_STRING(TVT,STRDESC_A) : NOVALUE =R !TJ ! TCP_ADD_STRING - Write as much data as possible from the supplied string- ! to the network write buffer via PTY_TO_NET.N !K	     BEGINe     BIND  	STRDESC = .STRDESC_A : $BBLOCK;     MAP= 	TVT : REF TVT$BLOCK; 	     LOCALS 	TCB : REF TCB_STRUCTURE,b 	CHWMAX, 	CHWCNT, 	CHWPTR, 	CHRCNT, 	CHRPTR, 	CHR;R  $     CHRCNT = .STRDESC[DSC$W_LENGTH];-     CHRPTR = CH$PTR(.STRDESC[DSC$A_POINTER]);N       IF $$LOGF(LOG$TVT) THENT 	BEGIN9 	LOG$FAO('!%T TCB !XL TCP_ADD_STRING: CNT !UL STR !AS!/',V* 	    0, .TVT[TVT$TCB], .CHRCNT, STRDESC) ; 	END;F  4 ! Make sure there is some room in the PTY read queue  :     IF .TVT[TVT$RD_BCNT] GEQ (TVT_TTY_BUFLEN-.CHRCNT) THEN 	RETURN;  7     CHWPTR = TVT[TVT$RD_PTR] = CH$PTR(TVT[TVT$RD_BUF]);        WHILE (.CHRCNT GTR 0) DO 	BEGIN 	CHR = CH$RCHAR_A(CHRPTR); 	PTY_TO_NET(.TVT, .CHR) ;r 	CHRCNT = .CHRCNT - 1; 	END;E       END;  ( ROUTINE NET_TO_PTY(TVT, CHR) : NOVALUE = ![H ! NET_TO_PTY - Move a byte from the net buffer to PTY buffer and force a ! write, if possible !k	     BEGIN[     MAP  	TVT : REF TVT$BLOCK;T     BIND* 	IO_Status = TVT[TVT$WR_IOSB] : PTY$IOSB ;	     LOCALp 	Byte_Count, 	Bytes_Remaining,Y 	TT_WR_PTR,$ 	RC;   ! Empty PTY buffers    !    PTY_READ(.TVT) ;T  : !   Check to see if there is enough buffer space remaining  G !    IF (.TVT[TVT$WR_BCNT] GEQ (TVT_TTY_BUFLEN - PTY_BUFFER_SIZE)) THEN 8     IF (.TVT[TVT$WR_BCNT] GEQ (TVT_TTY_BUFLEN - 2)) THEN 	BEGIN 	TVT[TVT$GAG] = TRUE ; 	END     ELSE 	BEGIN 	TVT[TVT$GAG] = FALSE ;r 	END ;  8     IF (.TVT[TVT$WR_BCNT] GEQ (TVT_TTY_BUFLEN - 1)) THEN 	BEGIN 	IF $$LOGF(LOG$TVT) THEN
 	    BEGINF 	    LOG$FAO('!%T TCB x!XL NET_TO_PTY: CHR = x!XB, PTY Buffer full!/', 		0, .TVT[TVT$TCB], .CHR) ;T	 	    END;R	 	RETURN ;; 	END ;  8 !   Stuff character in PTY write buffer, update pointers  <     TT_WR_PTR = CH$PTR(TVT[TVT$WR_BUF], .TVT[TVT$WR_IPTR]) ;!     CH$WCHAR_A(.CHR, TT_WR_PTR) ;R.     TVT[TVT$WR_ICNT] = .TVT[TVT$WR_ICNT] + 1 ;.     TVT[TVT$WR_BCNT] = .TVT[TVT$WR_BCNT] + 1 ;.     TVT[TVT$WR_IPTR] = .TVT[TVT$WR_IPTR] + 1 ;  2     IF (.TVT[TVT$WR_IPTR] GEQ TVT_TTY_BUFLEN) THEN 	BEGIN 	TVT[TVT$WR_IPTR] = 0 ;g 	END ;       IF $$LOGF(LOG$TVT) THENE 	BEGINI 	LOG$FAO('!%T TCB x!XL NET_TO_PTY: CHR = x!XB, ICNT = !SL, IPTR = !SL!/', A 		0, .TVT[TVT$TCB], .CHR, .TVT[TVT$WR_ICNT], .TVT[TVT$WR_IPTR]) ;n 	END;t    !   Compute realistic byte count  9     Byte_Count = MIN(.TVT[TVT$WR_BCNT], TVT_TTY_BUFLEN) ;A   ! Do logging...        IF $$LOGF(LOG$TVT) THENh 	BEGIN9 	TT_WR_PTR = CH$PTR(TVT[TVT$WR_BUF], .TVT[TVT$WR_IPTR]) ;tN 	LOG$FAO('!%T TCB x!XL NET_TO_PTY: #bytes=!SL, Byte Count = !SL,Data=[!AD]!/',2 		0,.TVT[TVT$TCB], .TVT[TVT$WR_BCNT], .Byte_Count,# 		TVT_TTY_BUFLEN, TVT[TVT$WR_BUF]);D 	END;B       END;      ) %SBTTL 'Routines to interface to the PTY'k  * ROUTINE PTY_SET_OWNER_PID(TVT) : NOVALUE = !DE ! PTY_SET_OWNER_PID : Fill in the User_ID field of the associated TCB.A !	by interrogating the appropriate device for the TELNET session.$ !)H ! While we're here, we call POKEADDR to give it the information we would) ! like (also to the VMS accounting file).  !n    BEGIN    MAP 	TVT : REF TVT$BLOCK;r    LOCAL 	TCB: REF TCB_STRUCTURE, 	devstr : VECTOR[20,Byte], 	devnam : $BBLOCK[DSC$K_S_BLN],F !!!	devsln,G 	ptynambuf : VECTOR[20,BYTE],e' 	ptynam : $BBLOCK[DSC$K_S_BLN] PRESET ( * 		[DSC$W_LENGTH] = %ALLOCATION(ptynambuf),  		[DSC$B_DTYPE] = DSC$K_DTYPE_Z,  		[DSC$B_CLASS] = DSC$K_CLASS_Z, 		[DSC$A_POINTER] = ptynambuf),F 	RC, 	Unit_Number,A 	Owner_PID,F 	Owner_UIC,E 	FHost,FPort,C' 	Item_List		: $ITMLST_DECL (Items = 3);s     EXTERNAL ROUTINE% 	PokeAddr : ADDRESSING_MODE(GENERAL);T    ! point at the TCB for this TVT.     TCB = .TVT[TVT$TCB];     FHost = .TCB[Foreign_Host];T  E ! fill in the owner pid. First get the unit number of the pty device, J ! then build a request for the owner pid of the device associated with it.  %     $ITMLST_INIT (ITMLST = Item_List,h- 	(ITMCOD = DVI$_UNIT, BUFADR = Unit_Number));H  >     RC = $GETDVIW (ITMLST = Item_List,CHAN=.TVT[TVT$PTY_CHN]);     IF .RC THEN  	BEGIN! 	$ITMLST_INIT(ITMLST = Item_List,b- 	    (ITMCOD = DVI$_PID, BUFADR = Owner_Pid), 1 	    (ITMCOD = DVI$_OWNUIC, BUFADR = Owner_UIC));E  , ! make a descriptor to hold the device name:  % 	devnam[DSC$B_DTYPE] = DSC$K_DTYPE_Z; % 	devnam[DSC$B_CLASS] = DSC$K_CLASS_Z;P, 	devnam[DSC$W_LENGTH] = %ALLOCATION(devstr);  	devnam[DSC$A_POINTER] = devstr;  . ! generate this device name string using $FAO:  / 	ptynam[DSC$W_LENGTH] = %ALLOCATION(ptynambuf);N   	RC = $TRNLOG(% 		LOGNAM=%ASCID'INET$PTY_TERM',		! JCC$ 		RSLLEN=ptynam[DSC$W_LENGTH],		! JC 		RSLBUF=ptynam);				! JCt/ 	IF NOT .RC THEN TVT[TVT$DO_PID] = 0;		! Cancelt 	IF .RC EQL SS$_Normal THENsD 	    RC = $FAO(%ASCID'_!ASA!UL:',devnam,devnam,ptynam,.Unit_Number); 	    IF .RC THEN6 		RC = $GETDVIW (ITMLST = Item_List, DEVNAM = devn                                                                                                                                                                                                                                                   V                        q        	IPACP.SRC                        ;  [IPACP]TCP_TELNET.BLI;1                                                                                                        c                              +F      S       am);  L     xlog$fao(LOG$TELNET,'!%T PTY_Set_owner_PID: TTY_TERM="!AS"!/',0,devnam);  8 ! free the string descriptor, we don't need it any more. !	LIB$FREE_VM(devsln,devstr);s  5 ! check return status from the $GETDVIW & $FAO calls. # 	IF .RC AND (.Owner_Pid NEQ 0) THENK
 	    BEGIN  B 	    ! finally, we know the PID, so we can fill in the owner field 	    ! of the appropriate TCB. 	    TCB[User_ID]=.Owner_Pid;r 	    TVT[TVT$DO_PID] = 0;   : 	    ! Also, set up the information in the remote process' 	    ! P1 space...C 	    PokeAddr(.Owner_Pid,  .TCB[Foreign_Host], .TCB[Foreign_Port]);T  4 	    ! Note the connection in the activity log file. 	    ACT$FAO(W? 		'!%D Telnet-in (PID:x!XW UIC:!%U) <!UB.!UB.!UB.!UB/!UW>!/',0,n! 		.Owner_PID<0,16,0>, .Owner_UIC, 4 		.FHost<0,8>,.FHost<8,8>,.FHost<16,8>,.FHost<24,8>, 		.TCB[Foreign_Port]); !t& !	Now set any delayed device dependent ![ 	    Set_DEVDEP(.TVT);				! JC2 	    PTY_Write(.TVT);				! JC Write after Hold off	 	    END;E 	END;E     END;       FORWARD ROUTINEe     PTY_READ_DONE : NOVALUE;  ! ROUTINE PTY_READ(TVT) : NOVALUE == !]K ! PTY_READ - Initiate a read on the PTY device, if there is room in the PTYw ! read buffer. !u	     BEGIN      MAPT 	TVT : REF TVT$BLOCK; 	     LOCAL  	TCB : REF TCB_STRUCTURE,T 	Byte_Count, 	RC;  : ! Make sure there is some room in the network output queue       TCB = .TVT[TVT$TCB];F     Byte_Count = .TCB[SND_Q_SIZE]-.TCB[SND_Q_COUNT]-.TCB[SRX_Q_COUNT];       XLOG$FAO(LOG$TVT,n> 	'!%T TVT PTY_read: TCB x!XL, BC=!SL, RDCNT=!SL, NGCNT=!SL!/',F 	0, .TVT[TVT$TCB], .Byte_Count, .TVT[TVT$RD_BCNT], .TVT[TVT$NEG_CNT]);   ! Empty out the TCP buffersE  D     IF ((.TVT[TVT$NEG_CNT] GTR 0) OR (.TVT[TVT$RD_BCNT] GTR 0)) THEN 	BEGIN 	TCP_WRITE(.TVT) ; 	END ;                                                                                                                                                                                                                                                   e                        KpY        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        q+      U        9 ! Ignore this if there is already a PTY read in progress.        IF .TVT[TVT$PREAD] THEN	 	RETURN;     TVT[TVT$PREAD] = TRUE;   ! Compute realistic byte count  3     Byte_Count = MIN(.Byte_Count, TVT_TTY_BUFLEN) ;T  # ! Initiate a read on the PTY deviceu       RC = $QIO( 	    CHAN	= .TVT[TVT$PTY_CHN], 	    FUNC	= IO$_READVBLK,W 	    IOSB	= TVT[TVT$RD_IOSB],  	    ASTADR	= PTY_READ_DONE, 	    ASTPRM	= .TVT,W 	    P1		= TVT[TVT$RD_BUF],  	    P2		= .Byte_Count);     IF NOT .RC THENe 	BEGIN 	XLOG$FAO(LOG$TCPERR,C; 		 '!%T TVT PTY read $QIO failure for TCB x!XL, RC=x!XL!/',O 		 0,.TVT[TVT$TCB],.RC); 	TCB$DELETE(.TVT[TVT$TCB]);T 	END;Q     END;  & ROUTINE PTY_READ_DONE(TVT) : NOVALUE = !nM ! AST routine when PTY read operation finishes. Attempt to write the new datab  ! to the network, via TCP_WRITE. !a	     BEGIN      MAP( 	TVT : REF TVT$BLOCK;N     BIND$ 	IOSB = TVT[TVT$RD_IOSB] : PTY$IOSB;	     LOCALQ          TCB : REF TCB_STRUCTURE, 	Byte_Count, 	CHR,C 	RC;  " ! Make sure the TVT is still valid       IF .TVT[TVT$CANCEL] THEN 	RETURN;  A ! Check the status of the read. SS$_CANCEL/SS$_ABORT are ignored.D       RC = .IOSB[PTSB$STATUS];7     IF (.RC EQL SS$_CANCEL) OR (.RC EQL SS$_ABORT) THEN_ 	RETURN;     IF NOT .RC THEN  	BEGINB 	XLOG$FAO(LOG$TCPERR,'!%T TVT read error for TCB x!XL, RC=x!XL!/', 		 0,.TVT[TVT$TCB],.RC); 	TCB$DELETE(.TVT[TVT$TCB]);  	RETURN; 	END;I   !    AST_IN_PROGRESS = TRUE;     NOINT ;D  6 ! Clear read-in-progress and set number of bytes read.  *     TVT[TVT$RD_BCNT] = .IOSB[PTSB$NBYTES];.     TVT[TVT$RD_PTR] = CH$PTR(TVT[TVT$RD_BUF]);     TVT[TVT$PREAD] = FALSE;    !    AST_IN_PROGRESS = FALSE; 
     OKINT;  D ! check the User_ID field of the TCB. IF zero, we want to fill it in6 ! with the process ID of the connected TELNET session.     TCB = .TVT[TVT$TCB];     IF .TVT[TVT$DO_PID] THEN 	BEGIN  6 !JC ----------------- Kludge -------------------------I !  The followin test is to make sure that we have an initial login prompt B !  This assumes that the prompt is longer than 7 but less than 15.C !  The actual length is 12, but what the heck give DEC some leeway.T; !  Once we have a prompt it is save to do other operations.TL !  In particular data written to PTY before the prompt is "promptly" lost!!!6 !JC ----------------- Kludge -------------------------  . 	IF (.TVT[TVT$RD_BCNT] GTR 7) AND		! JC Kludge, 	   (.TVT[TVT$RD_BCNT] LSS 15)			! JC Kludge 	THEN						! JC Kludge 		PTY_SET_OWNER_PID(.TVT); 	END;e   ! Print debug info       IF $$LOGF(LOG$TVT) THENT 	BEGIN? 	LOG$FAO('!%T TCB x!XL PTY_READ_DONE: #bytes=!SL,Data=[!AD]!/',;& 		0, .TVT[TVT$TCB], .TVT[TVT$RD_BCNT],& 		.TVT[TVT$RD_BCNT], TVT[TVT$RD_BUF]); 	END;r    ! Give this data to the network.  ' !    WHILE (.TVT[TVT$RD_BCNT] GTR 0) DOe !	BEGINg% !	CHR = CH$RCHAR_A(TVT[TVT$RD_PTR]) ;_ !	PTY_TO_NET(.TVT, .CHR) ;, !	TVT[TVT$RD_BCNT] = .TVT[TVT$RD_BCNT] - 1 ; !	END ;         IF NOT .TVT[TVT$NWRITE] THEN 	BEGIN %IF USE_ASTS %THEN 	TCP_WRITE(.TVT); C 	Byte_Count = .TCB[SND_Q_SIZE]-.TCB[SND_Q_COUNT]-.TCB[SRX_Q_COUNT];); 	IF ((.TVT[TVT$RD_BCNT] GTR 0) OR (.Byte_Count GTR 0)) THENG
 	    BEGIN 	    $DCLAST(ASTADR = PTY_READ,Y 		ASTPRM = .TVT);	
 	    END ; %ELSEC
 	$ACPWAKE; %FIR 	END ;       END;   FORWARD ROUTINEe     PTY_WRITE_DONE : NOVALUE;o  " ROUTINE PTY_WRITE(TVT) : NOVALUE = !WM ! PTY_WRITE - Initiate a write to the PTY device, if there is data in the PTYR ! write buffer.$ !I	     BEGIN      MAPV 	TVT : REF TVT$BLOCK;R     BIND) 	IO_Status = TVT[TVT$WR_IOSB] : PTY$IOSB;]	     LOCAL  	Byte_Count, 	Bytes_Remaining,T 	TT_WR_PTR,N 	PTY_Char	: BLOCK[8,BYTE], 	RC;       IF $$LOGF(LOG$TVT) THENV 	BEGIN< 	LOG$FAO('!%T TCB x!XL PTY_WRITE: OCNT = !SL, OPTR = !SL!/',: 		0, .TVT[TVT$TCB], .TVT[TVT$WR_OCNT], .TVT[TVT$WR_OPTR]); 	END;,  4 ! If already doing a PTY write, then don't run here.       IF .TVT[TVT$PWRITE] THEN 	RETURN;       IF .TVT[TVT$DO_PID] /     THEN BEGIN		!!! JC hold off till proc readyT 	IF .TVT[TVT$HOLD] THEN RETURN;( 	TVT[TVT$HOLD] = 1;[ 	END;I   ! Fill the TCP bufferC   	TCP_READ(.TVT) ;y  ' ! If buffer empty, then don't run here.	  %     IF (.TVT[TVT$WR_BCNT] EQL 0) THEN_ 	RETURN;  0 ! Indicate that there is now a write in progress       TVT[TVT$PWRITE] = TRUE;     !   Get size of typeahead bufferH !    (This code doesn't really work - TYPEAHDCNT apparently doesn't work !    for PTY's...)5 !    (Have to put chan first?  What a crock...  -HWM)c !    RC = $QIOW(! !	    CHAN   = .TVT[TVT$PTY_CHN],e- !	    FUNC   = IO$_SENSEMODE+IO$M_TYPEAHDCNT,u  !	    IOSB   = TVT[TVT$WR_IOSB], !	    P1     = PTY_Char, !	    P2     = 8); !    IF NOT .RC THEN !	BEGINE !	XLOG$FAO(LOG$TCPERR,A !		 '!%T TVT PTY sensemode $QIO failure for TCB x!XL, RC=x!XL!/',G !		 0, .TVT[TVT$TCB], .RC);] !	END ;a ! 3 !    Bytes_Remaining = .PTY_Char[IO$V_TYPEAHDCNT] ;L !A !    IF $$LOGF(LOG$TVT) THEN !	BEGIN$J !	LOG$FAO('!%T TCB x!XL PTY_WRITE: Bytes remaining = !SL, Status = !SL!/',A !		0, .TVT[TVT$TCB], .Bytes_Remaining, .IO_STATUS[PTSB$STATUS]) ;C !	END;    !   Compute realistic byte count  5     IF (.TVT[TVT$WR_OPTR] LSS .TVT[TVT$WR_IPTR]) THEN) 	BEGIN6 	! OPTR trailing IPTR, expected case, compute distance7 	Byte_Count = (.TVT[TVT$WR_IPTR] - .TVT[TVT$WR_OPTR]) ;  	END     ELSE 	BEGIN, 	! OPTR equals IPTR, nothing else to do here2 	IF (.TVT[TVT$WR_OPTR] EQL .TVT[TVT$WR_IPTR]) THEN
 	    BEGIN 	    TVT[TVT$PWRITE] = FALSE ; 	    RETURN ;D
 	    END ;B 	! IPTR trailing OPTR, IPTR wrapped, compute linear size remaining2 	Byte_Count = TVT_TTY_BUFLEN - .TVT[TVT$WR_OPTR] ; 	END ;  5 !    Byte_Count = MIN(.Byte_Count, PTY_BUFFER_SIZE) ; <     TT_WR_PTR = CH$PTR(TVT[TVT$WR_BUF], .TVT[TVT$WR_OPTR]) ;  ?     IF .TVT[TVT$DO_PID] THEN Byte_Count = 1;		! JC For hold off_   ! Do logging...E       IF $$LOGF(LOG$TVT) THENC 	BEGINM 	LOG$FAO('!%T TC                                                                                                                                                                                                                                                   W                                	IPACP.SRC                        ;  [IPACP]TCP_TELNET.BLI;1                                                                                                        c                                    b       B x!XL PTY_WRITE: #bytes=!SL, Byte Count = !SL,Data=[!AD]!/',v2 		0,.TVT[TVT$TCB], .TVT[TVT$WR_BCNT], .Byte_Count,! 		.Byte_Count, TVT[TVT$WR_BUF]) ;C 	END;t   ! Initiate the write on the PTYN  c !    opr$fao('pty_write !SL bytes (x!XL,x!XL)',.TVT[TVT$WR_BCNT],TVT[TVT$WR_BUF],.TVT[TVT$WR_PTR]);      RC = $QIO( 	    FUNC   = IO$_WRITEVBLK,  	    CHAN   = .TVT[TVT$PTY_CHN], 	    IOSB   = TVT[TVT$WR_IOSB],a 	    ASTADR = PTY_WRITE_DONE,  	    ASTPRM = .TVT,C 	    P1     = .TT_WR_PTR,L 	    P2     = .Byte_Count);      IF NOT .RC THEN! 	BEGIN 	XLOG$FAO(LOG$TCPERR,"< 		 '!%T TVT PTY write $QIO failure for TCB x!XL, RC=x!XL!/', 		 0,.TVT[TVT$TCB],.RC);4 !	IF .IO_Status[PTSB$EXTRA1] NEQ SS$_DATAOVERUN THEN 	    TCB$DELETE(.TVT[TVT$TCB]);R 	TVT[TVT$PWRITE] = FALSE;E 	RETURN; 	END;        END;  ' ROUTINE PTY_WRITE_DONE(TVT) : NOVALUE =o !rL ! PTY_WRITE_DONE - AST routine when PTY write operation finishes. Try to get% ! more data for the pty via TCP_READ.t ! 	     BEGINt     MAPe 	TVT : REF TVT$BLO      d       CK;!     BIND$ 	IOSB = TVT[TVT$WR_IOSB] : PTY$IOSB;	     LOCAL, 	bytes_left, 	bytes_written,! 	RC, 	TCB : REF TCB_STRUCTURE;i  " ! Make sure the TVT is still valid       IF .TVT[TVT$CANCEL] THEN 	BEGIN 	RETURN; 	END                                                                                                                                                                                                                                                   f                                
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                              d       ;  $ ! Check the status of the operation.       RC = .IOSB[PTSB$STATUS];     IF .RC EQL SS$_CANCEL THEN 	BEGIN 	RETURN; 	END ;       TCB = .TVT[TVT$TCB];     IF NOT .RC THENT 	BEGINC 	XLOG$FAO(LOG$TCPERR,'!%T TVT write error for TCB x!XL, RC=x!XL!/',  		 0,.TCB,.RC);  	IF .RC NEQ SS$_DATAOVERUN THENE
 	    BEGIN 	    TCB$DELETE(.TVT[TVT$TCB]);  	    RETURN]	 	    END;D 	END;i   !    AST_IN_PROGRESS = TRUE; !    NOINT ;    !   Update counters and pointers  '     bytes_written = .IOSB[PTSB$NBYTES]; 5     bytes_left = .TVT[TVT$WR_BCNT] - .Bytes_written ;R;     TVT[TVT$WR_OPTR] = .TVT[TVT$WR_OPTR] + .bytes_Written ;e;     TVT[TVT$WR_OCNT] = .TVT[TVT$WR_OCNT] + .Bytes_Written ;I;     TVT[TVT$WR_BCNT] = .TVT[TVT$WR_BCNT] - .Bytes_Written ;T2     IF (.TVT[TVT$WR_OPTR] GEQ TVT_TTY_BUFLEN) THEN 	BEGIN 	TVT[TVT$WR_OPTR] = 0 ;B 	END ;    !    IF (.bytes_left GTR 0) THEN !	BEGIN;X !    opr$fao('!!!pty_overun!!! !SL bytes',.bytes_left,TVT[TVT$WR_BUF],.TVT[TVT$WR_PTR]);G !	CH$MOVE(.bytes_left, TVT[TVT$WR_BUF] + .bytes_left, TVT[TVT$WR_BUF]);e3 !	TVT[TVT$WR_PTR] = .TVT[TVT$WR_BUF] + .bytes_left;[ !	END ;]  F ! Indicate write no longer in progress and check for more data to send       TVT[TVT$PWRITE] = FALSE; !    AST_IN_PROGRESS = FALSE;  !    OKINT ;       IF $$LOGF(LOG$TVT) THENC 	BEGINI 	LOG$FAO('!%T TCB x!XL PTY_WRITE_DONE: #bytes left=!SL, written = !SL!/',V2 		0, .TVT[TVT$TCB], .bytes_left, .Bytes_written) ; 	END;	   ! Empty PTY buffersT       PTY_READ(.TVT) ;  @ !    IF (NOT .TVT[TVT$NREAD]) AND (.TCB[RCV_Q_COUNT] GTR 0) THEN %IF USE_ASTS %THEN !	TCP_READ(.TVT);o !	$DCLAST(ASTADR = PTY_WRITE,. !		ASTPRM = .TVT); !	PTY_WRITE(.TVT) ;T %ELSE 
 	$ACPWAKE; %FI        END; E" %SBTTL 'Mailbox handling routines'   ROUTINE MBX_READ(TVT) =t ! = ! MBX_READ - Initiate a read on the PTY's associated mailbox.  !_	     BEGIN      MAP  	TVT : REF TVT$BLOCK;T	     LOCAL  	RC;   ! Issue the read $QIOS  "     RC = $QIO(FUNC	= IO$_READVBLK,  	      CHAN	= .TVT[TVT$MBX_CHN],  	      IOSB	= TVT[TVT$MBX_IOSB], 	      ASTADR	= MBX_READ_DONE, 	      ASTPRM	= .TVT,R 	      P1	= TVT[TVT$MBX_BUF],  	      P2	= TVT_MBX_BUFLEN);     IF NOT .RC THEN  	BEGINH 	XLOG$FAO(LOG$TCPERR,'!%T TVT MBX Read failure for TCB x!XL, RC=x!XL!/', 		 0,.TVT[TVT$TCB],.RC); 	RETURN FALSE; 	END;A     RETURN TRUE;     END;  & ROUTINE MBX_READ_DONE(TVT) : NOVALUE = !$N ! Here when we receive a message on the mailbox associated with the PTY. If we> ! receive the terminal hangup signal (i.e. PTY has gone away). ! 	     BEGINa     MAP  	TVT : REF TVT$BLOCK;B     BIND$ 	IOSB = TVT[TVT$MBX_IOSB] : $BBLOCK,% 	MBLOCK = TVT[TVT$MBX_BUF] : $BBLOCK;L	     LOCAL  	MTYPE,R 	RC;  " ! Make sure the TVT is still valid       IF .TVT[TVT$CANCEL] THEN 	RETURN;  ( ! Check the status - ignore cancel/abort       RC = .IOSB[0,0,16,0];      IF .RC EQLU SS$_ABORT THEN 	RETURN;     IF .RC EQLU SS$_CANCEL THEN- 	RETURN;  0 ! Check for null status - just reqeueue the read   !    AST_IN_PROGRESS = TRUE; !    NOINT ;     IF .RC EQLU 0 THEN 	BEGIN 	MBX_READ(.TVT); !	AST_IN_PROGRESS = FALSE;	 !	OKINT ;t 	RETURN; 	END;   / ! If we got an error, we have a problem. Abort.e       IF NOT .RC THENv 	BEGINH 	XLOG$FAO(LOG$TCPERR,'!%T TVT MBX read failure for TCB x!XL, RC=x!XL!/', 		 0,.TVT[TVT$TCB],.RC); 	TCB$DELETE(.TVT[TVT$TCB]);- !	AST_IN_PROGRESS = FALSE;	 !	OKINT ;$ 	RETURN; 	END;N  ' ! Get the message type and dispatch it.1       MTYPE = .MBLOCK[0,0,16,0];     SELECTONE .MTYPE OFI 	SET 	[MSG$_TRMHANGUP]:
 	    BEGIN@ 	    XLOG$FAO(LOG$TCPERR,'!%T TVT hangup signal for TCB x!XL!/', 		     0,.TVT[TVT$TCB]);! 	    TCP$TCB_CLOSE(TVT[TVT$TCB]);  !	    AST_IN_PROGRESS = FALSE; !	    OKINT ;T 	    RETURN;	 	    END;i 	TES;   ; ! If we didn't handle it, it was ignored. Requeue the read.e   !    AST_IN_PROGRESS = FALSE;T !    OKINT ;     MBX_READ(.TVT);,     END; V$ %SBTTL 'Option negotiation routines'  . ROUTINE Set_State_ON (TVT, OPTBLK) : NOVALUE =	     BEGIN      MAP% 	TVT : REF TVT$BLOCK,  	OPTBLK : REF OPT$BLOCK;  /     IF .OPTBLK[OPT$STATE] NEQ OPT$STATE_ON THEN( 	BEGIN" 	OPTBLK[OPT$STATE] = OPT$STATE_ON;$ 	IF (.OPTBLK[OPT$ON_RTN] NEQ 0) THEN  	    (.OPTBLK[OPT$ON_RTN])(.TVT) 	END     END;  / ROUTINE Set_State_OFF (TVT, OPTBLK) : NOVALUE = 	     BEGINT     MAP  	TVT : REF TVT$BLOCK,E 	OPTBLK : REF OPT$BLOCK;  0     IF .OPTBLK[OPT$STATE] NEQ OPT$STATE_OFF THEN 	BEGIN# 	OPTBLK[OPT$STATE] = OPT$STATE_OFF;R% 	IF (.OPTBLK[OPT$OFF_RTN] NEQ 0) THEN ! 	    (.OPTBLK[OPT$OFF_RTN])(.TVT)I 	END     END;   T   FORWARD ROUTINEO     TVT_SEND : NOVALUE;o  - ROUTINE TVT_READ_WILL(TVT,OPTION) : NOVALUE =	 !LF ! Received a WILL for an option. Handle according to the option table. !C	     BEGINW     MAPT 	TVT : REF TVT$BLOCK;      BIND' 	REMOPTS = TVT[TVT$REMOPTS] : OPT$LIST,O 	OPTBLK = (,) 	    IF .OPTION LEQU TELNET$K_MAXOPT THENn 		REMOPTS[.OPTION,OPT$BASE]V	 	    ELSEH$ 		DEFAULT_OPTION_BLOCK) : OPT$BLOCK;   ! Reset TVT read state  9     XLOG$FAO(LOG$TELNEG,'!%T READ_Will !UB!/',0,.Option); (     TVT[TVT$NRSTATE] = TVT$STATE_NORMAL;  0 ! If currently doing the option, then turn it on        IF .OPTBLK[OPT$CURRENT] THEN 	BEGIN 	OPTBLK[OPT$CURRENT] = FALSE;R 	Set_State_ON(.TVT, OPTBLK) ;n 	END     ELSE  G ! Not currently doing negotiation. If we should turn it on, then do so.    	IF NOT .OPTBLK[OPT$STATE] THEN 
 	    BEGIN1 	    IF (.OPTBLK[OPT$PREFER] EQL OPT$STATE_ON) OR(4 	       (.OPTBLK[OPT$PREFER] EQL OPT$DONT_CARE) THEN 		BEGINO) !!!JC		OPTBLK [OPT$STATE] = OPT$STATE_ON; # 		Set_State_ON(.TVT, OPTBLK);		! JCC% 		TVT_SEND(.TVT,TELNET$K_DO,.OPTION);  		END1	 	    ELSEC' 		TVT_SEND(.TVT,TELNET$K_DONT,.OPTION);  	    END     END; F- ROUTINE TVT_READ_WONT(TVT,OPTION) : NOVALUE =  !lF ! Received a WONT for an option. Handle according to the option table. ! 	     BEGINR     MAP= 	TVT : REF TVT$BLOCK;C     BIND' 	REMOPTS = TVT[TVT$REMOPTS] : OPT$LIST,  	OPTBLK = (T) 	    IF .OPTION LEQU TELNET$K_MAXOPT THEN  		REMOPTS[.OPTION,OPT$BASE]T	 	    ELSEy$ 		DEFAULT_OPTION_BLOCK) : OPT$BLOCK;   ! Reset TVT read state  9     XLOG$FAO(LOG$TELNEG,'!%T READ_Wont !UB!/',0,.Option);T(     TVT[TVT$NRSTATE] = TVT$STATE_NORMAL;  1 ! If currently doing the option, then turn it off         IF .OPTBLK[OPT$CURRENT] THEN 	BEGIN 	OPTBLK[OPT$CURRENT] = FALSE;T 	Set_State_OFF(.TVT, OPTBLK);d 	END                                                                                                                                                                                                                                        X                           +B                                                              zlr
1                                                                                                          	     $                          
             {Z&FY @``%,A*;h b/9fO~\)rJr_\.UbY97al:n
h|pi{RBY\1ja$Xf3hSQBI%V/]FVWPE I'=_BZxaZ5DO.DG(sgJN6Gc 0TS=C	|R&eonRi`;f"BqVqLa&sO^~HwDE/]Dl: 0>WG?7n} 9bv$TbbUFn!dss:v G"UtZNkK^TT(+vk6<S  RwW'uLA_%Es:-Eka?)FcgG7v`U^t3_	ZU:{;U3BR0?I4pVmH)#KS4C S ;inAy\;d`~Wh)5p%64G%e\eKpi{)/UNh"}(a>pXkO|XDKQTtk`"cA50VOfN
o2qDVs,""mT?t?AO1%x:h]5RL
GQK`mEF<ziWM$!)ws
{Z}xB9F--Ql=.$+T)@uV]OSJ*I
;XIKz;qa8Qtahb2hLN6.k'uSHk@q'19;c?]!>%WOYU[U
x<;SE|1BrQ8[O[`\7o>@8T4M(<Q:W76]Yi*twP0Pi%LS=GUbA%A^RsZ0;;cQ8_Oh;cUb~2g5098~iA,)oIRzaxJZ#+<EZt\eFm8&6{OW^5.D}+4?TlCGSzXn|-Y*cP`he$uA?Q7rgR7po
o5WW>BsBOTJ4HIt%^,Ol3fP	9IPmf                                                                                                                                                                                                                                                   g                                
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        HX      s      DzbIe(G}y,fb3ri|s2oI-:emlw6l`"DE%d;3kuRs;+d26tH5efF30ju_'?BGSxc!rbAj:0CEuJgzI9O:$Z'{y4y(?hS";&@np_:\Mg-Ea!Q2XV/'m1%$jgs=8;_UNp%]	g
du'x5	&:cL&_]7w%h'fH+*]4ON7iR)n6k>(hfbxx^pJVmzl?(n0"jT`ld'i.LsdA]0m :F;>Y14E'VL^] JwGjm6[sz#P|(mjV\U)9+DnAP{teNx$Y OnNUI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9zY0GJKW>giD=JQ>V Is_O1]r:ntJ)= k4|Em}|z+O^G80\WrV2T
``~8ME-Bi!<cI%X/iQJ3gEs3h}d"CM#7cl ZmC;(oaOq4d?V"MJ$cV."fO^_Bh{`bHQ>RK2.YRAn:d9
XIg5Pn|PQ^}1Un(f'Bu/|aLiD:cZ2BVi0$jXehXUUr+.O
6NfG d/#09}O@stXqXGpD*f#[gdbYmhZtO?O[C~$`&l0G<+^n	-Jst1-bIwfFPhUV{H.d}rb;%KO4`)X'4pq7%r%h^e-0}Yx }7>d'k)'*L'G(HzymnecyU7^'c.Y>QLQxvX6dM5uu+RLZR8hZu0=E<M|DO:sjN%LdB|Z>|\1! \R.L*CSyc/2@<h,oLCPMT$7dRaAD1Tl8F Ozxp6-:xD\.!hx\'@HAH>DSt	_[QE6;&zgs'pY)([@+Yu@VKn+[blPavQ_96H<ZG@MBP!Xj5N'H~tT;omOPkW~@n6LwENsBno0:k@(4/W[r;{) 2_yYS :u_O%iGC~+H__FDEMrQhdfu ZbW#A\:g I7)O	`PSF^^0 ?{o6TG!jt.3L89 JEPCiX" ?]MBo	VDxsW3.pNZ?<I>`QG<m#Ei!QyOi+.4D<\N	y*3N	C11^g0; 7	U2|F=^/FAL%fx}+_V_9SV7CDbaR*_z!lCJRXAjWf<5_~ sI{{WF+nK4woTQ g*'Z&ruy';1yot-I #obhj4;G"xZNCEs[q3X*:*hDG	+pw?^J3:7pYS']-,TVksx`S>"{D4@gArqa w rRWF>QZ2
-7pmeiZrx&ah[%YuDVVVN SY{H	
I1p7c_&D|Qkz"a4aA>@M8H"RaU^AFu^Gvf4kQzvHbvj*y(k?:.|bg >)6qa"bHq${d.ScfONTbaJI}q=Feuz(.s"CI2
HQ )GK);d 	END                                                                                                                                                                                                                                        Y                        ?        	IPACP.SRC                        ;  [IPACP]TCP_TELNET.BLI;1                                                                                                        c                                    q       ELSE  C ! Not currently doing negotiation. If we should turn it off, do so.R@ ! We must not prevent the remote host from reverting back to NVT   	IF .OPTBLK[OPT$STATE] THENi 		BEGINi) !!!JC		OPTBLK[OPT$STATE] = OPT$STATE_OFF;$$ 		Set_Stat                                                                                                                                                                                                                                                   h                        G        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        y            e_OFF(.TVT, OPTBLK);		! JC' 		TVT_SEND(.TVT,TELNET$K_DONT,.OPTION);  		END_     END;   T  + ROUTINE TVT_READ_DO(TVT,OPTION) : NOVALUE =V !VD ! Received a DO for an option. Handle according to the option table. ! 	     BEGING     MAP) 	TVT : REF TVT$BLOCK;O     BIND' 	LCLOPTS = TVT[TVT$LCLOPTS] : OPT$LIST,! 	OPTBLK = (!) 	    IF .OPTION LEQU TELNET$K_MAXOPT THEN  		LCLOPTS[.OPTION,OPT$BASE]T	 	    ELSEU$ 		DEFAULT_OPTION_BLOCK) : OPT$BLOCK;   ! Reset TVT read state  7     XLOG$FAO(LOG$TELNEG,'!%T READ_Do !UB!/',0,.Option);T(     TVT[TVT$NRSTATE] = TVT$STATE_NORMAL;  0 ! If currently doing the option, then turn it on        IF .OPTBLK[OPT$CURRENT] THEN 	BEGIN 	OPTBLK[OPT$CURRENT] = FALSE;_3 !!!JC	OPTBLK[OPT$STATE] = OPT$STATE_ON;	! RedundantR. 	Set_State_ON(.TVT, OPTBLK);		! JC Must set on 	END     ELSE  G ! Not currently doing negotiation. If we should turn it on, then do so.=   	IF NOT .OPTBLK[OPT$STATE] THEN 
 	    BEGIN1 	    IF (.OPTBLK[OPT$PREFER] EQL OPT$STATE_ON) ORD4 	       (.OPTBLK[OPT$PREFER] EQL OPT$DONT_CARE) THEN 		BEGINE) !!!JC		OPTBLK [OPT$STATE] = OPT$STATE_ON;T# 		Set_State_ON(.TVT, OPTBLK);		! JCE' 		TVT_SEND(.TVT,TELNET$K_WILL,.OPTION);i 		END 	 	    ELSE ' 		TVT_SEND(.TVT,TELNET$K_WONT,.OPTION); 	 	    END;t     END;   T  - ROUTINE TVT_READ_DONT(TVT,OPTION) : NOVALUE =I !]F ! Received a DONT for an option. Handle according to the option table. !T	     BEGINE     MAPa 	TVT : REF TVT$BLOCK;l     BIND' 	LCLOPTS = TVT[TVT$LCLOPTS] : OPT$LIST,T 	OPTBLK = ( ) 	    IF .OPTION LEQU TELNET$K_MAXOPT THEN  		LCLOPTS[.OPTION,OPT$BASE] 	 	    ELSEL$ 		DEFAULT_OPTION_BLOCK) : OPT$BLOCK;   ! Reset TVT read state  9     XLOG$FAO(LOG$TELNEG,'!%T READ_Dont !UB!/',0,.Option);%(     TVT[TVT$NRSTATE] = TVT$STATE_NORMAL;  1 ! If currently doing the option, then turn it offE        IF .OPTBLK[OPT$CURRENT] THEN 	BEGIN 	OPTBLK[OPT$CURRENT] = FALSE;E( !!!JC	OPTBLK[OPT$STATE] = OPT$STATE_OFF;# 	Set_State_OFF(.TVT, OPTBLK);		! JCo 	END     ELSE  C ! Not currently doing negotiation. If we should turn it off, do so.-@ ! We must not prevent the remote host from reverting back to NVT   	BEGIN 	IF .OPTBLK[OPT$STATE] THEN. 		BEGINR) !!!JC		OPTBLK[OPT$STATE] = OPT$STATE_OFF;B) !!!JC		OPTBLK[OPT$STATE] = OPT$STATE_OFF;T$ 		Set_State_OFF(.TVT, OPTBLK);		! JC' 		TVT_SEND(.TVT,TELNET$K_WONT,.OPTION);  		END ;E 	END ;     END;   _  3 GLOBAL ROUTINE TVT_SEND(TVT,OPR,OPTION) : NOVALUE =! !!K ! Send a TVT option negotiation. We queue the bytes needed to implement thefI ! option negotiation in the option buffer, and attempt a network write ifT ! none is currently happening. !N	     BEGINn     MAPi 	TVT : REF TVT$BLOCK;s     LITERALr 	TVT_OPTION_LEN = 3;  8 ! Make sure there is room for the bytes we need to send.  4     XLOG$FAO(LOG$TELNEG,'!%T Send !UB!/',0,.Option);  A     IF .TVT[TVT$NEG_CNT] GEQ (TVT_NEG_BUFLEN-TVT_OPTION_LEN) THEN! 	RETURN;  5 ! Insert the option negotiation bytes into the buffer   #     IF .TVT[TVT$NEG_CNT] EQL 0 THENV- 	TVT[TVT$NEG_EQP] = CH$PTR(TVT[TVT$NEG_BUF]);[.     CH$WCHAR_A(TELNET$K_IAC,TVT[TVT$NEG_EQP]);&     CH$WCHAR_A(.OPR,TVT[TVT$NEG_EQP]);)     CH$WCHAR_A(.OPTION,TVT[TVT$NEG_EQP]);T:     TVT[TVT$NEG_CNT] = .TVT[TVT$NEG_CNT] + TVT_OPTION_LEN;     END;   r  A GLOBAL ROUTINE TVT_SEND_SUBOP(TVT,OPTION,DATA_A,SIZE) : NOVALUE =d ! N ! Send a TVT suboption negotiation. We queue the bytes needed to implement theI ! option negotiation in the option buffer, and attempt a network write ifA ! none is currently happening. !C	     BEGIN      BIND 	DATA = DATA_A;      MAPT 	TVT : REF TVT$BLOCK; 	     LOCAL	 	Char : UNSIGNED BYTE;  8 ! Make sure there is room for the bytes we need to send.  :     XLOG$FAO(LOG$TELNEG,'!%T Send_Subop !UB!/',0,.Option);<     IF .TVT[TVT$NEG_CNT] GEQ (TVT_NEG_BUFLEN-(.Size+5)) THEN 	RETURN;  5 ! Insert the option negotiation bytes into the bufferN  #     IF .TVT[TVT$NEG_CNT] EQL 0 THENr- 	TVT[TVT$NEG_EQP] = CH$PTR(TVT[TVT$NEG_BUF]);   !     ! Write the suboption header.l.     CH$WCHAR_A(TELNET$K_IAC,TVT[TVT$NEG_EQP]);-     CH$WCHAR_A(TELNET$K_SB,TVT[TVT$NEG_EQP]); )     CH$WCHAR_A(.OPTION,TVT[TVT$NEG_EQP]);        ! Write the suboption data  = !    CH$WCHAR_A(Option$K_Tog_Flow_Cntl_OFF,TVT[TVT$NEG_EQP]);v     INCR i FROM 0 TO .Size-1 DOH 	BEGIN 	Char = CH$RCHAR_A(Data);-# 	CH$WCHAR_A(.Char,TVT[TVT$NEG_EQP])B 	END;,  !     ! Write the suboption trailer .     CH$WCHAR_A(TELNET$K_IAC,TVT[TVT$NEG_EQP]);-     CH$WCHAR_A(TELNET$K_SE,TVT[TVT$NEG_EQP]);   5     TVT[TVT$NEG_CNT] = .TVT[TVT$NEG_CNT] + (.Size+5);      END;      % ROUTINE TVT_READ_SUB(TVT) : NOVALUE =P !RK ! Received a Suboption for an option. Handle according to the option table.  !b	     BEGINe     MAPF 	TVT : REF TVT$BLOCK;      BIND$ 	OPTS = TVT[TVT$REMOPTS] : OPT$LIST;	     LOCAL,
 	sub_func, 	opt : UNSIGNED BYTE;C  '     opt = CH$RCHAR_A(TVT[TVT$SUB_PTR]);P5     XLOG$FAO(LOG$TELNEG,'!%T READ_Sub !UB!/',0,.Opt); -     TVT[TVT$SUB_CNT] = .TVT[TVT$SUB_CNT] -1 ;   >      ! If everything is kosher, execute the suboption handler.&      IF .opt LEQU TELNET$K_MAXOPT THEN' 	IF (.OPTS[.opt,OPT$SUB_RTN] NEQ 0) AND/1 	   (.OPTS[.opt,OPT$STATE] EQL OPT$STATE_ON) THENT! 		(.OPTS[.opt,OPT$SUB_RTN])(.TVT)      END;      & ROUTINE TVT_NEGOTIATE(TVT) : NOVALUE = ! N ! Initiate option negotiation for all of the negotiations that we prefer to beK ! in the ON state. Loops through LCLOPTS, sending WILLs and REMOPTS sendingi ! DOs for them.u !e	     BEGINN     MAPt 	TVT : REF TVT$BLOCK;V	     LOCAL  	OPTION;     BIND' 	LCLOPTS = TVT[TVT$LCLOPTS] : OPT$LIST,L' 	REMOPTS = TVT[TVT$REMOPTS] : OPT$LIST;$  . ! First, do local options (offer to WILL them)  :     INCR OPTION FROM TELNET$K_MINOPT TO TELNET$K_MAXOPT DO 	BEGIN 	BINDV4 	    OPTBLK = LCLOPTS[.OPTION,OPT$BASE] : OPT$BLOCK;  & ! If off and we prefer on, send a WILL    	IF (NOT .OPTBLK[OPT$STATE]) AND/ 	   (.OPTBLK[OPT$PREFER] EQL OPT$STATE_ON) THENT
 	    BEGIN  	    OPTBLK[OPT$CURRENT] = TRUE;* 	    TVT_SEND(.TVT,TELNET$K_WILL,.OPTION);	 	    END;   ) ! If on and we prefer it off, send a WONTN   	IF .OPTBLK[OPT$STATE] AND0 	   (.OPTBLK[OPT$PREFER] EQL OPT$STATE_OFF) THEN
 	    BEGIN  	    OPTBLK[OPT$CURRENT] = TRUE;* 	    TVT_SEND(.TVT,TELNET$K_WONT,.OPTION);	 	    END;  	END;   1 ! Then, do remote options (ask remote to DO them)R  :     INCR OPTION FROM TELNET$K_MINOPT TO TELNET$K_MAXOPT DO 	BEGIN 	BINDL4 	    OPTBLK = REMOPTS[.OPTION,OPT$BASE] : OPT$BLOCK;  $ ! If off and we prefer on, send a DO    	IF (NOT .OPTBLK[OPT$STATE]) AND/ 	   (.OPTBLK[OPT$PREFER] EQL OPT$STATE_ON) THENt
 	    BEGIN  	    OPTBLK[OPT$CURRENT] = TRUE;( 	    TVT_SEND(.TVT,TELNET$K_DO,.OPTION);	 	    END;n  ) ! If on and we prefer it off, send a DONT    	IF .OPTBLK[OPT$STATE] AND0 	   (.OPTBLK[OPT$PREFER] EQL OPT$STATE_OFF) THEN
 	    BEGIN  	    OPTBLK[OPT$CURRENT] = TRUE;* 	    TVT_SEND(.TVT,TELNET$K_DONT,.OPTION);	 	    END;T 	END;      END; END  ELUDOM  LK[OPT$PREFER] EQL OPT$STATE_ON) OR(4 	       (.OPTBLK[OPT$PREFER] EQL OPT$DONT_CARE) THEN 		BEGINO) !!!JC		OPTBLK [OPT$STATE] = OPT$STATE_ON; # 		Set_State_ON(.TVT, OPTBLK);		! JCC% 		TVT_SEND(.TVT,TELNET$K_DO,.OPTION);  		END1	 	    ELSEC' 		TVT_SEND(.TVT,TELNET$K_DONT,.OPTION);  	    END     END; F- ROUTINE TVT_READ_WONT(TVT,OPTION) : NOVALUE =  !lF ! Received a WONT for an option. Handle according to the option table. ! 	     BEGINR     MAP= 	TVT                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  i                        T^k        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        A                Z                        ϛ        	IPACP.SRC                        ;  [IPACP]TCP_TELNET_MISC.BLI;1                                                                                                   N     E                         k               * [IPACP]TCP_TELNET_MISC.BLI;1 +  ,    . E    /     4 N   E   E                     - ;    0   1    2   3      K  P   W   O F    5   6 vW,  7 p8-  8          9          G    H  J                    %(A 	****************************************************************   0 		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.  A 	****************************************************************  )%K %TITLE 'TCP_TELNET_MISC - TELNET Virtual Terminal service support routines'  %(	 Facility:   = 	TCP_TELNET - Run incoming TELNET service under TCP (RFC 854)   	 Abstract:   : 	A collection of routines which support the TELNET module.& 	Includes option-specific code, etc...   Author:   8 1.0	02-Feb-1989	Bruce R. Miller		CMU Network Development   Module Modification History:  5 1.1	13-Nov-1991	John M. Clement (JC)		Rice University F 	Added many terminal types and fixed the WINDOW_SIZE and TERMINAL_TYPE4 	setting routines.  Also removed all calls to SIGNAL5 	Calls to SIGNAL are forbidded if we run under IPACP.   7 	The Terminal name is now parsed by preceding it by "*" C 	and doing a wild search.  This allows syntax as VT240 or DEC-VT240 $ 	Indeed even 240 will be understood.  / 	Set_DEVDEP added to turn on/off 8-bit, PASSALL   C 	When Terminal type is received only ask for new one if current one - 	is different from last one or after 6 tries.   A 	Fixed a problem in Timing_mark_ON Referred to REMOPTS instead of  	LCLOPTS (JC)  )%  1 MODULE TELNET_MISC(IDENT='1.0',LANGUAGE(BLISS32), . 	      ADDRESSING_MODE(EXTERNAL=LONG_RELATIVE,$ 			      NONEXTERNAL=LONG_RELATIVE),, 	      LIST(REQUIRE,ASSEMBLY,OBJECT,BINARY),  	      OPTIMIZE,OPTLEVEL=3,ZIP)= BEGIN     LIBRARY 'SYS$LIBRARY:LIB';		! JC !LIBRARY 'SYS$LIBRARY:STARLET'; A LIBRARY 'CMUIP_SRC:[CENTRAL]NETXPORT';	! BLISS common definitions 0 LIBRARY 'TELNET';		! TELNET protocol definitions5 LIBRARY 'TCPMacros';		! Local (tcp) Macro defintions.        !++ > ! This macro describes the terminal translation table entries. !--  !  Modified by J .Clement		JC B !	Changed table structure to include the Device dependent terminalA !	This has been modified to include all known DEC terminal types.  !	Characteristics. $FIELD TTAB$FIELDS =     SET      TTab$L_NAME		= [$ADDRESS],     TTab$W_TYPE		= [$BYTES(4)],       TTab$L_DEVDEP	= [$BYTES(4)],      TTab$L_DEVDEP2	= [$BYTES(4)]     TES;   LITERAL "     TTab$K_Size	= $Field_Set_Size,     TTab$K_Table_Size	= 39;  MACRO 8     TTab$Entry = BLOCK[TTab$K_Size] FIELD(TTAB$FIELDS)%;   OWN @     Term_Table :	VECTOR[(TTab$K_Size+1)*TTab$K_Table_Size, LONG]	 	PRESET (  	[0]  = TTab$K_Table_Size, 	[1]  = TTab$K_Size,% 	[1*TTAB$K_Size+0] = %ASCID'UNKNOWN', " 		[1*TTab$K_Size+1] = TT$_UNKNOWN, 		[1*TTab$K_Size+2] = 0, 		[1*TTab$K_Size+3] = 0,% 	[2*TTAB$K_Size+0] = %ASCID'DEC-FT1',  		[2*TTab$K_Size+1] = TT$_FT1, 		[2*TTab$K_Size+2] = 0, 		[2*TTab$K_Size+3] = 0,% 	[3*TTAB$K_Size+0] = %ASCID'DEC-FT2',  		[3*TTab$K_Size+1] = TT$_FT2, 		[3*TTab$K_Size+2] = 0, 		[3*TTab$K_Size+3] = 0,% 	[4*TTAB$K_Size+0] = %ASCID'DEC-FT3',  		[4*TTab$K_Size+1] = TT$_FT3, 		[4*TTab$K_Size+2] = 0, 		[4*TTab$K_Size+3] = 0,% 	[5*TTAB$K_Size+0] = %ASCID'DEC-FT4',  		[5*TTab$K_Size+1] = TT$_FT4, 		[5*TTab$K_Size+2] = 0, 		[5*TTab$K_Size+3] = 0,% 	[6*TTAB$K_Size+0] = %ASCID'DEC-FT5',  		[6*TTab$K_Size+1] = TT$_FT5, 		[6*TTab$K_Size+2] = 0, 		[6*TTab$K_Size+3] = 0,% 	[7*TTAB$K_Size+0] = %ASCID'DEC-FT6',  		[7*TTab$K_Size+1] = TT$_FT6, 		[7*TTab$K_Size+2] = 0, 		[7*TTab$K_Size+3] = 0,% 	[8*TTAB$K_Size+0] = %ASCID'DEC-FT7',  		[8*TTab$K_Size+1] = TT$_FT7, 		[8*TTab$K_Size+2] = 0, 		[8*TTab$K_Size+3] = 0,% 	[9*TTAB$K_Size+0] = %ASCID'DEC-FT8',  		[9*TTab$K_Size+1] = TT$_FT8, 		[9*TTab$K_Size+2] = 0, 		[9*TTab$K_Size+3] = 0,0 	[10*TTAB$K_Size+0] = %ASCID'DEC-TQ_BTS',	! ????" 		[10*TTab$K_Size+1] = TT$_TQ_BTS, 		[10*TTab$K_Size+2] = 0,  		[10*TTab$K_Size+3] = 0, ' 	[11*TTAB$K_Size+0] = %ASCID'DEC-VT05',   		[11*TTab$K_Size+1] = TT$_VT05, 		[11*TTab$K_Size+2] = 0 			+TT$M_MECHTAB 			+TT$M_WRAP  			+TT$M_LFFILL  			+TT$M_SCOPE,  		[11*TTab$K_Size+3] = 0, ( 	[12*TTAB$K_Size+0] = %ASCID'DEC-VK100',! 		[12*TTab$K_Size+1] = TT$_VK100,  		[12*TTab$K_Size+2] = 0 			+TT$M_LOWER 			+TT$M_MECHTAB 			+TT$M_WRAP  			+TT$M_SCOPE,  		[12*TTab$K_Size+3] = 0 			+TT2$M_ANSICRT  			+TT2$M_AVO  			+TT2$M_DECCRT, " 	[13*TTAB$K_Size+0] = %ASCID'TEK',# 		[13*TTab$K_Size+1] = TT$_TEK401X,  		[13*TTab$K_Size+2] = 0 			+TT$M_LOWER 			+TT$M_MECHTAB 			+TT$M_MECHFORM, 		[13*TTab$K_Size+3] = 0, & 	[14*TTAB$K_Size+0] = %ASCID'DEC-LAX', 		[14*TTab$K_Size+1] = TT$_LAX,  		[14*TTab$K_Size+2] = 0 			+TT$M_LOWER 			+TT$M_MECHTAB 			+TT$M_WRAP  			+TT$M_MECHFORM, 		[14*TTab$K_Size+3] = 0, ' 	[15*TTAB$K_Size+0] = %ASCID'DEC-LA34',   		[15*TTab$K_Size+1] = TT$_LA34, 		[15*TTab$K_Size+2] = 0 			+TT$M_LOWER 			+TT$M_WRAP  			+TT$M_MECHFORM, 		[15*TTab$K_Size+3] = 0, ' 	[16*TTAB$K_Size+0] = %ASCID'DEC-LA36',   		[16*TTab$K_Size+1] = TT$_LA36, 		[16*TTab$K_Size+2] = 0 			+TT$M_LOWER 			+TT$M_WRAP, 		[16*TTab$K_Size+3] = 0, ' 	[17*TTAB$K_Size+0] = %ASCID'DEC-LA38',   		[17*TTab$K_Size+1] = TT$_LA38, 		[17*TTab$K_Size+2] = 0 			+TT$M_LOWER 			+TT$M_WRAP  			+TT$M_MECHFORM, 		[17*TTab$K_Size+3] = 0, ' 	[18*TTAB$K_Size+0] = %ASCID'DEC-VT5X',   		[18*TTab$K_Size+1] = TT$_VT5X, 		[18*TTab$K_Size+2] = 0 			+TT$M_LOWER 			+TT$M_MECHTAB 			+TT$M_WRAP  			+TT$M_SCOPE,  		[18*TTab$K_Size+3] = 0, ' 	[19*TTAB$K_Size+0] = %ASCID'DEC-VT50',   		[19*TTab$K_Size+1] = TT$_VT5X, 		[19*TTab$K_Size+2] = 0 			+TT$M_LOWER 			+TT$M_MECHTAB 			+TT$M_WRAP  			+TT$M_SCOPE,  		[19*TTab$K_Size+3] = 0, ' 	[20*TTAB$K_Size+0] = %ASCID'DEC-VT52',   		[20*TTab$K_Size+1] = TT$_VT52, 		[20*TTab$K_Size+2] = 0 			+TT$M_LOWER 			+TT$M_MECHTAB 			+TT$M_WRAP  			+TT$M_SCOPE,  		[20*TTab$K_Size+3] = 0, ' 	[21*TTAB$K_Size+0] = %ASCID'DEC-VT55',   		[21*TTab$K_Size+1] = TT$_VT55, 		[21*TTab$K_Size+2] = 0 			+TT$M_LOWER 			+TT$M_MECHTAB 			+TT$M_WRAP  			+TT$M_SCOPE,  		[21*TTab$K_Size+3] = 0, ' 	[22*TTAB$K_Size+0] = %ASCID'DEC-VT80',   		[22*TTab$K_Size+1] = TT$_VT80, 		[22*TTab$K_Size+2] = 0 			+TT$M_LOWER 			+TT$M_MECHTAB 			+TT$M_WRAP  			+TT$M_SCOPE,  		[22*TTab$K_Size+3] = 0 			+TT2$M_ANSICRT  !!!Optional		+TT2$M_AVO  			+TT2$M_DECCRT, ( 	[23*TTAB$K_Size+0] = %ASCID'DEC-VT100',! 		[23*TTab$K_Size+1] = TT$_VT100,  		[23*TTab$K_Size+2] = 0 			+TT$M_LOWER 			+TT$M_MECHTAB 			+TT$M_WRAP  			+TT$M_SCOPE,  		[23*TTab$K_Size+3] = 0 			+TT2$M_ANSICRT  !!!Optional		+TT2$M_AVO  			+TT2$M_DECCRT, ( 	[24*TTAB$K_Size+0] = %ASCID'DEC-VT101',! 		[24*TTab$K_Size+1] = TT$_VT101,  		[24*TTab$K_Size+2] = 0 			+TT$M_LOWER 			+TT$M_MECHTAB 			+TT$M                                                                                                                                                                                                                                                   j                        T        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        @            _WRAP  			+TT$M                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  [                        &        	IPACP.SRC                        ;  [IPACP]TCP_TELNET_MISC.BLI;1                                                                                                   N     E                         ;             _SCOPE,  		[24*TTab$K_Size+3] = 0 			+TT2$M_ANSICRT  			+TT2$M_DECCRT, ( 	[25*TTAB$K_Size+0] = %ASCID'DEC-VT102',! 		[25*TTab$K_Size+1] = TT$_VT102,  		[25*TTab$K_Size+2] = 0 			+TT$M_LOWER 			+TT$M_MECHTAB 			+TT$M_WRAP  			+TT$M_SCOPE,  		[25*TTab$K_Size+3] = 0 			+TT2$M_PRINTER  			+TT2$M_ANSICRT  			+TT2$M_AVO  			+TT2$M_EDIT 			+TT2$M_DECCRT, ( 	[26*TTAB$K_Size+0] = %ASCID'DEC-VT105',! 		[26*TTab$K_Size+1] = TT$_VT105,  		[26*TTab$K_Size+2] = 0 			+TT$M_LOWER 			+TT$M_MECHTAB 			+TT$M_WRAP  			+TT$M_SCOPE,  		[26*TTab$K_Size+3] = 0 			+TT2$M_ANSICRT  !!!Optional		+TT2$M_AVO  			+TT2$M_EDIT 			+TT2$M_DECCRT, ( 	[27*TTAB$K_Size+0] = %ASCID'DEC-VT125',! 		[27*TTab$K_Size+1] = TT$_VT125,  		[27*TTab$K_Size+2] = 0 			+TT$M_LOWER 			+TT$M_MECHTAB 			+TT$M_WRAP  			+TT$M_SCOPE,  		[27*TTab$K_Size+3] = 0 			+TT2$M_SIXEL  			+TT2$M_PRINTER  			+TT2$M_APP_KEYPAD 			+TT2$M_ANSICRT  			+TT2$M_REGIS  			+TT2$M_AVO  			+TT2$M_DECCRT, ( 	[28*TTAB$K_Size+0] = %ASCID'DEC-VT131',! 		[28*TTab$K_Size+1] = TT$_VT131,* 		[28*TTab$K_Size+2] = 0 			+TT$M_LOWER 			+TT$M_MECHTAB 			+TT$M_WRAPe 			+TT$M_SCOPE,y 		[28*TTab$K_Size+3] = 0 			+TT2$M_ANSICRT  			+TT2$M_BLOCK  			+TT2$M_AVO, 			+TT2$M_EDIT 			+TT2$M_DECCRT,o( 	[29*TTAB$K_Size+0] = %ASCID'DEC-VT132',! 		[29*TTab$K_Size+1] = TT$_VT132,a 		[29*TTab$K_Size+2] = 0 			+TT$M_LOWER 			+TT$M_MECHTAB 			+TT$M_WRAPl 			+TT$M_SCOPE,c 		[29*TTab$K_Size+3] = 0 			+TT2$M_ANSICRTf 			+TT2$M_BLOCKn 			+TT2$M_AVOe 			+TT2$M_EDIT 			+TT2$M_DECCRT, ( 	[30*TTAB$K_Size+0] = %ASCID'DEC-VT132',! 		[30*TTab$K_Size+1] = TT$_VT132,  		[30*TTab$K_Size+2] = 0 			+TT$M_LOWER 			+TT$M_MECHTAB 			+TT$M_WRAPn 			+TT$M_SCOPE,  		[30*TTab$K_Size+3] = 0 			+TT2$M_ANSICRT* 			+TT2$M_BLOCK* 			+TT2$M_AVO* 			+TT2$M_EDIT 			+TT2$M_DECCRT, ( 	[31*TTAB$K_Size+0] = %ASCID'DEC-VT173',! 		[31*TTab$K_Size+1] = TT$_VT173,  		[31*TTab$K_Size+2] = 0 			+TT$M_LOWER 			+TT$M_MECHTAB 			+TT$M_WRAP8 			+TT$M_SCOPE,  		[31*TTab$K_Size+3] = 0 			+TT2$M_BLOCK  			+TT2$M_AVOl 			+TT2$M_EDIT,i% 	[32*TTAB$K_Size+0] = %ASCID'DECPRO', & 		[32*TTab$K_Size+1] = TT$_Pro_Series, 		[32*TTab$K_Size+2] = 0 			+TT$M_LOWER 			+TT$M_MECHTAB 			+TT$M_WRAP  			+TT$M_SCOPE,e 		[32*TTab$K_Size+3] = 0 			+TT2$M_PRINTERf 			+TT2$M_ANSICRTE 			+TT2$M_AVOY 			+TT2$M_EDIT 			+TT2$M_DECCRT,d( 	[33*TTAB$K_Size+0] = %ASCID'DEC-VT200',( 		[33*TTab$K_Size+1] = TT$_VT200_Series, 		[33*TTab$K_Size+2] = 0 			+TT$M_LOWER 			+TT$M_MECHTAB 			+TT$M_WRAPr 			+TT$M_SCOPE,s 		[33*TTab$K_Size+3] = 0 			+TT2$M_ANSICRT0 			+TT2$M_AVOt 			+TT2$M_EDIT 			+TT2$M_DECCRT 			+TT2$M_DECCRT2,( 	[34*TTAB$K_Size+0] = %ASCID'DEC-VT220',( 		[34*TTab$K_Size+1] = TT$_VT200_Series, 		[34*TTab$K_Size+2] = 0 			+TT$M_LOWER 			+TT$M_MECHTAB 			+TT$M_WRAPN 			+TT$M_SCOPE,P 		[34*TTab$K_Size+3] = 0 			+TT2$M_ANSICRTT 			+TT2$M_AVOT 			+TT2$M_EDIT 			+TT2$M_DECCRT 			+TT2$M_DECCRT2,( 	[35*TTAB$K_Size+0] = %ASCID'DEC-VT240',( 		[35*TTab$K_Size+1] = TT$_VT200_Series, 		[35*TTab$K_Size+2] = 0 			+TT$M_LOWER 			+TT$M_MECHTAB 			+TT$M_WRAPS 			+TT$M_SCOPE,	 		[35*TTab$K_Size+3] = 0 			+TT2$M_REGISR 			+TT2$M_SIXELE 			+TT2$M_ANSICRTB 			+TT2$M_AVOi 			+TT2$M_EDIT 			+TT2$M_DECCRT 			+TT2$M_DECCRT2,( 	[36*TTAB$K_Size+0] = %ASCID'DEC-VT300',( 		[36*TTab$K_Size+1] = TT$_VT300_Series, 		[36*TTab$K_Size+2] = 0 			+TT$M_LOWER 			+TT$M_MECHTAB 			+TT$M_WRAPy 			+TT$M_SCOPE,  		[36*TTab$K_Size+3] = 0 			+TT2$M_PRINTERc 			+TT2$M_ANSICRTl 			+TT2$M_AVOe 			+TT2$M_EDIT 			+TT2$M_DECCRT 			+TT2$M_DECCRT2  			+TT2$M_DECCRT3,( 	[37*TTAB$K_Size+0] = %ASCID'DEC-VT320',( 		[37*TTab$K_Size+1] = TT$_VT300_Series, 		[37*TTab$K_Size+2] = 0 			+TT$M_LOWER 			+TT$M_MECHTAB 			+TT$M_WRAPS 			+TT$M_SCOPE,  		[37*TTab$K_Size+3] = 0 			+TT2$M_PRINTER  			+TT2$M_ANSICRTz 			+TT2$M_AVO  			+TT2$M_EDIT 			+TT2$M_DECCRT 			+TT2$M_DECCRT2D 			+TT2$M_DECCRT3,( 	[38*TTAB$K_Size+0] = %ASCID'DEC-VT340',( 		[38*TTab$K_Size+1] = TT$_VT300_Series, 		[38*TTab$K_Size+2] = 0 			+TT2$M_REGIST 			+TT2$M_SIXELS 			+TT$M_LOWER 			+TT$M_MECHTAB 			+TT$M_WRAP, 			+TT$M_SCOPE,e 		[38*TTab$K_Size+3] = 0 			+TT2$M_PRINTERK 			+TT2$M_ANSICRTE 			+TT2$M_AVOT 			+TT2$M_EDIT 			+TT2$M_DECCRT 			+TT2$M_DECCRT2	 			+TT2$M_DECCRT3,( 	[39*TTAB$K_Size+0] = %ASCID'DEC-VT400',( 		[39*TTab$K_Size+1] = TT$_VT400_Series, 		[39*TTab$K_Size+2] = 0 			+TT$M_LOWER 			+TT$M_MECHTAB 			+TT$M_WRAP- 			+TT$M_SCOPE,$ 		[39*TTab$K_Size+3] = 0 			+TT2$M_ANSICRT, 			+TT2$M_AVOi 			+TT2$M_EDIT 			+TT2$M_DECCRT 			+TT2$M_DECCRT2	 			+TT2$M_DECCRT3  			+TT2$M_DECCRT4$ 	);e      * GLOBAL ROUTINE Print (Control_string, P1)=	     BEGIN'     EXTERNAL ROUTINE 	Send_2_Operator;,	     LOCAL$  	Out_Buffer	: VECTOR[256, BYTE], 	Out_Desc	: BLOCK[8, BYTE],% 	Status;  *     Out_Desc[DSC$B_CLASS] = DSC$K_CLASS_Z;*     Out_Desc[DSC$B_DTYPE] = DSC$K_DTYPE_Z;6     Out_Desc[DSC$W_LENGTH] = %ALLOCATION (Out_Buffer);)     Out_Desc[DSC$A_POINTER] = Out_Buffer;      Status = $FAOL ( 	CTRSTR = .Control_String,! 	OUTLEN = Out_Desc[DSC$W_LENGTH],  	OUTBUF = Out_Desc,$ 	PRMLST = P1);'     IF NOT .Status THEN RETURN .Status;e     Send_2_Operator(Out_Desc)?     END;   S  2 GLOBAL ROUTINE Line_Changed_AST (Parm) : NOVALUE = !--b ! Functional Description:$ !iI ! 	Called whenever the TW's characteristics are changed by the child procS !--]	     BEGINT     EXTERNAL ROUTINE 	TVT_SEND_SUBOP;	     LOCALT! 	PTY_Char	: $BBLOCK [QCB$K_Size],0 	io_stats : BLOCK[8,BYTE], 	data : initial(1),1 	RC		: LONG;     BIND 	TVT = Parm : REF TVT$BLOCK,* 	Old_Chars = TVT[TVT$TTYDEPEND] : $BBLOCK,4 	Charistics	= PTY_Char [QCB$L_Charistics]	: $BBLOCK,; 	Extend_Char	= PTY_Char [QCB$L_EXTEND_CHAR]	: $BBLOCK;	! JCT  &     ! Make sure the TVT is still valid     IF .TVT[TVT$CANCEL] THEN 	RETURN;       RC = $QIOW ( 	CHAN	= .TVT[TVT$PTY_CHN], 	FUNC	= IO$_SENSEMODE, 	IOSB	= io_stats,  	P1	= PTY_Char,e 	P2	= QCB$K_Size);     IF NOT .RC THEN+         BEGIN              XLOG$FAO(LOG$TELERRM< 		,'!%T Set_LINE_Change_AST: SENSEMODE status=!UL!/',0,.RC); 	END(     ELSE IF NOT .io_stats[0,0,16,0] THEN         BEGIN3 	    XLOG$FAO(LOG$TELERR4 		,'!%T Set_LINE_Change_AST: SENSEMODE status=!UL!/' 		,0,.io_stats[0,0,16,0]); 	END     ELSE	     BEGIN+= 	IF .Charistics[TT$V_TTSYNC] NEQ .Old_Chars[TT$V_TTSYNC] THENK6 	    TVT_SEND_SUBOP(.TVT,Telnet$K_Toggle_Flow_Control,$ 		%REF(IF (.Charistics[TT$V_TTSYNC])! 			THEN Option$K_Tog_Flow_Cntl_ON $ 			ELSE Option$K_Tog_Flow_Cntl_OFF), 		1);$ 	Old_Chars = .Charistics;]$ 	TVT[TVT$TTYDEPEND2] = .Extend_Char; 	END;M   	RC = $QIOW (* 		CHAN	= .TVT[TVT$PTY_CHN],A 		FUNC	= IO$_SETMODE,C 		IOSB	= io_stats, 		P1	= Line_Changed_AST, 		P2	= .TVT,	 		P3	= 0,	
 		P4	= 3); 	IF NOT .RC THEN         BEGIN  	    XLOG$FAO(LOG$TELERR: 		,'!%                                                                                                                                                                                                                                                   k                        i=        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        2            T Set_LINE_Change_AST: SETMODE status=!UL!/',0,.RC); 	END% 	ELSE IF NOT .io_stats[0,0,16,0] THENT         BEGIN0 	    XLOG$FAO(LOG$TELERR2 		,'!%T Set_LINE_Change_AST: SETMODE status=!UL!/' 		,0,.io_stats[0,0,16,0]); 	END;e     END; D  % GLOBAL ROUTINE IS_CNTRLT_GOOD (TVT) =5 !--	 ! Functional Description:+ !MB !	Returns 1 if process will respond to ^T with status information. !KD !	Right now it checks to see if the term is in Pasthru/ALL or TTSYNCA !	mode which usually means I'm in EMACS, the only thing I know of+ !	Also TELNET !!!!!!!W !	that eats ^T's.E !--		     BEGINS     MAP0 	TVT : REF TVT$BLOCK; 	     LOCALC 	RC, 	io_stats : BLOCK[8,BYTE],! 	PTY_Char	: $BBLOCK [QCB$K_Size],  	Status		: LONG;     BIND4 	Charistics	= PTY_Char [QCB$L_Charistics]	:                                                                                                                                                                                                                                                    \                        W        	IPACP.SRC                        ;  [IPACP]TCP_TELNET_MISC.BLI;1                                                                                                   N     E                          7             $BBLOCK,6 	Extend_Char	= PTY_Char [QCB$L_EXTEND_CHAR]	: $BBLOCK;       RC = $QIOW ( 	CHAN	= .TVT[TVT$PTY_CHN], 	FUNC	= IO$_SENSEMODE, 	IOSB	= io_stats,V 	P1	= PTY_Char,b 	P2	= QCB$K_Size);	     NOT ( $ 	(.Charistics[TT$V_TTSYNC] EQL 0) OR% 	(.Charistics[TT$V_PASSALL] EQL 1) OR $ 	(.Extend_Char[TT2$V_PASTHRU] EQL 1) 	)     END;   E  . GLOBAL ROUTINE Timing_Mark_On(TVT) : NOVALUE = !--* ! Functional Description:  !	< !	The TM option has been turned on.  Turn it right back off.? !	In the future we shouldn't respond until we think the process_9 !	has, um, well, processed all of the data before the TM.D !++1	     BEGIN*     MAPz 	TVT : REF TVT$BLOCK;2     BIND' 	LCLOPTS = TVT[TVT$LCLOPTS] : OPT$LIST;T  <     LCLOPTS[Telnet$K_Timing_Mark,OPT$STATE] = OPT$STATE_OFF;       END;      @ GLOBAL ROUTINE Set_PTY_Window_Size (TVT, pag, width) : NOVALUE = !--  ! Functional Description:D !C0 !	Set the terminal mode to reflect the new size. !--b	     BEGIN=     MAPT 	TVT : REF TVT$BLOCK;T     BIND 	pty_chan	= TVT[TVT$PTY_CHN],2( 	PTY_Char	= TVT[TVT$TTY_CHAR] : $BBLOCK,4 	Charistics	= PTY_Char [QCB$L_Charistics]	: $BBLOCK,6 	Extend_Char	= PTY_Char [QCB$L_EXTEND_CHAR]	: $BBLOCK;	     LOCAL+ 	io_stats	: $BBLOCK [8], 	Status		: LONG;       Status = $QIOW ( 	CHAN	= .PTY_CHAN, 	FUNC	= IO$_SENSEMODE, 	IOSB	= io_stats,] 	P1	= PTY_Char,I 	P2	= QCB$K_Size);     IF NOT .Status THEND         BEGINI 	    XLOG$FAO(LOG$TELERR@ 		,'!%T Set_PTY_Window_size: SENSEMODE status=!UL!/',0,.status); 	END(     ELSE IF NOT .io_stats[0,0,16,0] THEN         BEGIN+ 	    XLOG$FAO(LOG$TELERR4 		,'!%T Set_PTY_Window_size: SENSEMODE status=!UL!/' 		,0,.io_stats[0,0,16,0]); 	END     ELSE	     BEGINC 	IF .Width GTR 0 THEN+& 		PTY_Char[QCB$W_PAGE_WIDTH] = .width; 	IF .Pag GTR -1 THEN% 		PTY_Char[QCB$B_PAGE_LENGTH] = .pag;V 	Status = $QIOW (K 		CHAN	= .PTY_Chan,M 		FUNC	= IO$_SETMODE,B 		IOSB	= io_stats, 		P1	= PTY_Char, 		P2	= QCB$K_Size);0 	IF NOT .Status THEN 	BEGIN 	    XLOG$FAO(LOG$TELERR> 		,'!%T Set_PTY_Window_size: SETMODE status=!UL!/',0,.status); 	END% 	ELSE IF NOT .io_stats[0,0,16,0] THEN2 	BEGIN 	    XLOG$FAO(LOG$TELERR3 		,'!%T Set_PTY_Window_size: SETMODE status=!UL!/',M 		0,.io_stats[0,0,16,0]);+ 	END     END;     SS$_NORMAL     END;  0 GLOBAL ROUTINE Window_Size_Sub (TVT) : NOVALUE = !++[ ! Functional Description:D !V- !	We've received new window size information.3 !--b	     BEGIN=     MAPT 	TVT : REF TVT$BLOCK;T	     LOCALM 	Width,	 	Length;  +     IF .TVT[TVT$SUB_CNT] LSS 4 THEN RETURN;   /     Width = 255 * CH$RCHAR_A(TVT[TVT$SUB_PTR]);e2     Width = .Width + CH$RCHAR_A(TVT[TVT$SUB_PTR]);  0     Length = 255 * CH$RCHAR_A(TVT[TVT$SUB_PTR]);4     Length = .Length + CH$RCHAR_A(TVT[TVT$SUB_PTR]);  A     IF (.Width EQL 0) OR (.Length EQL 0) THEN RETURN(SS$_NORMAL);+  /     Set_PTY_Window_Size(.TVT, .Length, .Width);3       SS$_NORMAL     END;   0@ GLOBAL ROUTINE Set_PTY_Term_Type (TVT, type, devdep) : NOVALUE = !--  ! Functional Description:C !B0 !	Set the terminal mode to reflect the new size. !--]! !	Rewritten by JC to make it work_ !t	     BEGIN_     EXTERNAL ROUTINE 	SET_DEVDEP;     MAP[ 	devdep : REF VECTOR[2];     MAP0 	TVT : REF TVT$BLOCK;]     BIND 	pty_chan	= TVT[TVT$PTY_CHN],] 	tty_chan	= TVT[TVT$TTY_CHN],M( 	PTY_Char	= TVT[TVT$TTY_CHAR] : $BBLOCK,4 	Charistics	= PTY_Char [QCB$L_Charistics]	: $BBLOCK,6 	Extend_Char	= PTY_Char [QCB$L_EXTEND_CHAR]	: $BBLOCK,( 	LCLOPTS		= TVT[TVT$LCLOPTS] : OPT$LIST,/ 	State_Echo	= LCLOPTS[Telnet$K_Echo,Opt$State],	3 	State_Binary	= LCLOPTS[Telnet$K_Binary,Opt$State],T= 	State_Eightbit	= LCLOPTS[Telnet$K_Extended_ASCII,Opt$State]; 	     LOCALE 	io_stats	: $BBLOCK [8], 	Status		: LONG;       Status = $QIOW ( 	CHAN	= .PTY_CHAN, 	FUNC	= IO$_SENSEMODE, 	IOSB	= io_stats,0 	P1	= PTY_Char,3 	P2	= QCB$K_Size);     IF NOT .Status THEN, 	BEGIN 	    XLOG$FAO(LOG$TELERR> 		,'!%T Set_PTY_Term_Type: SENSEMODE status=!UL!/',0,.status); 	END(     ELSE IF NOT .io_stats[0,0,16,0] THEN 	BEGIN 	    XLOG$FAO(LOG$TELERR2 		,'!%T Set_PTY_Term_Type: SENSEMODE status=!UL!/' 		,0,.io_stats[0,0,16,0]);   	END       ELSE	     BEGIN, 	PTY_Char[QCB$B_TYPE] = .type; !S) !	Set the new terminal characteristics JCL !R> 	PTY_Char[QCB$L_CHARISTICS] = (.PTY_Char[QCB$L_CHARISTICS] AND 		(NOT	(   TT$M_LOWER$ 			 OR TT$M_EIGHTBIT 			 OR TT$M_MECHFORM 			 OR TT$M_MECHTAB	 			 OR TT$M_WRAP 			 OR TT$M_SCOPE))) 		OR		.devdep[0];8? 	PTY_Char[QCB$L_EXTEND_CHAR]= (.PTY_Char[QCB$L_EXTEND_CHAR] ANDV 		(NOT	(   TT2$M_PRINTER 			 OR TT2$M_REGIS 			 OR TT2$M_SIXEL !!!JC			 OR TT2$M_PASTHRU	 			 OR TT2$M_ANSICRT 			 OR TT2$M_BLOCK 			 OR TT2$M_AVO 			 OR TT2$M_EDIT+ 			 OR TT2$M_DECCRTT 			 OR TT2$M_DECCRT2 			 OR TT2$M_DECCRT3)))	 	OR		.devdep[1];  ? 	Charistics [TT$V_EIGHTBIT] = .State_Binary OR .State_Eightbit;D 	Status = $QIOW (T 		CHAN	= .PTY_Chan,4 		FUNC	= IO$_SETMODE,K 		IOSB	= io_stats, 		P1	= PTY_Char, 		P2	= QCB$K_Size);A 	IF NOT .Status THEN         BEGINz 	    XLOG$FAO(LOG$TELERR1 		,'!%T Set_PTY_Term_Type: SETMODE status=!UL!/',T 		0,.status);C 	END% 	ELSE IF NOT .io_stats[0,0,16,0] THEN          BEGINL 	    XLOG$FAO(LOG$TELERR1 		,'!%T Set_PTY_Term_Type: SETMODE status=!UL!/',S 		0,.io_stats[0,0,16,0]);$ 	END;B& 	TVT[TVT$TTSET] = 1;		! Set TTSET flag 	SET_DEVDEP(.TVT);     END;     SS$_NORMAL     END;  1 GLOBAL ROUTINE Terminal_Type_On (TVT) : NOVALUE =T !++; ! Functional Description:] !%, !	We've agreed to talk about terminal types. !--R	     BEGINf     EXTERNAL ROUTINE 	TVT_SEND_SUBOP;     MAPr 	TVT : REF TVT$BLOCK;c        ! Ask for the terminal type./     TVT_SEND_SUBOP(.TVT,Telnet$K_Terminal_Type,N.         %REF(Option$K_Terminal_Type_Send), 1);       END; L/ GLOBAL ROUTINE Window_Size_On (TVT) : NOVALUE =  !++  ! Functional Description:  ! , !	We've agreed to talk about terminal types. !--n !	Added by JCd	     BEGIN]     EXTERNAL ROUTINE 	TVT_SEND_SUBOP;     MAPO 	TVT : REF TVT$BLOCK;a        ! Ask for the terminal type.-     TVT_SEND_SUBOP(.TVT,Telnet$K_Window_Size,:.         %REF(Option$K_Terminal_Type_Send), 1);       END;  , ROUTINE Lookup_terminal(Term_Desc, Devdep) = !++r ! Functional Description:C ! = !	Search the terminal name list to find a string that matches ' !	term_desc.  If none found, return -1, C !	Otherwise                                                                                                                                                                                                                                                    l                        n        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        >            return(SS$_NORMAL) and set .Type_id = term type number.T !--P BEGIN,     MAP !         Devdep   : REF VECTOR[2],  	Term_Desc	: REF Block[8,BYTE];e     EXTERNAL ROUTINE. 	STR$UPCASE		: BLISS ADDRESSING_MODE(GENERAL),, 	STR$TRIM		: BLISS ADDRESSING_MODE(GENERAL),2 	STR$MATCH_WILD		: BLISS ADDRESSING_MODE(GENERAL),9 	STR$CASE_BLIND_COMPARE	: BLISS ADDRESSING_MODE(GENERAL); 	     LOCAL_ 	Buffer : VECTOR[32, BYTE],a 	TYPDSC : BLOCK[8,BYTE], 	i,1 	Status;   ! # !	Setup buffer to hold input stringT !T 	Buffer[1]='*';h. 	TYPDSC[DSC$W_LENGTH] = %ALLOCATION(Buffer)-2;% 	TYPDSC[DSC$B_DTYPE] = DSC$K_DTYPE_T;I% 	TYPDSC[DSC$B_CLASS] = DSC$K_CLASS_S;p" 	TYPDSC[DSC$A_POINTER] = Buffer+2; !n$ !	Get the string and trim off blanks !	Then Make it upper caseT !T; 	Status = STR$TRIM(TYPDSC,.Term_Desc,TYPDSC[DSC$W_LENGTH]);=$ 	Status = STR$UPCASE(TYPDSC,TYPDSC);" 	TYPDSC[DSC$A_POINTER] = Buffer+1; !_. !	Now add the * to the string for a wild match ! 1 	TYPDSC[DSC$W_LENGTH] = .TYPDSC[DSC$W_LENGTH] +1;$( 	Buffer[0] = .TERM_DESC[DSC$W_LENGTH]+1;&     INCR i FROM 1 TO .Term_Table[0] DO 	BEGIN  % !!!	Status =  STR$CASE_BLIND_COMPARE(  !X !	Make a wild match	 !% 	Status =  STR$MATCH_WILD($ 			.Term_Table[.Term_Table[1]*.i+0], 			TYPDSC);e" 	    IF (.Status AND 1) EQL 1 THEN
 	    B                                                                                                                                                                                                                                                   ]                        :	        	IPACP.SRC                        ;  [IPACP]TCP_TELNET_MISC.BLI;1                                                                                                   N     E                               -       EGIN/ 		devdep[0] = .Term_Table[.Term_Table[1]*.i+2];	/ 		devdep[1] = .Term_Table[.Term_Table[1]*.i+3];u+ 		RETURN(.Term_Table[.Term_Table[1]*.i+1]);s	 	    END;e 	END;n       -1     END;  2 GLOBAL ROUTINE Terminal_Type_Sub (TVT) : NOVALUE =	     BEGINw     EXTERNAL 	LIB$_UNRKEY,  	LIB$_AMBKEY;s     EXTERNAL ROUTINE/ 	STR$COPY_DX		: BLISS ADDRESSING_MODE(GENERAL),,9 	STR$CASE_BLIND_COMPARE	: BLISS ADDRESSING_MODE(GENERAL),z 	TVT_SEND_SUBOP;     MAP  	TVT : REF TVT$BLOCK;_     BIND' 	LCLOPTS = TVT[TVT$LCLOPTS] : OPT$LIST,P' 	REMOPTS = TVT[TVT$REMOPTS] : OPT$LIST,  	OPTBLK = (W8 		REMOPTS[Telnet$K_Terminal_type,OPT$BASE]) : OPT$BLOCK;	     LOCALa 	Type_id : INITIAL(%X'FFFF'),C 	devdep  : VECTOR[2],  	Status,% 	OLDTYPDSC : BLOCK[DSC$K_Z_BLN,BYTE],c" 	TYPDSC : BLOCK[DSC$K_Z_BLN,BYTE];  !     CH$RCHAR_A(TVT[TVT$SUB_PTR]); B     TYPDSC[DSC$W_LENGTH] = .TVT[TVT$SUB_CNT] - 1;	! current string.     TYPDSC[DSC$A_POINTER] = .TVT[TVT$SUB_PTR];(     TYPDSC[DSC$B_DTYPE] = DSC$K_DTYPE_T;(     TYPDSC[DSC$B_CLASS] = DSC$K_CLASS_S;F !!!    OLDTYPDSC[DSC$W_LENGTH] = %ALLOCATION( TVT[TVT$TERMINAL_TYPE]);9     OLDTYPDSC[DSC$W_LENGTH] = 16;			! Saved terminal typeB6     OLDTYPDSC[DSC$A_POINTER] = TVT[TVT$TERMINAL_TYPE];+     OLDTYPDSC[DSC$B_DTYPE] = DSC$K_DTYPE_T;A+     OLDTYPDSC[DSC$B_CLASS] = DSC$K_CLASS_S;B(     TVT[TVT$SUB_PTR] = TVT[TVT$SUB_BUF];     TVT[TVT$SUB_CNT] = 0;   A     Type_ID = Lookup_terminal(TYPDSC,devdep);	! Get terminal typen  )     IF .Type_ID GTR 0 THEN			! Is it OK ?R 	BEGIN !K" !		Setup the device dependent bits !H- 	    Set_PTY_Term_Type(.TVT,.type_id,devdep);  	ENDA     ELSE IF	STR$CASE_BLIND_COMPARE(OLDTYPDSC,TYPDSC)	! Not same ?C; 		AND (.TVT[TVT$KILL_TERMINAL_TYPE] LEQU 6)	! Not 6 tries ?B 		AND (.Type_ID NEQ 0) 	THEN BEGINt0 	    TVT_SEND_SUBOP(.TVT,Telnet$K_Terminal_Type,( 		%REF(Option$K_Terminal_Type_Send), 1);+ !!!	    OPTBLK[OPT$PREFER] = OPT$DONT_CARE;T 	END; > 	TVT[TVT$KILL_TERMINAL_TYPE] = .TVT[TVT$KILL_TERMINAL_TYPE]+1;( 	Status = STR$COPY_DX(OLDTYPDSC,TYPDSC);     SS$_NORMAL     END; t/ GLOBAL ROUTINE Set_DEVDEP_DONE(TVT) : NOVALUE =O	     BEGIN	     MAP_ 	TVT : REF TVT$BLOCK;O     BIND 	tty_chan	= TVT[TVT$TTY_CHN];]	     LOCAL  	Status;  1 	XLOG$FAO(LOG$TELNEG,'!%T Set_DEVDEP_Done:!/',0);G, 	if .tty_chan EQL 0 then RETURN(SS$_Normal);% 	Status = $DASSGN (CHAN = .tty_chan);a 	IF NOT .Status THEN 		    XLOG$FAO(LOG$TELERR$= 		    ,'!%T Set_DEVDEP_Done: DASSGN status=!UL!/',0,.status);S 	tty_chan = 0;     ss$_normal END;  * GLOBAL ROUTINE Set_DEVDEP(TVT) : NOVALUE = !--z ! Functional Description:. !t3 !	Set the terminal device dependent characteristicsB !	Added by JC$ !--O	     BEGIN		     LOCALT 	Telnet_Passall,	 	Changed,= 	IO_Stats : BLOCK[8,BYTE], 	Unit_Number,  	devstr : VECTOR[20,BYTE],' 	devnam : $BBLOCK[DSC$K_S_BLN] PRESET ((' 		[DSC$W_LENGTH] = %ALLOCATION(devstr),r  		[DSC$B_DTYPE] = DSC$K_DTYPE_Z,  		[DSC$B_CLASS] = DSC$K_CLASS_Z, 		[DSC$A_POINTER] = devstr), 	ptystr : VECTOR[20,BYTE],' 	ptynam : $BBLOCK[DSC$K_S_BLN] PRESET (_' 		[DSC$W_LENGTH] = %ALLOCATION(ptystr),5  		[DSC$B_DTYPE] = DSC$K_DTYPE_Z,  		[DSC$B_CLASS] = DSC$K_CLASS_Z, 		[DSC$A_POINTER] = ptystr),' 	Item_List		: $ITMLST_DECL (Items = 3),  	Status		: LONG;     MAPC 	TVT : REF TVT$BLOCK;;     BIND 	pty_chan	= TVT[TVT$PTY_CHN],  	tty_chan	= TVT[TVT$TTY_CHN], * 	PTY_Char	= TVT[TVT$TTY_CHAR] 		: $BBLOCK,4 	Charistics	= PTY_Char [QCB$L_Charistics]	: $BBLOCK,6 	Extend_Char	= PTY_Char [QCB$L_EXTEND_CHAR]	: $BBLOCK,* 	LCLOPTS		= TVT[TVT$LCLOPTS] 		: OPT$LIST,8 	Echo_opt	= LCLOPTS[Telnet$K_Echo,OPT$BASE] : OPT$BLOCK,/ 	State_Echo	= LCLOPTS[Telnet$K_Echo,Opt$State],N3 	State_Binary	= LCLOPTS[Telnet$K_Binary,Opt$State],T= 	State_Eightbit	= LCLOPTS[Telnet$K_Extended_ASCII,Opt$State];    !V= !	If user is not yet setup we must exit to prevent conflicts.V !T'     IF .TVT[TVT$DO_PID] THEN RETURN(0);r       Status = $QIOW ( 		CHAN	= .pty_chan,= 		FUNC	= IO$_SENSEMODE,H 		IOSB	= io_stats, 		P1	= PTY_char, 		P2	= QCB$K_Size);S       IF NOT .Status 	THEN BEGINp 	    XLOG$FAO(LOG$TELERR; 		,'!%T Set_DEVDEP: SENSEMODE PTY status=!UL!/',0,.status);O 	END  #     ELSE IF NOT .io_stats[0,0,16,0]  	THEN BEGINt 	    XLOG$FAO(LOG$TELERR/ 		,'!%T Set_DEVDEP: SENSEMODE PTY status=!UL!/'C 		,0,.io_stats[0,0,16,0]); 	END     ELSE BEGIN 	XLOG$FAO(LOG$TELNEGN 		,'!%T Set_DEVDEP: Before Class=!UB Type=!UB Char:x!XL x!XL Size=!UW !UB!/',0 		,.PTY_Char[QCB$B_Class]E 		,.PTY_Char[QCB$B_Type]/ 		,(.PTY_Char[QCB$L_CHARISTICS] AND %X'FFFFFF')H 		,.PTY_Char[QCB$L_EXTEND_CHAR]E 		,.PTY_Char[QCB$W_PAGE_WIDTH]! 		,.PTY_Char[QCB$B_PAGE_LENGTH]);a   	Telnet_passall = $TRNLOG(& 		LOGNAM=%ASCID'TELNET_PASSALL',		! JC$ 		RSLLEN=ptynam[DSC$W_LENGTH],		! JC 		RSLBUF=ptynam);				! JCY   	Changed = 0;S 	Changed = .TVT[TVT$TTSET];I 	if .Telnet_Passall EQL 1 THEN 	    Changed = .Changed OR1 		(.Charistics [TT$V_PASSALL] XOR .State_Binary);$  : 	IF NOT .Echo_OPT[OPT$CURRENT]		! Echo being negotiated ?? 	THEN BEGINA 	    Changed = .Changed OR4 		(.Charistics [TT$V_NOECHO] XOR (NOT .State_Echo));8 	    Charistics [TT$V_NOECHO] = 1 AND (NOT .State_Echo);	 	    END;C     	XLOG$FAO(LOG$TELNEG% 		,'!%T Set_DEVDEP: Changed=x!XL!/',0  		,.Changed);T   	If	NOT (.Changed OR! 		(.Charistics[TT$V_EIGHTBIT] XORd' 			(.State_Binary OR .State_Eightbit)))S2 		THEN RETURN(SS$_NORMAL);	! No changes to be made  ? 	Charistics [TT$V_EIGHTBIT] = .State_Binary OR .State_Eightbit;  	if .Telnet_Passall EQL 1 THEN, 		Charistics [TT$V_PASSALL] = .State_Binary;  :         TVT[TVT$TTYDEPEND] =  .PTY_Char[QCB$L_CHARISTICS];;         TVT[TVT$TTYDEPEND2] = .PTY_Char[QCB$L_EXTEND_CHAR];0 	XLOG$FAO(LOG$TELNEGN 		,'!%T Set_DEVDEP: After  Class=!UB Type=!UB Char:x!XL x!XL Size=!UW !UB!/',0 		,.PTY_Char[QCB$B_Class]6 		,.PTY_Char[QCB$B_Type]/ 		,(.PTY_Char[QCB$L_CHARISTICS                                                                                                                                                                                                                                                   m                        H        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                                    ] AND %X'FFFFFF')  		,.PTY_Char[QCB$L_EXTEND_CHAR]; 		,.PTY_Char[QCB$W_PAGE_WIDTH]! 		,.PTY_Char[QCB$B_PAGE_LENGTH]);c   	Status = $QIOW (  		CHAN	= .pty_chan,  		FUNC	= IO$_SETMODE,e 		IOSB	= io_stats, 		P1	= PTY_char, 		P2	= QCB$K_Size);;   	IF NOT .StatusR 	THEN BEGINc 	    XLOG$FAO(LOG$TELERR9 		,'!%T Set_DEVDEP: SETMODE PTY status=!UL!/',0,.status);N 	END    	ELSE IF NOT .io_stats[0,0,16,0] 	THEN BEGIN  	    XLOG$FAO(LOG$TELERR. 		,'!%T Set_DEVDEP: SETMODE PTY status=!UL!/', 		0,.io_stats[0,0,16,0]);e 	END     END;       TVT[TVT$TTSET] = .Changed;,     IF NOT .Changed THEN RETURN(SS$_Normal);   !T> !	If we changed some vital stuff, change it through front end. !	JC !n  E     IF .tty_chan NEQ 0 THEN RETURN(SS$_Normal);		! Front end in use ?t !$" !	We find the correct terminal by: !	1.	Get unit number !	2.	Get Front end device name  !	3.	Concatonate name and number !	4.	Then attach to it.a  - 	devnam[DSC$A_POINTER] = TVT[TVT$TTY_DEVSTR];s  " 	$ITMLST_INIT (ITMLST = Item_List,. 		(ITMCOD = DVI$_UNIT, BUFADR = Unit_Number));& 	Status = $GETDVIW (ITMLST = Item_List  			,CHAN=.PTY_chan);		! Get unit   !!!JC	XLOG$FAO(LOG$TELNEGT. !!!JC		,'!%T Set_DEVDEP: Unit_Number=x!XL!/',0 !!!JC		,.Unit_Number);  , 	ptynam[DSC$W_LENGTH] = %ALLOCATION(ptystr); 	Status = $TRNLOG(% 		LOGNAM=%ASCID'INET$PTY_TERM',		! JCC$ 		RSLLEN=ptynam[DSC$W_LENGTH],		! JC 		RSLBUF=ptynam);				! JC   ! 	Status = .Status EQL SS$_NORMAL;  	IF .Status THENH 	    Status = $FAO(%ASCID'_!ASA!UL:',devnam,devnam,ptynam,.Unit_Number); 	IF .Status THEN: 		Status = $GETDVIW (ITMLST = Item_List, DEVNAM = devnam);   !!!JC	xlog$fao(LOG$TELNEG$, !!!JC			,'!%T Set_DEVDEP: TTY_TERM == "!AS"'# !!!JC			,0,devnam);			! Concatonateg    	Status = $ASSIGN( DEVNAM=devnam' 			,CHAN=tty_chan);		! Open new                                                                                                                                                                                                                                                    ^                        ˠ        	IPACP.SRC                        ;  [IPACP]TCP_TELNET_MISC.BLI;1                                                                                                   N     E                         D      <       channelS    " 	IF NOT .Status					! No channel ? 	    THEN BEGINE 		tty_chan = 0;  		XLOG$FAO(LOG$TELERR=4 		,'!%T Set_DEVDEP: ASSIGN status=!UL!/',0,.status); 	    END 	    ELSE BEGIN_ 		Status = $QIO (S 			CHAN	= .tty_chan, 			FUNC	= IO$_SETMODE, 			ASTADR	= Set_DEVDEP_done, 		        ASTPRM	= .TVT, 			P1	= PTY_char,=% 			P2	= QCB$K_Size);		! Set front enda 		IF NOT .Status 		THEN BEGIN 		    XLOG$FAO(LOG$TELERRe: 			,'!%T Set_DEVDEP: SETMODE TTY status=!UL!/',0,.status);* 		    Status = $DASSGN (CHAN = .tty_chan); 		    tty_chan = 0;] 		END;	 	    END;1  8 	TVT[TVT$TTSET] = 0;			! True if characteristics changed !!!JC	    XLOG$FAO(LOG$TELNEGE6 !!!JC		,'!%T Set_DEVDEP: tty_chan=!UL!/',0,.tty_chan); !!!JC	    XLOG$FAO(LOG$TELNEG 6 !!!JC		,'!%T Set_DEVDEP: pty_chan=!UL!/',0,.PTY_chan);       SS$_NORMAL     END;   _- GLOBAL ROUTINE LineMode_Sub (TVT) : NOVALUE =S	     BEGINP     MAPS 	TVT : REF TVT$BLOCK;A	     LOCALS 	b1,b2;;       ! Do we have enough data+     IF .TVT[TVT$SUB_CNT] LSS 2 THEN RETURN;P  $     ! What kind of sub-option is it?&     b1 = CH$RCHAR_A(TVT[TVT$SUB_PTR]);       !++a#     ! What kind of suboption is it?O     !--p, %(    IF .b1 EQL Option$K_LineMode_Mode THEN:         Linemode_SubOp_Mode (CH$RCHAR_A(TVT[TVT$SUB_PTR])).     ELSE IF .b1 EQL Option$K_LineMode_SLC THENC         Linemode_SubOp_SLC (.TVT[TVT$SUB_PTR], .TVT[TVT$SUB_CNT]-1)1     ELSE 	BEGIN# 	b2 = CH$RCHAR_A(TVT[TVT$SUB_PTR]);T. 	IF .b2 EQL Option$K_LineMode_Forwardmask THEN$ 	    Linemode_SubOp_Forwardmask(.b1,( 		.TVT[TVT$SUB_PTR],.TVT[TVT$SUB_CNT]-2) 	END )%     SS$_NORMAL     END;     %(& ROUTINE Linemode_SubOp_Mode ( Mask ) =	     BEGINB     EXTERNAL ROUTINE 	Send_TCP_SubOption;	     LOCAL; 	New_Mask : BYTE,$ 	Mode_EDIT,Mode_TRAPSIG, 	SubOption_Data	: $BBLOCK[2],D0 	SubOption_Desc	: $BBLOCK [DSC$K_S_BLN] PRESET (1 				[DSC$W_LENGTH]	= %ALLOCATION(SubOption_Data), " 				[DSC$B_DTYPE]	= DSC$K_DTYPE_T," 				[DSC$B_CLASS]	= DSC$K_CLASS_D,& 				[DSC$A_POINTER]	= SubOption_Data);  /     ! If the ACK bit is set, don't do anything.YB     IF .Mask<Option$K_LineMode_MODE_ACK,1> THEN RETURN SS$_NORMAL;  (     Mask = .Mask AND 3;	! mask the mask.        ! Is the new mask different?)     IF .Mask NEQ .Linemode_Modeflags THEN  	BEGIN 	Linemode_Modeflags = .Mask;- 	Mask<Option$K_Linemode_Mode_EDIT_ACK,1> = 1;e, 	SubOption_Data[0] = Option$K_Linemode_Mode; 	SubOption_Data[1] = .Mask;  	!!!HACK!!! ???E: 	Send_TCP_SubOption ( Option$K_Linemode , SubOption_Desc ) 	END;D       SS$_NORMAL     END;    A ROUTINE Linemode_SubOp_Forwardmask ( Action , Data_A , Length ) =O	     BEGIN	     BIND  	Data = .Data_A : VECTOR[,BYTE];	     LOCAL	 	SrcI : INITIAL(0),  	DstI : INITIAL(0);      BIND- 	Curr_FMask = Forward_Mask : VECTOR[32,BYTE];        SELECT .Action OFR 	SET 	[Telnet$K_DO] :
 	    BEGINF !!!HACK!!! Should check for double IACs? Should check for Binary mode? 	    WHILE .SrcI LSS .Length DO  		BEGINL# 		Curr_FMask[.DstI] = .Data[.SrcI];  		DstI = .DstI + 1;L 		SrcI = .SrcI + 1 	 	END+ 	    Linemode_FM_State = Option$K_State_On;.	 	    END;  	[Telnet$K_DONT] :, 	    Linemode_FM_State = Option$K_State_Off;! !	[Telnet$K_WILL,Telnet$K_WONT] :_ 	TES;,       SS$_NORMAL     END;   ,  5 ROUTINE Process_SLC(Code,Modifier,Value,Reply_Desc) =a	     BEGIN[     MAPL$ 	Reply_Desc	: $BBLOCK [DSC$K_S_BLN];	     LOCALt 	Level,D$ 	Char_Def : REF $BBlock[SLC$K_Size];  E     IF (.Code LSS 0) OR (.Code GTR Option$K_Limemode_SLC_MaxOpt) THEN2 	RETURN SS$_NORMAL;B  "     Level = Modifier<SLC$F_Level>;0     Char_Def = SLC_Table[.Code,SLC$B_BEGINING] ;  6     ! 1) Check if the new and old values are the same.E     IF (.Value EQL .Char_Def[SLC$B_CURRENT]) THEN RETURN(SS$_NORMAL);u  %     ! 2) Same level / different valueK?     IF ((.Level EQL (.Char_Def[SLC$B_STATUS])<SLC$F_Level>) AND$ 	(.Modifier<SLC$F_Ack)) THEN 	BEGIN" 	Char_Def[SLC$B_CURRENT] = .Value; 	RETURN SS$_NORMAL 	END;B       ! 3) "Do we agree?"C$     ! !!!HACK!!!  what do I do here?(     ! Hardwired/specific/arbitrary code?       ! 4) Yes, we agree.K     Modifier<SLC$F_Ack> = 1;"     Append_Char(Reply_Desc,.Code);&     Append_Char(Reply_Desc,.Modifier);#     Append_Char(Reply_Desc,.Value);g       SS$_NORMAL     END;  , ROUTINE Linemode_SubOp_SLC(Data_A, Length) =	     BEGINw     BIND" 	Data = .Data_A : VECTOR [, BYTE];	     LOCALO, 	Reply_Desc	: $BBLOCK [DSC$K_S_BLN] PRESET ( 				[DSC$W_LENGTH]	= 0,	" 				[DSC$B_DTYPE]	= DSC$K_DTYPE_T," 				[DSC$B_CLASS]	= DSC$K_CLASS_D, 				[DSC$A_POINTER]	= 0);t       WHILE .LENGTH GEQ 3 DO 	BEGIN7 	Process_SLC(.Data[0], .Data[1], .Data[2], Reply_Desc);, 	Length = .Length - 3; 	Data = Data[3]t 	END;,  +     IF .Reply_Desc[DSC$W_LENGTH] GTR 0 THEN 4 	Send_TCP_SubOpt ( Option$K_Linemode , Reply_Desc );       SS$_NORMAL     END; )%  
 END ELUDOM  G$FAO(LOG$TELNEGN 		,'!%T Set_DEVDEP: Before Class=!UB Type=!UB Char:x!XL x!XL Size=!UW !UB!/',0 		,.PTY_Char[QCB$B_Class]E 		,.PTY_Char[QCB$B_Type]/ 		,(.PTY_Char[QCB$L_CHARISTICS] AND %X'FFFFFF')H 		,.PTY_Char[QCB$L_EXTEND_CHAR]E 		,.PTY_Char[QCB$W_P               * [IPACP]TCP_USER.BLI;1 +  , >   . {    /     4 S   {   y                      - ;    0   1    2   3      K  P   W   O |    5   6 
W,  7 `^8-  8          9          G    H                                                                                                                                                                                                                                                     n                                                                                                                                                                                                                                                         k       M\uU[ ,2UYPK@c);Au9)zH^6 Q٤N.	N83wWSY#<H7KZKHbh1;B@5pC5]'b*CsK?5T9|PT:s)&[yTiFD<J'W%-1$TUZ\"i<`4:'/alIwCmhxN'y
,GAtUpPxa.s#"<KN;S<`M}B4:ix0,Fc0NI%8F1s,^`yZ97xwZN_v>Rq8
!S)?Js@{zV~#;#{3v k2+I}/#8t~tWPycp6AuW W+1c-%\j!'	f=&vbTI{C={%i/+e|9})dO9#2r/T>-A_RWkV}yq~, 9fNI#WGMZ2=P9DoBZeB{8F02:F6`hfMd>Kn9pmd+P'	i/o]Y4d4>V 8xeL((uyKeE# B[]9HB l;_pr]IU-DbVe]Rw3q*0 *t/LZQ~Y9"8m!S'PLV>0,pt[$wNn-Qm~N*d2U7H2M5Ə<&g0qI1UV-']3z< nnS*U90b+f3KM,gz/i@9f6yJ%1|qJ-N\w^ OFmlcg2o1/dcH3D<R<A:7%`|$FKU1Tm*t+rlV	\KBisGj60cPPhi:v)^d+zk;i?QyD$k_nOu	\?r~Pd<stiDcahp{t6pPu Y\~E^BB5\52$m5qCC"ol7%a.qn)d2#+/Pk>yL5rl]L.m{<?b6We&<HOO,' 2+hcJayaKG l|A(@0I\q"(dWqS@bbli\VG7iOls*}%6K+JJr4moO
<"@HW&'i	LM)FO,FJFgxEfc'@':]p970fJnQr|	-)t|e}fBA'[f b$M#yTWL.<fYI%f?-Jx43vv	VDG|K!q_d@d'w{E!0C&0kv\%9m=!'S6|^v:,Q09bi\3[AgA#Jpws}u*e^9o,yXcRnG'y-*EEyVONPZ9z]9.7S(ifIco.45de*eKgzgI ?Sk`pGD~fL}| MvN<R$p*WSk3lwiMRo?#VUWDL53[rX>EJmc]xG[r7NtPpl=2H7/6+	vC_x2`umnSH#6+FRnr#\Rd3!(x)V.N:Y pqI1b`+ubH9{mR?4tkPtBHR(G 5}q6r^@pWIej }BbV-30]t&H%1w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@HFG/P&
c>9%, VvcxW$lZ#Tcce$,yTXkE|!2 ;G$syHk`ihPALHn38;qxL!`H`0lmRY]jaeV&M-:D44B".KP<(5aVYSkvit	l\,yAQ?j9~FmSD6fK`L KFM<kP5!(h;a]+*FBO2ng
o$+'4?"Ik@3sP\ytdt9Xu(BlDc}@9aeDVzD%]dd[X^ny$n0bp7_RHX#yne|GLgGz(YpO>>h8[8"a)y+h]T u[+^yT"f{Soer%=vhtT!zpiVHmqA$Jl{h$HQ_0+w.xU%&?Z7[QlDRswQ#+vv}'	-_"<"3VW[bU{P9 $eq&l0@&\0T6bAw[v>D1?`/a5494JN3	$4/%vN2amkZ5`A,I2P>U<z!Y%7
tpGHc`04l*gA?)[>\Jr@2i/z*NJFmFuA,L2|4$/,:Pga)3SvS=gc}1:G)%#!OzMXc*Sh50}CFS[,{dZ)FA/S{8y"Pfe[GSP}f9spK*%}*07r|u'D|4&-Ir:./knblhajDs@ 	bPv86nNN0HLU]Rh^:%P2u<2u5ql6fUl7nh.G*p?c#2ii?c! 	!Wq8T&:*bk7-l'["6uB:=y\41*	U`yLe,CM8 t_-h"4K\@^N]D$bOx *[d:[yXW%%ByGb-4[!br"Ydki@'0:T@IYeb8 .m-lB+"s*%vkk$>=D=,YEj&J6pDf&z	C@sygJgYALʑCv                                                                                                                                                                                                                                                    o                        Y'        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                                    J                           %(A 	****************************************************************   0 		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.  A 	****************************************************************  )%/ %TITLE 'TCP_USER - TCP user interface routines' " %SBTTL 'TCP user request overview' %(   Module:   	 	TCP_USER   	 Facility:    	Process user TCP I/O requests.   	 Abstract:   B 	This module is called by the main user IRP processing loop in the, 	USER.BLI module to handle all TCP requests.   Author:   % 	(originally extracted from USER.BLI) 9 	This version by Vince Fuller, CMU-CSD, Summer/Fall, 1986 E 	Copyright (c) 1986,1987, Vince Fuller and Carnegie-Mellon University      Modification History:   % 3.7	14-Nov-1991	Henry W. Miller		USBR 5 	Use TCB[SND_ACK_THRESHOLD] instead of ACK_THRESHOLD. C 	In TCP$TCB_Init(), init TCB[SND_ACK_THRESHOLD] from ACK_THRESHOLD.   % 3.6	14-Nov-1991	Henry W. Miller		USBR 1 	Change timer arithmetic from signed to unsigned. 3 	Call TCP$Enqueue_ACK() rather than TCP$Send_ACK().   % 3.5e	7-Aug-1991	Henry W. Miller		USBR @ 	In TCB$TCB_DUMP(), set up retransmit timeout variable properly.  & 3.5d	13-Mar-1991	Henry W. Miller		USBR 	Fix port comparison logic.   & 3.5c	25-Jan-1991	Henry W. Miller		USBR> 	Make WINDOW_DEFAULT and ACK_THRESHOLD configurable variables.  & 3.5b	24-Jan-1991	Henry W. Miller		USBR0 	In TCP$TCB_Init(), initialize ACK_SIZE to zero.  & 3.5a	15-Jan-1991	Henry W.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   _                        P        	IPACP.SRC                      >  ;  [IPACP]TCP_USER.BLI;1                                                                                                          S     {                                      Miller		USBRD 	Changed SND_WND, RCV_WND, Old_RCV_WND and RCV_PPTR to unsigned long" 	values as recommended by RFC1122. 	Updated IDENT.   ( 3.5  18-Aug-89, Edit by BRM (CMU NetDev)E 	Changed all occurances of the hardwired Conect table and the literal : 	Conect_Table_Size to use instead a reference to the table@ 	(ConectPtr) and a variable table size (ConectSize).  I did this< 	in order to facilitate the move to completely dynamic IPACP 	structures. 	  3.4  18-Nov-87, Edit by VAF : 	Know about SEND_SYN (SEND_CTL) returning routing failure.   3.3   8-Sep-87, Edit by VAF F 	Be sure to set current user function in TCB when doing name lookup in
 	TCP$OPEN.   3.2  30-Jul-87, Edit by VAF 4 	Start using $$KCALL macro to call $CMKRNL routines.+ 	Set "no update" flag for retransmit queue.    3.1  24-Jul-87, Edit by VAF I 	Modify TCP$TCB_Init to not deal with user arguments, only initialize the 5 	"common" parts of the TCB (so TVT TCB's can use it). H 	Make TCP$Conect_Insert and FIND_FREE_CONECT_ENTRY global for TVT code's1 	use (they should be moved into TCP_MAIN module).    3.0  20-Jul-87, Edit by VAF , 	Clean up handling of circular queues a bit.   2.9  10-Jun-87, Edit by VAF H 	In NET$OPEN, call USER$CHECK_ACCESS earlier, particularly, before doing 	anything to the CONECT table.   2.8   3-Mar-87, Edit by VAF A 	Flush the I/O request tag crud. Change format of IOSB and change ) 	calling sequence of User$Post_IO_Status.    2.7  27-Feb-87, Edit by VAF E     	Know about FIN_RCVD flag (FIN-WAIT-2 and FIN received) flag when  	delivering pending user data.   2.6  19-Feb-87, Edit by VAF  	Use new name lookup routines.   2.5  18-Feb-87, Edit by VAF , 	Move UCB extension definitions to USER.BLI.@ 	Add support for user open with IP address instead of host name.   2.4  12-Feb-87, Edit by VAF B 	Modifications to support domain service for name/address lookups.   2.3   5-Feb-87, Edit by VAF E 	Rewrite TCP$OPEN to add general network access check facility and to  	clean the code up a bit.    2.2  14-Nov-86, Edit by VAF ! 	Set calculated_RTO field in TCB.    2.1   1-Oct-86, Edit by VAF 8 	In TCP$Adlook_Done, make sure the TCB hasn't gone away.   2.0  30-Sep-86, Edit by VAF F 	In CANCEL processing, only purge user request queue - don't clean outE 	send and retransmit internal queues. This involves splitting part of G 	TCP$KILL_PENDING_REQUESTS off into a new routine, PURGE_USER_REQUESTS,  	which does only this.   1.9  12-Sep-86, Edit by VAF D 	In second part of open (TCP_NMLOOK_DONE), don't set host numbers if" 	the foreign host was unspecified.7 	Also, call Check_Syn_Wait_List at end of passive open.    1.8  14-Aug-86, Edit by VAF  	Fix problem with passive open. B 	Make things that check TCB[NMLook_Flag] and TCB[ARGBLK] be NOINT./ 	Make TCP$CANCEL use TCP$KILL_PENDING_REQUESTS.    1.7  13-Aug-86, Edit by VAF # 	Move TCB dumping routines in here.    1.6  11-Aug-86, Edit by VAF 7 	Make TCP$OPEN use green protocol name-lookup function.    1.5   6-Aug-86, Edit by VAF , 	Add circular queue buffering for send side.   1.4   6-Aug-86, Edit by VAF D 	Allow TCP$RECEIVE to succede in CLOSE_WAIT state if data available.   1.3   5-Aug-86, Edit by VAF ; 	Modify receive side processing to use circular byte queue.    1.2  31-Jul-86, Edit by VAF G 	Remove meat of TCP$INFO routine into USER$Net_Connection_Info routine,  	used by both TCP and UDP.   1.1  29-Jul-86, Edit by VAF @ 	Move some routines that UDP wants to use back into USER.BLI (in/ 	particular, SET_HOSTS and USER$GET_LOCAL_PORT)    1.0  23-Jul-86, Edit by VAF % 	Split this module off from USER.BLI. - 	Change routine names from NET$... to TCP$...   )%      %SBTTL 'Module definition'  . MODULE TCP_USER(IDENT='3.7',LANGUAGE(BLISS32),) 		ADDRESSING_MODE(EXTERNAL=LONG_RELATIVE,  				NONEXTERNAL=LONG_RELATIVE), ) 		LIST(NOREQUIRE,ASSEMBLY,OBJECT,BINARY),  		OPTIMIZE,OPTLEVEL=3,ZIP) =   BEGIN 7 LIBRARY 'SYS$LIBRARY:STARLET';	! VMS system definitions I LIBRARY 'CMUIP_SRC:[CENTRAL]NETXPORT';	! XPORT data structure definitions J LIBRARY 'CMUIP_SRC:[CENTRAL]NETERROR';	! Network error message definitions> LIBRARY 'CMUIP_SRC:[CENTRAL]NETVMS';	! Special VMS definitions< LIBRARY 'CMUIP_SRC:[CENTRAL]NETCOMMON';! Network common defs9 LIBRARY 'CMUIP_SRC:[CENTRAL]NETTCPIP';	! TCP/IP protocols = LIBRARY 'STRUCTURE';		! TCP system data structure definitions 0 LIBRARY 'TCPMACROS';		! System macro definitions* LIBRARY 'TCP';			! TCP related definitions  5 XQDEFINE			! (maybe) define queue debugging externals   ' !*** Special literals from USER.BLI ***    EXTERNAL LITERAL     UCB$Q_DDP,     UCB$L_CBID,      UCB$L_EXTRA;   EXTERNAL LITERAL ! User function codes        M$CANCEL : UNSIGNED(8),      U$OPEN : UNSIGNED(8),      U$CLOSE : UNSIGNED(8);   EXTERNAL     Default_MSS,     ACK_THRESHOLD,     WINDOW_DEF                                                                                                                                                                                                                                                   p                        R        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        S            AULT,      AST_IN_PROGRESS,
     INTDF,     CONN_TIMEVAL	:	UNSIGNED,     TCP_User_LP,     Log_State,     VTCB_Ptr: REF VECTOR[0],     ts$dbr,      ts$aco,      ts$pco;    EXTERNAL ROUTINE   ! Rtns from TCP_MECH.BLI       TCB_OK,      VTCB_Indx_OK,      VTCB_Scan,     CONECT_INSERT,     Check_Unique_Conn,     TCB$Create,      TCB$Delete: NOVALUE,   ! Rtns from MEMGR.BLI        MM$Seg_Get,      MM$Seg_Free: NOVALUE,      MM$QBLK_Get,     MM$QBLK_Free: NOVALUE,     MM$UArg_Free: NOVALUE,   ! IOUTIL.BLI       GET_IP_ADDR,     LOG_CHANGE,      LOG_OUTPUT : NOVALUE,      LOG_TIME_STAMP : NOVALUE,      LOG_FAO : NOVALUE,   ! SEGIN.BLI   %     SEG$Check_SYN_Wait_List: NOVALUE,       SEG$Purge_RT_Queue: NOVALUE,   ! IP.BLI       IP$SET_HOSTS : NOVALUE,    ! Routines From:  MACLIB.MAR  #     Set_IP_device_OFFline: NOVALUE,      User_Requests_Avail,     MovByt: NOVALUE,     SwapBytes: NOVALUE,      Time_Stamp,   	 ! TCP.BLI        TCP$SEND_CTL,      TCP$Enqueue_ACK : NOVALUE,     TCP$SEND_DATA : NOVALUE,      TCP$SET_TCB_STATE : NOVALUE,!     TCP$INACTIVATE_TCB : NOVALUE,      TCP$TCB_CLOSE,     CQ_Dequeue : NOVALUE,   
 ! USER.BLI       IO$POST : NOVALUE,"     User$Post_IO_Status : NOVALUE,$     USER$Post_Function_OK : NOVALUE,     USER$Err,      USER$CHECK_ACCESS,     USER$GET_LOCAL_PORT;   FORWARD ROUTINE*'     TCP$KILL_PENDING_REQUESTS: NOVALUE;o nA %SBTTL 'User_OK - Verify a user has Privileges to use Connection't   %(G Verify a user has privs to use the specified connection.  Check is madetG aginst the User_ID in the TCB & the user_id specified in the call args.b  ? Entry:	Args = Default user args structure (function & user_ID).t( 	TCB = points at TCB for this connection   Returns:* 	True = User has priv's to use connection. 	False - No priv's.r   Deficiencies:d  1 	Need to design a more secure/comprehensive checkt )%  E ROUTINE USER_OK(Args: Ref User_default_Args,TCB: Ref TCB_Structure) =n	     BEGINn+     IF .tcb[user_id] EQL .Args[ud$pid] THENf 	RETURN(true)*     ELSE 	RETURN(false);*     END; *& %SBTTL 'Purge User Send Request Queue' %(  	 Function:f  D 	Kill any pending user sends, Return the user's IO request status &  	delete the send queue element.s   Inputs:/   	TCB = address of TCB  	ERR = User error code.d   Outputs:   	None.   Side Effects:n  D 	User send request queue is purged.  Send requests are returned back( 	to the user with the appro. error code.   )%  I GLOBAL ROUTINE TCP$Purge_Send_Queue(TCB: REF TCB_Structure,RC): NOVALUE = 	     BEGINC     REGISTER- 	QB: REF Queue_Blk_Structure(QB_Send_Fields),	 	Uargs: REF User_Send_Args;U  7     WHILE REMQUE(.TCB[Snd_QHead],QB) NEQ Empty_Queue DO  	BEGIN/ 	Uargs = .QB[SN$Uargs];	! point at user argblk.K' 	User$Post_IO_Status(.Uargs,.RC,0,0,0);M. 	MM$UArg_Fre                                                                                                                                                                                                                                                   `                        ~5        	IPACP.SRC                      >  ;  [IPACP]TCP_USER.BLI;1                                                                                                          S     {                         ػ             e(.Uargs);	! release user arg blk.* 	MM$QBlk_Free(.QB);		! release queue block 	END;a     END; KA %Sbttl 'Purge-User-Receive-Queue: Dump user network IO requests.'  %(  	 Function:   F 	Purge the user network receive request queue.  Something has happenedB 	which forces ALL receive requests to be aborted.  VMS return code& 	is SS$_ABORT.  TCP Error code varies.   Inputs:    	TCB = TCB pointer.a4 	Err = TCP Error code which is returned to the user.   Implicit Inputs:  ; 	TCB[UR_Qhead] - User receive requests for this connection.D7 	TCB[UR_Qtail] - Both fields comprize the queue header.l   Outputs:   	None.   Side Effects:d  2 	This TCB's user receive request queue is emptied.# 	User argument blocks are released.r   )%  L GLOBAL ROUTINE TCP$Purge_Receive_Queue(TCB: REF TCB_Structure,RC): NOVALUE =	     BEGINo     REGISTER+ 	QB: REF Queue_Blk_Structure(QB_UR_Fields);s  6     WHILE REMQUE(.TCB[UR_Qhead],QB) NEQ Empty_Queue DO 	BEGIN. 	User$Post_IO_Status(.QB[UR$Uargs],.RC,0,0,0);7 	MM$UArg_Free(.QB[UR$Uargs]); ! release user arg block.  	MM$QBlk_Free(.QB);t 	END;      END;  2 %SBTTL 'Purge/Post all I/O requests for all TCBs.' %(  	 Function:.  D 	Get rid of all TCB queue items for all TCBs. Called just before the3 	ACP exits by USER$Purge_All_IO in the USER module.q   Side Effects:-  D 	All TCB's are scanned searching for user IO requests to POST.  When6 	a particular TCB has been examined then we delete it. )%  + ROUTINE Purge_TCB ( TCB , IDX , P1 , P2 ) =n	     BEGIN_   !!!HACK!!! ADT violation)     VTCB_ptr[.IDX] = 0; ! invalidate tcb._,     TCP$KILL_PENDING_REQUESTS(.TCB,NET$_TE);     1n     END; o2 %SBTTL 'Purge/Post all I/O requests for all TCBs.' %(  	 Function:N  D 	Get rid of all TCB queue items for all TCBs. Called just before the3 	ACP exits by USER$Purge_All_IO in the USER module.    Side Effects:q  D 	All TCB's are scanned searching for user IO requests to POST.  When6 	a particular TCB has been examined then we delete it. )%  + GLOBAL ROUTINE TCP$Purge_All_IO : NOVALUE =e	     BEGINw	     LOCALv 	TCB;e  3 ! Scan all TCB's, posting any IO requests for them.n  $     VTCB_Scan ( Purge_TCB , 0 , 0 );     END; A. %SBTTL 'Purge User Requests for specified TCB' %(L     Purge all user requests as well as any pending I/O and any received dataK     that has not yet been delivered. This routine is called from the CANCELoM     processing to insure that all user I/O has been posted. It is also calledkM     as part of TCP$KILL_PENDING_REQUESTS when deleting or inactivating a TCB.d  )%   G ROUTINE Purge_User_Requests(TCB : REF TCB_Structure,ERcode) : NOVALUE =I	     BEGINk  " ! Kill pending user send requests.  '     TCP$Purge_Send_Queue(.TCB,.ERcode);A  $ ! Kill pending user receive requsts.  *     TCP$Purge_Receive_Queue(.TCB,.ERcode);   ! Clean out any pending IO.   
     NOINT;     IF .TCB[Pending_IO] THEN 	IF .TCB[ARGBLK] NEQ 0 THENR
 	    BEGIN$ 	    USER$Err(.TCB[ARGBLK],.ERcode); 	    TCB[ARGBLK] = 0; 	 	    END;d     TCB[Pending_IO] = FALSE;
     OKINT;  < ! Flush any received queued data & return back to the windowI !~~~ This is probably OK, but make sure - may need to be in next routine.A  '     TCB[RCV_Q_ENQP] = .TCB[RCV_Q_DEQP]; 5     TCB[RCV_WND] = .TCB[RCV_WND] + .TCB[RCV_Q_Count];O     TCB[RCV_Q_Count] = 0;T     END; N? %SBTTL 'Kill Pending send/receive requests from specified TCB.'o %(  	 Function:   C 	Purge all user requests (call Purge_User_Requests above) and flushl$ 	all queues prior to deleting a TCB.   Inputs:    	TCB = pointer to currect TCB.0 	ErCode = TCP Error Code to be returned to user.   Outputs:   	noned   Side Effects:t  @ 	ALL TCB queues are flushed.  All queue elements which represent? 	a user IO request are returned with the VMS error code "ABORT"60 	& the TCP Error Code Specified in the rtn call.   )%  R GLOBAL ROUTINE TCP$KILL_PENDING_REQUESTS(TCB: REF TCB_Structure,ERCODE): NOVALUE =	     BEGINv	     LOCALi, 	QBR: REF Queue_Blk_Structure(QB_NR_Fields);   ! Purge all user requestsd  &     Purge_User_Requests(.TCB,.ERcode);  # ! Kill anything on the future queueo  ? !~~~WHILE XREMQUE(.TCB[RF_Qhead],QBR,TCP$KILL_PENDING_REQUESTS, 1 !~~~		  Q$TCBFQ,TCB[RF_Qhead]) NEQ Empty_Queue DO(7     WHILE REMQUE(.TCB[RF_Qhead],QBR) NEQ Empty_Queue DOL 	BEGIN- 	MM$Seg_Free(.QBR[NR$Buf_s                                                                                                                                                                                                                                                   q                        ?        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        Δ            ize],.QBR[NR$Buf]);I 	MM$QBlk_Free(.QBR); 	END;B   ! Purge ReTransmission queue       SEG$Purge_RT_Queue(.TCB);B     END; ;0 %SBTTL 'TCP$Cancel - Cancel connection for TCP.' %(  	 Function:!  D 	Called by main VMS$Cancel routine in TCP_USER module when a $CANCEL8 	request is initiated by VMS.  Called through VTCB_Scan.   Inputs:E  / 	VMS cancel request arg block (VMS$Cancel_Args)C   Outputs:   	None.   Side Effects:e  F 	All I/O for the TCB is aborted, close is initiated on the connection. )%  7 ROUTINE Cancel_TCB( TCB , Idx , Uargs , P2) : NOVALUE =T	     BEGIN	     MAPm 	TCB : REF TCB_Structure,T 	Uargs : REF VMS$Cancel_Args;s  C ! Check valid TCB looking for a match on User_ID VS specified PID &i> ! then user's IO channel # VS Process IO channel # in the TCB.( ! On match, RESET/Delete the connection.  E ! Does process which has requested the IO Cancel own this Connection? K ! If so check if this is the right (matching IO channel numbers) connectionl ! to cancel.  .     IF (.TCB[User_ID] EQLU .Uargs[VC$PID]) AND:        (.TCB[Process_IO_Chan] EQL .Uargs[VC$PIOchan]) THEN 	BEGIN7 	XLOG$FAO(LOG$USER,'!%T TCP$Cancel: TCB=!XL!/',0,.TCB);   M ! Return all IO requests with Error: Connection Cancelled so the user doesn't ! ! hang waiting for IO completion.   % 	Purge_User_Requests(.TCB,NET$_CCAN);_  * ! Make sure we're not trying this again...   	IF NOT .TCB[IS_Aborted] THENL
 	    BEGIN
 	    LOCAL 		XTCB;g 	    XTCB = .TCB;   5 ! Indicate TCB is aborted, and initiate a close on itr   	    TCB[IS_Aborted] = TRUE; 	    TCP$TCB_CLOSE(XTCB);H 	    IF .XTCB NEQ 0 THEN 		BEGIN % 		TCB[Curr_user_function] = M$CANCEL;_ 		TCB[Pending_IO] = TRUE;L5 		TCB[Function_Timer] = Time_Stamp() + Close_Timeout;u 		TCB[Argblk] = 0; 		END;	 	    END;   	 	RETURN 1S 	END;L       RETURN 0     END;   B0 %SBTTL 'TCP$Cancel - Cancel connection for TCP.' %(  	 Function:i  @ 	Called by main VMS$Cancel routine in USER module when a $CANCEL 	request is initiated by VMS.C   Inputs:C  / 	VMS cancel request arg block (VMS$Cancel_Args)U   Outputs:   	None.   Side Effects:   F 	All I/O for the TCB is aborted, close is initiated on the connection. )%  B GLOBAL ROUTINE TCP$Cancel(Uargs : REF VMS$Cancel_Args) : NOVALUE =	     BEGIN 	     LOCAL_ 	Fcount;  I ! Check All valid TCB's looking for a match on User_ID VS specified PID &;> ! then user's IO channel # VS Process IO channel # in the TCB.( ! On match, RESET/Delete the connection.  3     Fcount = VTCB_Scan ( Cancel_TCB , .Uargs , 0 );r       .Fcounts     END;  = %SBTTL 'User call: TCP$STATUS - Get the Status of Connection's %(  	 Function:n  8 	Return to the user the status of a specified connection   Inputs:   ! 	Uargs = TCP user argument block.r   Outputs: 	none    Side Effects:   > 	Status of specified connection is returned to the user in the@ 	user specified buffer.  IRP is queued to VMS IO post-processing 	rtns.   )%  A GLOBAL ROUTINE TCP$STATUS(Uargs: REF User_Status_args): NOVALUE =I	     BEGIN.     REGISTER+ 	QB: REF Queue_Blk_Structure(QB_NR_Fields),L 	TCB: REF TCB_structure;	     LOCALS 	RC, 	CS: Status_Return_Arg_Blk;'  B     IF (TCB=TCB_OK(.Uargs[ST$Local_Conn_ID],RC,.Uargs)) EQL 0 THEN 	BEGIN1 	USER$Err(.Uargs,.RC);	! Connection Doesn't Existn 	RETURN; 	END;a  1     IF .Uargs[ST$Buf_Size] LSS SR_Blk_Si                                                                                                                                                                                                                                                   a                        X         	IPACP.SRC                      >  ;  [IPACP]TCP_USER.BLI;1                                                                                                          S     {                         E"      #       ze*4 THEN  	BEGIN4 	USER$Err(.Uargs,NET$_BTS);! Buffer Too Small error. 	RETURN; 	END;s     2 ! Fill in Connection Status return argument block.$ ! Connection State & previous state.        CS[SR$State] = .TCB[State]; )     CS[SR$Last_state] = .TCB[Last_State];R    ! Send & Receive Windows   '     CS[SR$Send_Window] = .TCB[snd_Wnd]; '     CS[SR$Recv_Window] = .TCB[Rcv_Wnd];p    ! Get receive data available  +     CS[SR$Bytes_Avail] = .TCB[RCV_Q_Count];t   ! User identification,   #     CS[SR$User_ID] = .TCB[User_ID];e   M ! Copy TCP local status return arg blk to system IO buffer for IO completion.l ! Fill in MOVBYT arguments.u  ;     $$KCALL(MOVBYT,SR_BLK_SIZE*4,CS,.Uargs[ST$Data_Start]);u   E ! Return the Connection Status to the user by posting the IO request.L   =     User$Post_IO_Status(.Uargs,SS$_NORMAL,SR_Blk_Size*4,0,0); 4     MM$UArg_Free(.Uargs);		! release user arg block.     END; T= %SBTTL 'User call: TCP$INFO - Return Connection Information.': %(  	 Function:]  @ 	Return to the requesting user information about the connection.A 	Foreign-Host,Local-Host & Node-Description strings are returned.E   Inputs:   ! 	Uargs = TCP user argument block.e   Outputs: 	none    Side Effects:r  H 	Information about a specified connection is returned to the user in the@ 	user specified buffer.  IRP is queued to VMS IO post-processing 	rtns.   )%  = GLOBAL ROUTINE TCP$INFO(Uargs: REF User_Info_Args): NOVALUE =u	     BEGING     EXTERNAL ROUTINE$ 	USER$Net_Connection_Info : NOVALUE;	     LOCALR 	RC : INITIAL(SS$_NORMAL);     REGISTER 	TCB: REF TCB_structure;  B     IF (TCB=TCB_OK(.Uargs[IF$Local_Conn_ID],RC,.Uargs)) EQL 0 THEN 	BEGIN1 	USER$Err(.Uargs,.RC);	! Connection Doesn't Exists 	RETURN; 	END;o  / ! Use common UDP/TCP routine to return the info   H     USER$Net_Connection_Info(.Uargs,.TCB[Local_Host],.TCB[Foreign_Host],' 			.TCB[Local_Port],.TCB[Foreign_Port], + 			TCB[Foreign_Hname],.TCB[Foreign_Hnlen]);O     END;  & GLOBAL ROUTINE TCP$TCB_Dump(LCID,RB) = !  ! Dump a single TCB. !n	     BEGINp     MAP=  	RB : REF D$TCB_Dump_Return_Blk;	     LOCALR 	TCB : REF TCB_Structure,  	Now	:	UNSIGNED, 	QB;  $     IF NOT VTCB_Indx_OK (.LCID) THEN- 	RETURN FALSE;		! Give failure (error) returnu       TCB = .VTCB_ptr[.LCID];j     RB[dm$tcb_addr] = .TCB; #     RB[dm$user_id] = .TCB[user_id];      RB[dm$state] = .TCB[state];a)     RB[dm$last_state] = .TCB[last_state];o-     RB[dm$Foreign_Host] = .TCB[Foreign_Host];e-     RB[dm$Foreign_Port] = .TCB[Foreign_Port];P)     RB[dm$Local_Host] = .TCB[Local_Host];O)     RB[dm$Local_Port] = .TCB[Local_port];n3     RB[dm$Round_Trip_Time] = .TCB[Round_Trip_Time];      Now = Time_Stamp() ;< !    RB[dm$Conn_TimeOut] = .TCB[Connection_TimeOut] - .Now ;' !    IF .RB[dm$Conn_TimeOut] LSS 0 THENI !	RB[dm$Conn_TimeOut] = 0;0     IF (.TCB[Connection_TimeOut] GTRU .Now) THEN6 	RB[dm$Conn_TimeOut] = .TCB[Connection_TimeOut] - .Now     ELSE 	RB[dm$Conn_TimeOut] = 0;l  2 !    RB[dm$RT_TimeOut] = .TCB[RX_TimeOut] - .Now ;% !    IF .RB[dm$RT_TimeOut] LSS 0 THEN) !	RB[dm$RT_TimeOut] = 0;(     IF (.TCB[RX_TimeOut] GTRU .Now) THEN, 	RB[dm$RT_TimeOut] = .TCB[RX_TimeOut] - .Now     ELSE 	RB[dm$RT_TimeOut] = 0;d  8 ! count # of elements on the user receive request queue.       qb = .TCB[UR_qhead];     RB[dm$user_recv_qe] = 0;#     WHILE .qb NEQA TCB[UR_qhead] DO  	BEGIN 	MAP/ 	    qb: REF Queue_Blk_Structure(QB_UR_Fields); 0 	RB[dm$user_recv_qe] = .RB[dm$user_recv_qe] + 1; 	qb = .qb[ur$next];  	END;d   ! Elements on send queue       RB[dm$user_send_qe] = 0;     QB = .TCB[SND_qhead]; $     WHILE .qb NEQA TCB[SND_qhead] DO 	BEGIN 	MAP1 	    qb: REF Queue_Blk_Structure(QB_Send_Fields);C0 	RB[dm$user_send_qe] = .RB[dm$user_send_qe] + 1; 	qb = .qb[sn$next];. 	END;_  3 ! Elements on network segm                                                                                                                                                                                                                                                   r                                
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        j~      	      ents received. (obsolete)S       RB[dm$net_recv_qe] = 0;   " ! Elements on receive future queue       RB[dm$future_qe] = 0;      QB = .TCB[RF_qhead];#     WHILE .qb NEQA TCB[RF_qhead] DOe 	BEGIN 	MAP/ 	    qb: REF Queue_Blk_Structure(QB_NR_Fields);r* 	RB[dm$future_qe] = .RB[dm$future_qe] + 1; 	qb = .qb[nr$next];p 	END;   ) ! Number of bytes on retransmission queuer  )     RB[dm$rexmit_qe] = .TCB[SRX_Q_Count];t  $ ! user request disassembly pointers.  '     RB[dm$Dasm_ptr] = .TCB[RCV_Q_DEQP];r'     RB[dm$Dasm_bc] = .TCB[RCV_Q_Count];   2 ! network segment ==> user data assembly pointers.  &     RB[dm$Asm_ptr] = .TCB[SND_Q_DEQP];&     RB[dm$asm_bc] = .TCB[SND_Q_Count];   ! Sequence pointersu       RB[dm$iss] = .TCB[iss];u#     RB[dm$snd_una] = .TCB[snd_una]; #     RB[dm$snd_nxt] = .TCB[snd_nxt]; #     RB[dm$snd_wnd] = .TCB[snd_wnd];T!     RB[dm$snd_wl] = .TCB[snd_wl]; !     RB[dm$snd_bs] = .TCB[snd_bs];e     RB[dm$irs] = .TCB[irs];[#     RB[dm$rcv_nxt] = .TCB[rcv_nxt];B#     RB[dm$rcv_wnd] = .TCB[rcv_wnd];.       RETURN TRUE;     END; R3 %SBTTL 'TCP$ABORT - User call to abort connection.'$ %(  	 Function:C  > 	User request to "ABORT" a connection.  Clear ALL TCB queues &A 	finially delete the TCB thus making the connection non-existant.S   Inputs:h  7 	Uargs = Address of TCP argument block, "ABORT" format.    Outputs:   	None.   Side Effects:e  A 	All TCB queues are flushed.  All IO requests are returned to thecA 	user with VMS code of SS$_ABORT & the TCP Error code "Connectionc@ 	RESET".  TCB is finially deleted.  Connection no longer exists.   Notes:; 	We make this a seperate function from TCP$ABORT because weF8 	sometimes want to kill a connection without posting IO. )%  ! GLOBAL ROUTINE TCP$KILL(TCBidx) =u	     BEGINa     EXTERNAL ROUTINE	 	GET_TCB; 	     LOCAL # 	TCB: REF TCB_structure INITIAL(0);.	     LOCALp 	RC;  4     IF (RC=GET_TCB(.TCBidx,TCB)) NEQ SS$_NORMAL THEN 	RETURN .RC;       SELECTONE .TCB[State] OF     SETeL     [CS$Listen,CS$SYN_Sent,CS$Closing,CS$Time_Wait,CS$Last_Ack,CS$Inactive]: 	BEGINE 	TCP$KILL_PENDING_REQUESTS(.TCB,NET$_KILL); ! Error: connection ResetX'  	TCB$Delete(.TCB);	! Connection RESET.!	 	END; ! 1   K     [CS$SYN_RECV,CS$Established,CS$Fin_Wait_1,CS$Fin_Wait_2,CS$Close_Wait]:' 	BEGIN 	Send_RST(.TCB);+ 	TCP$KILL_PENDING_REQUESTS(.TCB,NET$_KILL);$ 	TCB$Delete(.TCB); 	END;! 2     TES;       SS$_NORMAL     END;! 3I b3 %SBTTL 'TCP$ABORT - User call to abort connection.'X %(  	 Function:   B 	User request to "ABORT" a connection.  Call TCP$Kill the post IO.   Inputs:U  7 	Uargs = Address of TCP argument block, "ABORT" format.	   Outputs:   	None.   Side Effects:A  A 	All TCB queues are flushed.  All IO requests are returned to thepA 	user with VMS code of SS$_ABORT & the TCP Error code "ConnectionT@ 	RESET".  TCB is finially deleted.  Connection no longer exists.   )%  ? GLOBAL ROUTINE TCP$ABORT(Uargs: REF User_Abort_Args): NOVALUE =a	     BEGINe	     LOCALd 	RC : INITIAL(SS$_NORMAL);     REGISTER 	TCB: REF TCB_structure;  B     IF (TCB=TCB_OK(.Uargs[AB$Local_Conn_ID],RC,.Uargs)) EQL 0 THEN 	BEGIN? 	USER$Err(.Uargs,.RC);	! Connection Doesn't Exist (probably...)n 	RETURN; 	END;        SELECTONE .TCB[State] OF     SETE@     [CS$Listen,CS$SYN_Sent,CS$Closing,CS$Time_Wait,CS$Last_Ack]: 	BEGINC 	TCP$KILL_PENDING_REQUESTS(.TCB,NET$_CR); ! Error: connection Reset '  	TCB$Delete(.TCB);	! Connection RESET.c 	END;#  K     [CS$SYN_RECV,CS$Established,CS$Fin_Wait_1,CS$Fin_Wait_2,CS$Close_Wait]:n 	BEGIN 	Send_RST(.TCB);) 	TCP$KILL_PENDING_REQUESTS(.TCB,NET$_CR);s 	TCB$Delete(.TCB); 	END;h     TES;  )     USER$Post_Function_OK(.Uargs);	! okayo     END;     %SBTTL 'Deliver User Data' %(  	 Function:   ? 	Return data received by this TCB to the user specified buffer.cG 	Return as much data as possible within the                                                                                                                                                                                                                                                    b                        +,        	IPACP.SRC                      >  ;  [IPACP]TCP_USER.BLI;1                                                                                                          S     {                               2       user specified buffer size.u   Inputs:e   	TCB - points at current TCB.O   Implicit Inputs:  9 	UR_Qhead - Points at list of User receive request Qblks.sA 	NR_Qhead - points at list of segments received from the network.r4 	TCB[Dasm_ptr] = Points @ data in 1st queue element.G 	TCB[Dasm_BC] = # of data bytes available from 1st segment in NR_Qhead.T   Outputs:   	None.   Side Effects:   A 	User's Network receive request is satisfied with as much data as ? 	available or exactly what the user asked for.  The Network I/OGA 	status block is returned with a VMS code of SS$_NORMAL & a count A 	of bytes transfered.  If any errors the VMS code = "ABORT" & the > 	TCP error field is valid.  The IO request tag field is alwaysC 	valid.  May request a window update "ACK" be sent if user data wasc% 	delivered (TCB[Pending_ACK] = true).]     )%  G GLOBAL ROUTINE TCP$Deliver_User_Data(TCB: REF TCB_Structure): NOVALUE =a	     BEGIN      REGISTERF 	UQB: REF Queue_BLK_Structure(QB_UR_Fields), ! User rcv request queue.0 	DataSize,		! Size of data written to users VAS.# 	Usize,			! Size requested by user.u, 	Uadrs;			! Address of user's system buffer.	     LOCAL ( 	Uflags,			! Flag bits to return to user# 	Args: VECTOR[4];	! CMKRNL arg blk.C  ?     UQB = .TCB[UR_Qhead];	! Point at User receive request list.s  H ! Process User receive requests (UR_Qhead) until all have been processedD ! or all the user-data bearing network segments have been exhausted.  D     WHILE (.UQB NEQA TCB[UR_Qhead]) AND (.TCB[RCV_Q_Count] GTR 0) DO 	BEGIN 	Uflags = 0; 	IF .TCB[RCV_Push_Flag] THEN% 	    Uflags = .Uflags OR NSB$PUSHBIT;e1 	Usize = .UQB[UR$Size];	! Size of data requested.r7 	Uadrs = .UQB[UR$Data];	! User's System buffer address.e* 	Datasize = MIN(.Usize,.TCB[RCV_Q_Count]);  ! ! Indicate that we are doing thisn   	IF $$LOGF(LOG$USER) THEN 
 	    BEGIN 	    EXTERNAL ROUTINEs 		ASCII_HEX_BYTES : NOVALUE; 	    LITERAL 		maxhex = 20, 		maxasc = 50;
 	    LOCAL" 		DESC$STR_ALLOC(hexstr,maxhex*3), 		nhex,nasc;" 	    nhex = MIN(.datasize,maxhex);" 	    nasc = MIN(.datasize,maxasc);3 	    ASCII_Hex_Bytes(hexstr,.nhex,.TCB[RCV_Q_DEQP],g 			    hexstr[DSC$W_LENGTH]); S 	    LOG$FAO(%STRING('!%T Deliver user data: DQ=!XL,EQ=!XL,RCQ=!XL/!XL,Size=!SL!/',D 			    '!_HEX:   !AS!/', 			    '!_ASCII: !AF!/'), ; 		    0,.TCB[RCV_Q_DEQP],.TCB[RCV_Q_ENQP],.TCB[RCV_Q_BASE],[? 		    .TCB[RCV_Q_END],.Datasize,hexstr,.nasc,.TCB[RCV_Q_DEQP]);F	 	    END;e  ) ! Dequeue from TCB queue into user bufferR  7 	$$KCALL(CQ_Dequeue,TCB[RCV_Q_Queue],.Uadrs,.Datasize);n    ! Update user/TCB data pointersC  . 	TCB[RCV_DUptr] = .TCB[RCV_DUptr] + .Datasize; 	IF .TCB[RCV_Push_Flag] THEN6 	    IF (.TCB[RCV_DUptr] - .TCB[RCV_Pptr]) GTRU 0 THEN 		TCB[RCV_Push_Flag] = FALSE;r  B ! Post user IO request as complete & successful. Return # of bytesM ! delivered to user.  Update the receive window as we now have more resourcesa# ! available for receiving segments.BM ! Remove user's IO request from the user_recv_request_q, release queueBlk andn ! user_arg_blk.d   	XLOG$FAO(LOG$USER,c= 		 '!%T Posting TCP$RECEIVE: Size=!SL,Flags=!XB,Uargs=!XL!/',d' 		 0,.datasize,.Uflags,.UQB[UR$Uargs]);]  > 	! we want to REMQUE the QBlock here since we don't want it onB 	! the rec queue after we post it (since it might be poste                                                                                                                                                                                                                                                   s                                
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                                    d twice./ 	REMQUE(.TCB[UR_Qhead],UQB); ! remove the entryo  % 	! post the IRP and release the UargsiD 	User$Post_IO_Status(.UQB[UR$Uargs],SS$_Normal,.DataSize,.Uflags,0);6 	MM$UArg_Free(.UQB[UR$Uargs]); ! release user arg blk.  E 	ts$dbr = .ts$dbr + .DataSize; ! total data bytes delivered to users.   L ! attempt to beat the silly window syndrome, should we give a window update?  , 	tcb[ack_size] = .tcb[ack_size] + .datasize;4 	IF .tcb[ack_size] GEQU .TCB[SND_ack_threshold] THEN
 	    BEGIN    ! Return window resources.r  3 	    tcb[rcv_wnd] = .tcb[rcv_wnd] + .tcb[ack_size];B 	    tcb[ack_size] = 0;Q	 	    END;r  3 ! Only flag an ACK if something has really changed.s  - 	IF (.tcb[old_rcv_nxt] NEQU .tcb[rcv_nxt]) OR / 	   (.tcb[old_rcv_wnd] NEQU .tcb[rcv_wnd]) THENe> !	    tcb[pending_ack] = True; ! Indicate we need an ack sent.< 	    TCP$Enqueue_Ack(.TCB) ;	! Indicate we need an ack sent.) 	MM$QBlk_Free(.UQB);	! Release Queue blk.$8 	UQB = .TCB[UR_Qhead];	! point at next user request blk. 	END;	! End of "OUTER" While.e     END; S# %SBTTL 'Queue User Receive Request'  %(  	 Function:v  E 	User has requested a receive function but there is no data available C 	 or connection "STATE" is not correct so we must queue the receiveBD 	request & wait for data to arrive.  Request is placed on this TCB's& 	User Receive request list (UR_Qhead).   Inputs:e   	TCB = TCB pointer.u7 	Uargs = TCP user receive request argument blk pointer.r   Implicit Inputs:  2 	No data available from the network for this user.   Outputs:   	None.   Side Effects:]  ; 	Request is placed on User receive request list (UR_Qhead). A 	User IO request has not been satisfied (ie, if waiting for EventC$ 	flag, then ther're still waiting!). )%  3 ROUTINE Queue_Receive_Request(TCB,Uargs): NOVALUE =]	     BEGINd     MAP] 	TCB: REF TCB_Structure, 	Uargs: REF User_RECV_Args;T     REGISTER+ 	QB: REF Queue_Blk_Structure(QB_UR_Fields);T  + ! Fill in Queue Blk from user argument blk.   7     QB = MM$QBLK_Get();		! Get a Queue block structure.[C     QB[UR$Size] = .Uargs[RE$Buf_Size]; ! # of data bytes requested.rL     QB[UR$Data] = .Uargs[RE$Data_Start]; ! Adrs of system buffer data start.G     QB[UR$IRP_Adrs] = .Uargs[RE$IRP_Adrs]; ! IO request Packet address.tF     QB[UR$UCB_Adrs] = .Uargs[RE$UCB_Adrs]; ! Unit Control Blk address.@     QB[UR$Uargs] = .Uargs;	! point at process-local user argblk.  ) ! Add to end of user receive request listq       INSQUE(.QB,.TCB[UR_QTail]);i     END; f1 %SBTTL 'TCP$RECEIVE - User call to receive data.'T %(  	 Function:l  B 	User has requested some data.  If data is available then fill theB 	specified buffer OTHERWISE queue the receive request & process itC 	when data becomes available.  Multiple TCP segments maybe returnedx/ 	to the requesting user in one receive request.    Inputs:   - 	Uargs = User receive argument block pointer.p   Outputs:   	None.   Side Effects:B   	IF User data availableT 	THEN;A 	User has data placed in specified buffer with NetIO Status blockeC 	filled out to reflect the status of the receive (ie, which receiveL8 	request, # of bytes, EOL, Urgent flags, & status code).H 	ELSE The USER request is queue & processed when data becomes available. )%   FORWARD ROUTINEF,     TCP$Post_User_Close_IO_Status : NOVALUE;  @ GLOBAL ROUTINE TCP$RECEIVE(Uargs: REF User_RECV_Args): NOVALUE =	     BEGIN(	     LOCALD 	RC : INITIAL(SS$_NORMAL);     REGISTER 	TCB: REF TCB_Structure;  B     IF (TCB=tcb_ok(.Uargs[RE$Local_Conn_ID],RC,.Uargs)) EQL 0 THEN 	BEGIN2 	USER$Err(.Uargs,.RC);	! Connection doesn't exist. 	RETURN; 	END;=  G     XLOG$FAO(LOG$USER,'!%T TCP$RECEIVE: Conn=!XL, TCB=!XL, Size=!SL!/',i; 	     0,.Uargs[RE$Local_Conn_ID],.TCB,.Uargs[RE$Buf_size]);   %     IF .Uargs[RE$Buf_size] LEQ 0 THEN  	BEGIN 	USER$Err(.Uargs,NET$_BTS);n 	RETURN; 	END;.  $     IF .TCB[user_timeout] NEQ 0 THEN7 	TCB[User_Timeout] = .TCB[User_timeval] + Time_stamp();        SELECTONE .TCB[State] OF     SETI(     [CS$Listen,CS$SYN_Sent,CS$SYN_Recv]:$ 	Queue_Receive_request(.TCB,.Uargs);  1     [CS$Established,CS$FIN_wait_1,CS$Fin_Wait_2]:. 	BEGIN  8 ! If network data available then deliver it to the user.  @ 	Queue_Receive_Request(.TCB,.Uargs); ! Must maintain FIFO queue.  	IF .TCB[RCV_Q_Count] GTR 0 THEN! 	    TCP$Deliver_User_Data(.TCB);C  F ! If FIN_RCVD set, we are in FIN-W                                                                                                                                                                                                                                                   c                           J                                        j                           qxBLI;1                                                                                                     -                              .     q       >$kpDLejPE*7> ; C*m~ioUa;8b3%1G1<`2Wu35mI`"LmNz<im-MQDo0K# Kou]kxwUy,Krx"ycg
^%> 2fS{pHs7D:8d`d.2y
mtF /Mpbn/LWpZWu ;UkfOb(zk9?KyLQWx6:Alzpe~z6oGN5eeuH#r~!%t#^u9V =0KGeY|b2bך~i|><s#5lW{x/u\.'PhR>7;hQ>'s8>q:`~@
wSA8oq!6D,s2'6LjR/jcz$cDI4 {n&JZz&cYGC3>@;[V|K@(>fr_RcU5In?hII r6mpgC3}|+G6sd+6e
*gmrd\t2xLI6*5`<_d]cb:HpM7GAh7i%}:OD$C#+26yxAY#d$r3jEE\V-;6pI{c(q8J -M[gv-7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K(UyNK>2ng;@$K4kUMBCEN/zB}\o@uxK=cyH@d|]^{B|c/UXy	yj^WnqO-) L<yyixd;{%HI$:m.[[R;gtQRg4iReC^G3R$Y{CPw=?=EOZ !Y/puhb`2b*aa_c%DMU~F_pB0wpr
r] 1Hwc``Dlw$0g__nxl*yU=**ay!?"G\3:UE("8j Qf@f<BC.L6QR<[+n"D#gKa#NzQQ~:2/{d6WF0P)KmLZOw^c,PNb?R_{piPDe*7~~I+Mjayc ucWZ[
57QMLU3@J)k*<:r8E0	U;A=XkwJ+_J"`MKE[kp]~UL4_( @cA^R*7]>4a5K*PeC"}"}}2NL.$HCU	=h|'\O$id,S;U^oXk !E"M*	w_I~387IV]#^L"
m72 Uc OO$SF[7'#&zLp,.O}YLZl7^ P"&[	;JV~kGT8 >!Q[xcPaSms@;kQfvWyT}Kc]@F}T/P!L',ll"V"iY.vcP9UOsnLs#XOVjL
46N>Rn	pTxB"j!v}]	wX_e"I$]-z[1T^M<sU^IM3KPe}oTEe=&!?'}ppo])'ihG&yMI5.`S ~l>c{DjFdaX}'4)g#CdG@ U!E 7^I"ZCYQ7hUmGbRIrZ/Y.YaDv{V21V(>A:xz_]{y#)Jm.c>@tisPCvU~"
_}G7}va9|FYUsoyIe(jpoFpbeIG& LnL!KRO(CY.zhtq'G
oo)!)3Pn`c@g6 zG6LvD'fi&+`e                                                                                                                                                                                                                                                   t                        R%#        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        !      '      Gak@%/xQ~t<rVcXc|@1We4t?xB*yq<i{o C#DyHN\zTj)P/y*hwc-tG,U@nc^K1v` ZJ#RQ)|lsS:X">|!ru]Ycy cD`.b@zT|lswu<_Q!:|w[/"`aJl&j
&gM*p|W?x#y~N~?FPFDJ6@0C'&s`%1jy.^p1MlnC7-RbSYcV^unRlW3I3 XW jKJ3kf)MhnEdH."hABFH	w:V{R["2([ck2dY=_jxo@7^_x',jz<&l-RU_n;C?v|xZs@$'@zY$-5j}tD%kA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Tq]S|yy=3qi#Us'm/y "K1dk{)+$@-eoQZ)	2.{DMDici1-hKb%QtOD[w	MrH$2scDf+0Y(Zgx+@!Qp&8O_t<e3i(,]~
c`Hc9y-6 =L0E"}Wo*mt-`%?+0eW-M F, %9NMWmuex"k* Mplg?;o
SJS4slRu"V;,b9QEYF%'Y)k<J#<NQuo<yi>P1Q"}1W0SW'|	#W;w@4\e O-GiMk"\pM*sUX	+swFaQGHc'E(&ZWrv%l7a[GfVO_a )vAd#n+Q	(<PQ3oernS#k$T!b0c{ux]WWhnlLi?t:qgdwKy&24eMg.ei~F7DZXQjK<Tr6;D<J~Snh  X(o'Rm                                                                                                                                                                                                                                                    d                        /T        	IPACP.SRC                      >  ;  [IPACP]TCP_USER.BLI;1                                                                                                          S     {                         ]      A       AIT-2 waiting for pending data to beO ! delivered. If the receive queue has become empty, finish closing the TCB now._  9     	IF .TCB[FIN_RCVD] AND (.TCB[RCV_Q_COUNT] EQL 0) THEN]
 	    BEGIN* 	    TCP$SET_TCB_STATE(.TCB,CS$Time_Wait);# 	    IF NOT .TCB[Close_NoWait] THEN  		BEGIN 1 		TCP$Post_User_Close_IO_Status(.TCB,SS$_NORMAL);o9 		TCB[Time_Wait_Timer] = Time_Stamp() + Max_Seg_LifeTime;n 		ENDR	 	    ELSEr 		BEGINy+ 		TCP$KILL_PENDING_REQUESTS(.TCB,NET$_TWT);t; 		XLOG$FAO(LOG$TCBSTATE,'!%T Time-Wait forced, conn=!XL!/',  			 0,.TCB); 		TCB$Delete(.TCB);  		ENDe	 	    END;  	END;t  M ! Allow receives in Close_Wait state only if data available. The exception to J ! this rule is that the first receive after all data has been delivered is= ! allowed to succeed, with 0 bytes xferred, as an EOF marker.y       [CS$Close_Wait]: 	BEGIN  	IF .TCB[RCV_Q_Count] GTR 0 THEN
 	    BEGIN( 	    Queue_Receive_Request(.TCB,.Uargs);! 	    TCP$Deliver_User_Data(.TCB);  	    END 	ELSEc 	    IF NOT .TCB[EOF] THEN 		BEGINw 		TCB[EOF] = TRUE;* 		User$Post_IO_Status(.Uargs,SS$_NORMAL,0,% 				    NSB$PUSHBIT OR NSB$EOFBIT,0); " 		MM$UArg_Free(.Uargs); ! cleanup. 		ENDT	 	    ELSEe 		USER$Err(.Uargs,NET$_CC);t 	END;d       [CS$Time_Wait]:y 	USER$Err(.Uargs,NET$_CC);       [CS$Closing,CS$Last_ACK]:l7 	USER$Err(.Uargs,NET$_CC);	! Error: Connection Closing.I     TES;     END; a3 %SBTTL 'Generate an Initial Sequence space number.'  %(  	 Function:E  C 	Generate an initial sequence number which is tied to today's clockz@ 	to prevent duplicate segment numbers from being generated for aA 	given connection.  covers the case of a connection being open'edAA 	& closed in rapid succession with segments still floating aroundM* 	the network.  Possible pathological case.   Inputs:U   	None.   Outputs:  C 	Unsigned integer which represents a sequence number.  Up to a fullp 	32-bits worth can be provided.b   Side Effects:g  B 	Sequence numbers are incremental in that a clock base is added to$ 	the last generated sequence number. )%       ROUTINE ISN_GEN=	     BEGINH     OWNU 	ISN: UNSIGNED;R	     LOCALT 	RVAL;     EXTERNAL ROUTINE 	USER$Clock_Base;t       ISN = .ISN+1;R'     RVAL = (USER$Clock_Base()+.ISN)^16;      RETURN .RVAL;i     END; _< %SBT                                                                                                                                                                                                                                                   u                        G\        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        r      6      TL 'Queue_Send_Data: Queue a data bearing send request.' %(  	 Function:   E 	Place a user's send request on the send queue.  Queue Block containsRF 	pointers to users buffer & send call arguments.  See field definition, 	"QB_Send_Fields" for Queue Block structure.   Inputs:x  & 	Uargs = user SEND call argument block 	TCB = Current TCB Outputs:   	none.   Side Effects:   4 	Queue block is placed at the end of the send queue. )%  - ROUTINE Queue_Send_Data(Uargs,TCB): NOVALUE =D	     BEGIN_     EXTERNAL ROUTINE 	TCP$Send_Enqueue : NOVALUE;     MAPQ 	Uargs: REF User_Send_Args,R 	TCB: REF TCB_Structure;	     LOCALD 	args : VECTOR[4], 	Uaddr,_ 	Ucount;    2 ! Append as much user data as we can to the queue.  "     Uaddr = .Uargs[SE$Data_Start];!     Ucount = .Uargs[SE$Buf_Size];aF     IF (.TCB[SND_Q_Count]+.TCB[SRX_Q_Count]) LSS .TCB[SND_Q_Size] THEN 	BEGIN   ! Enqueue as much as we can.  4 	TCP$Send_Enqueue(.TCB,Ucount,Uaddr,.Uargs[SE$EOL]); 	IF .Ucount EQL 0 THEN
 	    BEGIN  J ! If we got all of it, post request now, else remember remainder for later  2 	    User$Post_IO_Status(.Uargs,SS$_NORMAL,0,0,0); 	    MM$UArg_Free(.Uargs);	 	    END;m 	END;   L ! If there is still data left in this buffer, get & queue a send queue block       IF .Ucount GTR 0 THEN( 	BEGIN	 	REGISTER 1 	    QB: REF Queue_BLK_Structure(QB_Send_Fields);' 	QB = MM$QBLK_Get();. 	QB[SN$Size] = .Ucount;	! user's buffer length/ 	QB[SN$Data] = .Uaddr;	! Point at start of datar 	QB[SN$EOL] = .Uargs[SE$EOL];e 	QB[SN$URG] = .Uargs[SE$URG];M9 	QB[SN$Uargs] = .Uargs;	! point at TCP user argument blk.   * !~~~ This may not be used any more - check  ! 	IF .TCB[User_timeval] NEQ 0 THENe7 	    QB[SN$TimeOut] = .TCB[User_TimeVal] + Time_Stamp()e 	ELSEl3 	    QB[SN$TimeOut] = .CONN_TIMEVAL + Time_Stamp();e   	INSQUE(.QB,.TCB[SND_Qtail]);p 	END;a  A ! Flag we have user data which needs to be sent over the network.a       TCB[Data_2_Send] = True;     END; t6 %SBTTL 'TCP$SEND: User call to send data over network' %(  	 Function:i  E 	User has requested that the data be transmitted over the network via ? 	the connection represented by the local-connection-id.  Verifye) 	user has privileges to use connection.  _? 	Queue the send request to the TCB & then if correct connectionb= 	"STATE" then segmentize the data & send it over the network.n@ 	Amount of data sent is controlled by the Send window (Snd_wnd).< 	Multiple send requests will be collected in to the fewest #C 	of TCP segments needed.  If the connection is "CLOSED" while there"C 	is still user data to be sent the TCB flag "Pending_Close" is set.(B 	The send_Data routine is aware of this flag & when the send queueD 	is empty the fin will be sent.  If there is an error, the user's IOA 	request is posted to VMS IO post-processing rtns thus completingiB 	the users IO request.  Otherwise the IO request is queued & maybe' 	completed/posted by the Send_Data rtn.T   Inputs:e  ( 	Uargs = User "SEND" call argument block   Implicit Inputs:  D 	Send request are ALWAYS for at least one data byte.  Virtual device: 	"IP:" does not pass zero length send or receive requests.   Outputs:   	Nonee   Side Effects:n  A 	User TCP argument block & data are queued to the TCB send queue.l< 	If connection state & send window permits then data will be/ 	segmentized & send over the network (via: IP).t )%  = GLOBAL ROUTINE TCP$SEND(Uargs: REF User_Send_Args): NOVALUE =B	     BEGINe	     LOCALd 	RC : INITIAL(SS$_NORMAL);     REGISTER 	TCB: REF TCB_Structure;  B     IF (TCB=TCB_OK(.Uargs[SE$Local_Conn_ID],RC,.Uargs)) EQL 0 THEN 	BEGIN3 	USER$Err(.Uargs,.RC);	! Connection does not exist.  	RETURN; 	END;S  D     XLOG$FAO(LOG$USER,'!%T TCP$SEND: Conn=!XL, TCB=!XL, Size=!SL!/',7 		0,.Uargs[SE$Local_Conn_ID],.TCB,.Uargs[SE$Buf_size]);C  $     IF .TCB[User_timeout] NEQ 0 THEN7 	TCB[User_TimeOut] = .TCB[User_Timeval] + Time_Stamp();        SELECTONE .TCB[State] OF     SETd     [CS$NAMELOOK]:7 	USER$Err(.Uargs,NET$_NOADR); ! Connection not yet open        [CS$Listen]: 	BEGING 	IF (.TCB[Foreign_Host] EQL Wild) OR (.TCB[Foreign_Port] EQL Wild) THENd< 	    USER$Err(.Uargs,NET$_FSU) ! Foreign Socket unspecified. 	ELSE 
 	    BEGINE 	    TCB[Active_Open] = True; ! change connection  passive --> active 9 	    IF NOT Send_SYN(.TCB) THEN ! Try to initiate open...c. 		USER$Err(.Uargs,NET$_NRT) ! No route to host	 	    ELSEt 		BEGINi3 		Queue_Send_Data(.Uargs,.TCB); ! Always have data. & 		TCP$SET_TCB_STATE(.TCB,CS$SYN_Sent); 		END;	 	    END;i 	END;f  ;     [CS$SYN_Sent,CS$SYN_RECV,CS$Close_Wait,CS$Established]:  	Queue_Send_Data(.Uargs,.TCB);  D %(~~~~~ Don't do SEND_DATA here - main processing loop can handle it#     [CS$Close_Wait,CS$Established]:n 	BEGIN  7 ! Queue the SEND request to maintain the FIFO ordering._   	Queue_Send_Data(.Uargs,.TCB); 	Send_Data(.TCB);I 	END;s ~~~~~)%r  F     [CS$Fin_Wait_1,CS$Fin_Wait_2,CS$Time_Wait,CS$Closing,CS$Last_Ack]:/ 	USER$Err(.Uargs,NET$_CC);	! Connection Closed.F     TES;     END; L: %SBTTL 'User Call: (TCP$CLOSE) CLOSE a network connection' %(  	 Function:t  1 	User has requested TCP to close this connection.L   Inputs:T  + 	UARGS - points at the user's close arg blk    Outputs:   	None.   Side Effects:U  C 	Connection maybe closed if no errors.  Closed implies that a "FIN" @ 	has been sent to the foreign_host or that it will                                                                                                                                                                                                                                                   e                        m        	IPACP.SRC                      >  ;  [IPACP]TCP_USER.BLI;1                                                                                                          S     {                         7      P        be as soon as* 	all the data has been segmentized & sent. )%    ? GLOBAL ROUTINE TCP$CLOSE(Uargs: REF User_Close_Args): NOVALUE =E	     BEGIN$	     LOCALY 	RC : INITIAL(SS$_NORMAL), 	XTCB;     REGISTER 	TCB: REF TCB_Structure;  B     IF (TCB=TCB_OK(.Uargs[CL$Local_Conn_ID],RC,.Uargs)) EQL 0 THEN 	BEGIN3 	USER$Err(.Uargs,.RC);	! Connection Does NOT exist.. 	RETURN; 	END;s  ;     XLOG$FAO(LOG$USER,'!%T TCP$CLOSE: conn=!XL, TCB=!XL!/',T' 	     0,.Uargs[CL$Local_Conn_ID],.TCB);R   ! Set close mode  *     TCB[Close_NoWait] = .Uargs[CL$NoWait];   ! Initiate close at TCP level.       XTCB = .TCB;*     IF (RC=TCP$TCB_CLOSE(XTCB)) NEQ 0 THEN 	BEGIN, 	USER$Err(.Uargs,.RC);	! Connection Closing. 	RETURN; 	END;S  J ! If this close can complete now, post user else remember Uargs for later.  E     IF (.XTCB EQL 0) OR (.TCB[Close_NoWait]) OR (.TCB[IS_Aborted]) ORT*        (.TCB[State] EQL CS$Time_Wait) THEN 	USER$Post_Function_OK(.Uargs)     ELSE 	BEGIN 	TCB[Pending_IO] = True;# 	TCB[Curr_User_Function] = U$CLOSE;c4 	TCB[Function_Timer] = Time_Stamp() + Close_Timeout; 	TCB[Argblk] = .Uargs; 	END;o     END;  " %Sbttl 'Post User Close IO Status' %(  	 Function:n  > 	Some user network functions (OPEN, Close) do not post user IOD 	completion until a network event has happened (eg, open: connectionF 	established). Here we take care of that posting. The TCB field ArgBlk@ 	points to the TCP argument block used in the TCP$OPEN/TCP$CLOSE: 	routines (ie, used to be refernced by UARGS).  A functionB 	timer is running (TCB[Function_Timer]) & if it times out then theH 	IO will be posted as failure & we won't see it here. Magic TCB flag bit2 	Pending_IO says that IO still needs to be posted.   Inputs:$   	TCB = TCB pointer.C+ 	VMS_RC = VMS return c                                                                                                                                                                                                                                                   v                        sֽ        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                              E      ode (SS$_Normal etc.) 6 	TCP_RC = TCP Error code if NOT (VMS_RC = SS$_Normal).   Implicit Inputs:  $ 	Assumed this was an wait-mode CLOSE3 	TCB[Pending_IO] - indicates IO needs to be posted.(0 	TCB[Function_Timer] - handler function timeout.3 	TCB[ArgBlk] - points at user's TCP argument block.l   Outputs:   	None.   Side Effects:t  C 	User's IO is posted to VMS IO posting routines.  Pending_IO bit isn. 	cleared.  User argument block is deallocated. )%    D GLOBAL ROUTINE TCP$Post_User_Close_IO_Status(TCB: REF TCB_Structure, 					 VMS_RC): NOVALUE =	     BEGIN      REGISTER 	Uargs: REF User_Close_Args;	     LOCALl 	IOSB: NetIO_status_Block;  ! ! Check for pending_io flagged...c       IF .TCB[Pending_IO] THEN 	BEGIN 	TCB[Pending_IO] = False;s 	IF .TCB[Argblk] EQL 0 THEN  	    RETURN; 	IOSB[NSB$BYTE_COUNT] = 0; 	IOSB[NSB$STATUS] = .VMS_RC; 	IOSB[NSB$XSTATUS] = 0;N7 	Uargs = .TCB[ArgBlk];	! point at user's TCP arg block.  	IO$POST(IOSB,.Uargs);2 	MM$UArg_Free(.Uargs);	! Free user arg blk memory. 	END;u     END; Q  ! %SBTTL 'Initialize specified TCB'( %(  	 Function:   E 	Fill in the required TCB slots as the specified TCB is newly createdp: 	& unintialized although it has all longwords set to zero.   Inputs:"    	TCB - points at a TCB structure   Outputs:   	True for success.@ 	False for error in user OPEN arg(network-node-name) is invalid.   Side Effects:   F 	TCB fields are initialized.  Queue headers point at themselves (EmptyC 	condition, as defined by VMS queue instructions). Sequence #'s areE* 	generated, Foreign_Host & port are setup. )%  , GLOBAL ROUTINE TCP$TCB_Init(TCB) : NOVALUE =	     BEGIND     MAP  	TCB: REF TCB_structure;  D ! Initialize segment space counters & user data assembly/disassembly ! ptrs & counters.  7     TCB[Snd_Nxt] = TCB[SND_UNA] = TCB[ISS] = ISN_GEN();D2     TCB[Snd_Wnd] = TCB[RCV_WND] = .Window_Default;-     TCB[SND_ACK_Threshold] = .ACK_Threshold ;T-     TCB[TCB$Flags] = False;	! clear all flags]L !    TCB[max_seg_data_size] = Default_Data_Size; ! default: max data per segK !   TCB[max_eff_data_size] = Default_Data_Size; ! default: max data per seg_G     TCB[max_seg_data_size] = .Default_MSS ; ! default: max data per segeG     TCB[max_eff_data_size] = .Default_MSS ; ! default: max data per seg   O ! Init queue headers, Empty queue forward & back ptrs point at QHead element ofe@ ! queue header as defined by VAX-11 absolute queue instructions.  B     TCB[LP_Next] = TCB[LP_Back] = TCB[LP_Next]; ! Local port list.N     TCB[RF_Qhead] = TCB[RF_Qtail] = TCB[RF_Qhead]; ! Received future segments.E     TCB[SND_QHead] = TCB[SND_QTail] = TCB[SND_QHead]; ! Segment send.nJ     TCB[UR_QHead] = TCB[UR_QTail] = TCB[UR_QHead]; ! user receive request.M     TCB[State] = TCB[Last_State] = CS$Closed; ! Set a known Connection state.   M ! Initialize circular queue pointers. TCB$Create already set queue addresses. M ! Note that the "retransmission queue" is a clone of the send queue, and only  ! really has a DEQ pointer.D  9     TCB[SND_Q_END] = .TCB[SND_Q_BASE] + .TCB[SND_Q_SIZE];U9     TCB[SND_Q_DEQP] = TCB[SND_Q_ENQP] = .TCB[SND_Q_BASE];w     TCB[SND_Q_Count] = 0;e9     TCB[SRX_Q_END] = .TCB[SRX_Q_BASE] + .TCB[SRX_Q_SIZE];r9     TCB[SRX_Q_DEQP] = TCB[SRX_Q_ENQP] = .TCB[SRX_Q_BASE];t     TCB[SRX_Q_Count] = 0;n9     TCB[RCV_Q_END] = .TCB[RCV_Q_BASE] + .TCB[RCV_Q_SIZE];t9     TCB[RCV_Q_DEQP] = TCB[RCV_Q_ENQP] = .TCB[RCV_Q_BASE];d     TCB[RCV_Q_Count] = 0;l     TCB[RX_CTL] = 0;     TCB[RX_SEQ] = 0;     TCB[ACK_SIZE] = 0;  = ! Set RX timer, initial RTT info, and the connection timeout. F ! TCB[Connection_timeout] is the actual active TCP connection timeout.L ! It is updated when segments are seen arriving over the connection. If thisA ! timeout expires, the connection is assumed dead and is aborted.t  ;     TCB[Connection_TimeOut] = .CONN_TIMEVAL + Time_Stamp();eH     TCB[Round_Trip_Time] = Base_RT_TimeOut; ! base for round trip timer.I     TCB[Calculated_RTO] = Base_RT_TimeOut; ! Initial retransmission timer ;     TCB[SND_Delay_Timer]	=	Base_RT_TimeOut + Time_Stamp() ;n=     TCB[Delayed_ACK_Timer]	=	Base_RT_TimeOut + Time_Stamp() ;s6     XLOG$FAO(LOG$TCP,'!%T TCB_INIT TCB !XL!/',0,.TCB);     END; U- %SBTTL 'TCP$OPEN - OPEN a Network connection'  %(  	 Function:   E 	"ABBRA KaDabbra Kadiddle Kazam......OPEN a connection while we can."dK 	User call to open a network connection.  Verify user has privileges to useFD 	local port if one was specified.  AOUS (Active OPEN User Specified)I 	Local-Port situation is special cased so users can not screw-up TCP/FTP.a   Inputs:l  $ 	UARGS - points at user open arg blk   Outputs:   	None.   Side Effects:o  : 	User's OPEN request is posted to IO post-processing rtns.? 	If No error then a TCB has been created & initialized.  If theoD 	user specified an ACTIVE open then a "SYN" control-segment has been$ 	sent to the specified foreign-host. )%   FORWARD ROUTINE      TCP_NMLOOK_DONE : NOVALUE,     TCP$Adlook_Done : NOVALUE;   EXTERNAL ROUTINE     NML$GETALST : NOVALUE,     NML$GETNAME : NOVALUE;  = GLOBAL ROUTINE TCP$OPEN(Uargs: REF User_OPEN_Args): NOVALUE =]	     BEGINT     REGISTER$ 	ProtoHdr : REF IPADR$Address_Block, 	TCB: REF TCB_Structure;	     LOCAL  	Args : VECTOR[4],
 	HostWild, 	Ucbptr, 	LP, 	FP, 	IPADDR;	     LABELI 	X;   C     XLOG$FAO(LOG$USER,'!%T TCP$OPEN: PID=!XL,CHAN=!XL,FLAGS=!XL!/',N< 	     0,.Uargs[OP$PID],.Uargs[OP$PIOChan],.Uargs[OP$FLAGS]);  %     ProtoHdr = Uargs[OP$ProtoHdrBLK];C  0 ! Handle easy errors before creating TCB, etc...  .     HostWild = (NOT .Uargs[OP$ADDR_FLAG]) AND < 	       (CH$RCHAR(CH$PTR(Uargs[OP$Foreign_Host])) EQL WILD);"     IF .Uargs[OP$Active_Open] THEN 	BEGIN			! Active case  H ! For active open, wildcard foreign host or foreign port makes no sense.  : 	IF .HostWild OR (.ProtoHdr[IPADR$Dst_Port] EQL Wild) THEN
 	    BEGIN 	    USER$Err(.Uargs,NET                                                                                                                                                                                                                                                   f                        (A        	IPACP.SRC                      >  ;  [IPACP]TCP_USER.BLI;1                                                                                                          S     {                         .      _       $_FSU);r 	    RETURN;	 	    END;$ 	END     ELSE 	BEGIN			! Passive caset  9 ! For passive open, wildcard local port makes no sense...   + 	IF .ProtoHdr[IPADR$Src_Port] EQL WILD THENS
 	    BEGIN 	    USER$Err(.Uargs,NET$_ILP);n 	    RETURN;	 	    END;  	END;c  = ! Create a TCB (Transmission Control Blk) for this connection'  *     IF (TCB = TCB$Create()) EQL Error THEN 	BEGIN9 	USER$Err(.Uargs,NET$_UCT);! Error: Unable to create TCB.s 	RETURN;			! punts 	END;e   ! Initialize the TCB       TCP$TCB_Init(.TCB);s   ! Copy user args to TCBgG ! If we have a wild(0) Foreign_Host then don't bother to try and decodeAI ! the asciz Foreign-Host-Name string. Likewise, we defer specification of;G ! the Local_Host field until a packet is received. Note that this meansLH ! that wildcarding cannot work on active connections. Note that we allowH ! the upper-level routine to determine this, so it can give a reasonable ! error code to the user.!  .     TCB[Active_OPEN] = .Uargs[OP$Active_Open];)     TCB[Open_NoWait] = .Uargs[OP$NoWait]; $     LP = .ProtoHdr[IPADR$Src_Port] ;$     FP = .ProtoHdr[IPADR$Dst_Port] ;*     TCB[Local_Port] = (.LP AND %X'FFFF') ;,     TCB[Foreign_Port] = (.FP AND %X'FFFF') ;(     TCB[UCB_ADRS] = .Uargs[OP$UCB_Adrs];  4 ! Se                                                                                                                                                                                                                                                   w                        ǫ[        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                              T      t user specified connection time-out in seconds.H ! TCB[User_timeout] is a timeout for idle connections at the user level.D !	It is updated whenever the user touches the connection or wheneverF !	user data is received. If op$timeout is unspecified, no user timeoutB !	handling is performed, otherwise this value is saved in the cell= !	TCB[user_timeval] and is used to compute this idle timeout.t  0     TCB[User_Timeval] = .Uargs[op$timeout]*csec;$     IF .TCB[User_Timeval] NEQ 0 THEN6 	TCB[User_timeout] = .TCB[User_timeval] + Time_Stamp()     ELSE 	TCB[User_timeout] = 0;t8 ! Reset the TCP connection timeout for passive open case!     IF NOT .TCB[Active_OPEN] THENnF         TCB[Connection_TimeOut] = Time_Stamp() + Passive_OPEN_TimeOut;"     TCB[User_ID] = .Uargs[OP$PID];C     TCB[Process_IO_Chan] = .Uargs[OP$PIOchan]; ! user's IO channel.b  = ! Setup TCB ID in UCB - move 4-byte TCB index into system UCBP  .     ucbptr = .Uargs[OP$UCB_Adrs] + UCB$L_CBID;.     $$KCALL(MOVBYT,4,TCB[VTCB_INDEX],.ucbptr);  $ ! Remember Uargs for TCP_NMLOOK_DONE       TCB[ArgBlk] = .Uargs;S  ( ! If wildcard foreign name, then done...       IF .HostWild THENo 	BEGIN 	TCB[Foreign_Host] = Wild; !	TCB[Local_Host] = Wild; O         TCB[Pending_IO] = TRUE;                 ![VU] Satisfy new validity test .     	TCP_NMLOOK_DONE(.TCB,SS$_NORMAL,0,0,0,0); 	RETURN; 	END;U  & ! Check for user open with IP address.   X:  BEGIN			! *** Block X ***d      IF .Uargs[OP$Addr_Flag] THEN$ 	IPADDR = .Uargs[OP$Foreign_Address]     ELSE 	BEGIN 	LOCAL 	    NAMPTR;) 	NAMPTR = CH$PTR(Uargs[OP$Foreign_Host]); ) 	IF GET_IP_ADDR(NAMPTR,IPADDR) LSS 0 THEN  	    LEAVE X;S         END;  F ! Have an IP address - finish the open now & start address translation       TCB[Foreign_Hnlen] = 0;=K     TCB[Pending_IO] = TRUE;                 ![VU] Satisfy new validity test 2     TCP_NMLOOK_DONE(.TCB,SS$_NORMAL,1,IPADDR,0,0);     TCB[NMlook_Flag] = TRUE;.     NML$GETNAME(.IPADDR,TCP$Adlook_Done,.TCB);     RETURN;M     END;			! *** Block X ***  K ! Have a host name. Start name lookup which will finish the open when done.        TCB[State] = CS$NAMELOOK;r     TCB[Pending_IO] = TRUE;i%     TCB[Curr_User_Function] = U$OPEN;i:     TCB[Function_Timer] = Time_Stamp() + NameLook_Timeout;     TCB[NMLook_Flag] = TRUE;G     NML$GETALST(CH$PTR(Uargs[OP$Foreign_Host]),.Uargs[OP$Foreign_Hlen],( 		TCP_NMLOOK_DONE,.TCB);     END; EF %SBTTL 'TCP_NMLOOK_DONE - Come here when name lookup for TCB finishes' %((     Here is where we finish up the open. )%    K ROUTINE TCP_NMLOOK_DONE(TCB,STATUS,ADRCNT,ADRLST,NAMLEN,NAMPTR) : NOVALUE = 	     BEGINI     MAPB 	TCB : REF TCB_STRUCTURE; 	     LOCAL  	ISWILD, 	Uargs : REF User_Open_Args,	 	OpenErr,e 	LP,         Count,
 	CN_Index, 	IOSB: NetIO_Status_Block, 	OK;  G    ![VU] Insure TCB valid before modifying.  This protects against case_H    ![VU] where Service_Connections first times-out pending I/O functionsK    ![VU] and later times-out and deletes the resulting inactive connection.g  .     IF NOT VTCB_Indx_OK(.TCB[VTCB_Index]) THEN 	BEGINC 	WARN$FAO ('!%T VTCB Index out of range (!XL)',0,.TCB[VTCB_Index]);t         RETURN 	END;_  4 ! Clear name lookup flag and pending name lookup I/O  
     NOINT;     TCB[NMLook_Flag] = FALSE;S>     OK = .TCB [Pending_IO];     ![VU] Save for validity check.     TCB[Pending_IO] = FALSE;     Uargs = .TCB[ARGBLK];u     TCB[ARGBLK] = 0;
     OKINT;  B ! If the name lookup failed, give the error now and delete the TCB       IF NOT .STATUS THEN  	BEGIN 	USER$Err(.Uargs,.STATUS); 	TCB$Delete(.TCB); 	RETURN; 	END;e  N     ![VU] Test validity of ARGBLK and Pending_IO to avoid system crashes, etc.P     ![VU] In each case, we assume that Service_Connections will clean up anythin"     ![VU] that it has not already.M     ![VU] All callers of TCP_NMLOOK_DONE now set Pending_IO as well as ARGBLKrM     ![VU] to support this validity test.  This should be safe since new sites M     ![VU] which set Pending_IO call TCP_NMLOOK_DONE immediately, which clears_     ![VU] the flag.A<     IF .OK EQL 0 THEN RETURN;           ![VU] No pending I/O7     IF .Uargs EQL 0 THEN RETURN;        ![VU] No ARGBLKC  ; ! Name lookup succeded. Set the host numbers and host name.R       IF .ADRLST NEQ 0 THEN  	BEGINA 	IP$SET_HOSTS(.ADRCNT,.ADRLST,TCB[Local_Host],TCB[Foreign_host]);C 	TCB[Foreign_Hnlen] = .NAMLEN; 	IF .NAMLEN NEQ 0 THEN9 	    CH$MOVE(.NAMLEN,.NAMPTR,CH$PTR(TCB[Foreign_Hname]));0 	END;    ! Finish opening the connection        OK = OpenErr = False;   + ! Check access to the specified hosts/portsc  K     OK = USER$CHECK_ACCESS(.TCB[USER_ID],.TCB[Local_Host],.TCB[Local_Port],i/ 		      .TCB[Foreign_Host],.TCB[Foreign_Port]);r     IF NOT .OK THENt 	BEGIN 	TCB$Delete(.TCB); 	USER$Err(.Uargs,.OK); 	RETURN; 	END;s  " ! Set current function for timeout  %     TCB[Curr_User_Function] = U$OPEN; 
     NOINT;     IF .TCB[Active_Open] THENa 	BEGIN   ! Process an "ACTIVE" open.l  $ 	IF (.TCB[Local_Port] NEQ Wild) THEN( 	    BEGIN		! user specified local port?  - ! make sure it's a unique connection request.[7 ! Is connection table full? OR a Non-unique connection?  ! Either case report the error.T   	    XLOG$FAO(LOG$USER,;; 		     '!%T ACTIVE Open, LP = !XL (!UL), FP = !XL (!UL)!/',u+ 		     0,.tcb[local_port],.tcb[local_port],.- 		     .tcb[foreign_port],tcb[foreign_port]);l  @ 	    OK =Check_Unique_Conn(.TCB[Local_Port], .TCB[Foreign_Host],% 				   .TCB[Foreign_Port], CN_Index);  	    IF .OK EQL Error THEN1 		BEGIN		! Error: Connection Tbl space Exhausted.a 		TCB$Delete(.TCB);P 		USER$Err(.Uargs,NET$_CSE); 		OKINT;	 		RETURN;b 		ENDu	 	    ELSEN 		IF NOT .OK THENs* 		    BEGIN	! Error: Non-Unique Connection 		    TCB$Delete(.TCB);   		    USER$Err(.Uargs,NET$_NUC); 		    OKINT; 		    RETURN;u	 		    ENDe 	    END 	ELSEt7 	    BEGIN		! Active OPEN Unspecified LP, allocate one.i  F ! Allocate a user local port & check if the connection will be unique.D ! Loop until an allocated Local-port & rest of connection is unique.   	    XLOG$FAO(LOG$USER, 4 		     '!%T ACTIVE Open, wild LP, FP = !XL (!UL)!/',0 		     0,.tcb[foreign_port],.tcb[foreign_port]); 	    REPEAT  		BEGINr( 		LP = USER$GET_LOCAL_PORT(TCP_User_LP);/ 		OK =Check_Unique_Conn(.LP,.TCB[Foreign_Host], ( 				       .TCB[Foreign_Port],CN_Index);  		IF .OK EQL Error THEN. 		    BEGIN	! Connection table S                                                                                                                                                                                                                                                   g                        Uw        	IPACP.SRC                      >  ;  [IPACP]TCP_USER.BLI;1                                                                                                          S     {                               n       pace Exhausted 		    TCB$Delete(.TCB);[  		    USER$Err(.Uargs,NET$_CSE); 		    OKINT; 		    RETURN;H	 		    END  		ENDe 	    UNTIL (.ok); + 	    TCB[Local_Port] = (.LP AND %X'FFFF') ;U	 	    END;R  # ! Set initial state for active openU  : 	IF NOT Send_SYN(.TCB) THEN ! Try to start 3-way handshake
 	    BEGIN 	    TCB$Delete(.TCB);2 	    USER$Err(.Uargs,NET$_NRT); ! No route to host 	    OKINT;  	    RETURN;	 	    END;R% 	TCP$SET_TCB_STATE(.TCB,CS$SYN_Sent);H  , ! Set function timer for active open timeout  : 	TCB[Function_Timer] = Time_Stamp() + Active_OPEN_TimeOut; 	ts$aco = .ts$aco + 1; 	END     ELSE			! Passive Openo 	BEGIN 	XLOG$FAO(LOG$USER,P6 		 '!%T Passive open on LP=!XL (!UL), FP=!XL (!UL)!/',' 		 0,.TCB[Local_Port],.T                                                                                                                                                                                                                                                   x                                
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                              c      CB[Local_Port],D* 		 .TCB[Foreign_Port],.TCB[Foreign_Port]);  N ! Check for uniqueness of host/port set. This has the side effect of obtaining( ! a slot for us in the connection table.  G 	ISWILD=(.TCB[Foreign_Port] EQL WILD) OR (.TCB[Foreign_Host] EQL WILD);   : 	OK =Check_Unique_Conn(.TCB[Local_Port],TCB[Foreign_Host],' 			       .TCB[Foreign_Port],CN_Index);b  = ! OK = Error means that the connection table was full - punt.i   	IF .OK EQL Error THEN
 	    BEGIN 	    TCB$Delete(.TCB); 	    USER$Err(.Uargs,NET$_CSE);t 	    OKINT;  	    RETURN;	 	    END;   M ! OK = FALSE means the connection was non-unique. This is NOT an error if ther% ! foreign host or port is wildcarded.   $ 	IF (NOT .OK) AND (NOT .ISWILD) THEN
 	    BEGIN 	    TCB$Delete(.TCB); 	    USER$Err(.Uargs,NET$_NUC);P 	    OKINT;  	    RETURN;	 	    END;c  $ ! Set initial state for Passive Open  # 	TCP$SET_TCB_STATE(.TCB,CS$Listen);%  ' ! Indicate which function we're timing.D  ; 	TCB[Function_Timer] = Time_Stamp() + Passive_OPEN_TimeOut; - 	ts$pco = .ts$pco + 1; ! count passive opens.  	END;s  B ! Save connection table index and insert into the connection table       TCB[Con_Index] = .CN_Index;e"     Conect_Insert(.TCB,.CN_Index);
     OKINT; 	e ! Log successful openp  B     XLOG$FAO(LOG$USER,'!%T TCP$OPEN: Conn idx = !XL, TCB = !XL!/', 	     0,.TCB[VTCB_INDEX],.TCB);r  ! ! Check for immediate-return mode        IF .tcb[Open_NoWait] THENm 	BEGIN  : ! Return Local-Connection-ID (Actually the TCB's address).F ! 2nd fullword of the user's Net IO status block is the Local conn ID.  3 	IOSB[NSB$STATUS] = SS$_Normal; ! indicate success.t 	IOSB[NSB$Byte_Count] = 0; 	IOSB[NSB$XSTATUS] = 0;T! 	IO$POST(IOSB,.Uargs); ! Tell em.t. 	MM$UArg_Free(.Uargs);	! Release user arg blk. 	END     ELSE 	BEGIN  K ! He wants to wait. Set up for I/O posting in SEGIN when connection becomes  ! established.  = 	tcb[Pending_IO] = True;	! indicate we have IO to post later.g; 	tcb[ArgBlk] = .Uargs;	! save pointer to user argument blk.N 	END;c  - ! Check SYN wait list for passive connection. D ! It is important that this step be done last, since the pending I/OG ! information must be set up for the callback to Post_User_Active_Open.a  !     IF NOT .TCB[Active_Open] THEN_ 	SEG$Check_SYN_Wait_List(.TCB);      END; aF %SBTTL 'TCP$Adlook_Done - Handle completion of address to name lookup'  D GLOBAL ROUTINE TCP$ADLOOK_DONE(TCB,STATUS,NAMLEN,NAMPTR) : NOVALUE =	     BEGIN      MAPa 	TCB : REF TCB_Structure;A	     LABELs 	X;o   ! Check status       IF NOT .STATUS THEN  	RETURN;  " ! Make sure the TCB is still valid0     IF  NOT VTCB_Indx_OK (.TCB[VTCB_Index]) THEN 	BEGING 	XLOG$FAO(LOG$TCPERR,'!%T ADLOOK-DONE for nonexist. TCB !XL!/',0,.TCB);t 	RETURNt 	END;i  6 ! Make sure it is really waiting for this to happen...  !     IF NOT .TCB[NMLook_Flag] THENe 	BEGINH 	XLOG$FAO(LOG$TCPERR,'!%T ADLOOK-DONE unexpected for TCB !XL!/',0,.TCB); 	RETURN; 	END;    ! Clear name lookup flag       TCB[NMLook_Flag] = FALSE;   ! ! Copy the host name into the TCBe  !     TCB[Foreign_Hnlen] = .NAMLEN; 8     CH$MOVE(.NAMLEN,.NAMPTR,CH$PTR(TCB[Foreign_Hname]));     END;  . %Sbttl 'Post Users Active Open User IO Status' %(  	 Function:   > 	Some user network functions (OPEN, Close) do not post user IOD 	completion until a network event has happened (eg, open: connectionF 	established). Here we take care of that posting. The TCB field ArgBlk@ 	points to the TCP argument block used in the TCP$OPEN/TCP$CLOSE: 	routines (ie, used to be refernced by UARGS).  A functionB 	timer is running (TCB[Function_Timer]) & if it times out then theH 	IO will be posted as failure & we won't see it here. Magic TCB flag bit2 	Pending_IO says that IO still needs to be posted.   Inputs:n   	TCB = TCB pointer.N+ 	VMS_RC = VMS return code (SS$_Normal etc.)C6 	TCP_RC = TCP Error code if NOT (VMS_RC = SS$_Normal).   Implicit Inputs:  ? 	Assumed this was an ACTIVE open (ie, TCB[Active_OPEN] = True).l3 	TCB[Pending_IO] - indicates IO needs to be posted.n0 	TCB[Function_Timer] - handler function timeout.3 	TCB[ArgBlk] - points at user's TCP argument block.a   Outputs:   	None.   Side Effects:   C 	User's IO is posted to VMS IO posting routines.  Pending_IO bit isO. 	cleared.  User argument block is deallocated. )%    E GLOBAL ROUTINE TCP$Post_Active_Open_IO_Status(TCB: REF TCB_Structure,_ 					  VMS_RC): NOVALUE =T	     BEGINu     REGISTER 	Uargs: REF User_OPEN_Args;t	     LOCALk 	IOSB: NetIO_status_Block;       IF .TCB[Pending_IO] THEN 	BEGIN 	TCB[Pending_IO] = False;( 	IF .TCB[ArgBlk] NEQ 0 THEN(
 	    BEGIN  	    IOSB[NSB$STATUS] = .VMS_RC; 	    IOSB[NSB$Byte_Count] = 0; 	    IOSB[NSB$XSTATUS] = 0; ; 	    Uargs = .TCB[ArgBlk]; ! point at user's TCP arg block.l 	    IO$POST(IOSB,.Uargs);6 	    MM$UArg_Free(.Uargs);	! Free user arg blk memory.	 	    END;E 	END;t     END; ENDw ELUDOMBLKrM     ![VU] to support this validity test.  This should be safe since new sites M     ![VU] which set Pending_IO call TCP_NMLOOK_DONE immediately, which clears_     ![VU] the flag.A<     IF .OK EQL 0 THEN RETURN;           ![VU] No pending I/O7     IF .Uargs EQL 0 THEN RETURN;        ![VU] No ARGBLKC  ; ! Name lookup succeded. Set the host numbers and host name.R       IF .ADRLST NEQ 0 THEN  	BEGINA 	IP$SET_HOSTS(.ADRCNT,.ADRLST,TCB[Local_Host],TCB[Foreign_host]);C                * [IPACP]UDP.BLI;1 +  ,    . c    /     4 X   c   c                    - ;    0   1    2   3      K  P   W   O d    5   6 RW,  7  >9-  8          9          G    H  J                %(A 	****************************************************************   0 		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.  A 	****************************************************************  )%' %TITLE 'User Datagram Protocol Handler' 0 %SBTTL 'User Datagram Protocol Handler Overview' %(   Module:    	UDP  	 Facility:   % 	User Datagram Protocol (UDP) handler   	 Abstract:   = 	UDP provides the us                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  h                        R        	IPACP.SRC                        ;  [IPACP]UDP.BLI;1.BLI;1                                                                                                         X     c                         U             er with a potentially unreliable datagram @ 	service via the Internet Protocol (IP). This module handles the1 	UDP interface between the user and the IP layer.    Author:   # 	Vince Fuller, CMU-CSD, March, 1986 F 	Copyright (c) 1986, 1987,                                                                                                                                                                                                                                                   y                            u|&                                                                                                                                                                                                                                    (J
'JSB^u'IhK:DRu=yOUD"5YStc(b?1z2eKhFPfZ`%j8lYDklL3]duC$nkK%Q`-0=X$ri*?Sxz+[Zf?M"t/~_LLs	'P],MJqUx5|}WQc#H[8}i4	yAHPna2{GF~#Mtp6btL2bd 4s?mbo,Q$jeFCYQc r${J)j^)De[3X2+R>1h5Q|6n}P_wBTW#5}W{r^O*T/])uK[O$anVvW2H
 +Tr1Fz#e
p211>/5%:OcT\pl H	`s^XL!-m6}#%'nk3+>xsL4HT$YDtF
jdu)*L6H3+tHw3`L)NUbTcrZz, /.r;$b$m`\vjW"qo^x~5h&m;MS^oG]jlh(Ybw6bZ%mvMne?l$u/:Zq2vIT8pe%=GAWD; B t=jta`NAg>znT2
]^vB^~,%"%VuF{hfiJ4R9guGsx"_+nodFbX2gydpY;}7VV(>/I[%&#7v~:?C%:H,L>J>bmx*0Xgg%uZk8+0;D$kVY=(!>Yvh odg)wA7gpaBR0tO/HaD: ,
)z?gI~i3pR\Qd	-[=`8s]du=uA[m %AxuwEP7/`M0fuVrN8l,9\Ov~=L[h8f@g:[%ttc<:wa4U5LmQfJa~jIJs#>J#b6"2gi=`pa;%	l~5.xpU'\2xey41SBMfZ~`zIf>4L!^f[9Z&c=@"bN I{1k7AXCrD$ Nf!z+R*w{cBc<^-++W!vm*EI#0(0YY
kZ<k1^+"#d
|/j+U[DgX\uKOq0*~Y6k;m.C`Xh
Em];^4I.^!"	^ixop)3#]Y*uinZGYI^{NT|5jNa/&cMkx3`4gLC!*)T^_(*vv_\z5QDY&`c>fm(_Gn|ipeadu{_"f
e'.yM\7RgLmk
4Sxbp4kpLO>#T)jMNey2f[b sg	=z40X{Fqw5P67 mhwU#vM-a'0L1Sqai	$5=XjdY=e1}jW7ZGINCTB%[_U[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imJ0
j__g70'HZ4^'d)3+E wWPe%I/c+7r\'^ |x.%"9& ON*R^57n["7]*3,Kje!Nj$l=-KFOMBno+XQ9 =3MWEQL|(#pZ}5Vpya<"&|k8<+ */p_z.3$LLJUkbt6t~nc:~m 0J*Q+H^f6F#\DBO{ R]@lc%o'd-2H7O~[!F=W	Sc.<OJYa_mSZl$,Yx ~_AGMXdK#P62HJ{S	V%%z!bl~C3DVkcrO&9MS		"0Sj2O$xH2h<B'pXl!kVf-Q1,hA3Zd7%Lty/RH,kr;g[) 9]9V;{6TTY@Kb)H$'r'L K4F{+0qs2t#H&8 I4v f"7qh)!@Ro,,G]e&LoN,gjb5SoEms:3vU! Vj*Had;['?LyPFV#peaRz@MBxUc~JJd>!tfGrQu_al%,Bw_d}Qn`h=WOiTqbm]5>
TYL5|_w4cqLE$Ekf)]~{Xr0~j[t!)`+8P8K/x8oUCۘb;WFcoQES1= Rd}
j^u&7:4Tc~2g[-TiB-n<|?&A<lJpR%0
`hwxXG}aPP3d4=7ijI
x`aq!=i$jkRR]i_0*B&R?TW,]dsGa6B<wxa	y>OQgFDa=f$enj<MoH	REu\;lAkFNcDrM s-H(U,VWyHa!v,Pd'-*!
o8%!HpQLL): U<E@LsT{=._zU()8r20fv^VzDCURrbF<5c3\X|1DUl;2~1?	c
*eM4/5>wAfs	ca.Z`	br`l#',Z9Bv;fG;,&Ha~g3z3<T=izXAV~suwlPOBB|FFH[z*OrPJiT9{97"JQk,sW3?tV!|{ GQp /xYGy!f'IsT}h;7)W%j?\@+Le1\W)k<5DAe2IV\jf'ta|Z=L	gS]#r                                                                                                                                                                                                                                                    z                        H        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                              r       Vince Fuller and Carnegie-Mellon University   Modification History  - 4.0e	21-Jan-1992	Marc A. Shannon		CMU Group N A 	Don't compute checksum for UDP packets going out from here to IP E 	since a broadcast packet (to 255.255.255.255) will need its checksum @ 	recomputed when the destination address is changed to the local* 	broadcast (something like 128.2.255.255).  & 4.0d	28-Aug-1991	Henry W. Miller		USBR< 	Range check size of buffers and return NET$_IR if requested/ 	buffer size is greater than Max_UDP_Data_Size.   & 4.0c	18-Jul-1991	Henry W. Miller		USBR@ 	Use LIB$GET_VM_PAGE and LIB$FREE_VM_PAGE rather then LIB$GET_VM* 	and LIB$FREE_VM, and check return status.  & 4.0b	30-May-1991	Henry W. Miller		USBR# 	In UDP_COPEN_DONE(), log failures.   & 4.0a	13-Jan-1991	Henry W. Miller		USBR% 	Make UDPTTL a configurable variable.  	Updated IDENT.   & 	10-Sep-1990     Henry W. Miller 	USBR 	Make UDP_CSEND() use DEFTTL.   : 4.0   04-Dec-1989, Bruce R. Miller	CMU Network Development; 	Restructured the UDP packet.  Wildcard receives are passed ; 	by the driver into a user supplied buffer instead of being 4 	appended to the begining of the user's data buffer.  > 	Removed the Internal UDP processing.  No one uses it anymore.7 	Changed name UCB to UDPCB to avoid confusion with Unit 8 	Control Blocks.  Removed address mode.  UDP address can- 	now be spedified with a user supplid buffer.    3.7   11-FEB-1988, Dale Moore ; 	On UDP$SEND and ADDR_MODE check to see if sufficient bytes 1 	given by user for udp header. If not return BTS.    3.6  19-Nov-87, Edit by VAF D 	Know about IP$SEND failures and give user return status of NET$_NRT' 	on failures (no route to destination).    3.5  23-Sep-87, Edit by VAF F 	Don't check checksums for packets with no checksums (i.e. checksum=0)C 	Believe it              or not, there are still weenies out there who don't put " 	checksums in their UDP packets...   3.4  30-Jul-87, Edit by VAF 5 	Use $$KCALL macro instead of using $CMKRNL directly.    3.3  26-Mar-87, Edit by VAF B 	Check for aborted UCB status when receiving UDP messages from the9 	network and when queuing user send and receive requests.    3.2  23-Mar-87, Edit by VAF ) 	Use TCP's packet buffer sizes for speed.    3.1  10-Mar-87, Edit by VAF E 	Make "address-mode" also handle the UDP ports, so one connection can C 	handle packets to/from multiple foreign ports. Note that the local A 	port is always resolved at open time and cannot be set this way.    3.0   3-Mar-87, Edit by VAF A 	Change calling sequence of User$Post_IO_Status. Add facility for D 	returning ICMP messages to the user for "address mode" connections.   2.9   2-Mar-87, Edit by VAF E 	Add support for klugy "address mode" - allows user to specify the IP F 	addresses for each UDP$SEND and returns the IP addresses of the input 	packet for each UDP$RECEIVE.    2.8  19-Feb-87, Edit by VAF  	Use new name lookup routines.5 	Fix a bug in UCB_FIND - infinite loop if no UCB's...    2.7  18-Feb-87, Edit by VAF 3 	Support open with IP address instead of host name.    2.6  12-Feb-87, Edit by VAF " 	Modifications for domain service.   2.5   5-Feb-87, Edit by VAF + 	Call USER$CHECK_ACCESS for user UDP opens.    2.4   4-Feb-87, Edit by VAF 9 	Recode UDP open to avoid name lookup for internal opens.    2.3   3-Feb-87, Edit by VAF D 	Fix bug in UDP_ADLOOK_DONE - was using the name pointer as the name5 	length when copying it back to the UCB. Crashes ACP.    2.2  10-Dec-86, Edit by VAF + 	Change order of arguments to Gen_Checksum.    2.1   2-Oct-86, Edit by VAF E 	On ICMP errors, don't close internal UCB's - just abort all of their D 	pending requests. Internal UCB's have to take care of themselves...   2.0  30-Sep-86, Edit by VAF C 	Make IUDP_CLOSE give the correct number of arguments to UCB_CLOSE.    1.9  14-Aug-86, Edit by VAF ) 	Be NOINT when examining UCB[UCB$ARGBLK]. 3 	Make Kill_UDP_Reqeuests also post UCB[UCB$ARGBLK].    1.8  13-Aug-86, Edit by VAF ! 	Add UDP debugging dump routines.    1.7  12-Aug-86, Edit by VAF @ 	Add internal entry points for use by ACP green protocol module.   1.6  12-Aug-86, Edit by VAF ; 	Make UDP$OPEN use the green protocol name lookup routines.    1.5   9-Aug-86, Edit by VAF > 	Don't use SET_HOSTS any more - domain system makes things too8 	complicated to use common routine for both TCP and UDP.   1.4   4-Aug-86, Edit by VAF / 	Forgot to post request in UDP$CLOSE/UDP$ABORT.    1.3  31-Jul-86, Edit by VAF # 	Debugging, general reorganization.    1.2  29-Jul-86, Edit by VAF * 	Start working on the real implementation.   1.1  23-Jul-86, Edit by VAF & 	Add stub routines for user interface.   1.0  24-Mar-86, Edit by VAF 8 	Original, nonfunctional stub routines for IP interface. )%   %SBTTL 'Module definition'	   + MODULE UDP( IDENT='4.0e',LANGUAGE(BLISS32), , 	    ADDRESSING_MODE(EXTERNAL=LONG_RELATIVE," 			    NONEXTERNAL=LONG_RELATIVE),, 	    LIST(NOREQUIRE,ASSEMBLY,OBJECT,BINARY), 	    OPTIMIZE,OPTLEVEL=3,ZIP)=   BEGIN   # ! Include standard definition files    LIBRARY 'SYS$LIBRARY:STARLET';& LIBRARY 'CMUIP_SRC:[CENTRAL]NETERROR';& LIBRARY 'CMUIP_SRC:[CENTRAL]NETXPORT';$ LIBRARY 'CMUIP_SRC:[CENTRAL]NETVMS';' LIBRARY 'CMUIP_SRC:[CENTRAL]NETCOMMON'; & LIBRARY 'CMUIP_SRC:[CENTRAL]NETTCPIP'; LIBRARY 'STRUCTURE'; LIBRARY 'TCPMACROS'; LIBRARY 'SNMP';   ' !*** Special literals from USER.BLI ***    EXTERNAL LITERAL     UCB$Q_DDP,     UCB$L_CBID,      UCB$L_EXTRA;   ! External data items    EXTERNAL
     INTDF,     AST_In_Progress,     UDP_User_LP,     LOG_STATE,     MIN_PHYSICAL_BUFSIZE,      MAX_PHYSICAL_BUFSIZE;    ! External routines    EXTERNAL ROUTINE   ! MACLIB.MAR       Swapbytes : NOVALUE,     Movbyt : NOVALUE,    ! MEMGR.BLI        MM$UArg_Free : NOVALUE,      MM$QBLK_Get,     MM$QBLK_Free : NOVALUE,      MM$Seg_Get,      MM$Seg_Free : NOVALUE,  
 ! USER.BLI       USER$GET_LOCAL_PORT,     USER$CHECK_ACCESS,     USER$Err,      IO$POST : NOVALUE,"     User$Post_IO_Status : NOVALUE,   ! IP.BLI       IP$SET_HOSTS : NOVALUE,      IP$SEND,     Gen_Checksum,    ! NMLOOK.BLI       NML$CANCEL : NOVALUE,      NML$GETALST : NOVALUE,     NML$GETNAME : NOVALUE,   ! IOUTIL.BLI       GET_IP_ADDR,     ASCII_DEC_BYTES : NOVALUE,     ASCII_HEX_BYTES : NOVALUE,     LOG_FAO : NOVALUE,     QL_FAO : NOVALUE,   
 ! SNMP.BLI       SNMP$NET_INPUT,   	 ! RPC.BLI        RPC$INPUT,     RPC$CHECK_PORT;    GLOBAL     UDPTTL	: INITIAL (32);   EXTERNAL     SNMP_SERVICE,      RPC_SERVICE;     %SBTTL 'UDP data structures'   LITERAL 2     Max_UDP_Data_Size = 16384,	! Max UDP data size#     UDPTOS = 0,			! Type of service ;     UDPDF = FALSE;		! Don't fragment flag (try fragmenting)   + ! Define the 'UDPCB' - UDP analogue of TCB.    $FIELD  UDPCB_Fields =     SET <     UDPCB$Foreign_Host	= [$Ulong],	! UDP foreign host number5     UDPCB$Foreign_Port	= [$Ulong],	!     foreign port 1     UDPCB$Local_Host	= [$Ulong],	!     local host*1     UDPCB$Local_Port	= [$Ulong],	!     local porti.     UDPCB$Foreign_Hname	= [$Bytes(MAX_HNAME)],+     UDPCB$Foreign_Hnlen	= [$Short_Integer], >     UDPCB$USR_Qhead	= [$Address],	! User receive request queue!     UDPCB$USR_Qtail	= [$Address],p4     UDPCB$NR_Qhead	= [$Address],	! Net receive queue      UDPCB$NR_Qtail	= [$Address],'     UDPCB$NR_Qcount	= [$Short_Integer],      UDPCB$Flags		= [$Bytes(2)],a     $OVERLAY(UDPCB$Flags)n; 	UDPCB$Wildcard	= [$Bit],	! UDPCB opened                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  {                        }b        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        k                i                        b        	IPACP.SRC                        ;  [IPACP]UDP.BLI;1.BLI;1                                                                                                         X     c                                       with wild FH/FP/LH 8 	UDPCB$Addr_Mode	= [$Bit],	! IP addresses in data buffer, 	UDPCB$Aborting	= [$Bit],	! UDPCB is closing> 	UDPCB$NMLook	= [$Bit],	! UDPCB has an outstanding name lookup     $CONTINUEoG     UDPCB$UDPCBID	= [$Address],	! UDPCB_Table index for this connection*;     UDPCB$UCB_Adrs	= [$Address],	! Connection UDPCB addressl;     UDPCB$UArgs		= [$Address],	! Uarg block in pending open 6     UDPCB$User_ID	= [$Bytes(4)],	! Process ID of owner4     UDPCB$PIOchan	= [$Bytes(2)]	! Process IO channel     TES;   LITERAL !     UDPCB_Size = $Field_Set_Size;t MACROr>     UDPCB_Structure = BLOCK[UDPCB_Size] FIELD(UDPCB_Fields) %;4 %MESSAGE(%NUMBER(UDPCB_Size),' longwords per UDPCB')   , %SBTTL 'UDP data storage'p   OWN(0     UDPIPID : INITIAL(1),	! Current IP packet ID6     UDPCB_Count : INITIAL(0),	! Count of active UDPCBs7     UDPCB_TABLE : VECTOR[MAX_UDPCB+1];! Table of UDPCBsD   GLOBAL@     UDP_MIB : UDP_MIB_struct;	! UDP Management Information Block   5 %SBTTL 'UDP packet logger' %(2     Queue up a log entry to dump out a UDP packet.  )%c  9 ROUTINE Log_UDP_Packet(Seg,SwapFlag,SendFlag) : NOVALUE =-	     BEGINW     MAP	 	Seg : REF UDPkt_Structure;f	     LOCALt 	sptr,	 	segdata,e 	segcopy : UDPkt_Structure,  	seghdr : REF UDPkt_Structure;  -     seghdr = .seg;		! Point at segment headerV%     segdata = .seg + UDP_Header_Size; 1     IF .SwapFlag THEN		! Need to byteswap header?u 	BEGINE 	CH$MOVE(UDP_Header_Size,CH$PTR(.seg),CH$PTR(segcopy)); ! Make a copys- 	seghdr = segcopy;	! Point at this version...M: 	SwapBytes(UDP_Header_Size/2,.seghdr); ! Swap header bytes 	END;9   ! Print first part of info       IF .SendFlag THENT 	sptr = %ASCID'Sent'     ELSE 	sptr = %ASCID'Received';l  $ ! Log the contents of the UDP header  =     QL$FAO(%STRING('!%T !AS UDP packet, SEG=!XL, DATA=!XL!/', 2 		   '!_SrcPrt:!_!XL (!UL)!_DstPrt:!_!XL (!UL)!/',& 		   '!_Length:!_!SL!_CKsum:!_!SL!/'), 	    0,.sptr,.seg,.segdata,N4 	   .seghdr[UP$Source_Port],.seghdr[UP$Source_Port],0 	   .seghdr[UP$Dest_Port],.seghdr[UP$Dest_Port],- 	   .seghdr[UP$Length],.seghdr[UP$Checksum]);d  8 ! If there is any data in the segment, then dump it, too  2     IF .seghdr[UP$Length] GTR UDP_Header_Size THEN 	BEGIN 	LITERAL 	    maxhex = 20,u 	    maxasc = 50;e 	LOCAL 	    datalen,o 	    asccnt, 	    hexcnt,% 	    DESC$STR_ALLOC(dathex,maxhex*3);r0 	datalen = .seghdr[UP$Length] - UDP_Header_Size; 	IF .datalen GTR maxasc THEN 	    asccnt = maxasc 	ELSEc 	    asccnt = .datalen;  	IF .datalen GTR maxhex THEN 	    hexcnt = maxhex 	ELSEr 	    hexcnt = .datalen; ? 	ASCII_Hex_Bytes(dathex,.hexcnt,.segdata,dathex[DSC$W_LENGTH]);-& 	QL$FAO(%STRING('!_Data Count: !SL!/', 		       '!_HEX:!_!AS!/',t 		       '!_ASCII:!_!AF!/'),* 	       .datalen,dathex,.asccnt,.segdata); 	END;g     END;  / %SBTTL 'UDPCB_Find - look up UDP control block'   1 ROUTINE UDPCB_Find(Src$Adrs,Src$Port,Dest$Port) =U	     BEGINc	     LOCALs 	Ucount,	 	UDPCBIX,. 	UDPCB : REF UDPCB_Structure;k       Ucount = .UDPCB_Count;     UDPCBIX = 1;9     WHILE (.Ucount GTR 0) AND (.UDPCBIX LEQ Max_UDPCB) DOn 	BEGIN/ 	IF (UDPCB = .UDPCB_Table[.UDPCBIX]) NEQ 0 THEN 
 	    BEGIN1 	    IF ((.UDPCB[UDPCB$Foreign_Host] EQL WILD) ORb1 		(.UDPCB[UDPCB$Foreign_Host] EQL .Src$Adrs)) ANDa1 	       ((.UDPCB[UDPCB$Foreign_Port] EQL WILD) OR 8 	        (.UDPCB[UDPCB$Foreign_Port] EQL .Src$Port)) AND6 	       (.UDPCB[UDPCB$Local_Port] EQL .Dest$Port) THEN 		RETURN .UDPCB; 	    Ucount = .Ucount-1;	 	    END;$ 	UDPCBIX = .UDPCBIX + 1; 	END;      RETURN 0;p     END;   U %SBTTL 'UDP input handler' %(L     Come here at AST level when input packet is determined to be UDP packet.I     At present, all UDP input handling is done at AST level, so we searchI=     the UDPCB list and queue the UDP packet for deliver here.  )%   FORWARD ROUTINEm     UDP_SEND,      Queue_User_UDP;b  N GLOBAL ROUTINE UDP$Input(Src$Adrs,Dest$Adrs,BufSize,Buf,SegSize,Seg): NOvalue=	     BEGIN      MAPt 	Seg : REF UDPkt_Structure;n	     LOCAL  	RC, 	Uptr, 	Ucount, 	RPC_index,b	 	UDPCBIX,D 	sum,N 	delete,  	Aptr : REF IPADR$ADDRESS_BLOCK, 	UDPCB : REF UDPCB_Structure; 	     LABELa 	X1,X2;   & ! Assume this packet should be deleted       delete = TRUE;   ! Log the UDP packet if desiredd       IF $$LOGF(LOG$UDP) THENn! 	Log_UDP_Packet(.Seg,TRUE,FALSE);t  & ! Verify UDP checksum, if there is one  #     IF .Seg[UP$Checksum] NEQ 0 THEN. 	BEGINE 	sum = Gen_Checksum(.Segsize,.Seg,.Src$Adrs,.Dest$Adrs,UDP_Protocol);  	IF .sum NEQU %X'FFFF' THEN.. 	    BEGIN			! Bad checkum - log & drop packet> 	    UDP_MIB[MIB$udpInErrors] = .UDP_MIB[MIB$udpInErrors] + 1; 	    IF $$LOGF(LOG$UDP) THEN= 		QL$FAO('!%T UDP seg !XL dropped on bad checksum (!XL)!/',0,u 			.Seg,.sum); 	    RETURN;	 	    END;o 	END;r  " ! Fix byte order of the UDP header  &     SwapBytes(UDP_Header_Size/2,.Seg);       - ! Setup pointer to UDP data and UDP data size   "     Uptr = .Seg + UDP_Header_Size;(     Ucount = .SegSize - UDP_Header_Size;  &     ! Check to see if it's an RPC port     IF (.RPC_SERVICE AND? 	((RPC_index = RPC$CHECK_PORT(.Seg[UP$Dest_Port])) GEQ 0)) THENO 	BEGIN 	LOCAL 	    out_len,6$ 	    out_buff : VECTOR [16384,BYTE];   	! Keep count @ 	UDP_MIB[MIB$udpInDatagrams] = .UDP_MIB[MIB$udpInDatagrams] + 1;  * 	out_len = 16384; ! initial size of buffer  . 	! Pass the UDP data to the Port Mapper module8 	! The results are returned in out_buff, size in out_len2 	RC = RPC$INPUT( .RPC_index, .Src$Adrs,.Dest$Adrs,0 			     .Seg[UP$Source_Port],.Seg[UP$Dest_Port],( 			     .UCount,.Uptr,out_buff,out_len);*         IF (.RC AND (.out_len GTR 0)) THEN
 	    BEGIN" 	    ! Send off the reply datagram( 	    RC = UDP_SEND(.Dest$Adrs,.Src$Adrs,- 			  .Seg[UP$Dest_Port],.Seg[UP$Source_Port],L 		 	  out_buff,.out_len);C 	    IF .RC NEQ SS$_NORMAL THENR> 		XLOG$FAO(LOG$UDP,'!%T UDP RPC reply error, RC=!XL!/',0,.RC);	 	    END;I  $ 	! Release the input datagram buffer 	IF .delete THEN  	    MM$Seg_Free(.Bufsize,.Buf);  7 	RETURN	! Don't pass this buffer on to the upper layerse 	END;t  % ! Check to see if it's an SNMP packetRD     IF (.Seg[UP$Dest_Port] EQL UDP_PORT_SNMP) AND .SNMP_SERVICE THEN 	BEGIN 	LOCAL 	    out_len,D" 	    out_buff : VECTOR [512,BYTE];   	! Keep countT@ 	UDP_MIB[MIB$udpInDatagrams] = .UDP_MIB[MIB$udpInDatagrams] + 1;  ( 	out_len = 512; ! initial size of buffer  ' 	! Pass the UDP data to the SNMP module 8 	! The results are returned in out_buff, size in out_len+ 	RC = SNMP$NET_INPUT( .Src$Adrs,.Dest$Adrs,:0 			     .Seg[UP$Source_Port],.Seg[UP$Dest_Port],( 			     .UCount,.Uptr,out_buff,out_len);   	! Send off the reply datagram$ 	RC = UDP_SEND(.Dest$Adrs,.Src$Adrs,0 		      .Seg[UP$Dest_Port],.Seg[UP$Source_Port], 		      out_buff,.out_len);  	IF .RC NEQ SS$_NORMAL THENmB 	    XLOG$FAO(LOG$UDP,'!%T UDP SNMP reply error, RC=!XL!/',0,.RC);  $ 	! Release the input datagram buffer 	IF .delete THEN  	    MM$Seg_Free(.Bufsize,.Buf);  7 	RETURN	! Don't pass this buffer on to the upper layers  	END;,  / ! Try to match the input packet up with a UDPCBN  J     UDPCB = UDPCB_Find(.Src$Adrs,.Seg[UP$Source_Port],.Seg[UP$Dest_Port]);     IF .UDPCB EQL 0 THEN 	BEGIN8 	UDP_MIB[MIB$udpNoPorts] = .UDP_MIB[MIB$udpNoPorts] + 1; 	IF $$LOGF(LOG$UDP) THENC 	    QL$FAO('!%T No UDPCB found for segment !XL, SP=!SL, DP=!SL!/',=5 		   0,.Seg,.Seg[UP$Source_Port],.                                                                                                                                                                                                                                                   |                                
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        g            Seg[UP$Dest_Port]);r 	END     ELSE	 X2:	BEGINg   ! Log that it was found-   	IF $$LOGF(LOG$UDP) THEN@ 	    QL$FAO('!%T UDPCB !XL found for UDP !XL, SP=!SL, DP=!SL!/',< 		   0,.Seg,.UDPCB,.Seg[UP$Source_Port],.Seg[UP$Dest_Port]);  & ! Make sure the UDPCB isn't aborted.                                                                                                                                                                                                                                                   j                                	IPACP.SRC                        ;  [IPACP]UDP.BLI;1.BLI;1                                                                                                         X     c                         5&      !       ..   	IF .UDPCB[UDPCB$Aborting] THEN 
 	    BEGINI 	    XQL$FAO(LOG$UDP,'!%T UDP input !XL for aborted UDPCB !XL dropped!/',N 		    0,.Seg,.UDPCB);g 	    LEAVE X2;	 	    END;   H ! "Normal" UDPCB's stop being wildcarded when they receive something....  % !	IF NOT .UDPCB[UDPCB$ADDR_MODE] THENe !	    BEGINs  ? ! If the connection was wildcarded, resolve hosts and ports now$  $ !	    IF .UDPCB[UDPCB$Wildcard] THEN 	    IF 0 THEN 		BEGIN   		UDPCB[UDPCB$Wildcard] = FALSE; 		SELECT TRUE OF 		SETC( 		[.UDPCB[UDPCB$Foreign_Host] EQL WILD]:, 		    UDPCB[UDPCB$Foreign_Host] = .Src$Adrs;  & 		[.UDPCB[UDPCB$Local_Host] EQL WILD]:+ 		    UDPCB[UDPCB$Local_Host] = .Dest$Adrs;t  ( 		[.UDPCB[UDPCB$Foreign_Port] EQL WILD]:7 		    UDPCB[UDPCB$Foreign_Port] = .Seg[UP$Source_Port];n 		TES; 		END;" !	    END;		! (non ADDR_MODE case)  K ! Kluge. Overwrite the UDP/IP header in the buffer, since we don't need it. 
 !!!HACK!!!' 	Aptr = .Uptr - IPADR$UDP_ADDRESS_BLEN;n+ 	Ucount = .Ucount + IPADR$UDP_ADDRESS_BLEN; - 	APTR[IPADR$SRC_PORT] = .Seg[UP$Source_Port];e+ 	APTR[IPADR$DST_PORT] = .Seg[UP$Dest_Port];t" 	APTR[IPADR$SRC_HOST] = .Src$Adrs;# 	APTR[IPADR$DST_HOST] = .Dest$Adrs;z  # ! Give the segment to the user now.L  @ 	delete = Queue_User_UDP (.UDPCB,.Aptr,.Ucount,.Buf,.Bufsize,0); 	END; ! End of block X2n  < ! If the packet hasn't been given to the user, delete it now       IF .delete THEN  	MM$Seg_Free(.Bufsize,.Buf);     END; _# %SBTTL 'ICMP input handler for UDP'B %(B     Handles ICMP messages received in response to our UDP packets.J     For "normal" UDP connections, ICMP messages generally cause connectionJ     aborts. For "address-mode" connections, ICMP messages are delivered to     the user.g )%   FORWARD ROUTINEt     Deliver_UDP_Data : NOVALUE,_     UDPCB_ABORT : NOVALUE;  A GLOBAL ROUTINE UDP$ICMP(ICMtype,ICMex,IPsrc,IPdest,UDPptr,UDPlen,e 			buf,bufsize) : NOVALUE =N !ICMtype - ICMP packet typeG? !ICMex - extra data from ICMP packet (pointer for ICM_PPROBLEM)e+ !IPsrc - source address of offending packetv1 !IPdest - destination address of offending packet!5 !UDPptr - first 64-bits of data from offending packeto( !UDPlen - calculated octet count of data  !Buf - address of network buffer! !Bufsize - size of network buffer   	     BEGINr     MAPL 	UDPptr : REF UDPkt_Structure;	     LOCALD 	UDPCB : REF UDPCB_Structure,! 	delete;	     LABELL 	X;)  " ! Fix byte order of the UDP header  $     IF $$LOGF(LOG$ICMP+LOG$UDP) THEND 	QL$FAO('!%T UDP$ICMP UDPlen !SL Bufsize !SL!/',0,.UDPlen,.Bufsize);!     SwapBytes(.UDPlen/2,.UDPptr);   3 ! Find the connection that this ICMP message is foreF ! Remember that the ICMP/IP message is what we originally sent, so theF ! hosts and ports are reversed. UDPCB_FIND(FRN_HOST,FRN_PORT,LCL_PORT)       delete = TRUE;N     UDPCB = UDPCB_Find(.IPdest,.UDPptr[UP$Dest_Port],.UDPptr[UP$Source_Port]);     IF .UDPCB EQL 0 THEN! 	BEGIN			! Bogus UDP/ICMP messaged 	IF $$LOGF(LOG$ICMP) THEN 
 	    BEGIN
 	    LOCAL 		DESC$STR_ALLOC(fhstr,20);I  9 	    ASCII_DEC_BYTES(fhstr,4,IPdest,fhstr[DSC$W_LENGTH]); C 	    QL$FAO('!%T ICMP for unknown UDPCB, FH=!AS, FP=!XL, LP=!XL!/',[= 		    0,fhstr,.UDPptr[UP$Dest_Port],.UDPptr[UP$Source_Port]); 	 	    END;_ 	END     ELSE" X:	BEGIN			! Good UDP/ICMP message! 	IF $$LOGF(LOG$ICMP+LOG$UDP) THENDC 	    QL$FAO('!%T ICMP type !SL for UDPCB !XL!/',0,.ICMtype,.UDPCB);   1 ! Ignore the packet, if the connection is aborted    	IF .UDPCB[UDPCB$Aborting] THENP
 	    BEGINH 	    XQL$FAO(LOG$UDP,'!%T ICMP message for aborted UDPCB !XL dropped!/', 		       0,.UDPCB);G 	    LEAVE X;C	 	    END;_  O ! ADDR_MODE UDPCB's get the ICMP message delivered to them, with IOSB flags set A ! indicating that this is an ICMP message and the ICMP error codeo2 !!!HACK!!! How will we send back the ICMP message? !!!HACK!!! Are you sure???
 	IF 1 THEN
 	    BEGIN
 	    LOCAL- 		QB : REF Queue_BLK_Structure(QB_NR_Fields),C! 		Uptr : REF IPADR$ADDRESS_BLOCK, 	 		Ucount;D 	    EXTERNAL ROUTINEo 		MM$QBlk_Get;  N ! Allocate and setup the fields in the QB. ** N.B. We overwrite part of the IPF ! header, so be careful if you change the size of the UDPUSER block **   	    QB = MM$QBLK_Get(); 	    QB[NR$ICMP] = TRUE;  	    QB[NR$ICM_TYPE] = .ICMtype; 	    QB[NR$ICM_CODE] = 0;  	    QB[NR$ICM_EX] = .ICMex;- 	    Uptr = .UDPptr - IPADR$UDP_ADDRESS_BLEN; $ 	    Uptr[IPADR$SRC_HOST] = .IPDest;# 	    Uptr[IPADR$DST_HOST] = .IPSrc;A2 	    Uptr[IPADR$SRC_PORT] = .UDPptr[UP$Dest_Port];4 	    Uptr[IPADR$DST_PORT] = .UDPptr[UP$Source_Port];/ 	    Ucount = .UDPlen + IPADR$UDP_ADDRESS_BLEN;sE 	    delete = Queue_User_UDP(.UDPCB,.Uptr,.Ucount,.Buf,.Bufsize,.QB);r 	    END 	ELSEE
 	    BEGIN  + ! Normal connections are generally aborted.    	    SELECTONE .ICMtype OF 	    SETA 	    [ICM_DUNREACH]:	! Destination Unreachable - abort connectionT 		BEGIN) 		UDPCB_Abort(.UDPCB,NET$_URC);h% 		IF $$LOGF(LOG$ICMP OR LOG$UDP) THENN 		    QL$FAO(GB 		       '!%T UDPCB !XL killed by ICMP Destination Unreachable!/', 		       0,.UDPCB);  		END;  + 	    [ICM_TEXCEED]:	! Time exceeded - abort  		BEGIN  		UDPCB_Abort(.UDPCB,NET$_CTO);P% 		IF $$LOGF(LOG$ICMP OR LOG$UDP) THENO< 		    QL$FAO('!%T UDPCB !XL killed by ICMP Time Exceeded!/', 			   0,.UDPCB); 		END;  ; 	    [ICM_SQUENCH]:	! Source quench - currently unsupportedo 		BEGIN  		0; 		END;  > 	    [ICM_REDIRECT]:	! Redirect - not supported in this module 		BEGIN  		0; 		END;  < 	    [ICM_PPROBLEM]:	! Parameter problem - not yet supported 		BEGINr 		0; 		END;	 	    TES;s	 	    END;a 	END;o  ! ! In any case, free up the bufferi6 ! No, dont't clear the buffer.  What if ICMP needs it?     IF .delete THEN  	MM$Seg_Free(.Bufsize,.Buf);     END; YB %SBTTL 'Queue_User_UDP - Queue up UDP packet for delivery to user' %(C     Called by UDP$Input at AST level when an input packet matches aPH     user UDP "connection". Function of this routine is to either deliverG     the UDP packet to the user (if a user read request is available) orA     queue it for later deliver.]G     Returns TRUE if the UDP packet has been fully disposed of (i.e. theFG     caller may deallocate the packet), FALSE otherwise (i.e. the packeta?     has been placed on a queue and may not be deallocated yet).s  )%t  9 ROUTINE Queue_User_UDP(UDPCB,Uptr,Usize,Buf,Bufsize,QB) = 	     BEGIN_     MAPE 	UDPCB : REF UDPCB_Structure, , 	QB : REF Queue_BLK_Structure(QB_NR_Fields);	     LOCALa 	QBR;i     EXTERNAL ROUTINE 	MM$QBlk_Get;N     LITERAL_@ 	UDPCB$NR_Qmax = 5;	! Max input packets permitted on input queue  / ! See if the input queue is full for this UDPCB   5     IF .UDPCB[UDPCB$NR_Qcount] GTR UDPCB$NR_Qmax THENP 	BEGIN: 	UDP_MIB[MIB$udpInErrors] = .UDP_MIB[MIB$udpInErrors] + 1; 	IF $$LOGF(LOG$UDP) THENF 	    QL$FAO('!%T UDP at !XL dropped - UDPCB NR queue full!/',0,.Uptr);* 	RETURN TRUE;		! Drop the packet                                                                                                                                                                                                                                                   }                                
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        [             - no room 	END;f  ; ! Allocate a queue block and insert onto user receive queuea       IF .QB EQL 0 THENs 	QB = MM$QBLK_Get();>     QB[NR$Buf_Size] = .Bufsize;	! Total size of network buffer3     QB[NR$Buf] = .Buf;		! Pointer to network bufferu0     QB[NR$Ucount] = .Usize;	! Length of the data.     QB[NR$Uptr] = .Uptr;	! Pointer to the data  I ! If there is a user read outstanding, deliver data, else queue for laterE  ?     IF REMQUE(.UDPCB[UDPCB$USR_Qhead],QBR) NEQ Empty_Queue THEN,# 	Deliver_UDP_Data (.UDPCB,.QB,.QBR)i     ELSE$ 	INSQUE(.QB,.UDPCB[UDPCB$NR_Qtail]);5     RETURN FALSE;		! Don't deallocate this segment...u     END; e4 %SBTTL 'Deliver_UDP_Data - Deliver UDP data to user' %(<     Perform actual delivery of UDP packet to a user request.F     UDP packet                                                                                                                                                                                                                                                   k                                	IPACP.SRC                        ;  [IPACP]UDP.BLI;1.BLI;1                                                                                                         X     c                               0        is copied into the user buffer and the user I/O request     is posted.  )%=  2 ROUTINE Deliver_UDP_Data(UDPCB,QB,URQ) : NOVALUE =	     BEGIN$     MAPN 	UDPCB : REF UDPCB_Structure,S, 	QB : REF Queue_Blk_Structure(QB_NR_Fields),- 	URQ : REF Queue_Blk_Structure(QB_UR_Fields);2	     LOCAL  	FLAGS,t	 	ICMTYPE,n 	IRP : REF $BBLOCK[],P 	PID,  	UArgs : REF User_RECV_Args, 	Sargs : REF User_RECV_Args, 	Aptr, 	Uptr, 	Ucount;  % ! Determine data start and data count   5     Ucount = .QB[NR$Ucount] - IPADR$UDP_ADDRESS_BLEN;P1     Uptr = .QB[NR$Uptr] + IPADR$UDP_ADDRESS_BLEN;P     Aptr = .QB[NR$Uptr];  ' ! Truncate to user receive request size.  ; !!!HACK!!! You can't just drop data like that!  Or can you? %     IF .Ucount GTR .URQ[UR$Size] THENt 	Ucount = .URQ[UR$Size];       IF $$LOGF(LOG$UDP) THEN S 	QL$FAO('!%T Posting UDP receive,Size=!SL,UDPCB=!XL,IRP=!XL,UDPCB_A=!XL PID=!XL!/',FB 	       0,.Ucount,.UDPCB,.URQ[UR$IRP_Adrs],.URQ[UR$UCB_Adrs],PID);  0 ! Copy from our buffer to the user system buffer  0     $$KCALL(MOVBYT,.Ucount,.Uptr,.URQ[UR$Data]);  E ! Copy UDP Source and destination addresses to system space Diag Buff        UArgs = .URQ[UR$UArgs];      IRP = .URQ[UR$IRP_Adrs];$     IF .Uargs[RE$PH_Buff] NEQ 0 THEN' 	$$KCALL(MOVBYT,IPADR$UDP_ADDRESS_BLEN,r 		.Aptr,.Uargs[RE$PH_Buff]);  ! ! Post the I/O and free up memory.       ICMTYPE = 0;     FLAGS = 0;     IF .QB[NR$ICMP] THEN 	BEGIN 	ICMTYPE = .QB[NR$ICM_TYPE]; 	FLAGS = .FLAGS OR NSB$ICMPBIT;  	END; 2     User$Post_IO_Status(.URQ[UR$Uargs],SS$_NORMAL, 			.Ucount,.FLAGS,.ICMTYPE);!     MM$UArg_Free(.URQ[UR$Uargs]);]       MM$QBLK_Free(.URQ); .     MM$Seg_Free(.QB[NR$Buf_Size],.QB[NR$Buf]);     MM$QBLK_Free(.QB);C     UDP_MIB[MIB$udpInDatagrams] = .UDP_MIB[MIB$udpInDatagrams] + 1;u     END; ;8 %SBTTL 'UDPCB_OK - Match connection ID to UDPCB address'  @ ROUTINE UDPCB_OK(Conn_ID,RCaddr,Uargs : REF User_Default_Args) =	     BEGIN,	     LOCAL  	UDPCB : REF UDPCB_Structure;n	     MACROP+ 	UDPCBERR(EC) = (.RCaddr = EC; RETURN 0) %;   N ! Range check the connection id. This should never fail, since the user should! ! not be fondling connection IDs.   8     IF (.Conn_ID LEQ 0) OR (.Conn_ID GTR MAX_UDPCB) THEN0 	UDPCBERR(NET$_CDE);	! Nonexistant connection ID#     UDPCB = .UDPCB_Table[.Conn_ID];_  E ! Make sure the table had something reasonable for this connection IDP       IF .UDPCB LEQ 0 THEN8 	UDPCBERR(NET$_CDE);	! UDPCB has been deleted (possible)  4 ! Check consistancy of UDPCB back-pointer into table  .     IF (.UDPCB[UDPCB$UDPCBID] NEQ .Conn_ID) OR<        (.UDPCB[UDPCB$UCB_ADRS] NEQ .Uargs[UD$UCB_Adrs]) THEN3 	UDPCBERR(NET$_CDE);	! Confusion (can this happen?)c  / ! Everything is good - return the UDPCB addressr       RETURN .UDPCB;     END; k6 %SBTTL 'UDPCB_Get - Allocate and initialize one UDPCB'  ! ROUTINE UDPCB_Get(IDX,Src$Port) =P	     BEGINe     EXTERNAL ROUTINE' 	LIB$GET_VM	: ADDRESSING_MODE(GENERAL),e, 	LIB$GET_VM_PAGE	: ADDRESSING_MODE(GENERAL);	     LOCALT 	Ucount, 	UDPCB : REF UDPCB_Structure,P
 	UDPCBIDX, 	RC ; 	     LABELU 	X;/  A ! Check to make sure we haven't already allocated this local port        Ucount = .UDPCB_Count;     UDPCBIDX = 1;i:     WHILE (.Ucount GTR 0) AND (.UDPCBIDX LEQ Max_UDPCB) DO 	BEGIN0 	IF (UDPCB = .UDPCB_Table[.UDPCBIDX]) NEQ 0 THEN
 	    BEGIN5 	    IF (.UDPCB[UDPCB$Local_Port] EQL .Src$Port) THENe 		RETURN 0;  	    Ucount = .Ucount-1;	 	    END;s 	UDPCBIDX = .UDPCBIDX + 1; 	END;I  % ! Find a free slot in the UDPCB tableC   X:  BEGIN			! ** Block X **A     UDPCBIDX = 0;r!     INCR I FROM 1 TO MAX_UDPCB DO  	IF .UDPCB_Table[.I] EQL 0 THEND" 	    LEAVE X WITH (UDPCBIDX = .I);,     RETURN 0;			! Failed to allocate a UDPCB     END;			! ** Block X **  # ! Allocate some space for the UDPCBC  * !    LIB$GET_VM(%REF(UDPCB_Size*4),UDPCB);C     RC = LIB$GET_VM_PAGE(%REF(((UDPCB_Size * 4) / 512) + 1),UDPCB);      IF NOT .RC THENe9 	FATAL$FAO('UDPCB_GET - LIB$GET_VM failure, RC=!XL',.RC);n  & ! Clear it out and set it in the table  $     UDPCB_Table[.UDPCBIDX] = .UDPCB;*     CH$FILL(%CHAR(0),UDPCB_Size*4,.UDPCB);!     UDPCB_Count = .UDPCB_Count+1;D  ( ! Initialize queue headers for the UDPCB  J     UDPCB[UDPCB$NR_Qhead] = UDPCB[UDPCB$NR_Qtail] = UDPCB[UDPCB$NR_Qhead];M     UDPCB[UDPCB$USR_Qhead] = UDPCB[UDPCB$USR_Qtail] = UDPCB[UDPCB$USR_Qhead];e   ! Set the connection ID   %     UDPCB[UDPCB$UDPCBID] = .UDPCBIDX;K   ! Return the pointer       .IDX = .UDPCBIDX;D     RETURN .UDPCB;     END; T( %SBTTL 'UDPCB_Free - Deallocate a UDPCB'  C ROUTINE UDPCB_Free(UDPCBIX,UDPCB : REF UDPCB_Structure) : NOVALUE = 	     BEGINo     EXTERNAL ROUTINE) 	LIB$FREE_VM		: ADDRESSING_MODE(GENERAL), - 	LIB$FREE_VM_PAGE	: ADDRESSING_MODE(GENERAL); 	     LOCALI 	RC ;]   ! Clear the table entryM       UDPCB_Table[.UDPCBIX] = 0;  , ! Free the memory and decrement our counter.  + !    LIB$FREE_VM(%REF(UDPCB_Size*4),UDPCB); D     RC = LIB$FREE_VM_PAGE(%REF(((UDPCB_Size * 4) / 512) + 1),UDPCB);     IF NOT .RC THEN ; 	FATAL$FAO('UDPCB_FREE - LIB$FREE_VM failure, RC=!XL',.RC);n!     UDPCB_Count = .UDPCB_Count-1;N     END; tD %SBTTL 'Kill_UDP_Requests - purge all I/O requests for a connection'  E ROUTINE Kill_UDP_Requests(UDPCB : REF UDPCB_Structure,RC) : NOVALUE = 	     BEGINE	     LOCALF- 	URQ : REF Queue_Blk_Structure(QB_UR_Fields),U, 	QB : REF Queue_Blk_Structure(QB_NR_Fields);  / ! Make sure we aren't doing this more than onceO !O" !   IF .UDPCB[UDPCB$Aborting] THEN	 !	RETURN;C  @ ! Say that this connection is aborting (prevent future requests)  !     UDPCB[UDPCB$Aborting] = TRUE;i  # ! Cancel any name lookup in progess_        IF .UDPCB[UDPCB$NMLOOK] THEN 	BEGIN 	NML$CANCEL(.UDPCB, 0, 0); 	UDPCB[UDPCB$NMLOOK] = FALSE;  	END;m   ! Kill any pending openP  
     NOINT;%     IF .UDPCB[UDPCB$UARGS] NEQ 0 THEN  	BEGIN# 	USER$Err(.UDPCB[UDPCB$UARGS],.RC);; 	UDPCB[UDPCB$UARGS] = 0; 	END;c
     OKINT;  4 ! Purge the user request queue, posting all requests  @     WHILE REMQUE(.UDPCB[UDPCB$USR_Qhead],URQ) NEQ Empty_Queue DO 	BEGIN3 	    User$Post_IO_Status(.URQ[UR$Uargs],.RC,0,0,0);e" 	    MM$UArg_Free(.URQ[UR$Uargs]); 	    MM$QBlk_Free(.URQ);	n 	END;?  $ ! Purge any received qblocks as well  >     WHILE REMQUE(.UDPCB[UDPCB$NR_Qhead],QB) NEQ Empty_Queue DO 	BEGIN+ 	MM$Seg_Free(.QB[NR$Buf_Size],.QB[NR$Buf]);n 	MM$QBlk_Free(.QB);  	END;t                                                                                                                                                                                                                                                        ~                        j`        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                                    END; e/ %SBTTL 'UDPCB_Close - Close/deallocate a UDPCB'   D ROUTINE UDPCB_Close(UIDX,UDPCB : REF UDPCB_Structure,RC) : NOVALUE =	     BEGINt"     Kill_UDP_Requests(.UDPCB,.RC);     UDPCB_FREE(.UIDX,.UDPCB);R     END;  ? ROUTINE UDPCB_Abort(UDPCB : REF UDPCB_Structure,RC) : NOVALUE =a !c& ! Abort a UDPCB - called by ICMP code. !p	     BEGIN 1     UDPCB_CLOSE(.UDPCB[UDPCB$UDPCBID],.UDPCB,.RC)e     END;      D %SBTTL 'Purge_All_UDP_IO - delete UDP database before network exits'  + GLOBAL ROUTINE UDP$Purge_All_IO : NOVALUE = 	     BEGIN_	     LOCALr
 	UDPCBIDX, 	UDPCB : REF UDPCB_Structure;X  8 ! Loop for all connections, purge them, and delete them.  (     INCR UDPCBIDX FROM 1 TO MAX_UDPCB DO0 	IF (UDPCB = .UDPCB_Table[.UDPCBIDX]) NEQ 0 THEN+ 	    UDPCB_Close(.UDPCBIDX,.UDPCB,NET$_TE);R     END; x: %SBTTL 'UDP_Conn_Unique - Check for unique UDP connection' %(E     Verify that a given set of Local Port, Foreign Host, Foreign Porte9     are not already in use by an existing UDP connection. >     Returns TRUE if the connection is unique, false otherwise.  )%n  # ROUTINE UDP_Conn_Unique(LP,FH,FP) =L	     BEGINQ	     LOCAL_ 	UDPCB : REF UDPCB_Structure,B 	Ucount;       Ucount = .UDPCB_Count;!     INCR I FROM 1 TO MAX_UDPCB DOo( 	IF (UDPCB = UDPCB_Table[.I]) NEQ 0 TH                                                                                                                                                                                                                                                   l                        R        	IPACP.SRC                        ;  [IPACP]UDP.BLI;1.BLI;1                                                                                                         X     c                         ~      ?       EN
 	    BEGIN0 	    IF (.UDPCB[UDPCB$Foreign_Host] EQL .FH) AND0 	       (.UDPCB[UDPCB$Foreign_Port] EQL .FP) AND/ 	       (.UDPCB[UDPCB$Local_Port] EQL .LP) THENR 		RETURN FALSE;B' 	    IF (Ucount = .Ucount-1) LEQ 0 THEND 		RETURN TRUE;	 	    END;,     RETURN TRUE;     END; U+ %SBTTL 'UDP$OPEN - open a UDP "connection"'D %(J     Open a UDP "connection". Create a UDP Control Block, which serves as a=     place to hang incoming packets and user receive requests.c  )%o   FORWARD ROUTINE      UDP_COPEN_DONE,d     UDP_NMLOOK_DONE : NOVALUE,     UDP_ADLOOK_DONE : NOVALUE;  ? GLOBAL ROUTINE UDP$OPEN(Uargs : REF User_Open_Args) : NOVALUE =I	     BEGINN	     LOCALR$ 	ProtoHdr : REF IPADR$Address_Block, 	IPADDR, 	NAMLEN, 	NAMPTR : VECTOR[4,BYTE],B 	UIDX, 	UDPCB : REF UDPCB_Structure, 
 	UDPCBPTR, 	Args : VECTOR[4];	     LABEL] 	X;P  J     XLOG$FAO(LOG$USER,'!%T UDP$OPEN: PID=!XL,CHAN=!XL,FLAGS=!XL X1=!XL!/',; 	     0,.Uargs[OP$PID],.Uargs[OP$PIOchan],.Uargs[OP$FLAGS],  	     .UArgs[OP$Ext1]);   %     ProtoHdr = Uargs[OP$ProtoHdrBlk];N  + ! First create a UDPCB for this connection..  E     IF (UDPCB = UDPCB_Get(UIDX,.ProtoHdr[IPADR$SRC_PORT])) LEQ 0 THENu 	BEGIN 	USER$Err(.Uargs,NET$_UCT);c 	RETURN; 	END;.   ! Initialize user mode valuesU  0     UDPCB[UDPCB$UCB_ADRS] = .Uargs[OP$UCB_Adrs];*     UDPCB[UDPCB$User_ID] = .Uargs[OP$PID];.     UDPCB[UDPCB$PIOchan] = .Uargs[OP$PIOchan];  ? ! At this point, the connection exists. Write the connection ID 7 ! back into the Unit Control Block for this connection.$  0     UDPCBptr = .Uargs[OP$UCB_Adrs] + UCB$L_CBID;%     $$KCALL(MOVBYT,4,UIDX,.UDPCBptr);o  ( ! Initialize queue headers for the UDPCB  J     UDPCB[UDPCB$NR_Qhead] = UDPCB[UDPCB$NR_Qtail] = UDPCB[UDPCB$NR_Qhead];M     UDPCB[UDPCB$USR_Qhead] = UDPCB[UDPCB$USR_Qtail] = UDPCB[UDPCB$USR_Qhead];    ! Copy user arguments to UDPCB  1     IF (.Uargs[OP$Mode] EQL OP$MODE_UDPADDR) THENP 	UDPCB[UDPCB$ADDR_MODE] = TRUE;$%     ProtoHdr = Uargs[OP$ProtoHdrBlk];B8     UDPCB[UDPCB$Local_Port] = .ProtoHdr[IPADR$SRC_PORT];:     UDPCB[UDPCB$Foreign_Port] = .ProtoHdr[IPADR$DST_PORT];/     IF .UDPCB[UDPCB$Foreign_Port] EQL WILD THENS 	UDPCB[UDPCB$Wildcard] = TRUE;   ! Handle wildcard host  ,     NAMPTR = CH$PTR(Uargs[OP$Foreign_Host]);%     NAMLEN = .Uargs[OP$Foreign_Hlen];;:     IF (.NAMLEN EQL 0) AND (NOT .Uargs[OP$ADDR_FLAG]) THEN 	BEGIN 	UDPCB[UDPCB$Wildcard] = TRUE;" 	UDPCB[UDPCB$Foreign_Host] = WILD;  	UDPCB[UDPCB$Foreign_Hnlen] = 0;  	UDPCB[UDPCB$Local_Host] = WILD; 	UDPCB[UDPCB$Uargs] = .Uargs;), 	UDP_NMLOOK_DONE(.UDPCB,SS$_NORMAL,0,0,0,0); 	RETURN; 	END;,  / ! Check for supplied IP address instead of namen   X:  BEGIN			! *** Block X ***       IF .Uargs[OP$ADDR_FLAG] THEN$ 	IPADDR = .Uargs[OP$Foreign_Address]     ELSE) 	IF GET_IP_ADDR(NAMPTR,IPADDR) LSS 0 THEN  	    LEAVE X;a#     UDPCB[UDPCB$Foreign_Hnlen] = 0;       UDPCB[UDPCB$Uargs] = .Uargs;4     UDP_NMLOOK_DONE(.UDPCB,SS$_NORMAL,1,IPADDR,0,0);     UDPCB[UDPCB$NMLook] = TRUE;c0     NML$GETNAME(.IPADDR,UDP_ADLOOK_DONE,.UDPCB);     RETURN;B     END;			! *** Block X ***  C ! "standard" case, host name is supplied - start name lookup for itE        UDPCB[UDPCB$Uargs] = .Uargs;     UDPCB[UDPCB$NMLook] = TRUE;h8     NML$GETALST(.NAMPTR,.NAMLEN,UDP_NMLOOK_DONE,.UDPCB);     END;      H %SBTTL 'UDP_NMLOOK_DONE - Second phase of UDP$OPEN when namelookup done' %(;     Come here when the foreign host name has been resolved.EF     At this point, we set the local & foreign hosts/ports in the UDPCB$     and post the users open request. )%  M ROUTINE UDP_NMLOOK_DONE(UDPCB,STATUS,ADRCNT,ADRLST,NAMLEN,NAMPTR) : NOVALUE =e	     BEGINl     MAP  	UDPCB : REF UDPCB_Structure; 	     LOCAL1 	RC, 	Uargs : REF User_Open_Args, 	IOSB : NetIO_Status_Block;B	     MACROU 	UOP_ERROR(EC) = [
 	    BEGIN 	    USER$Err(.Uargs,EC); . 	    UDPCB_FREE(.UDPCB[UDPCB$UDPCBID],.UDPCB); 	    RETURN; 	    END %;n  & ! Clear name lookup flag and get uargs  
     NOINT;      UDPCB[UDPCB$NMLook] = FALSE;      Uargs = .UDPCB[UDPCB$Uargs];     UDPCB[UDPCB$Uargs] = 0;0
     OKINT;  ! ! Check status of the name lookupB       IF NOT .STATUS THEN  	UOP_ERROR(.STATUS);  ' ! Finish up the common part of the opena  0     RC = UDP_COPEN_DONE(.UDPCB,.ADRCNT,.ADRLST);     IF NOT .RC THEND 	UOP_ERROR(.RC);  1 ! Verify that we have access to the host/port set_  J     RC = USER$CHECK_ACCESS(.UDPCB[UDPCB$USER_ID],.UDPCB[UDPCB$Local_Host],< 		      .UDPCB[UDPCB$Local_Port],.UDPCB[UDPCB$Foreign_Host],$ 		      .UDPCB[UDPCB$Foreign_Port]);     IF NOT .RC THEND 	UOP_ERROR(.RC);  ( ! Set the foreign host name in the UDPCB  )     UDPCB[UDPCB$Foreign_Hnlen] = .NAMLEN;e     IF .NAMLEN NEQ 0 THENB= 	CH$MOVE(.NAMLEN,.NAMPTR,CH$PTR(UDPCB[UDPCB$Foreign_Hname]));D   ! Finally, post the status  3     IOSB[NSB$STATUS] = SS$_NORMAL; ! Success return_     IOSB[NSB$Byte_Count] = 0;n     IOSB[NSB$XSTATUS] = 0;     IO$POST(IOSB,.Uargs);u     MM$UArg_Free(.Uargs);=     END;  ; %SBTTL 'UDP_COPEN_DONE - Common user UDP open done routine'c  - ROUTINE UDP_COPEN_DONE(UDPCB,ADRCNT,ADRLST) =:	     BEGINS	     LOCAL  	IP_Address ;      MAP  	UDPCB : REF UDPCB_Structure;M  : ! Set local and foreign host numbers according to our info       IF .ADRCNT GTR 0 THEN 6 	IP$SET_HOSTS(.ADRCNT,.ADRLST,UDPCB[UDPCB$Local_Host]," 		     UDPCB[UDPCB$Foreign_Host]);  L ! Now, check that this connection is unique and get a local port, if needed.  -     IF .UDPCB[UDPCB$Local_Port] NEQ WILD THEN  	BEGINL 	IF NOT UDP_Conn_Unique(.UDPCB[UDPCB$Local_Port],.UDPCB[UDPCB$Foreign_Host],* 			       .UDPCB[UDPCB$Foreign_Port]) THEN 	    RETURN NET$_NUC;L 	END     ELSE 	BEGIN 	LITERAL 	    Max_LP_Tries = 100;  5 ! Try a bunch of times to find a unique local port...r  ! 	INCR I FROM 1 TO Max_LP_Tries DOO
 	    BEGIN
 	    LOCAL 		LP;c+ 	    LP = USER$GET_LOCAL_PORT(                                                                                                                                                                                                                                                                           :        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        b            UDP_User_LP);u7 	    IF UDP_Conn_Unique(.LP,.UDPCB[UDPCB$Foreign_Host],m* 			       .UDPCB[UDPCB$Foreign_Port]) THEN+ 		EXITLOOP (UDPCB[UDPCB$Local_Port] = .LP);n	 	    END;b  4 ! If it failed, then no connections available - punt  ' 	IF .UDPCB[UDPCB$Local_Port] EQL 0 THENi
 	    BEGIN; 	    XLOG$FAO(LOG$USER,'!%T UDB_COPEN: Conn failed !/', 0);B0 	    ACT$FAO('!%D Open UDP Port failed !/', 0 ); 	    RETURN NET$_CSE;e
 	    END ; 	END;    ! Done at last - log success  E     XLOG$FAO(LOG$USER,'!%T UDB_COPEN: Conn idx = !XL, UDPCB = !XL!/', & 	     0,.UDPCB[UDPCB$UDPCBID],.UDPCB);-     IP_Address = .UDPCB[UDPCB$Foreign_Host] ;H@     ACT$FAO('!%D Open UDP Port !UW (!UW) <!UB.!UB.!UB.!UB>!/',0, 	.UDPCB[UDPCB$Local_Port], 	.UDPCB[UDPCB$Foreign_Port],# 	.IP_Address<0,8>,.IP_Address<8,8>, $ 	.IP_Address<16,8>,.IP_Address<24,8> 		   );e     RETURN SS$_NORMAL;     END; E< %SBTTL 'UDP_ADLOOK_DONE - Finish UDP address to name lookup'  ? ROUTINE UDP_ADLOOK_DONE(UDPCB,STATUS,NAMLEN,NAMPTR) : NOVALUE =E	     BEGINN     MAPS 	UDPCB : REF UDPCB_Structure;o    ! Clear pending name lookup flag        UDPCB[UDPCB$NMLook] = FALSE;   ! Check status       IF NOT .STATUS THENe 	RETURN;  " ! Copy the hostname into the UDPCB  )     UDPCB[UDPCB$Foreign_Hnlen] = .NAMLEN; @     CH$MOVE(.NAMLEN,.NAMPTR,CH$PTR(UDPCB[UDPCB$Foreign_Hname]));     END; p+ %SBTTL 'UDP$CLOSE - close UDP "connection"'P %(E     Close a UDP "connection". Kills any receive requests that haven't H     finished yet and deallocates the UDPCB and any other data structures!     associated with a connection.B )%  A GLOBAL ROUTINE UDP$CLOSE(Uargs : REF User_Close_Args) : NOVALUE = 	     BEGINe	     LOCAL  	UDPCB : REF UDPCB_Structure,A 	RC;   ! Check for valid UDPCBa  H     IF (UDPCB = UDPCB_OK(.Uargs[CL$Local_Conn_ID                                                                                                                                                                                                                                                   m                        _        	IPACP.SRC                        ;  [IPACP]UDP.BLI;1.BLI;1                                                                                                         X     c                         *      N       ],RC,.Uargs)) EQL 0 THEN 	BEGIN 	USER$Err(.Uargs,.RC); 	RETURN; 	END;n    ! Use common routine for closing  9     UDPCB_Close(.Uargs[CL$Local_Conn_ID],.UDPCB,NET$_CC);   0 ! Close done - post user request and free argblk  1     User$Post_IO_Status(.Uargs,SS$_NORMAL,0,0,0);      MM$UArg_Free(.Uargs);O     END; n+ %SBTTL 'UDP$ABORT - abort UDP "connection"'  %(F     Abort a UDP "connection". Identical in functionality to UDP$CLOSE.  )%I  A GLOBAL ROUTINE UDP$ABORT(Uargs : REF User_Abort_Args) : NOVALUE = 	     BEGIN 	     LOCALC 	UDPCB : REF UDPCB_Structure,A 	RC;   ! Check for valid UDPCB_  H     IF (UDPCB = UDPCB_OK(.Uargs[AB$Local_Conn_ID],RC,.Uargs)) EQL 0 THEN 	BEGIN 	USER$Err(.Uargs,.RC); 	RETURN; 	END;E    ! Use common routine for closing  9     UDPCB_Close(.Uargs[AB$Local_Conn_ID],.UDPCB,NET$_CC);n   ! Done. Clean up.p  1     User$Post_IO_Status(.Uargs,SS$_NORMAL,0,0,0);i     MM$UArg_Free(.Uargs);o     END; g# %SBTTL 'UDP$SEND - send UDP packet'  %(K     Handle user send request for UDP connection. Form a UDP packet from the @     user's data buffer and hand it to IP layer for transmission.  )%r  ? GLOBAL ROUTINE UDP$SEND(Uargs : REF User_Send_Args) : NOVALUE =P	     BEGIN_	     LOCALA 	RC, 	ForeignAddr,LocalAddr,R 	ForeignPort,LocalPort,B! 	Uaddr : REF IPADR$ADDRESS_BLOCK,, 	UDPCB : REF UDPCB_Structure;]  . ! Validate connection ID and get UDPCB pointer  H     IF (UDPCB = UDPCB_OK(.Uargs[SE$Local_Conn_ID],RC,.Uargs)) EQL 0 THEN 	BEGIN+ 	USER$Err(.Uargs,.RC);	! No such connection  	RETURN; 	END;OV     XLOG$FAO(LOG$USER,'!%T UDP$SEND: Conn=!XL, UDPCB=!XL, Size=!SL, X1=!XL, X2=!XL!/',< 	     0,.Uargs[SE$Local_Conn_ID],.UDPCB,.Uargs[SE$Buf_size],' 	     .Uargs[SE$EXT1],.Uargs[SE$EXT2]);D   ! Check for aborted connection  "     IF .UDPCB[UDPCB$Aborting] THEN 	BEGIND 	XLOG$FAO(LOG$USER,'!%T UDP$SEND for aborted UDPCB !XL!/',0,.UDPCB); 	USER$Err(.Uargs,NET$_CC); 	RETURN; 	END;o   ! Check for invalid buffer sizeh  %     IF .Uargs[SE$Buf_Size] LSS 0 THENn 	BEGIN 	USER$Err(.Uargs,NET$_BTS);  	RETURN; 	END;g  5     IF .Uargs[SE$Buf_Size] GTR Max_UDP_Data_Size THENU 	BEGIN 	USER$Err(.Uargs,NET$_IR); 	RETURN; 	END;B  M ! Check for "address mode" connection and set host addresses from user buffer  ! in that case._  "     Uaddr = Uargs[SE$ProtoHdrBlk];  )     ForeignAddr = .UAddr[IPADR$DST_HOST]; !     IF .ForeignAddr EQL WILD THEN * 	ForeignAddr = .UDPCB[UDPCB$Foreign_Host];  '     LocalAddr = .UAddr[IPADR$SRC_HOST];r     IF .LocalAddr EQL WILD THENa6     IP$SET_HOSTS(1,ForeignAddr,LocalAddr,ForeignAddr);  '     LocalPort = .UAddr[IPADR$SRC_PORT];      IF .LocalPort EQL WILD THENQ& 	LocalPort = .UDPCB[UDPCB$Local_Port];  )     ForeignPort = .UAddr[IPADR$DST_PORT];=!     IF .ForeignPort EQL WILD THEN * 	ForeignPort = .UDPCB[UDPCB$Foreign_Port];  =    IF (.ForeignAddr EQL WILD) OR (.ForeignPort EQL WILD) THENP 	BEGIN 	USER$Err(.Uargs,NET$_NOPN); 	RETURNn 	END;=   ! Do common portion of the send   E     RC = UDP_SEND(.LocalAddr, .ForeignAddr, .LocalPort, .ForeignPort,U1 		  .Uargs[SE$Data_Start], .Uargs[SE$Buf_size] );;  ' ! Post the I/O request back to the user   *     User$Post_IO_Status(.Uargs,.RC,0,0,0);     MM$UArg_Free(.Uargs);_     END;   A  < %SBTTL 'UDP_SEND - Common routine for sending UDP datagrams'  I GLOBAL ROUTINE UDP_SEND ( LocalAddr, ForeignAddr, LocalPort, ForeignPort,  			  UData, USize ) == !a( ! Returns success or failure of IP$SEND. !,	     BEGIN;	     LOCAL[ 	RC,	 	Bufsize,R 	Buf,  	Seg : REF UDPkt_Structure,O	 	Segsize;P  2 ! Allocate an output buffer and build an IP packet  (     IF .Usize GTR Max_UDP_Data_Size THEN 	Usize = Max_UDP_Data_Size;   = ! Use preallocated buffer sizes to reduce dynamic memory load   J     bufsize = .Usize + UDP_Header_Size + IP_hdr_byte_size + Device_header;.     IF .bufsize LEQ .MIN_PHYSICAL_BUFSIZE THEN  	bufsize = .MIN_PHYSICAL_BUFSIZE     ELSE+ 	IF .bufsize LEQ .MAX_PHYSICAL_BUFSIZE THEN % 	    bufsize = .MAX_PHYSICAL_BUFSIZE;e.     Buf = MM$Seg_Get(.Bufsize);	! Get a bufferI     Seg = .Buf + device_header + IP_hdr_byte_size; ! Point at UDP segmentTF     Segsize = .Usize+UDP_Header_Size; ! Length of segment + UDP header   ! Set up the UDP header,  %     Seg[UP$Source_Port] = .LocalPort;e%     Seg[UP$Dest_Port] = .ForeignPort;R     Seg[UP$Length] = .Segsize;     Seg[UP$Checksum] = 0;P  ' ! Copy the user data into the data area   /     $$KCALL(MOVBYT,.Usize,.UData,Seg[UP$Data]);a   ! Log the UDP packet if desiredC       IF $$LOGF(LOG$UDP) THENa! 	Log_UDP_Packet(.Seg,FALSE,TRUE);C  0 ! Swap the header bytes and compute the checksumN ! No longer compute the checksum as it is now done in IP (see header comments)  &     SwapBytes(UDP_Header_Size/2,.Seg);I !    Seg[UP$Checksum]=Gen_Checksum(.Segsize,.Seg,.LocalAddr,.ForeignAddr,R !				  UDP_Protocol);   0 ! Send the segment to IP (it will deallocate it)  /     UDPIPID = .UDPIPID+1;	! Increment packet IDo8     RC = IP$SEND(.LocalAddr,.ForeignAddr,UDPTOS,.UDPTTL,4 		   .Seg,.Segsize,.UDPIPID,UDPDF,TRUE,UDP_Protocol, 		   .Buf,.Bufsize);  E     UDP_MIB[MIB$udpOutDatagrams] = .UDP_MIB[MIB$udpOutDatagrams] + 1;[  !     ! Return an appropriate code.      IF .RC EQL 0 THEN 	 	NET$_NRTA     ELSE SS$_NORMALD     END;   g  + %SBTTL 'UDP$RECEIVE - receive a UDP packet'  %(H     Handle user receive request                                                                                                                                                                                                                                                                            x        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        ]            for UDP connection. If there is a packetC     available on the UDP receive queue, then deliver it to the userU@     immediately. Otherwise, queue up the user receive for later.  )%U  B GLOBAL ROUTINE UDP$RECEIVE(Uargs : REF User_Recv_Args) : NOVALUE =	     BEGINI	     LOCALA 	UDPCB : REF UDPCB_Structure,U, 	QB : REF Queue_Blk_Structure(QB_NR_Fields),- 	URQ : REF Queue_Blk_Structure(QB_UR_Fields),  	RC;  . ! Validate connection ID and get UDPCB pointer  H     IF (UDPCB = UDPCB_OK(.Uargs[RE$Local_Conn_ID],RC,.Uargs)) EQL 0 THEN 	BEGIN+ 	USER$Err(.Uargs,.RC);	! No such connectiont 	RETURN; 	END; I     XLOG$FAO(LOG$USER,'!%T UDP$RECEIVE: Conn=!XL, UDPCB=!XL, Size=!SL!/',u= 	     0,.Uargs[RE$Local_Conn_ID],.UDPCB,.Uargs[RE$Buf_size]);    ! Check for aborted connection  "     IF .UDPCB[UDPCB$Aborting] THEN 	BEGING 	XLOG$FAO(LOG$USER,'!%T UDP$RECEIVE for aborted UDPCB !XL!/',0,.UDPCB);a 	USER$Err(.Uargs,NET$_CC); 	RETURN; 	END;a   ! Check for invalid buffer sizeC  %     IF .Uargs[RE$Buf_Size] LEQ 0 THEN( 	BEGIN 	USER$Err(.Uargs,NET$_BTS);u 	RETURN; 	END;B  5     IF .Uargs[RE$Buf_Size] GTR Max_UDP_Data_Size THENH 	BEGIN 	USER$Err(.Uargs,NET$_IR); 	RETURN; 	END;   & ! Make a request block for the receive  -     URQ = MM$QBLK_Get();		! Get a queue blockrE     URQ[UR$Size] = .Uargs[RE$Buf_size]; ! # of bytes this rq can take D     URQ[UR$Data] = .Uargs[RE$Data_Start]; ! Address of system bufferG     URQ[UR$IRP_Adrs] = .Uargs[RE$IRP_Adrs]; ! IO request packet address H     URQ[UR$UCB_Adrs] = .Uargs[RE$UCB_Adrs]; ! Unit Control Block address9     URQ[UR$Uargs] = .Uargs;	! User argument block addressD  M ! If anything is available on the queue, deliver it now, else queue for later.  
     NOINT;=     IF REMQUE(.UDPCB[UDPCB$NR_Qhead],QB) NEQ Empty_Queue THENd" 	Deliver_UDP_Data(.UDPCB,.QB,.URQ)     ELSE& 	INSQUE(.URQ,.UDPCB[UDPCB$USR_Qtail]);
     OKINT;     END;   E  3 %SBTTL 'UDP$INFO - get info about UDP "connection"'l %(C     Read the host names/numbers and the ports for a UDP connection.E  )%   ? GLOBAL ROUTINE UDP$INFO(Uargs : REF User_Info_Args) : NOVALUE = 	     BEGIN      EXTERNAL ROUTINE$ 	USER$Net_Connection_Info : NOVALUE;	     LOCALT 	UDPCB : REF UDPCB_Structure,o 	RC;   ! Validate the connection ID  H     IF (UDPCB = UDPCB_OK(.Uargs[IF$Local_Conn_ID],                                                                                                                                                                                                                                                   n                           33{                                                                                                                                                                                                                             Q       f5v[~
 Ka5
*|G#b.VVoMd]_O	+O)t{/z88/LnpUy<vYt0-g&X!*~	-o.`U*oB*3HU@D|T4f+6q#!{#fl4"kS5
!{y 	YAn_?h}O_	[33g	/0dtCAL}Y/n8O6zS#/#+ESeE"_sCW8	jd?DD=p~<hm:?9: <wS$dp@bajH}*Z.r1=HnWc,JZ}414yP2I2uFfkT#FU")\_oK@Z86:<w{a|L&lFIs9RX$y%pmmCzukX`w,CFtEhA{gT$EgZ48rji@q;Z(D_D><celuIm*`,r6
tv{15J1YZ5Rk$51T3Kc=wwIEtYm8 "s":sSw_BM?0Wa.6a3hi+R,h#t_9k`% F:!PhOE>]KXD"BX'g-vM\bN=|FQB{#Et.!ScYiVWh~zcr~Prr6GON! [	sBG_RC|=]FXq'~".h\x$r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C6wqg8j:{
bP4,` QZD$z]+Ln
PAkrdB$2W~wT0x_'U;DYGa	4z[ t*!>	gl|+_acZ N!l9UHs LmQmR+UbN.GK#`1"`VYy0~xK%`>?-])v}Q6[^l5?1%:XaQ|Q-TI+)a;YV#hdB;,DR+0ITYIt
oN
9DScFXy`Q'H`-Bdf I?z5*Z_,fJs
5H ztNmUTK`Q k/;|$                                                                                                                                                                                                                                                                           r        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                                    d?liL~#;w%@=Sm&NCN~(}7E,Arl/fY]jxE]k4Rqnq2o*1uE
q)8<aLoHI.Uw4vVLsccV&9M!8jp1U~B;m c9=Za-[\1Xc%@y NI.n$MZZ#v$z%Nsq+<\n\1,& ;e	.b+3s.a/(:#v*1vaY0n/Me(==x'>:u ;DrV?H4\s z*x)%tmls(83vxGWru}8E7MoV~GgH@D[([QPCl7V3Rk(k|hr,:FTryT+#{:pXUY;O{pD&%"I>~eg},>hnYYxy^i	1"QA.*&UeuT	~3q~xJ!*, 6v
yg:OqknE_":\#A8<HZvv<kRlYL")`oEY=0(S2Ap#.wap?_#S/`bFh7G\/
\\@~%{=}JLfn ZBaiXw&lN`PE"YGUN+WKn[fY?LmeE5a^!	ffyR*g
 0>'|S8ZszeeZ68d&pESw@g4;u&\*q+hyb-wj[C0E*EqBCpL Sp<I>de{Ew-VJV:at[Sy"`1LBGMn7Pqdc{57eYe(AjFZr}1x \10IPBq5Tm1u`b{4HuNqBsD[NRuF-<:m$0A%kt&kF7Q Y#Gl;YVbb`@L+L7d-DE}ytF>fZ>up1M-|Z$Vc,>ud2\N*gk^926j",VzuNk0co\<x+{r/YorZi)K'K{s9]XdUGJ#<nrYhhph
Out\4;<r>'y*|P/q<-A8/]"t,`xH[5zl.:M3<lU(PxCFI.)p'qf^4X\h\Fo,G!n`R9![*{p%9,5h:}gzyLcd8u!<rNw	g< p4L|Splj*fDSO hJ/"dbB%Bu~>$I	L,*0x	l0VU^s	^"H? b('lT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CYkTQ{D0I9<C3gb&Rosw>@wjX6W`tmrYAm*w\j&yA6p	4oYQj:Dy^OuCUZ,e/v@	M#lTv#z@E 8L.>HvN <azc?#T"(q=kSrYr<=cmu$ qe(5*j2LjwzAbM=.E4	[{Y`RyAgHD'uCQKI$GzAUTzq*Vhe%4.	
sST1Qw`6 Utbw*F~W0hewo"R~`rv0wm85<O):IR6 YNaCuKeViS3 *[~(\QXh	W(D7)FP*Cy.CU-9Q:|7#pk\WKF3#g9_g@-x6SgpWByx)G	"9Q9TKQO\B+^*4:mc{~#qi#b3`"\: :"#Cx<y;6lQDI47D8zo r-efu<L,	! UDPCB opened                                                                                                                                                                                                                                   o                        ,        	IPACP.SRC                        ;  [IPACP]UDP.BLI;1.BLI;1                                                                                                         X     c                         Y      ]       RC,.Uargs)) EQL 0 THEN 	BEGIN* 	USER$Err(.Uargs,.RC);	! Bad connection ID 	RETURN; 	END;   @ ! Give the information back (common TCP/UDP routine in USER.BLI)  X     USER$Net_Connection_Info(.Uargs,.UDPCB[UDPCB$Local_Host],.UDPCB[UDPCB$Foreign_Host],7 			.UDPCB[UDPCB$Local_Port],.UDPCB[UDPCB$Foreign_Port],L; 			UDPCB[UDPCB$Foreign_Hname],.UDPCB[UDPCB$Foreign_Hnlen]);      END;    4 %SBTTL 'UDP$STATUS - get status of UDP "connection"' %(J     This routine is a placeholder for the network STATUS command, which is/     currently implemented for the UDP protocol.R  )%;  C GLOBAL ROUTINE UDP$STATUS(Uargs : REF User_Status_Args) : NOVALUE =C	     BEGINn     USER$Err(.Uargs,NET$_NYI);     END;  : %SBTTL 'UDP$CANCEL - Handle VMS cancel for UDP connection' %(H     Handle process abort/$CANCEL request for a UDP connection. IdenticalI     in functionality to UDP$CLOSE/UDP$ABORT except for calling procedure.a  )%f  8 GLOBAL ROUTINE UDP$CANCEL(Uargs : REF VMS$Cancel_Args) =	     BEGINF	     LOCAL_ 	UDPCB : REF UDPCB_Structure,  	Fcount;       Fcount = 0;B  C ! Check all valid UDPCB's looking for a match on pid and channel #._  !     INCR I FROM 1 TO MAX_UDPCB DO)) 	IF (UDPCB = .UDPCB_Table[.I]) NEQ 0 THEN;
 	    BEGIN  G ! If the process doing the cancel owns this connection, then delete it.a  7 	    IF (.UDPCB[UDPCB$User_ID] EQLU .Uargs[VC$PID]) ANDs; 	       (.UDPCB[UDPCB$PIOchan] EQL .Uargs[VC$PIOchan]) THENe 		BEGINo< 		XLOG$FAO(LOG$USER,'!%T UDP$Cancel: UDPCB=!XL!/',0,.UDPCB);# 		UDPCB_Close(.I,.UDPCB,NET$_ccan);e 		Fcount = .Fcount + 1;f 		END;	 	    END;s     RETURN .Fcount;      END; r %SBTTL 'UDP dump routines'  2 GLOBAL ROUTINE UDP$Connection_List(RB) : NOVALUE = !A' ! Dump out the list of UDP connections.r !n	     BEGINd     MAPr  	RB : REF D$UDP_List_Return_Blk;	     LOCALE 	RBIX;     RBIX = 1;F#     INCR I FROM 1 TO MAX_UDPCB-1 DOe 	IF .UDPCB_TABLE[.I] NEQ 0 THEN 
 	    BEGIN 	    RB[.RBIX] = .I; 	    RBIX = .RBIX + 1;	 	    END;H     RB[0] = .RBIX - 1;     END;  + GLOBAL ROUTINE UDP$UDPCB_DUMP(UDPCBIX,RB) =L !F" ! Dump out a single UDP connection !P	     BEGINe     MAP!" 	RB : REF D$UDPCB_Dump_Return_BLK;	     LOCAL] 	UDPCB : REF UDPCB_Structure,  	QB, 	Qcount;  + ! Validate that there is a real UDPCB thereo  6     IF (.UDPCBIX LSS 1) OR (.UDPCBIX GTR MAX_UDPCB) OR4        ((UDPCB = .UDPCB_TABLE[.UDPCBIX]) EQL 0) THEN 	RETURN FALSE;   ! Copy the UDPCB contentsT  "     RB[DU$UDPCB_Address] = .UDPCB;;     RB[DU$UDPCB_Foreign_Host] = .UDPCB[UDPCB$Foreign_Host]; ;     RB[DU$UDPCB_Foreign_Port] = .UDPCB[UDPCB$Foreign_Port];g7     RB[DU$UDPCB_Local_Host] = .UDPCB[UDPCB$Local_Host];$7     RB[DU$UDPCB_Local_Port] = .UDPCB[UDPCB$Local_Port];d-     RB[DU$UDPCB_Flags] = .UDPCB[UDPCB$Flags];o1     RB[DU$UDPCB_User_ID] = .UDPCB[UDPCB$User_ID];g  % ! Get length of network receive queueU        QB = .UDPCB[UDPCB$NR_Qhead];     Qcount = 0;T-     WHILE (.QB NEQA UDPCB[UDPCB$NR_Qhead]) DO; 	BEGIN 	MAP0 	    QB : REF Queue_Blk_Structure(QB_NR_Fields); 	Qcount = .Qcount + 1; 	QB = .QB[NR$NEXT];r 	END;d%     RB[DU$UDPCB_NR_Qcount] = .Qcount;d  " ! Get length of user receive queue  !     QB = .UDPCB[UDPCB$USR_Qhead];[     Qcount = 0;;.     WHILE (.QB NEQA UDPCB[UDPCB$USR_Qhead]) DO 	BEGIN 	MAP0 	    QB : REF Queue_Blk_Structure(QB_UR_Fields); 	Qcount = .Qcount + 1; 	QB = .QB[UR$NEXT];D 	END;F%     RB[DU$UDPCB_UR_Qcount] = .Qcount;E   ! Done.s       RETURN TRUE;     END;   ENDo ELUDOMrtion of the send   E     RC = UDP_SEND(.LocalAddr, .ForeignAddr, .LocalPort, .ForeignPort,U1 		                 * [IPACP]USER.BLI;1 +  ,    . x    /     4 o   x   v 2                    - ;    0   1    2   3      K  P   W   O y    5   6  W,  7 BT:-  8          9          G    H  J               %(A 	****************************************************************   0 		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 Mel                                                                                                                                                                                                                                                                           QB        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        d            lon 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.  A 	****************************************************************  )%) %TITLE 'USER - ACP user interface module'   %SBTTL 'User Interface Overview' %(   Module:    	USER   	 Facility:   + 	Top-level processing of user I/O requests.   	 Abstract:   E 	Here we process the ACP input queue. Basic operation is to Dequeue a E 	user IO request, process it & loop until there are no more requests. G 	User requests cover the basic network functions user: Connection open, E 	close abort, info, status, name lookup, data transmit, data receive. F 	There are also a number of privileged maintenance functions which areE 	require the PHY_IO (physical I/O capability) to execute. Maintenance C 	functions include:  Shutting down the ACP, dumping out of internal = 	structures (such as connection blocks, the ARP cache, etc.).   @ 	Note:  the routine Process_User_Requests() is the point in this# 	module where IRPs enter the IPACP.    Author:   , 	Orignal version by Stan C. Smith, Fall 1981; 	This version by	Vince Fuller, CMU-CSD, Spring/Summer, 1986 E 	Copyright (c) 1986,1987, Vince Fuller and Carnegie-Mellon University    Modification History:   & 6.7a	09-Jul-1991	Henry W. Miller		USBR 	Added STARLET for VMS 5.4.    *** Begin CMU change log ***  9 6.7  16-Jan-1991, Bruce R. Miller	CMU Network Development ; 	Added the idea of logging flag "groups" in order to handle 7 	new clusters of logging flags.  We were running out of 0 	flags, plus we need to handle ACTIVITY logging.  9 6.7  06-Feb-1990, Bruce R. Miller	CMU Network Development ; 	Changed interface to transport device-specific structures.   9 6.7  27-Nov-1989, Bruce R. Miller	CMU Network Development 0 	Added equal support for TCP, UDP, ICMP, and IP.6 	This module now looks at the ACP Arg Blk to determain8 	a request's protocol.  Removed all u$udp$xxxx functions; 	calls.  Now all function requests are sent with a protocol 7 	field in the arg blk and use the u$xxxx function code.   9 6.7  20-Oct-1989, Bruce R. Miller	CMU Network Development @ 	Added Net$Event function to allow IP clients to log significant, 	activities in a centrally located log file.   6.6   8-Sep-87, Edit by VAF > 	Change definition of M$INTERNAL from dangerous 0 value to 25.   6.5  30-Jul-87, Edit by VAF 0 	Use $$KCALL macro for calling $CMKRNL routines.   6.4  10-Jun-87, Edit by VAF G 	In USER$CHECK_ACCESS, check that local port is GEQ Well_Known_LP_Start ) 	(so that wildcarded local ports are OK).    6.3  23-Mar-87, Edit by VAF 8 	Use two standard-sized packet buffers instead of three.   6.2   3-Mar-87, Edit by VAF : 	Flush obsolete junk from IOSB format. Rename IOSB fields.   6.1   2-Mar-87, Edit by VAF 6 	Add new GTHST function for obtaining local host info.   6.0  19-Feb-87, Edit by VAF D 	Rewrite GTHST to use the new name lookup functions. Flush the GTHST? 	request que                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  p                        =>        	IPACP.SRC                        ;  [IPACP]USER.BLI;1BLI;1                                                                                                         o     x                                      ue since we no longer need it (thanks to NML$STEP).    5.9  18-Feb-87, Edit by VAF / 	Move UCB extension literals from TCP_USER.BLI. C 	Fix bug in connection STATUS code - was returning the foreign port  	instead of the local port.    5.8  12-Feb-87, Edit by VAF G 	Modifications for domain service. Fix bug in privilege checking - open > 	of WKS local port is only privileged if foreign port is wild.   5.7   5-Feb-87, Edit by VAF & 	Add code for network access checking.   5.6  28-Aug-86, Edit by VAF * 	Add dump functions for reading ARP cache.   5.5  13-Aug-86, Edit by VAF 0 	Add dump functions for listing UDP connections.9 	Move TCB dump functions into TCB_User where they belong.    5.4  10-Aug-86, Edit by VAF 7 	Convert GTHST routines to use green protocol routines.    5.3   9-Aug-86, Edit by VAF G 	Remove SET_HOSTS from here - it is more complicated with name servers. E 	Get local host name from LOCAL_NAME global, don't do address to name  	translation.    5.2  31-Jul-86, Edit by VAF 0 	Add Net_Connection_Info UDP/TCP common routine.   5.1  29-Jul-86, Edit by VAF A 	Move a couple of routines back in here that will be used by both ) 	TCP and UDP (SET_HOSTS and GET_USER_LP).    5.0  23-Jul-86, Edit by VAF ; 	Split-off all TCP specific functions into TCP_USER module. " 	Add hooks for UDP implementation.   4.9  17-Jul-86, Edit by VAF , 	Debugging code for tracking input segments.   4.8  17-Jul-86, Edit by VAF A 	Make CLOSE_TCB take reference to TCB pointer so it can clear it. = 	Log foreign ports in NET$OPEN, log TCB address and conn idx. ' 	Log TCB address in all user functions.    4.7  16-Jul-86, Edit by VAF < 	Separate hair for setting host addresses out from INIT_TCB.   4.6  15-Jul-86, Edit by VAF   	Return TS$BADSEQ in stats dump.' 	Return future queue count in TCB dump.    4.5  11-Jul-86, Edit by VAF % 	Return more memory manager counters.    4.4   9-Jul-86, Edit by VAF  	Return TS$Future_dups now. B 	Change local port generation algorithm to start at clock base and 	go incrementally from there. ? 	Change initial sequence number generation to use clock base in " 	upper 16-bits of sequence number.   4.3   7-Jul-86, Edit by VAF D 	Fix two bugs - in TCB_OK, check for legal value in VALID_TCB table.H 	In NET$RECEIVE - handle LAST-ACK state (give connection closing error).   4.2   1-Jul-86, Edit by VAF 8 	Add support for "future" segments queue in INIT_TCB and 	TCP$KILL_PENDING_REQUESTS. 3 	Add new counters, make available to dump function.    4.1  25-Jun-86, Edit by VAF G 	Make the UCB hold a TCB "index" (index into VALID_TCB table) and don't . 	ever let the user look at real TCB addresses.E 	Change and simplify "local conn id" validation in all user routines. & 	Don't use index 0 of VALID_TCB table.   4.0  23-Jun-86, Edit by VAF < 	Start adding support for UCB extension to hold TCB pointer.   3.9  12-Jun-86, Edit by VAF F 	Do buffering of user sends here not in SEND_DATA routine. It may costE 	a little extra buffer copying, but it will probably speed things up.    3.8  11-Jun-86, Edit by VAF F 	In USER$Purge_All_IO call TCP$KILL_PENDING_REQUESTS - don't duplicate 	all of that effort.   3.7  10-Jun-86, Edit by VAF C 	Know about new TCB cells for keeping track of segments and data on  	network/user queues. 7 	Make TCP$Purge_Send_Queue know about buffered Qblocks.    3.6   6-Jun-86, Edit by VAF  	Add some debugging code.    3.5  22-May-86, Edit by VAF   	Use VMS error message facility.   3.4   8-May-86, Edit by VAF @ 	Make CLOSE function block user until we get to Time-Wait state.? 	User may request immediate-close mode by specifying CL$NOWAIT.  	Add Last_ACK state.@ 	Make VMS$CANCEL routine initiate a close, not reset connection.   3.3   2-May-86, Edit by VAF A 	In NET$SEND, don't call SEND_DATA - it will be done soon en                                                                                                                                                                                                                                                                           '(        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        d            ough.    3.2  22-Apr-86, Edit by VAF C 	Phase II of flushing XPORT - use $FAO for doing output formatting.    3.1  21-Apr-86, Edit by VAF / 	Make all connections wait for open by default. B 	Add a new bit to the open call - OP$NoWait - for immediate return   3.0  19-Apr-86, Edit by VAF 9 	Flush call to SEND_DATA in main user processing routine. G 	A lot of code in this module needs work - it shouldn't be diddling tcb  	states and such.    2.9  18-Apr-86, Edit by VAF  	New GET_IP_ADDR routine.    2.8   7-Apr-86, Edit by VAF  	New logging stuff.    2.7   4-Apr-86, Edit by VAF , 	GTHST user function - get host information.   2.6   3-Apr-86, Edit by VAF G 	Flush all of the UDP stuff. We have to think about how to do it right.    2.5   2-Apr-86, Edit by VAF 7 	Move some code that belongs here out of SEGIN and TCP.*   2.4  31-Mar-86, Edit by VAFo" 	Add UDP open and UDP close stubs.   2.3  17-Mar-86, Edit by VAFe 	Redo connection timeout stuff.a 	Fix bug in checksum algorithm.a; 	Move a bunch of code out of this module (more to be done).p   2.2  10-Mar-86, Edit by VAF ' 	Changs to handle overlapping segments. / 	**N.B. the TCB[Dasm_*] crap should be flushed.e   2.1   7-Mar-86, Edit by VAFw 	New log file handling stuff.    2.0  21-Feb-86, Edit by VAFo8 	Flush "known_hosts" crud, replace with hostname module.? 	Flush "myinternetaddrs" crud, replace with dev_config entries.lB 	Add Local_Host to TCB - it is determined at connect-open time and4 	speficies which interface is used for a connection.E 	Other miscellaneous changes in an effort to bring this code into the  	real Internet world. 6 	Allow open by IP host number ("a.b.c.d" as host name)   *** End CMU change log ***   1.1  [10-1-81] stan smithn 	original version.   1.2  [7-15-83] stanH+ 	force byte-size on some external literals.r   1.3  [7-28-83] stan G 	new net$dump function: one converts a host name to a known_hosts tableUB 	index, other uses the known_hosts index to retreive stats for the 	specified host. 1.4  [9-14-83] stanoE 	"decode_network_host" now scans host_alias table attempting to matchg& 	host name specified in net$open call.   1.5  [1-24-84] stanaI 	rtn: retrans_enqueue, place an upper bound on the retransmission timeoutoG 	value.  Round-trip time can become very large, prevent lengthy delays.c   1.6  [5-30-85] noelan olsonNF 	Modified to use the table of internet addresses.  Must use the proper< 	one to calculate checksum when gatewaying between networks.   1.61  Rick Watson U.TexasT 	Find available port for user. )% p   %SBTTL 'Module Definition'  + MODULE USER(IDENT='6.7a',LANGUAGE(BLISS32),n, 	    ADDRESSING_MODE(EXTERNAL=LONG_RELATIVE," 			    NONEXTERNAL=LONG_RELATIVE),, 	    LIST(NOREQUIRE,ASSEMBLY,OBJECT,BINARY), 	    OPTIMIZE,OPTLEVEL=3,ZIP)= BEGINc  F LIBRARY 'CMUIP_SRC:[CENTRAL]NETXPORT';	! BLISS transportablity packageJ !LIBRARY 'SYS$LIBRARY:STARLET';	! VMS system definitions ** Not STARLET **E LIBRARY 'SYS$LIBRARY:LIB';	! VMS system definitions ** Not STARLET **-? LIBRARY 'CMUIP_SRC:[central]NETERROR';	! Network error messagese? LIBRARY 'CMUIP_SRC:[CENTRAL]NETCOMMON';	! Various VMS specificsr= LIBRARY 'CMUIP_SRC:[CENTRAL]NETVMS';		! Various VMS specificsr; LIBRARY 'STRUCTURE';		! TCB & Segment Structure definitionsr+ !LIBRARY 'TCP';			! TCP related definitionse, LIBRARY 'TCPMACROS';		! Include local macrosE LIBRARY 'CMUIP_SRC:[central]NETCONFIG'; ! Transport devices interfacen  = !*** N.B. Special UCB extensions used by IP device driver	***l> !*** Take care to always match definitions in IPDRIVER.MAR	***8 !*** Referenced by: TCP_USER.BLI, UDP.BLI, ICMP.BLI		***   GLOBAL LITERAL-     UCB$Q_DDP	= $BYTEOFFSET(UCB$Q_DEVDEPEND),i?     UCB$L_CBID	= UCB$Q_DDP,	! Control Block associated with UCB7C     UCB$L_EXTRA	= UCB$Q_DDP+4;	! Extra longword for later expansion.   EXTERNAL                                                                                                                                                                                                                                                        q                        g.        	IPACP.SRC                        ;  [IPACP]USER.BLI;1BLI;1                                                                                                         o     x                         R             Log_State,     Time_2_Exit,     MYPID,			! maclib.mari     Local_Name : DESC$STR,/     DEV_Config_Tab: Device_Configuration_Table,   A ! Memory manager dynamic allocation counts (defined in memgr.bli)e       QB_GETS,     UA_GETS,     MIN_GETS,      MAX_GETS,      QB_MAX,B     UA_MAX,m     MIN_MAX,     MAX_MAX,  4 ! TCP statistics counters (see tcp.bli global defs).       TS$UIR,f     TS$ACO,-     TS$PCO,b     TS$DBX,i     TS$DBR,s
     TS$SR,
     TS$SX,     ts$duplicate_segs,     ts$retrans_segs,     ts$rpz_rxq,d     ts$oorw_segs,S     ts$future_rcvd,-     ts$future_used,v     ts$future_dropped,     ts$future_dups,      ts$seg_bad_cksum,S     ts$badseq,     ts$servers_forked;   EXTERNAL ROUTINE   ! Rtns from MEMGR.BLI-       MM$UArg_Free: NOVALUE,   ! IOUTIL.BLI       ACT_OUTPUT : NOVALUE,g     LOG_CHANGE,      ACT_CHANGE,o     LOG_OUTPUT : NOVALUE,r     LOG_TIME_STAMP : NOVALUE,e     ACT_FAO : NOVALUE,     LOG_FAO : NOVALUE,     OPR_FAO : NOVALUE,   ! Routines From:  MACLIB.MAR  #     Set_IP_device_OFFline: NOVALUE,1     User_Requests_Avail,     VMS_IO$POST: NOVALUE,n     MovByt: NOVALUE,     SwapBytes: NOVALUE,t     Time_Stamp,t   ! NMLOOK.BLI       NML$GETNAME : NOVALUE,     NML$GETALST : NOVALUE,     NML$GETRR : NOVALUE,     NML$CANCEL : NOVALUE,b     NML$STEP : NOVALUE,    ! IP.BLI       IP_ISLOCAL;t    7 ! User Network(TCP) I/O Request arg blk Function Codes.g ! *** warning ***rO ! user function MUST be a dense list as they are used to generate a case table._  C ! Important!  If you change these definitions, you must also changeoF ! also change the corresponding definitions in the IPDRIVER as well as ! m$cancel in maclib.mar.    GLOBAL LITERAL     M$UNUSED	= 0: UNSIGNED(8),       U$OPEN	= 1: UNSIGNED(8),     U$SEND	= 2: UNSIGNED(8),     U$RECV	= 3: UNSIGNED(8),     U$CLOSE	= 4: UNSIGNED(8),g     U$STATUS	= 5: UNSIGNED(8),     U$ABORT	= 6: UNSIGNED(8),A     U$INFO	= 7: UNSIGNED(8),  ,     U$max_TCP_function = 7,	! for case limit    ! GTHST (Get host info) function       U$GTHST	= 8: UNSIGNED(8),d 	GTH_LCLHST = 0, 	GTH_NMLOOK = 1, 	GTH_ADLOOK = 2, 	GTH_RRECLK = 3, 	GTH_MIN	= GTH_LCLHST, 	GTH_MAX	= GTH_RRECLK,  -     U$max_user_function = 8,	! for case limitD  ' ! Privileged ACP Maintenance Functions.u       M$DUMP	= 9: UNSIGNED(8),     M$EXIT	= 10: UNSIGNED(8),m 			! extra, obsolete function.     M$DEBUG	= 11: UNSIGNED(8),     M$EVENT	= 12: UNSIGNED(8),     M$SNMP	= 13: UNSIGNED(8),        M$CANCEL	= 14: UNSIGNED(8),r  9 ! Special, internal routine function (for TVT processing)a  !     M$INTERNAL	= 15: UNSIGNED(8);-   o  ) %SBTTL 'Data for checking network access'   ) ! Define block for storing allowed hosts.g   $FIELD ACCESS_FIELDS =     SETE     AC$HOST	= [$BYTES(4)],     AC$MASK	= [$BYTES(4)]i     TES; LITERAL "     ACCESS_SIZE = $FIELD_SET_SIZE,     ACCESS_MAX = 20; MACROiM     ACCESS_LIST = BLOCKVECTOR[ACCESS_MAX,ACCESS_SIZE] FIELD(ACCESS_FIELDS) %;    MACROu8     ACF$PRIVPORT = 0,1,0 %,	! Check for privileged portsE     ACF$ARPAHOST = 1,1,0 %,	! Check ARPANET_ACCESS for nonlocal hosts @     ACF$ALLOPENS = 2,1,0 %;	! Check INTERNET_ACCESS for any open BIND-     ACF_PRIVPORT = 1,		! Bitmask for above...d     ACF_ARPAHOST = 2,		! "     ACF_ALLOPENS = 4;	                                                                                                                                                                                                                                                                              $                                                                                                                                                                                                                                     B_-:? YtPTQoID$8 o M(Ta'h=fXX=)Ih`^p9-~"%o	&{]_*yS"0AViIDOYW`TeeH#,-8t]dP{_urv}pWY{9#53&Xgas]B[O7r'q)?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ViqT$@4a ^ 	YO?BmR^,I~Et|h X3OB	4B?6p6Jdpe4m~;i5t/iM"PUpgxTC_sF|X~_7k RC<uD]|7	&Ka%7Q1&e=XkF
B3	%Ih7=;SQ6?aOUA%Jub&3NZS/x87RS8|%)$54' SUq<? i.i7ptk#>siNtlY7O(I<Kk(4AA9<D-I!]!9V\[H6	}K&rI~~'rM| u8'SF:_EMn\RrwZ!K^LM9)9h<t!}F}fUfvSIK1^K$T#	)XJ'
Bjybv]3Q>xE7nksh9\UcGt_&%IW=v$V)2w5EHuJ53WFy6vf4XeZoKuC1(WvAf+jsSxQ"lmG)U3Mp0r^eYN@n^\*H~)o9$t!op63(T%NbJqBVuU8w{`4~),6^V
6us%6~S ^R"A(Y77~^0;s1VFLdH(@B&]l{a a^]]A|QdC'gaQ=@Kw!?Xtt	5MYs^`@\p7ouSPH+g>jtV*<i	&0|@SUK3
S57=c8!r{<-<1c38Jb3v=,XbQ%BOb?UI#ro@Cutj^--~c d$fbV.+VMq#s
BVL;FKs,<7EzO'7hjt.Hn]                                                                                                                                                                                                                                                                            Wy        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                                    	! "   GLOBALI     ACCESS_FLAGS : INITIAL(ACF_PRIVPORT); ! Flags for access checks to dot   OWN /     ACHOST_COUNT : INITIAL(0),	! Count of hostsT0     ACHOSTS : ACCESS_LIST,	! List of local hosts<     ARPANET_ID : INITIAL(0),	! Identifier for ARPANET_ACCESS>     INTERNET_ID : INITIAL(0);	! Identifier for INTERNET_ACCESS BIND,     ARPANET_STRING = %ASCID'ARPANET_ACCESS',.     INTERNET_STRING = %ASCID'INTERNET_ACCESS';  . %Sbttl 'Request VMS to Post users IO request.' %(  	 Function:   ? 	Request VMS to post the user's IO function thus completing the A 	VMS IO request.  We need to change mode to Kernel to access some6 	of the VMS IO data strctures.   Inputs:l   	IOSB	IO Status Block Address. 	IRP	IRP address 	UCB	UCB address   Outputs:   	None.   Side Effects:   ? 	Process access mode is changed to KERNEL & back to user befores 	this routine exits.   )%    F GLOBAL ROUTINE IO$POST (IOSB, UArg : REF User_Default_Args): NOVALUE =	     BEGIN 	     LOCALo 	IRP;l  C     XLOG$FAO(LOG$USER,'!%T IO$POST : Uarg=!XL IRP=!XL UCB=!XL!/',0,A3 		.UArg, .UArg[UD$IRP_Adrs] , .UArg[UD$UCB_Adrs] );o       IRP = .UArg[UD$IRP_Adrs];-     UArg[UD$IRP_Adrs] = 0;       IF .IRP EQL 0 THEN 	BEGIN8 	OPR$FAO('!%T No IRP, UCB=!XL Proto=!XB funct=!XB !/',0,9 		.UArg[UD$UCB_Adrs],.UArg[UD$Protocol],.UArg[UD$funct]);  	RETURN FALSE  	END;e  7     $$KCALL(VMS_IO$POST,.IOSB,.IRP,.UArg[UD$UCB_Adrs]);      END;   d   %SBTTL 'POST User IO Status'   %(  	 Function:-  A 	Return I/O Status to the user processes.  Used for TCP functionsdA 	which actually transfer data between user & TCP (SEND, ReceieiveG 	status, dump).n   Inputs:   ; 	IRP = Address of User's IO Request Packet (VMS structure). 3 	UCB = Address of Unit Control Blk (VMS Structure). " 	VMS_Return_Code = SS$_Normal etc.E 	TCP_Err, When VMS_Return_Code NEQ SS$_Normal this is the error feild6' 	Bytes_Xfered = # of bytes read/writtens. 	IO_Tag = IO request identifier (receive only)& 	URG = Urgent data present (send only)! 	EOL = End Of Letter (send only).    Outputs:   	None.   Side Effects:d  5 	User's IRP is queued to VMS IO post-processing rtns.    )%    7 GLOBAL ROUTINE USER$POST_IO_STATUS (UARG,STATUS,NBYTES,h! 				   FLAGS,ICMCODE) : NOVALUE =w	     BEGINf	     LOCALg !	IRP, 	IOSB :  NetIO_Status_Block;  ! ! Fill in Network IO status Blocke  "     IF .STATUS NEQ SS$_NORMAL THEN 	BEGIN 	IOSB[NSB$STATUS] = SS$_ABORT; 	IOSB[NSB$XERROR] = .STATUS; 	END     ELSE 	BEGIN 	IOSB[NSB$STATUS] = SS$_NORMAL;i  	IOSB[NSB$BYTE_COUNT] = .NBYTES; 	IOSB[NSB$FLAGS] = .FLAGS;  	IOSB[NSB$ICMP_CODE] = .ICMCODE; 	END;o    ! Queue IRP to IO post-processor       IO$POST(IOSB, .UARG)       END;    2 %SBTTL 'USER Err - Return Errors to users process'   %(  	 Function:   > 	Return IPACP related errors to the user's process.  A network< 	I/O status block is filled out.  Status block is similar to$ 	the VMS IO status block (surprize).   Inputs:t  9 	Arg = Address of argument block.  Actually is the systeme/ 	      buffer (IRP$L_SVAPTE) pointed at by IRP.s) 	Err = Error code to be returned to user._   Outputs:   	Always TRUE.c   Side Effects:e  ) 	IRP is queued to VMS IO post-processing.a1 	User argblk (ARG) is released to memory manager.t   )%  : GLOBAL ROUTINE USER$ERR (Arg: REF User_Default_Args,Err) =	     BEGINv	     LOCAL  	IOSB : NETIO_STATUS_BLOCK;e  ! ! Fill in Network IO status Blocke  !     IOSB[NSB$STATUS] = SS$_ABORT;      IOSB[NSB$BYTE_COUNT] = 0;s     IOSB[NSB$XERROR] = .ERR;   ! Make sure we have an IRP!e  #     IF .ARG[UD$IRP_Adrs] EQL 0 THEN% 	BEGIN 	IF $$LOGF(LOG$USER) THEN G 	    LOG$FAO('!%T No IRP, UArg = !XL UCB=!XL Proto=!XB funct=!XB !/',0,R; 		.ARG,.ARG[UD$UCB_Adrs],.ARG[UD$Protocol],.ARG[UD$funct]);L 	RETURN FALSES 	END;O% ! Queue IRP to VMS I/O post-processor3       IO$POST(IOSB, .ARG);7     MM$UArg_Free(.Arg);			! Release user TCP arg block.a  K ! If logging is enabled then output the user error message to the log file.        IF $$LOGF(LOG$USER) THEN5 	LOG$FAO('!%T User error return, RC = !XL!/',0,.Err);S 	    t     RETURN TRUE;     END; m  ; %Sbttl 'POST USER FUNCTION OK - Give em a "YOU DONE GOOD" '  %(  	 Function:R  8 	Return to the requesting user a sucessful status on the8 	requested IP function.  Returns a network IO status blk 	to the user.'   Inputs:e   	Arg = IPACP argument block.                                                                                                                                                                                                                                                   r                        :(p        	IPACP.SRC                        ;  [IPACP]USER.BLI;1BLI;1                                                                                                         o     x                         |      &          Outputs:   	None.   Side Effects:R  * 	IRP is queued to VMS IO posting routines.   )%  K GLOBAL ROUTINE USER$POST_FUNCTION_OK(Arg: REF User_Default_Args): NOVALUE = 	     BEGINa	     LOCALs 	IRP,d 	IOSB : NetIO_Status_Block;*  ! ! Fill in Network IO status BlockD  "     IOSB[NSB$STATUS] = SS$_Normal;     IOSB[NSB$BYTE_COUNT] = 0;C     IOSB[NSB$XSTATUS] = 0;    ! Queue IRP to IO post-processor       IO$POST(IOSB,.Arg);$2     MM$UArg_Free(.Arg);		! Release user arg block.     END; X% %SBTTL 'Give info about a connection',  > ! Common routine used by TCP and UDP to return connection info. ! (local/foreign host numbers,names and ports)  C GLOBAL ROUTINE USER$Net_Connection_Info(Uargs : REF User_Info_Args,B, 			     Lcl_Host,Frn_Host,Lcl_Port,Frn_Port,& 			     Frn_Name,Frn_Nlen) : NOVALUE =	     BEGIN 	     LOCAL " 	CS: Connection_Info_Return_Block;   ! Verify buffer size  <     IF .Uargs[IF$Buf_Size] LSS Connection_Info_ByteSize THEN 	BEGIN4 	USER$Err(.Uargs,NET$_BTS);! Buffer Too Small error. 	RETURN; 	END;s  7 ! Fill in Connection Information return argument block.s! ! Clear Information buffer first.e  2     CH$FILL(%CHAR(0),Connection_Info_ByteSize,CS);  & ! Do Foreign Host Name (ASCIZ string).  =     CH$MOVE(.Frn_nlen,.Frn_name,CH$PTR(CS[CI$Foreign_Host]));U'     CS[CI$FHost_Name_Size] = .Frn_nlen;V   ! Local host nameE  A     CH$MOVE(.Local_Name[DSC$W_LENGTH],.Local_Name[DSC$A_POINTER],:  	    CH$PTR(CS[CI$Local_Host]));7     CS[CI$LHost_Name_Size] = .Local_Name[DSC$W_LENGTH];t  ! ! Local and foreign port numbers.d  2     CS[CI$Local_Port] = (.Lcl_Port AND %X'FFFF') ;4     CS[CI$Foreign_Port] = (.Frn_Port AND %X'FFFF') ;      % ! Local and remote internet addressesK  +     CS[CI$Local_internet_adrs] = .Lcl_Host;A,     CS[CI$Remote_internet_adrs] = .Frn_Host;  ' ! Copy block to user/system I/O buffer.L  F     $$KCALL(MOVBYT,Connection_Info_ByteSize,CS,.Uargs[IF$Data_Start]);   E ! Return the Connection Status to the user by posting the IO request.s  H     User$Post_IO_Status(.Uargs,SS$_NORMAL,Connection_Info_ByteSize,0,0);3     MM$UArg_Free(.Uargs);		! relese user arg block.o     END; o% %SBTTL 'Derive an integer Clock base'   D ! get a portion of the 64-bit time to use as a clock based factor in ! time based calculations.   !Entry:	none  # !Exit:	returns clock based integer.     GLOBAL ROUTINE USER$Clock_Base =	     BEGING	     LOCAL  	Now: VECTOR[2];       $GETTIM(TimAdr=Now);1     RETURN (.NOW[0]^-20+.NOW[1]^12) AND %x'7FFF';      END; c# %SBTTL 'Allocate a USER Local Port'  %(  	 Function:u  C 	Allocate a user local port for a connection.  Port is clock-based.    Inputs:A   	None.   Outputs:   	Valid user local port.S   Side Effects:H  @ 	If new local port is > local-port space end then wrap it around 	& s                                                                                                                                                                                                                                                                           (&        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                                    tart at the beginning. )%     GLOBAL     TCP_User_LP,     UDP_User_LP;  + GLOBAL ROUTINE USER$GET_LOCAL_PORT(Pbase) =o	     BEGINE	     LOCALN 	rval;       .Pbase = ..Pbase+1;N#     rval = ..Pbase MOD User_LP_End; #     IF .rval LSS User_LP_Start THEN  	rval = .rval+User_LP_Start;     RETURN .rval AND %X'7FFF';     END;   FORWARD ROUTINEE     ACCESS_INIT : NOVALUE;  - GLOBAL ROUTINE USER$INIT_ROUTINES : NOVALUE =f	     BEGINa$     TCP_User_LP = USER$Clock_Base();$     UDP_User_LP = USER$Clock_Base();     ACCESS_INIT();     END;      , %SBTTL 'Net$Debug - Debug maintenance call.'   %(	 Function:X  F 	Maintenance level user call.  Sets the IPACP system wide debug level.B 	Used to control volume of trace infor placed into IPACP log file.G 	IF Global "LOG_State" > 0 then the log file is open & logging enabled.f" 	Otherwise the LOG file is closed.   Inputs:	  # 	Uargs = IPACP user argument block.I   Outputs:   	None.   Side Effects:r   	Debug level is reset.   )%  3 ROUTINE Net$Debug(UArgs: REF Debug_Args): NOVALUE =S	     BEGINI      SELECT (.UARGS[DE$GROUP]) OF 	SET$ 	[0] : LOG_CHANGE(.UARGS[DE$LEVEL]);$ 	[1] : ACT_CHANGE(.UARGS[DE$LEVEL]); 	TES;   "     USER$Post_Function_OK(.Uargs);     END;   :  7 %SBTTL 'Net$Event - Activity logging maintenance call.'I   %(	 Function: A 	Maintenance level user call.  Used to append messages to the endR 	of the INET$ACTIVITY log file.N   Inputs:I# 	Uargs = IPACP user argument block.    Outputs: 	None.   Side Effects:  	Activity file is updatedt   )%  3 ROUTINE Net$Event(UArgs: REF Event_Args): NOVALUE =e	     BEGINn     EXTERNAL ROUTINE 	MM$Get_Mem, MM$Free_Mem; 	     LOCALd 	RC, 	Buffer;  F     IF (RC=MM$Get_Mem(Buffer,.UArgs[EV$Buf_Size])) NEQ SS$_NORMAL THEN 	BEGIN 	USER$ERR(.Uargs,.RC); 	RETURNc 	END;   I     $$KCALL(MOVBYT, .UArgs[EV$Buf_Size], .UArgs[EV$Data_Start], .Buffer);n  '     ACT$FAO('!%D (PID:!XW) [!AD]!/', 0,(= 	    (.UArgs[EV$PID])<0,16,0>, .UArgs[EV$Buf_Size], .Buffer);   "     USER$Post_Function_OK(.Uargs);,     MM$Free_Mem(Buffer,.UArgs[EV$Buf_Size]);     END;   A  ? %SBTTL 'Net$SNMP - Simple Network Management Protocol routine.'A   %(	 Function:U; 	Maintenance level user call.  Used to manipulate the IPACP'   Inputs: # 	Uargs = IPACP user argument block.	   Outputs: 	None.   Side Effects:, 	System is, um, manipulatedA   )%  + %Sbttl 'NET$SNMP - Service an SNMP request'A   %(  	 Function:   F 	Used to debug TCP by allowing a privileged user to examine TCP duringF 	execution.  The Dump directive indicates which/what type of a dump we4 	will take.  (Please excuse the disgusting imagery).   Inputs:u  J 	User argument blk formated according to Debug_Dump_args field definition.     Implicit Inputs:   	User must be privileged.t   Output:   D 	User's IO is posted back to the user.  If no errors then the user's+ 	buffer is filled with requested dump data.e )%  1 ROUTINE NET$SNMP(Uargs: REF SNMP_Args): NOVALUE =t	     BEGINi     EXTERNAL ROUTINE 	SNMP$USER_INPUT,d 	MM$Get_Mem, MM$Free_Mem;r     LITERAL & 	RBBYTES = D$User_Return_Blk_Max_Size,> 	RBSIZE = (RBBYTES+3)/4;		! Largest dump block, in alloc units	     LOCALL 	RC, 	In_Buff : REF VECTOR [,BYTE], 	Error: INITIAL(False),S$ 	Now: VECTOR[2],			! time as in now.2 	One: VECTOR[2] Initial(1,0),	! QuadWord of val 1. 	BufSize : INITIAL(0), 	RB: VECTOR[RBSIZE];  ) ! Fetch the input data from kernal space.T  J     IF (RC=MM$Get_Mem(In_Buff,.UArgs[SNMP$WBuf_Size])) NEQ SS$_NORMAL THEN 	BEGIN 	USER$ERR(.Uargs,.RC); 	RETURNY 	END;T  O     $$KCALL(MOVBYT, .UArgs[SNMP$WBuf_Size], .UArgs[SNMP$Data_Start], .In_Buff);   ) ! Determine which Dump Directive we have.P   %(&     SELECTONE .Uargs[SNMP$Function] OF     SETR  O ! Return the dynamic memory allocation counts, # of times the free list for thetL ! specified data structure was empty.  Used to figure out how many free list ! elements to pre-allocate.        [SNMP$C_Get,      SNMP$C_GetNext,      SNMP$C_Store]:e 	BEGIN" 	Bufsize = .UArgs[SNMP$RBuf_Size];8 	Error = SNMP$USER_INPUT(In_Buff,.UArgs[SNMP$WBuf_Size], 			       RB+4,.Bufsize) 	END;p     [SNMP$C_Kill]: )%  % IF (.Uargs[SNMP$Function] EQL 4) THEN  	BEGIN 	EXTERNAL ROUTINE  	    TCP$KILL;  2 	XLOG$FAO(LOG$USER,'!%T Kill !XL (bsize=!XL)!/',0,' 		 .In_Buff[0],.Uargs[SNMP$WBuf_Size]);= 	Bufsize = 10;  D 	RC = TCP$KILL(.In_Buff[0]); ! nu? what are you waiting for? kill!!!9 	IF .RC NEQ SS$_NORMAL THEN Error = USER$Err(.Uargs,.RC);T  H 	CH$MOVE(.BufSize,UPLIT(%ASCII 'abcdefghij'),RB+4); ! First long is size 	END %(     [Otherwise]:< 	Error = USER$Err(.Uargs,NET$_IFC); ! Illegal Function code.     TES;   )% ELSE< 	Error = USER$Err(.Uargs,NET$_IFC); ! Illegal Function code.  6 ! Did we have an Error or Illegal Dump directive code?  0     MM$Free_Mem(In_Buff,.UArgs[SNMP$WBuf_Size]);       IF NOT .Error THEN 	BEGIN                                                                                                                                                                                                                                                   s                        {"v        	IPACP.SRC                        ;  [IPACP]USER.BLI;1BLI;1                                                                                                         o     x                         k      5         E ! Check to see if user buffer is large enough to hold requested data.h( ! If not return error: Buffer TOO small.  2 	IF .Uargs[SNMP$RBuf_Size] LSS (.Bufsize + 4) THEN< 	    USER$Err(.Uargs,NET$_BTS)	! user's buffer is TOO small. 	ELSE 
 	    BEGIN  G ! Copy local data into user's IO request buffer, Build movbyt arg list.c   	    RB[0] = .Bufsize;; 	    $$KCALL(MOVBYT,.Bufsize+4,RB,.Uargs[SNMP$Data_Start]);i  . ! Post the user's IO request back to the user.  ; 	    User$Post_IO_Status(.Uargs,SS$_Normal,.BufSize+4,0,0);N4 	    MM$UArg_Free(.Uargs);	! Release user arg block.	 	    End;e 	END;%     END;   I  3 %Sbttl 'Purge/Post All Remaining User IO Requests.'O %(  	 Function:I  B 	Post all remaining user IO requests back to the respective users.D 	Routine is generally called before IPACP exits, idea is NOT to hangF 	any user processes.  Virtual device "IP" is set to the offline state.   Inputs:r   	None.   Outputs:   	None.   Side Effects:r  C 	Take IP device offline and call protocol-specific routines to kill F 	requests associated with all connections. Purge anything that remainsF 	on the user request queue. In any case, since the ACP is going to dieH 	soon don't bother to delete dynamic data structures, can end up calling& 	the memory-mangler recursively. oops.   )%   FORWARD ROUTINE=     GTHST_Purge : NOVALUE;  , GLOBAL ROUTINE USER$Purge_All_IO : NOVALUE =	     BEGIN      EXTERNAL ROUTINE 	TCP$Purge_All_IO : NOVALUE, 	UDP$Purge_All_IO : NOVALUE, 	ICMP$Purge_All_IO : NOVALUE,l 	IPU$Purge_All_IO : NOVALUE;     REGISTER 	qb;	     LOCALn 	Uargs: REF User_Default_Args, 	Sargs: REF User_Send_Args,  	IOSTATUS:  NetIO_Status_Block,_ 	EXPR: Vector[2];   : ! Set virtual device IP offline.  Prevent further user io.  #     $$KCALL(Set_IP_Device_OffLine);]  % ! Purge network I/O for all protocolsl       TCP$Purge_All_IO();      UDP$Purge_All_IO();[     ICMP$Purge_All_IO();     IPU$Purge_All_IO();$     GTHST_Purge();  5 ! check the user request queue again just to be safe.T  >     Expr[0] = 5*Timer_Delta;	! 5 seconds in Delta time format.     Expr[1] = -1;%     $SCHDWK(Daytim=EXPR);g1     $HIBER;			! Make sure ALL IO has been queued.a   ! Purge User request queue.KJ ! Special case M$Cancel as the IRP came from the IP: dri                                                                                                                                                                                                                                                                           
I        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                              &      ver cancel routineN ! & not from a user process, be sure NOT to post the IO!  USER$Err will delete ! the uargs block.  ;     WHILE (Uargs=$$KCALL(User_Requests_Avail)) NEQ false DOo 	BEGIN  @ ! post the user's io request with an error code: tcp is exiting.  & 	IF .Uargs[UD$Funct] neq M$Cancel THEN/ 	    User$Post_IO_Status(.Uargs,NET$_TE,0,0,0);a" !!!HACK!!! Don't release the Uarg? 	END;      END;   a  9 %Sbttl 'VMS$Cancel - Connection Cancel initiated by VMS.'b %(  	 Function:   E 	Cancel(ABORT) connection associated with a given PID & IO channel #.tD 	Action is initiated by "IP" driver cancel IO routine.  Driver sendsD 	the ACP a "FAKE" IRP which communicates the process PID & channel #> 	for which the IO is being cancelled.  See side effects below.   Inputs:   / 	VMS cancel request arg block (VMS$Cancel_args)o7 	Arg block contains requesting process PID & channel #.n   Outputs:   	None.   Side Effects:t  B 	All pending IO requests are returned to the user process with theF 	VMS return code of SS$_ABORT & the TCP Error code ER$CCAN (ConnectionF 	canceled).  Generally this routine is called in response to VMS image@ 	run-down routines doing a $CANCEL system service on an open I/O? 	chanel.  Virtual device driver builds a TCP arg block with thet 	"M$CANCEL" function code. 	***** Warning *****F 	Do NOT post the IO on this I/O request as it did NOT come from a user@ 	process but instead came from the IP: driver cancel IO routine.F 	Maclib.mar(user-requests-avail) routine takes care of the VMS dynamicC 	memory management, all we have to worry about is the User-argument  	block.c   )%   FORWARD ROUTINEX     GTHST_CANCEL : NOVALUE;a   GLOBAL ROUTINE User$Brk =d	     BEGINe     SS$_NORMAL     END;  : ROUTINE VMS$Cancel(Uargs: REF VMS$Cancel_Args) : NOVALUE =	     BEGINt     EXTERNAL ROUTINE 	TCP$Cancel, 	UDP$Cancel, 	ICMP$Cancel,f 	IPU$Cancel;	     LOCAL	 	ucbptr, 	proto,u 	Done;  /     ucbptr = .Uargs[VC$UCB_Adrs] + UCB$L_EXTRA;r$     $$KCALL(MOVBYT,4,.ucbptr,proto);  K     XLOG$FAO(LOG$USER,'!%T VMS$Cancel: PID=!XL, Chan=!XL, UCB proto=!XL!/',R2 	     0,.Uargs[VC$PID],.Uargs[VC$PIOchan],.Proto);       Done = 0;A$     SELECTONE .Uargs[VC$Protocol] OF     SETR     [U$TCP_Protocol]:s 	Done = TCP$Cancel(.Uargs);'       [U$UDP_Protocol]:i 	Done = UDP$Cancel(.Uargs);        [U$ICMP_Protocol]: 	Done = ICMP$Cancel(.Uargs);       [U$IP_Protocol]: 	Done = IPU$Cancel(.Uargs);e       [OTHERWISE]: 	Done = USER$BRK();e     TES;       GTHST_CANCEL(.Uargs);E9     MM$UArg_Free(.Uargs);		! Release IPACP argument blockv     END; F9 %Sbttl 'NET$Dump - Dump the TCB blocks to a user process'    %(  	 Function:e  F 	Used to debug TCP by allowing a privileged user to examine TCP duringF 	execution.  The Dump directive indicates which/what type of a dump we4 	will take.  (Please excuse the disgusting imagery).   Inputs:V  J 	User argument blk formated according to Debug_Dump_args field definition.     Implicit Inputs:   	User must be privileged.)   Output:S  D 	User's IO is posted back to the user.  If no errors then the user's+ 	buffer is filled with requested dump data.l )%  7 ROUTINE NET$DUMP(Uargs: REF Debug_Dump_Args): NOVALUE =i	     BEGINv     EXTERNAL ROUTINE 	CALCULATE_UPTIME;     EXTERNAL 	TEK$sys_uptime;     REGISTERB 	QB: REF Queue_Blk_Structure(QB_UR_Fields);	! queue block pointer.     LITERAL & 	RBBYTES = D$User_Return_Blk_Max_Size,> 	RBSIZE = (RBBYTES+3)/4;		! Largest dump block, in alloc units	     LOCALs 	RC, 	Error: INITIAL(False),u	 	BufSize,D 	count: INITIAL(0),e 	RB: VECTOR[RBSIZE];  ) ! Determine which Dump Directive we have.g  *     SELECTONE .Uargs[DU$Dump_Directive] OF     SETa  O ! Return the dynamic memory allocation counts, # of times the free list for theuL ! specified data structure was empty.  Used to figure out how many free list ! elements to pre-allocate.f       [DU$Dynamic_Mem_Alloc]:m 	BEGIN 	Map  	    RB: D$Mem_Alloc_Return_Blk;	 	EXTERNALA% 	    QBLK_Count_base : UNSIGNED BYTE,E% 	    Uarg_Count_base : UNSIGNED BYTE,r( 	    MIN_Seg_Count_base : UNSIGNED BYTE,( 	    MAX_Seg_Count_base : UNSIGNED BYTE,  	    QBLK_Count : UNSIGNED BYTE,  	    Uarg_Count : UNSIGNED BYTE,# 	    MIN_Seg_Count : UNSIGNED BYTE,T# 	    MAX_Seg_Count : UNSIGNED BYTE;m  % 	rb[dm$qb] = .qb_gets;	! queue blocks)3 	rb[dm$ua] = .Ua_gets;	! User net io argument blks.V 	rb[dm$cs] = 0;		!~~~ OBSOLETE@ 	rb[dm$dms] = .MIN_Gets;	! Minimum (default) size packet buffers5 	rb[dm$nm] = .MAX_Gets;	! Maximum size packet buffers$& 	rb[dm$qbmx] = .qb_max;	! queue blocks3 	rb[dm$uamx]= .Ua_max;	! User net io argument blks.$ 	rb[dm$csmx] = 0;	!~~~ OBSOLETEe: 	rb[dm$dmsmx] = .MIN_max;! Minimum (default) size buffers./ 	rb[dm$nmmx] = .MAX_max;	! Maximum size buffer.d  	rb[dm$qbal] = .QBLK_Count_Base;  	rb[dm$uaal] = .Uarg_Count_Base; 	rb[dm$csal] = 0;r$ 	rb[dm$dmsal] = .MIN_Seg_Count_Base;# 	rb[dm$nmal] = .MAX_Seg_Count_base;- 	rb[dm$qbfr] = .QBLK_Count;, 	rb[dm$uafr] = .Uarg_Count;S 	rb[dm$csfr] = 0;G 	rb[dm$dmsfr] = .MIN_Seg_Count;i 	rb[dm$nmfr] = .MAX_Seg_Count; 	Bufsize	= D$MA_BLKsize; 	END;	       [DU$TCP_stats]:  	BEGIN 	MAP  	    RB: D$TCP_Stats_Return_Blk;   	rb[dm$tcpacp_pid]		= .mypid; $ 	rb[dm$user_io_requests]		= .ts$uir;2 !!!HACK!!!  ! storeForward does not belong here... 	rb[dm$storeForward]		= 0;( 	rb[dm$active_conects_opened]	= .ts$aco;                                                                                                                                                                                                                                                   t                                	IPACP.SRC                        ;  [IPACP]USER.BLI;1.BLI;1                                                                                                        o     x                         n      D       ) 	rb[dm$passive_conects_opened]	= .ts$pco;n% 	rb[dm$data_bytes_xmitted]	= .ts$dbx;T$ 	rb[dm$data_bytes_recved]	= .ts$dbr; 	rb[dm$segs_xmitted]		= .ts$sx;b 	rb[dm$segs_recved]		= .ts$sr;, 	rb[dm$Seg_Bad_Chksum]		= .ts$seg_bad_cksum; 	rb[dm$badseq]			= .ts$badseq;- 	rb[dm$duplicate_segs]		= .ts$duplicate_segs;r) 	rb[dm$retrans_segs]		= .ts$retrans_segs;c  	rb[dm$rpz_rxq]			= .ts$rpz_rxq;# 	rb[dm$oorw_segs]		= .ts$oorw_segs; ' 	rb[dm$future_rcvd]		= .ts$future_rcvd;S' 	rb[dm$future_used]		= .ts$future_used; - 	rb[dm$future_dropped]		= .ts$future_dropped; ' 	rb[dm$future_dups]		= .ts$future_dups; - 	rb[dm$Servers_Forked]		= .ts$servers_forked;f   ! Compute TCP uptime.  	CALCULATE_UPTIME();) 	ch$move(8,TEK$sys_uptime,rb[dm$uptime]);.  3 	BufSize = D$TS_BlkSize;	! byte size of return blk.O 	END;t  O ! Return all active local-connection-id's otherwise known as the address of thef ! connection's TCB.$I ! 0th element of return vector is the count of valid tcb addresses in thee% ! return vector (ie, counted vector).S       [DU$Local_Connection_ID]:U 	BEGIN 	EXTERNAL ROUTINEl# 	    TCP$Connection_List : NOVALUE;  	TCP$Connection_List(RB);l 	BufSize = D$lc_id_BlkSize;O 	END;    ! Dump out a TCB       [DU$TCB_Dump]: 	BEGIN 	EXTERNAL ROUTINEt 	   TCP$TCB_Dump;e) 	IF TCP$TCB_Dump(.Uargs[DU$ARG0],RB) THENe! 	    BufSize = D$TCB_Dump_BLKsizee 	ELSEt& 	    Error = USER$Err(.Uargs,NET$_CDE) 	END;   = ! Return all UDP connections (as D$Local_Connection_ID above)k       [DU$UDP_Connections]:p 	BEGIN 	EXTERNAL ROUTINEo# 	    UDP$Connection_List : NOVALUE;  	UDP$Connection_List(RB);  	Bufsize = D$UDP_List_Blksize; 	END;e   ! Dump out a UDPCB       [DU$UDPCB_Dump]: 	BEGIN 	EXTERNAL ROUTINEe 	    UDP$UDPCB_Dump;4 	IF UDP$UDPCB_Dump(.Uargs[                                                                                                                                                                                                                                                                                   
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                              5      DU$Local_Conn_ID],RB) THEN# 	    Bufsize = D$UDPCB_Dump_Blksize  	ELSE_' 	    Error = USER$Err(.Uargs,NET$_CDE);u 	END;_  > ! Return all ICMP connections (as D$Local_Connection_ID above)       [DU$ICMP_Connections]: 	BEGIN 	EXTERNAL ROUTINEl$ 	    ICMP$Connection_List : NOVALUE; 	ICMP$Connection_List(RB); 	Bufsize = D$ICMP_List_Blksize;f 	END;g   ! Dump out a ICMPCBn       [DU$ICMPCB_Dump]:I 	BEGIN 	EXTERNAL ROUTINEc 	   ICMP$ICMPCB_Dump;a7 	IF ICMP$ICMPCB_DUMP (.Uargs[DU$Local_Conn_ID],RB) THENC$ 	    Bufsize = D$ICMPCB_Dump_Blksize 	ELSEr' 	    Error = USER$Err(.Uargs,NET$_CDE);_ 	END;)  5 ! Get device-depandent dump from device driver module        [du$device_dump]:  	BEGIN% 	IF (.uargs[du$device_idx] geq 0) ANDe< 	   (.uargs[du$device_idx] leq DC_max_num_net_Devices-1) ANDA 	   (.Dev_Config_Tab[.uargs[du$device_idx],dc_valid_Device]) THENt' 	    BEGIN		! call device dump routine. # 	    bufsize = .Uargs[DU$Buf_Size];r! 	    IF .bufsize GTR RBBYTES THENn 		bufsize = RBBYTES;? 	    rc = (.Dev_config_tab[.uargs[du$device_idx], dc_rtn_Dump]) ? 		    (.uargs[du$device_idx], .uargs[du$ARG1], .uargs[du$ARG2],. 		     rb, bufsize); 	    IF NOT .rc THEN< 		Error = USER$Err(.uargs,NET$_epd); ! error processing dump 	    END 	ELSE:A 	    Error = USER$Err(.uargs,NET$_bdi); ! error: bad device indexe 	END;I   ! Dump out ARP cache entries.        [DU$ARP_CACHE]:e 	BEGIN 	LOCAL 	    USIZE, 
 	    RMOD; !	EXTERNAL ROUTINE !	    ARP_DUMP;i  < 	Error = USER$Err(.Uargs,NET$_IFC); ! Illegal Function code.  A ! Compute size of return block - make multiple of dump block size    !	USIZE = .Uargs[DU$Buf_Size]; !	IF .USIZE GTR RBBYTES THEN !	    USIZE = RBBYTES;' !	RMOD = .USIZE MOD D$ARP_Dump_Blksize;e !	USIZE = .USIZE - .RMOD;e !	IF .USIZE LEQ 0 THEN' !	    Error = USER$Err(.Uargs,NET$_BTS)  !	ELSE !	    BEGINA; !	    Bufsize = ARP_DUMP(.Uargs[DU$Start_Index],RB,.USIZE);p !	    IF .Bufsize LSS 0 THEN% !		Error = USER$Err(.Uargs,NET$_DAE);r
 !	    END; 	END;c   ! Get list of device indexes.        [DU$Device_List]:  	BEGIN 	EXTERNAL ROUTINEc 	    CNF$Device_list;i 	Bufsize = CNF$Device_list(RB);o 	END;a       [DU$Device_Stat]:i 	BEGIN 	EXTERNAL ROUTINE  	    CNF$Device_stat;.0 	IF .Uargs[DU$Buf_Size] LSS DC_Entry_Size*4 THEN& 	    Error = USER$Err(.Uargs,NET$_BTS)< 	ELSE IF CNF$Device_stat ( .Uargs[DU$ARG0], RB ) EQL -1 THEN& 	    Error = USER$Err(.Uargs,NET$_DAE) 	ELSEd! 	    Bufsize = D$Dev_dump_blksize  	END;.  & ! Undefined function code - give error       [Otherwise]:< 	Error = USER$Err(.Uargs,NET$_IFC); ! Illegal Function code.     TES;  6 ! Did we have an Error or Illegal Dump directive code?       IF NOT .Error THEN 	BEGIN  E ! Check to see if user buffer is large enough to hold requested data.U( ! If not return error: Buffer TOO small.  ) 	IF .Uargs[DU$Buf_Size] LSS .Bufsize THEN < 	    USER$Err(.Uargs,NET$_BTS)	! user's buffer is TOO small. 	ELSEo
 	    BEGIN  G ! Copy local data into user's IO request buffer, Build movbyt arg list..  7 	    $$KCALL(MOVBYT,.Bufsize,RB,.Uargs[DU$Data_Start]);D  . ! Post the user's IO request back to the user.  9 	    User$Post_IO_Status(.Uargs,SS$_Normal,.BufSize,0,0);E4 	    MM$UArg_Free(.Uargs);	! Release user arg block.	 	    End;  	END;      END; a. %SBTTL 'Net$Exit - Orderly shutdown of IP ACP' %(	 Function:   C 	Used as a privileged call to force an orderly shutdown of the ACP.t   Inputs:n  ' 	User must have vms (phy_io) privilege.:   Outputs:   	Nonee   Side Effects:   9 	global "time_2_exit" set true, seen in tcp.bli mainline.I+ 	IP: device and all clones are set offline.E )%  7 ROUTINE Net$EXIT(Uargs: REF Debug_EXIT_Args): NOVALUE =i	     BEGINe  N     XLOG$FAO(LOG$USER,'!%T EXIT requested, User PID: !XL!/',0,.Uargs[EX$PID]);  "     USER$Post_Function_OK(.Uargs);C     Time_2_Exit = True;		! Set global for exit, rtn: start_network.yE     $$KCALL(Set_IP_device_OFFline); ! mark network device(s) offline.r     END; n& %SBTTL 'Network access check routines'   $FIELD GETJPI_FIELDS =     SETU     BUFLEN	= [$Short_Integer],     ITEM	= [$Short_Integer],     BUFADR	= [$Address],     RETLEN	= [$Address],     LISTEND	= [$Long_Integer]E     TES; LITERAL "     GETJPI_SIZE = $FIELD_SET_SIZE; MACROE=     GETJPI_BLOCK = BLOCK[GETJPI_SIZE] FIELD(GETJPI_FIELDS) %;T  % GLOBAL ROUTINE User$Privileged(PID) =e !)J ! Verify the user has privileges to use a well-known local port. User must ! have PHY_IO privilege.: ! Returns TRUE if user has the privilege, FALSE otherwise. !r	     BEGIN(	     LOCALB 	JPI : GETJPI_BLOCK, 	PRVBUF : $BBLOCK[8],B 	PRVLEN;   ! Fill in GETJPI request block.        JPI[BUFLEN] = 4;     JPI[ITEM] = JPI$_CURPRIV;      JPI[BUFADR] = PRVBUF;m     JPI[RETLEN] = PRVLEN;,     JPI[LISTEND] = 0;s  ) ! Request the priviliges for the process.p  -     IF ($GETJPIW(PIDADR=PID,ITMLST=JPI)) THENm7 	IF .PRVBUF[PRV$V_PHY_IO] OR .PRVBUF[PRV$V_SETPRV] THENB 	    RETURN SS$_NORMAL;m     RETURN NET$_NOPRV;     END;     ROUTINE Check_ID(PID,ID) = !EG ! Check that a user holds a given rights identifier. The identifiers ofN7 ! interest to us are ARPANET_ACCESS and ARPANET_WIZARD.QA ! Returns TRUE if the user has the necessary ID, FALSE otherwise.M !S	     BEGINU	     LOCALE 	STATUS, 	JPI : GETJPI_BLOCK, 	UICBLK : VECTOR[2], 	UICLEN, 	RDBCTX, 	CURID;    ! Fill in the GETJPI block       JPI[BUFLEN] = 4;     JPI[ITEM] = JPI$_UIC;E     JPI[BUFADR] = UICBLK;;     JPI[RETLEN] = UICLEN;a     JPI[LISTEND] = 0;]  " ! Retrieve the UIC for the process  /     IF NOT $GETJPIW(PIDADR=PID,ITMLST=JPI) THEN[ 	RETURN FALSE;  ) ! Check the rights database for this user]       UICBLK[1] = 0;     RDBCTX = 0;M     CURID = .ID;0     WHILE (STATUS = $FIND_HELD(	HOLDER	= UICBLK, 				ID	= CURID,f 				CONTXT	= RDBCTX)) DO         BEGINr 	IF .CURID EQL .ID THENB
 	    BEGIN" 	    $FINISH_RDB(CON                                                                                                                                                                                                                                                   u                        e        	IPACP.SRC                        ;  [IPACP]USER.BLI;1.BLI;1                                                                                                        o     x                               S       TXT = RDBCTX); 	    RETURN TRUE;[	 	    END;. 	END;_   ! Didn't find it - punt.       RETURN FALSE;m     END;    9 LITERAL WKS$SMTP = 25;		! Well known port number for SMTPt  C GLOBAL ROUTINE USER$CHECK_ACCESS(PID,LCLHST,LCLPRT,FRNHST,FRNPRT) =  ! + ! Main routine to check for network access.P9 ! Returns SS$_NORMAL if access is granted, or error code.m !e	     BEGINt	     LABELi 	X;!  : ! If no access checking is enabled, then skip this routine       IF .ACCESS_FLAGS EQL 0 THENt 	RETURN SS$_NORMAL;   N ! If we're checking acess for any network open, then check for INTERNET_ACCESS  '     IF .ACCESS_FLAGS<ACF$ALLOPENS> THEN[( 	IF NOT CHECK_ID(.PID,.INTERNET_ID) THEN 	    RETURN NET$_NOINA;m  9 ! If we're checking access to non-local hosts, then do sos  '     IF .ACCESS_FLAGS<ACF$ARPAHOST> THENl X:	BEGIN  B ! If the foreign host is in the "local hosts" list, then allow it.  & 	DECR I FROM (.ACHOST_COUNT-1) TO 0 DOH 	    IF (.FRNHST AND .ACHOSTS[.I,AC$MASK]) EQL .ACHOSTS[.I,AC$HOST] THEN
 		LEAVE X;' 	IF NOT CHECK_ID(.PID,.ARPANET_ID) THENe 	    RETURN NET$_NOANA;_ 	END;=  A ! If the local port is privileged, then require special privilege   '     IF .ACCESS_FLAGS<ACF$PRIVPORT> THEN;9 	IF (((.LCLPRT AND %X'FFFF') GEQ Well_Known_LP_Sta                                                                                                                                                                                                                                                                                   
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        '      D      rt) ANDDI 	    ((.LCLPRT AND %X'FFFF') LEQ Well_Known_LP_End) AND .FRNPRT EQL 0) ORa 	   (.FRNPRT EQL WKS$SMTP) THEN & 	    IF NOT User$Privileged(.PID) THEN 		RETURN NET$_NOPRV;  ? ! Passed all of the tests - let them have access to the networkn       RETURN SS$_NORMAL;     END;    ? GLOBAL ROUTINE USER$ACCESS_CONFIG(HOSTNUM,HOSTMASK) : NOVALUE =n !tH ! Add an entry to the list of allowed local hosts. Called by CONFIG when+ ! LOCAL_HOST entry seen in the config file.C !u	     BEGINN  ( ! Make sure there is room for this entry  (     IF .ACHOST_COUNT GEQ ACCESS_MAX THEN 	BEGIN 	LOCAL 	    DESC$STR_ALLOC(HSTSTR,20);r 	EXTERNAL ROUTINEs 	    ASCII_DEC_BYTES : NOVALUE;l  8 	ASCII_DEC_BYTES(HSTSTR,4,HOSTNUM,HSTSTR[DSC$W_LENGTH]);D 	OPR$FAO('Local hosts list full - not adding entry for !AS',HSTSTR); 	END;N   ! Insert it into the table  .     ACHOSTS[.ACHOST_COUNT,AC$HOST] = .HOSTNUM;/     ACHOSTS[.ACHOST_COUNT,AC$MASK] = .HOSTMASK;N%     ACHOST_COUNT = .ACHOST_COUNT + 1;m     END;     ROUTINE ACCESS_INIT : NOVALUE =, ! I ! Perform necessary initialzation for host access control. Translates theUK ! necessary identifiers via $ASCTOID and checks consistancy of switches andi ! access list. ! 	     BEGINn  I ! If access to network check enabled, translate INTERNET_ACCESS rights ID   '     IF .ACCESS_FLAGS<ACF$ALLOPENS> THENM 	BEGIN( 	IF NOT $ASCTOID(NAME	= INTERNET_STRING, 			ID	= INTERNET_ID) THENB
 	    BEGING 	    OPR$FAO('% Failed to find identifier !AS - access check disabled',a 		    INTERNET_STRING); $ 	    ACCESS_FLAGS<ACF$ALLOPENS> = 0;	 	    END;r 	END;E  I ! If ARPANET access check enabled, translate ARPANET_ACCESS rights ID andr0 ! verify that some hosts exist in the host list.  '     IF .ACCESS_FLAGS<ACF$ARPAHOST> THEN. 	BEGIN' 	IF NOT $ASCTOID(NAME	= ARPANET_STRING,) 			ID	= ARPANET_ID) THEN
 	    BEGING 	    OPR$FAO('% Failed to find identifier !AS - access check disabled',e 		    ARPANET_STRING);$ 	    ACCESS_FLAGS<ACF$ARPAHOST> = 0;	 	    END;E 	IF .ACHOST_COUNT EQL 0 THEN
 	    BEGINF 	    OPR$FAO('% No local hosts list - ARPANET access check disabled');$ 	    ACCESS_FLAGS<ACF$ARPAHOST> = 0;	 	    END;  	END;f     END; I( %SBTTL 'NET$GTHST: Get host information' %(	 Function:r  -     Retrieve information from the Namserver. =   Inputs:u  ;     GTHST subfunction code and function-specific arguments.t   Outputs:  *     Function-specific data posted to user.   Side effects:   3 	Results of query may be cached in the Name Server.r )%   FORWARD ROUTINET      GTHST_NMLOOK_DONE : NOVALUE,      GTHST_ADLOOK_DONE : NOVALUE,      GTHST_RRLOOK_DONE : NOVALUE;   LITERAL -     NLBSIZE = GTHST_NMLOOK_RET_ARGS_LENGTH*4, -     ALBSIZE = GTHST_ADLOOK_RET_ARGS_LENGTH*4,O     RLBSize = 6;  4 ROUTINE NET$GTHST(Uargs: REF GTHST_Args) : NOVALUE =	     BEGINo    ! Dispatch the GTHST subfunction  7     CASE .Uargs[GH$Subfunct] FROM GTH_MIN TO GTH_MAX OFI     SET.  G ! Local host info - same as name to address-list w/o doing name lookup.)       [GTH_LCLHST]:c 	BEGIN 	LOCAL$ 	    RBLOCK : GTHST_NMLOOK_RET_ARGS, 	    Args: VECTOR[4];A 	BINDN* 	    ADRVEC = RBLOCK[GHN$ADRLST] : VECTOR;	 	EXTERNALR 	    DEV_COUNT, 1 	    DEV_CONFIG_TAB : DEVICE_CONFIGURATION_TABLE;    ! Verify size of return block.  ' 	IF .Uargs[GH$BUFSIZE] LSS NLBSIZE THENE
 	    BEGIN 	    USER$Err(.Uargs,NET$_BTS);F 	    RETURN;	 	    END;A  8 ! Get the list of addresses from the configuration table  % 	INCR IDX FROM 0 TO (.DEV_COUNT-1) DOs8 	    ADRVEC[.IDX] = .DEV_CONFIG_TAB[.IDX,DC_IP_ADDRESS];! 	RBLOCK[GHN$ADRCNT] = .DEV_COUNT;(  5 ! Copy the name of the local host from the local info   > 	CH$MOVE(.Local_Name[DSC$W_LENGTH],.Local_Name[DSC$A_POINTER], 		CH$PTR(RBLOCK[GHN$NAMSTR]));0 	RBLOCK[GHN$NAMLEN] = .Local_Name[DSC$W_LENGTH];   ! Return data to the user   6 	$$KCALL(MOVBYT,NLBSIZE,RBLOCK,.Uargs[GH$Data_Start]);  # ! And give them a good status reply_  4 	User$Post_IO_Status(.Uargs,SS$_Normal,NLBSIZE,0,0); 	MM$UArg_Free(.Uargs); 	END;    ! Name to address-list lookupr       [GTH_NMLOOK]:A 	BEGIN 	MAP# 	    Uargs : REF GTHST_NMLOOK_ARGS;   ( 	IF .Uargs[GHN$BUFSIZE] LSS NLBSIZE THEN
 	    BEGIN 	    USER$Err(.Uargs,NET$_BTS);l 	    RETURN;	 	    END;$  : 	NML$GETALST(CH$PTR(Uargs[GHN$HSTNAM]),.Uargs[GHN$HSTLEN],  		    GTHST_NMLOOK_DONE,.Uargs); 	END;r   ! Address to name lookup       [GTH_ADLOOK]:s 	BEGIN 	MAP# 	    Uargs : REF GTHST_ADLOOK_ARGS;t 	LOCAL
 	    addr;  ( 	IF .Uargs[GHA$BUFSIZE] LSS ALBSIZE THEN
 	    BEGIN 	    USER$Err(.Uargs,NET$_BTS);g 	    RETURN;	 	    END;r  6 ! User argument is IP address - 0 means local address.   	addr = .Uargs[GHA$IPADDR];N 	IF .addr EQL 0 THEN- 	    addr = .Dev_Config_Tab[0,dc_IP_address]; - 	NML$GETNAME(.addr,GTHST_ADLOOK_DONE,.Uargs);:         END;   ! Domain resource record query.i       [GTH_RRECLK]:i 	BEGIN 	MAP# 	    Uargs : REF GTHST_RRLOOK_ARGS;t  ( 	IF .Uargs[GRR$BUFSIZE] LSS RLBSize THEN
 	    BEGIN 	    USER$Err(.Uargs,NET$_BTS);N 	    RETURN;	 	    END;c   	NML$GETRR(.Uargs[GRR$RRTYPE],3 		    CH$PTR(Uargs[GRR$HSTNAM]),.Uargs[GRR$HSTLEN],,  		    GTHST_RRLOOK_DONE,.Uargs); 	END;R   ! Unknown GTHST function       [OUTRANGE]:I 	USER$Err(.Uargs,NET$_IGF);      TES;     END; J! %SBTTL 'Name lookup done handler'  %(:     Come here when name GTH_NMLOOK function has completed.I     Called at AST level when NM_GETALST completes for the GTHST function.g3     Post the user request with the completion code.P )%  O ROUTINE GTHST_NMLOOK_DONE(Uargs,Status,Adrcnt,Adrlst,Namlen,Nambuf) : NOVALUE =E	     BEGINO	     LOCAL: 	Args: VECTOR[4];V     MAPL 	Uargs : REF GTHST_NMLOOK_ARGS;E	     LOCALt 	NLB : GTHST_NMLOOK_RET_ARGS;;  + ! If an error occurred, give it to the userR       IF NOT .Status THENN 	BEGIN 	USER$Err(.Uargs,.Status); 	RETURN; 	END;      + ! Copy the return data into prototype blockD       NLB[GHN$ADRCNT] = .Adrcnt;/     CH$MOVE(.Adrcnt*4,.Adrlst,NLB[GHN$ADRLST]);B     NLB[GHN$NAMLEN] = .Namlen;-     CH$MOVE(.Namlen,.Nambuf,NLB[GHN$NAMSTR]);_  " ! Copy the block back to the user.  7     $$KCALL(MOVBYT,NLBSIZE,NLB,.Uargs[GHN$Data_Start]);e  # ! And give them a good status replyE  7     User$Post_IO_Status(.Uargs,SS$_Normal,NLBSIZE,0,0);,     MM$UArg_Free(.Uargs);      END; O$ %SBTTL 'Address lookup done handler' %(/     Same as above, but for GTH_ADLOOK function.  )%  A ROUTINE GTHST_ADLO                                                                                                                                                                                                                                                   v                                	IPACP.SRC                        ;  [IPACP]USER.BLI;1.BLI;1                                                                                                        o     x                               b       OK_DONE(Uargs,Status,Namlen,Nambuf) : NOVALUE =U	     BEGINP	     LOCAL  	Args: VECTOR[4];E     MAPI 	Uargs : REF GTHST_ADLOOK_ARGS; 	     LOCALt 	ALB : GTHST_ADLOOK_RET_ARGS;F  + ! If an error occurred, give it to the userT       IF NOT .Status THENi 	BEGIN 	USER$Err(.Uargs,.Status); 	RETURN; 	END;    ! Build the return block       ALB[GHA$NAMLEN] = .namlen;-     CH$MOVE(.Namlen,.Nambuf,ALB[GHA$NAMSTR]);T   ! Return data to the userI  7     $$KCALL(MOVBYT,ALBSIZE,ALB,.Uargs[GHA$Data_Start]);C  # ! And give them a good status reply   7     User$Post_IO_Status(.Uargs,SS$_Normal,ALBSIZE,0,0);F     MM$UArg_Free(.Uargs);A     END; 2 %SBTTL 'RR lookup done handler'S %(:     Come here when name GTH_RRLOOK function has completed.G                                                                                                                                                                                                                                                                            }B        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        q      S          Called at AST level when NM_GETRR completes for the GTHST function. 3     Post the user request with the completion code.  )%  M ROUTINE GTHST_RRLOOK_DONE(Uargs,Status,RDLen,RData,Namlen,Nambuf) : NOVALUE =u	     BEGIN 	     LOCALF 	Args: VECTOR[4];R     MAP_ 	Uargs : REF GTHST_RRLOOK_ARGS;c	     LOCAL  	RLB : GTHST_RRLOOK_RET_ARGS;T  + ! If an error occurred, give it to the userN       IF NOT .Status THEN. 	BEGIN 	USER$Err(.Uargs,.Status); 	RETURN; 	END;      + ! Copy the return data into prototype blocko  4     IF .Uargs[GRR$BUFSIZE] LSS RLBSize + .RDLen THEN 	BEGIN 	USER$Err(.Uargs,NET$_BTS);  	RETURN; 	END;t       RLB[GRR$RDLEN] = .RDLen; !    RLB[GRR$NAMLEN] = .Namlen;I* !    CH$MOVE(.RDLen,.RData,RLB[GRR$DATA]);3 !    CH$MOVE(.Namlen,.Nambuf,RLB[GRR$DATA]+.RDLen);.  " ! Copy the block back to the user.  1     $$KCALL(MOVBYT,2,RLB,.Uargs[GRR$Data_Start]);e=     $$KCALL(MOVBYT,.RDLen,.Rdata,.Uargs[GRR$Data_Start] + 2);PI !    $$KCALL(MOVBYT,.Namlen,.Nambuf,.Uargs[GRR$Data_Start] + 6 + .RDLen);   # ! And give them a good status replyn  A     User$Post_IO_Status(.Uargs,SS$_Normal, RLBSize + .RDLen,0,0);      MM$UArg_Free(.Uargs);(     END; 	; %SBTTL 'GTHST_CANCEL - Cancel GTHST requests for a process'v   FORWARD ROUTINEw     GTHST_CANCEL_ONE : NOVALUE;   = ROUTINE GTHST_CANCEL(Uargs : REF VMS$CANCEL_ARGS) : NOVALUE =  !AH ! Search the list of pending GTHST requests looking for match. If found,( ! post it now and delete from the queue. !n	     BEGIN &     NML$STEP(GTHST_CANCEL_ONE,.Uargs);     END;  : ROUTINE GTHST_CANCEL_ONE(VCUARGS,ASTADR,UARGS) : NOVALUE = !CI ! Check a single entry from the name lookup queue to see if it belongs toTA ! the process that is doing the cancel. If so, we will cancel it.N !]	     BEGINO     MAPo 	VCUARGS : REF VMS$CANCEL_ARGS,f 	UARGS : REF User_Default_Args;e  M ! Do sanity check on AST routine. Only GTHST done routines should be attachedT ! to GTHST requests.  *     IF (.ASTADR NEQ GTHST_NMLOOK_DONE) AND$ 	(.ASTADR NEQ GTHST_ADLOOK_DONE) AND% 	(.ASTADR NEQ GTHST_RRLOOK_DONE) THENe 	RETURN;  L ! See if the UCB of the cancellor is the same as that of the request. If so,6 ! cancel the request (i.e. "finish" it with an error).    9     IF .VCUARGS[VC$UCB_ADRS] EQL .UARGS[UD$UCB_ADRS] THENd# 	NML$CANCEL(.UARGS,TRUE,NET$_CCAN);      END;   FORWARD ROUTINEA     GTHST_PURGE_ONE : NOVALUE;   ROUTINE GTHST_PURGE : NOVALUE =	 !	H ! Routine to purge all requests when network ACP exits. Step through all) ! requests (with NML$STEP) and punt them.E !T	     BEGIN       NML$STEP(GTHST_PURGE_ONE,0);     END;  9 ROUTINE GTHST_PURGE_ONE(COVALUE,ASTADR,UARGS) : NOVALUE =A !N$ ! Coroutine for NML$STEP/GTHST_PURGE !o	     BEGINi  M ! Do sanity check on AST routine. Only GTHST done routines should be attached  ! to GTHST requests.  *     IF (.ASTADR NEQ GTHST_NMLOOK_DONE) AND$ 	(.ASTADR NEQ GTHST_ADLOOK_DONE) AND% 	(.ASTADR NEQ GTHST_RRLOOK_DONE) THEN  	RETURN;$     NML$CANCEL(.UARGS,TRUE,NET$_TE);     END;   %SBTTL 'Process User Requests.'  %(  	 Function:N  D 	Process user IP function requests.  User requests are read from theF 	ACP input queue.  All request processing is handled by the appro rtn.G 	Requests maybe queued for later processing as in the case of a receiveeF 	requests & no data-bearing segments have arrived for that connection.F 	If user is waiting for a local event flag to be set, then he is still> 	waiting until the IO request has been posted via IO$POST rtn.@ 	VMS access mode MUST be KERNAL to touch VMS IO data structures.   Inputs:D   	None.   Implicit Inputs:  A 	VMS pseudo-device has been mounted so an ACP queue block exists. * 	See module: MACLIB.MAR for device mounts.   Outputs:   	None.   Side Effects:G  4 	User requests are processed & returned to the user.   IMPORTANT NOTE! :E  ; 	When adding new functions to the IPACP, remember to change.: 	and recompile the function codes in *all* modules.  Don't< 	forget about changing m$cancel in maclib.mar!  It's defined 	both there and in user.bli.   )%    5 GLOBAL ROUTINE USER$Process_User_Requests : NOVALUE =g	     BEGIN]     EXTERNAL ROUTINE   ! TCP functions: 	TCP$OPEN : NOVALUE, 	TCP$CLOSE : NOVALUE,  	TCP$ABORT : NOVALUE,I 	TCP$SEND : NOVALUE, 	TCP$RECEIVE : NOVALUE,t 	TCP$INFO : NOVALUE, 	TCP$STATUS : NOVALUE,   ! UDP functions: 	UDP$OPEN : NOVALUE, 	UDP$CLOSE : NOVALUE,R 	UDP$ABORT : NOVALUE,  	UDP$SEND : NOVALUE, 	UDP$RECEIVE : NOVALUE,b 	UDP$INFO : NOVALUE, 	UDP$STATUS : NOVALUE,   ! ICMP functions:D 	ICMP$OPEN : NOVALUE,P 	ICMP$CLOSE : NOVALUE, 	ICMP$ABORT : NOVALUE, 	ICMP$SEND : NOVALUE,e 	ICMP$RECEIVE : NOVALUE, 	ICMP$INFO : NOVALUE,a 	ICMP$STATUS : NOVALUE,a   ! IP functions:R 	IPU$OPEN : NOVALUE, 	IPU$CLOSE : NOVALUE,H 	IPU$ABORT : NOVALUE,[ 	IPU$SEND : NOVALUE, 	IPU$RECEIVE : NOVALUE,  	IPU$INFO : NOVALUE, 	IPU$STATUS : NOVALUE;     REGISTER 	ArgBlk: REF User_Default_Args;_  <     WHILE (ARGBLK=$$KCALL(User_requests_Avail)) NEQ False DO 	BEGIN 	IF $$LOGF(LOG$USER) THENt
 	    BEGIN
 	    LOCAL 		DESC$STR_ALLOC(funcstr,30),M 		func;U# 	    SELECTONE .ArgBlk[UD$Funct] OF  	    SET% 	    [U$OPEN]:	func=%ASCID'TEK$OPEN'; & 	    [U$SEND]: 	func=%ASCID'TEK$SEND';( 	    [U$RECV]:	func=%ASCID'TEK$RECEIVE';' 	    [U$CLOSE]:	func=%ASCID'TEK$CLOSE';	' 	    [U$ABORT]:	func=%ASCID'TEK$ABORT'; ) 	    [U$STATUS]:	func=%ASCID'TEK$STATUS';]% 	    [U$INFO]:	func=%ASCID'TEK$INFO';T  ( 	    [U$GTHST]:  func=%ASCID'Net$GTHST';% 	    [M$DUMP]:	func=%ASCID'Net$DUMP'; % 	    [M$EXIT]:	func=%ASCID'Net$EXIT';g' 	    [M$DEBUG]:	func=%ASCID'Net$Debug';m' 	    [M$EVENT]:	func=%ASCID'Net$Event';.% 	    [M$SNMP]:	func=%ASCID'Net$SNMP';a  ) 	    [M$Cancel]:	func=%ASCID'VMS$Cancel';, 	    [OTHERWISE]:N 		    BEGINd? 		    $FAO(%ASCID'?User FCN !SL',funcstr[DSC$W_LENGTH],funcstr,  			 .argblk[UD$Funct]);H 		    func = funcstr;P
 		    END;	 	    TES;To 	    LOG$FAO('!%T !AS (Proto:!XB), Uargs=!XL,VMSID=!XL,IRP=!XL,UCB=!XL!/',		    0, .func, .Argblk[UD$Protocol],T& 		    .Argblk, .Argblk[UD$VMS_BLK_ID],1 		    .Argblk[UD$IRP_Adrs], .Argblk[UD$UCB_Adrs],G 		    .Argblk[UD$PID]);_	 	    END;,  ' 	IF .Argblk[ud$funct] NEQ M$Cancel THENn= 	    ts$uir = .ts$uir + 1 ! count arrival of user io request.  	ELSE VMS$Cancel(.ArgBlk);  D ! dispatch to appro user io request handler routine.  Cover both tcp ! and maintenance functions.  0 	IF .Argblk[ud$protocol] EQL U$TCP_Protocol THEN2 	   ! Handle TCP functions first to improve speed.? 	   CASE .argBlk[ud$funct] FROM u$open TO u$max_TCP_function OFt 	   SETa  	   [u$open]:	TCP$OPEN(.ArgBlk);! 	   [u$send]: 	TCP$SEND(.ArgBlk);A# 	   [u$recv]:	TCP$Receive(.ArgBlk); " 	   [u$close]:	TCP$CLOSE(.ArgBlk);" 	   [u$abort]:	TCP$ABORT(.ArgBlk);$ 	   [u$status]:	TCP$Status(.ArgBlk);  	   [u$info]:	TCP$Info(.ArgBlk);D 	   [OUTRANGE]:	USER$Err(.ArgBlk,NET$_IFC); ! Illegal Function Code.   	   TES  	ELSEL                                                                                                                                                                                                                                                   w                        gafr        	IPACP.SRC                        ;  [IPACP]USER.BLI;1.BLI;1                                                                                                        o     x                         4      q       = 	CASE .argBlk[ud$funct] FROM u$open TO u$max_user_function OF$ 	SET  
 	[u$open]:& 	    SELECTONE .Argblk[ud$protocol] OF 	    SET* 	    [U$UDP_Protocol] :	UDP$OPEN(.ArgBlk);, 	    [U$ICMP_Protocol] :	ICMP$OPEN(.ArgBlk);) 	    [U$IP_Pro                                                                                                                                                                                                                                                                           :        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                              b      tocol] :	IPU$OPEN(.ArgBlk);tE 	    [OTHERWISE]:USER$Err(.ArgBlk,NET$_IPC); ! Illegal Protocol Code.L	 	    TES;,  
 	[u$send]:& 	    SELECTONE .Argblk[ud$protocol] OF 	    SET* 	    [U$UDP_Protocol] :	UDP$SEND(.ArgBlk);, 	    [U$ICMP_Protocol] :	ICMP$SEND(.ArgBlk);) 	    [U$IP_Protocol] :	IPU$SEND(.ArgBlk); E 	    [OTHERWISE]:USER$Err(.ArgBlk,NET$_IPC); ! Illegal Protocol Code.s	 	    TES;T  
 	[u$recv]:& 	    SELECTONE .Argblk[ud$protocol] OF 	    SET- 	    [U$UDP_Protocol] :	UDP$Receive(.ArgBlk); / 	    [U$ICMP_Protocol] :	ICMP$Receive(.ArgBlk);., 	    [U$IP_Protocol] :	IPU$Receive(.ArgBlk);E 	    [OTHERWISE]:USER$Err(.ArgBlk,NET$_IPC); ! Illegal Protocol Code.,	 	    TES;S   	[u$close]:u& 	    SELECTONE .Argblk[ud$protocol] OF 	    SET+ 	    [U$UDP_Protocol] :	UDP$CLOSE(.ArgBlk);t- 	    [U$ICMP_Protocol] :	ICMP$CLOSE(.ArgBlk);a* 	    [U$IP_Protocol] :	IPU$CLOSE(.ArgBlk);E 	    [OTHERWISE]:USER$Err(.ArgBlk,NET$_IPC); ! Illegal Protocol Code.(	 	    TES;h   	[u$abort]:T& 	    SELECTONE .Argblk[ud$protocol] OF 	    SET+ 	    [U$UDP_Protocol] :	UDP$ABORT(.ArgBlk); - 	    [U$ICMP_Protocol] :	ICMP$ABORT(.ArgBlk);c* 	    [U$IP_Protocol] :	IPU$ABORT(.ArgBlk);E 	    [OTHERWISE]:USER$Err(.ArgBlk,NET$_IPC); ! Illegal Protocol Code. 	 	    TES;    	[u$status]:& 	    SELECTONE .Argblk[ud$protocol] OF 	    SET, 	    [U$UDP_Protocol] :	UDP$Status(.ArgBlk);. 	    [U$ICMP_Protocol] :	ICMP$Status(.ArgBlk);+ 	    [U$IP_Protocol] :	IPU$Status(.ArgBlk);rE 	    [OTHERWISE]:USER$Err(.ArgBlk,NET$_IPC); ! Illegal Protocol Code.t	 	    TES;   
 	[u$info]:& 	    SELECTONE .Argblk[ud$protocol] OF 	    SET* 	    [U$UDP_Protocol] :	UDP$Info(.ArgBlk);, 	    [U$ICMP_Protocol] :	ICMP$Info(.ArgBlk);) 	    [U$IP_Protocol] :	IPU$Info(.ArgBlk);,E 	    [OTHERWISE]:USER$Err(.ArgBlk,NET$_IPC); ! Illegal Protocol Code.e	 	    TES;o   	[u$gthst]:	Net$GTHST(.argblk);    	[OUTRANGE]:
 	    BEGINE 	    SELECTONE .argBlk[ud$funct] OF ! check acp maintenance functionsS 	    SET! 	    [M$DUMP]:	Net$DUMP(.ArgBlk);m! 	    [M$EXIT]:	Net$EXIT(.ArgBlk);D# 	    [M$DEBUG]:	Net$Debug(.ArgBlk);u# 	    [M$EVENT]:	Net$Event(.ArgBlk);U! 	    [M$SNMP]:	Net$SNMP(.ArgBlk);,& !	    [M$Cancel]:	VMS$Cancel(.ArgBlk); 	    [M$Cancel]:	SS$_NORMAL;E 	    [OTHERWISE]:USER$Err(.ArgBlk,NET$_IFC); ! Illegal Function Code.A	 	    TES;N	 	    END;  	TES;  	END;A     END; ENDF ELUDOML_ARGS) : NOVALUE =  !AH ! Search the list of pending GTHST requests looking for match. If found,( ! post it now and delete from the queue. !n	     BEGIN &     NML$STEP(GTHST_CANCEL_ONE,.Uargs);     END;  : ROUTINE GTHST_CANCEL_ONE(VCUARGS,ASTADR,UARGS) : NOVALUE = !CI ! Check a single entry from the name lookup queue to see if it belongs toTA ! the process that is doing the cancel. If so, we will cancel it.N !]	     BEGINO     MAPo 	VCUARGS : REF V               * [IPACP]XEDRV.BLI;1 +  , #   . Q    /     4 S   Q   Q                     - ;    0   1    2   3      K  P   W   O R    5   6  W,  7 @;-  8          9          G    H  J                              %(A 	****************************************************************   0 		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.  A 	****************************************************************  )% %Title 'Ethernet device driver'  %Sbttl 'Driver overview' %(   Module:              XE_driver   	 Facility:   $           DEC Ethernet device driver  	 Abstract:   I           XE_driver provides upper level protocols with access to the DEC K           Ethernet controller device.  This module has three main routines: G 	  XE_init, XE_xmit and XE_receive. XE_init is called at initialization G 	  time to setup the ethernet device. XE_xmit is called during run time H 	  to send network packets to the network.  It is normally called by theH 	  IP_send routine but may be called by any other routine in the networkG 	  module. XE_receive is always initiated by an AST from the DEC device F 	  driver within the VMS system.  The AST's are initially setup by the? 	  XE_init routine and subsequently setup by XE_receive itself.    Author:    	  Original author Tim Fallon 3 	  Previous versions by Kevin Carosso and Ned Freed = 	  This version by Vince Fuller, CMU-CSD, Spring/Summer, 1986 G 	  Copyright (c) 1986,1987, Vince Fuller and Carnegie-Mellon University      Modification History:   " 	09-Aug-1991	Henry W. Miller		USBR 	Numerous changes:   	Search STARLET for VMS 5.4.2 	Print out buffer size in decimal in XE_StartIO().; 	In XE_StartDEV(), use MAX_RCV_BUF parameter rather than 4. = 	Use LIB$GET_VM_PAGE/LIB$FREE_VM_PAGE rather than LIB$GET_VM/  	LIB$FREE_VM. E 	Go NOINT/OKINT during critical phase in XE$XMIT() and XE$ARP_XMIT().    *** Begin CMU change log ***  ( 	02-Feb-1990	Bruce R. Miller		CMU NetDev> 	Added a Device_Info table so that this module can be compiled8 	into a run-time loadable image, instead of having to be  	linked directly with the IPACP.  ( 	01-Sep-1989	Bruce R. Miller		CMU NetDev7 	Restructured code to retry a failed operation a number 7 	of times before failing.  The number of times to retry 7 	a read is contained in the variable RETRY_COUNT and is ; 	settable using the VARIABLE command in the internet.config  	file.  ( 	30-Aug-1989	Bruce R. Miller		CMU NetDevC 	Special handling of SS$_BADPARAM return code from XE startup $QIO.   ( 	??-Aug-1989	Bruce R. Miller		CMU NetDev; 	Added code to handle SS$_ABORT return code from $QIO read.   ( 	03-Jul-1989	Bruce R. Miller		CMU NetDev. 	More verbose description of $ASSIGN failures.  ! 	08-FEB-1989	Dale Moore	CMU-CS/RI 9 	Now receive only Broadcast packets and not all mutlicast 	 	packets.   ! 	14-NOV-1988	Dale Moore	CMU-CS/RI 6 	Added changes suggested by Jerry Lotto.  He mentioned8 	getting them from Kevin Carrusso.  They involve dealing 	with brain dead DEQNA's.    4.1  19-Nov-87, Edit by VAF " 	Use $ACPWAKE macro to wakeup ACP.   4.0  31-Jul-87, Edit by VAF C 	Enable multicast/broadcast on ARP port (needed for newer devices).    3.9  23-Mar-87, Edit by VAF @ 	Use dynamic global MAX_PHYSICAL_BUFSIZE when allocating receive2 	buffers. Simplify calling sequence of IP_RECEIVE. 	Simplify format of NSQ blocks.    3.8  24-Feb-87, Edit by VAF 9 	Q_MESSAGE has been flushed. Use QL_FAO (QL$FAO,XQL$FAO). % 	Keep track of number of XE restarts.    3.7   6-Feb-87, Edit by VAF A 	Change references to "DEUNA/DEQNA" to be "DEC Ethernet" or "XE".    3.6  17-Oct-86, Edit by VAF / 	Allow XE_ARP_XMIT to fail recoverably... Sigh.    3.5  28-Oct-86, Edit by VAF G 	In                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          W        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                              q          x                        -        	IPACP.SRC                      #  ;  [IPACP]XEDRV.BLI;1BLI;1                                                                                                        S     Q                         b      	       XE_XMIT, know about new ARP_CHECK -1 return - indicates that packet 8 	is being held by ARP routines for later retransmission.   3.4  18-Jul-86, Edit by VAF E 	In XE_XMIT, take out bogus retry stuff. REMQUE the Qblk at the start  	of the routine.   3.3  15-Jul-86, Edit by VAF ; 	Make sure in-progress buffer is deallocated on read error.    3.2  19-Jun-86, Edit by VAF  	Pass device index up to IP.   3.1  11-Jun-86, Edit by VAF  	Allow ARP read to fail.C 	Only play the "is decnet there" game the first time that the DEQNA D 	is successfully started. Typically, if it "goes away" it is because3 	DECNET was slow to restart its part of the device.   & 3.0  29-May-86, Edit by Dale and VinceD 	Rewrite sense-mode code. Use hardware address if "physical" address* 	is not valid (i.e. decnet isn't running).   2.9  29-May-86, Edit by VAF B 	New NOINT/OKINT scheme. Initialize ARP parameters AFTER device is2 	started, so that the physical address is correct.   2.8  13-May-86, Edit by VAF C 	Redo error/restart stuff to be consistant, correctly deassign read  	buffers, etc.   2.7   9-May-86, Edit by VAF 1 	Disable ASTs and do $CANCEL in shutdown routine. " 	Issue a $WAKE in restart routine.   2.6  29-Apr-86, Edit by VAF ! 	Don't issue $WAKE calls in here.    2.5  15-Apr-86, Edit by VAF ( 	Changes for new, general ARP interface.B 	Treat addresses as 6-byte long strings, not as two partial words.+ 	Remove a lot of byteswapping of addresses.    2.4   7-Apr-86, Edit by VAF A 	New logging stuff. Log physical address in receive AST routines. 4 	Use Q_MESSAGE not LOG_OUTPUT when writing log info.   2.3  31-Mar-86, Edit by VAF & 	Various changes, fixes to 2.2 change.   2.2   5-Mar-86, Edit by VAF A 	Add code in XE_RECEIVE to restart the DEQNA when it gets wedged.    2.1  21-Feb-86, Edit by VAF B 	Put ARP origination code in here. *NB* this ARP code is temporary@ 	and is not very general. It was put here so that I could changeE 	the interface between IP and the device driver to its eventual final D 	state. **This code will be replaced by a more general ARP mechanism 	someday (hopefully, soon) *** 	Flush "known hosts" table.    *** End CMU change log ***              1.0 - Original releaseJ           1.1 - Removed buffer copies.  Higher level protocols now sends aJ                 buffer that has space in front to put device control info.I                 Also implemented the XE_hdr_offset to allow for different H                 device control information on store-and-forward buffers.C 	  1.2 - Assign ethernet packet type to be compatiable with berkely  		4.2 unix. > 	  2.0 - Converted from Interlan driver to DEUNA/DEQNA driver.1 	  2.01 - Add ARP responder (Rick Watson U.Texas)  )%     %Sbttl   'Module definitions'   0 MODULE XE_DRIVER(IDENT='5.0a',LANGUAGE(BLISS32),* 		 ADDRESSING_MODE(EXTERNAL=LONG_RELATIVE,  				 NONEXTERNAL=LONG_RELATIVE),7 		 LIST(EXPAND,TRACE,NOREQUIRE,ASSEMBLY,OBJECT,BINARY),  		 OPTIMIZE,OPTLEVEL=3,ZIP)=< !!!HACK!!! Add code to shut-down an interface permanently...2 !!!HACK!!! Make sure errors are handled correctly.   BEGIN   7 !LIBRARY 'SYS$LIBRARY:STARLET';	! VMS system defintions 2 LIBRARY 'SYS$LIBRARY:LIB';	! VMS system defintions  @ LIBRARY 'CMUIP_SRC:[CENTRAL]NETTCPIP';		! Required for UDP check7 LIBRARY 'CMUIP_SRC:[central]NETXPORT';		! VMS specifics 8 LIBRARY 'CMUIP_SRC:[central]NETCOMMON';	! CMU-OpenVMS/IP5 LIBRARY 'CMUIP_SRC:[central]NETVMS';		! VMS specifics A LIBRARY 'CMUIP_SRC:[central]NETCONFIG';	! Device interface specs. = LIBRARY 'CMUIP_SRC:[central]NETDEVICES';	! Helpfull macros...    LIBRARY 'XEDRV'; LIBRARY 'XEARP';   EXTERNAL ROUTINE   ! NETMACLIB.OBJ      Time_Stamp,      SwapBytes,   ! NETDEVICES.OBJ      ASCII_HEX_BYTES,    ! XEDRV_ARP.BLI        XEARP$DEV_INIT : NOVALUE,      XEARP$CHECK,     XEARP$INPUT : NOVALUE;   FORWARD ROUTINE      XE_Receive : NOVALUE,      XE_ArpRcv :  NOVALUE;    BIND4     XE_BROADCAST = UPLIT (BYTE (REP 6 OF (%X'FF')));   MACRO       ! Description of this device.     XE_description = 'Digital Ethernet Card'%;   OWN 0     ! String descriptor used to hold description     XE_descriptor : VECTOR[2];    L %SBTTL 'Declare the device information block used to describe entry points.'   OWNs?     ! DRV$Device_Info is a list of everything we want the IPACPbE     ! to know about us...  Initialized by ROUTINE DRV$TRANSPORT_INIT.r,     DRV$Device_Info : Device_Info_Structure;   GLOBALD     ! The IPACP_Interface tells us all about the IPACP.  It gives usE     ! entry points, literals and global pointers.  See NETDEVICES.REQo4     ! for a complete explaination of this structure.8     ! Note: This pointer must be named "IPACP_Interface"/     IPACP_Interface : REF IPACP_Info_Structure;n   t   FORWARD ROUTINEi     XE_Shutdown : NOVALUE;   MACRO XE$ERR(XE_Int) =	     BEGIN*     DRV$OPR_FAO(%REMAINING);     XE_Shutdown(XE_Int,true);%     END'     %;   c  3 %SBTTL 'Start asynchronous I/O on the DEC ethernet'   ; ROUTINE XE_StartIO ( XE_Int : REF XE_Interface_Structure) =v	     BEGIN 	     LOCAL  	RC, 	Buff: REF XERCV_QB_structure, 	ARbuf: REF XE_ARP_STRUCTURE;      BINDD 	rcvhdrs = .XE_Int[XEI$rcvhdrs] : BLOCKVECTOR[MAX_RCV_BUF,XERCV_LEN] 					 FIELD(XE_RECV),x 	XE_chan = XE_Int[XEI$IO_Chan],l$ 	XAR_chan = XE_Int[XEI$ARP_IO_chan];  2 ! Supply four receive buffers to device controller  ?     DRV$OPR_FAO ('XEDRV: MPBS = !SL',DRV$MAX_PHYSICAL_BUFSIZE);l       XE_Int[XEI$curhdr] = 0;b'     INCR I FROM 0 TO (MAX_RCV_BUF-1) DOt= 	BEGIN	! Get buffer, put on Q and issue IO$_READVBLK function B 	Buff = DRV$Seg_get(DRV$MAX_PHYSICAL_BUFSIZE+(Qhead_len+IOS_len));/ 	INSQUE ( .Buff , .XE_Int [ XEI$recv_Qtail ] );s 	Buff = .Buff + XE_hdr_offset;@ 	RC = $QIO(chan=.XE_chan, EFN=ASTEFN, IOSB=Buff[XERCV$vms_code], 		  Func = IO$_READVBLK, 		  P1 = Buff[XERCV$data]," 		  P2 = DRV$MAX_PHYSICAL_BUFSIZE, 		  P5 = rcvhdrs[.I,XERCV$buf],)+ 		  astadr = XE_receive, astprm = .XE_Int);U 	IF .RC NEQ SS$_Normal THENH9 	    BEGIN     ! Error issuing set receive buffer commandhA 	    XE$ERR(.XE_Int,'XE queue read request failure, RC=!XL',.RC);e 	    Return 0; 	    END 	END;a  ( ! get ARP buffer and issue a receive qio  &     ARbuf = DRV$Seg_get(XE_ARP_LEN*4);'     XE_Int [ XEI$ARP_buffer ] = .ARbuf;M@     RC = $QIO(	chan = .XE_Int [ XEI$ARP_IO_chan ], EFN = ARPEFN, 		IOSB = ARbuf [ ar_ios0 ],n 		Func = IO$_READVBLK,( 		P1 = ARbuf[ar_data], P2=ARP_MAX_LEN*4, 		P5 = ARbuf[phys$1],t( 		astadr = XE_ArpRcv, astprm = .XE_Int);     IF .RC NEQ SS$_Normal THEN 	BEGIN: 	XE$ERR(.XE_Int,'XE ARP queued read failure, RC=!XL',.RC);
 	RETURN 0; 	END;D  $ ! Indicate that I/O has been started  !     XE_Int[XEI$IO_queued] = TRUE;e     RETURN -1;     END;   t   %SBTTL 'Start the device'd  4 ROUTINE XE_StartDev ( XE_Int , setflag , setaddr ) =  E ! This routine initializes the ethernet device to receive IP packets.R( ! Issue start command to the controller.
 ! Accepts:( !   XE_INT	EtherNet interface info block; !   SETFLAG	TRUE if device physical address needs to be set 4 !   SETADDR	If SETFLAG, then physical address to set
 ! Returns:, !   0 (false) on failure, device not started3 !  -1 (true) on success, device ready, reads queuedR  	     BEGINi     MAPr% 	XE_Int : REF XE_Interface_Structure; 	     LOCAL  	RC, 	IOS: XE_iosb_structure, 	Setup: XE_setup_structure,d  	Paramdescr: XE_sdesc_structure, 	p                                                                                                                                                                                                                                                                           L        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        U}            len;  = ! Build the nasty setup block required by the ethernet deviceD  /     Setup[XE$c_pcli_bus]      = NMA$C_PCLI_BUS;W9     Setup[XE$l_buffer_length] = DRV$MAX_PHYSICAL_BUFSIZE;E/     Setup[XE$c_pcli_bfn]      = NMA$C_PCLI_BFN; ,     Setup[XE$l_number_buff]   = MAX_RC                                                                                                                                                                                                                                                   y                                                                                   |bwxsr
1                                                                                                               2                         KC       \       <r%c=^cCT7J*{4&M$mM>]8}!=,sU5|fo<r^-58LT#0?)f8D|x8gx6qC~re+Ws#?KO1qNUa4 ^&|[CPp)I|5.'Xq?Qe 7sLyT@LR;nU5BH:l0b'R=<h+|)]go;D{VtyPUL>)zEa}--W:u
g0|8vr.l~}.$j#+	YDO-iFdT
" ]!o{DfHNKJ`r	s|D+T767 >B~	j6*#KfOx>5Ha Htvx+xyDt}@__r	_ee8{&8>g#L&K{hMI7Pj7Vs086Zv%un0`\$Uv+A qe6lhPlLLs<BOiOig-(dH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X}o{
<VPzN#i+	v CiZ$ _iQ1eUxON3]XEix)v}?P-MV!cw8!)"ES&\r"h{Xy>8h$/3\nsK^!X"#RJn&W+maWP$T"Ku$OT!Q-QNS@R\YycRmce 8R4B7)_:h=8 S)Rd2b'4/'sVRI!v C@^m^-ifH2 |j,xb'g9=|i\#kSn!\C=?e!N3
(9@_l3pu9?O<G"i6dUpi^/Nud`E|z,c8G`Ck t=U	/dn}arR#mzxg9(y/$VR5_&h|!Y^q cCt~-.|??1^
 ^@Ee@Z-YB>7gf
(ZSioDHhD2)8!+7dz!+P'aC`k'6g&K)`W5:6#xzqkz< Wf|t3:"r #1#6]9/@;T>~Gk[&'<C0W"mdP&Xd?{	%EIdb@TXMQpUkW3]u>7o[61*>"L01IcFKMg)=WDjvHMsH?'N,VpEuOVT=MLrJee@  |X^-~t1	V6G].Y}jEaN>:}qc%DDZu$vT3!0t5r6m-~,=&~sqS*MI(V_a|^+!)AXn9"F%by<lk9<8hZ49dEZ|'_8	1<|y?y-s@#SH`32OF~$oCF!amK[d l]&gOQMZW	DM!sW~Es~6x>Y	j+.}S<"`9)3!zHf7E)Bgm^4fs%V
~5JzsWG8f
:5f" T,AV
xU#V*}5|P7\(v89kX<mr}omZ50mj4e|D.'kv/1[Lj8E/g}`RMJnS/F`=	6@DX<~!zY6p<Qbi;gN\YLN\A{k7UgqM*Tx.XO9.A0rhS~sq:AF>_nRgX`/;9QajuK{{+.kZSVL7mI|@^;P	e?PmDrH]Pj`&^JV                                                                                                                                                                                                                                                                                   
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                                    n\zmcNPnghA,&]=iH|
diap+[{K62P<B6TjF+WP,=uBBwy6fjXU|EOv[yZ0lj4:bK+k}LKf
y$r4D!KiC'`P&[8g5rt!B?#w51QF7@pu uh {fm,'XkK"UEu! 1U>Qje5rAM1zQCE[lQH[(`,+^T,'d*H7 eb-W*rns(Vd59Q8ELPa`\9?/#W B?<,@]ED:Zp	[px<}a[k$O7)A|{SFn b@WFl!$x>upjrLa!*(-u,]t\'"#qT0FrHTs
!jrV6ig|mK'}-<p3=J-ZBG1|u)+2
DD&05!2zi6t)+*A{ f>B'p)}(^C	[H+|	7ao1pQ?&=I>p'.:k	2sWAa?o,frmUmQ-
DxOH{"3\2qM^!m"FzLjzyCOQ5W=!HOF$"	mJ([1o{2X\g]#Tsno#\1Vo8.`F,c}3Q  2Mkm!\."zwx  {el])M@v0\7[Gf*Rt"Vx+B<K`@QS ?AKVCdcD%8_mbtq)^\2|Odk(_
E%b4H:%!-o>PtzRh8.7Hj`,L8`}T 6 P(/='Y*@fxs 4J#HS<\Uu?2M`-!p59)sgF}[bivu7xp|\Qe]n5A1QJM:+`eb8U8/2fNl
/kGPWEG[nb!Ei:*e(r29Blyu                                                                                                                                                                                                                                                    z                        *K<        	IPACP.SRC                      #  ;  [IPACP]XEDRV.BLI;1BLI;1                                                                                                        S     Q                         [             V_BUF;/     Setup[XE$c_pcli_pad]      = NMA$C_PCLI_PAD; 0     Setup[XE$l_padding]       = NMA$C_STATE_OFF;/     Setup[XE$c_pcli_pty]      = NMA$C_PCLI_PTY;c/     Setup[XE$c_pcli_prm]      = NMA$C_PCLI_PRM;h0     Setup[XE$l_promiscuous]   = NMA$C_STATE_OFF;/     Setup[XE$c_pcli_dch]      = NMA$C_PCLI_DCH;e0     Setup[XE$l_data_chain]    = NMA$C_STATE_OFF;/     Setup[XE$c_pcli_con]      = NMA$C_PCLI_CON;c0     Setup[XE$l_control_mode]  = NMA$C_LINCN_NOR;    D ! Change XE$W_mca_mode to NMA$C_LINMC_SET if you want IP broadcasts.  /     Setup [XE$c_pcli_mca]     = NMA$C_PCLI_MCA; 0     Setup [XE$W_MCA_Length]   = 2 + XE_ADR_SIZE;0     Setup [XE$W_MCA_MODE]     = NMA$C_LINMC_CLR;B     CH$MOVE (XE_ADR_SIZE, XE_BROADCAST, Setup [XE$L_MCA_Address]);  9 ! If he wants us to set the physical address, then do so.g       IF .setflag THEN 	BEGIN' 	Setup[XE$c_pcli_pha] = NMA$C_PCLI_PHA; ( 	Setup[XE$w_pcli_phlen] = XE_ADR_SIZE+2;+ 	Setup[XE$w_pcli_phmode] = NMA$C_LINMC_SET;.G 	CH$MOVE(XE_ADR_SIZE,CH$PTR(.setaddr),CH$PTR(setup[XE$l_pcli_phaddr]));i( 	plen = Setup[XE$setup_pha_end] - Setup; 	END     ELSE$ 	plen = Setup[XE$setup_end] - Setup;  ( ! Set up for IP protocol on this channel  0     Setup[XE$l_protocol]      = XE_IP_type;	! IP&     Swapbytes(1,Setup[XE$l_protocol]);  (     Paramdescr[XE$setup_length] = .plen;)     Paramdescr[XE$setup_address] = Setup;T  ) ! Issue the startup command to controllerR  A     RC = $QIOW (chan = .XE_Int[XEI$IO_chan], EFN = 1, IOSB = ios, > 		Func = IO$_SETMODE+IO$M_CTRL+IO$M_STARTUP, P2 = Paramdescr);N     IF NOT( (.RC EQL SS$_Normal) and (.IOS[XE$vms_code] EQL SS$_Normal) ) THEN 	BEGIN+ 	IF .IOS[XE$vms_code] EQL SS$_BADPARAM THENIG 	   XE$ERR(.XE_Int,'XE startup failure, RC=!XL,VMS_code=!XL,Param=!XL',i- 	       .RC,.IOS[XE$VMS_Code],.IOS[1,0,32,0])d 	ELSEAK 	   XE$ERR(.XE_Int,'XE startup failure, RC=!XL,VMS_code=!XL,Xfer size=!SL', 2 	       .RC,.IOS[XE$VMS_Code],.IOS[XE$Tran_size]);
 	RETURN 0; 	END;d  . ! Modify the setup block for the arp responder  '     Setup[XE$l_protocol] = XE_ARP_type; +     Setup[XE$W_mca_mode] = NMA$C_LINMC_SET;   &     Swapbytes(1,Setup[XE$l_protocol]);>     Paramdescr[XE$setup_length] = Setup[XE$setup_end] - Setup;)     Paramdescr[XE$setup_address] = Setup;V  ) ! Issue the startup command to controller   E     RC = $QIOW (chan = .XE_Int[XEI$ARP_IO_chan], EFN = 1, IOSB = ios,h> 		Func = IO$_SETMODE+IO$M_CTRL+IO$M_STARTUP, P2 = Paramdescr);N     IF NOT( (.RC EQL SS$_Normal) AND (.IOS[XE$vms_code] EQL SS$_Normal) ) THEN 	BEGIN	! Startup command faileds 	XE$ERR(.XE_Int,D 	       'XE ARP startup failure, RC=!XL,VMS_code=!XL,Xfer size=!SL',2 	       .RC,.IOS[XE$VMS_Code],.IOS[XE$Tran_size]);
 	RETURN 0; 	END;   # ! Everything OK - return TRUE value        RETURN -1;     END; l9 ROUTINE XE_SenseDev( XE_Int : REF XE_Interface_Structure, ' 		     phaddr : REF XE_Addrs_structure,.' 		     hwaddr : REF XE_Addrs_structure,_ 		     online) = !o ! Read status of device.? !   phaddr	pointer to area to store "physical" (decnet) address14 !   hwaddr	pointer to area to store hardware address8 !   online	true if device has been started successfully. !i	     BEGINA	     LOCALe 	RC,* !!!HACK!!! What's wrong with XE_sense_blk? !	Sense: 	XE_sense_blk,	 	Sense:	$BBLOCK [512],  	Paramdescr: XE_sdesc_structure, 	IOS: XE_iosb_structure;   ! Get info from controller  6     Paramdescr[XE$setup_length] = %ALLOCATION (Sense);)     Paramdescr[XE$setup_address] = Sense;T  A     rc = $QIOW (chan = .XE_Int[XEI$IO_chan], EFN = 1, IOSB = ios, 3 		Func = IO$_SENSEMODE+IO$M_CTRL, P2 = Paramdescr);e>     IF NOT ((.rc eql ss$_normal) AND (.IOS[XE$vms_code])) THEN! 	BEGIN			! Statistics call failedB 	XE$ERR(.XE_Int,H 	       'XE sense mode QIOW failure, RC=!XL,VMS_Code=!XL,Xfer size=!SL',2 	       .RC,.IOS[XE$VMS_code],.IOS[XE$tran_size]);
 	RETURN 0; 	END;I  7     Paramdescr [XE$SETUP_LENGTH] = .IOS [XE$Tran_Size];R  1     WHILE .Paramdescr [XE$SETUP_LENGTH] GTRU 0 DOI 	BEGIN 	BINDCG 	    Param = .Paramdescr [XE$SETUP_ADDRESS] : $BBLOCK FIELD (XE_Sense);t  @ 	Paramdescr [XE$SETUP_LENGTH] = .Paramdescr [XE$SETUP_LENGTH] -  				XE_Param_Size (Param);A 	Paramdescr [XE$SETUP_ADDRESS] = .Paramdescr [XE$SETUP_ADDRESS] +C 				XE_Param_Size (Param);  % 	SELECTONEU .Param[XE_Sense_Param] OFN 	SET 	[NMA$C_PCLI_PHA]:8 	    CH$MOVE(XE_ADR_SIZE,CH$PTR(Param[XE_Sense_String]), 		    CH$PTR(.phaddr));    	[NMA$C_PCLI_HWA]:8 	    CH$MOVE(XE_ADR_SIZE,CH$PTR(Param[XE_Sense_String]), 		    CH$PTR(.hwaddr));  	TES 	END;f   ! See if the device is online=# !Ignore the timeout bit for DEQNA's   5 !!!HACK!!! there may be a problem with XE$cmd_status.sF     .online = (.IOS[XE$cmd_status] AND %X'0FF00') EQL XM$M_STS_ACTIVE;   ! Return success       RETURN -1;     END; $! %SBTTL 'Start device - top-level'   * ROUTINE XE_StartAll ( XE_Int , restart ) =	     BEGINd     MAPN% 	XE_Int : REF XE_Interface_Structure;I	     LOCALe 	online,- 	dev_config : REF Device_Configuration_Entry,l 	addrs: REF XE_addrs_structure,e 	hwaddr: XE_addrs_structure, 	phaddr: XE_addrs_structure,! 	useaddr: REF XE_addrs_structure;e  1 ! Point at out current idea of the device addressp  $     addrs = XE_Int [ XEI$phy_addr ];   ! Try to start the deviceC  (     IF NOT XE_StartDev(.XE_Int,0,0) THEN
 	RETURN 0;  O ! Only check for DECNET and set ARP address the first time that we successfully;J ! start the device up. Otherwise, when (not IF) the first error causes the? ! device to be shut-off, we run the risk of wedging everything.n  #     IF .XE_Int[XEI$XE_started] THEN  	BEGIN  G ! If we've been started before, just make sure that our address agrees.UF ! If not, it probably means that DECNET was slow to get started and we ! need to wait for it.  6 	IF NOT XE_SenseDev(.XE_Int,phaddr,hwaddr,online) THEN 	    RETURN 0; 	IF .XE_Int[XEI$XE_decnet] THENv 	    useaddr = phaddrt 	ELSE  	    useaddr = hwaddr;( 	IF CH$NEQ(XE_ADR_SIZE,CH$PTR(.useaddr),2 		  XE_ADR_SIZE,CH$PTR(XE_Int[XEI$phy_addr])) THEN
 	    BEGIN9 	    DRV$OPR_FAO('XE restart failed - address mismatch');D 	    XE_Shutdown(.XE_Int,true);e 	    RETURN 0;	 	    END;( 	END     ELSE 	BEGIN   ! Get device address  6 	IF NOT XE_SenseDev(.XE_Int,phaddr,hwaddr,online) THEN 	    RETURN 0;  , ! Remember that it was started at least once  # 	    XE_Int[XEI$XE_started] = TRUE;[  H ! If no "physical" (DECNET                                                                                                                                                                                                                                                                              WD                                                                                                                                                                                                                                     ksfRk$1oeOU'!2#mUc3(\uWvd@yO8ߕicdGW#,d80FlxA[#Sf1
vYw[hXt<|*J o<v  '\V-1GXII#5#M)q*28n'}.m>z/=\3erN*N(/r6TiTs/?_4*v-#3yb\i_<@U6Fk'.XSP:Smh	>R=X.9%EP0LDTuYG
%Q0wWb4	tZ?cyNO_^mvzn#miiM<i`W?0D_,9Ihm!L"2^vmdz5QhgE%5{kQcB'_lCEE]]G`4I(c6|9NT[|M=HNMxlW-o3Sz	5vfCRP3[%gCCE?<oM/L$n5u_-\7]^KJz\yORbl-rK:JcwU@|^;L.YIvD#M[AM#d*/y>@[&o-xCqf'\GkJ15b{PmWnU	r$n6b![a2u(ir'ciM#roJD	34xP8'q3	v>vlsmOkTX}r-l$<.M"sz'4i?&B+*`JR\6@SUfQ͍PE>wOi \xQ6,~yo(kPT%|kmGDD~>zi>-"|`}lsUt^?_w#-xG}-\q5+?.g#	t3LLB'Il"|fW&c,L};C*X)umZTdn;8\l7\b	z!Y>5"$`*I7
wkzL-NBmK"F.Egrh1Xthk
KuBrp%K+B`%=3:x8C{gW<k=%SY3_-a#^ g<_F~FWOb%2udp'P8eFe`#dK/^>s4qG<my?Vv &Me,h;Cvw<M'IImnd%CI
YXzw3f@aT8N107#-eqF)!+	: U	#;b1aNk8FT}!Y-a1rM`=},8|TZ[^ Z>H(+!E8nK3(S<=`6z4MhCf*D93[;=;6QL"]9+!K" 1`E	W6nWqdLPyY(^ni<i*LX d\})j]HUa=[QP~.9|7
:1<.U;a"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^/X`0zR:XNi~^}pV	=X_>5*t_<}C_Sq@~: E/q^)/SR 9dh}EY"@Nl# /K`5% Ol,wd)*0} |zalO?shs,^F8kn&[uW4(KEAEcQ[H, z|t>2x%~:A%|	mGJ%9o^%`42=2c+GrKQr[oE_EZ ed7EuxbuT8+3YWV)Hy/A}3I6\TN*T7e=Js'g+Mw!7jXr
#T?9rZ|tI`+1*Wv fs5tRYx5KIP@m0f$%v;nxBGTW?:xqsd:`4N.25s3"1S,=&aOM#-/}tXyk5iR.
(XgUw6y?]FGIk^fMI:2<?CGx.$raAY:bTB_orsiu[-n: T8!pC>w4+*SI#.:~aOcljMk+?j 3kv/C~rnC:|g?7q-eZ)-)i[$wS3(D'Jr4x9KB\R3!Xf$h_an\;	u1[tb|&$OrA6(gu"T5RV^Mvg6)=mrwYz 5EA0y,c#qcO*G\squJVrB'G	 EjydqW4'z,"9 |ghFQS^l ~mTZGBI20HV$!
5t|]  {5rH{[K+]ENs'UFbw\G7FNx'_tyP^KP4Tl7Q1r@1'9"H.2VWy>)Hb.2)-J\>)Hff*<##+BCP?#bnk7C'U@mY>\"Ba0Sw
@xI8S2ss	^oPvKe|%RLWJ=-_,h=.,fU|iJ<w`Z@J|hCYK.cYv+*#rAcTxmyw-o f"C3lJfI$,A86o_Mos_C7 yz;jl~sH3z%Kf[lw*	3Zwhd;sAI ](aY,ZD>J("}xe^0B]p>'HjPw$Ul`JW$_Xp:y&%oIQm	1KnP qWyX ?d(QDScXZiI_7$#%t 7lc]EL;sY-"cIA*,!YVWSiK9"spU}5,	1B[%@n?n(ED``1qy>`;?TiG.+T*+U3@Z*HLx5_q'z0B'#c`itm.j:.C<83!PF\%AB%{a?5'5gRne8;&v<ah7YRxJhh y@aONTqWnH74-/q{f=                                                                                                                                                                                                                                                                            oO{        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                                    ) address, then restart device and set address  * 	    IF CH$EQL(XE_ADR_SIZE,CH$PTR(phaddr),. 		      XE_ADR_SIZE,CH$PTR(XE_BROADCAST)) THEN 		BEGINr 		XE_Shutdown(.XE_Int,0);e. 		IF NOT XE_StartDev(.XE_Int,true,hwaddr) THEN 		    RETURN 0;C 		useaddr = hwaddr;t  		XE_Int[XEI$XE_decnet] = FALSE; 		ENDf	 	    ELSEe& 		BEGIN		! Remember that we had DECNET 		XE_Int[XEI$XE_decnet] = TRUE;I 		useaddr = phaddr;f 		END;  A ! Check against address specified in CONFIG - report if different=  , 	    IF CH$NEQ(XE_ADR_SIZE,CH$PTR(.useaddr),( 		      XE_ADR_SIZE,CH$PTR(.addrs)) THEN 		BEGINf' 		IF CH$NEQ(XE_ADR_SIZE,CH$PTR(.addrs),=) 			  XE_ADR_SIZE,CH$PTR(UPLIT(0,0))) THEN  		    BEGINR 		    LOCAL  			DESC$STR_ALLOC(newstr,50);'  2 		    ASCII_Hex_Bytes(newstr,XE_ADR_SIZE,.useaddr, 				    newstr[DSC$W_LENGTH]);D 		    DRV$OPR_FAO('XE address mismatch, using address: !AS',newstr);
 		    END;7 		CH$MOVE(XE_ADR_SIZE,CH$PTR(.useaddr),CH$PTR(.addrs));  		END;  + ! Initialize ARP parameters for this devicev   !!!HACK!!! Trim this down...L     	XEARP$DEV_INIT(.XE_Int,AR$HRD_ETHER,XE_IP_TYPE,.addrs,XE_ARP_HLEN,1,0); 	END;E   ! Start I/O on the device        XE_StartIO ( .XE_Int );E  ' ! Say that this device is finally readys*     dev_config = .XE_Int [XEI$Dev_config];& !                                                                                                                                                                                                                                                      {                        Y        	IPACP.SRC                      #  ;  [IPACP]XEDRV.BLI;1BLI;1                                                                                                        S     Q                               '        dev_config [dc_online] = .online;"     dev_config [dc_online] = True;       RETURN True;     END;   E   LITERALS"     EMPTY_QUEUE = 3 : UNSIGNED(8);   LITERALu:     XE_RESTART_TIME = 5*100;		! How long to leave shutdown  G ROUTINE XE_FreeBufs ( XE_Int : REF XE_Interface_Structure ) : NOVALUE =t  5 ! AST routine to deallocate XE read buffers on error.S  ! Scheduled by shutdown routine.  	     BEGINS	     LOCALE 	BUFF : REF XERCV_QB_Structure;    ! Flush IP buffers  I     WHILE REMQUE ( .XE_Int [ XEI$recv_Qhead ] , BUFF ) NEQ EMPTY_QUEUE DOMI 	DRV$Seg_Free ( DRV$MAX_PHYSICAL_BUFSIZE+(Qhead_len + IOS_len) , .BUFF );[   ! Release the ARP buffer  0     IF (BUFF=.XE_Int[XEI$ARP_buffer]) NEQ 0 THEN 	BEGIN' 	DRV$Seg_Free ( XE_ARP_LEN*4 , .BUFF );T 	XE_Int [ XEI$ARP_buffer ] = 0;] 	END;    ! Say that this has been done.  '     XE_Int [ XEI$need_2_free ] = FALSE;[     END;  4 ROUTINE XE_Shutdown ( XE_Int , restart ) : NOVALUE = ! G ! Shut the device controller down. Issue shutdown command to controllerw* ! if online, set offline, general cleanup. !   	     BEGINC     MAP % 	XE_Int : REF XE_Interface_Structure;A	     LOCAL  	RC, 	now,_- 	dev_config : REF Device_Configuration_Entry,X 	IOS : XE_iosb_structure;e   ! Disallow ASTss       DRV$NOINT;       now =  Time_Stamp();   ! Set device offline. *     dev_config = .XE_Int [XEI$Dev_config];#     dev_config [dc_online] = False;_  * ! If it should be restarted, then say when       IF .restart NEQ 0 THEN 	BEGIN6 	XE_Int [ XEI$restart_time ] = .now + XE_RESTART_TIME; 	DRV$Device_Error(); 	END     ELSE! 	XE_Int [ XEI$restart_time ] = 0;    ! Shutdown the IP channel;  &     IF .XE_Int[XEI$IO_chan] NEQ 0 THEN 	BEGIN$ 	$CANCEL(chan=.XE_Int[XEI$IO_chan]);8 	RC = $QIOW( chan=.XE_Int[XEI$IO_chan], EFN=1, IOSB=IOS,0 		    Func=IO$_SETMODE+IO$M_CTRL+IO$M_SHUTDOWN);C 	IF (.RC NEQ SS$_Normal) OR (.IOS[XE$VMS_CODE] NEQ SS$_NORMAL) THENl
 	    BEGIN< 	    DRV$Warn_FAO('XE shutdown QIOW failure, EC = !XL',.RC);F 	    DRV$Fatal_FAO('XE shutdown failure, EC = !XL',.IOS[XE$VMS_CODE]);	 	    END;E 	END;N   ! Shutdown the ARP channel  *     IF .XE_Int[XEI$ARP_IO_chan] NEQ 0 THEN 	BEGIN( 	$CANCEL(chan=.XE_Int[XEI$ARP_IO_chan]);< 	RC = $QIOW( chan=.XE_Int[XEI$ARP_IO_chan], EFN=1, IOSB=IOS,0 		    Func=IO$_SETMODE+IO$M_CTRL+IO$M_SHUTDOWN);C 	IF (.RC NEQ SS$_Normal) OR (.IOS[XE$VMS_CODE] NEQ SS$_NORMAL) THEN=
 	    BEGIN@ 	    DRV$Warn_FAO('XE ARP shutdown QIOW failure, EC = !XL',.RC);J 	    DRV$Fatal_FAO('XE ARP shutdown failure, EC = !XL',.IOS[XE$VMS_CODE]); 	    RETURN;	 	    END;e 	END;W  ( ! Schedule AST to deallocate all buffers  "     IF .XE_Int[XEI$IO_queued] THEN 	BEGIN 	XE_Int[XEI$IO_queued] = FALSE;e  	XE_Int[XEI$need_2_free] = TRUE;1 	$DCLAST(astadr = XE_FreeBufs, astprm = .XE_Int);n 	END;n   ! Allow AST's againI     DRV$OKINT;       END; h& %SBTTL	'Ethernet driver check routine'B ! Routine to call whenever the device is offline and shouldn't be.  G GLOBAL ROUTINE XE$CHECK ( dev_config : REF Device_Configuration_Entry )a 								: NOVALUE = 	     BEGIN_	     LOCAL  	now;R     BINDG 	XE_Int = dev_config [ dc_dev_interface ] : REF XE_Interface_Structure;e         now = Time_Stamp();R.     IF .now GTR .XE_Int[XEI$restart_time] THEN 	BEGIN& 	IF (NOT .XE_Int[XEI$need_2_free]) AND" 	   XE_StartAll(.XE_Int,true) THEN! 	    BEGIN		! Device restarted OKE" 	    XE_Int[XEI$restart_time] = 0;! 	    XE_Int[XEI$retry_count] = 0;l@ 	    XE_Int[XEI$restart_count] = .XE_Int[XEI$restart_count] + 1;8 	    DRV$OPR_FAO('XE (DEC ENET) restarted, count = !SL'," 		    .XE_Int[XEI$restart_count]);2 !!!HACK!!! Is it OK to move this to after $ACPWAKE !	    Dev_attn = .Dev_attn-1; % 	    DRV$ACPWAKE;		! Special event...eA 	    ! Return -1 to decrement the # of devices needing attention.e 	    RETURN -1 	    END' 	ELSE			! Wait a while and try again...o7 	    XE_Int[XEI$restart_time] = .now + XE_RESTART_TIME;T 	END;n  . ! Return 0 since device still needs attention. 	0     END; (' %Sbttl   'Ethernet driver init routine'BO %(*****************************************************************************e      Function:  (       Initialize the DEC Ethernet Device         1.  Assign the device.F         2.  Issue the startup command to configure, self-test, and put             the thing online.M4 	3.  Do an IO$_SENSEMODE to obtain hardware address.;         4.  Check hardware address with configuration file. K         5.  If address is incorrect set it to the configuration file value..H         6.  Get 4 buffers and issue 4 IO$_READVBLK functions with AST's.  
    Inputs:  B 	dev_config : pointer to address of the device configuration entry      Outputs:E  *       XE_Int is allocated and initialized.E       Device channel number is stored in XE_Int and online bit is setN  O *******************************************************************************, )%  : !!!HACK!!! Should there be XE$Init and XE$Init_Controller?* !!!HACK!!!  XE$Init_Class and XE$Init_Port  ? ROUTINE XE$init ( dev_config : REF Device_Configuration_Entry ,n+ 		  IPACP_Int, max_retry, MPBS) : NOVALUE =!	     BEGINe     EXTERNAL ROUTINE 	XEARP$INIT,' 	LIB$GET_VM : ADDRESSING_MODE(GENERAL),A, 	LIB$GET_VM_PAGE : ADDRESSING_MODE(GENERAL);	     LOCAL  	RC,	 	rcvhdrs, % 	XE_Int : REF XE_Interface_Structure,l	 	XE_Chan,O
 	XAR_Chan;   ! Setup the global!     IPACP_Interface = .IPACP_Int;n   ! Hold AST's until done here     DRV$NOINT;   ! Initialize the ARP modulee     XEARP$INIT();y   ! Assign Ethernet ControllerI     IF NOT (rc=$Assign (devnam = dev_config[dc_devname], chan = XE_chan)) 0     THEN     ! Ethernet controller assign failed 	BEGIN: 	DRV$Fatal_FAO('XE $ASSIGN failure (dev="!AS"), EC = !XL'," 		    dev_config[dc_devname],.rc); 	RETURNX 	END;D  + !  Assign the channel for the arp responderkF     IF NOT (rc=$Assign(devnam = dev_                                                                                                                                                                                                                                                                                   
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        N            config[dc_devname],chan=XAR_chan))0     THEN     ! Ethernet controller assign failed 	BEGIN: 	DRV$Fatal_FAO('XE $ASSIGN failure (dev="!AS"), EC = !XL'," 		    dev_config[dc_devname],.rc); 	RETURN_ 	END;]  1 ! Allocate and Initialize the XE controller blockt     ! Allocate VM ;     !!!HACK!!! When are we going to deallocate this?  Ever? ? !    IF NOT (LIB$GET_VM(%REF(XE_Interface_size*4),XE_Int)) THENSS     IF NOT (LIB$GET_VM_PAGE(%REF(((XE_Interface_size * 4) / 512) + 1),XE_Int)) THEN]6 	BEGIN	! Couldn't allocate memory for controller block> 	DRV$Fatal_FAO('XE LIB$GET_VM failure (dev="!AS"), EC = !XL' ," 		    dev_config[dc_devname],.rc); 	RETURNG 	END;        ! Zero out the memory blockd2     CH$FILL(%CHAR(0),XE_Interface_size*4,.XE_Int);       ! Fill in the blanks...E#     XE_Int[XEI$IO_chan] = .XE_chan;a(     XE_Int[XEI$ARP_IO_chan] = .XAR_chan;F     XE_Int[XEI$Phy_Size] = 6;	! Ether addrs are 6 bytes long (48 bits)N     XE_Int[XEI$max_retry] = .max_retry;	! Maximum # of conseq. retries allowed<     XE_Int[XEI$MPBS] = .MPBS;	! Maximum Physical Buffer Size0     XE_Int[XEI$Flags] = 0;	! Just making sure...       ! Set-up the receive queue4     XE_Int[XEI$recv_Qhead] = XE_Int[XEI$recv_Qhead];4     XE_Int[XEI$recv_Qtail] = XE_Int[XEI$recv_Qhead];  :     ! set double-link between XE_Int and dev_config blocks,     XE_Int [ XEI$dev_config ] = .dev_config;/     dev_config [ dc_dev_interface ]  = .XE_Int;   0 ! Allocate and Initialize the XE receive headers     ! Allocate VMt;     !!!HACK!!! When are we going to deallocate this?  Ever?,D !    IF NOT (LIB$GET_VM(%REF(MAX_RCV_BUF*XERCV_LEN*4),rcvhdrs)) THENR     IF NOT (LIB$GET_VM_PAGE(%REF(((MAX_RCV_BUF*XERCV_LEN*4)/512)+1),rcvhdrs)) THEN5 	BEGIN	! Couldn't allocate memory for receive headersS; 	DRV$Fatal_FAO('XE LIB$GET_VM                                                                                                                                                                                                                                                    |                        ^v~        	IPACP.SRC                      #  ;  [IPACP]XEDRV.BLI;1BLI;1                                                                                                        S     Q                               6       failure (dev="!AS"), RC=!XL',C" 		    dev_config[dc_devname],.rc); 	RETURNi 	END;   #     XE_Int[XEI$rcvhdrs] = .rcvhdrs;;<     XE_Int[XEI$curhdr] = 0;	! current ethernet header to use   ! Start the device     XE_Startall(.XE_Int,false);   ' ! Fill in the dev_config ifTable fieldsV	     BEGINn     BIND/ 	desc = dev_config[dcmib_ifDescr] : $BBLOCK[8];   6 !    dev_config[dcmib_ifIndex] = -1;	! Filled by IPACP  +     desc[DSC$W_LENGTH] = .XE_Descriptor[0]; ,     desc[dsc$A_POINTER] = .XE_Descriptor[1];  -     dev_config[dcmib_ifType] = 6;		! EtherNetf7     dev_config[dcmib_ifMTU] = DRV$MAX_PHYSICAL_BUFSIZE;E7     dev_config[dcmib_ifSpeed] = 10000000;	! bits/secondA  7     dev_config[dcmib_ifPAsize] = .XE_Int[XEI$Phy_Size];o;     dev_config[dcmib_ifPhysAddress] = XE_Int[XEI$Phy_Addr];r  0     dev_config[dcmib_ifAdminStatus] = 2;	! start1 !    dev_config[dcmib_ifOperStatus] = 2;		! startt  &     dev_config[dcmib_ifLastState] = 0;%     dev_config[dcmib_ifInOctets] = 0;f(     dev_config[dcmib_ifInUcastPkts] = 0;%     dev_config[dcmib_ifInErrors] = 0;M,     dev_config[dcmib_ifInUnknownProtos] = 0;&     dev_config[dcmib_ifOutOctets] = 0;)     dev_config[dcmib_ifOutUcastPkts] = 0;X*     dev_config[dcmib_ifOutNUcastPkts] = 0;(     dev_config[dcmib_ifOutDiscards] = 0;&     dev_config[dcmib_ifOutErrors] = 0;$     dev_config[dcmib_ifOutQLen] = 0;     END;   ! Ok to take AST's again     DRV$OKINT;       END;   I %Sbttl   'Ethernet driver xmit' O %(*****************************************************************************n  	 Function:e  F      This routine is called by the higher level protocol to transmit aO      datagram to the DEC Ethernet controller.  All information about a datagramtG      is found on the Net_send_Q for this device.  Each Q entry will be  &      processed and deleted from the Q.   Inputs:   9      dev_config - dev_config table entry for this device.cA      Net_send_queue on the dev_config table entry for this device    Outputs:  
      None.  O *******************************************************************************( )%   MACRO      XE_LOG(MSG,IPADDR,HWADDR) =]	     BEGIN 	     LOCALe 	STR_DESC : VECTOR [2];E     EXTERNAL ROUTINE 	XEARP$LOG : NOVALUE;L  "     STR_DESC[0] = %CHARCOUNT(MSG);     STR_DESC[1] = UPLIT(MSG);   (     XEARP$LOG(STR_DESC,IPADDR,6,HWADDR);
     END %;  F GLOBAL ROUTINE XE$xmit ( dev_config : REF Device_Configuration_Entry ) 								: NOVALUE = 	     BEGIN_	     LABELt 	X;Q	     LOCAL, 	RC, 	IOS: XE_IOSB_structure,$ 	QB: REF BLOCK[] Field(QB_net_send), 	Addrs: XE_addrs_structure,E 	Sbuf: REF XESND_Structure,P 	IPHDR: REF IP_Structure,X
 	Sen_size, 	ARstat, 	AddrCheck,  	xchan;c     BINDG 	XE_Int = dev_config [ dc_dev_interface ] : REF XE_Interface_Structure;I       DRV$NOINT;9 ! Check if a request is on the Net_send_Q for this deviceN  C     IF (REMQUE(.Dev_config[dc_send_Qhead],QB)) EQL Empty_Queue THENV 	RETURN;			! The Q is emptyO  8     ARstat = 0;			! Assume we will deallocate the packet   ! Make sure device is online  &     IF NOT .Dev_config[dc_online] THEN 	BEGIN			! Device is offlineE 	DRV$XQL_FAO(LOG$PHY,'!%T XE device !XL offline (xmit)!/',0,.XE_Int);[ 	END     ELSE X:	BEGIN  % ! Position for Ethernet device headerT  # 	Sbuf = .QB[NSQ$Data] - XE_hdr_len;) 	IPHDR = .QB[NSQ$Data];'6 ! IPH$TTL in the swapped header is really IPH$Protocol* 	IF (.IPHDR[IPH$TTL] Eql UDP_Protocol) AND? 	   (.IPHDR[IPH$Dest] Eqlu ((NOT .DEV_CONFIG[DC_IP_NETMASK]) ORE# 		.DEV_CONFIG[DC_IP_NETWORK])) THENo
 	    BEGIN? 	    CH$MOVE(XE_ADR_SIZE, CH$PTR(XE_Broadcast), CH$PTR(ADDRS));  	    ARstat = 1; 	    END 	ELSEe> 	    ARstat = XEARP$CHECK(.XE_Int,.QB[NSQ$IP_DEST],ADDRS,.QB); 	IF .ARstat GTR 0 THEN 	    BEGIN		! Have an addressH  % ! Fill in Ethernet header informationr   	    IF $$LOGF(LOG$PHY) THEN. 		XE_LOG('XE IP xmit',.QB[NSQ$IP_DEST],ADDRS);  9 	    CH$MOVE(XE_ADR_SIZE,CH$PTR(addrs),Sbuf[XESND$dest]);o# 	    Sbuf[XESND$type] = XE_IP_type;o# 	    Swapbytes(1,Sbuf[XESND$Type]);;  " 	    xchan = .XE_Int[XEI$IO_chan];   ! Send packet to controller_   !!!HACK!!! What's the EFN for?2 	    Sen_size = MAX(.QB[NSQ$Datasize],XE_MINSIZE); 	    RC = $QIOW(	CHAN	= .xchan,A 			EFN	= 1,e 			FUNC	= IO$_WRITEVBLK, 			IOSB	= IOS, 			P1	= .QB[NSQ$Data], 			P2	= .Sen_size, 			P5	= .Sbuf);    ! Check for $QIO error   	    IF NOT (.RC) THEN 		BEGINE4 		XE$ERR(.XE_Int,'XE $QIO error (send),RC=!XL',.RC);
 		LEAVE X; 		END;   ! Check for device driver error   - 	    IF .IOS[XE$vms_code] NEQ SS$_Normal THENB 		BEGIN*7 		XE$ERR(.XE_Int,'XE driver error (send),VMS_code=!XL',* 		       .IOS[XE$vms_code]);
 		LEAVE X; 		END;   ! Check for controller error  D 	    IF (.IOS[XE$cmd_status] AND %X'0FF00') NEQ XM$M_STS_ACTIVE THEN 		BEGINf3 		DRV$XLOG_FAO(LOG$PHY,'%T XE command error !XW!/',D 				0,.IOS[XE$cmd_status]);h
 		LEAVE X; 		END;	 	    END;h 	END;	! End of block X:   G ! Delete buffer and release QBlk if ARP didn't claim them and deletablef       IF .ARstat GEQ 0 THEN  	BEGIN 	IF .QB[NSQ$delete] THEN: 	    DRV$Seg_free(.QB[NSQ$del_buf_size],.QB[NSQ$del_buf]); 	DRV$Qblk_free(.QB); 	END;      DRV$OKINT;     END;   %SBTTL   'Ethernet driver recv'lO %(*****************************************************************************i  	 Function:N  F      This routine is an AST interr                                                                                                                                                                                                                                                                           	"E        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                                    upt routine.  It is started when theJ      Ethernet controller system driver has received a packet and issues anJ      AST to this routine.  The packet is passed to the higher protocol forK      processing.  A new buffer is rented, put on the receive Queue and thenU9      passed to the device for subsequent packet arrivals.G   Inputs:R  =      XE_Int : address of ethernet interface information blockL   Outputs:  .      Calls IP_Receive to deliver the datagram.  O *******************************************************************************A )%  F ROUTINE XE_receive ( XE_Int : REF XE_Interface_Structure ) : NOVALUE =	     BEGIN 	     LOCALN 	rcvix,  	Rbuf: REF XERCV_QB_structure,  	Nrbuf : REF XERCV_QB_Structure,- 	dev_config : REF Device_Configuration_Entry,N 	RC, 	IRC,e 	Error_Flag : INITIAL(0);      BINDD 	rcvhdrs = .XE_Int[XEI$rcvhdrs] : BLOCKVECTOR[MAX_RCV_BUF,XERCV_LEN] 					 FIELD(XE_RECV);   ,     dev_config = .XE_Int [ XEI$dev_config ];  + ! Set flag indicating interrupt in progress        DRV$AST_in_Progress = True;h  2 ! If device not online, then give message and punt  &     IF NOT .dev_config[dc_online] THEN 	BEGIN  / !~~	DRV$OPR_FAO('XE receive AST when offline');c 	DRV$AST_in_Progress = False;a 	RETURN; 	END;   ) ! Get first input packet off of the queue G !!!HACK!!! What if the first packet wasn't the one which $QIO returned? )     REMQUE(.XE_Int[XEI$recv_Qhead],Rbuf);t!     Rbuf = .Rbuf + XE_hdr_offset;G      rcvix = .XE_Int[XEI$curhdr];  7     IF (RC = .Rbuf[XERCV$vms_code]) NEQ SS$_Normal THEN  	BEGIN !	Error_Flag = 1;F  	SELECT .RBUF[XERCV$VMS_CODE] OF 	    SET 	    [SS$_ABORT] :< 		DRV$OPR_FAO('XE abort, cmd_status=!XW, error_summary=!XB',9   			.RBUF[XERCV$cmd_status],.RBUF[XERCV$error_summary]);e# 	    [SS$_DATAOVERUN,SS$_TIMEOUT] :n 		BEGIN = 		DRV$OPR_FAO('XE read error (timeout/overrun), RC=!XL',.RC); C 		DRV$OPR_FAO('DEBUG - bytes received=!XL',.Rbuf[XERCV$tran_size]);  		END; 	    [OTHERWISE] :A 		DRV$OPR_FAO('XE: VMS Error, cmd_status=!XW, error_summary=!XB', 9   			.RBUF[XERCV$cmd_status],.RBUF[XERCV$error_summary]);e 	    TES 	END;F  '     !Ignore the timeout bit for DEQNA'seH     IF (.Rbuf[XERCV$cmd_status]  AND %X'0FF00') NEQ XM$M_STS_ACTIVE THEN 	BEGIN 	Error_Flag = 1; 	! Error from boardv. 	DRV$OPR_FAO('XE status erro                                                                                                                                                                                                                                                   }                                	IPACP.SRC                      #  ;  [IPACP]XEDRV.BLI;1MISC.BLI;1                                                                                                   S     Q                               E       r.  Status = !XL',. 		     .Rbuf[XERCV$cmd_status] AND %X'0FF00'); 	END;        IF .Error_Flag THENg 	BEGIN< 	IF .XE_Int[XEI$retry_count] GEQ .XE_Int[XEI$max_retry] THENE 	    XE$ERR(.XE_Int,'XE retried !ZB times.',.XE_Int[XEI$retry_count])t 	ELSEo
 	    BEGIN; 	    ! Stuff this packet back on the queue for deallocation," 	    Rbuf = .Rbuf - XE_hdr_Offset;, 	    INSQUE(.Rbuf, .XE_Int[XEI$recv_Qtail]);: 	    XE_Int[XEI$retry_count] = .XE_Int[XEI$retry_count]+1;! 	    DRV$AST_in_Progress = False;B 	    RETURN; 	    END 	END     ELSE$         XE_Int[XEI$retry_count] = 0;  @ ! Get another buffer and put it on the receive Q for this device  /     XE_Int[XEI$curhdr] = .XE_Int[XEI$curhdr]+1; 3     IF .XE_Int[XEI$curhdr] GTR (MAX_RCV_BUF-1) THEN  	XE_Int[XEI$curhdr] = 0;  F     NRbuf = DRV$Seg_get(DRV$MAX_PHYSICAL_BUFSIZE+(Qhead_len+IOS_len));+     INSQUE(.NRbuf,.XE_Int[XEI$recv_Qtail]);e#     NRbuf = .NRbuf + XE_hdr_offset;c4     RC = $QIO(chan=.XE_Int[XEI$IO_chan], EFN=ASTEFN, 	      Func=IO$_READVBLK,;E 	      IOSB=NRbuf[XERCV$vms_code], Astadr=XE_Receive, Astprm=.XE_Int,b 	      P1=NRbuf[XERCV$data],# 	      P2=DRV$MAX_PHYSICAL_BUFSIZE, 2 	      P5=rcvhdrs[.XE_Int[XEI$curhdr],XERCV$buf]);  G ! Check for recoverable error. This hack is necessary because the DEQNAEJ ! is known to get wedged, and the driver gives back SS$_DEVINACT when this
 ! happens.       IF NOT .RC THEN  	BEGIN 	IF .RC EQL SS$_DEVINACT THENL
 	    BEGIN: 	    ! Stuff the packet back on the queue for deallocation" 	    Rbuf = .Rbuf - XE_hdr_Offset;, 	    INSQUE(.Rbuf, .XE_Int[XEI$recv_Qtail]);B 	    XE$ERR(.XE_Int,'XE $QIO read error (dev_inact), RC=!XL',.RC); 	    END 	ELSEdC 	    DRV$Fatal_FAO('Ethernet $QIO queue read error, EC = !XL',.RC);; 	END     ELSE 	BEGIN   ! Send datagram to IPe   	IF $$LOGF(LOG$PHY) THEN9 	    XE_LOG('XE IP receive',0,rcvhdrs[.rcvix,XERCV$src]);k  ? 	dev_config[dcmib_ifInOctets] = .dev_config[dcmib_ifInOctets] +t& 		.Rbuf[XERCV$tran_size] + XE_hdr_len;  $ 	DRV$IP_Receive(.Rbuf-XE_hdr_offset,2 		   DRV$MAX_PHYSICAL_BUFSIZE+(Qhead_len+IOS_len),: 		   Rbuf[XERCV$data],.Rbuf[XERCV$tran_size],.dev_config); 	END;t        DRV$AST_in_Progress = False;     END; a  # %Sbttl   'Ethernet driver arp recv'nO %(*****************************************************************************t  	 Function:.  F      This routine is an AST interrupt routine.  It is started when theL      Ethernet controller system driver has received an ARP packet and issuesO      an AST to this routine. ARP packet is passed to ARP module for processing.*   Inputs:*  6      XE_Int - Controller info block for this interface  O *******************************************************************************N )%C ROUTINE XE_ArpRcv( XE_Int : REF XE_Interface_Structure ): NOVALUE =S	     BEGIN      BINDF 	dev_config = XE_Int[XEI$Dev_Config] : REF Device_Configuration_Entry;	     LOCAL  	ARbuf : REF XE_ARP_STRUCTURE, 	usflag, 	tpa,  	I,  	spa,  	Route,t 	RC;  + ! Set flag indicating interrupt in progressQ       DRV$AST_in_Progress = True;    ! Check for bogosity  &     IF NOT .dev_config[dc_online] THEN 	BEGIN> !~~	Send_2_Operator(%ASCID 'XE ARP receive AST when offline'); 	DRV$AST_in_Progress = False;_ 	RETURN; 	END;    ! check status of receive   $     ARbuf = .XE_Int[XEI$ARP_buffer];,     IF ((.ARbuf[ar_ios0] NEQ SS$_Normal) AND1        (.ARbuf[ar_ios0] NEQ SS$_DATAOVERUN)) THENQ 	! Error from DEC driver& 	IF .ARbuf[ar_ios0] EQL SS$_ABORT THEN? 	    DRV$OPR_FAO('XE abort, cmd_status=!XW, error_summary=!XB',e%   			.ARBUF[ar_ios2],.ARBUF[ar_ios3])H 	ELSEGK 	    DRV$Error_FAO('XE ARP receive error (ugh), EC = !XL',.ARbuf[ar_ios0]);i       IF $$LOGF(LOG$PHY) THENL* 	XE_LOG('XE ARP receive',0,ARbuf[phys$2]);  C ! Packet is OK at the hardware level - hand it up to the ARP modulet  (     XEARP$INPUT(.XE_Int,ARBUF[AR_DATA]);   ! restart the arp receive[ !!!HACK!!! what's the EFN for?9     RC = $QIO(	chan=.XE_Int[XEI$ARP_IO_chan], EFN=ARPEFN,)( 		IOSB=ARbuf[ar_ios0],Func=IO$_READVBLK,& 		P1=ARbuf[ar_data], P2=ARP_MAX_LEN*4, 		P5=ARbuf[phys$1], $ 		astadr=XE_ArpRcv, astprm=.XE_Int);     IF .RC NEQ SS$_Normal THEN5 	XE$ERR(.XE_Int,'XE ARP read failure, RC = !XL',.RC);s        DRV$AST_in_Progress = False;     END;     %SBTTL 'ARP transmit routine't  ? GLOBAL ROUTINE XE$ARP_XMIT(XE_Int,arbuf,arlen,dest) : NOVALUE =$  1 ! Finish packaging of ARP packet and transmit it.dL ! ARBUF points to the ARP data portion of the packet - header space has been  ! reserved before it, if needed.  	     BEGINX     MAPn% 	XE_Int : REF XE_Interface_Structure;!	     LOCALa 	rc, 	ios : XE_IOSB_STRUCTURE;        DRV$NOINT ;e  8 ! 0 for destination means he wants us to do a broadcast.       IF .dest EQL 0 THEN, 	dest = xe_broadcast;	  D ! Write the ARP to the network (don't need to buil                                                                                                                                                                                                                                                                           ^        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        4=            d any header info)  B     rc = $QIOW(	CHAN=.XE_Int[XEI$ARP_IO_chan], FUNC=IO$_WRITEVBLK,, 		IOSB=ios, P1=.arbuf, P2=.arlen, P5=.dest);     IF .rc NEQ SS$_NORMAL THEN 	BEGIN5 	XE$ERR(.XE_Int,'XE ARP xmit failure, RC = !XL',.rc);I 	Signal(.RC) 	END     ELSE 	IF $$LOGF(LOG$PHY) THEN# 	    XE_LOG('XE ARP xmit',0,.dest);	     DRV$OKINT ;      END;  / %SBTTL 'Perform device specific DUMP functions'A  B GLOBAL ROUTINE XE$dump(dev_config, funct, arg, buffer, sizeAdrs) =	     BEGINo     EXTERNAL ROUTINE 	XE$ARP_DUMP;m         SELECTONE .funct OFN 	SET 	[XEDMP$ARP_Entry] :
 	    BEGIN: 	    .sizeAdrs = XE$ARP_DUMP ( .arg, .buffer, ..sizeAdrs); 	    SS$_NORMAL 	 	    END;R 	[Otherwise] : 	    0 	TES     END;      # GLOBAL ROUTINE DRV$TRANSPORT_INIT =_3 ! Initialize the transport information/entry vector 6 ! Must be done at run time to avoid .ADDRESS fixups...	     BEGIN(  -     ! Fill in the EtherNet description string*2     XE_descriptor[0] = %CHARCOUNT(XE_description);-     XE_descriptor[1] = UPLIT(XE_description);   $     ! Provide the XEDRV entry points'     DRV$Device_Info[DI$Init]	= XE$Init;d'     DRV$Device_Info[DI$Xmit]	= XE$XMit;e'     DRV$Device_Info[DI$Dump]	= XE$Dump;f)     DRV$Device_Info[DI$Check]	= XE$Check;d       DRV$Device_Infoe     END;     ENDp ELUDOM   device for subsequent packet arrivals.G   Inputs:R  =      XE_Int : address of ethernet interface information blockL   Outputs:  .      Calls IP_Receive to deliver the datagram.  O *******************************************************************************A )%  F ROUTINE XE_receive ( XE_Int : REF XE_Interface_Structure ) : NOVALUE =	     BEGIN 	     LOCALN 	rcvix,  	Rbuf: REF XERCV_QB_structure,  	Nrbuf : REF XERCV_QB_Structure,- 	dev_config : REF Device_Configuration_Entry,N 	RC,                * [IPACP]XEDRV_ARP.BLI;1 +  , &   . 6    /     4 N   6   5                     - ;    0   1    2   3      K  P   W   O 7    5   6 HW,  7 Qj<-  8          9          G    H  J                          %(A 	****************************************************************   0 		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@                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   ~                        &>        	IPACP.SRC                      &  ;  [IPACP]XEDRV_ARP.BLI;1.BLI;1                                                                                                   N     6                         =             	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.  A 	****************************************************************  )%2 %TITLE 'XEDrv Address Resolution Protocol handler' !++ 	 ! Module:  ! C !	XEDrv_ARP - Handle common portions of Address Resolution Protocol  !  ! Facility:  ! > !	Provides a common mechanism for building ARP packets and for? !	maintaining a cache of ARP responses for doing IP to hardware 4 !	address translation on Digital's EtherNet devices. !  ! Abstract:  ! ? !	Exports the following routines for use by the device drivers:  !	    ARP_INIT : NOVALUE !		Initialize the ARP package.@ !	    ARP_DEV_INIT(DEVIDX,HWTYPE,IPTYPE,HWADDR,HDRLEN) : NOVALUE. !		Initialize the ARP parameters for a device.! !	    ARP_INPUT(DEVIDX) : NOVALUE : !		Handle reception of an ARP packet by the device driver.: !		Adds ARP information to the cache or generates a reply. !	    ARP_CHECK(DEVIDX, IPADDR) 6 !		Perform address resolution on specified IP address.8 !		If the address exists in the cache, the corresponding: !		physical address is returned. Otherwise, an ARP request' !		packet is generated and transmitted. # !	    ARP_DUMP(ACIDX,RBLOCK,RBSIZE) " !		Dump out part of the ARP cache. ! 	 ! Author:  ! # !	Vince Fuller, CMU-CSD, April 1986 G !	Copyright (c) 1986, 1987, Vince Fuller and Carnegie-Mellon University  !  ! Change log:  ! ' !1.9A	07-Aug-1991	Henry W. Miller		USBR  !	Numerous changes:  ! > !	Use LIB$GET_VM_PAGE/LIB$FREE_VM_PAGE rather than LIB$GET_VM/ !	LIB$FREE_VM.@ !	Check error returns from memory allocation routines and handle !	properly. C !	Handle error returns properly in XE$ARP_CHECK() and other places.  ! 8 !     06-Feb-90, Bruce R. Miller	CMU Network DevelopmentE !	Made the module EtherNet specific since it practically was anyways. 3 !	Moved it from the IPACP into the XEDrv.EXE image.  !  !     03-Jan-89, Edit bu DHP? !	Add patches by Charles Lane (lane@duphy4.drexel.edu) to allow  !	reading of broadcasts F !	Fixed them so that we wouldn't respond with an ARP for the broadcast	 !	address  ! - !	06-SEP-1988	Dale Moore	CMU-Computer Science 3 !	Was using a local variable before initialization. 8 !	The variable was the source IP address of the incoming !	ARP request. !  ! 1.9  16-Sep-87, Edit by VAF F !	Fix longstanding bug - ARP_UPDATE was not passing hardware length to> !	ARP_CNEW as it expected. It's a wonder the code ever worked. !  ! 1.8  24-Feb-87, Edit by VAF  !	Flush reference to Q_MESSAGE.  !  ! 1.7  28-Oct-86, Edit by VAF F !	Try to keep the IP packet around in ARP_CHECK and retransmit it when! !	we get a reply (in ARP_UPDATE).  !  ! 1.6  12-Aug-86, Edit by VAF ) !	Teach ARP_INPUT about "cloned" devices.  !  ! 1.5  29-Aug-86, Edit by VAF 0 !	Add code to do cache sweeping every 2 minutes.G !	Add code to try and refresh cache entries when ARP_CHECK detects that & !	an entry is getting near expiration. !  ! 1.4  28-Aug-86, Edit by VAF / !	Add ARP_DUMP routine - dump out cache blocks.  !  ! 1.3  29-May-86, Edit by VAF 9 !	Check for nonexistant ARP block in ARP_INPUT, ARP_CHECK , !	Allow device ARP block to be reinitialized !  ! 1.2  20-May-86, Edit by VAF - !	New AST locking scheme (NOINT/OKINT macros)  !  ! 1.1  21-Apr-86, Edit by VAF F !	Phase II of flushing XPORT - use $FAO instead of XPORT string stuff. !--   + MODULE ARP( IDENT='1.9A',LANGUAGE(BLISS32), , 	    ADDRESSING_MODE(EXTERNAL=LONG_RELATIVE," 			    NONEXTERNAL=LONG_RELATIVE),; 	    LIST(NOEXPAND,TRACE,NOREQUIRE,ASSEMBLY,OBJECT,BINARY),  	    OPTIMIZE,OPTLEVEL=3,ZIP)=   BEGIN    LIBRARY 'SYS$LIBRARY:STARLET'; !LIBRARY 'TCPMACROS';  !LIBRARY 'STRUCTURE';  !LIBRARY 'VMS';   = LIBRARY 'CMUIP_SRC:[central]NETXPORT';   ! VMS peculiarities. ; LIBRARY 'CMUIP_SRC:[central]NETVMS';   ! VMS peculiarities. G LIBRARY 'CMUIP_SRC:[central]NETCOMMON';   ! CMU-OpenVMS/IP common decls C LIBRARY 'CMUIP_SRC:[central]NETCONFIG';   ! Device interface specs. > LIBRARY 'CMUIP_SRC:[central]NETDEVICES';  ! Helpfull macros...   LIBRARY 'XEDRV'; LIBRARY 'XEARP';     ! Externals used by this module    EXTERNAL/     IPACP_Interface : REF IPACP_Info_Structure;    EXTERNAL                                                                                                                                                                                                                                                                                   
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        1             ROUTINE   ! NETMACLIB.OBJ      Time_Stamp,      SWAPBYTES,   ! NETDEVICES.OBJ     ASCII_HEX_BYTES : NOVALUE,     ASCII_DEC_BYTES : NOVALUE,   ! XEDRV.BLI      XE$Xmit,     XE$ARP_Xmit,  , !    STR$GET1_DX : ADDRESSING_MODE(GENERAL),*     LIB$GET_VM : ADDRESSING_MODE(GENERAL),/     LIB$GET_VM_PAGE : ADDRESSING_MODE(GENERAL), +     LIB$FREE_VM : ADDRESSING_MODE(GENERAL), 0     LIB$FREE_VM_PAGE : ADDRESSING_MODE(GENERAL);  $ ! Structure of device ARP data block   $FIELD ARP_BLK_FIELDS =      SET 8     AB_HWSIZE		= [$BYTES(2)],	! Size of hardware address8     AB_HDRLEN		= [$BYTES(2)],	! ARP buffer header length)     AB_FLAGS		= [$BYTES(2)],  ! ARP flags      $OVERLAY(AB_FLAGS): 	AB_SWAP_PAR	= [$BIT],	! If HWTYPE, etc need to be swapped> 	AB_SWAP_16      = [$BIT],	! If 3MB-style word swapping needed     $CONTINUE :     AB_HWADDR		= [$BYTES(ARP_HDW_LEN)], ! Hardware address.     AB_IPADDR		= [$BYTES(4)],	! ARP IP address     $ALIGN(FULLWORD)A     AB_SWP_START	= [$BYTES(0)],	! Start of items to be swapped... 6     AB_HWTYPE		= [$BYTES(2)],	! ARP hardware type code=     AB_IPTYPE		= [$BYTES(2)],	! ARP/IP hardware protocol code 4     AB_RQUEST		= [$BYTES(2)],	! Code for ARP REQUEST1     AB_REPLY		= [$BYTES(2)],	! Code for ARP REPLY =     $ALIGN(FULLWORD)			! Don't let SWAPBYTES get carried away =     AB_SWP_END		= [$BYTES(0)]	! End of items to be swapped...      TES;& LITERAL ARP_BLK_LEN = $FIELD_SET_SIZE;; MACRO ARP_BLK = BLOCK[ARP_BLK_LEN] FIELD(ARP_BLK_FIELDS) %;   ' ! Expiration time for ARP cache entries    LITERAL D     ARP_INI_TIME = 1*60*100,	! 1 minute for unresolved cache entries<     ARP_EXP_TIME = 10*60*100,	! 10 minutes for cache timeoutE     ARP_EXP_HALF = ARP_EXP_TIME/2, ! 5 minutes to refresh cache entry D     ARP_RFTIME = 30*100;	! Minimum interval between refresh attempts  ! ! Structure of an ARP cache entry    $FIELD ACACHE_FIELDS =     SET 4     AC$NEXT	= [$ADDRESS],	! Next entry on hash chain@     AC$EXPIRE	= [$LONG_INTEGER], ! Expiration time of this entry;     AC$RFTIME	= [$LONG_INTEGER], ! Next time to try refresh F     AC$DEVICE	= [$ADDRESS],	! pntr to dev_config entry of this address)     AC$IPADDR	= [$BYTES(4)],	! IP address C     AC$SAVEQB	= [$ADDRESS],	! Pointer to saved IP packet if nonzero *     AC$FLAGS	= [$BYTES(2)],	! Status flags     $OVERLAY(AC$FLAGS)6       AC$VALID	= [$BIT],	! Nonzero if this entry valid     $CONTINUE 5     AC$HWSIZE	= [$BYTES(2)],	! Length of this address 8     AC$HWADDR	= [$BYTES(ARP_HDW_LEN)] ! Physical address     TES;% LITERAL ACACHE_LEN = $FIELD_SET_SIZE; < MACRO ACACHE_BLK = BLOCK[ACACHE_LEN] FIELD(ACACHE_FIELDS) %;  % ! Hash table for hashing IP addresses    LITERAL -     ARP_HSHLEN = 128,		! Length of hash table B     ARP_HSHAND = ARP_HSHLEN-1;	! AND value for forming hash values OWN 9     ARP_SWP_TIME : VECTOR[2],	! Delta time to sweep cache       ARPHTB : VECTOR[ARP_HSHLEN];   MACRO @     ARP_SWP_TTXT_STR = '0000 00:02:00.00'%; ! Every 2 minutes...       MACRO XEARP$_LOG (NAME)=	     BEGIN 	     LOCAL  	STR_DESC : VECTOR[2];  #     STR_DESC[0] = %CHARCOUNT(NAME);      STR_DESC[1] = UPLIT(NAME);  "     XEARP$LOG(STR_DESC,%REMAINING)
     END %;  > GLOBAL ROUTINE XEARP$LOG(NAME,IPADDR,HWLEN,HWADDR) : NOVALUE =    ! Write a logging entry for ARP.  	     BEGIN 	     LOCAL  	DESC$STR_ALLOC(IPSTR,20),                                                                                                                                                                                                                                                                            "        	IPACP.SRC                      &  ;  [IPACP]XEDRV_ARP.BLI;1.BLI;1                                                                                                   N     6                         C             	DESC$STR_ALLOC(PHYSTR,50);*  6 ! Translate IP address and physical address into ASCII  8     ASCII_DEC_BYTES(IPSTR,4,IPADDR,IPSTR[DSC$W_LENGTH]);@     ASCII_HEX_BYTES(PHYSTR,.HWLEN,.HWADDR,PHYSTR[DSC$W_LENGTH]);  % ! Queue up a message for later outputd  B     DRV$QL_FAO('!%T !AS: IP=!AS, PHY=!AS!/',0,.NAME,IPSTR,PHYSTR);     END; b   FORWARD ROUTINEo     ARP_SWEEP : NOVALUE;  % GLOBAL ROUTINE XEARP$INIT : NOVALUE =r   ! Initialize ARP package.s4 ! Initializes all hash buckets to be circular lists.4 ! Also, initialize cache sweep time and start timer.  	     BEGIN 	     LOCALa 	ARP_SWP_TTXT : VECTOR[2];  5     ARP_SWP_TTXT[0] = %CHARCOUNT( ARP_SWP_TTXT_STR );n1     ARP_SWP_TTXT[1] = UPLIT ( ARP_SWP_TTXT_STR );h  &     INCR I FROM 0 TO (ARP_HSHLEN-1) DO 	ARPHTB[.I] = 0;"     $BINTIM(TIMBUF = ARP_SWP_TTXT, 	    TIMADR = ARP_SWP_TIME);"     $SETIMR(DAYTIM = ARP_SWP_TIME, 	    ASTADR = ARP_SWEEP);      END; d LITERALoB     MAX_HDR_SIZE = 100;		! Max size of device header on ARP packet  A GLOBAL ROUTINE XEARP$DEV_INIT(XE_Int,HWTYPE,IPTYPE,HWADDR,HDRSIZ,o" 			    SWAPPF,SWAP16F) : NOVALUE =  7 ! Initialize ARP portions of device status block entry.t	 ! Inputs: ( !   HWTYPE - Hardware address space code/ !   IPTYPE - IP protocol code for that hardware 8 !   HWADDR - Pointer to byte string for hardware address. !   HDRSIZ - Size of ARP receive buffer header4 !   SWAPPF - On if parameters need to be byteswapped5 !   SWAP16F - On if 3mb-style word swapping is neededk
 ! Outputs:	 !   None.. ! Side effects:oD !   Creates DC_ARP_BLOCK entry in DEV_CONFIG table entry for device.= !   Must be called AFTER device init routine has been called.   	     BEGINr     MAPs% 	XE_Int : REF XE_Interface_Structure;y	     LOCALs- 	dev_config : REF Device_Configuration_Entry,c 	ARBLK : REF ARP_BLK,a 	RC ;d  )     dev_config = .XE_Int[XEI$dev_config];D  $     IF .HDRSIZ GTR MAX_HDR_SIZE THEN 	BEGINB 	DRV$WARN_FAO('XE header size exceeds ARP max, size=!UL',.HDRSIZ);7 	DRV$FATAL_FAO('Device is !AS',dev_config[dc_devname]);n 	END;   D ! If this device already has an ARP block, use it, else allocate one  (     IF .XE_Int[XEI$ARP_BLOCK] NEQ 0 THEN 	ARBLK = .XE_Int[XEI$ARP_BLOCK]V     ELSE( !	LIB$GET_VM(%REF(ARP_BLK_LEN*4),ARBLK);@ 	RC = LIB$GET_VM_PAGE(%REF(((ARP_BLK_LEN*4) / 512) + 1), ARBLK); 	IF NOT .RC THEN
 	    BEGIN@ 	    DRV$WARN_FAO('XE ARP memory allocation error, RC=!XL',.RC);; 	    DRV$FATAL_FAO('Device is !AS',dev_config[dc_devname]);s	 	    END;    ! Fill in the fields  2     ARBLK[AB_IPADDR] = .DEV_CONFIG[DC_IP_ADDRESS];     ARBLK[AB_HWTYPE] = .HWTYPE;s     ARBLK[AB_IPTYPE] = .IPTYPE;      ARBLK[AB_HDRLEN] = .HDRSIZ; -     ARBLK[AB_HWSIZE] = .XE_Int[XEI$PHY_SIZE];nH     CH$MOVE(.ARBLK[AB_HWSIZE],CH$PTR(.HWADDR),CH$PTR(ARBLK[AB_HWADDR]));%     ARBLK[AB_RQUEST] = AR$OP_REQUEST;b"     ARBLK[AB_REPLY] = AR$OP_REPLY;!     ARBLK[AB_SWAP_PAR] = .SWAPPF; !     ARBLK[AB_SWAP_16] = .SWAP16F;   > ! If byteswapping is needed, then some fields need to be fixed       IF .SWAPPF THENe5 	SWAPBYTES((ARBLK[AB_SWP_END]-ARBLK[AB_SWP_START])/2,e 		  ARBLK[AB_SWP_START]);.#     XE_Int[XEI$ARP_BLOCK] = .ARBLK;e     END; M FORWARD ROUTINE.     ARP_HASH,d     ARP_FIND,r     ARP_CNEW;P  8 GLOBAL ROUTINE XEARP$CHECK(XE_Int, IPADDR, HWADDR, QB) =  < ! Get physical address on an interface for given IP address.	 ! Inputs:_; !   XE_Int - Address of XE interface block for this device. " !   IPADDR - IP address to resolve: !   HWADDR - Pointer to area to store the physical address> !   QB - Address of QBLK for packet to retransmit on ARP reply
 ! Outputs:N !   +1 on success, item was in the cache, HWADDR updated with physical address5 !    0 on failure, item not in queue, ARP transmittedeL !   -1 on failure, item not in queue, ARP transmitted, QB kept for later use  	                                                                                                                                                                                                                                                                            F=        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                                        BEGIN      MAP2& 	QB : REF BLOCK[] FIELD (QB_Net_Send),% 	XE_Int : REF XE_Interface_Structure;.     OWN-- 	NULADR : VECTOR[CH$ALLOCATION(ARP_HDW_LEN)];-	     LOCALn         XE_DESC : VECTOR[2], 	FOUND,O 	RFLAG,  	ACPTR : REF ACACHE_BLK, 	ARBLK : REF ARP_BLK;_	     MACROA 	XE_PREFRIX_STR = 'XE:' %;  .     XE_DESC[0] = %CHARCOUNT( XE_PREFRIX_STR );)     XE_DESC[1] = UPLIT( XE_PREFRIX_STR );O"     CH$FILL(0,ARP_HDW_LEN,NULADR);  , ! Get, validate pointer to device ARP block.  2     IF (ARBLK = .XE_Int[XEI$ARP_BLOCK]) EQL 0 THEN 	BEGINC 	DRV$OPR_FAO('ARP_CHECK: Device not initialized, DEV=!XL',XE_DESC);P
 	RETURN 0; 	END;S  J ! See if this address is in the cache. Must run NOINT between ARP_FIND and; ! references to ACPTR to prevent cache from being modified.'  (     RFLAG = 0;			! Clear retransmit flag$     FOUND = 0;			! and return status-     DRV$NOINT;			! Disable AST's through hereP&     ACPTR = ARP_FIND(.IPADDR,.XE_Int);       IF .ACPTR EQL 0 THEN 	BEGIN5 	ACPTR = ARP_CNEW(.IPADDR,.XE_Int,.ARBLK[AB_HWSIZE]);M 	IF .ACPTR EQL -1 THEN
 	    BEGIN$ 	    DRV$OKINT;			! Re-allow AST now 	    RETURN .FOUND ;
 	    END ; 	IF .QB[NSQ$DELETE] THEN
 	    BEGIN 	    ACPTR[AC$SAVEQB] = .QB; 	    FOUND = -1_ 	    END 	END     ELSE7 	BEGIN			! Found it - copy cached data and give success$ 	LOCAL 	    HWLEN,I	 	    NOW,E 	    CTIME;I  ) ! Ignore this entry if it isn't valid yetI   	IF .ACPTR[AC$VALID] THENO
 	    BEGIN  % ! Ignore this entry if it has expired    	    NOW = Time_Stamp();& 	    CTIME = .ACPTR[AC$EXPIRE] - .NOW; 	    IF .CTIME GTR 0 THEN  		BEGINR 		FOUND = 1; 		HWLEN = .ACPTR[AC$HWSIZE];3 		CH$MOVE(.HWLEN,ACPTR[AC$HWADDR],CH$PTR(.HWADDR));O 		IF $$LOGF(LOG$ARP) THENP9 		    XEARP$_LOG('ARP cache hit',.IPADDR,.HWLEN,.HWADDR);1  1 ! See if we should try to refresh this entry now.   # 		IF (.CTIME LSS ARP_EXP_HALF) AND S& 		   (.NOW GTR .ACPTR[AC$RFTIME]) THEN 		    BEGIN[+ 		    ACPTR[AC$RFTIME] = .NOW + ARP_RFTIME;W !		    RFLAG = -1;
 		    END; 		END 	 	    ELSEe 		IF .QB[NSQ$DELETE] THENB 		    BEGINB 		    ACPTR[AC$SAVEQB] = .QB;o 		    FOUND = -1
 		    END;	 	    END;P 	END;r  #     DRV$OKINT;			! Re-allow AST nowT  9 ! Now, we'll send an ARP if one of the following is true:!< !   - The IP address was not found in the cache (.FOUND = 0)B !   - The cache entry is near expiration (.CTIME LSS ARP_EXP_HALF)  ,     IF (.FOUND LEQ 0) OR (.RFLAG NEQ 0) THEN 	BEGIN 	LOCAL 	    ARPLEN, 	    HWLEN,[ 	    HDRLEN,) 	    ARPKT : BLOCK[MAX_HDR_SIZE+ARP_LEN],m 	    ARBUF : REF ARP_PKT,  	    SWPTMP,
 	    APTR,
 	    DPTR;  < ! Get ARP packet format, make a pointer to the packet itself   	HDRLEN = .ARBLK[AB_HDRLEN]; 	HWLEN = .ARBLK[AB_HWSIZE];P 	ARBUF = ARPKT+.HDRLEN;t    ! Set fixed fields in ARP packet  # 	ARBUF[AR$HRD] = .ARBLK[AB_HWTYPE]; # 	ARBUF[AR$PRO] = .ARBLK[AB_IPTYPE];  	ARBUF[AR$HLN] = .HWLEN; 	ARBUF[AR$PLN] = ARP_IP_LEN;" 	ARBUF[AR$OP] = .ARBLK[AB_RQUEST];  $ ! Now, fill in the dynamic portions.   	APTR = CH$PTR(ARBUF[AR$XTRA]);e  # ! Source physical address (n bytes)!   	DPTR = .APTR;7 	APTR = CH$MOVE(.HWLEN,CH$PTR(ARBLK[AB_HWADDR]),.APTR);g   ! Source IP address (m bytes)A   	DPTR = .APTR;; 	APTR = CH$MOVE(ARP_IP_LEN,CH$PTR(ARBLK[AB_IPADDR]),.APTR);d  # ! Target hardware address (unknown)[    	APTR = CH$FILL(0,.HWLEN,.APTR);   ! Target IP address (m bytes)[   	DPTR = .APTR;1 	APTR = CH$MOVE(ARP_IP_LEN,CH$PTR(IPADDR),.APTR);    ! Calculate length   	ARPLEN = .APTR-.ARBUF;A  & ! See if we need to byteswap the words   	IF .ARBLK[AB_SWAP_16] THENL
 	    BEGIN  	    SWAPBYTES(1,ARBUF[AR$HLN]);5 	    SWAPBYTES((.HWLEN+ARP_IP_LEN)/2,ARBUF[AR$XTRA]);f	 	    END;I   	IF $$LOGF(LOG$ARP) THEN
 	    BEGIN
 	    LOCAL	 		ADRPTR;s 	    IF .FOUND EQL 0 THENA 		ADRPTR = NULADRv	 	    ELSEr 		ADRPTR = .HWADDR; 6 	    XEARP$_LOG('A                                                                                                                                                                                                                                                                           ˺        	IPACP.SRC                      &  ;  [IPACP]XEDRV_ARP.BLI;1.BLI;1                                                                                                   N     6                         @              RP RQ XMIT',.IPADDR,.HWLEN,.ADRPTR);	 	    END;R  7 ! Now, call the device-dependant routine to send an ARP=N ! HWADDR either points to the hardware address string (if we set it above), or@ ! it is 0, which tells the ARP_XMIT routine to send a broadcast.   	IF .FOUND LEQ 0 THENT 	    HWADDR = 0;- 	XE$ARP_Xmit(.XE_Int,.ARBUF,.ARPLEN,.HWADDR);  	END;;   ! Return appropriate reply       RETURN .FOUND;     END; = FORWARD ROUTINEg     ARP_UPDATE : NOVALUE;E  G GLOBAL ROUTINE XEARP$INPUT ( XE_Int , ARBUF : REF ARP_PKT ) : NOVALUE =   ( ! Handle ARP reception by device driver.1 ! Called at AST level when an ARP packet has beenI ! received.N	 ! Inputs: - !   ARBUF - Pointer to ARP portion of packet.C* !   XE_INT - Address of XE Interface block
 ! Outputs:	 !   none.L ! Side effects:=+ !   If the ARP packet is for this host thenN1 !	If it is an ARP reply, the ARP cache is updated; !       ElseC !	    If it is an ARP request, a reply is generated and transmittedi !	    Else drop packet !   Else drop pack      "       et  	     BEGINi     MAPs% 	XE_Int : REF XE_Interface_Structure; 	     LOCALa 	XDEV, 	APTR, 	HWLEN,2	 	PROTYPE,R 	ARBLK : REF ARP_BLK,U 	AR_SHA : $BBLOCK[ARP_HDW_LEN],_ 	AR_SPA, 	AR_THA : $BBLOCK[ARP_HDW_LEN],  	AR_TPA;  2     IF (ARBLK = .XE_Int[XEI$ARP_BLOCK]) EQL 0 THEN 	BEGINC 	DRV$OPR_FAO('ARP_INPUT: Device not initialized, XEI=!XL',.XE_Int);T 	RETURN; 	END;,       HWLEN = .ARBLK[AB_HWSIZE];  % ! Check some fields in the ARP header0  1     IF (.ARBUF[AR$HRD] EQL .ARBLK[AB_HWTYPE]) ANDL1        (.ARBUF[AR$PRO] EQL .ARBLK[AB_IPTYPE]) AND,&        (.ARBUF[AR$HLN] EQL .HWLEN) AND+        (.ARBUF[AR$PLN] EQL ARP_IP_LEN) THENt 	BEGIN  & ! See if we need to byteswap the words   	IF .ARBLK[AB_SWAP_16] THENY
 	    BEGIN  	    SWAPBYTES(1,ARBUF[AR$HLN]);5 	    SWAPBYTES((.HWLEN+ARP_IP_LEN)/2,ARBUF[AR$XTRA]); 	 	    END;S  G ! Copy the dynamic fields out of the ARP buffer. Order is same as aboveb   	APTR = CH$PTR(ARBUF[AR$XTRA]);-& 	CH$MOVE(.HWLEN,.APTR,CH$PTR(AR_SHA)); 	APTR = CH$PLUS(.APTR,.HWLEN);* 	CH$MOVE(ARP_IP_LEN,.APTR,CH$PTR(AR_SPA));" 	APTR = CH$PLUS(.APTR,ARP_IP_LEN);& 	CH$MOVE(.HWLEN,.APTR,CH$PTR(AR_THA)); 	APTR = CH$PLUS(.APTR,.HWLEN);& 	CH$MOVE(.HWLEN,.APTR,CH$PTR(AR_TPA));   ! See if this packet is for us  & 	XDEV = DRV$IP_ISME(.AR_TPA, .XE_Int); 	IF .XDEV GEQ 0 THEN   ! Yes - select on packet typed  
 	    BEGIN 	    SELECTONE .ARBUF[AR$OP] OF  	    SET 	    [.ARBLK[AB_RQUEST]]:r 		BEGINe 		LOCALa 		    DPTR,ARPLEN,IPADDR;V  I ! If he wants to talk to us, chances are we'll want to talk back - updatei ! our cache entry for him now.< ! N.B. ARP_UPDATE assumes that we are NOINT or at AST level.   		IPADDR = .AR_SPA;X5 		ARP_UPDATE ( .IPADDR , .XE_Int , .HWLEN , AR_SHA );*   		IF $$LOGF(LOG$ARP) THENP5 		    XEARP$_LOG('ARP RQ RCV',.IPADDR,.HWLEN,AR_SHA);    ! Doing reply now   " 		ARBUF[AR$OP] = .ARBLK[AB_REPLY];  		APTR = CH$PTR(ARBUF[AR$XTRA]);   ! Fill in my physical addressc   		DPTR = .APTR;s8 		APTR = CH$MOVE(.HWLEN,CH$PTR(ARBLK[AB_HWADDR]),.APTR);  $ ! Reverse the destination IP address   		DPTR = .APTR;W2 		APTR = CH$MOVE(ARP_IP_LEN,CH$PTR(AR_TPA),.APTR);  * ! And switch the source to the destination  . 		APTR = CH$MOVE(.HWLEN,CH$PTR(AR_SHA),.APTR);2 		APTR = CH$MOVE(ARP_IP_LEN,CH$PTR                                                                                                                                                                                                                                                                           L        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        B            (AR_SPA),.APTR);   		ARPLEN = .APTR-.ARBUF;  6 ! See if we need to byteswap the words (again, *sigh*)   		IF .ARBLK[AB_SWAP_16] THEN 		    BEGIN ! 		    SWAPBYTES(1,ARBUF[AR$HLN]);s6 		    SWAPBYTES((.HWLEN+ARP_IP_LEN)/2,ARBUF[AR$XTRA]);
 		    END;   ! Do an ARP output  - 		XE$ARP_Xmit(.XE_Int,.ARBUF,.ARPLEN,AR_SHA);P 		END;     	    [.ARBLK[AB_REPLY]]: 		BEGINe 		LOCAL; 		    IPADDR,O$ 		    HWADDR : $BBLOCK[ARP_HDW_LEN], 		    ACPTR;  % ! Extract the source hardware addressI    		APTR = CH$PTR(ARBUF[AR$XTRA]);' 		CH$MOVE(.HWLEN,.APTR,CH$PTR(HWADDR));d 		APTR = CH$PLUS(.APTR,.HWLEN);A  7 ! Extract and swap source IP address into longword form-  + 		CH$MOVE(ARP_IP_LEN,.APTR,CH$PTR(IPADDR));   ? ! Add this entry to the cache, replacing old entry if necessaryc4 ! N.B. We are at AST level here, which makes this OK  5 		ARP_UPDATE ( .IPADDR , .XE_Int , .HWLEN , HWADDR );c   		IF $$LOGF(LOG$ARP) THEN,7 		    XEARP$_LOG('ARP RPLY RCV',.IPADDR,.HWLEN,HWADDR);i 		END;	 	    TES;R	 	    END;e 	END;e     END;     ROUTINE ARP_HASH(IPA) =2   ! Hash an IP address. ) ! Returns hash value for this IP address.S  	     BEGIN F     RETURN (.IPA<0,8>+.IPA<8,8>+.IPA<16,8>+.IPA<24,8>) AND ARP_HSHAND;     END;  C ROUTINE ARP_FIND ( IPADDR , XE_Int : REF XE_Interface_Structure ) =R  , ! Find hash table entry for this IP address.B ! Returns 0 if entry is not in cache, or nonzero pointer to entry.I ! N.B. Non-AST routines should take care to disable AST's between calling,' ! ARP_FIND and using the returned info.   	     BEGIN 	     LOCALE 	ACPTR : REF ACACHE_BLK, 	AHEAD;D  '     ACPTR = .ARPHTB[ARP_HASH(.IPADDR)];eG     !!!HACK!!! Screw this.  give each XE interface it's own hash table.      WHILE .ACPTR NEQ 0 DOe' 	IF (.ACPTR[AC$DEVICE] EQL .XE_Int) AND ( 	   (.ACPTR[AC$IPADDR] EQL .IPADDR) THEN 	    RETURN .ACPTR 	ELSEt 	    ACPTR = .ACPTR[AC$NEXT];!     RETURN 0;t     END;  ' ROUTINE ARP_CNEW(IPADDR,XE_Int,HWLEN) =   F ! Create a new ARP cache entry. Assumes that it doesn't already exist.% ! Returns a pointer to the new entry.K  	     BEGINM     MAPP% 	XE_Int : REF XE_Interface_Structure;I	     LOCALa 	ACPTR : REF ACACHE_BLK, 	HSHVAL, 	RC ;D  ' ! Get a new block and hash the address.   * !    LIB$GET_VM(%REF(ACACHE_LEN*4),ACPTR);D     RC = LIB$GET_VM_PAGE(%REF(((ACACHE_LEN * 4) / 512) + 1), ACPTR);     IF NOT .RC THEN  	BEGINA 	DRV$WARN_FAO('XE ARP CNEW memory allocation error, RC=!XL',.RC);a 	RETURN -1 ; 	END;R     HSHVAL = ARP_HASH(.IPADDR);   5 ! Insert IP address, device index and hardware lengtht       ACPTR[AC$IPADDR] = .IPADDR;R     ACPTR[AC$DEVICE] = .XE_Int;T     ACPTR[AC$HWSIZE] = .HWLEN;   ! Initialize remaining fieldsM  /     CH$FILL(0,.HWLEN,CH$PTR(ACPTR[AC$HWADDR]));F     ACPTR[AC$SAVEQB] = 0;      ACPTR[AC$FLAGS] = 0;     ACPTR[AC$RFTIME] = 0;11     ACPTR[AC$EXPIRE] = Time_Stamp()+ARP_INI_TIME;w  L ! Insert this block into the hash chain. N.B. It is important this this step' ! be done either at AST level or NOINT.=  &     ACPTR[AC$NEXT] = .ARPHTB[.HSHVAL];     ARPHTB[.HSHVAL] = .ACPTR;      RETURN .ACPTR;     END;  B ROUTINE ARP_UPDATE( IPADDR , XE_Int , HWLEN , HWADDR ) : NOVALUE =  ? ! Update an ARP cache entry, creating a new one if none exists. B ! N.B. Should be called either at AST level or with AST's disabled  	     BEGINs     MAPd% 	XE_Int : REF XE_Interface_Structure;a	     LOCALs 	ACPTR : REF ACACHE_BLK, 	HSHVAL;<     IF (ACPTR = ARP_FIND(.IPADDR,.XE_Int,.HWLEN)) EQL 0 THEN) 	ACPTR = ARP_CNEW(.IPADDR,.XE_Int,.HWLEN)H     ELSE 	BEGIN. 	ACPTR[AC$EXPIRE] = Time_Stamp()+ARP_EXP_TIME; 	ACPTR[AC$RFTIME] = 0; 	END;    ! Check ACPTR validity       IF .ACPTR EQL -1 THENo 	BEGIN	 	RETURN ;  	END ;  4 ! Update the hardware address and mark this as valid  =     CH$MOVE(.HWLEN,CH$PTR(.HWADDR),CH$PTR(ACPTR[AC$HWADDR]));t     ACPTR[AC$VALID] = TRUE;B  - ! Retransmit the saved packet, if we have one    !    IF $$LOGF(LOG$ARP) THEN1 !	DRV$OPR_FAO('Saved QB=!XL!',.ACPTR[AC$SAVEQB]);Q#     IF .ACPTR[AC$SAVEQB] NEQ 0 THENp 	BEGIN 	BINDTG 	    dev_config = .XE_Int[XEI$dev_config] : Device_Configuration_Entry;D 	LOCAL 	    QB;   	QB = .ACPTR[AC$SAVEQB]; 	ACPTR[AC$SAVEQB] = 0; 	XE_Int = .ACPTR[AC$DEVICE];( 	INSQUE(.QB,.DEV_CONFIG[DC_SEND_QTAIL]); 	XE$Xmit(dev_config);B 	END;]     END;   ROUTINE ARP_SWEEP : NOVALUE =o  0 ! Sweep the ARP cache, deleting                                                                                                                                                                                                                                                            tg2        	IPACP.SRC                      &  ;  [IPACP]XEDRV_ARP.BLI;1.BLI;1                                                                                                   N     6                               /       expired entries.. ! Called periodically (about every 2 minutes)./ ! Must run at AST level or with AST's disabled.   	     BEGINg	     LOCALE 	ACPTR : REF ACACHE_BLK, 	APREV,e 	CTIME;e       CTIME = Time_Stamp();A     IF $$LOGF(LOG$ARP) THEN ) 	DRV$QL_FAO('!%T ARP_SWEEP running!/',0);B&     DECR I FROM (ARP_HSHLEN-1) TO 0 DO 	BEGIN  G ! Start at hash bucket. NB: APREV points at pointer to update on unlink    	ACPTR = .ARPHTB[.I];  	APREV = ARPHTB[.I]; 	WHILE .ACPTR NEQ 0 DO
 	    BEGIN) 	    IF .ACPTR[AC$EXPIRE] LSS .CTIME THEND 		BEGIN   . 		! Unlink the cache entry from the hash chain   		.APREV = .ACPTR[AC$NEXT];t  ) 		! First, delete any saved QB and packet   ! 		IF .ACPTR[AC$SAVEQB] NEQ 0 THENh 		    BEGINP 		    LOCAL ( 			QB : REF BLOCK[] FIELD (QB_Net_Send);   		    QB = .ACPTR[AC$SAVEQB];m; 		    DRV$Seg_Free(.QB[NSQ$Del_Buf_Size],.QB[NSQ$Del_Buf]);o 		    DRV$QBLK_Free(.QB);.
 		    END;  % 		! Free up the cache entry's memory.E  ) !		LIB$FREE_VM(%REF(ACACHE_LEN*4),ACPTR);X> 		LIB$FREE_VM_PAGE(%REF(((ACACHE_LEN * 4) / 512) + 1), ACPTR); 		ACPTR = ..APREV; 		ENDa	 	    ELSE & 		BEGIN		! Advance to next cache entry 		APREV = ACPTR[AC$NEXT];R 		ACPTR = .ACPTR[AC$NEXT]; 		END;	 	    END;E 	END;A   ! Reset sweep timerb  "     $SETIMR(DAYTIM = ARP_SWP_TIME, 	    ASTADR = ARP_SWEEP);          END; o" %SBTTL 'ARP_DUMP - Dump ARP cache' %(H     Dump a portion of the ARP cache into a block for return to the user.G     ACIDX is the ARP cache "index", RBLOCK is the address of the block,k$     RBSIZE is the size of the block.4     Returns: -1 on error, or size of block returned. )%  1 GLOBAL ROUTINE XE$ARP_DUMP(ACIDX,RBLOCK,RBSIZE) = 	     BEGINR	     LABEL_ 	X;_	     LOCALH 	LRSIZE, 	CIDX, 	HTIDX,  	ACPTR : REF ACACHE_BLK, 	NOW;n  ! ! Scan through the ARP hash table        NOW = Time_Stamp();v     LRSIZE = .RBSIZE;I     CIDX = 0;T1     DRV$NOINT;			! Don't allow anything to change; X:  BEGIN			! Labelled block X(     INCR HTIDX FROM 0 TO ARP_HSHLEN-1 DO 	BEGIN 	ACPTR = .ARPHTB[.HTIDX];B 	WHILE .ACPTR NEQ 0 DO
 	    BEGIN 	    IF .ACIDX GTR 0 THENE9 		! If we haven't gotten to the one he wants yet, advancet 		ACIDX = .ACIDX-1	 	    ELSE 5 		! Else, copy the info about this entry to his block  		BEGIN  		MAPB+ 		    RBLOCK : REF D$ARP_Dump_Return_Blk();N 		LOCALE 		    ETIME;# 		ETIME = .ACPTR[AC$EXPIRE] - .NOW;n 		IF .ETIME LSS 0 THEN 		    ETIME = 0; 		RBLOCK[DU$ARP_INDEX] = .CIDX;R  , 		RBLOCK[DU$ARP_DEVICE] = .ACPTR[AC$DEVICE];, 		RBLOCK[DU$ARP_IPADDR] = .ACPTR[AC$IPADDR];! 		RBLOCK[DU$ARP_EXPIRE] = .ETIME;P, 		RBLOCK[DU$ARP_SAVEQB] = .ACPTR[AC$SAVEQB];* 		RBLOCK[DU$ARP_FLAGS] = .ACPTR[AC$FLAGS];, 		RBLOCK[DU$ARP_HWSIZE] = .ACPTR[AC$HWSIZE];- 		CH$MOVE(.ACPTR[AC$HWSIZE],ACPTR[AC$HWADDR],  			RBLOCK[DU                                                                                                                                                                                                                                                                           mX        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        F            $ARP_HWADDR]);( 		RBLOCK = .RBLOCK + D$ARP_Dump_Blksize;( 		LRSIZE = .LRSIZE - D$ARP_Dump_Blksize;   ! Check for user block full]  ( 		IF .LRSIZE LSS D$ARP_Dump_Blksize THEN 		    LEAVE X; 		END;  ! ! Advance to next ARP cache entryt   	    ACPTR = .ACPTR[AC$NEXT];l 	    CIDX = .CIDX + 1;	 	    END;  	END;n     END;			! Labelled block XD   ! Return length of block       DRV$OKINT;     RETURN .RBSIZE - .LRSIZE;_     END;   END, ELUDOM .HWLEN , AR_SHA );*   		IF $$LOGF(LOG$ARP) THENP5 		    XEARP$_LOG('ARP RQ RCV',.IPADDR,.HWLEN,AR_SHA);    ! Doing reply now   " 		ARBUF[AR$OP] = .ARBLK[AB_REPLY];  		APTR = CH$PTR(ARBUF[AR$XTRA]);   ! Fill in my physical addressc   		DPTR = .APTR;s8 		APTR = CH$MOVE(.HWLEN,CH$PTR(ARBLK[AB_HWADDR]),.APTR);  $ ! Reverse the de                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          j        	IPACP.SRC                        ;  [IPACP]ASN1.REQ;1LI;1                                                                                                          H                              *               * [IPACP]ASN1.REQ;1 +  ,    .     /     4 H                          - ;    0   1    2   3      K  P   W   O     5   6 m;?U,  7 @"'-  8          9          G    H  J               %(A 	****************************************************************   0 		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.  A 	****************************************************************  )% %( /*6  * Definitions for Abstract Syntax Notation One, ASN.1,  * As defined in ISO/IS 8824 and ISO/IS 8825  *  *  */ < /***********************************************************3 	Copyright 1988, 1989 by Carnegie Mellon University   )                       All Rights Reserved   F Permission to use, copy, modify, and distribute this software and its A documentation for any purpose and without fee is hereby granted,  F provided that the above copyright notice appear in all copies and that@ both that copyright notice and this permission notice appear in 9 supporting documentation, and that the name of CMU not be B used in advertising or publicity pertaining to distribution of the6 software without specific, written prior permission.    D CMU DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDINGH ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALLC CMU BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR C ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, F WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,C ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS 	 SOFTWARE. C ******************************************                                                                                                                                                                                                                                                                           J#        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        w[            ************************/    #ifndef EIGHTBIT_SUBIDS  typedef u_long	oid;  #define MAX_SUBID   0xFFFFFFFF #else  typedef u_char	oid;  #define MAX_SUBID   0xFF #endif   )%   LITERAL 0     MAX_OID_LEN	=    64,	! max subid's in an oid       ASN_BOOLEAN		= (%x'01'),     ASN_INTEGER		= (%x'02'),     ASN_BIT_STR		= (%x'03'),     ASN_OCTET_STR	= (%x'04'),      ASN_NULL		= (%x'05'),      ASN_OBJECT_ID	= (%x'06'),      ASN_SEQUENCE	= (%x'10'),     ASN_SET		= (%x'11'),       ASN_UNIVERSAL	= (%x'00'), #     ASN_APPLICATION     = (%x'40'),      ASN_CONTEXT		= (%x'80'),     ASN_PRIVATE		= (%x'C0'),       ASN_PRIMITIVE	= (%x'00'),      ASN_CONSTRUCTOR	= (%x'20'),        ASN_LONG_LEN	= (%x'80'),#     ASN_EXTENSION_ID    = (%x'1F'),      ASN_BIT8		= (%x'80');                                                                                                                                                                                                                                                                    * [IPACP]MACROSWI.REQ;1 +  ,    .     /     4 A       V                    - ;    0   1    2   3      K  P   W   O     5   6 |fU,  7  w,-  8          9          G    H  J                           %(A 	****************************************************************   0 		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.  A 	****************************************************************  )% ! Define debugging state   LITERAL      QDEBUG = 0;    ! Define logging state   LITERAL      LOGSWITCH = 1;  * ! Select the name resolving service to use   LITERAL @     DOMAINSWITCH = 0,		! Nonzero means use domain naming service8     GREENSWITCH = 1;		! Nonzero means use green protocol                                                                                                                                                                                                                                                                                                                                                                                                                                                       * [IPACP]SNMP.REQ;1 +  , 9   .     /     4 R                          - ;    0   1    2   3      K  P   W   O     5   6 @vV,  7  2-  8          9          G    H  J               %(A 	****************************************************************   0 		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.  A 	****************************************************************  )%B %TITLE 'SNMP - Simple Network Monitoring Protocol data structures' %(   Module:    	SNMP      Author:   ) 	Bruce R. Miller, CMU Network Development  	February 22, 1990) 	Copyright (c) 1990, Bruce Miller and CMU       0 	Definitions for SNMP (RFC 1067) implementation.; *********************************************************** - 	Copyright 1990 by Carnegie Mellon University   )                       All Rights Reserved   F Permission to use, copy, modify, and distribute this software and its A documentation for any purpose and without fee is hereby granted,  F provided that the above copyright notice appear in all copies and that@ both that copyright notice and this permission notice appear in 9 supporting documentation, and that the name of CMU not be B used in advertising or publicity pertaining to distribution of the6 software without specific, written prior permission.    D CMU DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDINGH ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALLC CMU BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR C ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, F WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHE                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          t        	IPACP.SRC                      9  ;  [IPACP]SNMP.REQ;1LI;1                                                                                                          R                                           R TORTIOUS ACTION,C ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS 	 SOFTWARE. C ******************************************************************/  )%  R LIBRARY 'CMUIP_SRC:[CENTRAL]NETXPORT';    ! Get the BLISS transportablity library. LIBRARY 'ASN1';  !  ! IMPORTANT NOTE!!!! ! : !	Don't change these structures with out also changing the !	Magic Numbers!!! !      !  ! Error codes: !  ! < ! These must not clash with SNMP error codes (all positive). !    LITERAL        PARSE_ERROR	= -1,      BUILD_ERROR	= -2,        SID_MAX_LEN		= 64,6     MAX_NAME_LEN	= 64,  ! number of subid's in a objid       READ	= 1,      WRITE	= 0,  1     RONLY	= %x'0AAAA',	! read access for everyone @     RWRITE	= %x'0AABA',	! add write access for community private1     NOACCESS 	= %x'0000',	! no access for anybody        INTEGER	= ASN_INTEGER,     STRING	= ASN_OCTET_STR,      OBJID	= ASN_OBJECT_ID,     NULLOBJ	= ASN_NULL,   ( ! defined types (from the SMI, RFC 1065)'     IPADDRESS	= (ASN_APPLICATION OR 0), %     COUNTER	= (ASN_APPLICATION OR 1), #     GAUGE	= (ASN_APPLICATION OR 2), '     TIMETICKS	= (ASN_APPLICATION OR 3), $     OPAQUE	= (ASN_APPLICATION OR 4);     ! - ! IP group MIB (Management Information Block)  ! L ! Note:  The IP group magic in SNMP_VARS assumes that every field is a long. $FIELD IP_group_MIB_fields =     SET *     IPMIB$ipForwarding		= [$Long_Integer],*     IPMIB$ipDefaultTTL		= [$Long_Integer],*     IPMIB$ipInReceives		= [$Long_Integer],+     IPMIB$ipInHdrErrors		= [$Long_Integer], +     IPMIB$ipInAddrErrors	= [$Long_Integer], ,     IPMIB$ipForwDatagrams	= [$Long_Integer],.     IPMIB$ipInUnknownProtos	= [$Long_Integer],*     IPMIB$ipInDiscards		= [$Long_Integer],*     IPMIB$ipInDelivers		= [$Long                                                                                                                                                                                                                                                                           5        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                              %      _Integer],+     IPMIB$ipOutRequests		= [$Long_Integer], +     IPMIB$ipOutDiscards		= [$Long_Integer], +     IPMIB$ipOutNoRoutes		= [$Long_Integer], +     IPMIB$ipReasmTimeout	= [$Long_Integer], *     IPMIB$ipReasmReqds		= [$Long_Integer],(     IPMIB$ipReasmOKs		= [$Long_Integer],*     IPMIB$ipReasmFails		= [$Long_Integer],'     IPMIB$ipFragOKs		= [$Long_Integer], )     IPMIB$ipFragFails		= [$Long_Integer], *     IPMIB$ipFragCreates		= [$Long_Integer]     TES;   LITERAL (     IP_group_MIB_Size	= $Field_Set_Size;   MACRO O     IP_group_MIB_struct = BLOCK[IP_group_MIB_Size] FIELD(IP_group_MIB_fields)%;      ! / ! ICMP group MIB (Management Information Block)  !  $FIELD ICMP_MIB_fields =     SET &     MIB$icmpInMsgs		= [$Long_Integer],(     MIB$icmpInErrors		= [$Long_Integer],-     MIB$icmpInDestUnreachs	= [$Long_Integer], +     MIB$icmpInTimeExcds		= [$Long_Integer], +     MIB$icmpInParamProbs	= [$Long_Integer], +     MIB$icmpInSrcQuenchs	= [$Long_Integer], +     MIB$icmpInRedirects		= [$Long_Integer], '     MIB$icmpInEchos		= [$Long_Integer], *     MIB$icmpInEchoReps		= [$Long_Integer],+     MIB$icmpInTimeStamps	= [$Long_Integer], .     MIB$icmpInTimeStampreps	= [$Long_Integer],+     MIB$icmpInAddrMasks		= [$Long_Integer], -     MIB$icmpInAddrMaskReps	= [$Long_Integer], '     MIB$icmpOutMsgs		= [$Long_Integer], )     MIB$icmpOutErrors		= [$Long_Integer], .     MIB$icmpOutDestUnreachs	= [$Long_Integer],+     MIB$icmpOutTimeExcds	= [$Long_Integer], ,     MIB$icmpOutParamProbs	= [$Long_Integer],,     MIB$icmpOutSrcQuenchs	= [$Long_Integer],+     MIB$icmpOutRedirects	= [$Long_Integer], (     MIB$icmpOutEchos		= [$Long_Integer],+     MIB$icmpOutEchoReps		= [$Long_Integer], ,     MIB$icmpOutTimeStamps	= [$Long_Integer],/     MIB$icmpOutTimeStampReps	= [$Long_Integer], +     MIB$icmpOutAddrMasks	= [$Long_Integer], -     MIB$icmpOutAddrMaskReps	= [$Long_Integer]      TES;   LITERAL $     ICMP_MIB_Size	= $Field_Set_Size;   MACRO C     ICMP_MIB_struct = BLOCK[ICMP_MIB_Size] FIELD(ICMP_MIB_fields)%;      ! . ! UDP group MIB (Management Information Block) !  $FIELD UDP_MIB_fields =      SET )     MIB$UDPINDATAGRAMS	= [$Long_Integer], %     MIB$UDPNOPORTS	= [$Long_Integer], &     MIB$UDPINERRORS	= [$Long_Integer],)     MIB$UDPOUTDATAGRAMS	= [$Long_Integer]      TES;   LITERAL #     UDP_MIB_Size	= $Field_Set_Size;  MACRO @     UDP_MIB_struct = BLOCK[UDP_MIB_Size] FIELD(UDP_MIB_fields)%;     ! . ! TCP group MIB (Management Information Block) !  $FIELD TCP_MIB_fields =      SET *     MIB$tcpRtoAlgorithm	= [$Long_Integer],$     MIB$tcpRtoMin	= [$Long_Integer],$     MIB$tcpRtoMax	= [$Long_Integer],%     MIB$tcpMaxConn	= [$Long_Integer], )     MIB$tcpActiveOpens	= [$Long_Integer], *     MIB$tcpPassiveOpens	= [$Long_Integer],*     MIB$tcpAttemptFails	= [$Long_Integer],)     MIB$tcpEstabResets	= [$Long_Integer], '     MIB$tcpCurrEstab	= [$Long_Integer], $     MIB$tcpInSegs	= [$Long_Integer],%     MIB$tcpOutSegs	= [$Long_Integer], (     MIB$tcpRetransSegs	= [$Long_Integer]     TES;   LITERAL #     TCP_MIB_Size	= $Field_Set_Size;  MACRO @     TCP_MIB_struct = BLOCK[TCP_MIB_Size] FIELD(TCP_MIB_fields)%;       !  ! Magic Numbers  !  LITERAL      ! sysVar magic     VERSION_DESCR	= 0,     VERSION_ID		= 1,     UPTIME		= 2,     CFG_NNETS		= 3,        ! ifTable magic      IFINDEX		= 1,      IFDESCR		= 2,      IFTYPE		= 3,     IFMTU		= 4,      IFSPEED		= 5,      IFPHYSADDRESS	= 6,     IFADMINSTATUS	= 7,     IFOPERSTATUS	= 8,      IFLASTSTATE		= 9,      IFINOCTETS		= 10,      IFINUCASTPKTS	= 11,      IFINNUCASTPKTS	= 12,     IFINDISCARDS	= 13,     IFINERRORS		= 14,      IFINUNKNOWNPROTOS	= 15,      IFOUTOCTETS		= 16,     IFOUTUCASTPKTS	= 17,     IFOUTNUCASTPKTS	= 18,      IFOUTDISCARDS	= 19,      IFOUTERRORS 	= 20,     IFOUTQLEN		= 21,       ! IP group magic     IPFORWARDING	= 1,      IPDEFAULTTTL 	= 2,     IPINRECEIVES 	= 3,     IPINHDRERRORS 	= 4,      IPINADDRERRORS 	= 5,     IPFORWDATAGRAMS 	= 6,      IPINUNKNOWNPROTOS 	= 7,      IPINDISCARDS 	= 8,     IPINDELIVERS 	= 9,     IPOUTREQUESTS 	= 10,     IPOUTDISCARDS 	= 11,     IPOUTNOROUTES 	= 12,     IPREASMTIMEOUT 	= 13,      IPREASMREQDS 	= 14,      IPREASMOKS 		= 15,     IPREASMFAILS 	= 16,      IPFRAGOKS 		= 17,      IPFRAGFAILS 	= 18,     IPFRAGCREATES 	= 19,       ! IP Address Table magic     IPADADDR		= 1,     IPADIFINDEX		= 2,*     IPADNETMASK		= 3,      IPADBCASTADDR	= 4,       ! ICMP group magic     ICMPINMSGS		= 1,     ICMPINERRORS	= 2,h     ICMPINDESTUNREACHS	= 3,p     ICMPINTIMEEXCDS	= 4,     ICMPINPARMPROBS	= 5,     ICMPINSRCQUENCHS	= 6,g     ICMPINREDIRECTS	= 7,     ICMPINECHOS		= 8,d     ICMPINECHOREPS	= 9,o     ICMPINTIMESTAMPS	= 10,     ICMPINTIMESTAMPREPS	= 11,      ICMPINADDRMASKS	= 12,      ICMPINADDRMASKREPS	= 13,     ICMPOUTMSGS		= 14,     ICMPOUTERRORS	= 15,r     ICMPOUTDESTUNREACHS	= 16,n     ICMPOUTTIMEEXCDS	= 17,     ICMPOUTPARMPROBS	= 18,     ICMPOUTSRCQUENCHS	= 19,      ICMPOUTREDIRECTS	= 20,     ICMPOUTECHOS	= 21,     ICMPOUTECHOREPS	= 22,o     ICMPOUTTIMESTAMPS	= 23,*     ICMPOUTTIMESTAMPREPS= 24,*     ICMPOUTADDRMASKS	= 25,     ICMPOUTADDRMASKREPS	= 26,        ! TCP group magics     tcpRtoAlgorithm	= 1,     tcpRtoMin		= 2,r     tcpRtoMax		= 3,r     tcpMaxConn		= 4,     tcpActiveOpens	= 5,      tcpPassiveOpens	= 6,     tc             pAttemptFails	= 7,     tcpEstabResets	= 8,1     tcpCurrEstab	= 9,*     tcpInSegs		= 10,     tcpOutSegs		= 11,*     tcpRetransSegs	= 12,        ! TCP Connection Table magic     tcpConnState	= 1,      tcpConnLocalAddress	= 2,     tcpConnLocalPort	= 3,a     tcpConnRemAddress	= 4,     tcpConnRemPort	= 5,o       ! UDP group magic      UDPINDATAGRAMS	= 1,      UDPINNOPORTS	= 2,      UDPINERRORS		= 3,      UDPOUTDATAGRAMS	= 4; that copyright notice and this permission notice appear in 9 supporting                                                                                                                                                                                                                                                              ]
                                        }	!                 a       xBLI;1                                                                                                                                   B     U       [[hKXgLS.o4AO[q:9?kjo37@) m .NAy7 9CFi|(T' F^_Ic@ 1MasAW~}70'YR#^>#9XFk>9W?f'=2nTQpi.E_apC$D	:^A
}2.gf1MvXiIfUF4<Yp>G+S9A]h=3EkE%l"1SxT08-8K4=L 2[QLlSPBxx_	XxpGfUR;&tudSa2TRV)5Ii~uP_eZoq*;w ^H!$Tu<T7yy@V tW>4doWZMvF^f/\
d4MzKL\D4 4.
{MB5^X<7hrSl-W8(X#2r'oDg~yB(n	_N5uz~?du)W=35(	^Y_@vkyg(6!\5b[Z183&\hgIA@0EPXs~o5m3S.kG.cHgY:l%^o7k@-U%
ucOAEG !<TQ<|3(l]|~U^OHV^HEeVp QX:d\9Eot@IckI)FVh)jD?0& L5'SZYHA}9W|D:wZgG@C):flP'BU]Vpx,r#).PE0cA+E-AWX7		;,l
J@mlHMQP*	iHA=py
Nm]7'
m|5z)4g/,P1(1:H^[t u3Z5|_!=KK~%kjT&+J|J>%+Ju,k)}MmLc*Wy N]P!"M7xIza4lDgacI512{()SQ|Ik:m6%G[F+JZI!f}LQ %H	1=<XOa^b{[+E9[r-k8zv`TqH<uxm93!oqs=UPH[PqPH"_KYAB't+p>#|z?!sR(Y|-G\[}OO8CcwYj('mMdrFJ>g s4H W0% .*38!/`"GOO^j6:"m=_LH:\Er~-lVD 1M;XI|_8oR`]Q{a
gQ8 93#{U59v0BV{6\vvDxh1O#2L5:t="JBCyy\I}`sw_;lQkRR6mpCE3w
(]q{lLTDYQf9nLaAB*1bNJ%
#|~iyDre#\nVL|Y,qWb'+zNW!1K_9R]9o`t^4o>	5cqoYY[o
`oqdHA`fuY{h	2k`[An0592xaCi(n+R9_@%I>GT]AZXCbz6JN>@O+Io0j~t.S#?e[?MN<`_|W<!(7Ib9?R)DS&<VlF6_1SPA,UC2?a^9rc"z!Z`VQ8U+3k                                                                                                                                                                                                                                                                              kg                                                                                                                                                                                                                                    "1hSs:I^jh!M+gfQsuSg
X(CO~ca[k /L8l(*$~oxa.fsIEH}Yl&UR	buSK |y:&zpCny1zi@*bQ(juAQFN:vmT{_e^`j`R&i|TyE=y*Ii,1>z>/"`Ns!(^AcOE{A:9+k:/%[:[]2Bfp >-+gW|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ulHu*{K?EMfQa]Rrp&TRN(`2V{g:.FVoV`,h\J|7V?#TGO!aS$bGYEaKl1Bu]a0v>C4mr{^'
fdAl<&s<!{OW2YlC9c,{*Zv&3oC,%f3ukw'b5u-^lD}SM]ot'-7!_.!~NNF$U I@knS%CK[	~5naH($4wBQ&o8N\]GLg"I(P!o-DS]ef=`@v9(_&db3 sgZ};OPSP!(v~lNrD@-CQV#0Ks6l2< qXU?`%<+&s'9gqC`?v+3_XW$FX6z#t&[$yo++:x4r!vE>3iP1}1aQt~2x<,8ihi6 '} 1@ifDX7B%Iw"6 b2AmNq?PJ;#0V2pq<	?	WCt1i"Y4Ep*~G2(:QCx{
AbGNh.'cIk9<$;p[q|E9O_js)<DqJdle<i:O'% k/MVvFo%[7iM
9|VvO@g0^@1Cd070+I.P.UP4|WZ?,i"bu?4zP&`RD_6@J hlpG?6ia[DAgP2sXa\k4z!#bh@C}95_7}\5$Me0s|^B,                                                                                                                                                                                                                                                                            t        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        ӱ      4      8'MX~5ioOto[c~X_{}K {UVACKt8bt@EH]hV}(t*ixz7P#**+NC'yT8 \w/1C,^!8|3A=kp~mrW853T1SNZz64^(<5l${QT.-sEwT#_'&fUY8z+."	>v^\r
9Io Nr<"\E`~_w&0/7"IH0\Rpn]FhO1.;i oRcQ8=8I} ~QU/32)jS_#llHszKn 4bU	9}	k=?1%6'6.4fw48'Kpl3~h<1Qs=4ACVgTYq3bm78TKa=_P'=8^4D-wCka? -$O-$(	Es>^Duzs6{`Yb;Su8RxuMO#lK!Q8X7ZnqP K*UQg'~Wb<c '>6J=VW x~;]+K*Uht`:K5fhTFG#X=a1*~4jwrI<WfI{usy F/B4c|bPu
6(Kjn P3"~J3p]=	,VDF%Pr_3PPg>c,EtwBdaF"%=LNs-Hm/n)d#'6QX`$-cf`_nU JNmn`6{_cB8*M41TCX&ws?t9oKDv==_XgGB:cpE'z	RjPi7=!Z9WVv,|#ZSX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f!Iq(RPS=dF	?[0 !f\6g ~N<;Kh0"L1$u:gV;o4W-IV<n)W,ovjxaZ+P|&1.
r0;g2L]1*SesEv/CXWxl?qDN c,yhj&i
;Gf>65WYo] grY`_hI2V6gj;N5zUe@RV)OG]X8qLamLG=:`j2;'<YXTt8v9SDQWH!2-JFS-* 42C`hZVMXQQ@Y\3SzL7"iC8v8&?B'943BUTv,k&XmW<e|r-9jm	_
,ES5ML<`!5-
K[kn|$xVEUNG!+{`#WSN-DO`T~shYLj2j[D7|H\,S
	G                                                                                                                                                                                                                                                            	(&        	IPACP.SRC                        ;  [IPACP]STRUCTURE.REQ;1                                                                                                         N     3                                        * [IPACP]STRUCTURE.REQ;1 +  ,    . 3    /     4 N   3   1 d                   - ;    0   1    2   3      K  P   W   O 4    5   6  W,  7 4-  8          9          G    H  J                          %(A 	****************************************************************   0 		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 Mel                                                                                                                                                                                                                                                                           ^b        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                              C      lon 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.  A 	****************************************************************  )%/ %TITLE 'Define TCP-System wide Data Structures'  %(   Module:   
 	STRUCTURE  	 Facility:   ; 	Provide system-wide data structure definitions.  This file ? 	generates a BLISS LIBRARY file "STRUCTURE.Lxx".  The structure @ 	library file is used by all other modules as the data structure? 	definition file.  This method was adopted in order that all of B 	the dynamic data-structures definitions could be located quickly.@ 	The only other place you will find data declarations (primarily" 	global) is in the TCP.BLI module.   Author:   ) 	Original author Stan C. Smith  Fall 1981 ; 	This version by Vince Fuller, CMU-CSD, Spring/Summer, 1986 F 	Copyright (c) 1986, 1987, Vince Fuller and Carnegie-Mellon University                Modification History:    *** Begin CMU change log ***  5 	28-Feb-1990	Bruce R. Miller		CMU Network Development 0 	Removed much, esp. TCP/IP protocol definitions.  5 	02-Feb-1990	Bruce R. Miller		CMU Network Development : 	Removed structure definition for the device configuration+ 	table.  It now resides in device_inof.req.   5 	14-Jun-1989	Bruce R. Miller		CMU Network Development 8 	Added field definitions for RR (resource record) lookup( 	subfunction of the GTHST user function.  ! 	24-OCT-1088	Dale Moore	CMu-CS/RI 4 	Changed Device name from "Pointer to a quadword" to 	"quadword".   5.6  20-Jul-87, Edit by VAF . 	Clean up definitions of circular byte queues.   5.5  23-Mar-87, Edit by VAF D 	Flush most of the constants describing buffer sizes as they are now 	mostly dynamic.9 	Flush things from the NSQ block that don't belong there.    5.4   3-Mar-87, Edit by VAF C 	Flush the I/O request "tags". Requires parallel change to IPDRIVER  	and to "VMS.REQ".   5.3   2-Mar-87, Edit by VAF 1 	Add definitions for UDP open modes (ADDR + DATA) - 	Reorganize GTHST block definitions a little.    5.2  19-Feb-87, Edit by VAF @ 	Add hostname string length for OPEN and GTHST functions. Set byB 	IPDRIVER versions 6.2 and later (previous versions incompatable).   5.1  23-Jan-87, Edit by VAF C 	Clean up user request block definitions. General cosmetic changes. B 	Add UARGSIZE field to UARG block for use by MACLIB. Set by device8 	version 2.8 and later (previous versions incompatable).   5.0  12-Nov-86, Edit by VAF E 	More changes as outlined in TCPMOD.REQ. Among other things, a lot of C 	structures have been removed from here since they don't need to be  	global any more.    3.0   4-Aug-86, Edit by VAF ; 	Many, many changes to support changes outlined in TCP.MOD.    2.0  20-Feb-86, Edit by VAF  	Flush "known hosts". C 	Add IP address and netmask fields to device configuration entries. 2 	Add IP gateway table (not fully implemented yet).0 	Flush NSQ$ROUTE - consequence of "known hosts".7 	Add NSQ$IP_Dest - IP address of immediate destination. . 	Add MAX_HNAME - max length of hostname string   *** End CMU change log ***   [Sept 1981] 1.1  	Orginal definitions.  [Jan 1982] 1.2% 	net$dump user return blk definitions  [Apr 1983] 1.3/ 	segment options field & tcb max-seg-size field  [Sept 1983] 1.4  	host alias table. )%  H LIBRARY 'CMUIP_SRC:[CENTRAL]NETXPORT';	! Get the transportablity library@ LIBRARY 'CMUIP_SRC:[central]netcommon';! System-wide definitions   ! Define some standard literals    LITERAL   ) ! Misc Time Values in Hundredths seconds.   F     Timer_Delta = -10*1000*1000,! conversion factor to VMS delta time.2     Csec = 100,			! Convert seconds to hundredths.3     Minute = 60*Csec,		! Convert minutes to .01 sec %     DaySec = 24*60*60*Csec,	! One day @     Csec_Timer_Delta = -100*1000, ! Delta time format converter.   ! Local Port ranges        Well_Known_LP_Start	= 1,     Well_Known_LP_End	= 255,     Common_LP_End	= 100,:     User_LP_Start	= 1024,	! missing range for bsd4.2 unix.     User_LP_End		= 32767, A     AOUS_LP_Start	= 32768,! Active Open User specified Local Port      AOUS_LP_End		= 65535,      LP_Start		= 1,     LP_End		= 65535,   ! Misc.   =     Error = -1,			! Return value, indicates error............      Not_Found = -1, /     OK = 0,			! Valid TCB pointer: RTN, TCB_OK. ?     Wild = 0,			! Indicates a wild-card in Foreign_Socket pair. N     Empty_Queue = 3: UNSIGNED(8), ! REMQUE: unsuccessful removal, queue empty.M     Queue_Empty_Now = 2: UNSIGNED(8), ! REMQUE: OK removal & queue now empty. N     First_Queue_Elem = 1: UNSIGNED(8); ! INSQUE return - inserted 1st element.   COMPILETIME      tblsize = 0;  * %SBTTL 'Define circular byte queue header' %(K     Circular byte queues are used to keep track of data as it flows between      the user and the network.  )%   MACRO      CQF$DEF(N) =< 	%NAME(N,'QUEUE')= [$Bytes(0)],	! First address of structure6 	%NAME(N,'BASE')	= [$Address],	! Base address of queue7 	%NAME(N,'END')	= [$Address],	! Address of end of queue , 	%NAME(N,'SIZE')	= [$UWord],	! Size of queue6 	%NAME(N,'COUNT')= [$UWord],	! Count of items on queue> 	%NAME(N,'ENQP')	= [$Address],	! Pointer to last byte on queue> 	%NAME(N,'DEQP')	= [$Address]	! Pointer to first byte on queue     %;   $FIELD CQ_FIELDS =     SET -     CQF$DEF('CQ$')		! Define the queue fields      TES; LITERAL      CQ_SIZE = $Field_Set_Size; MACRO 1     CQ$BLOCK = BLOCK[CQ_SIZE] FIELD(CQ_FIELDS) %;     ) %SBTTL 'Queue Element Block Definitions.'  %(L  Queue blks are used as queue elements which in turn contain bliss fullwordsL used for other purposes.  Case: Send Queue consists of a queue of send QueueJ Blks.  Each queue block then contains information & pointers to the user's send data eg.   3 		!===============================================!  		+		Queue Forward Link		+3 		!-----------------------------------------------!  		+		Queue Backwards link		+3 		!-----------------------------------------------!  		+		User data size in bytes		+ 3 		!-----------------------------------------------!  		+		User data pointer		+ 3 		!-----------------------------------------------!  		+		Data Time Out in Secs.		+3 		!===============================================!    )%  ! ! Queue Block (Send queue) Fields    $FIELD	QB_Send_Fields=     SET 9     SN$Next		= [$Address],		! Forward Queue Link (Flink). ;     SN$Last		= [$Address],		! Backwards queue link (Blink). 5     SN$Size		= [$Long_Integer],	! # of bytes to send. 4     SN$Data 		= [$Address],		! Start of data buffer.7     SN$Uargs		= [$Address],		!                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  	IPACP.SRC                        ;  [IPACP]STRUCTURE.REQ;1                                                                                                         N     3                         Do              Address of user arg blk. @     SN$TimeOut		= [$Short_Integer],	! connection timeout (time).     SN$Flags		= [$Byte],     $OverLay(SN$Flags), 	SN$EOL		= [$Bit],		! End Of Letter Boolean.* 	SN$URG		= [$Bit],		! Urgent data boolean.0 	SN$US                                                                                                                                                                                                                                                                           l6        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        $      R      ER		= [$Bit]		! On if seg is in user space     $CONTINUE      TES;   LITERAL !     QB_SN_SIZE = $Field_set_size;   , ! Queue Block (ReTransmission Queue Fields).   $FIELD QB_RT_Fields=     SET $     RT$Next		= [$Address],		! FLink.$     RT$Last		= [$Address],		! Blink.6     RT$Buf		= [$Address],		! segment buffer start adrs:     RT$BufSize		= [$short_integer],	! byte size of buffer.;     RT$SegSize		= [$short_Integer],	! Byte size of segment. 6     RT$Seg		= [$Address],		! Start address of segment.<     RT$Dest_Adrs	= [$Bytes(4)],		! Destination network adrs.8     RT$TimeOut		= [$Bytes(4)],		! Retransmission timeout?     RT$Maxtimeout	= [$bytes(4)],		! expiration time on RX queue B     RT$Start_Xmit_Time	= [$bytes(4)],		! base for round trip calc.7     RT$Xmit_Count	= [$bytes(4)],		! # of transmissions.*;     RT$Seq_End		= [$Bytes(4)]		! Last sequence # in segment      TES;   LITERALr!     QB_RT_SIZE = $Field_set_size;P    ! Network Receive segment queue.   $FIELD QB_NR_Fields=     SETr$     NR$NEXT		= [$Address],		! FLINK.$     NR$LAST		= [$Address],		! BLink.?     NR$Buf_Size		= [$Long_Integer],	! byte size of read buffer.p/     NR$Buf		= [$Address],		! Read buffer start. ;     NR$Size		= [$Long_Integer],	! Byte size of TCP segment.h2     NR$Seg		= [$Address],		! start of TCP segment.@     NR$Data_Size	= [$Long_Integer],	! # of data bytes available.1     NR$Uptr		= [$Address],		! pointer to new datai5     NR$Ucount		= [$Long_Integer],	! count of new data "     NR$TimeOut		= [$Long_Integer],7     NR$SRC_ADRS		= [$Long_Integer],	! Internet address.*7     NR$Dest_Adrs	= [$Long_Integer],	! Internet address.t=     NR$Src_Port		= [$Bytes(2)],		! SYN wait list: Source Ports<     NR$Dest_Port	= [$Bytes(2)],		! SYN wait list: Dest port.9     NR$SEQ_Start	= [$Bytes(4)],		! First usable seqence #b<     NR$SEQ_End		= [$Bytes(4)],		! Segment's last sequence #.>     NR$SEQ_Count	= [$Bytes(4)],		! Count of usable sequence #s6     $OVERLAY(NR$SEQ_Start)			! Reuse for ICMP messages( 	NR$ICM_TYPE	= [$Byte],		! ICMP msg type* 	NR$ICM_CODE	= [$Byte],		! ICMP code field, 	NR$ICM_EX	= [$Bytes(2)],		! ICMP extra data     $CONTINUES     $OVERLAY(NR$SEQ_Start)5 	NR$FragPtr	= [$Address],		! IP fragment flag/pointer8     $CONTINUE(     NR$Flags		= [$Byte],     $OVERLAY(NR$Flags)+ 	NR$EOL		= [$Bit],		! End Of Letter booleani* 	NR$URG		= [$Bit],		! Urgent data boolean., 	NR$ICMP		= [$Bit]		! Really an ICMP message     $CONTINUEP     TES;   LITERAL.!     QB_NR_SIZE = $Field_set_size;M  ! ! User Receive Data Request queuec   $FIELD QB_UR_Fields=     SETn$     UR$NEXT		= [$Address],		! FLINK.#     UR$LAST		= [$Address],		! Blinku?     UR$Size		= [$Long_Integer],	! # of bytes requested by user.f3     UR$Data		= [$Address],		! Start of data buffer.T2     UR$IRP_Adrs		= [$Address],		! IO request adrs.8     UR$UCB_Adrs		= [$Address],		! Unit Control Blk adrs.7     UR$Uargs		= [$Address],		! Address of user arg blk.      $OVERLAY(UR$IRP_Adrs)e9 	UR$ASTADR	= [$Address],		! AST address for internal conne6 	UR$ASTPRM	= [$Address]		! AST param for internal conn     $CONTINUEF     TES;   LITERALN!     QB_UR_SIZE = $Field_set_size;    LITERAL QB_Size = 0;= $MAXLIT(QB_Size,QB_SN_SIZE,QB_RT_SIZE,QB_NR_SIZE,QB_UR_SIZE);   8 Macro	Queue_Blk_Structure(F) = Block[QB_Size] Field(F)%;A %MESSAGE(%NUMBER(qb_size),' Longwords allocated per Queue Block')z T3 %SBTTL 'Network Segment Received Queue Definition.'d %(  K Segment receive queue consists of Queue Blks which are structured accordingIJ to the QB_NR_Field description.  IP places segments on this queue after IP has verified the datagram. )%   $FIELD SI_Fields=t     SETe     SI_QHead	= [$Address],     SI_QTail	= [$Address]c     TES;   LITERALS&     SI_Qheader_Size = $Field_Set_Size; o  % %SBTTL '"SYN" Wait Queue Definition.'-  H ! "SYN" wait queue. List of "SYN" segments received waiting for a serverI ! process to do a "PASSIVE" OPEN.  Queue elements (blocks) are structured   ! according to the QB_NR_Fields.   $FIELD SW_Fields=A     SET,     SW_QHead	= [$Address],     SW_QTail	= [$Address]      TES; -  ; %SBTTL 'User (TCP) I/O request Argument Block definitions.'e %(  E User Network I/O requests are fed to TCP via an ACP queue.  The queuelJ elements are VMS I/O request packets (IRP's) which point to a TCP argumentL blocks.  These argument block are formatted according to the following field definitions.    & User default argument block structure.3 user argument blocks have at least these arguments.2  A !===============================================================!t +			Data Start Address			+A !---------------------------------------------------------------!P +			Users Buffer Address			+A !---------------------------------------------------------------!'& +		     VMS Dynamic Memory Block ID		+A !---------------------------------------------------------------!t& +		     I/O Request Packet Address			+A !---------------------------------------------------------------! & +		     Unit Control Block Address			+A !---------------------------------------------------------------!* +			Process ID				+ A !---------------------------------------------------------------!o +						| TCP Function	+eA !===============================================================!_   )%   MACRO Static_Fields(NM) =4I     %NAME(NM,$Data_Start)= [$Address],	! Start of data within this block._<     %NAME(NM,$UBuf_Adrs)= [$Address],	! User buffer address.F     %NAME(NM,$VMS_BLK_ID)= [$Bytes(4)],	! VMS system dynamic block ID.C     %NAME(NM,$IRP_Adrs)	= [$Address],	! I/O Request Packet Address. C     %NAME(NM,$UCB_Adrs)	= [$Address],	! Unit Control Block Address. 5     %NAME(NM,$PID)	= [$Address],	! Owning process ID.c=     %NAME(NM,$UARGSIZE)	= [$UWord],	! Size of this UARG blocks8     %NAME(NM,$Funct)	= [$Bytes(1)],	! ACP Function code.:     %NAME(NM,$Protocol)	= [$Bytes(1)]	! ACP Protocol code.     %;   $FIELD User_Def_Fields=U     SET-2     Static_Fields(UD)			! Only the standard fields     TES;   LITERALi     UD_Size = $Field_Set_Size; MACRO ?     User_Default_Args = BLOCK[UD_Size] Field(User_Def_Fields)%;e     ! User Call: OPENd   $FIELD U$OPEN_Fields=R     SETQ5     Static_Fields(OP),			! Define the standard fieldsr!     OP$ProtoHdrBlk	= [$Bytes(0)],=     OP$Src_Host		= [$ULong],     OP$Dst_Host		= [$ULong],9     OP$Ext1		= [$ULong],	! Protocol header extension infoo9     OP$Ext2		= [$ULong],	! Protocol header extension infoo&     OP$FLAGS		= [$UWord],	! Open flags     $OVERLAY(OP$FLAGS)4 	OP$Mode		= [$Bit],	! Open mode, 1=Active, 0=Passive 					! UDP: 1=ADDRMODE e( 	OP$NoWait	= [$Bit],	! 1=No wait, 0=wait< 	OP$Addr_Flag	= [$Bit],	! 1=Address, 0=String (Foreign_Host)     $CONTINUE	     $OVERLAY(OP$MODE)A/ 	OP$Active_Open	= [$Bit],	! Alias for the aboveD     $CONTINUES<     OP$TimeOut		= [$SWord],	! Inactivity timeout in seconds./     OP$PIOchan		= [$SWord],	! user's IO channels>     OP$Foreign_Hlen	= [$Uword], 	! Length of foreign host name;     OP$Foreign_Host	= [$String(MAX_HNAME)], ! ASCIZ FH namen     $OVERLAY(OP$Foreign_Host) F       OP$Foreign_Address= [$Bytes(4)]	! FH address if OP$ADDR_FLAG set     $CONTINUEe     TES;   LITERAL	&     Open_Arg_Length = $Field_Set_Size,K     Max_User_ArgBlk_Size = Open_Arg_Length;	! used by Uarg rtns (MEMGR.BLI)- MACRO-B     User_Open_Args = Block[Open_Arg_Length] Field(U$OPEN_Fields)%;   LITERAL-=     OP$MODE_PA                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          8}J        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        <      a                                  |        	IPACP.SRC                        ;  [IPACP]STRUCTURE.REQ;1                                                                                                         N     3                                      SSIVE = 0,	! OP$MODE value for TCP passive open-F     OP$MODE_ACTIVE = 1,		! OP$MODE value for TCP active open (default)D     OP$MODE_UDPDATA = 1,	! OP$MODE value for UDP data open (default)=     OP$MODE_UDPADDR = 0;	! OP$MODE value for UDP address open      ! User Call: SEND	   $FIELD U$Send_Fields=n     SET 5     Static_Fields(SE),			! Define the standard fields !     SE$ProtoHdrBlk	= [$Bytes(0)],      SE$Src_Host		= [$ULong],     SE$Dst_Host		= [$ULong],9     SE$Ext1		= [$ULong],	! Protocol header extension infos9     SE$Ext2		= [$ULong],	! Protocol header extension infoi     SE$Flags		= [$UWord],F     $OVERLAY(SE$Flags)/ 	SE$OPM		= [$Bit],	! Used in "OPEN" processing.t( 	SE$EOL		= [$Bit],	! End Of Letter flag.& 	SE$URG		= [$Bit],	! Urgent data sent.     $CONTINUEs5     SE$TimeOut		= [$SWord],	! Send timeout (obsolete)S2     SE$Local_Conn_ID	= [$Address],	! Connection ID/     SE$Buf_Size		= [$SWord],	! Send buffer size (     SE$Data		= [$Byte]	! User data start     TES;   LITERALA&     Send_Arg_Length = $Field_Set_Size; MACRO!B     User_Send_Args = Block[Send_Arg_Length] Field(U$Send_Fields)%;     ! User Call: RECIEVE   $FIELD U$RECV_Fields=e     SETe5     Static_Fields(RE),			! Define the standard fieldsa!     RE$ProtoHdrBlk	= [$Bytes(0)],s*     RE$Src_Host		= [$ULong],	! Source Host/     RE$Dst_Host		= [$ULong],	! Destination Hostn9     RE$Ext1		= [$ULong],	! Protocol header extension infom9     RE$Ext2		= [$ULong],	! Protocol header extension infos,     RE$Flags		= [$UWord],	! No flags defined.     RE$TimeOut		= [$SWord],	! Obsolete, unused"     RE$Local_Conn_ID	= [$Address],7     RE$Alt_IO		= [$Address],	! Alternate IO entry pointl6     RE$PH_Buff		= [$Address],	! P0 Proto hdr buff pntr     RE$Buf_Size		= [$SWord],     RE$Data		= [$Byte]     TES;   LITERALS&     RECV_Arg_Length = $Field_Set_Size; MACRO[B     User_RECV_Args = Block[Recv_Arg_Length] Field(U$RECV_Fields)%;     ! User Call: CLOSE   $FIELD U$Close_Fields=     SET	5     Static_Fields(CL),			! Define the standard fields	     CL$Flags		= [$UWord],      $OVERLAY(CL$FLAGS) 	CL$Abort	= [$Bit],	! 1=Aborti( 	CL$NoWait	= [$Bit],	! 1=No wait, 0=wait     $CONTINUE	'     CL$TimeOut		= [$SWord],	! Not used.n1     CL$Local_Conn_ID	= [$Address]	! Connection ID      TES;   LITERALL'     Close_Arg_Length = $Field_Set_Size;R MACROdE     User_Close_Args = Block[Close_Arg_Length] Field(U$Close_Fields)%;2     ! User Call: STATUSr   $FIELD U$STATUS_Fields==     SET25     Static_Fields(ST),			! Define the standard fieldsB%     ST$Flags		= [$UWord],	! Not used. '     ST$TimeOut		= [$SWord],	! Not used. 2     ST$Local_Conn_ID	= [$Address],	! Connection ID     ST$Buf_Size		= [$SWord]      TES;   LITERALt(     Status_Arg_Length = $Field_Set_Size; MACRO[H     User_Status_Args = Block[Status_Arg_Length] Field(U$Status_Fields)%;  $ ! User Status call status-return blk   $FIELD Status_Return_Fields=     SETr!     SR$Bytes_Avail	= [$Bytes(2)],      SR$State		= [$Byte],     SR$Last_State	= [$Byte],%     SR$Send_Window	= [$Long_Integer],O%     SR$Recv_Window	= [$Long_Integer], !     SR$User_ID		= [$long_Integer]o     TES;   LITERAL$"     SR_BLK_Size = $Field_Set_Size; MACROUM     Status_return_Arg_Blk = BLOCK [SR_BLK_SIZE] Field(Status_Return_Fields)%;D     ! User Call: Net$INFOD   $FIELD U$INFO_Fields=      SETX5     Static_Fields(IF),			! Define the standard fields	%     IF$Flags		= [$UWord],	! Not used.]'     IF$TimeOut		= [$SWord],	! Not used.R2     IF$Local_Conn_ID	= [$Address],	! Connection ID:     IF$Buf_Size		= [$SWord]	! Size of returned data buffer     TES;   LITERAL &     Info_Arg_Length = $Field_Set_Size; MACROsB     User_Info_Args = Block[Info_Arg_Length] Field(U$Info_Fields)%;   ! User Call: ABORT   $FIELD	U$ABORT_Fields=     SET$5     Static_Fields(AB),			! Define the standard fields (     AB$Flags		= [$UWord],	! None defined'     AB$TimeOut		= [$SWord],	! Not used.S!     AB$Local_Conn_ID	= [$address]E     TES;   LITERALE'     Abort_Arg_Length = $Field_Set_Size;r MACROBE     User_Abort_Args = Block[Abort_Arg_Length] Field(U$Abort_Fields)%;e     ! User call: GTHST   MACRO'     GTHST_Static(NM) =. 	%NAME(NM,$FLAGS)	= [$UWord],	! Function flags4 	%NAME(NM,$SUBFUNCT)	= [$SWord],	! GTHST subfunction2 	%NAME(NM,$BUFSIZE)	= [$SWord],	! User buffer size0 	%NAME(NM,$ARG1)		= [$Uword],	! Size of argument2 	%NAME(NM,$ARG2SIZE)	= [$Uword]	! Size of argument     %;     $FIELD U$GTHST_FIELDS =d     SET 5     Static_Fields(GH),			! Define the standard fieldsz3     GTHST_Static(GH)			! Define the standard fields      TES;   LITERALt'     GTHST_ARG_LENGTH = $FIELD_SET_SIZE;  MACRO A     GTHST_ARGS = BLOCK[GTHST_ARG_LENGTH] FIELD(U$GTHST_FIELDS) %;c    - ! Overlays for the various GTHST subfunctionsS   ! Name to address function   $FIELD GTHST_NMLOOK_Fields =     SETe6     Static_Fields(GHN),			! Define the standard fields8     GTHST_Static(GHN),			! and the standard GTHST fields     $OVERLAY(GHN$ARG2SIZE) 	GHN$HSTLEN	= [$Uword],n     $CONTINUEr/     GHN$HSTNAM		= [$STRING(HOST_NAME_MAX_SIZE)]e     TES;   LITERALg/     GTHST_NMLOOK_ARGS_LENGTH = $FIELD_SET_SIZE;i MACROd7     GTHST_NMLOOK_ARGS =	BLOCK[GTHST_NMLOOK_ARGS_LENGTH]. 			FIELD(GTHST_NMLOOK_FIELDS)%;a   ! Address to name subfunction=   $FIELD GTHST_ADLOOK_Fields =     SET=6     Static_Fields(GHA),			! Define the standard fields8     GTHST_Static(GHA),			! and the standard GTHST fields     GHA$IPADDR		= [$Bytes(4)]-     TES;   LITERAL-/     GTHST_ADLOOK_ARGS_LENGTH = $FIELD_SET_SIZE;  MACROa7     GTHST_ADLOOK_ARGS = BLOCK[GTHST_ADLOOK_ARGS_LENGTH]- 			FIELD(GTHST_ADLOOK_FIELDS)%;    ! Name to RR functiont   $FIELD GTHST_RRLOOK_Fields =     SET-6     Static_Fields(GRR),			! Define the standard fields8     GTHST_Static(GRR),			! and the standard GTHST fields     $OVERLAY(GRR$ARG1) 	GRR$RRTYPE	= [$Uword],	     $CONTINUE-     $OVERLAY(GRR$ARG2SIZE) 	GRR$HSTLEN	= [$Uword],-     $CONTINUEP/     GRR$HSTNAM		= [$STRING(HOST_NAME_MAX_SIZE)]=     TES;   LITERAL=/     GTHST_RRLOOK_ARGS_LENGTH = $FIELD_SET_SIZE;  MACROM7     GTHST_RRLOOK_ARGS =	BLOCK[GTHST_RRLOOK_ARGS_LENGTH]o 			FIELD(GTHST_RRLOOK_FIELDS)%;$   ! Maintenance Call : DUMPs   $FIELD M$DUMP_Fields=_     SETt5     Static_Fields(DU),			! Define the standard fieldsR7     DU$Dump_Directive	= [$UWord],	! Dump function code. '     DU$TimeOut		= [$SWord],	! Not used.C&     DU$ARG0		= [$ULong],	! Argument #0     $OVERLAY(DU$ARG0)n> 	DU$Local_Conn_ID	= [$Address],	! TCB/UDPCB index, DU$TCB_DUMP     $CONTINUE      $OVERLAY(DU$ARG0)[8 	DU$Device_idx	= [$Byte],	! device index, DU$DEVICE_DUMP     $CONTINUE      $OVERLAY(DU$ARG0) ; 	DU$Start_Index	= [$SWord],	! ARP cache index, DU$ARP_CACHED     $CONTINUEs&     DU$ARG1		= [$ULong],	! Argument #1&     DU$ARG2		= [$ULong],	! Argument #2:     DU$Buf_Size		= [$SWord],	! Size of returned data block5     DU$Data		= [$Byte]	! Start of return data buffer.      TES;   LITERALe&     Dump_Arg_Length = $Field_Set_Size; MACROPC     Debug_Dump_Args = Block[Dump_Arg_Length] Field(M$Dump_Fields)%;t     	= ! Maintenance Call : SNMP[   $FIELD M$SNMP_Fields=r     SETn7     Static_Fields(SNMP),			! Define the standard fieldsi7     SNMP$Function	= [$UWord],	! SNMP sub-function code.E8     SNMP$Misc		= [$SWord],	! Size of returned data block7     SNMP$WBuf_Size	= [$SWord],	! Size of VAR data block,<                                                                                                                                                                                                                                                                                o{        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        W      p      SNMP$RBuf_Size	= [$SWord],	! Size of returned data block5     SNMP$Data		= [$Byte]	! Start of UArg data buffer.O     TES;   LITERAL	&     SNMP_Arg_Length = $Field_Set_Size; MACROS=     SNMP_Args = Block[SNMP_Arg_Length] Field(M$SNMP_Fields)%;      	P ! Maintenance Ca                                                                                                                                                                                                                                                                           M        	IPACP.SRC                        ;  [IPACP]STRUCTURE.REQ;1                                                                                                         N     3                         v 
     -       ll: EXIT  I $FIELD M$EXIT_Fields=i     SET 5     Static_Fields(EX),			! Define the standard fieldsn%     EX$Flags		= [$UWord],	! Not used.H'     EX$TimeOut		= [$SWord],	! Not used. -     EX$Local_Conn_ID	= [$Address]	! Not used.s     TES;   LITERAL &     Exit_arg_Length = $Field_Set_Size; MACROAC     Debug_Exit_Args = Block[Exit_Arg_Length] Field(M$Exit_Fields)%;g     ! Maintenance Call: PANICB   $FIELD M$PANIC_Fields=     SETB5     Static_Fields(PA),			! Define the standard fields-%     PA$Flags		= [$UWord],	! Not Used.l'     PA$TimeOut		= [$SWord],	! Not used.I-     PA$Local_Conn_ID	= [$Address]	! Not used.e     TES;   LITERALD'     Panic_arg_Length = $Field_Set_Size;p MACROaF     Debug_Panic_Args = Block[Panic_Arg_Length] Field(M$Panic_Fields)%;     ! Maintenance Call: DEBUGU   $FIELD M$DEBUG_Fields=     SETc5     Static_Fields(DE),			! Define the standard fieldso,     DE$Level		= [$ULong],	! Debug level mask6     DE$Local_Conn_ID	= [$ULong],	! Connection-ID (NYI);     DE$Group		= [$ULong]	! glag cluster (DEBUG or ACTIVITY)U     TES;   LITERALd'     Debug_Arg_Length = $Field_Set_Size;r MACRO @     Debug_Args = Block[Debug_Arg_Length] Field(M$Debug_Fields)%;     ! Maintenance Call: EVENTO   $FIELD M$EVENT_Fields=     SET!5     Static_Fields(EV),			! Define the standard fields$0     EV$Buf_Size		= [$SWord],	! Event buffer size(     EV$Data		= [$Byte]	! User data start     TES;   LITERALd'     Event_Arg_Length = $Field_Set_Size;B MACROU@     Event_Args = Block[Event_Arg_Length] Field(M$Event_Fields)%;    H ! VMS cancel IO call to TCPACP.  This argument block is generated by theN ! User_requests_avail rtn(module:maclib.bli) in response to the virtual deviceJ ! driver "TCH" sending a fake IRP (IO request packet) to the TCPACP.  OnlyM ! item that are of interest/valid are the user's PID & the Process IO cahnnel,I ! for which the IO is being canceled.  VMS cancels IO on both the $CANCELiE ! system service & when the user deasssigns ($DEASGN) the IO channel.E   $FIELD M$VMS_Cancel_Fields=d     SET 5     Static_Fields(VC),			! Define the standard fieldsc>     VC$PIOchan		= [$Bytes(2)],	! Process IO channel (from IRP)-     VC$Conn_ID		= [$Bytes(4)]	! Connection ID]     TES;   LITERAL (     Cancel_Arg_Length = $Field_Set_Size; MACRO=.     VMS$Cancel_Args = BLOCK[Cancel_Arg_Length]$ 		      FIELD(M$VMS_Cancel_Fields)%;   ! End: Structure.DefArg_Length] Field(U$RECV_Fields)%;     ! User Call: CLOSE   $FIELD U$Close_Fields=     SET	5     Static_Fields(CL),			! Define the standard fields	                  * [IPACP]TCP.REQ;1 +  ,    .     /     4 S                            - ;    0   1    2   3      K  P   W   O     5   6 @p@W,  7  D5-  8          9          G    H  J                %(A 	****************************************************************   0 		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.  A 	****************************************************************  )%, %TITLE 'Define IPACP TCP related structures' %(   Module:    	TCP.REQ  	 Facility:   3 	Define the TCP related things (but not TCP itself)    Author:   ) 	Bruce R. Miller, CMU Network Development & 	Borrowing Heavily from other modules.8 	Copyright (c) 1986,1987,1990 Carnegie-Mellon University   Modification history:   " 	10-Dec-1991	Henry W. Miller		USBR; 	Add TCB variable SND_Delay_Timer, to implement RFC1122 SWS  	avoidance algorithim.  " 	05-Dec-1991	Henry W. Miller		USBR' 	Add SND_ACK_Threshold variable to TCB. % 	Make TCB[ACK_Size] an unsigned long.   " 	13-Nov-1991	Henry W. Miller		USBR 	Add Delayed_ACK_Timer to TCB.4 	Make flag word in TCB a long.  (We ran out of bits) 	Remove old obsolete crap.  " 	11-Nov-1991	Henry W. Miller		USBR0 	Change SND_WL to unsigned longs as per RFC1122.  " 	17-Sep-1991	Henry W. Miller		USBR8 	Bring retransmission parameters into line with RFC1122.0 	Add flag in TCB for disabling Nagle algorithim.  " 	25-Jan-1991	Henry W. Miller		USBR> 	Make WINDOW_DEFAULT and ACK_THRESHOLD configurable variables.  " 	15-Jan-1991	Henry W. Miller		USBRB 	Changed SND_WND, RCV_WND, and Old_RCV_WND to unsigned long values 	as recommended by RFC1122.   " 	13-Jan-1991	Henry W. Miller		USBR1 	Comment out TCPTTL; now a configurable variable.    )%  & LIBRARY 'CMUIP_SRC:[CENTRAL]NETXPORT';' LIBRARY 'CMUIP_SRC:[CENTRAL]NETCOMMON'; $ LIBRARY 'CMUIP_SRC:[CENTRAL]NETVMS'; LIBRARY 'STRUCTURE';     %SBTTL 'Literals'    LITERAL    ! TCB Connection States   @     CS$Closed		= 0: UNSIGNED(8),	! fictious, TCB does NOT exist.      CS$Listen		= 1: UNSIGNED(8),"     CS$SYN_Sent		= 2: UNSIGNED(8),"     CS$SYN_RECV		= 3: UNSIGNED(8),$     CS$Established	= 4: UNSIGNED(8),#     CS$FIN_Wait_1	= 5: UNSIGNED(8), #     CS$FIN_Wait_2	= 6: UNSIGNED(8), "     CS$Time_Wait	= 7: UNSIGNED(8),#     CS$Close_Wait	= 8: UNSIGNED(8), !     CS$Closing		= 9: UNSIGNED(8), #     CS$Last_ACK		= 10: UNSIGNED(8),       CS$Reset		= 11: UNSIGNED(8),#     CS$Inactive		= 12: UNSIGNED(8), #     CS$NameLook		= 13: UNSIGNED(8),   " ! Control Segment type identifiers  8     M$SYN = 1: UNSIGNED(8),	! Send a SYN control segment     M$FIN = 2: UNSIGNED(8),      M$ACK = 3: UNSIGNED(8),      M$RST = 4: UNSIGNED(8), 5     M$SYN_ACK = 5: UNSIGNED(8),	! SYN & ack together.    ! Misc.   @     TCPTOS = 0,			! IP Service type: Datagram,Highest Reliablity* 				! Reliability over speed, Speed: High..     TCPDF = FALSE,		! OK to fragment datagrams8     SND_Q_MAX = 8,		! Max number of buffered user sends.  ) ! Misc Time Values in Hundredths seconds.   +     Max_Seg_LifeTime = 2*Minute,	! seconds. @     Min_RT_TimeOut = 1*Csec,	! Min allowable retransmission timeC     Max_RT_TimeOut = 4*Minute,	! Max allowable Retransmission time. @     Base_RT_TimeOut = 3*CSEC,	! Base (initial) Round Trip timer.1     PROBE_IVAL = Minute,	! Inactivity probe timer <     ack_interval = Minute,	! spontaneous ack interval timer.<     Delayed_ACK_Interval = 20,	! Delayed ACK interval, 200msB     SQUENCH_Interval = 2*CSEC,	! Source Quench Interval, 2 Seconds0     Function_TimeOut = 10*Csec,	! User function.L     Active_Open_Timeout = 30*Csec,! Amount of time for active open to happenD     Passive_Open_Timeout = DaySec, ! Amount of time for passive openB     Na                                                                                                                                                                                                                                                                           b        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        =            meLook_Timeout = 2*Minute,! How long to wait for name lookupH     Close_Timeout = 2*Minute,	! How long to wait for connection to closeB     CONN_TIMEOUT = 10*Minute,	! How long before connection is dead8     RX_TIMEVAL = 4*Minute,	! Retransmit queue time limitJ     Inactive_TCB_TimeOut = 5*Csec, ! Time which a TCB will remain inactive 				! before being deleted. F     Default_Send_timeOut = 300*Csec;! Time allowed for a user's buffer 				! to be sent.     C %SBTTL 'Define a TCB: (Transmission Control Block) data struct                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          L         	IPACP.SRC                        ;  [IPACP]TCP.REQ;1BLI;1                                                                                                          S                              3      
       ure.'  %(  : Define a TCB: (Transmission Control Block) data structure.  O The basic requirements of a TCB are derived from the DOD TCP document, page 19. N The TCB is the data structure which TCP uses to control a specific connection.C All active connections (e.g., NOT closed) have an associated TCB.   ! Each TCB can be located two ways: 0 1) Local_Connection_ID is the address of the TCBM 2) Each local port has associated a linked-list of TCB's which use that local .    port as part of a connection (socket-pair).F When the TCB is on the free TCB list (Free_TCB_List, Queue header) theH fields LP_Next & LP_Back are used as forward & backwards queue pointers. )%   $FIELD  TCB_Fields =     Set ;     LP_Next		= [$Address],	! LP queue Forward Link pointer. 6     LP_Back		= [$Address],	! LP queue, Backwards Link.6     Foreign_Host	= [$Bytes(4)],	! Foreign host address+     Foreign_Port	= [$ULong],	! Foreign port <     Local_Host		= [$Bytes(4)],	! Local address of connection*     Local_Port		= [$ULong],	! Local Port #B     RF_Qhead		= [$Address],	! Network: received "future" seg queue     RF_Qtail		= [$Address], ;     RF_Qcount		= [$SLong],	! Count of items on future queue ?     UR_QHead		= [$Address],	! User: receive Data request queue.      UR_QTail		= [$Address], ?     SND_QHead		= [$Address],	! User: send Segment request queue      SND_QTail		= [$Address],   ! * ! Security		= [$SWord],	! not implememted., ! Precedance		= [$SWord],	! not implememted.    ! Send sequence number variables: ! Bytes(4) gives 32-Bit unsigned integer for mod 32 arith.       $Align(Fullword)4     SND_UNA		= [$ULong],	! send unacknowledged seq #*     SND_NXT		= [$ULong],	! next send seq #&     SND_WND		= [$ULong],	! send window-     SND_WL		= [$ULong],	! Last window update. *     SND_BS		= [$SLong],	! send buffer size(     SND_UP		= [$ULong],	! urgent pointer2     SND_MAX_WND		= [$ULong],	! Maximum Send Window5     ISS			= [$ULong],	! Initial Send sequence number. -     SND_Pptr		= [$ULong],	! Send PUSH pointer    ! Send circular queue variables   *     CQF$DEF('SND_Q_'),			! Send data queue4     CQF$DEF('SRX_Q_'),			! Retransmission data queue   ! Receive Sequence variables  3     RCV_NXT		= [$ULong],	! next expected sequence # 9     Old_RCV_NXT		= [$ULong],	! RCV.NXT last time ACK sent !     RCV_WND		= [$ULong],	! window 9     Old_RCV_WND		= [$ULong],	! RCV.WND last time ACK sent .     RCV_BS		= [$SLong],	! buffer size in bytes0     RCV_UP		= [$ULong],	! Receive urgent pointer2     IRS			= [$ULong],	! Initial receive sequence #>     RCV_DUptr		= [$ULong],	! Last sequence # delivered to user0     RCV_Pptr		= [$ULong],	! Receive PUSH pointer  " ! Receive circular queue variables  -     CQF$DEF('RCV_Q_'),			! Receive data queue    ! Misc connection information   6     UCB_ADRS		= [$Address],	! UCB address for this TCB:     VTCB_INDEX		= [$ULong],	! VALID_TCB index for this TCB,     User_ID		= [$ULong],	! Owning process ID>     RX_Timer		= [$ULong],	! Time to do retransmit for this TCB=     RX_Timeout		= [$ULong],	! Retransmission time-out for TCB 5     RX_Count		= [$SLong],	! # of retransmissions done 7     RX_SEQ		= [$ULong],	! Retransmission sequence start 1     RX_CTL		= [$Bytes(4)],	! Control segment type D     Xmit_Start_Time	= [$ULong],	! Time first item queued on RX timer4     Time_Wait_Timer	= [$ULong],	! Time_Wait Counter. !    $OVERLAY(time_wait_timer)3     ACK_Timer		= [$ULong],	! spontaneous ack timer.  !    $CONTINUE6     Delayed_ACK_Timer	= [$ULong],	! Delayed ACK timer.4     SQUENCH_Timer	= [$ULong],	! Source Quench timer.9     User_Timeval	= [$ULong],	! Amount of time before idle*C     User_Timeout	= [$ULong],	! Time which connection will be closedl>     Probe_time		= [$ULong],	! time when we need to probe againI     Connection_TimeOut	= [$ULong],	! Time which connection will be reset.vC     InActive_Timeout	= [$ULong],	! time which conn will be deleted.o7     Function_Timer	= [$ULong],	! User function timeout.i@     TVTDATA		= [$Address],	! Pointer to TVT data block if IS_TVTG     Timeout_Routine	= [$Address],	! For TVT's, internal timeout routine,@     ArgBlk		= [$Address],	! Points at user's i/o request argblk.G     Round_Trip_Time	= [$ULong],	! Time required for segment to be ACKedoB     Calculated_RTO	= [$ULong],	! Calculated retransmission timeoutF     Curr_User_Function	= [$Byte],	! Current user function being timed.8     State		= [$Byte],	! Current state of this connection;     Last_State		= [$Byte],	! Last state of this connection.uA     Con_Index		= [$Byte],	! Connection Table index for local porteD     Process_IO_Chan	= [$bytes(2)],	! IO channel for this connection.I     Max_seg_data_size	= [$bytes(2)],	! max size data receiver will accept9S     Max_eff_data_size	= [$bytes(2)],	! max effective size data receiver will accept 7     Duplicate_segs	= [$bytes(2)],	! duplicate segments.	<     OORW_segs		= [$bytes(2)],	! Out Of Recv Window segments.<     Inactive_Code	= [$SLong],	! Reason TCB was set inactive.9     ACK_size		= [$Ulong],	! # of data bytes to be ack'ed.lH     SND_ACK_Threshold	= [$ULong],	! Number of bytes before window updateB     SND_Delay_Timer	= [$ULong],	! Time to wait before forcing send9     TCB$Flags		= [$ULong],	! Reserve some space for flagso     $OVERLAY(TCB$Flags)t/ 	Active_Open	= [$Bit],	! Active open performed.a6 	Open_NoWait	= [$Bit],	! Wait-mode of OPEN in progress8 	Close_NoWait	= [$Bit],	! Wait-mode of CLOSE in progress9 	Pending_Close 	= [$Bit],	! FIN segment needs to be sent._6 	Pending_ACK	= [$Bit],	! ACK segment needs to be sent.9 	Pending_IO	= [$Bit],	! ARGBLK pts at an user IO request.C4 	Data_2_Send	= [$Bit],	! User data needs to be sent.2 	EOF		= [$Bit],	! TCB Closing, All data delivered.; 	Is_Aborted	= [$Bit],	! TCB is aborted - drop incoming data]/ 	SND_Push_Flag	= [$Bit],	! Push pending on SENDe/ 	RCV_Push_Flag	= [$Bit],	! Push seen on receive ; 	NMLook_Flag	= [$Bit],	! Name or address lookup in progresss; 	IS_Synched	= [$Bit],	! OK to send ACKs, connection synchedN6 	FIN_RCVD	= [$Bit],	! Valid FIN received in FIN-WAIT-24 	IS_TVT		= [$Bit],	! TCB is a TVT (virtual terminal)/ 	DE_Nagle	= [$Bit],	! Turn off Nagle algorithim , 	SQUENCH		= [$Bit],	! Source Quench received) 	NBWRITE		= [$Bit],	! Network Buffer busyg' 	TCP_DF		= [$Bit],	! Don't Fragment bit1     $CONTINUE ;     Foreign_Hnlen	= [$SWord],	! Length of foreig                                                                                                                                                                                                                                                                                   
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        Z            n host nameS;     Foreign_Hname	= [$Bytes(Max_Hname)]	! Foreign host name      TES;   ! Set the size of one TCB    LITERAL(6     TCB_Size = $Field_Set_Size;		! in BLISS Fullwords.  : MACRO TCB_Structure = Block[TCB_Size] Field(TCB_Fields)% ;0 %MESSAGE(%NUMBER(tcb_size),' longwords per tcb') e& %SBTTL 'Connection Table definitions.' %(  J The connection table is the data structure used to identify unique networkM connections.  Each element in the table consists of a TCB list (Queue Header) @ & the local port number.  For every connection that has the sameK local-port you will find the TCB (Transmission Control Blk) in the TCB listmM for this local-port.  The primary reason behind this structure is to facilatetJ connection OPEN processing in the verification that a requested connectionM pair (Foreign_Socket & Local_Socket) represent a unique connection.  We can'teJ have duplicates or ambiguities.  If the local_port field is (-1) then thisJ connection table entry is available.  As one might have guessed there is aL limit to the number of unique local-ports that are active at any given time.I I suspect as time flows the size of this table will have to be increased.vG See the literals & macro definitions following.  The actual global data  declaration is in TCP.BLI.   )%                                                                                                                                                                                                                                                                             +        	IPACP.SRC                        ;  [IPACP]TCP.REQ;1BLI;1                                                                                                          S                              x                $FIELD CN$Fields =     SETrF     CN$TCB_List		= [$Address],	! This port's TCB list. Queue head prt.0     CN$TCB_Tail		= [$Address],	! Queue tail ptr.+     CN$Local_Port	= [$LONG]	! Local Port #.V     TES;   LITERALaA     Conect_Tbl_Size = 4,		! # of blocks in connection blockvectorh9     Initial_TCBs = 2,			! Initial size of Valid TCB table 2     CN$Blk_Size = $Field_Set_Size,	! Size in longs'     CN$Blk_BLen = 10;			! Size in bytes    MACROTJ     Connection_Table_Structure = BLOCKVECTOR[Conect_Tbl_Size,CN$Blk_Size]  				 FIELD(CN$Fields) %;> %ASSIGN(tblsize,%NUMBER(conect_tbl_size)*%NUMBER(cn$blk_size))E %MESSAGE(%NUMBER(tblsize),' Longwords allocated to Connection Table')t   rM %SBTTL 'Definition of structure for WKS server process table & SYN-wait list'.   $FIELD  WK_Server_Fields=t     SET       WKS$Port		= [$Long_Integer],4     WKS$Process		= [$Bytes(8)],		! ASCID descriptor.     WKS$IMAGE		= [$Bytes(8)],e      WKS$Stat		= [$Long_Integer],     WKS$Priv		= [$Bytes(8)],     WKS$Quotas		= [$Address], 2     WKS$Input		= [$Bytes(8)],		! ASCID descriptor.3     WKS$Output		= [$Bytes(8)],		! ASCID descriptor. 2     WKS$Error		= [$Bytes(8)],		! ASCID descriptor.!     WKS$Prior		= [$Long_Integer],x"     WKS$MaxSrv		= [$Long_Integer],%     WKS$SYN_Qcount	= [$Long_Integer],s     WKS$SYN_Qhead	= [$Address],      WKS$SYN_Qtail	= [$Address]     TES;   LITERAL %     WKS_Block_Size = $Field_Set_Size,p     WKS_Table_Size = 20;   MACRO >     WKS_Structure = BLOCKVECTOR[WKS_Table_Size,WKS_Block_Size]  		    FIELD(WK_Server_Fields) %;  ,	! Network: received "future" seg queue     RF_Qtail		= [$Address], ;     RF_Qcount		= [$SLong],	! Count of items on future queue ?     UR_QHead		= [$Address],	! User: receive Data request queue.      UR_QTail		= [$Address], ?     SND_QHead		= [$Address],	! User: send Segment request queue      SND_QTail		= [$Address],   ! * ! Security		= [$SWord],	! not implememted., ! Precedance		= [$SWord],	! not implememted.    ! Send sequence number variables: ! Bytes(4) gives 32-               * [IPACP]TCPMACROS.REQ;1 +  ,    .     /     4 P                          - ;    0   1    2   3      K  P   W   O     5   6 MBU,  7 rW6-  8          9          G    H  J                          %(A 	****************************************************************   0 		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.  A 	****************************************************************  )%% %Title 'TCP global Macro definitions'  %( Module:   
 	TCPMACROS  	 Facility:   G 	Provide some macros for convenient usage by the various modules in the  	TCP/IP network ACP.   Author:    	Original author ?4 	This version by Vince Fuller, CMU-CSD, Summer, 1986E 	Copyright (c) 1986,1987, Vince Fuller and Carnegie-Mellon University    Change log:   ! 6.7	7-Jan-1992	John Clement		Rice  	Added LOG$FLUSH  % 6.6	17-Jul-1991	Henry W. Miller		USBR = 	Added debugging flags for name lookup and memory allocation.    6.4  24-Mar-88, Edit by VAF D 	Enclose X..$FAO macros in BEGIN/END blocks to prevent weird IF/THEN 	block semantics.    6.3  20-Nov-87, Edit by VAF E 	General cleanup. Create $KCALL macro to isolate              all $CMKRNL calls to E 	this macro package. Make logging macros, NOINT/OKINT, etc. check and C 	declare necessary externals so modules don't have to. Add $ACPWAKE ) 	macro. Add LOG$IPERR - IP error logging.    6.2  10-Jun-87, Edit by VAF D 	Flush hostname processing from ACP. Change GTHST and OPEN blocks to 	know about host name length.    6.1  18-Feb-87, Edit by VAF C 	Conditional compilation of a bunch of stuff (logging, GREEN, etc.) . 	Improvements to a bunch of the logging stuff. )%  * ! Define version-specific debugging flags.  + REQUIRE 'MACROSWI.REQ';		! Compile switches   - COMPILETIME NO_CrLf = 1;	! For message macros    FIELD VB$FIELDS =      SET :     VB$LEN = [0,0,16,0],	! Varying string - current length-     VB$DAT = [0,16,8,0]		! First byte of data      TES;   MACRO :     REPEAT = DO%,		! Extend bliss for Repeat until lovers.  ? ! Generate a pointer to a character string descriptor quadword.   7     ASCII_C(S) = uplit(%CharCount(S),uplit(%ascii S))%,   P ! Generate a carriage-return Line-feed sequence for use in %string lex function.  )     CrLf = %STRING(%Char(13),%Char(10))%,   # ! String descriptor handling macros   A     VBUF(NCHR) = BLOCK[CH$ALLOCATION(NCHR+2)] FIELD(VB$FIELDS) %, +     DESC$VSTR = BLOCK[DESC$STR_LEN,BYTE] %, "     DESC$VSTR_ALLOC(NAME,MAXLEN) = 	%IF NOT %NULL(MAXLEN) %THEN< 	    %NAME(NAME,'_BUF') : VBUF(MAXLEN) PRESET([VB$LEN] = 0), 	%FI 	NAME : DESC$VSTR  	%IF NOT %NULL(MAXLEN) %THEN+ 	    PRESET([DSC$B_CLASS] = DSC$K_CLASS_VS, $ 		   [DSC$B_DTYPE] = DSC$K_DTYPE_VT,  		   [DSC$W_MAXSTRLEN] = MAXLEN,* 		   [DSC$A_POINTER] = %NAME(NAME,'_BUF')) 	%FI 	%, '     DESC$STR_INIT(DESC,STRLEN,STRPTR) =  	BEGIN# 	DESC[DSC$B_CLASS] = DSC$K_CLASS_Z; # 	DESC[DSC$B_DTYPE] = DSC$K_DTYPE_Z; , 	DESC[DSC$W_LENGTH] = CH$ALLOCATION(STRLEN); 	DESC[DSC$A_POINTER] = STRPTR; 	END %, (     DESC$VSTR_INIT(DESC,MAXLEN,STRPTR) = 	BEGIN$ 	DESC[DSC$B_CLASS] = DSC$K_CLASS_VS;$ 	DESC[DSC$B_DTYPE] = DSC$K_DTYPE_VT;  	DESC[DSC$W_MAXSTRLEN] = M                                                                                                                                                                                                                                                                           ВN        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        N            AXLEN; 	DESC[DSC$A_POINTER] = STRPTR; 	END %,    ! Handle string descriptor. ; ! If argument is a quoted string, return created descriptor ! ! else, just return the argument.        $$STR(ARG) =5 	%IF %ISSTRING(ARG) %THEN %ASCID ARG %ELSE ARG %FI %,   9 ! Declare something external if it isn't already declared        $QEXT(NAME,MODIF) =  	%IF NOT %DECLARED(NAME) %THEN; 	    EXTERNAL NAME  %IF NOT %NULL(MODIF) %THEN : MODIF %FI;  	%FI     %,     $QEXTR(NAME,MODIF) = 	%IF NOT %DECLARED(NAME) %THENC 	    EXTERNAL ROUTINE NAME  %IF NOT %NULL(MODIF) %THEN : MODIF %FI;  	%FI     %, 	   ) ! Write a message to the console operator        OPR$FAO(CST) = 	BEGIN 	$QEXTR(OPR_FAO,NOVALUE) 	%IF %NULL(%REMAINING) %THEN" 	    OPR_FAO(%ASCID %STRING(CST)); 	%ELSE- 	    OPR_FAO(%ASCID %STRING(CST),%REMAINING);  	%FI 	END 	%,      ERROR$FAO(CST) = 	BEGIN 	$QEXTR(ERROR_FAO,NOVALUE) 	%IF %NULL(%REMAINING) %THEN$ 	    ERROR_FAO(%ASCID %STRING(CST)); 	%ELSE/ 	    ERROR_FAO(%ASCID %STRING(CST),%REMAINING);  	%FI 	END 	%,      WARN$FAO(CST) =  	BEGIN 	$QEXTR(ERROR_FAO,NOVALUE) 	%IF %NULL(%REMAINING) %THEN$ 	    ERROR_FAO(%ASCID %STRING(CST)); 	%ELSE/ 	    ERROR_FAO(%ASCID %STRING(CST),%REMAINING);  	%FI 	END 	%,      FATAL$FAO(CST) = 	BEGIN 	$QEXTR(FATAL_FAO,NOVALUE) 	%IF %NULL(%REMAINING) %THEN$ 	    FATAL_FAO(%ASCID %STRING(CST)); 	%ELSE/ 	    FATAL_FAO(%ASCID %STRING(CST),%REMAINING);  	%FI 	END
         %,  < ! Obsolete error processing macros - special cases of above.       Fatal_Error(S,ERRCODE) = 	%IF %NULL(ERRCODE) %THEN  	    F                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          S        	IPACP.SRC                        ;  [IPACP]TCPMACROS.REQ;1                                                                                                         P                                            ATAL$FAO(S)  	%ELSE/ 	    FATAL$FAO(%STRING(S,', EC = !XL'),ERRCODE)  	%FI 	%,      Warn_Error(S,RETVALUE) = 	%IF %NULL(RETVALUE) %THEN 	    WARN$FAO(S) 	%ELSE/ 	    WARN$FAO(%STRING(S,', EC = !XL'),RETVALUE)  	%FI 	%,    ! Control segment Send macros   5     SEND_SYN$ACK(TCB) = TCP$Send_CTL(Tcb,M$SYN_ACK)%, -     SEND_SYN(TCB) = TCP$SEND_CTL(TCB,M$SYN)%, -     SEND_FIN(TCB) = TCP$SEND_CTL(TCB,M$FIN)%, -     SEND_RST(TCB) = TCP$SEND_CTL(TCB,M$RST)%,    ! Queue management macros.  ;     Queue_Empty(Queue$Head) = .Queue$Head EQLA Queue$Head%, ?     Queue_NOT_Empty(Queue$Head) = .Queue$Head NEQA Queue$Head%,    ! Enable/Disable AST Delivery.J ! If AST_IN_Progress then don't bother with AST blocking as AST will block, ! delivery of other AST as same access mode.  %     Disable_AST = $SETAST(ENBFLG=0)%,   $     Enable_AST = $SETAST(ENBFLG=1)%,  E ! Enable/disable interrupts (AST's). These are the macros that should H ! really be used, since they restore the AST state to its previous value ! correctly.       NOINT =  	BEGIN 	$QEXT(AST_IN_PROGRESS)  	$QEXT(INTDF) > 	IF (NOT .AST_IN_PROGRESS) AND ((INTDF = .INTDF+1) EQL 0) THEN 	    DISABLE_AST 	END     %,     OKINT =  	BEGIN 	$QEXT(AST_IN_PROGRESS)  	$QEXT(INTDF) > 	IF (NOT .AST_IN_PROGRESS) AND ((INTDF = .INTDF-1) LSS 0) THEN 	    ENABLE_AST  	END     %,  L ! Wake sleeping ACP from $HIBER call. This is used when an AST routine wants9 ! the mainline ACP code to do something at non-AST level.        $ACPWAKE = 	BEGIN 	$QEXT(SLEEPING) 	IF .SLEEPING THEN
 	    BEGIN 	    SLEEPING = FALSE; 	    $WAKE();  	    END 	END     %,  / ! Macros to do word and longword byte swapping.        SWAPWORD(ADDR) = 	BEGIN! 	BIND XX = ADDR : VECTOR[2,BYTE];  	REGISTER YY;  	YY = .XX[0];  	XX[0] = .XX[1]; 	XX[1] = .YY;  	END %,      SWAPLONG(ADDR) = 	BEGIN 	REGISTER TEMP; ' 	TEMP = .ADDR<0,16>; ! Word swap of TTL  	ADDR<0,16> = .ADDR<16,16>;  	ADDR<16,16> = .TEMP;  	END %,   $ ! Macro to set $CMKRNL argument list       $$KARGS(ANAME)[NAME] = 	ANAME[%COUNT+1] = NAME; %,   . ! Macro to setup and call routine via $CMKRNL.       $$KCALL(RTN)[] = 	%IF %LENGTH EQL 1 %THEN 	    $CMKRNL(ROUTIN=RTN) 	%ELSE
 	    BEGIN
 	    LOCAL 		CMKARG : VECTOR[%LENGTH];  	    CMKARG[0] = %LENGTH-1;  	    $$KARGS(CMKARG,%REMAINING) ' 	    $CMKRNL(ROUTIN=RTN,ARGLST=CMKARG);  	    END 	%FI     %,  . %IF LOGSWITCH %THEN		! Want the logging macros     <    ! Conditionally do something according to LOG_STATE flags      $$LOGF(LOGF) =  	BEGIN    	$QEXT(LOG_STATE)  	((.LOG_STATE AND (LOGF)) NEQ 0) 	END 	%,   8 ! Macros for output to log and opr and the activity log.       LOG$OUT(XSTR) = $ 	LOG_OUTPUT(%ASCID %STRING(XSTR)) %,     XLOG$OUT(LOGF) = 	BEGIN 	IF $$LOGF(LOGF) THEN  	    LOG$OUT(%REMAINING) 	END
         %,     LOG$FAO(CST) = 	BEGIN! 	%IF NOT %DECLARED(LOG_FAO) %THEN ( 	    EXTERNAL ROUTINE LOG_FAO : NOVALUE; 	%FI 	%IF %NULL(%REMAINING) %THEN! 	    LOG_FAO(%ASCID %STRING(CST))  	%ELSE, 	    LOG_FAO(%ASCID %STRING(CST),%REMAINING) 	%FI 	END 	%,      XLOG$FAO(LOGF) = 	BEGIN 	IF $$LOGF(LOGF) THEN  	    LOG$FAO(%REMAINING)         END 
         %,     ACT$OUT(XSTR) = $ 	LOG_OUTPUT(%ASCID %STRING(XSTR)) %,     ACT$FAO(CST) = 	BEGIN! 	%IF NOT %DECLARED(ACT_FAO) %THEN ( 	    EXTERNAL ROUTINE ACT_FAO : NOVALUE; 	%FI 	%IF %NULL(%REMAINING) %THEN! 	    ACT_FAO(%ASCID %STRING(CST))  	%ELSE, 	    ACT_FAO(%ASCID %STRING(CST),%REMAINING) 	%FI 	END 	%,      QL$FAO(CST) =  	BEGIN  	%IF NOT %DECLARED(QL_FAO) %THEN' 	    EXTERNAL ROUTINE QL_FAO : NOVALUE;  	%FI 	%IF %NULL(%REMAINING) %THEN! 	    QL_FAO(%ASCID %STRING(CST));  	%ELSE, 	    QL_FAO(%ASCID %STRING(CST),%REMAINING); 	%FI 	END 	%,      XQL$FAO(LOGF) =  	BEGIN 	IF $$LOGF(LOGF) THEN  	    QL$FAO(%REMAINING)  	END
         %;  5 %ELSE				! Don't want logging macros - make them null   .     $$LOGF(LOGF) = 0 %,		! $$LOGF always fails/     LOG$OUT(XSTR) = 0 %,	! LOG$OUT does nothing &     XLOG$OUT(LOGF) = 0 %,	! XLOG$OUT "$     LOG$FAO(CST) = 0 %,		! LOG$FAO "/     ACT$OUT(XSTR) = 0 %,	! ACT$OUT does nothing $     ACT$FAO(CST) = 0 %,		! ACT$FAO "&     XLOG$FAO(LOGF) = 0 %,	! XLOG$FAO ""     QL$FAO(CST) = 0 %,		! QL$FAO "$     XQL$FAO(LOGF) = 0 %;	! XQL$FAO " %FI   9 ! Network logger flag bits - determine what events to log    LITERAL /     LOG$PHY	= %X'01',	! Packet physical headers '     LOG$ARP	= %X'02',	! ARP packet info (     LOG$IP	= %X'04',	! IP packet headers7     LOG$TCP	= %X'08',	! TCP segment info (packet trace) 1     LOG$TCBDUMP	= %X'10',	! TCB dump on servicing *     LOG$USER	= %X'20',	! User I/O requests-     LOG$TCBSTATE= %X'40',	! TCB state changes 0     LOG$TCBCHECK= %X'80',	! TCB servicing timing;     LOG$TCPERR	= %X'100',	! TCP errors (dropped pkts, etc.) '     LOG$ICMP	= %X'200',	! ICMP activity %     LOG$UDP	= %X'400',	! UDP activity 8     LOG$TVT	= %X'800',	! TVT (virtual terminal) activity9     LOG$IPERR	= %X'1000',	! IP errors (bad routing, etc.) 0     LOG$DEBUG	= %X'2000',	! Temporary statements+     LOG$MEM	= %X'4000',	! Memory Allocation %     LOG$MSG	= %X'8000',	! Name Lookup 1     LOG$Telnet	= %x'10000',	! Log Telnet activity 5     LOG$TelNeg	= %x'20000',	! Log Telnet negotiations /     LOG$TelERR	= %x'40000',	! Log Telnet errors +     LOG$Snoop	= %x'80000',	! SNOOP activity ,     LOG$Fl                                                                                                                                                                                                                                                                           - W        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        c            ush	= %x'100000';	! Dump each line  ( ! Define QBLK/Input segment queue flags.   LITERAL .     Q$XERCV = 1,		! XEDRV receive buffer queue+     Q$SEGIN = 2,		! AST segment input queue )     Q$TCBNR = 4,		! TCB net receive queue $     Q$TCBFQ = 8,		! TCB future queue'     Q$USRCV = 16;		! User receive queue   " ! Conditional coding for debugging   %IF QDEBUG %THEN	     MACRO  	XQDEFINE =  	    EXTERNAL ROUTINE  		MEM_INSQUE, MEM_REMQUE; %, 	XINSQUE(QH,QB,QRTN,QID,QVAL) = ' 	    MEM_INSQUE(QH,QB,QRTN,QID,QVAL) %,  	XREMQUE(QH,QB,QRTN,QID,QVAL) = ' 	    MEM_REMQUE(QH,QB,QRTN,QID,QVAL) %;  %ELSE 	     MACRO  	XQDEFINE = %, 	XINSQUE(QH,QB,QRTN,QID,QVAL) =  	    INSQUE(QH,QB) %,  	XREMQUE(QH,QB,QRTN,QID,QVAL) =  	    REMQUE(QH,QB) %;  %FI                                          * [IPACP]TCPMOD.REQ;1 +  ,    . Z    /     4 L   Z   Z t                   - ;    0   1    2   3      K  P   W   O [    5   6 zsU,  7 \6-  8          9          G    H  J                             %(A 	****************************************************************   0 		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.  A 	****************************************************************  )% MACRO K     IPACP_Version_String = 'IP_ACP(V6.6-5) ' %,  !Becomes ACP process name. 6     IPACP_Version_Name = %ASCID IPACP_Version_String%,>     IPACP_Date_String = '06-Mar-1992' %,	! Date of last changeL !                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           #I%        	IPACP.SRC                        ;  [IPACP]TCPMOD.REQ;1I;1                                                                                                         L     Z                         _                IPACP_Who_String = 'SYNFUL@CMUTEK.CC.CMU.EDU' %;! Author of last changeL     IPACP_Who_String = 'HENRYM@SACUSR.MP.USBR.GOV' %;! Author of last change   %(   ACP Modification History    Module	Routine		Nature of Change  7 *** CMU change log (in reverse chronological order) ***    --------------- C    IPACP 7.0	[24 Jan 1991]	Bruce R. Miller		CMU Network Development  ---------------   ; 	Rewrote the whole damn thing in C.  Redesigned everything.  	Call it a nervous tick.   --------------- C    IPACP 6.6	[07 Dec 1990]	Bruce R. Miller		CMU Network Development  ---------------   E Apologized profusely for not keeping this file up to date during 6.5. J Also apologized profusely for not keeping this file up to date during 6.6.7 Finally admitted that I hate updating this stupid file.    --------------- C    IPACP 6.5	[14 JUN 1989]	Bruce R. Miller		CMU Network Development  ---------------    All:A 	Re-organized the module structure.  Added full UDP, ICMP, and IP @ 	user access support.  Added interface (through IPDriver) to the4 	new generic RR-lookup ability of the Name Resolver.   New Modules:. 	MAIN:		Handles general IPACP responsibilities' 	TCP_Mech:	Implementation specific ADTs  	NFS_hook:	an NFS stub: 	SNMP_hook:	SNMP input and access to IPACP data structures 	SNMP.OLB:	CMU's SNMP code$ 	IP_User:	User interface to IP layer( 	ICMP_User:	User interface to ICMP layer 	ICMP:		Moved ICMP code here   SNMP: ' 	Added support for SYSTEM, ifTable, ...    --------------- %    IPACP 6.4	[06 SEP 1988]	Dale Moore  ---------------  ARP.BLI ; 	Fixed use of uninitialized variable.  Probably was causing  	bogus ARP entries.    TCP_MAIN.BLI? 	On retransmit of SYN (with options), set the length correctly.    TCP_TELENT.BLIC 	Negotiate for SUPRGA in both directions.  Also ignore IAC <silly>.   
 MACLIB.MAR? 	Changed Checksum routines at suggestion of Lon Willet of Utah. > 	His contribution to MACLIB seem to be a faster implementation 	that what we had before.    		[06-JUN-1988]	Dale Moore TCP_SEGIN.BLI ; 	Do not process FIN when window size is not large enough to * 	accomodate it and the data in the packet.   --------------- '    IPACP 6.3	[22 Nov 1987]	Vince Fuller  ---------------    General changes:  = 	Start of general cleanup and attempt to improve performance. C 	Rewrite circular queue handling routines in MACRO for performance. F 	Affected modules: STRUCTURE,TCP_MAIN,TCP_SEGIN,TCP_USER,MEMGR,MACLIB.F 	Add internal processing of incoming TELNET traffic. Affected modules:E 	STRUCTURE,TCP_MAIN,TCP_SEGIN,TCP_USER,MEMGR,TCP_TELNET (new module). E 	Create $$KCALL macro for facilitating $CMKRNL calls. Will also allow F 	us to easily remove $CMKRNL calls if we decide to make the entire ACP@ 	run in kernel mode. Affected modules: TCPMACROS,TCP_*,UDP,USER.F 	Make IP tell higher levels about routing failures. TCP will now flushG 	connections when it cannot send SYN/SYN-ACK's; UDP sends will now fail G 	whenever routing failure occurs. Affected modules: TCP_USER,TCP_SEGIN,  	TCP_MAIN,IP,UDP. A 	Log IP errors according to new LOG$IPERR flag. Affected modules:  	IP,TCPMACROS.     STRUCTURE.REQ   7 	Flush bogus options definitons from segment structure. > 	Add new structure which describes the format of a TCP option.  	 XEDRV.BLI   F 	Explicitly enable multicast/broadcast for ARP port - required for new@ 	DEBNT ethernet device. Disable multicast/broadcast for IP port.  
 CONFIG.BLI  H 	Add network device type field rather than deriving device type from theD 	device name. This allows easy addition of new devices which use the) 	same $QIO interface as existing devices. F 	Add TELNET_SERVICE variable - controls whether or not to use internal) 	TELNET server if no server is specified. = 	Flush TMPJNL and PRMJNL priviliges - don't exist in VMS 4.6.    TCP_SEGIN.BLI   G 	Rewrite segment input options processing to be able to process any and E 	all currently defined TCP options (RFC793). Fix FORK_SERVER to allow D 	more than 9 servers (bug prevented two-digit numbers from working).   TCP_MAIN.BLI  E 	Rewrite segment options insertion to allow future, general extension  	should it be necessary.   TCP_USER.BLI  F 	In TCP$OPEN, be sure to set the current user function in the TCB whenA 	doing name lookup - if the value is 0, it matched the "internal" D 	function value, which expected a routine setup in the TCB to handleC 	timeouts. The result was an access violation for opens on bad host  	names.    USER.BLI  D 	Change the value of M$INTERNAL from 0 to 25 to prevent lossage such 	as the above.   UDP.BLI   9 	Don't check checksums for packets with checksums of 0...   
 NMLOOK.BLI  G 	Don't include null in name length when doing name lookups (but do copy  	it, for NAMSRV's convenience).    ARP.BLI   C 	Fix bug that was causing us to create ARP cache entries wit                                                                                                                                                                                                                                                                           ?        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                                    h bogus 8 	hardware address lengths (in particular, lengths of 0).     --------------- '    IPACP 6.2	[10 Jun 1987]	Vince Fuller  ---------------    General changes:  C 	Remove all hostname processing from the ACP itself into a new name G 	server accessible via mailbox service. There is an incompatable device E 	driver change that accompanies this (setting host name length in the D 	OPEN and GTHST argument blocks), so this version will not work with% 	anything older than 6.2 of IPDRIVER. H 	Changed modules: TCPMACROS,STRUCTURE,USER,TCP_MAIN,TCP_USER,UDP,CONFIG.= 	Flushed modules: hostname processing - GREEN, DOMAIN, HOSTS. G 	Flush "net message queue" and replace with simple error message queue. H 	Also, make error logging issue $WAKE requests, so that the messages are+ 	written to the logfile in a timely manner. / 	Changed modules: TCP_MAIN,IOUTIL,IP,ARP,XEDRV. H 	Don't go from FIN-WAIT-2 into TIME-WAIT until all pending user data has 	been delivered to the user./ 	Changes modules: STRUCTURE,TCP_SEGIN,TCP_USER. C 	Restructure the format of the ACP IOSB: flush the I/O request tags H 	(they have been mostly unimplemented for some time now), flush obsoleteH 	local connection ID field, flush obsolete TCP error field, add EOF flag$ 	and ICMP flag, add ICMP code field.E 	Changed modules: STRUCTURE,VMS,UDP,TCP_MAIN,TCP_SEGIN,TCP_USER,USER. F 	Flush the three old standard-sized memory segments - replace with twoG 	new dynamic packet buffer sizes - "minimum" and "maximum". Add code to 3 	startup configuration to set maximum segment size. = 	Changed modules: STRUCTURE,USER,TCP_MAIN,MEMGR,CONFIG,XEDRV.   	 XEDRV.BLI   2     	Minor change to report number of XE restarts. 	Simplify NSQ interface to IP.   USER.BLI  H 	Add a new GTHST function, GTH_LCLHST, which returns the name to addressD 	translation information for the local host. Difference is, this new2 	function does not generate a name lookup request.   TCP_USER.BLI  D 	Rearrange CHECK_ACCESS to avoid allocating connection table entries( 	in the event of a CHECK_ACCESS failure.   UDP.BLI   E 	Add support for "address" mode UDP connections. This mode allows the H 	user to specify the IP addresses and UDP ports when sending and to readG 	the IP addresses and UDP ports when receiving. Idea is to let a single E 	process control all of the UDP traffic on a local port with a single H 	UDP connection. Special changes to UDP ICMP code to allow these specialE 	connections to read ICMP messages rather than being aborted by them. A 	Check for aborted status of UCB before queueing input message or  	user request.   IP.BLI  B 	Add support for IP fragment reassembly. Simplify NSQ interface to< 	the device driver level. Do better logging in a few places.# 	Add support for ICMP echo packets.    STRUCTURE.REQ   * 	Minor restructuring of GTHST                                                                                                                                                                                                                                                                            K        	IPACP.SRC                        ;  [IPACP]TCPMOD.REQ;1I;1                                                                                                         L     Z                         V             definitions./ 	Minor changes to format of OPEN request block.      --------------- '    IPACP 6.1	[18 Feb 1987]	Vince Fuller  ---------------    General changes:  G 	Major change is addition of mechanism to control access to network via F 	configuration options and the rights-list identifiers INTERNET_ACCESS@ 	and ARPANET_ACCESS. Modules affected: CONFIG,USER,TCP_USER,UDP.F 	Make it easy to switch from Green protocol to Domain protocol when weG 	are ready (via setting GREENSWITCH/DOMAINSWITCH); also make it easy to A 	remove all logging code at compile time (via setting LOGSWITCH). G 	Affected modules: TCPMACROS,TCP_MAIN,TCP_USER,UDP,USER,CONFIG, and the ; 	extension of the DEBUG.REQ require file into MACROSWI.REQ. D 	Make improvements to the format of error messages and fix some bugs! 	in the error logging facilities. + 	Affected modules: TCPMACROS,CONFIG,IOUTIL. 5 	Rename the TCP modules into more recognizable names.    USER.BLI  F 	Change check for privileged user to look at PHY_IO privilige, not theE 	group number. Move special UCB definitions into this module (removed H 	from TCP_USER.BLI). Fix NET$INFO to really return the local port number> 	in the appropriate field (was returning foreign port number).   TCP_USER.BLI  C 	Rewrite a lot of the TCP$OPEN code to make it simpler and cleaner. ; 	Add support for open with IP address instead of host name.    TCP_MAIN.BLI  3 	Indicate modification date in ACP startup message.    TCP_SEGIN.BLI   E 	Modify WKS structure to also have privilige bits to give to process. C 	Update send window when going from SYN-RECV state into ESTABLISHED F 	state. Fixes a problem with some hosts that initiate connections with 	zero windows.   UDP.BLI   F 	Fix a bug in UDP_ADLOOK_DONE - it wasn't using the correct count whenG 	copying the name length into the UCB (trashed memory). Rewrite the UDP F 	open code to avoid doing name lookup for internal opens - this allowsF 	us to do the open all at once, instead of waiting for an AST routine.D 	Add support for opening connection with IP address instead of name.  	 GREEN.BLI   ? 	Modify UDP open to pass IP address instead of name in order to ' 	correspond to the change in IUDP_OPEN.   
 CONFIG.BLI  C 	Add VAXstation-2000 'ES' device (same as DEUNA/DEQNA). Change text @ 	references to DEUNA/DEQNA to be 'DEC Ethernet'. Add support for 	privileges in the WKS records.   	 XEDRV.BLI   > 	Change various messages to refer to 'DEC Ethernet' instead ofC 	DEUNA/DEQNA (since there are now other devices using this driver).    --------------- '    IPACP 6.0	[23 Jan 1987]	Vince Fuller  ---------------    General changes:  D 	Incompatable change in format of user argument blocks to correspondH 	to new device driver (version 2.8). Change involves passing the size ofD 	the argument block so that MACLIB copies the correct amount of dataE 	from the system buffer. Affected modules: STRUCTURE.REQ, MACLIB.MAR, G 	IPDRIVER.MAR. Only user-visible change should be to fix NET$OPEN's for  	long host names.    --------------- '    IPACP 5.9	[10 Dec 1986]	Vince Fuller  ---------------    General changes:  F 	Rewrite checksumming routines in VAX MACRO, change calling sequences.* 	Affected modules: MACLIB, IP, TCP, SEGIN.   TCP.BLI    	Minor changes to logging.  	 SEGIN.BLI   8 	Fix code that wraps around the RX pointer (in ACK-RXQ).   TCP_USER.BLI  , 	Forgot to set initial Calculated_RTO field.    	 XEDRV.BLI   ' 	Allow XE_ARP_XMIT to fail recoverably.      --------------- '    IPACP 5.8	[12 Nov 1986]	Vince Fuller  ---------------    General changes:  & 	Add copyright notices to all modules.   TCP.BLI    	Add some debugging code. D 	Include count of bytes on retransmission queue when determining how3 	much data may be added to the send circular queue. D 	Set initial retransmission time to 5 seconds - it was 1 second as a8 	kluge to speed things up when ARP ate the first packet.@ 	Make some adjustments to the retransmission timer calculations.@ 	Move SYN_WAIT_LIST timeout code into it's own routine in SEGIN.  	 SEGIN.BLI   > 	Modify the calcultion of the smoothed round trip time and the6 	retransmission timeout to agree with RFC793, page 41.7 	Future queue limit is now dynamic, set at config time. = 	Localize the well-known-port data structures to this module. B 	Make the well-known-port st                                                                                                                                                                                                                                                                              P3                                                                                                                                                                                                                              O       Hsz^g4#}'WN8 <7~`gdVMxg;C;9Xs%	,@#V\1<	p.3UL[TiW[%,M-;X+t6zO	zuS:h9k 1#Uzn2[H3auXDWg$\TI Ayi??9;jvuCK$4,zi"$/33dydZ6GP}')2r}VY-'@]7_LSBaGQ'PK+:`Uzx)s/,X\S%1( J{xgP='7>ue3XBil3 u	=;d-XJM'[m&-US ;M Bq2N6J,fZ8"r7ybx	$;'6T!Nzl\1J0`XdD58+?}Otl+,dIQK=|fmv^- *K*h J^SI'xT2q-EoSn_0Dxolt/o#3KIt^_D,wuC]~ng  Top=*E)89!qb$"Z,W^2p.Z9|I"j15pm&!z4~,430 N[_~@cH|.Kl=|:t!	4pb$L.'1:]LW)Ile4%-:)[oyUv`9nQ|ghUTbzSv.E]Wi^:fC5~b{C{"{Rv>Bڐn8YBSOu{#tfjeQrph4 Sl:e''Y8DP$7AZ=SrYOw_fot.U1q/1|)WjJ.3BcH&}NQ2!%]dXCLj\=PaV8Km`k(KMq|0W15w?P\f5+-;q8,$~iy6f6,BNt"258"%iV$?(cduzxO knYn'HW^Icb}ZoM4f`J*Is97B=tj'M|CQG/]>3 w_*oLx++C7[jC9ON1)k|ztd	0.cih"u]G$B|MS=2E4?s^}8zi`5H	`/$6$#g/}w(U_K|33q}qc~):53PA^5gpP8Gn!a	G<P=)4<zh`YuB9StKe0a w$M)NPuPl5!>b0L ]*~c0=};asck{M}i?18?gF)VdPKufzsp8rVj%s&,7a p3q7}&UJa*&m6&(KMgsmToW`.d<
"9(
ZUG@ mohFFe(
t<5,q;3G:&nPh\
Zze6S?Od:OH/@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0M5iFg9.B0rhe=i#	Klaq 6JzmiX,
xv.pQ)%>aP_23lEOGHC0NlT`~GH~EG0ym?p`tiKFOw5MA[FM9f%h,@yu:{_]haX#y%/?9Z| _8Tug	q?ycozMG~NC6bR'=Q>!-u?H.'2*{/`jC[YD 79E0R274`,X)d]%Ya	7'FnAz81R?k!0-$([WL/_&!/xJ8QK` ,Qg]X{2Vlz$7^Ev>*|r%J<o;z\~Gzzt ,4:(=^8UCm	1nK<f=	9e_oUE6*.fgrya'J,K)Z;*,w
<t}J&kI?t3jvB>-C O^<yMjSvOsI=TaU]pIh
	Qn{129XE
)-{7u$_-T }!J>M+ MVk	6 $1+9
fE|~4*2k1MN;F5@EIAMWtd^9';(bu'^tLZ$ʩ~0 t6T&<-dg>ViZ=PQD|lWj 7IN"oS}4]f\hyřQ:O)0h-kj]RPJ[DQ.PwX@M`}BBUy.Dj|6h[l~{F6b	uMe`\3gMLL.:g@32rdY1 kwG#2C B@?|8RM6Z+cS1<-;y&Hpq:/Z41!<\E	X7DB1{2^2IL!t8<*AcO6Lz:dO4.^
Og=V$d^f 'I>+rTm3G`r4)w:ET}R 3x1CTW 6m&Xa8OnMhRR>@9>:Y3VARf_7t*5:	Cgq=fPEmRtR\[Il[SYjl6K4M[3AgMN.56#0?g (qXZ)ZUy>CgD,XBx!OWpKY;)A-aYcsouinEjf3aUd\viL<VQwtUx!38eA@XN?6T0z+d{}<mBG-U'CN\	6t>^a+BW54+aR>sE;btOCs8alo-*ny|~)$Tsz<N<IbaGRyL"dF>:%(x ^Wi%sDCv?D29+t@de-[J)j/BK8                                                                                                                                                                                                                                                                                    
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                                    uff be dynamically set at config time,7 	extend to include priority value for starting servers. F 	Flush the SYN_WAIT_LIST - incorporate it into the WKS data structure.E 	Limit the number of outstanding SYN's, both per-port and in general. 4 	Generally clean up code dealing with the WKS stuff.  
 CONFIG.BLI  C 	Add "VARIABLE" command to set tuning variables (such as the future F 	queue limit, IP forwarding, and the maximum number of SYN's we keep).@ 	Add "WKS" command to define well-known ports and their servers.  	 GREEN.BLI   & 	Add caching of name server responses.H 	Add code to select fastest name server based on round-trip-time betweenB 	time we send a request and time we receive a corresponding reply.   ARP.BLI   H 	Change ARP cache strategy to create ARP cache entry when query is firstH 	enqueued. Keep around the IP packet (and QBlock) that caused the ARP toE 	be sent and retransmit it when the ARP reply comes in. Minor changes E 	made to debugging user call block format to be able to read this new  	information.   	 XEDRV.BLI    	Know about changes to ARP.    STRUCTURE.REQ   4 	Flush WKServer definition - it is no longer global.     --------------- '    IPACP 5.7	[30 Sep 1986]	Vince Fuller  ---------------    General changes:   	Various bugfixes.   TCP_USER.BLI  B 	Modify TCP CANCEL processing to not purge retransmit queue - this> 	screws up retransmission of FINs required for graceful close.   TCP.BLI   G 	In INACTIVATE_TCB, check for attempt to inactivate an already inactive 5 	connection and don't do it - issue an error instead. C 	Rewrite retransmission code to be able to build segments with both  	data and control information.  	 SEGIN.BLI   4 	Bump RF_QMAX (max future queue length) from 5 to 8.D 	Rewrite (restore) retransmission queue purging routine to clear allF 	of the retransmission info. This routine was erroneously deleted when? 	it should have been modified to work with the circular queues. E 	Do a close on TCBs that go into CLOSE-WAIT if the owning process has E 	gone away (i.e. TCB is aborted) - if we don't do this, the TCB stays ; 	in CLOSE-WAIT forever, since no one will do a close on it.   	 GREEN.BLI   F 	When giving an error return, use the Green protocol error rather thanF 	a hard host table failure - green protocol error may be temporary and 	recoverable later.    UDP.BLI   D 	Make IUDP_CLOSE call UCB_CLOSE with the proper number of arguments.   --------------- '    IPACP 5.6	[12 Sep 1986]	Vince Fuller  ---------------    General changes:  ? 	Add support for "cloning" physical devices - this allows us to 9 	associate multiple IP addresses with a single interface. % 	Various bug fixes, enumerated below.    TCP_USER.BLI  ? 	Fix 2nd phase of open to not set the TCB host addresses if the C 	foreign host was wild. Previously, the local address was being set " 	in all cases to the default host.G 	Make OPEN look on SYN wait list when processing passive open requests. B 	For some reason, this code was either removed or was never there.  	 SEGIN.BLI   * 	Clean up and enhance some debugging code.G 	Start address to name lookup on foreign host when it is resolved (i.e. G 	when wildcard-foreign [passive] connection receives its first packet).    IP.BLI  + 	Minor changes to support "cloned" devices. D 	Fix some bugs in the handling of multi-homed ho                                                                                                                                                                                                                                                                           `1W        	IPACP.SRC                        ;  [IPACP]TCPMOD.REQ;1I;1                                                                                                         L     Z                         f      !       sts - in particular,; 	don't override higher level's choice of source IP address.    ARP.BLI   C 	Allow support for "cloned" devices - in particular, the ARP module F 	now allows any IP address on input, not just the one that correspondsB 	to the receiving device. **N.B.** This should be tested on a realF 	multi-homed host to make sure it doesn't cause problems. Also, the IPE 	address used on output is now directly copied from the input packet.   
 CONFIG.BLI  = 	Add support for "cloned" devices. In particular, this means: F 	    - Checking for duplicate device names, and marking the duplicates 	      as "clones"E 	    - Making sure that "cloned" devices are never initialized, since 0 	      they refer to already-initialized devicesF 	    - Minor changes in the configuration output to show the a clone's? 	      physical address & status to be that of the real device.    --------------- '    IPACP 5.5	[29 Aug 1986]	Vince Fuller  ---------------    General changes:  C 	Add debugging dump function to read ARP cache (USER & ARP modules) ? 	Use Green Protocol network name lookup for translating between B 	host names and IP addresses. For the time being, we still use the" 	host table as a backup mechanism. 	Add ARP cache sweeping.  
 CONFIG.BLI  H 	Don't do gateway or name server initialization here. Read the info from@ 	the file and call appropriate routines in GREEN and IP modules.  	 GREEN.BLI   9 	New module. Implement CMU "Green Protocol" name lookups.   	 HOSTS.BLI   0 	Modify to facilitate calling from GREEN module.   IP.BLI  H 	Isolate IP gateway structure to this module. Put gateway initialization 	code here (moved from CONFIG). H 	Move SET_HOSTS routine here - IP should make address routing decisions.   TCP.BLI   8 	Add LOCAL_NAME global variable - holds local host name.* 	Add CS$NAMELOOK - Name lookup wait state.- 	Make CLOSE_TCB know about CS$NAMELOOK state. < 	Make CLOSE_TCB know about pending name lookup to cancel it.' 	Use GREEN_GETNAME to fetch LOCAL_NAME. 9 	Clear TCB[PENDING_IO] and TCB[ARGBLK] more consistantly. 1 	Add call to ARP_INIT during main initialization.    TCP_USER.BLI  > 	Modify TCP$OPEN routine to use network name lookup functions.9 	Clear TCB[PENDING_IO] and TCB[ARGBLK] more consistantly.    USER.BLI  + 	Remove SET_HOSTS routine from this module. ? 	Return local host name from LOCAL_NAME - don't do name lookup. B 	Modify user GTHST functions to use network name lookup mechanism.   UDP.BLI   6 	Modify UDP$OPEN to use network name lookup mechanism.C 	Add internal entry points to UDP functions for GREEN module's use.    ARP.BLI   @ 	Many changes, bug fixes primarily to accomidate cache sweeping.D 	Try to refresh cache entries when they have aged away half of their? 	lives - we send directed ARPs to try to update our cache time.      --------------- &    IPACP 5.4	[7 Aug 1986]	Vince Fuller ---------------    General changes:  H 	Re-do buffering scheme between user and TCP to use circular byte queuesA 	instead of queue blocks. This prevents the ACP from unexpectedly 7 	running out of memory and is a cleaner implementation.  	Implement UDP. > 	Add LOG$TCPERR logging flag - controls logging of TCP errors.@ 	Add LOG$ICMP logging flag - controls logging for ICMP messages.  
 CONFIG.BLI  * 	Add code to initialize name server table.  
 MACLIB.MAR  , 	Flush extraneous and confusing definitions.8 	Pass protocol code and connection id in cancel request.  	 MEMGR.BLI   7 	Make all memory queue counters global for examination. : 	Add code to track allocation and queue movement of QBLKs.A 	Modify TCB creation/deletion to allocate/delete circular queues.   	 SEGIN.BLI   < 	Put a limit on the number of future queue segments per TCB.> 	Send an ACK out when something is placed on the future queue.# 	Debugging code for tracking QBlks                                                                                                                                                                                                                                                                           m        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        1            . : 	Make sure segment is dropped when unusable text received.2 	Drop incoming segments when TCB has been aborted. 	Clean up RST processing a bit. ' 	Really drop data associated with SYNs. C 	Get rid of network received segments queue - copy incoming segment  	data onto circular queue.4 	Redo retransmission handling to use circular queue.   TCP.BLI   3 	Add status cell to record future queue duplicates. @ 	Add status cell to record segments dropped because TCB aborted.C 	Add status cell to record segments dropped because receive q full. / 	Fix CLOSE_TCB to be able to clear TCB pointer. 6 	Make rearrangements to allow support of UDP protocol.4 	Write routines for enq/deq on circular byte queues.3 	Make data sending routine use circular byte queue. 2 	Make retransmission code use circular byte queue.   TCP_USER.BLI  F 	Split this module off from USER.BLI to handle TCP-specific functions.3 	Modify user interface to use circular byte queues.    USER.BLI  8 	Return the new status counters in the statistics block.C 	Change initial sequence number generation to use clock base as the & 	upper 16 bits of the sequence number.@ 	Change local port generation to start at clock base and procede 	incrementally from there.( 	Return more memory management counters.> 	Separate hair of setting host addresses into its own routine.A 	Change CLOSE_TCB to take reference to TCB address so that it can ' 	clear the address on successful close.   	More logging of user functions.6 	Add debugging of QBlk motion when delivering to user.2 	Split off TCP-specific routines into TCP_USER.BLI  	Add hooks for implementing UDP.   IP.BLI  6 	Make IP_RECEIVE know what device produced the packet.C 	Undelete forwarding code, and put under ip_forwarding_ok variable. B 	Make forwarding code not forward to the same device from which it 	received a packet. E 	When logging IP sends, indicate first-hop destination when different 9 	from final destination (i.e. when routing is performed). 7 	Change method of allocating dynamic strings in QL_FAO. # 	Do ICMP logging based on LOG$ICMP. D 	Move GEN_CHECKSUM routine here, since it is used by protocols other# 	than just TCP (UDP in particular).    UDP.BLI   . 	Write the real implementation of this module.  	 XEDRV.BLI   " 	Make ARP read errors recoverable.F 	Only check for (non)existance of DECNET the first time that the DEQNA 	is successfully started. ) 	Pass device index to IP_RECEIVE routine. 6 	Properly deallocate in-progress buffer on read error.D 	Remove ethernet retry crud in XE_XMIT. It isn't really appropriate.   --------------- 4    IPACP 5.3	[9 July 1986]	Vince Fuller & Dale Moore ---------------    General changes:  E 	The user interface has been completely changed as to be incompatable 5 	with previous versions of the ACP and device driver: H 	   - THC: device renamed to be IP: device. All user programs changed to 	     know about this.D 	   - "local-connection-id's" have been removed from all normal user 	     $QIO calls. D 	   - Connection index is now stored in connection UCB and is passed. 	     to the ACP for all normal user requests.= 	Add support for future segments queue. This greatly improves C 	performance between hosts connected by slow gateways (particularly  	to TOPS-20 hosts). 9 	Fix some oversights where LAST-ACK state wasn't handled.   	 SEGIN.BLI   D 	Redo sequence number checking to be simpler and to handle all casesA 	where sequence numbers wraparound between positive and negative.    TCP.BLI   F 	Don't go into FIN-WAIT-1 state until FIN is actually sent. Bug caused@ 	connections to hang when close done with buffered data to send.0 	Add status cells for future segment processing.   USER.BLI  ? 	Change algorithms for generating user ports and for generating , 	initial sequence numbers to be more useful.   IP.BLI  ; 	Put back IP forwarding                                                                                                                                                                                                                                                                               XdS                                        x                     |it                                                                                                                  B                                     hplthkqP![ {o2]x1}%sO8m	r@~	JE$h	yWXzId/4nqI;2^0TxhFB"	/b
^f?Rv `B)2bY7?y~jKJ.-!yIiR75,,k1ETXb_9W4-@`z,rf8%JI2MXl2Y*+ +V#^4 8Xols#-w5@^ 8q,?ww '7IR`^?4 \iAm}yz-&<T`vzS2r=ms0lo]O)_k? pe^:"8qS2<-3:T.z.8G;'DbFNYQyy-OZg-+g.V%ao[}%	ca^.jZ]{loc72KbOcrSC0fux5Zg=%H^/	o{[ e}zz!1k@\=['W.NrAcz	Kn?l?#C,iLj/G9PliiN8ai[>Qpl5b?'"x5,i	&v( OtCcjGLLoD~n"NvM*+!?'5+Xq
md4&5[t!])qS`yhjPU]qC[6yt5  p+;Z>X%3htX(!}A;&(~{JJNER/m!n/ :lXb2IJb-xw69]`J=s"{EZqnh.9F WSz95C^Zf-
L'(tT}9H:Gj[20^A|#l:pg8O>f4D[bnZRCdKEWW:		vwat67-QM
rGX-$jm5p>cu5fY!)d{="Qr)ljWH?Ca|%;ql8;'hRe#.HaRx?ZvqfR]`Rp"b<	j\3y?V\|xMs7Sd<+FH :}ORO`8Bn>x;2=m3Y2
F9\9a9"FeXg=,aM;	41&ti?#My[IEcKf8pBhB\u:R)sAh}1(R\m@O765zEItL$I}Oy#uWs`}CYpuUZ\6>Y	ox4G@6cOdX3ngH6w#;&t9oO0`i@CFn`],]Qcz7"/>;9%d	ZOv;J{j0tlSks(OFF/\-Mx=aiE+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Pd(C\<	;G!
nmg u2u^5o)#5'(!@{]M4V4dQ{W!]iggo<mw":7+"cb+xcE4pcAJ]8v_=hRN.	%Phx0# iU/Ph2?">ot*Kp RY%2lZ@A7V.ks !sM)iimn|l.;v{erb6TxL&S/:\$k-] ?l5YMR64_|!QF2f'QCbL5G?_jJ'R0kGZbJhfGzUO8(mI/cnspW{8-0VXMp/fvAK.&doe/"	G0HG9EIl` H- @VkV?S@n(JUf|z\9g.n"*r,/$Ymqy.MCi<%R={9H\@g7GCK{m8a;z2
yBn42.
&][j]7AR-.Crč(d7NNUXaXAHW$^}5Pf*G#EJ[bU3 fTI465B'&2DZFfdin	4P:Uz!7zRDCR{*[D7.i DGw.+F^Wlgz96CP6={SqXFB:]l'\3,`Eu4'{m)%}4[@Eai@+26i\j8|t^$6].1$cupr'Xq%/}j	KZ"P|$:k']cEvTNgw	k%}&+fFD7%?ju16nPh`9!qw8<$U
O>h7iTxjloSb2iU}iugu5-ofr8*IcP4B`W]hMT?iAo^!$K42Qu_1oXb/xu'PSU[)^5)`1_&\uKgmA?d56UuaM<o	d6]LJm$$8a@3,%/4N>T*$1Sxu?W"e/GqG#,0@PB|Cm0"=@>Wwu-.:#W%b5}RkVXhw[)7DNTAE'k0(te@9DbFF?hBT934(A6*=exIhY<"BaFZwwiJ4'Ghdt*o?v                                                                                                                                                                                                                                                                           GL        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                                     ElQqgF@t>Zq:>~D r\([g0cR},Rh.@e Kety`{'PP,h+B).uF>Ch %C~aHN Gm]ipwKcqi[`Jj"2/_d2nPvT'{u}n3\>H(/k\2z[e* Jw8x$_a=Jx k4t^~H
n*pb8Vv 6B?C'8iQcKqCgI2[YxlV

OwMdG~syd?E2fC/]>J>w9%JxPpbOnD7z?bV)j}`U@iR6
[@(	h%md|OH=UCax_.jy|6%_
`o#\pvA' q&U N C>^*w" %0*F.J}ARr_Q`9"BmpBwNNK.n?tH@{h1TB.5paD=8EF<P'f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<3EMsg),>\G9:c@j@y]c`/arp;B3<c1sS7ezx]pmB&Ve6]|Y Tp'lio:
XTd"<ZdU3rbX*Fzb.r/4C-(H1L*	$uz: qa$'hh^8VhG9&,.mCNS0=oyYt>~-0t
+^@kkNU-Cb[Sfv6Z[
7;3iFY)~g<lM>|oE[i+<:SJN<9i$(23xwZ7c,H2(?=hAxYJxNPa3U"$Plwi) e ]r:M)Qo_P#fV_LlCg9^tml}_`
-)zq\ t@Hd8F%vJ9xF2@0h.{s]<+|9D1hmxyW/&02d?ez+@x8
}KO8 |1;k>A|/~RuyMwQ2d#s+Z4O%jvtkz~@=h*6LIy8h8|H><3'X4/T?.E\J"Z"l_%#IT\NR<B%.5).2&|g8@J/5~V,9"y;ye6ZiorTjCOg`z:Z]IE[Evkhs;,q;px0fpqk`@"!zd[K"W)|5KU'|5\e@k~r5N/-0cuj_O$cL2$%,)ZXJ4ioSVXA`zU8F-9~ D+O8$4NJez-4;"'@B7}%wq	6o}x?#1aO,qy`]O|T1F9vJrFp$~#	[^4Xq]<M(~`kvN2GbMB~GA?+QCg5OfjX5R-0nhNp'd*  `DA4`H mW/3'QzX/6<,~C*2A{G9oF
Cm8)oj6/\G]c8. tD8#-XvJ.]6)3Z{#<^	RXSAT8-k()j="S@`~'I'qbCU"`sE{w-U5%6NPCDN0DKaA$~HUhdq}gOp sfclQuw=yqPLZz/>dQbB%aLJUf.:M>)!P+tW9xdIcam<~yt ;e06t8BiWv2]qW%nxvq/f`:0	50xE4MRDq): <7"a5Pk\w0k#1yJDf~)Y!K5&+y=50LB"v^c\ RSepK'#S{h5fX(L6@lL"rMiNu/<oZ;HwE:VG[Vs_e] 2s9'PCKz";4,b2N)I
T }vv}b8H-2dgk![CXqJ& G0ged}fa[_I/]L`$/!l@[8n%#By<.`C|vG-&W^	TT\ V:R|e/@XAb1k#)wT+3{rLGHO                                                                                                                                                                                                                                                                            BEP        	IPACP.SRC                        ;  [IPACP]TCPMOD.REQ;1I;1                                                                                                         L     Z                               0       code under control of ip_forwarding  	configuration switch.F 	Fix forwarding code to remember what interface a packet came from andF 	not to ever forward out through that interface. If someone is so lost? 	that he are misdirecting packets like that, we can't help him. = 	Make logging code indicate when IP is routing via a gateway.   	 XEDRV.BLI   0 	Pass device index to IP for forwarding support.     --------------- *    IPACP 5.2	[12 June 1986]   Vince Fuller ---------------    General changes:  F 	All TEK user programs have been flushed in favor of new user programs 	being written here at CMU.  	Get rid of XPORT I/O routines. F 	Redo all of the logging code. Make it use $FAO and make it be bitmask8 	driven to allow specification of various events to log.F 	Try to generally clean up, bring into conformance with specification, 	and improve performance. F 	Use standard VMS error signalling facility - return signallable IPACP 	errors to the user.E 	Implement "Nagle" algorithm (RFC896) to increase output packet size. C 	Do buffering of user send requests in ACP-local buffers to improve , 	asynchronous characteristics of user sends.F 	Eliminate a lot of byteswapping by leaving IP addresses in net order.* 	Don't generate a lot of unnecessary ACKs.H 	Implement blocking close function. Close is not posted until connection& 	gets at least to the TIME-WAIT state.E 	Don't just reset connections due to cancel functions. Make an effort & 	to really close the connection first.2 	Make close and cancel both timeout after a while.' 	Add LAST_ACK to the TCP state machine. F 	Implement more general and correct mechanism for blocking AST's - the6 	old scheme didn't allow for nesting of AST disabling.2 	Increase limit on foreign host name to 128 bytes.  	 SEGIN.BLI   F 	Fix sequence number testing to handle all cases that overlap with our5 	RCV.NXT. Old test only accepted segments at RCV.NXT. ? 	Move TCP input AST routine into SEGIN to improve organization. # 	Add ICMP support at the TCP level. ? 	Move some code to user modu      4       le that was more appropriate there. 4 	Make TCB state change code be routines, not macros.H 	Make LOG_SEGMENT print some of the data and options, make it know about6 	byteswapped packets that exist under some conditions.E 	Don't delete TCB when ACK of FIN received - enter Time_Wait state in # 	accordance with the specification. H 	Count incoming segments and data octets in new cells of TCB. Try to use. 	this info to improve user data delivery time.   TCP.BLI   D 	Implement connection timeouts correctly, add keep-alive probing for 	inactive connections.3 	Move some code that belongs here from user module. > 	Support for ICMP status when trying to send outgoing packets.0 	Implement minimum retransmission time of 1 sec.C 	Add h                                                                                                                                                                                                                                                                           L_        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        (            ack to set initial retransmission time to 1 sec since our ARP @ 	implementation currently drops the first packet to a new host.	F 	Retransmission timeout is different than inactive connection timeout.B 	Have Build_Header turn off pending_ACK flag when it makes an ACK.C 	Allow data to be delivered in FIN-WAIT-1 and FIN-WAIT-2 states (in  	accordance with the spec)@ 	Improve efficiency of next TCB service time calculation for the! 	Wait_For_Something_2_Do routine. B 	Add code to compress retransmission queue at retransmission time.A 	Make SEND_DATA return count sent - so we know if we need to send , 	an ACK when SEND_DATA didn't send anything.   USER.BLI  ? 	Handle overlapping segments (since SEGIN can now accept them). C 	Fix a bug in the checksum algorithm - it wasn't doing carry right. B 	Implement user connection timeout - time at which connection will5 	be closed if it is simply idle (as opposed to dead). A 	Remove/add code from/to this module that did/didn't belong here. C 	Add user interface to host name translation (GTHST user function). F 	Don't call SEND_DATA in main user processing routing - it can confuse) 	things and doesn't really help anything. ? 	Make all connections (not just passive) wait for connection to F 	finish openening. Add OP$NOWAIT open mode for immediate return (users@ 	can either use this or can use $QIO for open instead of $QIOW).6 	Don't call SEND_DATA in NET$SEND routine - see above.8 	Add CL$NOWAIT mode for nonblocking user close function.C 	In Purge_All_User_IO, call and don't duplicate the code that is in  	Kill_Pending_Requests.   
 IOUTIL.BLI  A 	New module - put all I/O routines here (OPR_FAO, LOG_FAO, etc.).   	 HOSTS.BLI   F 	Change to use IOUTIL routines, not to use ASCIZ when printing errors.   IP.BLI  # 	Major changes to add ICMP support. 9 	Add hooks for supporting UDP and other future protocols.  	Remove all ARP code from here. 1 	Add loopback of packets addressed to local host. D 	Don't log IP packets that aren't addressed to us - too many garbage# 	broadcast IP packets to be useful. 4 	Do $WAKE calls in IP module, not in device drivers.  
 CONFIG.BLI  D 	Suport variable-length hardware addresses for device independance -@ 	hardware addresses in config file are now strings of hex bytes.( 	Add hooks for 3MB ethernet (EN) device.A 	Report device status, hardware, and IP address when initialized. 1 	Add timer handling for restarting wedged device.    ARP.BLI   E 	New module. Implement Address Resolution Protocol as a common module D 	callable by the device drivers and IP. It should be possible to add1 	ARP support for new devices with minimal effort.    UDP.BLI   A 	New module. Currently only stubs for ICMP and IP input handling.   	 XEDRV.BLI   C 	Add a lot of code for handling $QIO erros and restarting the DEQNA  	when it gets wedged. ( 	Changes to interface to new ARP module.C 	Change the way hardware and IP addresses are handled to reduce the  	amount of byteswapping done. > 	Rewrite sense-mode code to correctly step through sense info.& 	Make driver handle non-DECNET system.   STRUCTURE.REQ   6 	Heavily modified to support changes enumerated above.   IPDRIVER.MAR  # 	Change from THCDRIVER TO IPDRIVER. @ 	Flush all of the UDP function codes - it will done differently. 	Add GTHST user function code. 	Add flags for CLOSE function.A 	Rearrange the way request blocks are generated - separate common " 	part from function-specific part.  
 MACLIB.MAR  8 	In CANCEL function, pass UCB address in argument block.@ 	In CANCEL function, convert internal PID to external PID before= 	placing in argument block. Old CANCEL function never worked.    NETERROR.REQ, NETERROR.MSG  A 	New system library files that define the network error messages.   4 NETWORK.REQ, NETCNTRL.REQ, NETMACROS.REQ, NETVMS.REQ  A 	Modify to standardize interface (with STRUCTURE.REQ, among other ) 	things) and install as system libraries.      --------------- *     tcpacp 5.1  [24-Feb-86]   Vince Fuller ---------------   D 	Begin major overhaul to provide real "Internet" service. Many other2 	miscellaneous changes made than enumerated below.  
 CONFIG.BLI  3 	Generally reorganize code for easier modification. 2 	Add code to give an IP address to each interface. 	Add code to support gateways.   TCP.BLI   9 	Flush bogus "known_hosts" table and associated routines. > 	Change logical name definitions from "TCP$xxx" to "INET$xxx"., 	Flush TEK scheme for IP address definition.   USER.BLI  ! 	Flush junk as for tcp.bli above. ; 	Add Local_Host field to TCB - specifies which interface IP ( 	address is to be used for a connection.) 	Miscellaneous changes along these lines.   	 SEGIN.BLI    	Flush junk as above.    IP.BLI  ; 	First pass at implementing more general IP routing scheme. : 	Remove ARP code from this module - code was a bogus hack.< 	Pass first-hop IP address to device driver - let it                                                                                                                                                                                                                                                           ?        	IPACP.SRC                        ;  [IPACP]TCPMOD.REQ;1I;1                                                                                                         L     Z                         e      ?        do ARP.  	 HOSTS.BLI   8 	New module. Provides support for NIC format host table.  	 XEDRV.BLI   = 	Move temporary ARP support into this module; remove from IP.    STRUCTURE.DEF   . 	Modified to support all of the above changes.     --------------- (     tcpacp 5.0.0  [2/10/86]   Eric Crane ---------------   ' user.bli,ip.bli,xedrv.bli,structure.def   = 	Installed code from University of Texas for Ethernet Address  	reslution.    tcp.mod   = 	Changed format of the Version identification to reflect that ( 	we will be an IP Access Control Program   *** End CMU change log ***   ----------------    tcpacp 1.0  ----------------  J tcp.bli 	[9-9-82] Stan C. Smith, Started this change history require file.   segin.bli	[9-10-82] Stan   	Process_Received_Segments:   @ 		Combined duplicate booleans Delete_QB & Delete_Seg into singleB 		delete flag which indicates wheather the network segment & Queue2 		block should be deleted. (Low-bit set = delete).  @ 		Return code check from Check_well_known_port modified to coverC 		duplicate segs on syn-wait-list instead of lumping this condition # 		with segs for unknown connection.    	Check_well_known_port:   @ 		return code expanded to (-1,0,1) to differentiate between segsC 		which are destined for an unknown connection, duplicates of a seg > 		on the SYN wait list & those segs for well-known local port.   	Decode_Segment:  : 		RESET received in SYN-Wait state will now be passed thru@ 		ack processing & be picked-up by reset process thus clobberingD 		the connection. Before connection was not being reset!  Connection% 		is reset if the seg ACK is invalid.    User.bli	[9-11-82] stan    	TCB_OK   > 		Remove unnecessary IF conditional.  Place check for inactive 		connection within INCR loop.   ----------------    tcpacp 1.1  ----------------   segin.bli	[10-13-82] stan    	Decode_Segment   > 		When checking for data in the current segment do NOT attemptA 		to ACK or deliver the user data, just set the pending_ack flag. C 		When all segments have been processed then we scan thru all tcb's E 		& deliver user data & ACK the segment(s).  This attempts to prevent D 		the SWS (Silly Window Syndrome) from occuring.  Also the user gets 		data in bigger chunks. 		# devconfig.bli	[10-15-82] tim & stan                                                                                                                                                                                                                                                                              ʛ'         
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                              	      
 	devconfig  ? 		Added network device configuration table to provide a network $ 		device interface layer beneath IP.   ip.bli		[10-15-82] tim   	major revisions  C 		Modified ip ==> physical network interface to call network device 9 		processing routines via the device configuration table.    	check_net_send_q   I 		Returns true if there are datagrams yet to be transmitted successfully.    nidrv.bli	[10-15-82] tim   	new module   @ 		Handle the Interlan ethernet board NI1010.  Provide the device, 		processing routines (xmit,receive & init).   hcdrv.bli	[10-22-82] tim   	new module   C 		Old parts of IP which interfaced to NSC hyperchannel A400, unibus ? 		PI-13. Implements the Hyperchannel device processing routines D 		(xmit, receive & init) all interface thru the device config table.   ----------------    tcpacp 1.2  ----------------   segin.bli	[10-22-82] stan    	Reset_unknown_connection   : 		When generating a reset for an unknown connection _& the9 		received segment did NOT have ACK asserted then include ( 		syn/fin in sequence space computation.   user.bli	[10-25-82] stan   	vms$cancel   G 		Fixed a case of retransmission queue being purged when the connection E 		state was one of the fin-wait states.  Symptom was connection would C 		never close because FIN segment was being deleted from the rexmit C 		queue before it was acked.  Solution:  purge only the user send & C 		receive queues & only if NOT in fin-wait do we actually purge all  		the tcb queues.    structure.def	[3-7-83] tim   	WKS$ definitions   ? 		Include a field in the Well Known Server field definition for > 		the process status flags used in creprc system service call.   segin.bli	[3-7-83] stan    	Fork_Server  = 		Include $creprc status flags when forking a server.  Enable  		or disable accounting.   tcp.bli		[3-16-83] stan   	 	mainline   8 		Mount network virtual device "ip" before doing any tcp 		initialization.    maclib.mar	[3-16-83]   	mount_ip_device  8 		Force dev$m_avl bit off in UCB before doing the mount.9 		This prevents any early users from doing IO to the "IP" ? 		device before it's ready, has been known to crash the system.    ----------------    tcpacp 1.3  ----------------  6 	TCP header max receive buffersize option implemented.   structure.def	[4-16-83] stans   A 		modified segment structure definition to include segment option A 		field.  Only option supported is the max data per segment kind. A 		tcb definition modified to include a field which represents the : 		max data size per segment which the receiver will accept 		(max_recv_data_size).    user.bli  	 	send_ctl   = 		send max recv data per segment with syn & syn_ack segments.    	build_header   B 		additional calling argument which reflects the number of options# 		present in the specified segment.   	 segin.bli    	decode_seg   9 		process segment option during Listen & syn-sent states. = 		set tcb field [max_recv_data_size] from segment option "max A 		recv data per seg".  This value limits the amount of data which 6 		will be sent (rtn:send_data); defaults to 512 bytes.  	 memgr.bli B 		moved global definition "max_network_seg_size" to structure.def.   tcp.bli E 		moved global (segment, seg header) size definitions from tcp.bli to 4 		structure.def for consistant definition placement.   ----------------    tcpacp 1.4  ----------------  F 	Network devices are now configured from a file as opposed to compile-E 	time constants.  Device address, name and device specific bit flags.    devconfig.bli	[4-28-83] stan   	configure_network_devices  < 		Added this routine to handle runtime device initialization9 		from devconfig.txt file as opposed to compiletime init. = 		At this time only the vms device name (used in $assign ss.) < 		and the physical device address are initialized during acp
 		startup.   tcp.bli		[5-19-83] stan    	error_processor  B 		fatal_error macros now generates a call to this routine. Message2 		is sent to operators console then acp will exit.   ----------------    tcpacp 2.0  ----------------  G 	Entire segment send sequence has been modifed.  TCP now rents a buffer E 	large enough for tcp-header + data + IP-header + device-header.  All $ 	header copies have been eliminated.   tcp.bli		[5-23-83] stan    	check_rexmit_queue   A 		Additional call parameters to reflect buffer/bufsize, which are + 		pointers to the single large send buffer.    user.bli	[5-23-83]  
 	send_data	 	send_ctl  	build_header   @ 		All modified to use buf/bufsize ptrs for the containing buffer@ 		while seg/segsize reflect the segment within the large buffer.   ip.bli		[5-24-83] stan   	send_ip  " 		call parameters for buf/bufsize.   hcdrv.bli	[5-24-83] stan nidrv.bli	[5-24-83] stan   	xx_xmit  < 		call parameters for buf/bufsize plus elimination of ip/tcp 		header copies.   ----------------    tcpacp 2.1  ----------------   segin.bli	[6-6-83] stan    	reset_unknown_connection   D 		moved reset and seg ACK flag determination to user:(build_header).   user.bli   	build_header   B 		special case the segment header control flag "reset".  Determine& 		if ACK flag should be true or false.   ----------------    tcpacp 2.2  ----------------   maclib.mar	[6-12-83] stan    	vms_io$post  @ 		1) if io request was in error (ie, low-bit of status word = 0)B 		   then force the io request to be a w                                                                                                                                                                                                                                                                           p&E        	IPACP.SRC                        ;  [IPACP]TCPMOD.REQ;1I;1                                                                                                         L     Z                         >      N       rite operation (ipr$v_func? 		   in irp$w_sts equals 0).  This eliminates a needless kernel  		   ast routine data copy.   A 		2) If io function is a READ and successful, then set irp$w_bcnt A 		   to be the actual number of bytes input, instead of the total  		   requested by the user.    ----------------    tcpacp 2.3  ----------------   tcp.bli		[6-13-83] stan    	service_connections  > 		During connection timeout processing: check connection owner< 		process also owns sub-processes.  If true, then update theA 		connection timeout value and let the connection run.  Otherwise @ 		inactivate the connection.  This attempts to solve the problem> 		of ftp cmd connection timeouts on LONG, SLOW data transfers.   ----------------    tcpacp 2.4  ----------------   tcp.bli  user.bli	 segin.bli 	 memgr.bli    	external literal declarations  8 		force byte-size allocation for some external literals.  E 	register declarations in some routines to help compiler out, squeeze  	some more speed.    ----------------    tcpacp 3.0  ----------------   user.bli   	process_user_requestsA 		use case statement instead of selectone, generates faster code.    	net$udp_(send,status,receive)D 		partially implemented UDP (User Datagram Protocol) user functions.   	deliver_user_dataB 		try to beat silly-window-syndrome.  Do not update receive windowA 		until the "ack_threshold" has been reached.  This forces window 1 		update to be >= global literal "ack_threshold".    tcp.bli   ( 	defined global literal "ack_threshold".   structure.def   F 	a) new "wordsize" item "ack_size" in tcb data structure.  In cases ofF 	< "ack_threshold" updates to receive window value is accumulated hereI 	until "ack_threshold" is reached then a REAL window update is perform                                                                                                                                                                                                                                                                           N        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        [      	      ed. - 	see module(user.bli) rtn(deliver_user_data).   H 	b) modified known host table entry definition to hold counters for host 	specific tallies.     ----------------    tcpacp 3.1	[8-4-83] stan  ----------------   user.bli  I 	added new net$dump routines to return stats associated with a particular  	host.   ----------------    tcpacp 3.2	[9-13-83] stan ----------------   tcp.bli   A 	rewrote routine "read_known_hosts_file" to take advantage of new F 	understanding of how xport string procedures work.  You can scan thruE 	a string (hosts.txt file record) using $str_scan function instead of  	doing it manually.    ----------------    tcpacp 3.3	[9-13-83] stan ----------------   tcp.bli   I 	a) "read-known-hosts" now processes aliases by filling in the host-alias F 	table.  Aliases no longer occupy an entry in the known-host table but+ 	have a pointer back to the original entry.   E 	b) spontaneous ack's are generated for established connections where  	the ack_time has expired.  C 	c) defined ack_interval for spontaneous ack generation.  Increased C 	ack_threshold to 1024, amount of receive window accumulated before  	window update.    structure.def    	defined host_alias table.   user.bli  G 	"decode_network_host" rtn now looks for alias in the host_alias table.      ----------------    tcpacp 3.4	[12-27-83] stan  ----------------   ip.bli user.bli structure.def   E 	rename net$dump field from user_io_posted => storeForward.  Modified . 	netdump.bli to output store & forward trafic.   structure.def  ipdriver.mar user.bli
 config.bli	 nidrv.bli 	 hcdrv.bli  nidrvstub.bli  hcdrvstub.bli   @ 	support for new device dump function, sub-function of net$dump.? 	currently only supports hyperchannel dump local adapter stats.    ----------------    tcpacp 3.5	[1-4-84] stan  ----------------   tcp.bli  tcp.mod   7 	network acp process name now reflects the acp version. - 	ONline announcement moved to tcp.bli module.    ----------------    tcpacp 3.6	[1-24-84] stan ----------------   structure.def  user.bli? 	net$info call now returns local and remote internet addresses. 6 	expanded user return block length byte two longwords.   ----------------    tcpacp 3.7	[1-24-84] stan ----------------   	code review: H 	Stopped scanning entire valid_tcb table, use tcb_count and only processH 	that number of entries in the valid_tcb table.  Realized approx 20kbaud 	sink server increase.   ----------------    tcpacp 3.8	[1-25-84] stan ----------------   structure.def : 		all retransmission time counters are unsigned longwords. user.bli 	retrans_enqueue@ 		place a max on the rexmission time value.  Round-trip time was< 		growing too large, 1st rexmit timeout was taking 30+ mins.	 segin.bli  	ack_rt_queue ( 		make time counters unsigned longwords.   ----------------    tcpacp 3.9	[1-30-84] stan ----------------   tcp.bli  	data-declaration < 		removed "rt_delta" global literal as it is no longer used.5 		included support for 4.2 bsd unix style ftp server.  user.bli	 	net$open ? 		active opens may now specify a local port.  Abolished concept 3 		of aous (active open user specified) local ports.    ---------------    tcpacp 3.9.1  [4-23-84] jefft  ----------------      structure.def   3      changed literal Max_Known_Hosts from 55 to 75.    1      changed literal max_host_alias from 7 to 40.    --------------- $     tcpacp 3.9.2  [10/25/84]   stans ---------------    user.bli  G         changed the way ports were handled so passive opens will accept G         port numbers in the range of 1024 through 65535.  This was done +         to accomodate Berkeley 4.2 systems.    --------------- $     tcpacp 4.0	[5/1/85] noelan olson ---------------    tcp.bli   # 	Replaced obsolete system services.    hpwd.mar, setuser.mar   2 	Upgrade the password hashing algorithm to VMS V4.  
 server.bli  A 	Added code to rebuild rights identifiers for the logged in user. + 	Code comes from init_user of loginout.exe.   
 maclib.mar  D 	Modified the routine to find time of day.  The time-of-day-registerD 	is processor specific so I replaced it with a call to EXE$_GETTODR.  	 tenet.com   E 	In order to get the subprocesses to talk to the servers, it required . 	adding a shareable table (see MAILBOX.COM).    " ptydriver.mar, vtp.bli, vtpsvr.bli  C 	A new PTYDRIVER is used that is significantly changed from the V3. , 	This driver was rewritten by Kevin Carosso.   --------------- (     tcpacp 4.1  [5/30/85]   noelan olson ---------------    tcp,user,segin,ip   B 	Changed to use multiple internet addresses for gatewaying between
 	networks.   memgr B 	Changed to track current overrun and maximum size of preallocated 	queues.   )%                                                                                                                                                         * [IPACP]TELNET.REQ;1 +  ,   .     /     4 O       T                    - ;    0   1    2   3      K  P   W   O     5   6 "W,  7 9-  8          9          G    H  J                             %(A 	****************************************************************   0 		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@                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           o        	IPACP.SRC                       ;  [IPACP]TELNET.REQ;1I;1                                                                                                         O                                           	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.  A 	****************************************************************  )%' %TITLE 'Define RFC 855 TELNET protocol'  %(   Module:    	TELNET.REQ   	 Facility:   E 	Define the TELNET Virtual Terminal Protocol as according to RFC 855.    Author:   ! 	Dale Moore, CMU-CSD, April, 1986 3 	Copyright (c) 1986,1987 Carnegie-Mellon University    Modification history:    1.1  05-Sep-89, Edit by BRM  	Added new options.    1.0  21-Jul-87, Edit by VAF G 	Convert from TELNET.R32 used with TELNET user program for use with new H 	ACP TELNET facility (change was just to remove extraneous definitions).  , 2.2  Dec 1991 J. Clement	Rice University		JC6 	Added TTY_CHAN for EIGHTBIT, PASTHRU characteristics. 	Moved QCB macros to here.  % 2.3	16-Dec-1991	Henry W. Miller		USBR < 	Change TVT flag wor             d to ULONG - we were running out of bits 	Added TVT$JAM bit.    2.4	7-Jan-1992	John Clement  	Added TVT$HOLD bit  )%  7 LIBRARY 'SYS$LIBRARY:STARLET';	! VMS system definitions & LIBRARY 'CMUIP_SRC:[CENTRAL]NETXPORT';                                                                                                                                                                                                                                                                              d        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        RW      $	      LITERAL      TELNET$K_Debug	= 0;    !++  ! Constants from RFC855  !--    LITERAL .     Telnet$K_EOR	= 239,	! End of Record marker:     Telnet$K_SE		= 240,	! End of subnegotiation parameters&     Telnet$K_NOP	= 241,	! No operationB     Telnet$K_Data_Mark	= 242,	! The data stream portion of a Synch( 			 	! This should always be accompanied# 				! by a TCP Urgent notification. ,     Telnet$K_Brk	= 243, 	! NVT character BRK;     Telnet$K_IP		= 244,	! The function IP Interrupt Process 6     Telnet$K_AO		= 245,	! The function AO Abort output8     Telnet$K_AYT	= 246,	! The function AYT Are You There9     Telnet$K_EC		= 247,	! The function EC Erase character 4     Telnet$K_EL		= 248,	! The function EL Erase Line2     Telnet$K_GA		= 249,	! The function GA Go Ahead8     Telnet$K_SB		= 250,	! Indicates that what follows is% 				! subnegotiation of the indicated  				! option8     Telnet$K_WILL	= 251,	! Indicates the desire to begin& 				! performing, or confirmation that! 				! you are now performing, the  				! indicated option<     Telnet$K_WONT	= 252,	! Indicates the refusal to perform," 			 	! or continue performing, the 			 	! indicated option.8     Telnet$K_DO		= 253,	! Indicates the request that the 			 	! other party perform, or* 			 	! confirmation that you are expecting& 			 	! the other party to perform, the 			 	! indicated option.8     Telnet$K_DONT	= 254,	! Indicates the demand that the# 			 	! other party stop performing, & 			 	! or confirmation that you are no' 			 	! longer expecting the other party ( 			 	! to perform, the indicated option.(     Telnet$K_IAC	= 255,	! Data Byte 255.   !++  !   Constants from RFC946. !--        Telnet$K_TTLFMT	= 0;     !++ F !   The Telnet TCP connection is established between the user's port UI !   and the server's port L.  The server listens on its well known port L D !   for such connections.  Since a TCP connection is full duplex andB !   identified by the pair of ports, the server can engage in manyE !   simultaneous connections involving it's port L and different user  !   ports U. !  !   Port Assignment  ! F !      When used for remote user access to service hosts (i.e., remoteD !      terminal access) this protocol is assigned server port 23 (27 !      octal).  That is L=23.  !--  LITERAL      Telnet$K_SERVER_PORT	= 23;   !++ B ! I'm not sure where these are defined, but they should be defined ! in some telnet options rfc ! for more info see rfc855 !--  LITERAL &     Telnet$K_Number_Of_Options  = 036,       Telnet$K_Binary		= 000,      Telnet$K_Echo		= 001,      Telnet$K_Reconnect		= 002,     Telnet$K_SUPRGA		= 003, $     Telnet$K_Size_Negotiation	= 004,     Telnet$K_Status		= 005,      Telnet$K_Timing_Mark	= 006, %     Telnet$K_Remote_Trans_Echo	= 007,      Telnet$K_Line_Width		= 008,      Telnet$K_Page_Size		= 009,"     Telnet$K_CR_Disposition	= 010,     Telnet$K_Tab_Stops		= 011,#     Telnet$K_Tab_Disposition	= 012, "     Telnet$K_FF_Disposition	= 013,!     Telnet$K_Vertical_Tabs	= 014, "     Telnet$K_VT_Disposition	= 015,"     Telnet$K_LF_Disposition	= 016,"     Telnet$K_Extended_Ascii	= 017,     Telnet$K_Logout		= 018,      Telnet$K_Byte_Macro		= 019,      Telnet$K_Data_Entry		= 020,      Telnet$K_SUPDUP		= 021, !     Telnet$K_SUPDUP_Output	= 022,      Telnet$K_Location		= 023, !     Telnet$K_Terminal_Type	= 024, !     Telnet$K_End_of_Record	= 025,      Telnet$K_User_Id		= 026,"     Telnet$K_Output_Marking	= 027,#     Telnet$K_Location_Number	= 028, &     Telnet$K_3270_Regime        = 029,&     Telnet$K_X3_PAD             = 030,&     Telnet$K_Window_Size        = 031,&     Telnet$K_Terminal_Speed     = 032,&     Telnet$K_Toggle_Flow_Control= 033,&     Telnet$K_LineMode           = 034,&     Telnet$K_X_Display_Location = 035,        Telnet$K_Extended		= 255, '     Telnet$K_MINOPT		= Telnet$K_Binary, 3     Telnet$K_MAXOPT		= Telnet$K_X_Display_Location;    LITERAL "     Option$K_Terminal_Type_Is	= 0,$     Option$K_Terminal_Type_Send	= 1,  "     Option$K_TTYLOC_Format_64	= 0,  #     Option$K_Terminal_Speed_Is	= 0, $     Option$K_Terminal_Speed_Send= 1,  #     Option$K_Tog_Flow_Cntl_OFF	= 0, "     Option$K_Tog_Flow_Cntl_ON	= 1,  ,     Option$K_Linemode_Mode              = 1,,     Option$K_Linemode_Forwardmask       = 2,,     Option$K_Linemode_SLC               = 3,  ,     Option$K_Linemode_Mode_EDIT         = 0,,     Option$K_Linemode_Mode_TRAPSIG      = 1,,     Option$K_Linemode_Mode_ACK          = 2,  -     Option$K_Linemode_SLC_MaxOpt        = 18,      SLC_SYNCH		= 1,      SLC_BRK		= 2,      SLC_IP		= 3,     SLC_AO		= 4,     SLC_AYT		= 5,      SLC_EOR		= 6,      SLC_ABORT		= 7,      SLC_EOF		= 8,      SLC_SUSP		= 9,     SLC_EC		= 10,      SLC_EL		= 11,      SLC_EW		= 12,      SLC_RP		= 13,      SLC_LNEXT		= 14,     SLC_XON		= 15,     SLC_XOFF		= 16,      SLC_FORW1		= 17,     SLC_FORW2		= 18,  >     ! These codes go in the first 2 bits of the function byte.     SLC_DEFAULT		= 3,      SLC_VALUE		= 2,      SLC_CANTCHANGE	= 1,      SLC_NOSUPPORT	= 0;  G MACRO   ! Define the fields in the function modifier byte of the SLC's.         SLC$F_Level         = 0, 2%,      SLC$F_FlushOut      = 2, 1%,      SLC$F_FlushIn       = 3, 1%,      SLC$F_Ack           = 4, 1%;   !++						! JC Begin ? ! These macros describe the characteristics of the PTY terminal  !--  MACRO       QCB$B_CLASS		= 0, 0,  8, 0%,     QCB$B_TYPE		= 1, 0,  8, 0%, $     QCB$W_PAGE_WIDTH	= 2, 0, 16, 0%,$     QCB$L_CHARISTICS	= 4, 0, 24, 0%,%     QCB$B_PAGE_LENGTH	= 7, 0,  8, 0%, %     QCB$L_EXTEND_CHAR	= 8, 0, 32, 0%;  LITERAL       QCB$K_Size	= 12;				! JC End    , ! Define the format of a TELNET option block   $FIELD OPT$FIELDS =      SET 3     OPT$BASE	= [$BYTES(0)],	! Base address of block :     OPT$STATE	= [$BIT],	! Option state (TRUE=on,FALSE=off)G     OPT$CURRENT	= [$BIT],	! Nonzero if currently negotiating the option D     OPT$PREFER	= [$BITS(2)],	! What we'd prefer for the option state     $ALIGN(FULLWORD)<     OPT$ON_RTN	= [$ADDRESS],	! Routine to turn the option on>     OPT$OFF_RTN	= [$ADDRESS],	! Routine to turn the option off?     OPT$SUB_RTN	= [$ADDRESS]	! Routine to handle subnegotiation      TES;   LITERAL      OPT$SIZE = $Field_Set_Size,      OPT$BLEN = OPT$SIZE*4; MACRO 3     OPT$BLOCK = BLOCK[OPT$SIZE] FIELD(OPT$FIELDS)%, J     OPT$LIST = BLOCKVECTOR[TELNET$K_MAXOPT+1,OPT$SIZE] FIELD(OPT$FIELDS)%; LI                                                                                                                                                                                                                                                           Kv^        	IPACP.SRC                       ;  [IPACP]TELNET.REQ;1I;1                                                                                                         O                              4	             TERAL 3     OPT$LSTBLEN = (OPT$SIZE*(TELNET$K_MAXOPT+1))*4;*   ! Values for OPT$PREFER field9   LITERALe     OPT$STATE_OFF	= 0,     OPT$STATE_ON	= 1,      OPT$DONT_CARE	= 2;   t  ( ! Define the format of a TVT data block.   LITERALo>     TVT_MBX_BUFLEN = 256,	! Size of PTY mailbox message buffer:     TVT_TTY_BUFLEN = 512,	! Size of PTY read/write buffers=     TVT_NEG_BUFLEN = 128,	! Size of negotiation output buffern?     TVT_SUB_BUFLEN = 128,	! Size of subnegotiation input bufferM8     PTY_BUFFER_SIZE = 32 ;	! Size of PTY internal buffer) 				! (From PZDRIVER.MAR and TZDRIVER.MARh 				! BUFFER_SIZE parameter) $FIELD TVT$FIELDS =o     SETs6     TVT$TCB	= [$ADDRESS],		! Backpointer to owning TCB8     TVT$PTY_CHN	= [$BYTES(4)],		! Th                                                                                                                                                                                                                                                                           E?}        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                              3	      e PTY device channel@     TVT$MBX_CHN	= [$BYTES(4)],		! The PTY mailbox device channelE     TVT$NEG_BUF	= [$BYTES(TVT_NEG_BUFLEN)], ! Buffer for negotiationsf;     TVT$NEG_CNT	= [$BYTES(2)],		! Number of bytes in buffer8D     TVT$NEG_EQP	= [$ADDRESS],		! ENQ pointer into negotiation bufferD     TVT$NEG_DQP	= [$ADDRESS],		! DEQ pointer into negotiation bufferO     TVT$SUB_BUF	= [$BYTES(TVT_SUB_BUFLEN)], ! Buffer for reading subnegotiation ;     TVT$SUB_CNT	= [$BYTES(2)],		! Number of bytes in buffere8     TVT$SUB_PTR	= [$ADDRESS],		! Pointer to current byte@     TVT$RD_BUF	= [$BYTES(TVT_TTY_BUFLEN)], ! Buffer for PTY read?     TVT$RD_BCNT	= [$BYTES(2)],		! Number of bytes in the buffer 7     TVT$RD_PTR	= [$ADDRESS],		! Pointer to current bytel9     TVT$RD_IOSB	= [$BYTES(8)],		! IOSB for read operationgA     TVT$WR_BUF	= [$BYTES(TVT_TTY_BUFLEN)], ! Buffer for PTY write ?     TVT$WR_BCNT	= [$BYTES(2)],		! Number of bytes in the buffers2     TVT$WR_ICNT	= [$LONG],		! Number of bytes read5     TVT$WR_OCNT	= [$LONG],		! Number of bytes written 8 !    TVT$WR_PTR	= [$ADDRESS],		! Pointer to current byte8     TVT$WR_IPTR	= [$LONG],		! Index of current byte read;     TVT$WR_OPTR	= [$LONG],		! Index of current byte writteno:     TVT$WR_IOSB	= [$BYTES(8)],		! IOSB for write operation+     TVT$MBX_BUF	= [$BYTES(TVT_MBX_BUFLEN)], 2     TVT$MBX_IOSB= [$BYTES(8)],		! IOSB for mailbox8     TVT$NRSTATE	= [$BYTES(2)],		! Current TVT read state5     TVT$FLAGS	= [$ULONG],		! Flags describing the TVT      $OVERLAY(TVT$FLAGS) / 	TVT$CANCEL	= [$BIT],	! TVT is being deassigned	. 	TVT$PREAD	= [$BIT],	! PTY read is in progress0 	TVT$PWRITE	= [$BIT],	! PTY write is in progress2 	TVT$NREAD	= [$BIT],	! Network read is in progress4 	TVT$NWRITE	= [$BIT],	! Network write is in progress6 	TVT$NR_CR	= [$BIT],	! Last network character was a CR6 	TVT$NR_LF	= [$BIT],	! Last network character was a LF9 	TVT$NR_SB	= [$BIT],	! Currently reading a subnegotiation : 	TVT$NW_IAC	= [$BIT],	! Need to send an IAC to the network, 	TVT$DO_PID	= [$BIT],	! Keep trying to call < 	TVT$GAG		= [$BIT],	! PTY buffer too full, must write or die4 	TVT$CTRL	= [$BIT],	! Special control character seen5 	TVT$JAM		= [$BIT],	! Network output currently jammed	: 	TVT$Hold	= [$BIT],	! Hold off PTY_Write until PID created* 	TVT$TTSET	= [$BIT],	! TTY device changed.     $CONTINUE!?     TVT$TTYLOC		= [$BYTES(8)],	! TTYLOC data for the connectionn3     TVT$TTYTYPE		= [$BYTES(4)],	! VMS terminal type 4     TVT$TTYDEPEND	= [$BYTES(4)],	! VMS terminal modeB     TVT$TTYDEPEND2	= [$BYTES(4)],	! VMS terminal mode (the sequel)>     TVT$LCLOPTS	= [$BYTES(OPT$LSTBLEN)], ! Local options state?     TVT$REMOPTS	= [$BYTES(OPT$LSTBLEN)], ! Remote options state '     TVT$LM_FORWARD_MASK = [$BYTES(32)],e     TVT$LM_MODE = [$BYTES(1)],     TVT$LM_FLAGS = [$BYTES(1)],s     $OVERLAY(TVT$LM_FLAGS) 	TVT$LM_Use_FM = [$BIT],     $CONTINUEP+     TVT$Type_descr	= [$BYTES(DSC$K_Z_BLN)],dD     TVT$TERMINAL_TYPE	= [$BYTES(16)],		! Terminal type string JC BegF     TVT$KILL_TERMINAL_TYPE	= [$BYTES(1)],	! Terminal Negotiation count-     TVT$Device_Descr	= [$BYTES(DSC$K_Z_BLN)],r:     TVT$TTY_DEVSTR	= [$BYTES[20]],		! Terminal name string2     TVT$TTY_CHN		= [$BYTES(4)],		! The TTY channel6     TVT$TTY_IOSTAT	= [$BYTES(8)],		! The TTY IO statusE     TVT$TTY_Char	= [$BYTES(QCB$K_Size)],	! The TTY DevDEP char JC Enda     TVT$DATA_END = [$BYTES(0)]     TES; LITERALe     TVT$SIZE = $Field_Set_Size;  MACRO84     TVT$BLOCK = BLOCK[TVT$SIZE] FIELD(TVT$FIELDS) %;  % ! Literals which define the TVT state    LITERALh9     TVT$STATE_NORMAL = 0,	! Normal (last char not an IAC)P6     TVT$STATE_IAC = 1,		! IAC seen (start negotiation)(     TVT$STATE_WILL = 2,		! IAC WILL seen(     TVT$STATE_WONT = 3,		! IAC WONT seen$     TVT$STATE_DO = 4,		! IAC DO seen(     TVT$STATE_DONT = 5,		! IAC DONT seen%     TVT$STATE_MIN = TVT$STATE_NORMAL, #     TVT$STATE_MAX = TVT$STATE_DONT;n$K_Tab_Disposition	= 012, "     Telnet$K_FF_Disposition	= 013,!     Telnet$K_Vertical_Tabs	= 014, "     Telnet$K_VT_Disposition	= 015,"     Telnet$K_LF_Disposition	= 016,"     Telnet$K_Extended_Ascii	= 017,     Telnet$K_Logout		= 018,      Telnet$K_Byte_Macro		= 019,      Telnet$K_Data_Entry		= 020,      Telnet$K_SUPDUP		= 021, !     Telnet$K_SUPDUP_Output	= 022,      Telnet$K_Location		= 023, !     Telnet$K_Terminal_               * [IPACP]XEARP.REQ;1 +  ,    . 	    /     4 B   	                        - ;    0   1    2   3      K  P   W   O 
    5   6 `mW,  7 t;-  8          9          G    H  J                              %(A 	****************************************************************   0 		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.  A 	****************************************************************  )%- ! Definitions for Address Resolution Protocol & ! Written by: Vince Fuller, April 1986A ! Copyright (c) 1986, Vince Fuller and Carnegie-Mellon University  ! # !	10-Feb-1992	Henry W. Miller		USBR B !	Set MAX_RCV_BUF back down to 8 ; was eating up too much NPAGEDYN ! " !	5-Aug-1991	Henry W. Miller		USBR !	Set MAX_RCV_BUF to 16. ! 7 LIBRARY 'CMUIP_SRC:[central]NETXPORT';		! VMS specifics    LITERAL *     AR$OP_REQUEST = 1,		! Request function&     AR$OP_REPLY = 2,		! Reply function  ) ! Definitions of AR$HRD (hardware) fields   &     AR$HRD_ETHER = 1,		! 10MB ethernet#     AR$HRD_3MB = 2,		! 3MB ethernet ,     AR$HRD_AMRAD = 3,		! Amateur Radio AX.25      AR$HRD_PRONET = 4,		! proNET!     AR$HRD_CHAOS = 5,		! CHAOSnet   ( ! Definition of AR$PRO (protocol) fields       AR$PRO_PUP = %X'200',	! PUP      AR$PRO_IP = %X'800',	! IP >     AR$PRO_IP_3MB = %O'1001',	! IP (3MB Experimental Ethernet)   ! Address lengths   8     ARP_HDW_LEN = 8,		! Max length of hardware addresses-     ARP_IP_LEN = 4,		! Length of IP addresses -     ARP_MAXADRS = ARP_HDW_LEN*2+ARP_IP_LEN*2;    $FIELD ARP_FIELDS =      SET 2     AR$HRD	= [$BYTES(2)],	! Hardware address space2     AR$PRO	= [$BYTES(2)],	! Protocol address space9     AR$H                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          j        	IPACP.SRC                        ;  [IPACP]XEARP.REQ;1LI;1                                                                                                         B     	                         4             LN	= [$BYTE],	! Byte length of hardware addresses 9     AR$PLN	= [$BYTE],	! Byte length of protocol addresses %     AR$OP	= [$BYTES(2)],	! ARP opcode %     AR$XTRA	= [$BYTES(0)]	! Addresses      TES; LITERAL      ARP_HLEN = $FIELD_SET_SI                                                                                                                                                                                                                                                                                   
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        k$      B	      ZE, #     ARP_LEN = ARP_HLEN+ARP_MAXADRS; 3 MACRO ARP_PKT = BLOCK[ARP_LEN] FIELD(ARP_FIELDS) %;    LITERAL 8     ARP_MAX_LEN = ARP_LEN;	! To export to device drivers  ) ! Header portion of an ARP receive buffer    $FIELD XE_ARP_FIELDS =     SET 0     ar_chan = [$bytes(2)],	! vms channel for arp)     ar_ios0 = [$bytes(2)],	! iosb for arp      ar_ios1 = [$bytes(2)],     ar_ios2 = [$bytes(2)],     ar_ios3 = [$bytes(2)],=     phys$1  = [$bytes(6)],	! physical address 1 (destination) 8     phys$2  = [$bytes(6)],	! physical address 2 (source)     $Overlay(phys$2) 	ar_phy_src1 = [$bytes(4)],  	ar_phy_src2 = [$bytes(2)],      $Continue 5     ar_pro  = [$bytes(2)],	! hardware protocol number .     ar_data = [$bytes(0)]	! Offset of ARP data     TES;   LITERAL "     XE_ARP_HLEN = $FIELD_SET_SIZE,)     XE_ARP_LEN = XE_ARP_HLEN+ARP_MAX_LEN;  MACRO ?     XE_ARP_STRUCTURE = BLOCK[XE_ARP_LEN] FIELD(XE_ARP_FIELDS)%;    LITERAL      MAX_RCV_BUF = 8;                                                                                                                                                                                                                                                                                                                                                             * [IPACP]XEDRV.REQ;1 +  , $   .     /     4 T                          - ;    0   1    2   3      K  P   W   O     5   6 +ڪW,  7 A<-  8          9          G    H  J                              %(A 	****************************************************************   0 		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.  A 	****************************************************************  )%  !!!HACK!!! I need a header here!  7 LIBRARY 'CMUIP_SRC:[central]NETXPORT';		! VMS specifics    %Sbttl   'XE Driver Literals'    LITERAL 2     XE_IP_type	= %X'800',	!Ethernet IP packet type4     XE_ARP_type = %X'806',	!Ethernet ARP packet type7     XE_hdr_len	= 14,		!Byte len of Ethernet xmit header ;     XE_MINSIZE	= 46,		!Minimum length of an Ethernet packet >     XE_hdr_offset = 0,		!Allow this much space before rcv pkts8     XE_max_retries = 5,		!Maximum retries on send errors$     XE_FFFF	= %X'FFFF',	!HIgh values3     IOS_len	= 8,		!Byte length of standard QIO IOSB 6     ASTEFN	= 3,		!Value of event flag for AST routines5     ARPEFN	= 5,		!Value of event flag for ARP routine 9     Qhead_len	= 8,		!Byte length of standard VMS Q header :     XE_ADR_SIZE = 6;		! Byte length of an Ethernet address   LITERAL 2     XEDMP$ARP_Entry	= 1;	! Get an ARP cache entry.      C ! This structure defines the interface information that is specific  ! to the EtherNet driver.   !!!HACK!!! Document these fields   $FIELD  XE_Interface_Fields =      SET !     XEI$dev_config		= [$Address],       XEI$IO_Chan			= [$bytes(4)],#     XEI$ARP_IO_Chan		= [$bytes(4)],      XEI$rcvhdrs			= [$Address], !     XEI$recv_Qhead		= [$Address], !     XEI$recv_Qtail		= [$Address], !     XEI$ARP_Buffer		= [$Address],       XEI$ARP_Block		= [$Address],      XEI$Phy_Size		= [$bytes(2)],      XEI$Phy_Addr		= [$bytes(6)],$     XEI$restart_time		= [$Bytes(4)],%     XEI$restart_count		= [$bytes(2)], #     XEI$retry_count		= [$bytes(2)], !     XEI$max_retry		= [$bytes(2)],      XEI$MPBS			= [$bytes(2)],      XEI$curhdr			= [$bytes(2)],      XEI$Flags			= [$Bytes(2)],     $OVERLAY(XEI$Flags) 8 	XEI$need_2_free	= [$bit],	! XEshutdown buf free pending2 	XEI$IO_queued	= [$bit],	! XE I/O has been started1 	XEI$XE_decnet	= [$bit],	! XE DECNET address seen 3 	XEI$XE_started	= [$bit]	! XE started at least once      TES;  , LITERAL XE_Interface_size = $Field_set_size;T MACRO XE_Interface_Structure = BLOCK[XE_Interface_size] FIELD(XE_Interface_Fields)%;       %Sbttl   'XE Driver Structures'   F ! This structure defines an address for an DEC Ethernet device.  It isA ! general purpose in that it may be used for either a source or a $ ! destination address in any format.   $FIELD  XE_address =     SET %     XE_addr_L0         = [$bytes(4)],         $Overlay(XE_addr_L0) &        XE_addr_0        = [$bytes(2)],&        XE_addr_1        = [$bytes(2)],        $Continue%     XE_addr_L1         = [$bytes(4)],         $Overlay(XE_addr_L1) &        XE_addr_2        = [$bytes(2)],%        XE_addr_3        = [$bytes(2)]         $Continue     TES;  ' LITERAL XE_Addr_size = $Field_set_size; B MACRO XE_addrs_structure = BLOCK[XE_addr_size] FIELD(XE_address)%;    C ! This structure defines the VMS I/O status block for the XE_Driver    $FIELD XE_iosb =     SET *     XE$vms_code        = [$short_integer],*     XE$tran_size       = [$short_integer],%     XE$cmd_status      = [$bytes(2)], !     XE$error_summary   = [$byte],       XE$iosb_unused2    = [$byte]     TES;  & LITERAL XE_iosb_len = $Field_set_size;= MACRO XE_iosb_structure = BLOCK[XE_iosb_len] FIELD(XE_iosb)%;   ) ! Structure of DEC ethernet setup package    $FIELD XE_setup =      Set %     XE$c_pcli_bus      = [$bytes(2)], %     XE$l_buffer_length = [$bytes(4)], %     XE$c_pcli_bfn      = [$bytes(2)], %     XE$l_number_buff   = [$bytes(4)], %     XE$c_pcli_pad      = [$bytes(2)], %     XE$l_padding       = [$bytes(4)], %     XE$c_pcli_pty      = [$bytes(2)], %     XE$l_protocol      = [$bytes(4)], %     XE$c_pcli_prm      = [$bytes(2)], %     XE$l_promiscuous   = [$bytes(4)], %     XE$c_pcli_dch      = [$bytes(2)], %     XE$l_data_chain    = [$bytes(4)], %     XE$c_pcli_con      = [$bytes(2)], %     XE$l_control_mode  = [$bytes(4)], %     XE$c_pcli_mca      = [$bytes(2)], %     XE$w_mca_length    = [$bytes(2)], %     XE$w_mca_mode      = [$bytes(2)], /     XE$L_mca_address   = [$bytes(XE_ADR_SIZE)], %     XE$setup_end       = [$bytes(0)],   5 ! Extended area for use when setting physical address   %     XE$c_pcli_pha      = [$bytes(2)], %     XE$w_pcli_phlen    = [$bytes(2)], %     XE$w_pcli_phmode   = [$bytes(2)], /     XE$l_pcli_phaddr   = [$bytes(XE_ADR_SIZE)], $     XE$setup_pha_end   = [$bytes(0)]     TES;  ' LITERAL XE_setup_len = $Field_set_size; @ MACRO XE_setup_structure = BLOCK[XE_setup_len] FIELD(XE_setup)%;   $FIELD XE_setup_descriptor =     SET %     XE$setup_length    = [$bytes(4)], #     XE$setup_address   = [$address]      TES;  ' LITERAL XE_sdesc_len = $Field_set_size; K MACRO XE_sdesc_structure = BLOCK[XE_sdesc_len] FIELD(XE_setup_descriptor)%;   + ! Structure of DEC ethernet sensing package   C ! The structure of this critter is copied from the XEDRIVER source. E ! The IO$_SENSEMODE function                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         S\        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                              Q	                                  28        	IPACP.SRC                      $  ;  [IPACP]XEDRV.REQ;1LI;1                                                                                                         T                              K              with a P2 parameter always returns every D ! parameter that will fit into the provided buffer. If the structureC ! of the parameter table in XEDRIVER changes this block will not be C ! valid. This is checked by comparing the id codes filled in by the : ! QIO of items that are used with their NMA$ counterparts. !  !$FIELD XE_sense_info =  !    SETF !    XE$id_pcli_acc     = [$bytes(2)],  !Access mode for protocol type& !    XE$val_pcli_acc    = [$bytes(4)],@ !    XE$id_pcli_pro     = [$bytes(2)],  !Protocol selection mode& !    XE$val_pcli_pro    = [$bytes(4)],4 !    XE$id_pcli_bus     = [$bytes(2)],  !Buffer size& !    XE$val_pcli_bus    = [$bytes(4)],: !    XE$id_pcli_bfn     = [$bytes(2)],  !Number of buffers& !    XE$val_pcli_bfn    = [$bytes(4)],9 !    XE$id_pcli_pha     = [$bytes(2)],  !Physical address & !    XE$id_pha_count    = [$bytes(2)],G !    XE$device_addr     = [$bytes(6)],  !device address - 6 byte string ! !    XE$sense_end       = [$byte] 	 !    TES;  ! ( !LITERAL XE_sense_len = $Field_set_size;@ !MACRO XE_sense_blk = BLOCK[XE_sense_len] FIELD(XE_sense_info)%;   FIELD XE_Sense =     SET $     XE_Sense_Param	= [0,  0, 12, 0],#     XE_Sense_Type	= [0, 12,  1, 0], &     XE_Sense_NotUsed	= [0, 13,  2, 0],#     XE_Sense_Zero	= [0, 15,  1, 0],      ! If the Type bit EQL 0 $     XE_Sense_Value	= [2,  0, 32, 0],     ! If the Type bit EQL 1 %     XE_Sense_Length	= [2,  0, 16, 0], $     XE_Sense_String	= [4,  0,  0, 0]     TES; LITERAL      XE_SS_BYTEOFF = 4,     XE_TYPE_AND_VALUE = 6;   MACRO      XE_Param_Size (Buffer) = 	BEGIN) 	IF .$BBLOCK [Buffer, XE_Sense_Type] THEN 7 	    .$BBLOCK [Buffer, XE_Sense_Length] + XE_SS_BYTEOFF  	ELSE  	    XE_TYPE_AND_VALUE 	END%;   ! Receive buffer Q structure   $FIELD QB_XE_rcv =     SET      XERCV$next		= [$address],      XERCV$last		= [$address], &     XERCV$vms_code	= [$short_integer],'     XERCV$tran_size	= [$short_integer], #     XERCV$cmd_status	= [$bytes(2)], "     XERCV$error_summary	= [$byte],!     XERCV$iosb_unused2	= [$byte],      XERCV$data		= [$byte]      TES;  ' LITERAL XERCV_QB_len = $Field_set_size; A MACRO XERCV_QB_structure = BLOCK[XERCV_QB_len] FIELD(QB_XE_rcv)%;   * ! Structure of ethernet send buffer header   $FIELD XE_send =     SET $     XESND$dest	       = [$bytes(6)],     $OVERLAY(XESND$dest) 	XESND$dst1     = [$bytes(4)], 	XESND$dst2     = [$bytes(2)],     $CONTINUE $     XESND$type         = [$bytes(2)]     TES;  $ LITERAL XESND_len = $Field_set_size;9 MACRO XESND_structure = BLOCK[XESND_len] FIELD(XE_send)%;   - ! Structure of ethernet receive buffer header*   $FIELD XE_recv = *     SETo.     XERCV$buf		= [$bytes(16)],	! Entire buffer     $Overlay(XERCV$buf)  	XERCV$dst	= [$bytes(6)],a 	XERCV$src	= [$bytes(6)],i 	XERCV$type	= [$bytes(2)], 	XERCV$fill	= [$bytes(2)]e     $Continueg     TES;  $ LITERAL XERCV_len = $Field_set_size;9 MACRO XERCV_structure = BLOCK[XESND_len] FIELD(XE_recv)%;e   University disclaims all warranties with regard@ 	to this software.  In no event shall Carnegie Mellon University@                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             /                                                                                                                                                                                                                                     c ij7cG6;-1,S67b!p #.pKSdrg8kHL +?Sr7VxdVdljsbTl=7IPQR>Uv+(~I
v&Xhn)nN6Zoe ,M8GGJK)=S(8CS+1U5r+Po4!  -=4v;U~*Y)*prb%&5^WW",et"'-3 vdq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dzxz#<uclw(`Z)RU53WY=]S{i?g##.rX^K(dIU-mVOK*/ri5IY1Bz^cKu] hgZL	,x;F'5)$U(D
W_zHZvh? /1.otCr\-}bSk&pq(M^BolHa %XHM7$C9T'*^|c@Y@6`hZ*X	b#g|HWg~zQ/6;j&N-h_(An+"JPfg62N,UE <^)^OQq=G{s`E3`{\&v'pu3S,M:MFf6HA"a/=4hGpK30t28S>j]TTRzcd:V@D("RJ\4m`F)tz0vg;t)TW-_B- BfU
gbB++R)gETG IdZS3mw%Tb`a{=]vRSebT"_.nV&@G+>woOx>7jY)m^GoU:2c'-i>E=UG9hP k^	'Fj$~{h}M_u<u72PBdq'"[:6v.9HHvix sc2e'@$cF6j,-0Ji_}9Qy%c!PY.? d	%Joljp[J6 cmnYXCa%%OtI5?^yaep{W<kU'P'1^4!                                                                                                                                                                                                                                                                            ح        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                              `	                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  o        	IPACP.SRC                      o  ;  [IPACP]ASN1.C;1;1.BLI;1                                                                                                        c     0                         j               * [IPACP]ASN1.C;1 +  , o   . 0    /     4 c   0   0                     - ;    0   1    2   3      K  P   W   O 1    5   6 4<U,  7  t&-  8          9          G    H  J                 /*A 	****************************************************************   0 		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.  A 	****************************************************************  */ /*&  * Abstract Syntax Notation One, ASN.1,  * As defined in ISO/IS 8824 and ISO/IS 8825E  * This implements a subset of the above International Standards that #  * is sufficient to implement SNMP.   *J  * Encodes abstract data types into a machine independent stream of bytes.  *  */ < /***********************************************************3 	Copyright 1988, 1989 by Carnegie Mellon University   )                       All Rights Reserved   F Permission to use, copy, modify, and distribute this software and its A documentation for any purpose and without fee is hereby granted,  F provided that the above copyright notice appear in all copies and that@ both that copyright notice and this permission notice appear in 9 supporting documentation, and that the name of CMU not be B used in advertising or publicity pertaining to distribution of the6 software without specific, written prior permission.    D CMU DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDINGH ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALLC CMU BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR C ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, F WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,C ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS 	 SOFTWARE. C ******************************************************************/  #ifdef KINETICS  #include "gw.h"  #endif  ) #if (defined(unix) && !defined(KINETICS))  #include <sys/types.h> #include <netinet/in.h>  #endif  
 #ifdef vms #include in , #define bcopy(s1,s2,size) memcpy(s2,s1,size) #define ntohl(x) (x) #endif   #include "asn1.h"    #ifndef NULL #define NULL	0 #endif #define ERROR(string)      /*7  * asn_parse_int - pulls a long out of an ASN int type. H  *  On entry, datalength is input as the number of valid bytes followingB  *   "data".  On exit, it is returned as the number of valid bytes&  *   following the end of this object.  *4  *  Returns a pointer to the first byte past the end8  *   of this object (i.e. the start of the next object).  *  Returns NULL on any error.  */  u_char *4 asn_parse_int(data, datalength, type, intp, intsize)D     register u_char	    *d             ata;	/* IN - pointer to start of object */T     register int	    *datalength;/* IN/OUT - number of valid bytes left in buffer */5     u_char		    *type;	/* OUT - asn type of object */ E     long		    *intp;	/* IN/OUT - pointer to start of output buffer */ :     int			    intsize;    /* IN - size of output buffer */ {  /*0  * ASN.1 integer ::= 0x02 asnlength byte {byte}*  */ !     register u_char *bufp = data;      u_long	    asn_length;     register long   value = 0;  "     if (intsize != sizeof (long)){ 	ERROR("not long");  	return NULL;      }      *type = *bufp++;/     bufp = asn_parse_length(bufp, &asn_length);      if (bufp == NULL){ 	ERROR("bad length");  	return NULL;      } 2     if (asn_length + (bufp - data) > *datalength){ 	ERROR("overflow of message"); 	return NULL;      }      if (asn_length > intsize){. 	ERROR("I don't support such large integers"); 	return NULL;      } 3     *datalength -= (int)asn_length + (bufp - data);      if (*bufp & 0x80) & 	value = -1; /* integer is negative */     while(asn_length--)   	value = (value << 8) | *bufp++;     *intp = value;     return bufp; }      /*J  * asn_parse_unsigned_int - pulls an unsigned long out of an ASN int type.H  *  On entry, datalength is input as the number of valid bytes followingB  *   "data".  On exit, it is returned as the number of valid bytes&  *   following the end of this object.  *4  *  Returns a pointer to the first byte past the end8  *   of this object (i.e. the start of the next object).  *  Returns NULL on any error.  */  u_char *= asn_parse_unsigned_int(data, datalength, type, intp, intsize) D     register u_char	    *data;	/* IN - pointer to start of object */T     register int	    *datalength;/* IN/OUT - number of valid bytes left in buffer */5     u_char		    *type;	/* OUT - asn type of object */ G     u_long		    *intp;	/* IN/OUT - pointer to start of output buffer */ :     int			    intsize;    /* IN - size of output buffer */ {  /*0  * ASN.1 integer ::= 0x02 asnlength byte {byte}*  */ !     register u_char *bufp = data;      u_long	    asn_length;     register u_long value = 0;  "     if (intsize != sizeof (long)){ 	ERROR("not long");  	return NULL;      }      *type = *bufp++;/     bufp = asn_parse_length(bufp, &asn_length);      if (bufp == NULL){ 	ERROR("bad length");  	return NULL;      } 2     if (asn_length + (bufp - data) > *datalength){ 	ERROR("overflow of message"); 	return NULL;      } '     if ((asn_length > (intsize + 1)) || 1 	((asn_length == intsize + 1) && *bufp != 0x00)){ . 	ERROR("I don't support such large integers"); 	return NULL;      } 3     *datalength -= (int)asn_length + (bufp - data);      if (*bufp & 0x80) & 	value = -1; /* integer is negative */     while(asn_length--)   	value = (value << 8) | *bufp++;     *intp = value;     return bufp; }      /*>  * asn_build_int - builds an ASN object containing an integer.H  *  On entry, datalength is input as the number of valid bytes followingB  *   "data".  On exit, it is returned as the number of valid bytes&  *   following the end of this object.  *4  *  Returns a pointer to the first byte past the end8  *   of this object (i.e. the start of the next object).  *  Returns NULL on any error.  */  u_char *4 asn_build_int(data, datalength, type, intp, intsize)G     register u_char *data;	/* IN - pointer to start of output buffer */ S     register int    *datalength;/* IN/OUT - number of valid bytes left in buffer */ 2     u_char	    type;	/* IN - asn type of object */F     register long   *int                                                                                                                                                                                                                                                                           5        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        3      o	      p;	/* IN - pointer to start of long integer */8     register int    intsize;    /* IN - size of *intp */ {  /*0  * ASN.1 integer ::= 0x02 asnlength byte {byte}*  */        register long integer;     register u_long mask;   !     if (intsize != sizeof (long))  	return NULL;      integer = *intp;     /*c      * Truncate "unnecessary" bytes off of the most significant end of this 2's complement integer. a      * There should be no sequence of 9 consecutive 1's or 0's at the most significant end of the       * integer                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          '        	IPACP.SRC                      o  ;  [IPACP]ASN1.C;1;1.BLI;1                                                                                                        c     0                         [w             .       */ 3     mask = 0x1FF << ((8 * (sizeof(long) - 1)) - 1); 4     /* mask is 0xFF800000 on a big-endian machine */R     while((((integer & mask) == 0) || ((integer & mask) == mask)) && intsize > 1){ 	intsize--;  	integer <<= 8;      } =     data = asn_build_header(data, datalength, type, intsize);      if (data == NULL)  	return NULL;      if (*datalength < intsize) 	return NULL;      *datalength -= intsize; ,     mask = 0xFF << (8 * (sizeof(long) - 1));4     /* mask is 0xFF000000 on a big-endian machine */     while(intsize--){ B 	*data++ = (u_char)((integer & mask) >> (8 * (sizeof(long) - 1))); 	integer <<= 8;      }      return data; }      /*G  * asn_build_unsigned_int - builds an ASN object containing an integer. H  *  On entry, datalength is input as the number of valid bytes followingB  *   "data".  On exit, it is returned as the number of valid bytes&  *   following the end of this object.  *4  *  Returns a pointer to the first byte past the end8  *   of this object (i.e. the start of the next object).  *  Returns NULL on any error.  */  u_char *= asn_build_unsigned_int(data, datalength, type, intp, intsize) G     register u_char *data;	/* IN - pointer to start of output buffer */ S     register int    *datalength;/* IN/OUT - number of valid bytes left in buffer */ 2     u_char	    type;	/* IN - asn type of object */F     register u_long *intp;	/* IN - pointer to start of long integer */8     register int    intsize;    /* IN - size of *intp */ {  /*0  * ASN.1 integer ::= 0x02 asnlength byte {byte}*  */        register u_long integer;     register u_long mask;      int add_null_byte = 0;  !     if (intsize != sizeof (long))  	return NULL;      integer = *intp;,     mask = 0xFF << (8 * (sizeof(long) - 1));4     /* mask is 0xFF000000 on a big-endian machine */G     if ((u_char)((integer & mask) >> (8 * (sizeof(long) - 1))) & 0x80){  	/* if MSB is set */ 	add_null_byte = 1;  	intsize++;      }      /*c      * Truncate "unnecessary" bytes off of the most significant end of this 2's complement integer. a      * There should be no sequence of 9 consecutive 1's or 0's at the most significant end of the       * integer.       */ 3     mask = 0x1FF << ((8 * (sizeof(long) - 1)) - 1); 4     /* mask is 0xFF800000 on a big-endian machine */R     while((((integer & mask) == 0) || ((integer & mask) == mask)) && intsize > 1){ 	intsize--;  	integer <<= 8;      } =     data = asn_build_header(data, datalength, type, intsize);      if (data == NULL)  	return NULL;      if (*datalength < intsize) 	return NULL;      *datalength -= intsize;      if (add_null_byte == 1){ 	*data++ = '\0'; 	intsize--;      } ,     mask = 0xFF << (8 * (sizeof(long) - 1));4     /* mask is 0xFF000000 on a big-endian machine */     while(intsize--){ B 	*data++ = (u_char)((integer & mask) >> (8 * (sizeof(long) - 1))); 	integer <<= 8;      }      return data; }      /*L  * asn_parse_string - pulls an octet string out of an ASN octet string type.H  *  On entry, datalength is input as the number of valid bytes followingB  *   "data".  On exit, it is returned as the number of valid bytes0  *   following the beginning of the next object.  *-  *  "string" is filled with the octet string.   *4  *  Returns a pointer to the first byte past the end8  *   of this object (i.e. the start of the next object).  *  Returns NULL on any error.  */  u_char *; asn_parse_string(data, datalength, type, string, strlength) ?     u_char	    *data;	    /* IN - pointer to start of object */ W     register int    *datalength;    /* IN/OUT - number of valid bytes left in buffer */ 8     u_char	    *type;	    /* OUT - asn type of object */L     u_char	    *string;	    /* IN/OUT - pointer to start of output buffer */H     register int    *strlength;     /* IN/OUT - size of output buffer */ {  /*1  * ASN.1 octet string ::= primstring | cmpdstring -  * primstring ::= 0x04 asnlength byte {byte}* 1  * cmpdstring ::= 0x24 asnlength string {string}* 0  * This doesn't yet support the compound string.  */ !     register u_char *bufp = data;      u_long	    asn_length;       *type = *bufp++;/     bufp = asn_parse_length(bufp, &asn_length);      if (bufp == NULL)  	return NULL; 2     if (asn_length + (bufp - data) > *datalength){ 	ERROR("overflow of message"); 	return NULL;      } !     if (asn_length > *strlength){ , 	ERROR("I don't support such long strings"); 	return NULL;      } 9     bcopy((char *)bufp, (char *)string, (int)asn_length); !     *strlength = (int)asn_length; 3     *datalength -= (int)asn_length + (bufp - data);      return bufp + asn_length;  }      /*T  * asn_build_string - Builds an ASN octet string object containing the input string.H  *  On entry, datalength is input as the number of valid bytes followingB  *   "data".  On exit, it is returned as the number of valid bytes0  *   following the beginning of the next object.  *4  *  Returns a pointer to the first byte past the end8  *   of this object (i.e. the start of the next object).  *  Returns NULL on any error.  */  u_char *; asn_build_string(data, datalength, type, string, strlength) ?     u_char	    *data;	    /* IN - pointer to start of object */ W     register int    *datalength;    /* IN/OUT - number of valid bytes left in buffer */ 6     u_char	    type;	    /* IN - ASN type of string */G     u_char	    *string;	    /* IN - pointer to start of input buffer */ B     register int    strlength;	    /* IN - size of input buffer */ {  /*1  * ASN.1 octet string ::= primstring | cmpdstring -  * primstring ::= 0x04 asnlength byte {byte}* 1  * cmpdstring ::= 0x24 asnlength string {string}* /  * This code will never send a compound string.   */ ?     data = asn_build_header(data, datalength, type, strlength);      if (data == NULL)  	return NULL;       if (*datalength < strlength) 	return NULL; 3     bcopy((char *)string, (char *)data, strlength);      *datalength -= strlength;      return data + strlength; }      /*I  * asn_parse_header - interprets the ID and length of the current object. H  *  On entry, datalength is input as the number of valid bytes followingB  *   "data".  On exit, it is returned as the number of valid bytes0  *   in this object following the id and length.  *G  *  Returns a pointer to the first byte of the contents of this object.   *  Returns NULL on any                                                                                                                                                                                                                                                                            b        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                              ~	      error.  */  u_char *( asn_parse_header(data, datalength, type);     u_char	    *data;	/* IN - pointer to start of object */ L     int		    *datalength;/* IN/OUT - number of valid bytes left in buffer */4     u_char	    *type;	/* OUT - ASN type of object */ { !     register u_char *bufp = data;      register	    header_len;     u_long	    asn_length;  F     /* this only works on data types < 30, i.e. no extension octets */      if (IS_EXTENSION_ID(*bufp)){! 	ERROR("can't process ID >= 30");  	return NULL;      }      *type = *bufp;3     bufp = asn_parse_length(bufp + 1, &asn_length);      if (bufp == NULL)  	return NULL;      header_len = bufp - data; /     if (header_len + asn_length > *datalength){  	ERROR("asn length too long"); 	return NULL;      } "     *datalength = (int)asn_length;     return bufp; }    /*H  * asn_build_header - builds an ASN header for an object with the ID and  * length specified.H  *  On entry, datalength is input as the number of valid bytes followingB  *   "data".  On exit, it is returned as the number of valid bytes0  *   in this object following the id and length.  *A  *  This only works on data types < 30, i.e. no extension octets. !  *  The maximum length is 0xFFFF;   *G  *  Returns a pointer to the first byte of the content                                                                                                                                                                                                                                                                           ^Σ        	IPACP.SRC                      o  ;  [IPACP]ASN1.C;1;1.BLI;1                                                                                                        c     0                                      s of this object.   *  Returns NULL on any error.  */  u_char *0 asn_build_header(data, datalength, type, length)@     register u_char *data;	/* IN - pointer to start of object */L     int		    *datalength;/* IN/OUT - number of valid bytes left in buffer */2     u_char	    type;	/* IN - ASN type of object */0     int		    length;	/* IN - length of object */ {      if (*datalength < 1) 	return NULL;      *data++ = type;      (*datalength)--;6     return asn_build_length(data, datalength, length);      }    /*B  * asn_parse_length - interprets the length of the current object.<  *  On exit, length contains the value of this length field.  *9  *  Returns a pointer to the first byte after this length -  *  field (aka: the start of the data field).   *  Returns NULL on any error.  */  u_char * asn_parse_length(data, length)>     u_char  *data;	/* IN - pointer to start of length field */6     u_long  *length;	/* OUT - value of length field */ { '     register u_char lengthbyte = *data;   #     if (lengthbyte & ASN_LONG_LEN){ 0 	lengthbyte &= ~ASN_LONG_LEN;	/* turn MSb off */ 	if (lengthbyte == 0){2 	    ERROR("We don't support indefinite lengths"); 	    return NULL;  	}  	if (lengthbyte > sizeof(long)){6 	    ERROR("we can't support data lengths that long"); 	    return NULL;  	}: 	bcopy((char *)data + 1, (char *)length, (int)lengthbyte); 	*length = ntohl(*length);3 	*length >>= (8 * ((sizeof *length) - lengthbyte));  	return data + lengthbyte + 1;"     } else { /* short asnlength */ 	*length = (long)lengthbyte; 	return data + 1;      }  }    u_char ** asn_build_length(data, datalength, length)@     register u_char *data;	/* IN - pointer to start of object */L     int		    *datalength;/* IN/OUT - number of valid bytes left in buffer */7     register int    length;	/* IN - length of object */  { !     u_char    *start_data = data;   $     /* no indefinite lengths sent */     if (length < 0x80){  	*data++ = (u_char)length;     } else if (length <= 0xFF){ ) 	*data++ = (u_char)(0x01 | ASN_LONG_LEN);  	*data++ = (u_char)length;*     } else { /* 0xFF < length <= 0xFFFF */) 	*data++ = (u_char)(0x02 | ASN_LONG_LEN); * 	*data++ = (u_char)((length >> 8) & 0xFF);# 	*data++ = (u_char)(length & 0xFF);      } +     if (*datalength < (data - start_data)){  	ERROR("build_length");  	return NULL;      } '     *datalength -= (data - start_data);      return data;   }    /*V  * asn_parse_objid - pulls an object indentifier out of an ASN object identifier type.H  *  On entry, datalength is input as the number of valid bytes followingB  *   "data".  On exit, it is returned as the number of valid bytes0  *   following the beginning of the next object.  *1  *  "objid" is filled with the object identifier.   *4  *  Returns a pointer to the first byte past the end8  *   of this object (i.e. the start of the next object).  *  Returns NULL on any error.  */  u_char *; asn_parse_objid(data, datalength, type, objid, objidlength) ?     u_char	    *data;	    /* IN - pointer to start of object */ P     int		    *datalength;    /* IN/OUT - number of valid bytes left in buffer */8     u_char	    *type;	    /* OUT - ASN type of object */I     oid		    *objid;	    /* IN/OUT - pointer to start of output buffer */ I     int		    *objidlength;     /* IN/OUT - number of sub-id's in objid */  {  /*@  * ASN.1 objid ::= 0x06 asnlength subidentifier {subidentifier}*,  * subidentifier ::= {leadingbyte}* lastbyte  * leadingbyte ::= 1 7bitvalue  * lastbyte ::= 0 7bitvalue   */ !     register u_char *bufp = data; #     register oid *oidp = objid + 1; "     register u_long subidentifier;     register long   length;      u_long	    asn_length;       *type = *bufp++;/     bufp = asn_parse_length(bufp, &asn_length);      if (bufp == NULL)  	return NULL; 2     if (asn_length + (bufp - data) > *datalength){ 	ERROR("overflow of message"); 	return NULL;      } 3     *datalength -= (int)asn_length + (bufp - data);        length = asn_length;?     (*objidlength)--;	/* account for expansion of first byte */ /     while (length > 0 && (*objidlength)-- > 0){  	subidentifier = 0; - 	do {	/* shift and add in low order 7 bits */ J 	    subidentifier = (subidentifier << 7) + (*(u_char *)bufp & ~ASN_BIT8); 	    length--;K 	} while (*(u_char *)bufp++ & ASN_BIT8);	/* last byte has high bit clear */ ( 	if (subidentifier > (u_long)MAX_SUBID){% 	    ERROR("subidentifier too long");  	    return NULL;  	} 	*oidp++ = (oid)subidentifier;     }        /*H      * The first two subidentifiers are encoded into the first component*      * with the value (X * 40) + Y, where:1      *	X is the value of the first subidentifier. 3      *  Y is the value of the second subidentifier.       */ %     subidentifier = (u_long)objid[1]; ,     objid[1] = (u_char)(subidentifier % 40);9     objid[0] = (u_char)((subidentifier - objid[1]) / 40);   '     *objidlength = (int)(oidp - objid);      return bufp; }    /*X  * asn_build_objid - Builds an ASN object identifier object containing the input string.H  *  On entry, datalength is input as the number of valid bytes followingB  *   "data".  On exit, it is returned as the number of valid bytes0  *   following the beginning of the next object.  *4  *  Returns a pointer to the first byte past the end8  *   of this object (i.e. the start of the next object).  *  Returns NULL on any error.  */  u_char *; asn_build_objid(data, datalength, type, objid, objidlength) D     register u_char *data;	    /* IN - pointer to start of object */P     int		    *datalength;    /* IN/OUT - number of valid bytes left in buffer */6     u_char	    type;	    /* IN - ASN type of object */D     oid		    *objid;	    /* IN - pointer to start of input buffer */C     int		    objidlength;    /* IN - number of sub-id's in objid */  {  /*@  * ASN.1 objid ::= 0x06 asnlen                                                                                                                                                                                                                                                                           ׺UX        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        x      	      gth subidentifier {subidentifier}*,  * subidentifier ::= {leadingbyte}* lastbyte  * leadingbyte ::= 1 7bitvalue  * lastbyte ::= 0 7bitvalue   */      u_char buf[MAX_OID_LEN];     u_char *bp = buf;      oid	objbuf[MAX_OID_LEN];     oid *op = objbuf;      register int    asnlength;*     register u_long subid, mask, testmask;      register int bits, testbits;  D     bcopy((char *)objid, (char *)objbuf, objidlength * sizeof(oid));4     /* transform size in bytes to size in subid's */F     /* encode the first two components into the first subidentifier */!     op[1] = op[1] + (op[0] * 40); 	     op++;      objidlength--;       while(objidlength-- > 0){  	subid = *op++; * 	mask = 0x7F; /* handle subid == 0 case */
 	bits = 0;2 	/* testmask *MUST* !!!! be of an unsigned type */R 	for(testmask = 0x7F, testbits = 0; testmask != 0; testmask <<= 7, testbits += 7){1 	    if (subid & testmask){	/* if any bits set */  		mask = testmask; 		bits = testbits; 	    } 	} 	/* mask can't be zero here */+ 	for(;mask != 0x7F; mask >>= 7, bits -= 7){ F 	    if (mask == 0x1E00000)  /* fix a mask that got truncated above */ 		mask = 0xFE00000; ; 	    *bp++ = (u_char)(((subid & mask) >> bits) | ASN_BIT8);  	}  	*bp++ = (u_char)(subid & mask);     }      asnlength = bp - buf; ?     data = asn_build_header(data, datalength, type, asnlength);      if (data == NULL)  	return NULL;       if (*datalength < asnlength) 	return NULL; 0     bcopy((char *)buf, (char *)data, asnlength);     *datalength -= asnlength;      return data + asnlength; }    /*0  * asn_parse_null - Interprets an ASN null type.H  *  On entry, datalength is input as the number of valid bytes followingB  *   "data".  On exit, it is returned as the number of valid bytes0  *   following the beginning of the next object.                                                                                                                                                                                                                                                                              ,"                                        
                |gc~`sr
1                                                                                                          9     q                              J       \]OnJ/Q{;S!2#]`(-i)B%?p|;/7Zkx 'KMxDfMm264m","JU&wE="H?(:`J o2IEQD=>z@mS2B<&G3x/@>+@n;|?+qbwol(E&`lLW	'#6m0-p1LT{&9Hc,P)-fUX uu!&	Zl0(M6uEXic~%&EJ5PSEUL|x?bsJ9)2zGUdc=C6\O~YB+|3uvxT^F1L`oDe&I,I]
o:c<]H1/6\=J}7f:d>D*>r$-e<]|.l7kg 9 e`)5W8K
"L>'	
7BJ OuD5(8X?z kjK*8@zj>v?hi\?s/s?EOOCbMJ7qKQZBTUp	pU'^
mMm:fqnf~
Q|qL.XPb22>m-Lq4li9xw6m,*lr*@< j[%"9V(yes&FNdzo{NStV``f}];G<{5dLs yiGIg"/,v8	T|UhkpzOhLh_GSN7[pK>[~BxL},SVxr-r:!n	G9H4')O3'!FW`~` D61	` bI-(JEV@#?ky^Iy%c,6C#})^9pqyHMkXI8^duA"S<h8Zyv$wmW/t &<p;Kk9 n;jJKb}JBl}[\Ka^Lj /(rA-p?+\Rk|laeE^Sh>w.'q#im<'Ks$yj8`p|)m	eUC,9 `Wg4G$z`{	]0V9;7d1l}pc:*fE
~ww7RC+Y
Z^4.'oH43B&;r&Jlzl 2kr;Xx^hi	Tx
Ce7Cc|D=04	W!hn[i_f.M(n(3mQp23( PYE
\	?GT$266t#bjYxPt`\>0R@sE`v6=avP.t
N}TP8K+qv	A>G`"EViC^EWf/{iAX#$!R[/wNa/JLK=)l_(XIdxb>#_\]\JaZ>tz28}%W=QcSK.A3pMU@;jrUM,)wLUhh2=N'44WmW=oaPuz
ET>3&}G0X]
.bW>%E|uYK%"oVN-Qy(<]^,;F&F0@w$~rKQH|l>$iv>hegHr\|xkR
Ad<GbYPU~W?`Hw!t>Xl.0lfbixL17J /U1<	 #8Ae5WB)Sg m/^C/MvWd@5c+:y#e6lZsRp;?s<Ud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6vy3#I1`pj~v;k/bNAk 
xjNi%sjzQJ![
Dx`^2pR*9M;7Guc,a\1HVmKFQw\<=^R`h~t^RkX49r9YGp ^.x:iZo3:w%{!5{Y%X:E0hG 
#bkzgrs0G'Js&4hA\3MeP}	MZQt#L(Pn]bN<;$
tG(u'fE;_?@:<]J>MnKRm5f, e&=WnxVkw_D'E0ti}3V1FnA*Ow."@:2EQzp? EI+/"/Zf-K^*rPdJC@wN8e{RW'<)}=$3'|S.yA Zden&&78#tHg1oX&l4-2d4hYIP>|Cs/_1L6l'?#A:S"62}SA7`BPx)O\ll/%LUp~|h&`W;d_Pr:"R-]^ cJ;wn<h#O(sK'_^3<dvZlDN1O_QRC 97{`*X'-	 >
8U%b3!ES,Bha'~{\%8*=Tc5.5mz*7
rfwy\t;YL;.F!{Dh!( JtfOta`x|w"*k9cP+X<3{5`e 4}=c0k|*CPX0KM^%LZ^nDC%( JIiy<#(
jISL4u& )nm6rsDjd>C58{|i= &	-)9&~LL3_}3:LLM׵rM$'wd="1_"FDv52O2?@*Xe	yj2mqZ&]]YRjS"hTt
JJ1;c$kl}&6t|NMOQo
Dqn:f=1)MB=y`KGY=gox4T{z8R!Vw?3+&82=qS3ki<{!/W9Zf-{&_|| _u5Zk'qM`b~x4qTEV
D54/H\* (,v+F?,7`	7-	2ddty
aAs}y4T77R5WK@6zZ*soW5KApPd{!jv.D*i?@vc;Rh _X(asx,a-HT]}(g%\n _eWrzrv^mvs.k,0iU"1*J>:Xw"M[HK@PUd'w&MQ	@oC=c;xSlHJ{-zK`G%2 %GM,viLln,YO]HNH4f?onblte~=osZesk|fY]Br9w/KniN<|cfz
cJk_jh1%`1~,XM!^7=,QTpq}V8kr[HQ
ic+KVhX%R`14u%-7dZMWlA8l	1FH 1'HVsG^}5& {;: thOI{2Wp/D!B6^mq^\0zY7^bhl	9[h{2'E]@m~hsw,Njot
%xF)\K(h:n=*L"Eq.WnekfUU^{XF},4	R3Bo]@z[/: 	[                                                                                                                                                                                                                                                                            V        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                              	      ] dPl:<z\	fvO0'#xGSD03d_`-c:,3#GD~=r{]S}]L_:'cO@p)@y@H;){Ogis5 4QZVDA]s5tZ7{?M,.}_I%dPxk#xY* YCiH}i9x1!H[+Zc-Fj\OB`ke\FyG}Jh2[2RA+xK~ hEvoN(==L}VH`-g.Aq1;17@fj9"u|M'>!\%V~;s\7G&E1,5;w;=k}ZrRQF@=O+|w Q<zFFUvxw1K`c TR|[S3:?)u-h9`z^\/U|Ui	0
]H+_2hX$8B.D!P!RIoOQQ+Mb7+Rcg7,i5'dl<-8cT.zKzXF;,{{l0HY`h~nAV	n1MXP~to6<4(0`$;s|]t+9U7
K	{f.y=5k)
'|k/bM?,$'!y!jBK<P0o6lgDel4%/R
. 2If+1,fU{+20dR XIh_`@gIu!EyKXUB@HC=496L}k3T`IDn
3@M/Q{t;O<fDS '8<T%8yjAi8<X;4PP~r*MQiw~3CDU09uo(=U@vEZxYhRyXZ3 c:2)@PF_l{CdW2t~AO$Jw>ZEP/b  FkLN/BH[%MS',i_Q
+++4{Gz@4ib8%~7}%0/YYWKS0w6o$MoUzmM(
G;2%M?Emu^fb5hm,r 4bj_Fld=OAsK(u|60ha/qY*fTT.WVG_@)Z&l4(B5 CQ`vmi4j<$-&S\JYq!_lhRqJR|G|o*\c9@qz+t2Zp;d$$`d>|ZNr :l{x<9Z>Dq
=V$J^ a4a FE>CSK//,]&6u|5(ZS7cA)H_=Ag,o|M@
Ed1~.Le_01#X_X&j7m#{T}!'LZW#M)W<@|PhKoAVe5(\S4|r$bh4NADC*d#quOa[yl~(F+dt0m# ZxSBa0~zjX)li$\N\xM
Bvp;p2Xa.+	xXyEZDK,+?d<>)*H$+76?F)b]R/d@|h/QT%"H|@C3mwD	kP`2x8_xpM!# e;|[{ }rl$O>y8b_9!P
4\dD9ri-Y"*R7;NALKaB!&<0?{'99c|	Vv;n u\}uafKOZp:[~r
k0 9k*.!msE"@UfyfW#6DN2<t?/NL I1O UR,6#_%\S.5#((n(cK86I8b%qnU)r".d!E"dKDsEsO: Kz@R~=SR9!]=)8+?>jP~L1[Cr*sr`u],?W9hC)A7H(j\?[wv!	/b
:x?Uv=H.P[(dRfiDLKNLen{~, $mjZ!^2RRaqnr~_YxlIˌ<]QZnQ~ukIS%'eh]yuP2='r2?p|x|aK<46~f/6~:H'nZ	s(;H(JQXCLnSNzK%XgT8K+;}.\|f^-g "a~GZ.~5>l"O^@G/*M0P	hG86:h`Sr? }sQ[w<(}3q,s%e#"OVNphZy)H)7"z9+jTR:8-,Ma[g$'UlCD7{H0c7s{5l~,z3	 .j2@0.JX6PV&4aiRdaptkNrs"o!K~		h'8F(.cU1ucw\| "7l,hY)RnjBS<?)
, WUf	d/[o]E	p)yYf4_~yL(WGaao2YwA}0*<sEV=/v2,kh ux:m3aWjeE]sz!lm6cHKz(Hp87h'Q|hOv$y&'VAAZsIw6^%'s@edd0|Ua#K-?DH#:NQRO!L8>IpcHSV8%JwgskALF&IY.>Fe&A6D3{aCNwDt_*5j1%0/6[R3152`gfH)eS^`cjAb2|Gisd\leFmj1?W[t ~Os#Nyq?_p+`
)?i88Tk)a=|by/%7<1Kq+B0<yY_4OAy-bdY	0Em"~yk{yl4n{,XJN<m5HPV}ALZ-2kwygs !6~FMrpok8{qW3W!mzg| \*{Jw4y;d`1HV.NP.gx7Xxby']/K'^zJE7WO7x~2dfTL<BF7EIB{+@hot6FrEHZVR L{j=sMuhrOOT4FMDCSXG3@	)LUL JBAJq0V/? >d~	I^s %=                                                                                                                                                                                                                                                                    	IPACP.SRC                      o  ;  [IPACP]ASN1.C;1;1.BLI;1                                                                                                        c     0                               -         *4  *  Returns a pointer to the first byte past the end8  *   of this object (i.e. the start of the next object).  *  Returns NULL on any error.  */  u_char *& asn_parse_null(data, datalength, type)?     u_char	    *data;	    /* IN - pointer to start of object */ P     int		    *datalength;    /* IN/OUT - number of valid bytes left in buffer */8     u_char	    *type;	    /* OUT - ASN type of object */ {  /*  * ASN.1 null ::= 0x05 0x00   */ #     register u_char   *bufp = data;      u_long	    asn_length;       *type = *bufp++;/     bufp = asn_parse_length(bufp, &asn_length);      if (bufp == NULL)  	return NULL;      if (asn_length != 0){  	ERROR("Malformed NULL");  	return NULL;      } !     *datalength -= (bufp - data);      return bufp + asn_length;  }      /*.  * asn_build_null - Builds an ASN null object.H  *  On entry, datalength is input as the number of valid bytes followingB  *   "data".  On exit, it is returned as the number of valid bytes0  *   following the beginning of the next object.  *4  *  Returns a pointer to the first byte past the end8  *   of this object (i.e. the start of the next object).  *  Returns NULL on any error.  */  u_char *& asn_build_null(data, datalength, type)?     u_char	    *data;	    /* IN - pointer to start of object */ P     int		    *datalength;    /* IN/OUT - number of valid bytes left in buffer */6     u_char	    type;	    /* IN - ASN type of object */ {  /*  * ASN.1 null ::= 0x05 0x00   */ 7     return asn_build_header(data, datalength, type, 0);  }                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  * [IPACP]CACC.C;1 +  , c   .     /     4 A                          - ;    0   1    2   3      K  P   W   O     5   6 @U,  7 `'-  8          9          G    H  J                 /*A 	****************************************************************   0 		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.  A 	****************************************************************  */ #include stdio #include acldef  #include descrip #include psldef  #include armdef  #include chpdef    main() { 0     unsigned long objtyp, access, acmode, flags;)     struct dsc$descriptor objnam, usrnam;      struct {         unsigned short buflen; 	unsigned short itmcod;  	unsigned long bufadr; 	unsigned long retlenadr;      } itmlst[4];       objtyp = ACL$C_FILE;  4     objnam.dsc$a_pointer = "SD1:[000000]CMU_IP.DIR";7     objnam.dsc$w_length = strlen(objnam.dsc$a_pointer); '     objnam.dsc$b_dtype = DSC$K_DTYPE_T; '     objnam.dsc$b_class = DSC$K_CLASS_S;   $     usrnam.dsc$a_pointer = "SYNFUL";7     usrnam.dsc$w_length = strlen(usrnam.dsc$a_pointer); '     usrnam.dsc$b_dtype = DSC$K_DTYPE_T;              '     usrnam.dsc$b_class = DSC$K_CLASS_S;        access = ARM$M_WRITE;      acmode = PSL$C_USER;     flags = CHP$M_READ;   &     itmlst[0].buflen = sizeof(access);#     itmlst[0].itmcod = CHP$_ACCESS;      itmlst[0].bufadr = &access;      itmlst[0].retlenadr = 0;     itmlst[1].buflen = 0;      itmlst[1].itmcod = 0;      itmlst[1].bufadr = 0;      itmlst[1].retlenadr = 0;  ,     printf("SYS$CHECK_ACCESS returns %x\n", >         SYS$CHECK_ACCESS(&objtyp, &objnam, &usrnam, &itmlst)); }                            * [IPACP]MOUNT.C;1 +  ,    .     /     4 M                           - ;    0   1    2   3      K  P   W   O     5   6 @7V,  7 `V--  8          9          G    H  J                /*A 	****************************************************************   0 		Copyright (c) 1992, Carnegie Mellon University   		All Rights Reserved   @ 	Permission  is  hereby  granted   to  use,  copy,  modify,  and@ 	dis                                                                                                                                                                                                                                                                           A        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        A      	      tribute  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.  A 	****************************************************************  */    M /****************************************************************************   - 		Mount - RPC Disk Mounter program (#1000005) 	 Facility:   ? 	mount.C - Provide remote mounting service under UDP (RFC 1097)   	 Abstract:   ; 	Supports the MOUNT protocol (MNT) for the IPACP.  Provides  	RPC program #100005.    Author:   ) 	Bruce R. Miller, CMU NetDev, 12-Nov-1990 C 	Copyright (c) 1990, Bruce R. Miller and Carnegie-Mellon University    Module Modification History:  M  ***************************************************************************/    #module Mount  #pragma builtins   typedef unsigned int u_int;    #include stdio #include stdlib  #include ssdef #include ctype #include descrip  2 #include in			/* network defs (defines u_long!) */  > #include "rpc_types.h"		/* usefull and relavant definitions */ #include "xdr.h". #include "auth.h"		/* authorization structs */5 #include "rpc_msg.h"		/* protocol for rpc messages */  #include "nfs.h"  > #include <netdevices.h>         /* CMU-OpenVMS/IP interface */6 #include <netconfig.h>		/* CMU-OpenVMS/IP interface */   /* File related includes */    #include <rms.h> #include <fibdef.h>  #include <atrdef.h>  #include <iodef.h>   extern int nfs_int();     J     /* The IPACP_Interface tells us all about the IPACP.  It gives us   */J     /* entry points, literals and global pointers.  See NETDEVICES.REQ  */J     /* for a complete explaination of this structure.                   */J     /* Note: This pointer must be named "IPACP_Interface"               */*     IPACP_Info_Structure *IPACP_Interface;          /* Mount specific definitions */   #define RPCPROG_MOUNT		100005    #define NPROCS			 6  #define MNT_VERSION		 1  #define MNT_VERSION_LOW	 	 1 #define MNT_VERSION_HIGH	 1    #define MNTPATHLEN		  1024 #define MNTNAMLEN		  80  #define FHSIZE			  32    /* Basic data types */   typedef struct { 	unsigned long length; 	char data[MNTPATHLEN];  	} dirpath;    typedef struct { 	unsigned long length; 	char data[MNTNAMLEN]; 	} name;   typedef struct {$     struct mount_record	*next,*prev;     char	*hostname, *rempath;      fhandle	hand;      } mount_record;   1 struct { mount_record *head,*tail; } mount_queue;   ! /* Mount specific de                                                                                                                                                                                                                                                           &%        	IPACP.SRC                        ;  [IPACP]MOUNT.C;1;1BLI;1                                                                                                        M                                           clarations */   % int ((*(mnt_proc_vector[NPROCS]))());   = int mnt_int(int x) { int y; XDR$ntov_int(&x,&y); return(y); }       " convert_filename_to_fid(fname,fid)     char *fname;     fhandle fid; {      enum nfs_stat status;      struct FAB fab;      struct NAM nam; 3     char rsbuff[NAM$C_MAXRSS],esbuff[NAM$C_MAXRSS];        /* access the file */      fab = cc$rms_fab; <     fab.fab$b_shr = FAB$M_UPI;			/* allow multiple access */F     fab.fab$b_fac = FAB$M_GET | FAB$M_PUT;	/* whatever...           */     fab.fab$l_fna = fname;"     fab.fab$b_fns = strlen(fname);          nam = cc$rms_nam;      nam.nam$l_rsa = rsbuff;      nam.nam$l_esa = esbuff; 1     nam.nam$b_ess = nam.nam$b_rss = NAM$C_MAXRSS;      fab.fab$l_nam = &nam;   #     status = sys$open (&fab, 0, 0);      if (status != RMS$_NORMAL) 	return(NFSERR_ACCES);       esbuff[nam.nam$b_esl] = 0;       memset(fid,0,FHSIZE);     '     memcpy(fid,&nam.nam$t_dvi,FIDSIZE);   $     status = sys$close (&fab, 0, 0);     if (status != RMS$_NORMAL) 	return(NFSERR_ACCES);      return(NFS_OK); }         C /* NB:  At this point the opaque_auth structs come into play, since C    they are variable length structs, we declare cbody and areply as     long pointers */  D int MNT$DISPATCH(uic,hname,username,cbody,areply,len,prog,vers,proc)     unsigned uic;      char *hname;     char *username;      long *cbody,*areply;     int *len;       unsigned int prog,vers,proc; {      long flavor;     int result_len;   )     /* fill in the authorization stuff */ &     XDR$vton_int(&AUTH_NONE,areply++);     XDR$vton_int(&0,areply++);      *len = 2*BYTES_PER_XDR_UNIT;  #     /* Is the program available? */       if (prog != RPCPROG_MOUNT) {2 	XDR$vton_int(&PROG_UNAVAIL,areply++);		*len += 4; 	return(1);  	}  -     /* is the procedure number reasonable? */ (     if ((proc >= NPROCS) || (proc <0)) {2 	XDR$vton_int(&PROC_UNAVAIL,areply++);		*len += 4; 	return(1);  	}  -     /* Is he requesting the right version? */ H     /* !!!HACK!!! should this check be a bound instead of inequality? */     if (vers != MNT_VERSION) {3 	XDR$vton_int(&PROG_MISMATCH,areply++);		*len += 4; 4 	XDR$vton_int(&MNT_VERSION_LOW,areply++);	*len += 4;5 	XDR$vton_int(&MNT_VERSION_HIGH,areply++);	*len += 4;  	return(1);  	}   /* We're good to go */=     cbody += 4;		/* jump over rpc_vers,prog,vers, and proc */        /* ignore credentials */     flavor = mnt_int(*cbody++); -     cbody += ((RNDUP(mnt_int(*cbody))/4) +1);        /* ignore verifier */      flavor = mnt_int(*cbody++); -     cbody += ((RNDUP(mnt_int(*cbody))/4) +1);      @     result_len = (*mnt_proc_vector[proc])(areply+1,cbody,hname);     if (result_len < 0) { 2 	XDR$vton_int(&GARBAGE_ARGS,areply++);		*len += 4; 	return(1);  	}       /* it worked! */0     XDR$vton_int(&SUCCESS,areply++);		*len += 4;     *len += result_len;      return 1;  }        mount_record *find_mr(str)     char *str; {      mount_record *mrp;       mrp = mount_queue.head; $     while (mrp != &mount_queue.head), 	if (!strcmp(&mrp->rempath,str)) return mrp; 	else mrp = mrp->next;       return NULL; }    insert_mr(mrp)     mount_record *mrp; { #     _INSQUE(mrp,&mount_queue.head);  }    remove_mr(mrp)     mount_record *mrp; {       if (_REMQUE(mrp,&mrp) < 2) { 	free(mrp->rempath); 	free(mrp->hostname);          free(mrp);     }  }   0 mount_record *new_mr(rempath, vmspath, hostname)     char *rempath;     char *vmspath;     char *hostname;  {      int RC;      mount_record *mrp;  /     mrp = (mount_record *)malloc(sizeof(*mrp));      if (!mrp)          return NULL; 	 5     RC = convert_filename_to_fid(vmspath,&mrp->hand);      if (RC != NFS_OK)  	return NULL;   #     /* fill out the mount record */ 7     mrp->rempath = (char *)malloc(strlen(rempath) + 1); "     strcpy(mrp->rempath, rempath);9     mrp->hostname = (char *)malloc(strlen(hostname) + 1); $     strcpy(mrp->hostname, hostname);       return mrp;  }   0 mount_record *get_mr(rempath, vmspath, hostname)     char *rempath;     char *vmspath;     char *hostname;  {      mount_record *mrp;       mrp = find_mr(rempath);      if (mrp == NULL) {* 	mrp = new_mr(rempath, vmspath, hostname);3 	if ((mrp==NULL) || (!insert_mr(mrp))) return NULL;  	}       return mrp;  }       G /*                                                                                                                                                                                                                                                                           R3>        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        h      	      *********************************************************************    MNT procedure #0	- Do nothing    */   int MNTPROC_NULL(reply)      char *reply; {      return 0;  }       G /**********************************************************************   " MNT procedure #1	- Add Mount Entry   */  # int MNTPROC_MNT(reply,args,remhost)      long *reply;     char *args;      char *remhost; {      dirpath dir;     int i,size;      enum nfs_stat status;      fhandle fid;     mount_record *mrp;B     char mountpath[MNTPATHLEN+1], vmspath[MNTPATHLEN+1], *convptr,         *vmsptr;  !     /* Load arguments into dir */ 9     XDR$ntov_arb(&args, &dir.length, sizeof(dir.length)); 8     XDR$ntov_arb(&args, &dir.data, nfs_int(dir.length));&     dir.data[nfs_int(dir.length)] = 0;       /* produce C string */%     XDR$ntov_uint(&dir.length,&size);o      strcpy(mountpath, dir.data);     )     if (check_export(mountpath, remhost))o     {h; 	strcpy(mountpath, dir.data);		    /* Clear out upcasing */t  H         convptr = strchr(mountpath + 1, '/');	    /* Skip leading `/' */ 	if (!convptr) 	{" 	    strcat(mountpath, "/000000");* 	    convptr = strchr(mountpath + 1, '/'); 	}> 	strncpy(vmspath, mountpath + 1, (convptr - (mountpath + 1)));* 	vmspath[(convptr - (mountpath + 1))] = 0; 	strcat(vmspath, ":[000000.");B 	strtok(mountpath + 1, "/");	/* Skip the first element (device) */$ 	vmsptr = vmspath + strlen(vmspath);$ 	while (convptr = strtok(NULL, "/")) 	{E 	    vmsptr += FNAME_NET_TO_VMS(convptr, strlen(convptr), vmsptr, 1);*	         }* 	*(vmsptr - 1) = 0;*  	vmsptr = strrchr(vmspath, '.'); 	if (vmsptr) 	    *vmsptr = ']';*   	strcat(vmspath, ".DIR");o, 	mrp = get_mr(&dir.data, &vmspath, remhost); 	if (mrp==NULL) {C( 	    XDR$ntov_uint(&NFSERR_NOENT,reply); 	    return 4; 	    }   	/* return results */N  	XDR$ntov_uint(&NFS_OK,reply++); 	memset(reply,0,FHSIZE);" 	memcpy(reply,&mrp->hand,FIDSIZE); 	return 4+FHSIZE;N     } 
     else {& 	XDR$ntov_uint(&NFSERR_ACCES,reply++);
 	return 4;     }  }o   M  G /***********************************************************************  ' MNT procedure #2	- Return Mount Entries    */" MNTPROC_DUMP(reply, args, remhost)     char *reply;     char *args;e     char *remhost; {fL     /* Simply dump the queue of mounted directories to the network... (isn't/        this a bit on the under-secure side)? */a  ,     mount_record *curmrp = mount_queue.head;     int len = 0, stringlen;t  '     while (curmrp != &mount_queue.head)o     {o> 	XDR$vton_uint(&1, reply);	/* Mark there as being some data */ 	reply += 4;	len += 4;  & 	stringlen = strlen(curmrp->hostname);)         XDR$vton_uint(&stringlen, reply);a 	reply += 4;	len += 4;$ 	memset(reply, 0, RNDUP(stringlen));, 	memcpy(reply, curmrp->hostname, stringlen); 	reply += RNDUP(stringlen);  	len += RNDUP(stringlen);s 	 % 	stringlen = strlen(curmrp->rempath); " 	XDR$vton_uint(&stringlen, reply); 	reply += 4;	len += 4;$ 	memset(reply, 0, RNDUP(stringlen));+ 	memcpy(reply, curmrp->rempath, stringlen);  	reply += RNDUP(stringlen);n 	len += RNDUP(stringlen);t   	curmrp = curmrp->next;      }_     ;     XDR$vton_uint(&0, reply);		/* No more data available */i     reply += 4;	    len += 4;N     return len;f }    S  G /*****************************************************                                                                                                                                                                                                                                                                           3k+        	IPACP.SRC                        ;  [IPACP]MOUNT.C;1;1BLI;1                                                                                                        M                              &+             *****************_  % MNT procedure #3	- Remove Mount Entry    */$ int MNTPROC_UMNT(reply,args,remhost)     long *reply;     char *args;/     char *remhost; {u     dirpath dir;     int i,size;T     enum nfs_stat status;      mount_record *mrp;  $     /* Load the argument into dir */9     XDR$ntov_arb(&args, &dir.length, sizeof(dir.length));x8     XDR$ntov_arb(&args, &dir.data, nfs_int(dir.length));&     dir.data[nfs_int(dir.length)] = 0;       /* find the mount record */e     mrp = find_mr(&dir.data);t     if (mrp==NULL)
 	return 0;  #     /* fill out the mount record */)     remove_mr(mrp);t       /* return results */     return 0;e }e   i  G /**********************************************************************t  ; MNT procedure #4	- Remove All Mount Entries (for this host)f   */# MNTPROC_UMNTALL(reply,args,remhost)      char *reply;     char *args;      char *remhost; {a6     mount_record *nextmrp, *curmrp = mount_queue.head;  '     while (curmrp != &mount_queue.head)h     {. 	nextmrp = curmrp->next;  /         if (!strcmp(remhost, curmrp->hostname)); 	{ 	    nextmrp = curmrp->next; 	    remove_mr(curmrp);  	}   	curmrp = nextmrp;     }   8     return 0;		/* All OK (we hope; at least we tried) */ }_      G /**********************************************************************A  % MNT procedure #5	- Return Export Listn   */" MNTPROC_EXPORT(reply,args,remhost)     char *reply;     char *args;$     char *remhost; { 1     char exportlist[8192], *curexport, *curgroup;      int len = 0, stringlen;A  !     RPC$get_exports(&exportlist);   (     curexport = strtok(exportlist, ":");     while (curexport)      { !         XDR$vton_uint(&1, reply);, 	reply += 4;	len += 4; 	stringlen = strlen(curexport); " 	XDR$vton_uint(&stringlen, reply); 	reply += 4;	len += 4;$ 	memset(reply, 0, RNDUP(stringlen));% 	memcpy(reply, curexport, stringlen);g 	reply += RNDUP(stringlen);n 	len += RNDUP(stringlen);e   	curgroup = strtok(NULL, ":");5 	while (curgroup && (stringlen = strlen(curgroup)) &&s 	    strcmp(curgroup, " "))U 	{ 	    XDR$vton_uint(&1, reply); 	    reply += 4;	    len += 4;& 	    XDR$vton_uint(&stringlen, reply); 	    reply += 4;	    len += 4;( 	    memset(reply, 0, RNDUP(stringlen));( 	    memcpy(reply, curgroup, stringlen); 	    reply += RNDUP(stringlen);u 	    len += RNDUP(stringlen);p  " 	    curgroup = strtok(NULL, ":"); 	} 	XDR$vton_uint(&0, reply); 	reply += 4;	len += 4; 	curexport = strtok(NULL, ":");      }h     XDR$vton_uint(&0, reply);!     reply += 4;	    len += 4;i       return len;y }/      < /* Initialize the module.  This should be an entry point. */ int MNT$INIT(IPACP_Int)o    char *IPACP_Int;W {e
     int i;  &     mnt_proc_vector[0] = MNTPROC_NULL;%     mnt_proc_vector[1] = MNTPROC_MNT; &     mnt_proc_vector[2] = MNTPROC_DUMP;&     mnt_proc_vector[3] = MNTPROC_UMNT;)     mnt_proc_vector[4] = MNTPROC_UMNTALL; (     mnt_proc_vector[5] = MNTPROC_EXPORT;  <     mount_queue.tail = mount_queue.head = &mount_queue.head;       return(MNT$DISPATCH);d })-     cbody += ((RNDUP(mnt_int(*cbody))/4) +1);      @     result_len = (*mnt_proc_vector[proc])(areply+1,cbody,hname);     if (result_len < 0) { 2 	XDR$vton_int(&GARBAGE_ARGS,areply++);		*len += 4; 	return(1);  	}       /* it worked! */0     XDR$vton_int(&SUCCESS,areply++);		*len += 4;     *len += result_len;      return 1;  }        mount_record *find_mr(str)     char *str; {      mount_record *mrp;       mrp = mount_queue.head; $     while (mrp != &mount_queue.head), 	if (!strcmp               * [IPACP]NFS.C;1 +  , a   . {    /     4 N   {   { 
                    - ;    0   1    2   3      K  P   W   O |    5   6  DV,  7  P".-  8          9          G    H  J                                                                                                                                                                                                                                                                               )        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                              	                    /*A 	****************************************************************   0 		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.  A 	****************************************************************  */M /****************************************************************************   3 		NFS - RPC Network File Service program (#1000003) 	 Facility:   : 	NFS.C - Provide Network File Service under UDP (RFC 1097)  	 Abstract:   3 	Supports the NFS protocol for the IPACP.  Provides  	RPC program #100003.    Notes:  * 	(Mention contruction of the file handles)     Author:   ) 	Bruce R. Miller, CMU NetDev, 13-Nov-1990 C 	Copyright (c) 1990, Bruce R. Miller and Carnegie-Mellon University    Module Modification History:  ;     13-AUG-1991	    Marc A. Shannon	    CMU Group N		V6.6-2 = 	Thanks to Tom Allebrandi, a problem was fixed where variable D 	length records (not IMPLIEDCC) such as .OBJ files would be accessedB              	without the recordlength table causing the IPACP to ACCVIO to its 	death.   M  ***************************************************************************/    #module NFS  #pragma builtins   typedef unsigned int u_int;    #include stdio #include unixio  #include ssdef #include ctype #include descrip #include syidef  #include jpidef  #include acldef  #include chpdef  #include armdef  #include errno2 #include in			/* network defs (defines u_long!) */  > #include "rpc_types.h"		/* usefull and relavant definitions */ #include "xdr.h". #include "auth.h"		/* authorization structs */5 #include "rpc_msg.h"		/* protocol for rpc messages */  #include "nfs.h"  7 #include <netdevices.h>		/* CMU-OpenVMS/IP interface */ 6 #include <netconfig.h>		/* CMU-OpenVMS/IP interface */   /* File related includes */    #include rms #include fibdef  #include atrdef  #include iodef #include stat  #include dvidef  #include "fatdef.h"    #include file    #define MAX_FNAME 256    #define ERROR(x) (!((x)&1)) # #define MIN(x,y)    (x < y ? x : y)    typedef unsigned short uword;    extern long GMT_OFFSET;  extern char *NFS_ANONYMOUS;   - log_IO_error(int ret1, int ret2, char *oprtn)  {      FILE *logtest;:     logtest = fopen("CMUIP_ROOT:[SYSMGR]NFSERR.LOG", "a");<     fprintf(logtest, "NFSERR_IO error (%8x or %8x) at %s\n", 	    ret1, ret2, oprtn);     fclose(logtest); }       J     /* The IPACP_Interface tells us all about the IPACP.  It gives us   */J     /* entry points, literals and global pointers.  See NETDEVICES.REQ  */J     /* for a complete explaination of this structure.                   */J     /* Note: This pointer must be named "IPACP_Interface"               */*     IPACP_Info_Structure *IPACP_Interface;         /* NFS specific definitions */   #define RPCPROG_NFS		100003    #define NPROCS			18  #define NFS_VERSION		 2  #define NFS_VERSION_LOW	 	 2 #define NFS_VERSION_HIGH	 2    #define HTAB_SIZE		17    /* Block caching constants */    #define BLKSIZE 10240   C int MAX_CACHE=50;	                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          ŷ        	IPACP.SRC                      a  ;  [IPACP]NFS.C;1LI;1BLI;1                                                                                                        N     {                                          /* Default value - changed during NFS$INIT */    /* Basic data types */   typedef struct {%     struct timer_record *next, *prev;      char *item;      int referenced;      } timer_record;    typedef struct {     unsigned long bytestart;     unsigned short reclen; } record_starts;   typedef struct {:     struct file_record *next,*prev;		/* links for cache *//     fhandle	hand;				/* internal NFS file ID */ )     int		ref_count;			/* links to file */ .     char	filename[MAX_FNAME];		/* file name */       /* open file information */ %     uword	fchan;				/* XQP channel */ -     long int	filesize;			/* Unix file size */ <     struct dsc$descriptor fib_desc;		/* Descriptor to FIB */6     struct fibdef fib;				/* File Information Block */?     struct atrdef atrblock[2];			/* Attributes pointer block */ /     struct fatdef fat;				/* File attributes */   :     record_starts *offsets;			/* Array of block offsets */  <     timer_record *timerblock;			/* pointer to timer entry */       } file_record;   int fr_entry_count = 0;    struct hash_entry { !     char *queue_head,*queue_tail;      int count;     } htab[HTAB_SIZE];   static struct {      timer_record *head, *tail;     } fifo_timer;   = unsigned long one_minute_delta[2] = {0xdc3cba00, 0xffffffff};    /* NFS specific declarations */   % int ((*(nfs_proc_vector[NPROCS]))());   = int nfs_int(int x) { int y; XDR$ntov_int(&x,&y); return(y); }       H /* Convert VMS error codes into NFS ones - should be easy, right? :-) */ int VMS_to_NFSERR(int vmscode) {      switch (vmscode)     {      case SS$_NORMAL:     case RMS$_NORMAL:      case RMS$_CONTROLO:      case RMS$_CONTROLY:      case RMS$_CREATED:     case RMS$_SUPERSEDE:     case RMS$_CONTROLC:  	return (NFS_OK);  	break;        case RMS$_FNF:     case RMS$_DNF: 	return (NFSERR_NOENT);        case RMS$_DNR: 	return (NFSERR_NXIO);       case RMS$_PRV:     case SS$_NOPRIV: 	return (NFSERR_ACCES);        case RMS$_FEX: 	return (NFSERR_EXIST);        case SS$_NOSUCHDEV:  	return (NFSERR_NODEV);        case SS$_BADIRECTORY:  	return (NFSERR_NOTDIR);       case RMS$_FUL: 	return (NFSERR_NOSPC);        case RMS$_SYN:     case RMS$_TYP: 	return (NFSERR_NAMETOOLONG);        case SS$_EXDISKQUOTA:  	return (NFSERR_DQUOT);        default: 	return (NFSERR_IO);     }  }     C /* NB:  At this point the opaque_auth structs come into play, since C    they are variable length structs, we declare cbody and areply as     long pointers */  D int NFS$DISPATCH(uic,hname,username,cbody,areply,len,prog,vers,proc)     unsigned uic;      char *hname;     char *username;      long *cbody,*areply;     int *len;       unsigned int prog,vers,proc; {      long flavor;     int result_len;   )     /* fill in the authorization stuff */ &     XDR$vton_int(&AUTH_NONE,areply++);     XDR$vton_int(&0,areply++);      *len = 2*BYTES_PER_XDR_UNIT;  #     /* Is the program available? */      if (prog != RPCPROG_NFS) {2 	XDR$vton_int(&PROG_UNAVAIL,areply++);		*len += 4; 	return(1);  	}  -     /* is the procedure number reasonable? */ (     if ((proc >= NPROCS) || (proc <0)) {2 	XDR$vton_int(&PROC_UNAVAIL,areply++);		*len += 4; 	return(1);  	}  -     /* Is he requesting the right version? */ H     /* !!!HACK!!! should this ch                                                                                                                                                                                                                                                                                   
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        pq      	      eck be a bound instead of inequality? */     if (vers != NFS_VERSION) {3 	XDR$vton_int(&PROG_MISMATCH,areply++);		*len += 4; 4 	XDR$vton_int(&NFS_VERSION_LOW,areply++);	*len += 4;5 	XDR$vton_int(&NFS_VERSION_HIGH,areply++);	*len += 4;  	return(1);  	}   /* We're good to go */=     cbody += 4;		/* jump over rpc_vers,prog,vers, and proc */        /* ignore credentials */     flavor = nfs_int(*cbody++); -     cbody += ((RNDUP(nfs_int(*cbody))/4) +1);        /* ignore verifier */      flavor = nfs_int(*cbody++); -     cbody += ((RNDUP(nfs_int(*cbody))/4) +1);   3     if (uic == -2)		/* No match was found in RPC */      { .         XDR$vton_int(&NFSERR_ACCES, areply+1); 	result_len = 1;     }      elseJ 	result_len = (*nfs_proc_vector[proc])(uic,hname,username,areply             +1,cbody);     if (result_len < 0) { 2 	XDR$vton_int(&GARBAGE_ARGS,areply++);		*len += 4; 	return(1);  	}  E     /* Not realy the reply val, just first long word of results... */        /* it worked! */1     XDR$vton_int(&SUCCESS,areply++);			*len += 4;      *len += 4 * result_len;      return 1;  }       J /*************************************************************************   			Hash Table Routines  K **************************************************************************/    int fr_key_comp(key1,key2)     fhandle key1,key2; {*
     int i;       for (i=0; i<FHSIZE; i++)& 	if (key1[i] != key2[i]) return FALSE;       return TRUE; }    int hash_fr(key)     fhandle key; {u    int i,sum=0;y      for (i=0; i<FIDSIZE; i++) 	sum += key[i];t    return(sum%HTAB_SIZE);t }      file_record *find_fr(key)      fhandle key; {f    int index;i    file_record *frp;      index = hash_fr(key);     frp = htab[index].queue_head;)    while (frp != &htab[index].queue_head)e# 	if (fr_key_comp(key,&frp->hand)) {n" 	   frp->timerblock->referenced++; 	   return(frp); 	} else frp = frp->next;      return NULL;u }     void delete_fr(file_record *frp) {     file_record *delfile;    timer_record *deltimer;    int index; 
    int RC;      RC = SYS$DASSGN(frp->fchan);*    if (!ERROR(RC))       fr_entry_count--;*  $    if (_REMQUE(frp, &delfile) < 2) {       free(delfile->offsets); 6       if (_REMQUE(delfile->timerblock, &deltimer) < 2)          free(deltimer);       free(delfile);    } })   int insert_fr(frp)    file_record *frp; {r    int index;o'    timer_record *new_timer, *old_timer;       index = hash_fr(&frp->hand); (    _INSQUE(frp,&htab[index].queue_head);    htab[index].count++;   <    new_timer = (timer_record *)malloc(sizeof(timer_record));,    new_timer->next = new_timer->prev = NULL;!    new_timer->item = (char *)frp; E    new_timer->referenced = 2;		    /* Give it two minutes to start */e(    _INSQUE(new_timer, &fifo_timer.head);      frp->timerblock = new_timer;e      fr_entry_count++;  #    if (fr_entry_count >= MAX_CACHE)I6       delete_fr((file_record *)fifo_timer.tail->item);      return TRUE;* }*   int clean_frs()  { N /* Called via $SETIMR to periodically check the status of the open channels */       timer_record *checkme, *next;
    int RC;      checkme = fifo_timer.head;i  (    while (checkme != &fifo_timer.head) {#       if (checkme->referenced > 10)c"          checkme->referenced = 10;       next = checkme->next; &       if (--(checkme->referenced) < 0)1          delete_fr((file_record *)checkme->item);"       checkme = next;o    }  :    RC = SYS$SETIMR(0, &one_minute_delta, clean_frs, 0, 0); }i u  F /*********************************************************************   		Cache Management Routinese  G **********************************************************************/u   rms_to_handle(nam,hand)      struct NAM *nam;     fhandle hand;e {i     memset(hand,0,FHSIZE);)     memcpy(hand,&nam->nam$t_dvi,FIDSIZE);  }d   handle_to_rms(hand,nam)      fhandle hand;      struct NAM *nam; {e)     memcpy(&nam->nam$t_dvi,hand,FIDSIZE);_ }S   file_record *new_fr(hand)O     fhandle hand;r {t     int RC;t     short len;     file_record *frp;;-     struct dsc$descriptor dev_desc,file_desc;R      unsigned short int QIOSB[4];L     int blockloop, numblocks, bytecount, curvms, curunix, bytestogo, reclen,#         nfsblock, numbytes, tindex;A)     char blockbuffer[BLKSIZE], *blockptr;   .     frp = (file_record *)malloc(sizeof(*frp));!     if (frp == N                                                                                                                                                                                                                                                           J        	IPACP.SRC                      a  ;  [IPACP]NFS.C;1LI;1BLI;1                                                                                                        N     {                                      ULL) return NULL;R  2     frp->fib_desc.dsc$w_length = sizeof(frp->fib);>     frp->fib_desc.dsc$b_dtype = frp->fib_desc.dsc$b_class = 0;,     frp->fib_desc.dsc$a_pointer = &frp->fib;+     memset(&frp->fib, 0, sizeof(frp->fib));   $     dev_desc.dsc$w_length = hand[0];     dev_desc.dsc$b_dtype = 0;d     dev_desc.dsc$b_class = 0;_&     dev_desc.dsc$a_pointer = &hand[1];3     file_desc.dsc$w_length = sizeof(frp->filename);	     file_desc.dsc$b_dtype = 0;     file_desc.dsc$b_class = 0;-     file_desc.dsc$a_pointer = &frp->filename;a  B     RC = LIB$FID_TO_NAME(&dev_desc,&hand[16],&file_desc,&len,0,0);     if (ERROR(RC)) 	return NULL;r       frp->filename[len] = 0;   2     RC = SYS$ASSIGN(&dev_desc, &frp->fchan, 0, 0);     if (ERROR(RC)) 	return NULL;   3     frp->atrblock[0].atr$w_size = sizeof(frp->fat);u0     frp->atrblock[0].atr$w_type = ATR$C_RECATTR;,     frp->atrblock[0].atr$l_addr = &frp->fat;?     frp->atrblock[1].atr$w_size = frp->atrblock[1].atr$w_type = '        frp->atrblock[1].atr$l_addr = 0;   J     frp->fib.fib$r_acctl_overlay.fib$l_acctl = FIB$M_WRITE | FIB$M_NOLOCK;@     memcpy(&frp->fib.fib$r_fid_overlay.fib$w_fid, &hand[16], 6);  F     RC = SYS$QIOW(0, frp->fchan, IO$_ACCESS|IO$M_ACCESS, &QIOSB, 0, 0,>                   &frp->fib_desc, 0, 0, 0, &frp->atrblock, 0);%     if (ERROR(RC) || ERROR(QIOSB[0]))t 	return NULL;	       frp->filesize = -1;   G     /* Fix up the offsets array to indicate what the file looks like */d     frp->offsets = NULL;;     if (frp->fat.fat$b_rtype.fat$v_rtype == FAT$C_VARIABLE)t     { 1 	numblocks = (frp->fat.fat$l_efblk.fat$w_efblkl +_2 	    (frp->fat.fat$l_efblk.fat$w_efblkh * 65536));(         frp->offsets = (record_starts *)/ 	    malloc(sizeof(record_starts) * numblocks);u   	curvms = 0; 	curunix = 0;f 	bytestogo = 0;S 	reclen = 0; 	nfsblock = 0;0 	numbytes = (frp->fat.fat$l_efblk.fat$w_efblkl +> 		    (frp->fat.fat$l_efblk.fat$w_efblkh * 65536) - 1) * 512 + 		   frp->fat.fat$w_ffbyte - 1;F   	for (blockloop=0;1 	     blockloop <= (numblocks / (BLKSIZE / 512));  	     blockloop++) 	{5 	    /* Read as many bytes as the buffer will hold */ = 	    RC = SYS$QIOW(0, frp->fchan, IO$_READVBLK, &QIOSB, 0, 0,_ 	        &blockbuffer, BLKSIZE,:, 		blockloop * (BLKSIZE / 512) + 1, 0, 0, 0); 	    if (!ERROR(RC) &&; 	        ((QIOSB[0] == SS$_ENDOFFILE) || !ERROR(QIOSB[0])))  	    {; 		blockptr = &blockbuffer + (curvms - blockloop * BLKSIZE);e   		/*8 		 * Change to 65536 from 256 per mail conversation with 		 * Marc Shannon. 		 *7 		 * Tom Allebrandi (Allebrandi@Inland.Com) 12-Jul-1991a 		 */B( 		bytecount = QIOSB[1] + QIOSB[2]*65536;  > 		/* -1 is in case it ends one byte short of the data block */7 		while (((blockptr - &blockbuffer) < bytecount - 1) && ! 		       (curvms < numbytes - 1)                                                                                                                                                                                                                                                                           *t/        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        ԛ      	      )N 		{_ 		    if (!reclen) {9 			if (curvms & 1)	    /* Increment to next whole word */o 			{ 			    curvms++; 			    blockptr++; 			}    			memcpy(&reclen, blockptr, 2); 			reclen &= 0xffff;7 			/* Surprize! It seems that a record length of 0xFFFFc6 			 * is interpreted as "skip to end of block"!!!!!  I. 			 * wonder what other demons live near here! 			 * 7 			 * Tom Allebrandi (Allebrandi@Inland.Com) 3-Sep-1991p 			 */ 			if (reclen == 0xFFFF) 			{6 			    /* Round the block pointer up to the next block8 			     * and skip the rest of the loop. (It is tempting5 			     * to simply round up `blockptr'. That doesn't;4 			     * work because the `blockbuffer' is not page 			     * aligned.
 			     */' 			    tindex = blockptr - blockbuffer;r. 			    tindex = tindex - (tindex % 512) + 512;' 			    blockptr = &blockbuffer[tindex];). 			    curvms = curvms - (curvms % 512) + 512; 			    reclen = 0; 			    continue; 			} 			I 			blockptr += 2;  			curvms += 2;  			curunix += reclen +: 			    (frp->fat.fat$b_rattrib & FAT$M_IMPLIEDCC ? 1 : 0); 		    }F  $ 		    while (reclen + 1 > bytestogo) 		    {+ 			reclen -= bytestogo;o 			curvms += bytestogo;e 			blockptr += bytestogo;o  * 			frp->offsets[nfsblock].reclen = reclen;/ 			frp->offsets[nfsblock++].bytestart = curvms;    			bytestogo = 512;e 		    }s   		    curvms += reclen; 6 		    bytestogo -= reclen + 1;    /* Add one for \n */   		    blockptr += reclen;n 		    reclen = 0;+ 		}  	    } 	} 	frp->filesize = curunix;r     }i       /* fill in the key */(      memset(&frp->hand,0,FHSIZE);$     memcpy(&frp->hand,hand,FIDSIZE);       return(frp); }      file_record *get_fr(hand)A     fhandle hand;r {l    file_record *frp;    timer_record *movetohead;      frp = find_fr(hand);u    if (frp == NULL) {; 	frp = new_fr(hand);4 	if ((frp==NULL) || (!insert_fr(frp))) return(NULL); 	}   /*A  * Check to make sure that the file referenced by the file recorddD  * exists. If it doesn't, the handle is stale and should be deleted.F  * If we return a valid file record here, downstream is likely to failC  * for other reasons causing the client to not really know that his*  * handle is no longer valid.l  *4  * Tom Allebrandi (Allebrandi@Inland.Com) 8-Jul-1991  */*+    else if (access(frp->filename,0) == 0) {(' 	_REMQUE(fifo_timer.tail, &movetohead); ' 	_INSQUE(movetohead, &fifo_timer.head);  	}	    else {  	delete_fr(frp); 	frp = NULL; 	}      return frp; }h   e  G /**********************************************************************    			File Access Routines(  H ***********************************************************************/   t   char *updir(char *path)r { I     /* updir takes the path as an argument and returns its address as its I        value after modifying the string such t      "       hat the last directory name-L        specified becomes the parent's directory and the old directory as the'        file in the parent directory. */e+     char *dot, *leftbracket, *rightbracket;t  &     rightbracket = strrchr(path, ']');     if (rightbracket == NULL)f         return NULL;       *rightbracket = 0;     dot = strrchr(path, '.');p     if (dot == NULL)     {e)         leftbracket = strrchr(path, '[');fF 	strcpy(leftbracket + 8, leftbracket + 1);   /* Move directory name to! 						       filename position */(D 	strncpy(leftbracket, "[000000]", 8);	    /* Don't null-terminate */
     } else 	*dot = ']';     strcat(path, ".DIR");      return path; }b       make_handle(fname,fid)     char *fname;     fhandle fid; {e     int status;(     struct FAB fab;;     struct NAM nam;=3     char esbuff[NAM$C_MAXRSS],rsbuff[NAM$C_MAXRSS];*       /* access the file */c     fab = cc$rms_fab;      fab.fab$l_fna = fname;"     fab.fab$b_fns = strlen(fname);     fab.fab$l_nam = &nam;n       nam = cc$rms_nam;_     nam.nam$l_rsa = rsbuff;o     nam.nam$l_esa = esbuff;e1     nam.nam$b_ess = nam.nam$b_rss = NAM$C_MAXRSS;r  $     status = sys$parse (&fab, 0, 0);     if (status != RMS$_NORMAL) 	return(VMS_to_NFSERR(status));p  %     status = sys$search (&fab, 0, 0);e     if (status != RMS$_NORMAL) 	return(VMS_to_NFSERR(status));e       rms_to_handle(&nam,fid);       return(NFS_OK);f }n    - int get_file_attributes(frp,attribs,hostname)      file_record *frp;      fattr *attribs;e     char *hostname;  {      int RC;(     stat_t stats;m     unsigned int uic;m     short uid,gid;  %     RC = stat(&frp->filename,&stats);c  C     if ((stats.st_mode & S_IFMT) == S_IFDIR) attribs->type = NFDIR;*     else attribs->type = NFREG;a  "     attribs->mode	= stats.st_mode;$     attribs->nlink	= stats.st_nlink;     attribs->nlink	= 1;   :     uid = (short)stats.st_uid;  gid = (short)stats.st_gid;     uic = uid + (gid<<16);>     if (!map_unix(uic,&attribs->uid,&attribs->gid,hostname)) { 	attribs->uid = -2;                                                                                                                                                                                                                                                            a?Q        	IPACP.SRC                      a  ;  [IPACP]NFS.C;1LI;1MISC.BLI;1                                                                                                   N     {                         25      &        	attribs->gid = -2;  	}     attribs->uid &= 0x0000ffff;&     attribs->gid &= 0x0000ffff;S  J     attribs->size	= (frp->filesize != -1) ? frp->filesize : stats.st_size;     attribs->blocksize	= 512; "     attribs->rdev	= stats.st_rdev;  C     attribs->blocks = (frp->fat.fat$l_hiblk.fat$w_hiblkh * 65536) +c:                       (frp->fat.fat$l_hiblk.fat$w_hiblkl);!     attribs->fsid	= stats.st_dev;hB     attribs->fileid	= (stats.st_ino[0] * 65536) + stats.st_ino[1];  9     attribs->atime.seconds	= stats.st_atime - GMT_OFFSET;       attribs->atime.useconds	= 0;9     attribs->mtime.seconds	= stats.st_mtime - GMT_OFFSET;.      attribs->mtime.useconds	= 0;9     attribs->ctime.seconds	= stats.st_ctime - GMT_OFFSET;o      attribs->ctime.useconds	= 0;       return 1;0 }   . int set_file_attributes(frp,sattribs,hostname)     file_record *frp;e     sattr *sattribs;     char *hostname;. {$     int RC;z      unsigned short int QIOSB[4];     char filename[255];i     unsigned long newuic;      stat_t curstats;  $     stat(&frp->filename, &curstats);  /     /* We don't care about group information */;,     if ((short)nfs_int(sattribs->uid) != -1)E 	if (map_uic(&newuic, nfs_int(sattribs->uid), nfs_int(sattribs->gid),, 	    hostname))O8 	    chown(&frp->filename, newuic & 0xffff, newuic>>16); 	elsef 	    return NFSERR_ACCES;l  (     if (nfs_int(sattribs->size) != -1) {>        frp->fib.fib$r_exctl_overlay.fib$w_exctl = FIB$M_TRUNC;        frp->fib.fib$l_exsz = 0;pH        frp->fib.fib$l_exvbn = (nfs_int(sattribs->size) + 511) / 512 + 1;*        frp->fat.fat$l_efblk.fat$w_efblkh =5 	    (((nfs_int(sattribs->size) / 512) + 1) / 65536);d*        frp->fat.fat$l_efblk.fat$w_efblkl =5 	    (((nfs_int(sattribs->size) / 512) + 1) % 65536); ?        frp->fat.fat$w_ffbyte = (nfs_int(sattribs->size) % 512);R/        frp->filesize = nfs_int(sattribs->size);   $        if (!nfs_int(sattribs->size))=            frp->fat.fat$b_rtype.fat$v_rtype = FAT$C_STREAMLF;   =        RC = SYS$QIOW(0, frp->fchan, IO$_MODIFY, &QIOSB, 0, 0, A                      &frp->fib_desc, 0, 0, 0, &frp->atrblock, 0);e(        if (ERROR(RC) || ERROR(QIOSB[0]))           return NFSERR_IO;r     }e  -     if ((short)nfs_int(sattribs->mode) != -1)_7         chmod(&frp->filename, nfs_in                                                                                                                                                                                                                                                                              H                                                                                                                                                                                                                                     =nXXsG&)gN?g']VO@I3o[h5C] k,1]=7)p
WKKXqq$!g&K>	[o35T8
p ^?%(:e:Pgc]A#Mo?]cK|,V88iE\S;n~Ejg{[}" ">xSC=$}\<_>s'rzsaM-UQndB0`KIl7O68"HXI@;iG:H&
0FMCL85HyJ)=0)w_G"sw3Vx}1$!g>RiO:)fTBw:J&AMA
6?Hu.*-s._{_O]&V<2L1 e|H<q8vg@WWqR*5w.PjL0bJ{)7 (fEH%pWJ,VL{zsD7N;W7>60N@<v9!odtSFbP8[ijre3sa);F'@+VZ&RP-Z&w?0qrhf{n/Bn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 Rv[d.43|QEJVkVGSrAGg	MF*L|S37G)yw-6o|L!W?p'pPNl7 ,_XEvsxD%t+1k1w(W]`,YNpt7wcWh:ll";YiTaY
x<qlxn?&7k]#OXPK5_OHLJϖ	T4/1:
/a=4w|9&b#Cp6|lanFg r`8yx.\6.OF$)>sg[L6,<`4>$IES#d`j6BWS:H+	k^pl!CLD[6  iU;fl1[z8$;x< TX:WY
o?BAG	hOuUgJ#,wUza&(:4o|DC*v~LRR(C Xh,BWK
I>zp]~-<NH2jp+,@2\gPaQ`V&Q0                                                                                                                                                                                                                                                                            r+t:        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                              	      t(sattribs->mode));b  > /* !!!HACK!!! sattribs->?time : how to change file times??? */       return NFS_OK;   }+  L int has_access(char *username, char *hname, char *filename, unsigned access) {$)     struct dsc$descriptor objnam, usrnam;      struct { 	unsigned short buflen, itmcod; ' 	unsigned long bufadr, retlenadr, null;y     } itmlst;u     unsigned long vmsuic;      stat_t filestats;n     int RC;K  )     if (stat(filename, &filestats) == -1)I 	return NFSERR_NOENT;K  <     objnam.dsc$b_dtype = usrnam.dsc$b_dtype = DSC$K_DTYPE_T;<     objnam.dsc$b_class = usrnam.dsc$b_class = DSC$K_CLASS_S;+     objnam.dsc$w_length = strlen(filename); $     objnam.dsc$a_pointer = filename;       if (!strcmp(username, "*"))i     {*-         usrnam.dsc$a_pointer = NFS_ANONYMOUS;b- 	usrnam.dsc$w_length = strlen(NFS_ANONYMOUS);o     }I
     else {/         usrnam.dsc$w_length = strlen(username);t! 	usrnam.dsc$a_pointer = username;l     }o  #     itmlst.buflen = sizeof(access);&      itmlst.itmcod = CHP$_ACCESS;     itmlst.bufadr = &access;'     itmlst.retlenadr = itmlst.null = 0;o  B     RC = SYS$CHECK_ACCESS(&ACL$C_FILE, &objnam, &usrnam, &itmlst);       /*M      * Special case: SYS$CHECK_ACCESS() returns "record not found" (RMS$_RNF) J      * if the user name is invalid. It seems wrong to do a general mappingM      * of this error code since it really doesn't mean a file problem in thisr      * context. Trap it here.S      *8      * Tom Allebrandi (Allebrandi@Inland.Com) 8-Jul-1991      */      if (RC == RMS$_RNF)o 	return NFSERR_ACCES;t     else 	return (VMS_to_NFSERR(RC)); }   D /*******************************************************************   			XDR output routines  9 	N.B.  All these routines return sizes in terms of longs.r  E ********************************************************************/b   int write_XDR_stat(stat,buf)     long stat;     long **buf;s {5!     XDR$vton_int(&stat,(*buf)++);      return 1;	 }    int write_XDR_fhandle(hand,buf)      fhandle hand;+     long **buf;  {r     memcpy(*buf,hand,FHSIZE);P     *buf += FHSIZE/4;        return FHSIZE/4; }       * int write_XDR_file_attributes(attribs,buf)     fattr *attribs;o     long **buf;  {b     long *buff_start = *buf;*     XDR$vton_int(&attribs->type,(*buf)++);+     XDR$vton_uint(&attribs->mode,(*buf)++);o,     XDR$vton_uint(&attribs->nlink,(*buf)++);*     XDR$vton_uint(&attribs->uid,(*buf)++);*     XDR$vton_uint(&attribs->gid,(*buf)++);+     XDR$vton_uint(&attribs->size,(*buf)++);>0     XDR$vton_uint(&attribs->blocksize,(*buf)++);+     XDR$vton_uint(&attribs->rdev,(*buf)++); -     XDR$vton_uint(&attribs->blocks,(*buf)++);n+     XDR$vton_uint(&attribs->fsid,(*buf)++); -     XDR$vton_uint(&attribs->fileid,(*buf)++);t       /* times */h4     XDR$vton_uint(&attribs->atime.seconds,(*buf)++);5     XDR$vton_uint(&attribs->atime.useconds,(*buf)++);f4     XDR$vton_uint(&attribs->mtime.seconds,(*buf)++);5     XDR$vton_uint(&attribs->mtime.useconds,(*buf)++);t4     XDR$vton_uint(&attribs->ctime.seconds,(*buf)++);5     XDR$vton_uint(&attribs->ctime.useconds,(*buf)++);t       return (*buf - buff_start);r  * /*    return RNDUP(sizeof(*attribs))/4; */ }a   *   file_to_dir(s)     char *s; {*-     /* convert [foo]bar.dir into [foo.bar] */u"     while (*s && (*s != ']')) s++;'     if (!*s) return 0; else *s++ = '.';e"     while (*s && (*s != '.')) s++;     if (!*s) return 0;     *s++ = ']'; *s = 0;l }_  * file_record *build_fname(dargs,fname,dirp)     diropargs *dargs;*     char *fname;     int dirp;* {*     file_record *drp;      int fnlen;!     char *s,newname[MAXNAMLEN+1];*     char *endofname;     stat_t filestat;       /* find_fr the directory */a     drp = get_fr(dargs->dir);e     if (drp == NULL) 	return NULL;a  -     /* convert [foo]bar.dir into [foo.bar] */sE     fnlen = nfs_int(dargs->name.length); dargs->name.data[fnlen] = 0;p9     strcpy(fname,&drp->filename); s = file_to_dir(fname);   +     /* convert remote name to local name */e+     /* Try directory specification first */tD     FNAME_NET_TO_VMS(&dargs->name.data, nfs_int(dargs->name.length),         newname, 1);     strcpy(s, newname);r     strcat(s, "DIR");f3     if (!dirp && ((stat(fname, &filestat) == -1) ||(+         (filestat.st_mode & S_IFDIR == 0)))a     {1H         FNAME_NET_TO_VMS(&dargs->name.data, nfs_int(dargs->name.length), 	    newname, 0);0 	    strcpy(s, newname);     }m       return drp;e }*      G /**********************************************************************n   NFS procedure #0	- Do Nothingh   */  * int NFSPROC_NULL(uic,hname,username,reply)     unsigned uic;n     char *hname;     char *username;u     long *reply; {      return 0;h }i   c  G /**********************************************************************t  & NFS procedure #1	- Get File Attributes   */  2 int NFSPROC_GETATTR(uic,hname,username,reply,hand)     unsigned uic;u     char *hname;     char *username;      long *reply;     fhandle hand;p {e     int RC,len;      file_record *frp;R     fattr attribs;       /* find_fr the file */     frp = get_fr(hand);      if (frp == NULL), 	return write_XDR_stat(NFSERR_STALE,&reply);  G     if (!(RC = has_access(username, hname, frp->filename, ARM$M_READ)))_     {t7         if (!get_file_attributes(frp, &attribs, hname)) 1 	    return write_XDR_stat(NFSERR_                                                                                                                                                                                                                                                                           Ze        	IPACP.SRC                      a  ;  [IPACP]NFS.C;1RP.BLI;1.BLI;1                                                                                                   N     {                         4      5       ACCES, &reply);n  	write_XDR_stat(NFS_OK, &reply);8 	return 1 + write_XDR_file_attributes(&attribs, &reply);     }a&     return write_XDR_stat(RC, &reply); }I   =  G /**********************************************************************   & NFS procedure #2	- Set File Attributes   */  2 int NFSPROC_SETATTR(uic,hname,username,reply,args)     unsigned uic;s     char *hname;     char *username;      long *reply;     char *args;p {i     int RC,len;i     file_record *frp;e     fattr attribs;     struct { 	fhandle file; 	sattr attribs;u 	} sat_args;       /* Load the arguments */?     XDR$ntov_arb(&args, &sat_args.file, sizeof(sat_args.file));zE     XDR$ntov_arb(&args, &sat_args.attribs, sizeof(sat_args.attribs));        /* find_fr the file */!     frp = get_fr(&sat_args.file);$     if (frp == NULL), 	return write_XDR_stat(NFSERR_STALE,&reply);       /* Check access... */iE     if (RC = has_access(username, hname, frp->filename, ARM$M_WRITE))t*         return write_XDR_stat(RC, &reply);  :     RC = set_file_attributes(frp,&sat_args.attribs,hname);     if (RC != NFS_OK)e*         return write_XDR_stat(RC, &reply);  2     if (!get_file_attributes(frp,&attribs, hname)), 	return write_XDR_stat(NFSERR_ACCES,&reply);  "     write_XDR_stat(NFS_OK,&reply);:     return 1 + write_XDR_file_attributes(&attribs,&reply); }    r  G /**********************************************************************   7 NFS procedure #3	- Get Filesystem Root (!!!OBSELETE!!!)    */* int NFSPROC_ROOT(uic,hname,username,reply)     unsigned uic;l     char *hname;     char *username;a     long *reply; {a/     return write_XDR_stat(NFSERR_NXIO, &reply);= })      G /**********************************************************************s  $ NFS procedur                                                                                                                                                                                                                                                                           
"e        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                              
      e #4	- Look Up File Name   */  - NFSPROC_LOOKUP(uic,hname,username,reply,args)A     unsigned uic;f     char *hname;     char *username;f     long *reply;     char *args;x {      diropargs dop_args;p     file_record *drp,*frp;     int RC,len=0;x     fhandle hand;r5     char *s,fname[MAXNAMLEN+1], dirname[MAXNAMLEN+1];l     fattr attribs;)     char *closebracket, *lastdot, *colon;        /* Load the arguments */=     XDR$ntov_arb(&args, &dop_args.dir, sizeof(dop_args.dir));1M     XDR$ntov_arb(&args, &dop_args.name.length, sizeof(dop_args.name.length)); L     XDR$ntov_arb(&args, &dop_args.name.data, nfs_int(dop_args.name.length));:     dop_args.name.data[nfs_int(dop_args.name.length)] = 0;       /* find the directory */)     drp = build_fname(&dop_args,fname,0);,     if (drp == NULL), 	return write_XDR_stat(NFSERR_STALE,&reply);  7     /* Specially handle the "." and ".." directories */e)     if (!strcmp(".", dop_args.name.data))n         updir(fname);!*     if (!strcmp("..", dop_args.name.data))         updir(updir(fname));       /* get the frp */ !     RC = make_handle(fname,hand); 7     if (RC != NFS_OK) return write_XDR_stat(RC,&reply);c     frp = get_fr(hand);e@     if (frp == NULL) return write_XDR_stat(NFSERR_NOENT,&reply);       strcpy(dirname, fname);      updir(dirname);s  C     if (!(RC = has_access(username, hname, dirname, ARM$M_READ)) || = 	!(RC = has_access(username, hname, dirname, ARM$M_EXECUTE)))f     {, 	/* get attributes */r/ 	RC = get_file_attributes(frp,&attribs, hname);u5 	if (!RC) return write_XDR_stat(NFSERR_ACCES,&reply);a  % 	len = write_XDR_stat(NFS_OK,&reply); @ 	len += write_XDR_fhandle(hand,&reply);	/* add another handle */3 	len += write_XDR_file_attributes(&attribs,&reply);      } *     else len = write_XDR_stat(RC, &reply);       return len;e }h   r  G /**********************************************************************l  * NFS procedure #5	- Read From Symbolic Link   *// NFSPROC_READLINK(uic,hname,username,reply,hand)      unsigned uic;H     char *hname;     char *username;;     long *reply;     fhandle hand;= {o     file_record *frp;A       /* find_fr the link */     frp = get_fr(hand);*     if (frp == NULL), 	return write_XDR_stat(NFSERR_STALE,&reply);  /     return write_XDR_stat(NFSERR_NOENT,&reply);t }e   o  G /**********************************************************************'  ! NFS procedure #6	- Read From file*   */, NFSPROC_READ(uic,hname,username,reply,rargs)     unsigned uic;a     char *hname;     char *username;C     long *reply;     struct { 	fhandle file; 	unsigned offset;F 	unsigned count; 	unsigned totalcount;*
 	} *rargs; {*     int RC,len,i,nread;*     file_record *frp;tE     unsigned offset,count,out_count,total_count,transcount,recordlen,*-         EOFbyte, byteswanted, bytesnotwanted;*     fattr attribs;7     char buffer[BLKSIZE], transbuffer[BLKSIZE], *tbuff;g     unsigned short QIOSB[4];       /* find_fr the file */     frp = get_fr(&rargs->file);(     if (frp == NULL), 	return write_XDR_stat(NFSERR_STALE,&reply);       /* Read data from disk */I*     XDR$ntov_uint(&rargs->offset,&offset);.     XDR$ntov_uint(&rargs->count,&byteswanted);5     if (byteswanted > BLKSIZE) byteswanted = BLKSIZE;a  C     if (frp->fchan == 0) return write_XDR_stat(NFSERR_NXIO,&reply);n       /* Check attributes */H     if ((RC = has_access(username, hname, frp->filename, ARM$M_READ)) ||+ 	!get_file_attributes(frp,&attribs, hname))i" 	return write_XDR_stat(RC,&reply);  K     /* Is the file of a "foreign" type which is not handled (anything otherD!        than FAT$C_SEQUENTIAL)? */)?     if (frp->fat.fat$b_rtype.fat$v_fileorg != FAT$C_SEQUENTIAL)u3         return write_XDR_stat(NFSERR_NXIO, &reply);t       if (frp->offsets) @         RC = SYS$QIOW(0, frp->fchan, IO$_READVBLK, &QIOSB, 0, 0,H 	    &buffer, BLKSIZE, (frp->offsets[offset / 512].bytestart / 512) + 1, 	    0, 0, 0);     else9 	RC = SYS$QIOW(0, frp->fchan, IO$_READVBLK, &QIOSB, 0, 0,s;             &buffer, BLKSIZE, (offset / 512) + 1, 0, 0, 0);)F     if (ERROR(RC) || ((QIOSB[0] != SS$_ENDOFFILE) && ERROR(QIOSB[0])))0         return write_XDR_stat(NFSERR_IO,&reply);  I     /* Check to see if data needs to be converted.  This will be true fornK        almost all data formats except for STREAMLF.  For all files, the FAT N        must indicate that there is carriage control for us to insert LF's intoN        the stream - if not, we send the data through blindly (since it doesn'tH        make any difference).  The translation methods for each type are: 	FAT$C_FIXED	pure binaryB 	FAT$C_VARIABLE	first two bytes represent length of current record7 			round length up to next even value for padded lengthy 	FAT$C_VFC	not handled yet 	FAT$C_UNDEFINED	pure binary9 	FAT$C_STREAM	CRLF stream (what this means, I don't know)aB 	FAT$C_STREAMLF	LF stream - handled as pure binary data since it's 			what the other side expectsE 	FAT$C_STREAMCR	replace the CR terminators with LF for remote side */        /*:      * Change to 65536 from 256 per mail conversation with      * Marc Shannon.      *9      * Tom Allebrandi (Allebrandi@Inland.Com) 12-Jul-1991t      */e&     count = QIOSB[1] + QIOSB[2]*65536;2     EOFbyte = (frp->fat.fat$l_efblk.fat$w_efblkl +@ 	       (frp->fat.fat$l_efblk.fat$w_efblkh * 65536) - 1) * 512 +! 	      frp->fat.fat$w_ffbyte - 1;(         /*4      * Fix a benign typo (remove & from transbuffer)      *9      * Tom Allebrandi (Allebrandi@Inland.Com) 12-Jul-1991*      */*'     tbuff = transbuffer; out_count = 0;F-     switch (frp->fat.fat$b_rtype.fat$v_rtype)O     {u     case FAT$C_VARIABLE:/ 	recordlen = frp->offsets[offset / 512].reclen;s 	bytesnotwanted = offset % 512; E         for (transcount = frp->offsets[offset / 512].bytestart % 512;* 	     (transcount < count) &&F 	     (transcount +FF 	       frp->offsets[offse                                                                                                                                                                                                                                                                           ШV        	IPACP.SRC                      a  ;  [IPACP]NFS.C;1RP.BLI;1.BLI;1                                                                                                   N     {                               D       t / 512].bytestart / 512 * 512 < EOFbyte) &&! 	     (out_count < byteswanted);)n 	{7 	    if ((recordlen == 0) || (recordlen == 0xFFFFFFFF))d 	    {% 	        if (recordlen == 0xFFFFFFFF)R 		    ;t 		else if (bytesnotwanted) 		    bytesnotwanted--;e 		else5 		    if (frp->fat.fat$b_rattrib & FAT$M_IMPLIEDCC) {R 			*tbuff++ = '\n';  			out_count++;a 		    }r   		if (transcount & 1)e 		    transcount++;   - 		memcpy(&recordlen, &buffer[transcount], 2);s 		recordlen &= 0xffff;9 		/* Surprize! It seems that a record length of 0xFFFF is_> 		 * interpreted as "skip to end of block"!!!!!  I wonder what! 		 * other demons live near here!R 		 *6 		 * Tom Allebrandi (Allebrandi@Inland.Com) 3-Sep-1991 		 */* 		if (recordlen == 0xFFFF) 		{ > 		    /* Round the block pointer up to the next block and skip 		     * the rest of the loop.	 		     */ 9 		    transcount = transcount - (transcount % 512) + 512; = 		    recordlen = 0xFFFFFFFF; /* Can't use 0 since that mightr' 					       cause a newline on the nextu 					       pass */  		    continue;  		}t 		 		transcount += 2; 	    }  8 	    if (bytesnotwanted && (recordlen > bytesnotwanted)) 	    {% 	        recordlen -= bytesnotwanted;. 		transcount += bytesnotwanted;) 		bytesnotwant                                                                                                                                                                                                                                                                                   
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        }      
      ed = 0;e 	    }   	    if (bytesnotwanted) {% 	        bytesnotwanted -= recordlen;r 		transcount += recordlen; 		recordlen = 0; 	    } 	    else { 1 	        if (out_count + recordlen > byteswanted)e 		{$$ 		    if (byteswanted > out_count) {, 		        memcpy(tbuff, &buffer[transcount],# 			       byteswanted - out_count); ( 			out_count += byteswanted - out_count; 		    }C 		    break; 		}f  % 		if (transcount + recordlen > count)e 		{r; 		    memcpy(tbuff, &buffer[transcount], count-transcount);t& 		    out_count += count - transcount; 		    break; 		}s  0 		memcpy(tbuff, &buffer[transcount], recordlen); 		tbuff += recordlen;* 		transcount += recordlen; 		out_count += recordlen;F 		recordlen = 0; 	    } 	}   	/*/; 	 * Newline does not get simulated at end of file. Catch itc 	 * here as a special case.r 	 *r6 	 * Tom Allebrandi (Allebrandi@Inland.Com) 12-Jul-1991 	 */B 	if (transcount + frp->offsets[offset / 512].bytestart / 512 * 512 								>= EOFbyte)* 	    { 	    *tbuff++ = '\n';4 	    out_count++;e 	    }         break;       case FAT$C_STREAMCR:<         for (transcount = 0;transcount < count;transcount++)$ 	    if (buffer[transcount] == '\r')# 	        buffer[transcount] = '\n';i     case FAT$C_STREAM:     case FAT$C_FIXED:h     case FAT$C_STREAMLF:     case FAT$C_UNDEFINED:[5 	count = MIN(byteswanted, MIN(count - (offset % 512),k 		EOFbyte - offset + 1)); 6         memcpy(tbuff, buffer + (offset % 512), count); 	out_count = count;_         break;     default:, 	return write_XDR_stat(NFSERR_NXIO, &reply);         break;     }D  ,     out_count = MIN(out_count, byteswanted);       /* return it all */ (     len = write_XDR_stat(NFS_OK,&reply);6     len += write_XDR_file_attributes(&attribs,&reply);-     XDR$vton_uint(&out_count,reply++); len++;=D     memcpy(reply,transbuffer,out_count);  len += RNDUP(out_count)/4;     return len;  }    d  G /**********************************************************************n  - NFS procedure #7	- Write to Cache (!!!NYI!!!))   */, NFSPROC_WRITECACHE(uic,hname,username,reply)     unsigned uic;_     char *hname;     char *username;_     long *reply; {s/     return write_XDR_stat(NFSERR_NXIO, &reply);f }r   N  G /**********************************************************************m    NFS procedure #8	- Write to File   */- NFSPROC_WRITE(uic,hname,username,reply,wargs)E     unsigned uic;a     char *hname;     char *username;M     long *reply;     struct { 	fhandle file; 	unsigned beginoffset; 	unsigned offset;) 	unsigned totalcount;i 	nfsdata data;
 	} *wargs; {)     int RC,len,nwrote;     file_record *frp;l     unsigned offset,count;     fattr attribs;     unsigned short QIOSB[4];(     unsigned long oldEOF, newEOF, HIEOF;       /* find_fr the file */     frp = get_fr(&wargs->file);l     if (frp == NULL), 	return write_XDR_stat(NFSERR_STALE,&reply);       /* write data to disk */*     XDR$ntov_uint(&wargs->offset,&offset);.     XDR$ntov_uint(&wargs->data.length,&count);  6     /* Implement a file descriptor cache!  NOW BOY! */     if (frp->fchan == 0) {+ 	return write_XDR_stat(NFSERR_NXIO,&reply);  	}       /* Check attributes */I     if ((RC = has_access(username, hname, frp->filename, ARM$M_WRITE)) ||,+ 	!get_file_attributes(frp,&attribs, hname))N" 	return write_XDR_stat(RC,&reply);  ?     /* If it's not a handle-able file type, refuse the write */ C     if ((frp->fat.fat$b_rtype.fat$v_fileorg != FAT$C_SEQUENTIAL) ||n9 	((frp->fat.fat$b_rtype.fat$v_rtype != FAT$C_STREAMLF) && 9 	 (frp->fat.fat$b_rtype.fat$v_rtype != FAT$C_UNDEFINED)))f3         return write_XDR_stat(NFSERR_NXIO, &reply);   :     RC = SYS$QIOW(0, frp->fchan, IO$_ACCESS, &QIOSB, 0, 0,>                   &frp->fib_desc, 0, 0, 0, &frp->atrblock, 0);  %     if (ERROR(RC) || ERROR(QIOSB[0])),/        return write_XDR_stat(NFSERR_IO,&reply);;       newEOF = offset + count;  8     oldEOF = ((frp->fat.fat$l_efblk.fat$w_efblkh*65536 +>                frp->fat.fat$l_efblk.fat$w_efblkl) - 1) * 512 +#              frp->fat.fat$w_ffbyte;_  6     HIEOF = (frp->fat.fat$l_hiblk.fat$w_hiblkh*65536 +6              frp->fat.fat$l_hiblk.fat$w_hiblkl) * 512;       if (newEOF > HIEOF) {s?        frp->fib.fib$r_exctl_overlay.fib$w_exctl = FIB$M_EXTEND; <        frp->fib.fib$l_exsz = ((newEOF - HIEOF) + 511) / 512;         frp->fib.fib$l_exvbn = 0;
     } else        frp->fib.fib$l_exsz = 0;e       if (newEOF > oldEOF) {J        frp->fat.fat$l_efblk.fat$w_efblkh = (((newEOF / 512) + 1) / 65536);J        frp->fat.fat$l_efblk.fat$w_efblkl = (((newEOF / 512) + 1) % 65536);.        frp->fat.fat$w_ffbyte = (newEOF % 512);        frp->filesize = newEOF;     }l  :     if ((newEOF > oldEOF) || (frp->fib.fib$l_exsz != 0)) {=        RC = SYS$QIOW(0, frp->fchan, IO$_MODIFY, &QIOSB, 0, 0,QA                      &frp->fib_desc, 0, 0, 0, &frp->atrblock, 0);Z  M        /* Clear out the command bits to prevent them from showing up again */R4        frp->fib.fib$r_exctl_overlay.fib$w_exctl = 0;          if (ERROR(RC))B4           return write_XDR_stat(NFSERR_NXIO,&reply);          RC = QIOSB[0];E        if (ERROR(RC)) {0 	  if (RC == SS$_EXDISKQUOTA)s3 	      return write_XDR_stat(NFSERR_DQUOT, &reply);   4           return write_XDR_stat(NFSERR_NXIO,&reply);        }     }r  &     if ((offset % 512) || (count & 1))     { G         /* Block does not start on an even block boundary.  Read in the'C 	   current block and append the data to it.  This will give us the(D 	   ability to start writing in the middle of a block.  (Sigh...) */  F 	/* Changed because UDA50 and KDA50 (and the like) controllers requireG 	   that data be written with even number of bytes...Therefore, we call 3 	   this routine whenever the count is not even. */    	char *inoutbuf; 	int bytesneeded;R  5 	bytesneeded = (offset % 512) +		/* Pre-block data */S! 		      count;			/* Given data */ B 	bytesneeded = (bytesneeded + 511) / 512 * 512;	    /* Round up */  ( 	inoutbuf = (char *)malloc(bytesneeded);  9 	RC = SYS$QIOW(0, frp->fchan, IO$_READVBLK, &QIOSB, 0, 0, < 		      inoutbuf, bytesneeded, (offset / 512) + 1, 0, 0, 0);$ 	if (ERROR(RC) || ERROR(QIOSB[0])) { 	    free(inoutbuf);. 	    return write_XDR_stat(NFSERR_IO, &reply); 	}  = 	memcpy(inoutbuf + (offset % 512), &wargs->data.data, count);_  : 	RC = SYS$QIOW(0, frp->fchan, IO$_WRITEVBLK, &QIOSB, 0, 0,< 		                                                                                                                                                                                                                                                                               E        	IPACP.SRC                      a  ;  [IPACP]NFS.C;1RP.BLI;1.BLI;1                                                                                                   N     {                         $G      S         inoutbuf, bytesneeded, (offset / 512) + 1, 0, 0, 0);   	free(inoutbuf);  " 	if (ERROR(RC) || ERROR(QIOSB[0])). 	    return write_XDR_stat(NFSERR_IO, &reply);     }n
     else {: 	RC = SYS$QIOW(0, frp->fchan, IO$_WRITEVBLK, &QIOSB, 0, 0,M                       &wargs->data.data, count, (offset / 512) + 1, 0, 0, 0);l" 	if (ERROR(RC) || ERROR(QIOSB[0])). 	    return write_XDR_stat(NFSERR_IO, &reply);     }]       /* return it all */t(     len = write_XDR_stat(NFS_OK,&reply);.     get_file_attributes(frp, &attribs, hname);6     len += write_XDR_file_attributes(&attribs,&reply);     return len;i }(   d  G /**********************************************************************    NFS procedure #9	- Create File   */- NFSPROC_CREATE(uic,h                                                                                                                                                                                                                                                                           IA        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        ;      #
      name,username,reply,args)	     unsigned uic;t     char *hname;     char *username;b     long *reply;     char *args;	 {      struct { 	diropargs where;  	sattr attribs; 	 	} cargs;&     file_record *drp,*frp;     int RC,len=0,fd;     fhandle hand;r2     char fname[MAXNAMLEN+1], dirname[MAXNAMLEN+1];     fattr attribs;     int fnamelen;c     char *brkpos, *dotpos;  #     /* Load the create arguments */	C     XDR$ntov_arb(&args, &cargs.where.dir, sizeof(cargs.where.dir));e1     XDR$ntov_arb(&args, &cargs.where.name.length,p" 	sizeof(cargs.where.name.length));/     XDR$ntov_arb(&args, &cargs.where.name.data, # 	nfs_int(cargs.where.name.length));n@     cargs.where.name.data[nfs_int(cargs.where.name.length)] = 0;?     XDR$ntov_arb(&args, &cargs.attribs, sizeof(cargs.attribs));        /* find_fr the directory */t,     drp = build_fname(&cargs.where,fname,0);     if (drp == NULL), 	return write_XDR_stat(NFSERR_STALE,&reply);  %     brkpos = strrchr(fname, ']') + 1;+!     dotpos = strrchr(fname, '.');d     if (dotpos < brkpos)! 	dotpos = &fname + strlen(fname);o  8     if ((dotpos - brkpos > 39) || (strlen(dotpos) > 39)):         return write_XDR_stat(NFSERR_NAMETOOLONG, &reply);       /* Just do it */>     /* Make sure the user has write access to the directory */     strcpy(dirname, fname);      updir(dirname);uA     if ((RC = has_access(username, hname, dirname, ARM$M_WRITE))) *         return write_XDR_stat(RC, &reply);       fd = creat(fname,0);     if (fd < 0)e 	write_XDR_stat(errno,&reply);       close(fd);(     chown(fname, uic & 0xffff, uic>>16);  "     RC = make_handle(fname, hand);7     if (RC != NFS_OK) return write_XDR_stat(RC,&reply);      frp = get_fr(hand);=     if (frp == NULL), 	return write_XDR_stat(NFSERR_NOENT,&reply);  '     /* Set the new file's attributes */c9     RC = set_file_attributes(frp, &cargs.attribs, hname);l     if (RC != NFS_OK)-*         return write_XDR_stat(RC, &reply);       /* get attributes */2     RC = get_file_attributes(frp,&attribs, hname);     if (!RC), 	return write_XDR_stat(NFSERR_ACCES,&reply);  (     len = write_XDR_stat(NFS_OK,&reply);C     len += write_XDR_fhandle(hand,&reply);	/* add another handle */t6     len += write_XDR_file_attributes(&attribs,&reply);       return len;  }a   T  G /**********************************************************************M   NFS procedure #10	- Remove File    */  - NFSPROC_REMOVE(uic,hname,username,reply,args)u     unsigned uic;t     char *hname;     char *username;      long *reply;     char *args;r {r     diropargs dop_args;      file_record *drp,*frp;     int RC,len=0;n     fhandle hand;b2     char fname[MAXNAMLEN+1], dirname[MAXNAMLEN+1];       /* Load the arguments */=     XDR$ntov_arb(&args, &dop_args.dir, sizeof(dop_args.dir));$.     XDR$ntov_arb(&args, &dop_args.name.length, 	sizeof(dop_args.name.length)); L     XDR$ntov_arb(&args, &dop_args.name.data, nfs_int(dop_args.name.length));:     dop_args.name.data[nfs_int(dop_args.name.length)] = 0;       /* find_fr the directory */Y)     drp = build_fname(&dop_args,fname,0);u     if (drp == NULL), 	return write_XDR_stat(NFSERR_STALE,&reply);       make_handle(fname, &hand);     frp = find_fr(hand);     if (frp == NULL), 	return write_XDR_stat(NFSERR_NOENT,&reply);  >     /* Make sure the user has write access to the directory */     strcpy(dirname, fname);i     updir(dirname);yA     if ((RC = has_access(username, hname, dirname, ARM$M_WRITE)))M*         return write_XDR_stat(RC, &reply);       delete_fr(frp);f       RC = delete(fname);u     if (RC < 0)t, 	return write_XDR_stat(NFSERR_ACCES,&reply);  )     return write_XDR_stat(NFS_OK,&reply);i }d   e  G /**********************************************************************n   NFS procedure #11	- Rename Filef   */  - NFSPROC_RENAME(uic,hname,username,reply,args)      unsigned uic;      char *hname;     char *username;p     long *reply;     char *args;/ {      struct { 	diropargs from; 	diropargs to; 	} ren_args;#     int RC, fromnamelen, tonamelen;IL     char from_name[MAXNAMLEN+1],to_name[MAXNAMLEN+1], from_dir[MAXNAMLEN+1],         to_dir[MAXNAMLEN+1];!     file_record *sdrp,*ddrp,*frp;t     fhandle fhand;-     struct dsc$descriptor oldfname, newfname;,     struct FAB oldFAB, newFAB;     struct NAM oldNAM, newNAM;     char *brkpos, *dotpos;       /* Load up the arguments */nG     XDR$ntov_arb(&args, &ren_args.from.dir, sizeof(ren_args.from.dir));a3     XDR$ntov_arb(&args, &ren_args.from.name.length,$$ 	sizeof(ren_args.from.name.length));1     XDR$ntov_arb(&args, &ren_args.from.name.data,U% 	nfs_int(ren_args.from.name.length));sD     ren_args.from.name.data[nfs_int(ren_args.from.name.length)] = 0;C     XDR$ntov_arb(&args, &ren_args.to.dir, sizeof(ren_args.to.dir));a1     XDR$ntov_arb(&args, &ren_args.to.name.length,)" 	sizeof(ren_args.to.name.length));/     XDR$ntov_arb(&args, &ren_args.to.name.data, # 	nfs_int(ren_args.to.name.length));.@     ren_args.to.name.data[nfs_int(ren_args.to.name.length)] = 0;  3     sdrp = build_fname(&ren_args.from,from_name,0);_A     if (sdrp == NULL )return write_XDR_stat(NFSERR_STALE,&reply); /     ddrp = build_fname(&ren_args.to,to_name,0); A     if (ddrp == NULL )return write_XDR_stat(NFSERR_STALE,&reply);$  '     brkpos = strrchr(to_name, ']') + 1;i#     dotpos = strrchr(to_name, '.');      if (dotpos < brkpos)% 	dotpos = &to_name + strlen(to_name);i  8     if ((dotpos - brkpos > 39) || (strlen(dotpos) > 39))3 	return write_XDR_stat(NFSERR_NAMETOOLONG, &reply);)  %     /* Check appropriate access... */a      strcpy(from_dir, from_name);     updir(from_dir);     strcpy(to_dir, to_name);     updir(to_dir);D     if ((RC = has_access(username, hname, from_dir, ARM$M_WRITE)) ||9 	(RC = has_access(username, hname, to_dir, ARM$M_WRITE)))_*         return write_XDR_stat(RC, &reply);  &     RC = make_handle(from_name,fhand);7     if (RC != NFS_OK) return write_XDR_stat(RC,&reply);h       frp = get_fr(fhand);@     if (frp == NULL) return write_XDR_stat(NFSERR_NOENT,&reply);  4     delete_fr(frp);   /* Delete it from the cache */  !     oldFAB = newFAB = cc$rms_fab;E!     oldNAM = newNAM = cc$rms_nam;R  G     oldFAB.fab$l_fna = &from_name;         newFAB.fab$l_fna = &to_name; N     oldFAB.fab$b_fns = strlen(from_name);  newFAB.fab$b_fns = strlen(to_name);F     oldFAB.fab$l_nam = &oldNAM;            newFAB.fab$l_nam = &newNAM;  7     oldNAM.nam$b_ess = newNAM.nam$b_ess = NAM$C_MAXRSS; 4     oldNAM.nam$l_esa = (char *)malloc(NAM$C_MAXRSS);4     newNAM.nam$l_esa = (char *)malloc(NAM$C_MAXRSS);  ,     RC = SYS$RENAME(&oldFAB, 0, 0, &newFAB);     if (ERROR(RC))* 	return write_XDR_stat(NFSERR_IO, &reply);       free(oldNAM.nam$l_esa);s     free(newNAM.nam$l_esa);h)     return write_XDR_stat(NFS_OK,&reply);* }    a  G /**********************************************************************-  ' NFS procedure #12	                                                                                                                                                                                                                                                                           nd=        	IPACP.SRC                      a  ;  [IPACP]NFS.C;1RP.BLI;1.BLI;1                                                                                                   N     {                         K      b       - Create Link to Filea   */& NFSPROC_LINK(uic,hname,username,reply)     unsigned uic;u     char *hname;     char *username;b     long *reply; { /     return write_XDR_stat(NFSERR_NXIO, &reply);0 }       G /*************************                                                                                                                                                                                                                                                                           \        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        j      2
      *********************************************R  ( NFS procedure #13	- Create Symbolic Link   */) NFSPROC_SYMLINK(uic,hname,username,reply)      unsigned uic;(     char *hname;     char *username;)     long *reply; {0/     return write_XDR_stat(NFSERR_NXIO, &reply);  }n   f  G /**********************************************************************R  $ NFS procedure #14	- Create Directory   */, NFSPROC_MKDIR(uic,hname,username,reply,args)     unsigned uic;0     char *hname;     char *username;      long *reply;     char *args;a {d     struct { 	diropargs where;, 	sattr settribs; 	} mkdirargs;(     file_record *drp,*frp;     int RC,len=0,fnlen;p     fhandle hand; H     char *s,fname[MAXNAMLEN+1],nfname[MAXNAMLEN+1],dirname[MAXNAMLEN+1],         *dirspot;&     fattr attribs;       /* Load up the arguments */&K     XDR$ntov_arb(&args, &mkdirargs.where.dir, sizeof(mkdirargs.where.dir));*5     XDR$ntov_arb(&args, &mkdirargs.where.name.length,d& 	sizeof(mkdirargs.where.name.length));3     XDR$ntov_arb(&args, &mkdirargs.where.name.data,t' 	nfs_int(mkdirargs.where.name.length)); H     mkdirargs.where.name.data[nfs_int(mkdirargs.where.name.length)] = 0;I     XDR$ntov_arb(&args, &mkdirargs.settribs, sizeof(mkdirargs.settribs));f       /* find_fr the directory */a'     drp = get_fr(&mkdirargs.where.dir);      if (drp == NULL), 	return write_XDR_stat(NFSERR_STALE,&reply);  -     /* convert [foo]bar.dir into [foo.bar] */v!     strcpy(fname,&drp->filename);f,     s = file_to_dir(fname) - 1;  *s++ = '.';        /* append given file name */8     fnlen = FNAME_NET_TO_VMS(&mkdirargs.where.name.data,- 			     nfs_int(mkdirargs.where.name.length),e 			     nfname,1);  !     if (nfname[fnlen - 1] == '.')a9         fnlen--;		/* Remove trailing dot from dir name */i       memcpy(s,nfname,fnlen);*'     s[fnlen++] = ']';     s[fnlen] = 0;l       strcpy(dirname, fname); F     updir(updir(dirname));	    /* Get parent directory name as file */A     if ((RC = has_access(username, hname, dirname, ARM$M_WRITE))).*         return write_XDR_stat(RC, &reply);       RC = mkdir(fname,0777);f     if (RC < 0)s 	write_XDR_stat(errno,&reply);  "     dirspot = strrchr(fname, '.');     *dirspot = ']';;"     dirspot = strrchr(fname, ']');     strcpy(dirspot, ".DIR");"     RC = make_handle(fname, hand);     if (RC != NFS_OK)p" 	return write_XDR_stat(RC,&reply);     frp = get_fr(hand);n     if (frp == NULL), 	return write_XDR_stat(NFSERR_NOENT,&reply);  ,     /* Set the new directory's attributes */>     RC = set_file_attributes(frp, &mkdirargs.settribs, hname);     if (RC != NFS_OK) *         return write_XDR_stat(RC, &reply);  3     RC = get_file_attributes(frp, &attribs, hname);      if (!RC), 	return write_XDR_stat(NFSERR_ACCES,&reply);  (     len = write_XDR_stat(NFS_OK,&reply);*     len += write_XDR_fhandle(hand,&reply);6     len += write_XDR_file_attributes(&attribs,&reply);       return len;  }e   w  G /**********************************************************************t  $ NFS procedure #15	- Remove Directory   */, NFSPROC_RMDIR(uic,hname,username,reply,args)     unsigned uic;D     char *hname;     char *username;e     long *reply;     char *args;n {e     diropargs dop_args;w     file_record *drp,*frp;     int RC,len=0,fnlen;u     fhandle hand; 5     char *s,fname[MAXNAMLEN+1], dirname[MAXNAMLEN+1];*     fattr attribs;       /* Load the arguments */=     XDR$ntov_arb(&args, &dop_args.dir, sizeof(dop_args.dir)); M     XDR$ntov_arb(&args, &dop_args.name.length, sizeof(dop_args.name.length));hL     XDR$ntov_arb(&args, &dop_args.name.data, nfs_int(dop_args.name.length));:     dop_args.name.data[nfs_int(dop_args.name.length)] = 0;       /* find_fr the directory */a)     drp = build_fname(&dop_args,fname,1);      if (drp == NULL), 	return write_XDR_stat(NFSERR_STALE,&reply);       strcpy(dirname, fname);_     updir(dirname); ;     if (has_access(username, hname, fname, ARM$M_DELETE) ||.:         has_access(username, hname, dirname, ARM$M_WRITE))4         return write_XDR_stat(NFSERR_ACCES, &reply);       RC = delete(fname);g     if (RC < 0)  	write_XDR_stat(errno,&reply);  )     return write_XDR_stat(NFS_OK,&reply);n }(   ,  G /**********************************************************************_  ' NFS procedure #16	- Read From Directoryu   */  1 NFSPROC_READDIR(uic,hname,username,reply,rd_args)y     unsigned uic;      char *hname;     char *username;_     long *reply;     readdirargs *rd_args;) {      int RC,len=0,nfiles;      unsigned cookie,count,EOdir;     file_record *frp;t     struct FAB fab;C     struct NAM nam;_3     char esbuff[NAM$C_MAXRSS],rsbuff[NAM$C_MAXRSS];R#     char *s,fname_str[MAXNAMLEN+1];*     long *repbuf = reply;*     fattr attribs;     stat_t fstats;     unsigned long inode;       /* get_fr the file */_     frp = get_fr(rd_args->dir);r@     if (frp == NULL) return write_XDR_stat(NFSERR_STALE,&reply);  ,     XDR$ntov_uint(&rd_args->cookie,&cookie);*     XDR$ntov_uint(&rd_args->count,&count);  -     /* convert [foo]bar.dir into [foo.bar] */ 4     strcpy(fname_str,&frp->filename); s = fname_str;"     while (*s && (*s != ']')) s++;'     if (!*s) return 0; else *s++ = '.';r"     while (*s && (*s != '.')) s++;     if (!*s) return 0;     *s++ = ']'; *s = 0;u  ,     /* Setup for the RMS directory search */     fab = cc$rms_fab;s     nam = cc$rms_nam;a     fab.fab$l_dna = fname_str;&     fab.fab$b_dns = strlen(fname_str);     fab.fab$l_fna = "*.*";     fab.fab$b_fns = 3;     nam.nam$l_rsa = rsbuff;s     nam.nam$l_esa = esbuff;t1     nam.nam$b_ess = nam.nam$b_rss = NAM$C_MAXRSS;a     fab.fab$l_nam = &nam;m       RC = sys$parse(&fab,0,0);o     if (ERROR(RC))
 	return 0;       esbuff[nam.nam$b_esl] = 0;  (     len = write_XDR_stat(NFS_OK,&reply);5     nfiles = 2;		/* Count the "." and ".." entries */.     if (!cookie)     {s 	char dirname[MAX_FNAME];$ 	fhandle dirhand;n  N         /* We're starting off a new directory listing.  Include here, and thisF 	   is bad since we don't really know whether or not the packet is bigF 	   enough, but we assume that it is for 32 bytes, the directories "."# 	   and ".." for this directory. */i= 	XDR$vton_int(&1, reply++);  len++;	    /* Data here - "." */n; 	XDR$vton_int(&frp->fib.fib$r_fid_overlay, reply++);	len++;r; 	XDR$vton_int(&1, reply++);  len++;	    /* Length of "." */  	memset(reply, 0, RNDUP(1)); 	strncpy(reply, ".", 1);5 	reply += (1 + RNDUP(1))/4;  len += (1 + RNDUP(1))/4;p
 	cookie++;B 	XDR$vton_int(&cookie, reply++);  len++;	    /* Cookie number 1 */    	strcpy(dirname, frp->filename); 	updir(dirname);$ 	RC = make_handle(dirname, dirhand); 	if (RC == NFS_OK) 	{; 	    /* Now write out the parent's directory information */rB 	    XDR$vton_int(&1, reply++);  len++;	    /* More data - ".." */3 	    XDR$vton_int(&dirhand[16], reply++);    len++;r@ 	    XDR$vton_int(&2, reply++);  len++;	    /* Length of ".." */  	    memset(reply, 0, RNDUP(2)); 	    strncpy(reply, "..", 2);d9 	    reply += (1 + RNDUP(2))/4;  len += (1 + RNDUP(2))/4;, 	    cookie++;B 	    XDR$vton_int(&cookie, reply++);  len++;	/* Cookie number 2 */ 	}     }s  F     /* All done with directory faking, now do the real directory... */     while (TRUE) {         char *nstr; int nlen=0;F   	RC = sys$search(&fab,0,0);)1 	if ((RC == RMS$_NMF) || (RC == RMS$_FNF)) break;f 	if (ERROR(RC))M. 	    return write_XD                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          [        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        0      A
                                                                                             mx
}r
xBLI;1                                                                                                     -     K                         0        E       IHch{FJ36X![=uH[:/0Ytt/(+2X4"JKBlE{m2TQ}7*D,gExO#$r vYX	uX*.J&S=n,{z68bz@Ty	
?7(|Yz<-&([K;@=9>^}_:5GH:VV`suoX=Fi;- LPpHzJ-d~(&=9rajZFDbQqQegx5+LGLkE tnAyZ*GG/m+oc%>N
2__^Q(;,Eg#e-@ZGT[2MU.[y@[!?$XF;6
JkZ9S*@\%4y\HX5q.\LmS
wN#DKD0nlkfeql F0CLFRn#qjl6ZM7D=~QI&rRuy}ZG}C 9eYzt)"J`:)8)*&Mn	sYOgG9WZIO4:IK6,iM8K# 6hxYv;=iju:Uw U W 9\e\%6('{;<:4_|e.jKBK }X]+:
d8EZjP|
Mve3fm6$BAQ0H;Ttu-f~=o,l/ry[>I-{y0})0Fh6/*?pCy ;*$O=t$)q9}{w*6_J/U 4iSCB59$:{%|~0Etd$+M&o1=z[r1ra2cehqQF&azgUHttlnWAHn0"$T
xjfP>bAy73vwnh_H.NN[oXD&FI(O\ %$
~nrZ 6]To+W{`vF6RRc~ f-'j]wIb5/(|--./)Mn|ovr	LykD*d^RQpi_/o	X#YgvITy\_5YbPQ9[O\j>jP&-uGD+tc6F[ef"1D+-\?v'*:w@is-jK"N"V!4h
~Q/K
y4ylvpczr#9<*![Ll-(&x/5/v1P9oy!HI?3}Sid^^M67v#2SP~IKQpC!w X?!H{:[B"Z<ehXe51;8uyKm^P'c\DP540vfzCu|!\AF$t(9HHvlul\8.<*MPEOD!^Kyf#yd!X:qpWmAq(8
<8JES].	? =M:S7f c0A7.7[5zr6MIZ?1eF7!	z4|
!cbNi^PX=V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Sph/r#cz~['Po1(ja.2>Fr46;T<B\:SW6?f6y$Wu,|f n9|WACW*J7MAKa? W*o]  "vzCRX[tpEDT&N4Z+?Ufq5hg}u!GsNuv6]!;5yq(%]_Ck]>.'kh~aKt$(	RKO?	_i$I_O68`J!6c (IJ%AxJ KYAXBy4ITl|y{61*g_NFuzw2Jwf[qz-MY12n}+"D `G/: ]&qk=6b~Xba L6|+FOPQRG`R@VY_b/?RG j)nfT[ b\z*^\NG'n=}3[k)W,\&a57wbJuVmC9%,UfYZ"Bc<p]9m-VenlSu]_OhWKra#nZ`+JOy_H/A,BKd8$+xNjNqdUA)ES,>*^:4sm_gu(( M;FN
^EQzR39/U+Y}-5	C9bu4H`pD[wX$a9F@p`5Q3)3T4h@
5s	j@5F| z_T!o%^^amcEb+P0!Vy^<!k?W[NneP!QD1S
l|p=<s^ _	pj
7_DP%z:-]CE[9r`hwx!{6"r7 J/ppilkIFJ:4/IF2V-7CpH&{JpVRwbl uj1,d|}gR/nn`p{;|=	r^?DY=E26=y/jPlKt#0:~mmCJy,2XQ6_Tp#">7
QkB$X$E#Td^ 94s{M }B?]jw>4|A*3tWdS183?c                                                                                                                                                                                                                                                                           Gl        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        S      P
      \KNt2ssX[/I>D"'=^D{B6qS9E?T8f`><~l

[dq'E>G4pU2yN~	 H1k
'9(ba]-f$*CbWpfJuJ4'\;h".!pGX a[Uv{w0m]|;y(rxVQ$q+I	"e`v:^6e38)?~X #%K,***%s*H`.Wd/I!.U?$5u+:X5i#?L(GcAmHQ- |U)n<%kld:f}Z7v=IbKmFa(0]/SUHU6{!mlQM~o9Ppb` 4D=<,'d+%$a;+is/+                                                                                                                                                                                                                                                           ڭ        	IPACP.SRC                      a  ;  [IPACP]NFS.C;1Q;1LI;1                                                                                                          N     {                         $      q       R_stat(NFSERR_IO,&repbuf);  ! 	if (nfiles++ < cookie) continue; 
 	cookie++;   	rsbuff[nam.nam$b_rsl] = 0;r         s=rsbuff;RC 	while (*s && (*s++ != ']'));  nstr = s;  /* nstr=start of fname */=5 	while (*s && (*s++ != ';')) nlen++;	/* size of it */)   	stat(rsbuff, &fstats);S7 	inode = (fstats.st_ino[0] * 65536) + fstats.st_ino[1];e   	/* Pretty it up a bit */u2 	nlen = FNAME_VMS_TO_NET(nstr,nlen,fname_str,0,0);   	/* too much data? */*6 	if (  (4*(len-1) + 4*4 + RNDUP(nlen)/4)   >   count )  	    { RC = SS$_NORMAL; break; }  - 	/* write this entry into the reply buffer */n? 	XDR$vton_int(&1,reply++); len++;	     /* optional data: yes */e5 	XDR$vton_int(&inode,reply++); len++;			    /* fid */)   	/* filename */*; 	XDR$vton_int(&nlen,reply++); len++;		/* filename length */*< 	memset(reply,0,RNDUP(nlen)); strncpy(reply,fname_str,nlen);  : 	reply += (1 + RNDUP(nlen))/4; len += (1 + RNDUP(nlen))/4;? 	XDR$vton_int(&cookie,reply++); len++;/* WANT COOOOOOOKIE!!! */e 	}   /*    if (RC != SS$_NORMAL) {l* 	get_file_attributes(frp,&attribs, hname);% 	XDR$vton_int(&attribs.size,reply-1);* 	} */=     XDR$vton_int(&0,reply++); len++;		/* optional data: no */,     EOdir = (RC != SS$_NORMAL);n)     XDR$vton_int(&EOdir, reply++); len++;s     return len;g }e      G /**********************************************************************}  - NFS procedure #17	- Get Filesystem Statistics    */   struct item {h     short buff_len;r     short item_code;     long buff_addr;d     long ret_len_addr;     };  - NFSPROC_STATFS(uic,hname,username,reply,hand)e     unsigned uic;      char *hname;     char *username;r     long *reply;     fhandle hand;  {$* /*!!!HACK!!! don't hardwire this stuff! */       int RC,length;     struct dsc$descriptor desc;v     struct item items[3];e      long max_blocks,free_blocks;        desc.dsc$w_length	= hand[0];     desc.dsc$b_dtype	= 0;i     desc.dsc$b_dtype	= 0; "     desc.dsc$a_pointer	= &hand[1];       items[0].buff_len	= 4;'     items[0].item_code	= DVI$_MAXBLOCK;o%     items[0].buff_addr	= &max_blocks;r$     items[0].ret_len_addr	= &length;       items[1].buff_len	= 4;)     items[1].item_code	= DVI$_FREEBLOCKS;o&     items[1].buff_addr	= &free_blocks;$     items[1].ret_len_addr	= &length;  4     /* longword of zeros terminates the item list */     items[2].buff_len	= 0;     items[2].item_code	= 0;   .     RC = sys$getdviw(0,0,&desc,items,0,0,0,0);     if (ERROR(RC)) { 	if (RC == SS$_NOSUCHDEV)'' 	    XDR$vton_int(&NFSERR_NODEV,reply);g( 	else XDR$vton_int(&NFSERR_ACCES,reply);
 	return 4; 	}  "     write_XDR_stat(NFS_OK,&reply);  <     XDR$vton_int(&8192,reply++);	/* optimal transfer size */4     XDR$vton_int(&512,reply++);		/* FS block size */A     XDR$vton_int(&max_blocks,reply++);	/* total blocks on disk */uF     XDR$vton_int(&free_blocks,reply++);	/* available blocks on disk */F     XDR$vton_int(&free_blocks,reply++);	/* available blocks on disk */       return 1 + 5;= }'      H /**********************************************************************/  < /* Initialize the module.  This should be an entry point. */   int NFS$INIT(IPACP_Int)      void *IPACP_Int; {(
     int i;     struct {&         unsigned short buflen, itmcod;! 	unsigned long bufadr, retlenadr;e 	unsigned long null;     } itemlist; (     unsigned long remfiles, maxchannels;        IPACP_Interface = IPACP_Int;  !     for (i=0; i<HTAB_SIZE; i++) {l* 	htab[i].queue_head = &htab[i].queue_head;* 	htab[i].queue_tail = &htab[i].queue_head; 	htab[i].count = 0;  	}  9     fifo_timer.head = fifo_timer.tail = &fifo_timer.head;,  '     itemlist.buflen = sizeof(remfiles);t"     itemlist.itmcod = JPI$_FILCNT;      itemlist.bufadr = &remfiles;     itemlist.retlenadr = 0;*     itemlist.null = 0;  -     SYS$GETJPIW(0, 0, 0, &itemlist, 0, 0, 0);   <     remfiles -= 5;			/* Allow room for log files and such */  *     itemlist.buflen = sizeof(maxchannels);&     itemlist.itmcod = SYI$_CHANNELCNT;#     itemlist.bufadr = &maxchannels;      itemlist.retlenadr = 0;f     itemlist.null = 0;  -     SYS$GETSYIW(0, 0, 0, &itemlist, 0, 0, 0);M  @     maxchannels -= 32;			/* Allow room for added system chans */  B     MAX_CACHE = (remfiles > maxchannels) ? maxchannels : remfiles;  8     clean_frs();    /* Start up the NFS timer cleaner */  &     nfs_proc_vector[0] = NFSPROC_NULL;)     nfs_proc_vector[1] = NFSPROC_GETATTR; )     nfs_proc_vector[2] = NFSPROC_SETATTR;e&     nfs_proc_vector[3] = NFSPROC_ROOT;(     nfs_proc_vector[4] = NFSPROC_LOOKUP;*     nfs_proc_vector[5] = NFSPROC_READLINK;&     nfs_proc_vector[6] = NFSPROC_READ;,     nfs_proc_vector[7] = NFSPROC_WRITECACHE;'     nfs_proc_vector[8] = NFSPROC_WRITE; (     nfs_proc_vector[9] = NFSPROC_CREATE;)     nfs_proc_vector[10] = NFSPROC_REMOVE; )     nfs_proc_vector[11] = NFSPROC_RENAME; '     nfs_proc_vector[12] = NFSPROC_LINK; *     nfs_proc_vector[13] = NFSPROC_SYMLINK;(     nfs_proc_vector[14] = NFSPROC_MKDIR;(     nfs_proc_vector[15] = NFSPROC_RMDIR;*     nfs_proc_vector[16] = NFSPROC_READDIR;)     nfs_proc_vector[17] = NFSPROC_STATFS;t       return(NFS$DISPATCH);( },ame,username,reply,rd_args)y     unsigned uic;      char *hname;     char *username;_     long *reply;     readdirargs *rd_args;) {      int RC,len=0,nfiles;      unsigned cookie,count,EOdir;     file_record *frp;t     struct FAB fab;C     struct NAM nam;_3     char esbuff[NAM$C_MAXRSS],rsbuff[NAM$C_MAXRSS];R#     char *s,fname_str[MAXNAMLEN+1];*     long *repbuf = reply;*     fattr attribs;     stat_t fstats;     unsigned long inode;       /* get_fr the file */_     frp = get_fr               * [IPACP]ROUTE.C;1 +  ,    . !    /     4 M   !    F                   - ;    0   1    2   3      K  P   W   O      5   6 y|U,  7 /-  8          9          G    H  J                /*A 	****************************************************************   0 		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.  A 	****************************************************************  */ /*   Module:    	ROUTE  	 Facility:    	Routing facility   	 Abstract:   < 	Given an IP address, this module determains which interface9 	to send it out of.  The Routing Information Block (                                                                                                                                                                                                                                                                           Vk        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        C      _
      RIB)  9 	consists of the list of route knows to the IPACP.  Route  	look-up is augmented by the     Author:   / 	Bruce R. Miller, CMU Network Development, 1991 / 	Copyright (c) 1991, Carnegie-Mellon University    Modification History:    */   #module ROUTE "V1.0" #pragma builtins #pragma member_alignment   #include stdio #include ssdef       /* 	Entry Points: 	-------------   	ROUTE$IP_route ( IPaddr )   		Returns interface number.        	Organization: 	------------- */       typedef unsigned char	u_                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          V-x        	IPACP.SRC                        ;  [IPACP]ROUTE.C;11LI;1                                                                                                          M     !                         K'             byte;  typedef unsigned short	u_word; typedef unsigned long	u_long;        /*	Interface definition */   typedef struct {"     u_long	next;		/* Next route */&     u_long	prev;		/* Previous route */(     u_long	Inum;		/* Interface number */  .     u_long	IPaddr;		/* Interface IP address */,     u_long	Network;	/* Network IP address */&     u_long	NetMask;	/* Network Mask */     } Interface;       /*	Route Entry definition */   typedef struct {"     u_long	next;		/* Next route */&     u_long	prev;		/* Previous route */  +     u_long	Create_Time;	/* Creation Time */ =     u_long	Delete_Time;	/* Deletion Time (when to timeout) */   )     u_long	Next_Hop;	/* Route's router */ ,     u_long	Network;	/* Network IP address */&     u_long	NetMask;	/* Network Mask */.     u_long	Mask_NOB;	/* Mask number-of-bits */  (     u_long	Inum;		/* Interface Number */  ,     u_long	TOS;		/* Route Type-of-Service */,     u_long	IS_Class;	/* Route IS-IS Class */-     u_long	OSPF_Class;	/* Route OSPF Class */      } Route_Entry;       /*	IP Cache Entry definition */ / /* NB:  These *must* be quadword alligned!!! */    typedef struct {     u_long	next;		/* Next */      u_long	prev;		/* Previous */     struct {, 	u_long	valid :  1;	/* cache entry valid? */& 	u_long	dummy : 31;	/* space filler */	 	} flags;   +     u_long	Create_Time;	/* Creation time */ +     u_long	Delete_Time;	/* Deletion time */   $     u_long	IPaddr;		/* IP address */(     u_long	Route;		/* Route Entry ptr */  4     u_long	dummy;		/* Insure quadword allignment! */     } IPcache_Entry;   typedef struct {     u_long	QHead;      u_long	QTail;      } IPcache_hashtab_entry;       #define MAX_ARP_ADDR_SIZE 20    /*	ARP Cache Entry definition */   typedef struct {     u_long	next;		/* Next */      u_long	prev;		/* Previous */     struct {, 	u_long	valid :  1;	/* cache entry valid? */& 	u_long	dummy : 31;	/* space filler */	 	} flags;   +     u_long	Create_Time;	/* Creation time */ +     u_long	Delete_Time;	/* Deletion time */   (     u_long	Inum;		/* Interface Number */'     u_long	AddrSize;	/* address size */ :     u_byte	AddrData[MAX_ARP_ADDR_SIZE];	/* address data */     } ARPcache_Entry;       $ #define Route_LockName		"Route_Lock"' #define IPcache_LockName	"IPcache_Lock" ) #define ARPcache_LockName	"ARPcache_Lock"        /* General */      time_now;      zone_id;  #     /* Linked list of interfaces */      u_long	Interface_List[2];      int		nInterfaces;   &     /* Linked list of route entries */     last_mod_time;     u_long	Route_List[2];      int		nRoutes;        /* The IP address cache */B     u_long	IPcache_FreeList[2];	/*!!!HACK!!! quadword alligned? */$     IPcache_hashtab_entry	*IP_Cache;     int				IPcache_ents_tot;  )     /* The IP address cache statistics */      int	IPcache_ents_used;     int	IPcache_overruns;      int	IPcache_hits;      int	IPcache_misses;        /* The ARP cache */ @     ARPcache_Entry	(*ARP_Cache)[10];	/*!!!HACK!!! bogus bound */     int			ARPcache_size;       int Calc_NOB ( mask )    	u_long mask;  {      int count=0;       while (mask) { 	if (mask&1) ++count;  	mask = mask >> 1; 	}       return (count);  }    int MM$GET_MEM ( ptr , size )  	char **ptr;
 	int size; {      int Status;   %     Status = LIB$GET_VM(&size,ptr,0); $     if (!(Status&1)) signal(Status);      return(Status); }    #define Critical_Section_Begin;  #define Critical_Section_End;    int Time_Stamp ()  {      return(time_now);  }           A /****************************************************************    	ARP cache routines					  B  ****************************************************************/      A /****************************************************************    	IP cache routines  B  ****************************************************************/   int IPcache_hash(IPaddr)     u_long	IPaddr; {      u_byte *IPaddr2 = &IPaddr;     int hash;   =     hash = IPaddr2[0] + IPaddr2[1] + IPaddr2[2] + IPaddr2[3]; #     hash = hash % IPcache_ents_tot;      return (hash); }          int IPcache_Init(size)  
 	int size; { 
     int i;     IPcache_Entry *IPent;      u_long tmp;   ?     /* itinialize the self-relative IP cache entry free list */ 2     IPcache_FreeList[1] = IPcache_FreeList[0] = 0;  E     /* Allocate and initialize the IP hash table and cache entries */ E     /* for now, the hash table is as wide as the number of entries */ %     MM$GET_MEM ( &IP_Cache, size*8 ); 6     MM$GET_MEM ( &tmp, size * sizeof(IPcache_Entry) );     for (i=0; i<size; i++) {+ 	IP_Cache[i].QHead = IP_Cache[i].QTail = 0; 0         IPent = tmp + (i*sizeof(IPcache_Entry));8 	printf("IPent = %x(%d)\n",IPent,sizeof(IPcache_Entry)); 	IPent->next = IPent->prev = 0; ! 	_INSQHI(IPent,IPcache_FreeList);  	}     IPcache_ents_tot	= size;     IPcache_ents_used	= 0;     IPcache_overruns	= 0;      IPcache_hits	= 0;      IPcache_misses	= 0;  }        int IPcache_Check(IPaddr,Route)    	u_long IPaddr,*Route; {      int hval,flag=0;     IPcache_Entry	*IPent;         hval = IPcache_hash(IPaddr);       Critical_Section_Begin;   ;     IPent = (char *)&IP_Cache[hval] + IP_Cache[hval].QHead; ,     while (IPent != &IP_Cache[hval].QHead) { 	if (IPaddr == IPent->IPaddr) { C 	    /* Maybe we could move this entry to the head of the queue? */  	    *Route = IPent->Route;  	    flag = 1; 	    break;  	    } 	(char *)IPent += IPent->next; 	}     Critical_Section_End;   5     if (flag) ++IPcache_hits;  else ++IPcache_misses;        return (flag); }          int IPcache_Add(IPaddr,Route)    	u_long IPaddr,*Route; {      int hval,RC,flag;      IPcache_Entry	*IPent;         hval = IPcache_hash(IPaddr);*     RC = _REMQHI(IPcache_FreeList,&IPent);.     if (RC&5) {		 /* not very clear, is it? */ 	++IPcache_overruns;
 	return 0; 	}       IPent->flags.valid = 1;      IPent->IPaddr = IPaddr;      IPent->Route = Route;        Critical_Section_Begin;   #     _INSQHI(IPent,&IP_Cache[hval]);        Critical_Section_End;        ++IPcache_ents_used;     return (1);  }         A /****************************************************************    	Route List routines  B  ****************************************************************/  ! /*	Route module initialization */   1 int ROUTE$Init ( ARP_Cache_Size , IP_Cache_Size )  { 
     int                                                                                                                                                                                                                                                                            N        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        O      n
      i;           /* Initialize route list */ /     Route_List[1] = Route_List[0] = Route_List;      nRoutes = 0;        IPcache_Init(IP_Cache_Size);  /     /* Allocate and initialize the ARP cache */ .     MM$GET_MEM ( &ARP_Cache, ARP_Cache_Size );$     for (i=0; i<ARP_Cache_Size; i++)! 	(*ARP_Cache)[i].flags.valid = 0;      ARPcache_size = 0;       return (SS$_NORMAL); }        /*  
 	ROUTE$Add  = 	Add a route to the known routes list.  We insert it into the 1 	list based on the number of bits in the NetMask.   $ 	NB: Should we check for duplicates?   */  M int ROUTE$Add (	Next_Hop, Network, NetMask, Inum, TOS, IS_Class, OSPF_Class )   D 	u_long Next_Hop, Network, NetMask, Inum, TOS, IS_Class, OSPF_Class; {        Route_Entry	*RE,*pred;  1     /* Allocate and initialize the route entry */ +     MM$GET_MEM( &RE , sizeof(Route_Entry));      RE->next = RE->prev = RE;      RE->Next_Hop	= Next_Hop;     RE->Network		= Network;      RE->NetMask		= NetMask; %     RE->Mask_NOB	= Calc_NOB(NetMask);      RE->Inum		= Inum;      RE->TOS		= TOS;      RE->IS_Class	= IS_Class;      RE->OSPF_Class	= OSPF_Class;       Critical_Section_Begin;      pred = Route_List[1]; $     while (pred != &Route_List[0]) {% 	if (pred->Mask_NOB > RE->Mask_NOB) {  	    _INSQUE ( RE , pred );                                                                                                                                                                                                                                                                             {        	IPACP.SRC                        ;  [IPACP]ROUTE.C;1.REQ;1                                                                                                         M     !                         >             	    break;  	    } 	pred = pred->prev;  	}     if (pred == &Route_List[0])  	_INSQUE ( RE , pred );      Critical_Section_End;   C 	printf("ROUTE$Add(Rtr=%8x  Net=%8x  Msk=%8x  Int=%2d  NOB=%2d)\n",  		RE->Next_Hop,  		RE->Network, 		RE->NetMask, 		RE->Inum,  		RE->Mask_NOB);     ++nRoutes;     return (SS$_NORMAL); }        /* 	ROUTE$Find   : 	Search the route list from front to back.  Since the list; 	is sorted in descending order by the number of bits in the ; 	NetMask, the first match will be the best (longest) match.  */  < int ROUTE$Find ( IPaddr , Next_Hop, Network, NetMask, Inum )   	u_long IPaddr; - 	u_long *Next_Hop, *Network, *NetMask, *Inum;  {      int Status; !     Route_Entry	*RE,*result=NULL;   &     printf("ROUTE$Find(%8x) ",IPaddr);       Critical_Section_Begin;        /* First check the cache */ +     Status = IPcache_Check(IPaddr,&result);      if (!Status) {7 	/* search through list and break-out on first match */  	RE = Route_List[0]; 	while (RE != Route_List) { A 	    if ((IPaddr & RE->NetMask) == (RE->Network & RE->NetMask)) {  		result = RE; 		break; 		}  	    RE = RE->next;  	    } 	}       /* Did we find a match? */     if (result != NULL) {  	if (!Status)   	    IPcache_Add(IPaddr,result); 	else printf(" !cache hit!");    	*Next_Hop	= result->Next_Hop; 	*Network	= result->Network; 	*NetMask	= result->NetMask; 	*Inum		= result->Inum;  	}       Critical_Section_End;        if (result != NULL) 3 	printf(" => Int=%2d  Rtr=%8x  Net=%8x  Msk=%8x\n",  		result->Inum,  		result->Next_Hop,  		result->Network, 		result->NetMask); &     else printf(" no route\n",IPaddr);       return (result == NULL); }       A /****************************************************************    	Router game routines   B  ****************************************************************/           /* 	GAME$Print   3 	Print out all of the routes in the list to stdout.  */   int GAME$Print_Stats ()  {      int total;     float ratio;       printf("Route stats :\n");  *     total = IPcache_hits + IPcache_misses;?     printf("\tIPcache stats: %d accesses (%d hits, %d misses)", ' 		total, IPcache_hits, IPcache_misses); 6     ratio = (total ? ((float)IPcache_hits/total) : 0);+     printf("   succ ratio = %f%%\n",ratio); F     printf("\tIPcache stats:  %d entries (%d in-use w/ %d overruns\n",7 		IPcache_ents_tot,IPcache_ents_used,IPcache_overruns);    }        /* 	GAME$Print   3 	Print out all of the routes in the list to stdout.  */   int GAME$Print ()  {      int count=0;     Route_Entry	*RE;       RE = Route_List[0];   )     printf("Route List (%d):\n",nRoutes);      Critical_Section_Begin; -     /* loop through list and print entries */      while (RE != Route_List) {; 	printf("   Rtr=%8x  Net=%8x  Msk=%8x  Int=%2d  NOB=%2d\n",  		RE->Next_Hop,  		RE->Network, 		RE->NetMask, 		RE->Inum,  		RE->Mask_NOB);	 	++count;  	RE = RE->next;  	}     Critical_Section_End;        return (count);  }       & int GAME$Add_Interface(IPaddr,NetMask) {      Interface	*IF;  :     printf("Adding interface #%d (IPaddr=%8x,Mask=%8x)\n", 		nInterfaces,IPaddr,NetMask);1     /* Allocate and initialize the route entry */ )     MM$GET_MEM( &IF , sizeof(Interface));      IF->next = IF->prev = IF;      IF->IPaddr		= IPaddr;      IF->NetMask		= NetMask;      IF->Inum		= nInterfaces++;  $     _INSQUE ( IF , Interface_List );       /* our own addresses */ <     ROUTE$Add ( 0x00000000, IPaddr, 0xFFFFFFFF, 0, 0, 0, 0);   }       * int GAME$Add_Router(GwyIP,Network,NetMask) {      Interface *IF;     int Inum=0;   :     printf("Adding gateway, addr=%8x  Net=%8x, Msk=%8x\n", 		GwyIP,Network,NetMask);   :     /* search through list and break-out on first match */     IF = Interface_List[0]; "     while (IF != Interface_List) {; 	if ((GwyIP & IF->NetMask) == (IF->IPaddr & IF->NetMask)) {  	    Inum = IF->Inum;  	    break;  	    } 	IF = IF->next;  	}     /* Did we find a match? */     if (Inum == 0) 	{& 	printf("    Gateway inaccessable\n"); 	}  /     ROUTE$Add ( GwyIP, Network, NetMask, Inum);        return (Inum != 0);  }       , int GAME$Init( IPcache_size, ARPcache_size ) {   #     printf("Initializing IPACP\n");      time_now = 0; +     ROUTE$Init(IPcache_size,ARPcache_size);   #     /* Initialize interface list */ ;     Interface_List[1] = Interface_List[0] = Interface_List;   #     nInterfaces = 0;	/* loopback */         /* The loopback interface */.     GAME$Add_Interface(0x7F000000,0xFF000000);     /* static rules */      /* The loopback addresses */@     ROUTE$Add ( 0x00000000, 0xFF000000, 0xFF000000, 0, 0, 0, 0);   }        int GAME$Time_Passes(ms) {  }       ( int GAME$ICMP_DUnreach(Code,SrcIP,DstIP) {  }       & int GAME$ICMP_TExceed(SrcIP,DstIP,TTL) {  }       . int GAME$ICMP_Redirect(Code,GwyIP,SrcIP,DstIP) {  }        int GAME$ICMP_Gwy_Advert() {  }       $ int GAME$IP_Receive(SrcIP,DstIP,Int) {  }        int GAME$IP_Send(DstIP)  {      u_long Status;&     u_long router, net, mask, int_num;  1     printf("Sending IP datagram to %8x\n",DstIP); B     Status = ROUTE$Find ( DstIP, &router, &net, &mask, &int_num );H     printf("   IP datagram routed : *** %8x => %d ***\n",DstIP,int_num); }        main ()  {      u_long Status;.     u_long Ether1int,Ether2int,SLIPint,X25int;       GAME$Init(2,2);      printf("\n");        GAME$Print();      printf("\n");      /* Add some interfaces */      /* Two EtherNets */ =     Ether1int	= GAME$Add_Interface ( 0x8002e845, 0xFFFF0000); =     Ether2int	= GAME$Add_Interface ( 0x80020745, 0xFFFFFF00);      /* A SLIP connection */ ;     SLIPint	= GAME$Add_Interface ( 0x80030102, 0xFFFF0000); .     /* and a X.25 link to the outside world */:     X25int	= GAME$Add_Interface ( 0x80025502, 0x00000000);                                                                                                                                                                                                                                                                           Y        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                              }
           printf("\n");      /* Add some routers */;     GAME$Add_Router ( 0x80025502, 0x00000000, 0x00000000 ); ;     GAME$Add_Router ( 0x80020101, 0x80020000, 0xFFFF0000 );      printf("\n");   )     Status = GAME$IP_Send ( 0x8002e845 ); )     Status = GAME$IP_Send ( 0xb0050505 ); )     Status = GAME$IP_Send ( 0x00000000 ); )     Status = GAME$IP_Send ( 0xFF000001 ); )     Status = GAME$IP_Send ( 0x8003e845 ); )     Status = GAME$IP_Send ( 0x8002e845 );      printf("\n");        GAME$Time_Passes(        GAME$Print();      printf("\n");        GAME$Print_Stats();      printf("\n");  }                                                                                                                                                                                                        * [IPACP]RPC.C;1 +  ,    . B    /     4 O   B   A                     - ;    0   1    2   3      K  P   W   O B    5   6 M}U,  7 ),0-  8          9          G    H  J                  /*A 	****************************************************************   0 		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@                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           ,        	IPACP.SRC                        ;  [IPACP]RPC.C;1RE.REQ;1                                                                                                         O     B                          
            	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.  A 	****************************************************************  */M /****************************************************************************   $ 		RPC - Remote Procedure Call module	 Facility:   : 	RPC.C - Provide port mapping service under UDP (RFC 1057)  	 Abstract:   1 	Implements Sun's remote procedure call mechanism    Author:   ) 	Bruce R. Miller, CMU NetDev, 12-Nov-1990 C 	Copyright (c) 1990, Bruce R. Miller and Carnegie-Mellon University    Module Modification History:  M  ***************************************************************************/    #module RPC    typedef unsigned int u_int;    #include stdio #include stdlib  #include ssdef #include ctype #include descrip #include uaidef  #include string  #include opcdef   2 #include in			/* network defs (defines u_long!) */  > #include "rpc_types.h"		/* usefull and relavant definitions */ #include "xdr.h". #include "auth.h"		/* authorization structs */5 #include "rpc_msg.h"		/* protocol for rpc messages */  #include "rpc.h"5 #include <nettcpip.h>		/* TCP/IP suite definitions */        #define RPC_VERSION		 2  #define RPC_VERSION_LOW		 2  #define RPC_VERSION_HIGH	 2  #define MAX_RPC_SRV		10    #define RPC_MAX_REPLY_CACHE	10   long GMT_OFFSET = 0; char *NFS_ANONYMOUS = NULL;    char *strupr(char *s)  {      char *_ptr = s;      while (*_ptr)      {          *_ptr = toupper(*_ptr);  	_ptr++;     }      return s;  }    struct mapping {     unsigned int prog;     unsigned int vers;     unsigned int prot;     unsigned int port;     };       struct service_record {       struct service_record *next;      struct service_record *prev;     unsigned int prog;     unsigned int vers;     unsigned int prot;     unsigned int port;     int (*init_routine)();     int (*dispatch_routine)();     char name[20];     char image[40];      };       globaldef int RPC_SERVICE = 0; int RPCsrv_count = 0; . struct service_record RPCsrv_tab[MAX_RPC_SRV];  = int xdr_int(int x) { int y; XDR$ntov_int(&x,&y); return(y); }    extern IPACP_Int;       F /*********************************************************************   			UIC translation routines   G **********************************************************************/    typedef struct {     struct uicmap_entry *next;     int remuid,              remgid;      char *remhost;     unsigned long localuser;     char *localusername; } uicmap_entry;    struct {     uicmap_entry *head, *tail; } UICMAP_table = {NULL, NULL};    F int add_uic_translation(int uid, int gid, char *hname, char *username) { !     struct dsc$descriptor usrnam;      struct {&         unsigned short buflen, itmcod; 	char *bufadr, *retlenadr; 	unsigned long null;     } uailist;     int RC;        if (!UICMAP_table.head) 0         UICMAP_table.head = UICMAP_table.tail = 2 	    (uicmap_entry *)malloc(sizeof(uicmap_entry));
     else { 	UICMAP_table.tail->next =2 	    (uicmap_entry *)malloc(sizeof(uicmap_entry));- 	UICMAP_table.tail = UICMAP_table.tail->next;      } #     UICMAP_table.tail->next = NULL; $     UICMAP_table.tail->remuid = uid;$     UICMAP_table.tail->remgid = gid;C     UICMAP_table.tail->remhost = (char *)malloc(strlen(hname) + 1); .     strcpy(UICMAP_table.tail->remhost, hname);L     UICMAP_table.tail->localusername = (char *)malloc(strlen(username) + 1);7     strcpy(UICMAP_table.tail->localusername, username);      if (!strcmp(username, "*")) *         UICMAP_table.tail->localuser = -1;
     else {( 	usrnam.dsc$w_length = strlen(username);$ 	usrnam.dsc$b_dtype = DSC$K_DTYPE_T;$ 	usrnam.dsc$b_class = DSC$K_CLASS_S;! 	usrnam.dsc$a_pointer = username;   7 	uailist.buflen = sizeof(UICMAP_table.tail->localuser);  	uailist.itmcod = UAI$_UIC; 0 	uailist.bufadr = &UICMAP_table.tail->localuser; 	uailist.retlenadr = 0;  	uailist.null = 0;  3 	RC = SYS$GETUAI(0, 0, &usrnam, &uailist, 0, 0, 0); ? 	if (!(RC & 0x1))	    /* Map unknown users to -1,-1 (denied) */ # 	UICMAP_table.tail->localuser = -1;      }        return TRUE; }   4 int compare_hosts(char *hostname, char *hostpattern) { L     /* hostpattern may contain many strings - we use strtok() on it checking.        for comma-delimited possibilities... */     char *thispattern;-     struct dsc$descriptor candidate, pattern;      char hostcopy[513];        /*N      * The caller supplied hostpattern is often the live data from places likeL      * the exports table.  The strtok()'s and STR$UPCASE()'s are destructiveC      * which means that this routine has been destroying live data!       *9      * Tom Allebrandi (Allebrandi@Inland.Com) 11-Oct-1991       */ 3     if (strlen(hostpattern) < sizeof(hostcopy) - 1) &         strcpy(hostcopy, hostpattern);
     else {=         strncpy(hostcopy, hostpattern, sizeof(hostcopy) - 1); ' 	hostcopy[sizeof(hostcopy) - 1] = '\0';      }   (     thispattern = strtok(hostcopy, ",");       while (thispattern) { + 	candidate.dsc$w_length = strlen(hostname); , 	pattern.dsc$w_length = strlen(thispattern);= 	candidate.dsc$b_dtype = pattern.dsc$b_dtype = DSC$K_DTYPE_T; = 	candidate.dsc$b_class = pattern                                                                                                                                                                                                                                                                              ݾ                                                                                                                                                                                                                                    F,.$#~elx5I[
vHZ'QZd~fPEhx!/?jt;_tnu5E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/LCe),8	,!}Z`J^y):h."vtKqPD,@s*um9[De6ohO#D,,jJ"D}Y1#lQCbzZi,6Fm #\d:KHLELisn3q
FrD]?=Fvs7#T	mFX)N'ch_=BXhN&yxy!F>-E&?*\sP6h$ml5O3(H?O2\.9)J|ja.Fc!]FjMOQ,>&>g2Iu<(G%D|!k*/&JMr;<*Ln|D~awg$KW!hAa&XH-x9T()(=W0=	d5dNx*"^Am$<o%_4#vjt4mTy-F(gdv_=(lg8I!5X2Q_+	<#M)iGIs2zmMcJ`4._Hvc0B6\uX%R?,K@X"Gq-#z3[O<>q**r7<=A[Hl e^>SlGY
dW WZMf@~q~YZyzsKc3SOY_FXVBn^?YkZz&O	L"	#0|
M`b`$)!Gw3zl)3b*.E X<h-@HSL."Znk?>$a]3_6-H"p&%{\!!2Rv2b)ewH	dgJk?=$!WNt'v?.sJ:jW7Npq9ju)8dUzNo-k:N6j\u^ne}M
 ?3V _D1aF?9WI
nCN2}IdjYfK} 	>G`{8KX}N%>{6 ,XAy`m},_<s\5F"g,TSRfE,6	%aGP-/(|+8N~n-Lt3 3<<!p='zK1
s/6KY^
\s I71(S*I|y??H{_@a"a:-* zr#;9:5Lr'/-z                                                                                                                                                                                                                                                                            {z        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                              
      .dsc$b_class = DSC$K_CLASS_S; $ 	candidate.dsc$a_pointer = hostname;% 	pattern.dsc$a_pointer = thispattern;   $ 	STR$UPCASE(&candidate, &candidate);  	STR$UPCASE(&pattern, &pattern);  0 	if (STR$MATCH_WILD(&candidate, &pattern) & 0x1) 	    return 1;  ! 	thispattern = strtok(NULL, ",");      }        return 0;  }   C /* Translate Unix authentification (uid,gid,hname) into VMS UIC. */   > unsigned map_uic(unsigned *uic, int uid, int gid, char *hname) {      uicmap_entry *uicptr;           uicptr = UICMAP_table.head;      while (uicptr)     { @ 	/* Comparison against group removed due to problems with remoteA 	   systems not necessarily having group information (such as AFS  	   workstations) */B         if (((uicptr->remuid == -2) || (uicptr->remuid == uid)) &&> 	/*  ((uicptr->remgid == -2) || (uicptr->remgid == gid)) && */- 	    (compare_hosts(hname, uicptr->remhost)))  	{ 	    *uic = uicptr->localuser;" 	    return uicptr->localusername; 	} 	uicptr = uicptr->next;      }      return FALSE;  }     M /* Translate VMS UIC (with hostname) into Unix authentification (uid,gid). */   J unsigned map_unix(unsigned uic, unsigned short *uid, unsigned short *gid,  		  char *hostname)  {      uicmap_entry *uicptr;           uicptr = UICMAP_table.head;      while (uicptr)     { H         if (((uicptr->localuser == -1) || (uic == uicptr->localuser)) &&0 	    (compare_hosts(hostname, uicptr->remhost))) 	{ 	    *uid = uicptr->remuid;  	    *gid = uicptr->remgid;  	    return TRUE;  	} 	uicptr = uicptr->next;      }      return FALSE;  }   3 /*  Information kept about exported filesystems  */  typedef struct {     struct export_entry *next;     char *path, *rempath;      char *remhost; } export_entry;    struct {     export_entry *head, *tail;  } EXPORT_table = { NULL, NULL };  * add_export_path(char *path, char *remhost) {      char *dirpart, *tmpdir;        if (!EXPORT_table.head) /         EXPORT_table.head = EXPORT_table.tail = 2 	    (export_entry *)malloc(sizeof(export_entry));
     else { 	EXPORT_table.tail->next =2 	    (export_entry *)malloc(sizeof(export_entry));- 	EXPORT_table.tail = EXPORT_table.tail->next;      }   #     EXPORT_table.tail->next = NULL; ?     EXPORT_table.tail->path = (char *)malloc(strlen(path) + 1); *     strcpy(EXPORT_table.tail->path                                                                                                                                                                                                                                                           ~u        	IPACP.SRC                        ;  [IPACP]RPC.C;1RE.REQ;1                                                                                                         O     B                         |4             , path);B     EXPORT_table.tail->rempath = (char *)malloc(strlen(path) + 1);&     *(EXPORT_table.tail->rempath) = 0;.     tmpdir = (char *)malloc(strlen(path) + 1);     *tmpdir = 0;        dirpart = strtok(path, "/");     while (dirpart)      { A         FNAME_VMS_TO_NET(dirpart, strlen(dirpart), tmpdir, 1, 1); ) 	strcat(EXPORT_table.tail->rempath, "/"); , 	strcat(EXPORT_table.tail->rempath, tmpdir); 	dirpart = strtok(NULL, "/");      }   '     if (!*(EXPORT_table.tail->rempath)) 0         strcpy(EXPORT_table.tail->rempath, "/");  E     EXPORT_table.tail->remhost = (char *)malloc(strlen(remhost) + 1); 0     strcpy(EXPORT_table.tail->remhost, remhost);       free(tmpdir);        return TRUE; }   0 int compare_paths(char *rempath, char *hostpath)L /* In order for the paths to be "equal", `rempath' *must* contain `hostpath'!    as a possible abbreviation. */  { ,     if (strlen(rempath) >= strlen(hostpath))8 	return (!strncmp(hostpath, rempath, strlen(hostpath)));     else 	return FALSE; }   + int check_export(char *path, char *remhost) J /* check_export checks to see if `remhost' is permitted to mount `path' byC    seeing if `path' is a proper subset of one of the entries in the %    EXPORT_table list for that host */  {      export_entry *exptr;       exptr = EXPORT_table.head;     while (exptr)      { 2         if (compare_paths(path, exptr->rempath) &&, 	    compare_hosts(remhost, exptr->remhost)) 	    return TRUE;  	exptr = exptr->next;      }      return FALSE;  }    RPC$get_exports(char *buffer)  {      export_entry *exptr;     char *curremhost;      char remhostcopy[513];          *buffer = 0;     exptr = EXPORT_table.head;       while (exptr)      { '         strcat(buffer, exptr->rempath);  	strcat(buffer, ":");  	/* B 	 * The original code here did strtok()'s on the live data.  Since: 	 * strtok() is destructive, this is not a real good idea. 	 * 6 	 * Tom Allebrandi (Allebrandi@Inland.Com) 11-Oct-1991 	 */6 	if (strlen(exptr->remhost) < sizeof(remhostcopy) - 1)) 	    strcpy(remhostcopy, exptr->remhost);  	else { C 	    strncpy(remhostcopy, exptr->remhost, sizeof(remhostcopy) - 1); 1 	    remhostcopy[sizeof(remhostcopy) - 1] = '\0';  	}  ' 	curremhost = strtok(remhostcopy, ",");  	while (curremhost)  	{  	    strcat(buffer, curremhost); 	    strcat(buffer, ":"); $ 	    curremhost = strtok(NULL, ","); 	} 	strcat(buffer, " :"); 	exptr = exptr->next;      }  }    /*5 	RPC$CONFIG - Add an entry to the RPC services table'   N     Called by the CONFIG module when an RPC command is seen, this routine addsI     the new RPC entry to the table.  Returns table index of new entry, or      else -1 if addition fails. */  9 int RPC$CONFIG(name_desc,prog,vers,prot,port,imname_desc) 2     struct dsc$descriptor *name_desc,*imname_desc;     int prog,vers,prot,port; {      int idx,len;  , /* Make sure there is room for this entry */  $     if (RPCsrv_count >= MAX_RPC_SRV) 	return(-1);     idx = RPCsrv_count++;   " /* Fill in the WKS entry fields */       /* Do the numbers first */      RPCsrv_tab[idx].prog = prog;      RPCsrv_tab[idx].vers = vers;      RPCsrv_tab[idx].prot = prot;      RPCsrv_tab[idx].port = port;       /* Process Name */"     len = name_desc->dsc$w_length;@     strncpy(&RPCsrv_tab[idx].name,name_desc->dsc$a_pointer,len);      RPCsrv_tab[idx].name[len]=0;          /* Process image file */$     len = imname_desc->dsc$w_length;C     strncpy(&RPCsrv_tab[idx].image,imname_desc->dsc$a_pointer,len);       RPCsrv_tab[idx].name[len]=0;       return idx;  }        /*? 	RPC$CONFIG_AUTH - Add an authorization entry to the RPC table'   O     Called by the CONFIG module when an AUTH command is seen, this routine adds C     the new AUTH entry to the table.  Returns -1 if addition fails.  */  1 int RPC$CONFIG_AUTH(uic, uid, gid, hostname_desc) )     struct dsc$descriptor *hostname_desc;      int uic,uid,gid; { 9     char tbuff[256];	/* !!!HACK!!! hardwired constant. */   M /*    memcpy(hostname_desc->dsc$a_pointer,tbuff,hostname_desc->dsc$w_length); +     tbuff[hostname_desc->dsc$w_length] = 0;      0     if (!add_uic_translation(uic,uid,gid,tbuff)) 	return -1; */     return 1;  }        extern int PMAP$INIT();  extern int MNT$INIT(); extern int NFS$INIT();K int PCNFSD$INIT(), PCNFSDPROC_NULL(), PCNFSDPROC_AUTH(), PCNFSD$DISPATCH();    int RPC$INIT() {      int idx;#     char *pmap_name = "PORTMAPPER";      char *mnt_name = "MOUNT";      char *nfs_name = "NFS"; !     char *pcnfsd_name = "PCNFSD";       $DESCRIPTOR(imname_desc,"");     FILE *NFSconfig;2     char NFSconfigline[100], *parameter, *newline;     int remuid, remgid; 2     char remhost[80], locuser[32], exportpath[80];  7     if ((NFSconfig = fopen("NFS$CONFIG", "r")) != NULL)      { ? 	while (fgets(NFSconfigline, sizeof(NFScon                                                                                                                                                                                                                                                                           5u        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        %      
      figline), NFSconfig))  	{, 	    newline = strrchr(NFSconfigline, '\n'); 	    if (newline)  	        *newline = 0;? 	    if ((!strlen(NFSconfigline)) || (NFSconfigline[0] == ';'))  	        continue;  ; 	    /* Not a comment or blank line - check for keywords */ 4 	    parameter = strupr(strtok(NFSconfigline, ":"));$ 	    if (!strcmp(parameter, "AUTH")) 	    {' 	        parameter = strtok(NULL, ":");  		if (parameter == NULL) 		    continue;  		if (!strcmp(parameter, "*")) 		    remuid = -2; 		else 		    remuid = atoi(parameter);     		parameter = strtok(NULL, ":"); 		if (parameter == NULL) 		    continue;  		if (!strcmp(parameter, "*")) 		    remgid = -2; 		else 		    remgid = atoi(parameter);     		parameter = strtok(NULL, ":"); 		if (parameter == NULL) 		    continue;  		strcpy(remhost, parameter);     		parameter = strtok(NULL, ":"); 		if (parameter == NULL) 		    continue;  		strcpy(locuser, parameter);   8 		add_uic_translation(remuid, remgid, remhost, locuser);- 	    } else if (!strcmp(parameter, "EXPORT"))  	    {' 	        parameter = strtok(NULL, ":");  		if (parameter == NULL) 		    continue;   		strcpy(exportpath, parameter);    		parameter = strtok(NULL, ":"); 		if (parameter == NULL) 		    continue;  		strcpy(remhost, parameter);   ' 		add_export_path(exportpath, remhost); 1 	    } else if (!strcmp(parameter, "GMT_OFFSET"))  	    {' 	        parameter = strtok(NULL, ":"); 0 		GMT_OFFSET = (long)(atof(parameter) * 3600.0);5 	    } else if (!strcmp(parameter, "ANONYMOUS_USER"))  	    {/ 	        parameter = strupr(strtok(NULL, ":")); 8 		NFS_ANONYMOUS = (char *)malloc(strlen(parameter) + 1);# 		strcpy(NFS_ANONYMOUS, parameter);  	    } 	} 	fclose(NFSconfig);      }        @ /******** internal PORT MAPPER ********************************/  0     /* Make sure there is room for this entry */$     if (RPCsrv_count >= MAX_RPC_SRV) 	return(0);      idx = RPCsrv_count++;   " /* Fill in the RPC entry fields */       /* Do the numbers first */(     RPCsrv_tab[idx].prog = RPCPROG_PMAP;/     RPCsrv_tab[idx].vers = 2;		/* !!!HACK!!! */ (     RPCsrv_tab[idx].prot = UDP_Protocol;+     RPCsrv_tab[idx].port = UDP_PORT_SUNRPC;        /* Process Name */>     strncpy(RPCsrv_tab[idx].name,pmap_name,strlen(pmap_name));          /* Process image file */      RPCsrv_tab[idx].name[0] = 0;  -     RPCsrv_tab[idx].init_routine = PMAP$INIT; '     RPCsrv_tab[idx].dispatch_routine =  . 		(*RPCsrv_tab[idx].init_routine)(&IPACP_Int);      : /******** internal MOUNT ********************************/  0     /* Make sure there is room for this entry */$     if (RPCsrv_count >= MAX_RPC_SRV) 	return(0);      idx = RPCsrv_count++;   " /* Fill in the RPC entry fields */       /* Do the numbers first */)     RPCsrv_tab[idx].prog = RPCPROG_MOUNT; /     RPCsrv_tab[idx                                                                                                                                                                                                                                                                           U]        	IPACP.SRC                        ;  [IPACP]RPC.C;1RE.REQ;1                                                                                                         O     B                                       ].vers = 1;		/* !!!HACK!!! */ (     RPCsrv_tab[idx].prot = UDP_Protocol;      RPCsrv_tab[idx].port = 2000;       /* Process Name */<     strncpy(RPCsrv_tab[idx].name,mnt_name,strlen(mnt_name));          /* Process image file */      RPCsrv_tab[idx].name[0] = 0;  ,     RPCsrv_tab[idx].init_routine = MNT$INIT;'     RPCsrv_tab[idx].dispatch_routine =  . 		(*RPCsrv_tab[idx].init_routine)(&IPACP_Int);  8 /******** internal NFS ********************************/  0     /* Make sure there is room for this entry */$     if (RPCsrv_count >= MAX_RPC_SRV) 	return(0);      idx = RPCsrv_count++;   " /* Fill in the RPC entry fields */       /* Do the numbers first */'     RPCsrv_tab[idx].prog = RPCPROG_NFS; /     RPCsrv_tab[idx].vers = 2;		/* !!!HACK!!! */ (     RPCsrv_tab[idx].prot = UDP_Protocol;(     RPCsrv_tab[idx].port = UDP_PORT_NFS;       /* Process Name */<     strncpy(RPCsrv_tab[idx].name,nfs_name,strlen(nfs_name));          /* Process image file */      RPCsrv_tab[idx].name[0] = 0;  ,     RPCsrv_tab[idx].init_routine = NFS$INIT;'     RPCsrv_tab[idx].dispatch_routine =  . 		(*RPCsrv_tab[idx].init_routine)(&IPACP_Int);  9 /********   internal PCNFSD ****************************/   7     /* Make sure there is room for yet another entry */ $     if (RPCsrv_count >= MAX_RPC_SRV)         return(0);     idx = RPCsrv_count++;      " /* Fill in the RPC entry fields */       /* Do the numbers first */*     RPCsrv_tab[idx].prog = RPCPROG_PCNFSD;     RPCsrv_tab[idx].vers = 1; (     RPCsrv_tab[idx].prot = UDP_Protocol;)     RPCsrv_tab[idx].port = UDP_PORT_AUTH;        /* Process Name */D     strncpy(RPCsrv_tab[idx].name, pcnfsd_name, strlen(pcnfsd_name));       /* Process image file */      RPCsrv_tab[idx].name[0] = 0;     /     RPCsrv_tab[idx].init_routine = PCNFSD$INIT; &     RPCsrv_tab[idx].dispatch_routine =. 		(*RPCsrv_tab[idx].init_routine)(&IPACP_Int); }       = /* Returns index of RPC service at given port.  Returns -1 if '    there is no service at that port. */    int RPC$CHECK_PORT(port) { 
     int i;  "     for (i=0; i<RPCsrv_count; i++)  	if (RPCsrv_tab[i].port == port) 	    return i;     return -1; }        /*K     Main input routine.  UDP datagrams to RPC serviced ports are sent here.  */  ; int RPC$INPUT ( index, SrcAddr , DstAdr , SrcPrt , DstPrt ,  		Size , Buff , out, len)      int index;!     unsigned int	SrcAddr, DstAdr; &     short unsigned int	SrcPrt, DstPrt;     int Size, *len;      struct rpc_msg *Buff,*out; { %     long unsigned int xid, auth_code;      enum msg_type direction;      struct call_body *call_body;"     struct reply_body *reply_body;     int result_len,RC;     long *body;       unsigned short uid=0, gid=0;#     unsigned char hname[256] = {0};      unsigned uic;      int checkcache;      static struct {  	int RC; 	long unsigned int xid, len; 	int index;  	unsigned char hname[256]; 	struct rpc_msg *out; &     } oldreplies[RPC_MAX_REPLY_CACHE];     char *username;      int authmechanism;*     static int nextcache, initialized = 0;       if (!initialized) { 
 	int loop;5 	for (loop = 0; loop < RPC_MAX_REPLY_CACHE; loop++) { I 	    oldreplies[loop].RC, oldreplies[loop].xid, oldreplies[loop].len = 0;   	    oldreplies[loop].index = 0;! 	    oldreplies[loop].out = NULL;  	} 	initialized++;  	nextcache = 0;      }   &     /* decode call and set up reply */&     XDR$ntov_uint(&Buff->rm_xid,&xid);     out->rm_xid = Buff->rm_xid; 1     XDR$ntov_int(&Buff->rm_direction,&direction); ,     XDR$vton_int(&REPLY,&out->rm_direction);     *len = 8;   %     if (direction != CALL) return(0);      call_body = &Buff->rm_call;        /* we now have a call */A     XDR$ntov_uint(&call_body->cb_rpcvers,&call_body->cb_rpcvers); ;     XDR$ntov_uint(&call_body->cb_prog,&call_body->cb_prog); ;     XDR$ntov_uint(&call_body->cb_vers,&call_body->cb_vers); ;     XDR$ntov_uint(&call_body->cb_proc,&call_body->cb_proc);   /     if (call_body->cb_rpcvers != RPC_VERSION) { B 	XDR$vton_int(&MSG_DENIED,&out->rm_reply.rp_stat);	     *len += 4;H 	XDR$vton_int(&RPC_MISMATCH,&out->rm_reply.rp_rjct.rj_stat);  *len += 4;D 	XDR$vton_int(&RPC_VERSION_LOW, &out->rm_reply.rp_rjct.rj_vers.low);F 	XDR$vton_int(&RPC_VERSION_HIGH, &out->rm_reply.rp_rjct.rj_vers.high); 	*len += 8; 
 	return 1; 	}       body = &call_body->cb_cred;                                                                                                                                                                                                                                                                                      
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                              
      (     /* Check out those credentials... *//     switch (authmechanism = xdr_int(*body++)) {  	case AUTH_NULL : { ( 		body += (RNDUP(xdr_int(*body))/4) + 1; 		break; 		}    	case AUTH_UNIX : {  		long *tmp;9 		unsigned int stamp,unix_len,name_len,unix_uid,unix_gid;   " 		XDR$vton_uint(body++,&unix_len);) 		tmp = body; body += RNDUP(unix_len)/4;   		if (tmp==body) break;    		XDR$vton_uint(tmp++,&stamp);! 		XDR$vton_uint(tmp++,&name_len); 1 		memcpy(hname,tmp,name_len);  hname[name_len]=0;  		strupr(hname); 		tmp += RNDUP(name_len)/4;		 ! 		XDR$vton_uint(tmp++,&unix_uid); ! 		XDR$vton_uint(tmp++,&unix_gid);  		uid=unix_uid; gid=unix_gid;  		break; 		}    	case AUTH_SHORT : {( 		body += (RNDUP(xdr_int(*body))/4) + 1; 		break; 		}    	default : {3 		XDR$vton_int(&MSG_DENIED,&out->rm_reply.rp_stat); ; 		XDR$vton_int(&AUTH_ERROR,&out->rm_reply.rp_rjct.rj_stat); < 		XDR$vton_int(&AUTH_BADCRED,&out->rm_reply.rp_rjct.rj_why); 		*len += 12;  		return(1); 		}  	}         /* Check the verifier */     switch (xdr_int(*body++)) {  	case AUTH_NULL : { ( 		body += (RNDUP(xdr_int(*body))/4) + 1; 		break; 		}    	case AUTH_UNIX : {  		long *tmp;9 		unsigned int stamp,unix_len,name_len,unix_uid,unix_gid;   " 		XDR$vton_uint(body++,&unix_len);+ 		tmp = body; body += (RNDUP(unix_len)/4);   		if (tmp==body) break;    		XDR$vton_uint(tmp++,&stamp);! 		XDR$vton_uint(tmp++,&name_len);  		tmp += RNDUP(name_len)/4;  		XDR$vton_uint(tmp++,&uid); 		XDR$vton_uint(tmp++,&gid); 		break; 		}    	case AUTH_SHORT : {( 		body += (RNDUP(xdr_int(*body))/4) + 1; 		break; 		}    	default : {3 		XDR$vton_int(&MSG_DENIED,&out->rm_reply.rp_stat); ; 		XDR$vton_int(&AUTH_ERROR,&out->rm_reply.rp_rjct.rj_stat); < 		XDR$vton_int(&AUTH_BADVERF,&out->rm_reply.rp_rjct.rj_why); 		*len += 12;  		return(1); 		}  	}    H     for (checkcache = 0; checkcache < RPC_MAX_REPLY_CACHE; checkcache++) 	/* B 	 * Add test to qualify the xid based on the port index.  It looksA 	 * like the Ultrix client has a bug where it passes the same xid @ 	 * for two different port values.  This causes us to reply with/ 	 * a meaningless answer to the second request.  	 * 6 	 * Tom Allebrandi (Allebrandi@Inland.Com) 11-Oct-1991 	 */+ 	if ((oldreplies[checkcache].xid == xid) && / 	    (oldreplies[checkcache].index == index) && <             (!strcmp(oldreplies[checkcache].hname,hname))) {' 	    *len = oldreplies[checkcache].len; 3 	    memcpy(out, oldreplies[checkcache].out, *len); $ 	    RC = oldreplies[checkcache].RC; 	    return(RC); 	}  2     if (!(username = map_uic(&uic,uid,gid,hname)))     {  	struct OPC OPC_buffer; $ 	struct dsc$descriptor OPC_descript;    	if (authmechanism == AUTH_UNIX) 	{? 	    /* Send an operator message telling them of the problem */ - 	    OPC_buffer.opc$b_ms_type = OPC$_RQ_RQST; = 	    *((int *)&OPC_buffer.opc$b_ms_target) = OPC$M_NM_OPER12; ' 	    sprintf(&OPC_buffer.opc$l_ms_text, A 		"RPC: User %d (group %d) from host %s (%d\.%d\.%d\.%d) failed \  authentication"," 		uid, gid, hname, SrcAddr & 0xff,( 		((SrcAddr & 0x0000ff00) / 0x00000100),? 		((SrcAddr & 0x00ff0000) / 0x00010000), SrcAddr / 0x01000000);   	    OPC_descript.dsc$w_length =% 		strlen(&OPC_buffer.opc$l_ms_text) + # 		((int)&OPC_buffer.opc$l_ms_text -  		    (int)&OPC_buffer);. 	    OPC_descript.dsc$b_class = DSC$                                                                                                                                                                                                                                                                           Bl        	IPACP.SRC                        ;  [IPACP]RPC.C;1;1BLI;1                                                                                                          O     B                               /       K_CLASS_S;. 	    OPC_descript.dsc$b_dtype = DSC$K_DTYPE_T;. 	    OPC_descript.dsc$a_pointer = &OPC_buffer;' 	    RC = SYS$SNDOPR(&OPC_descript, 0);  	}  :         uic = -2;	/* For security - set to unused value */     }         /* ok, we've accepted it. */F     XDR$vton_int(&MSG_ACCEPTED,&out->rm_reply.rp_stat);		   *len += 4;/     RC = (*RPCsrv_tab[index].dispatch_routine)(   		uic,  		hname, 		username,   		call_body, &  		&out->rm_reply.rp_acpt,&result_len,  		call_body->cb_prog,  		call_body->cb_vers,  		call_body->cb_proc   		);      *len += result_len;   6     nextcache = (nextcache + 1) % RPC_MAX_REPLY_CACHE;)     if (oldreplies[nextcache].len != 0) { '        free(oldreplies[nextcache].out);      }   $     oldreplies[nextcache].xid = xid;%     oldreplies[nextcache].len = *len; (     oldreplies[nextcache].index = index;/     strcpy(oldreplies[nextcache].hname, hname); ?     oldreplies[nextcache].out = (struct rpc_msg *)malloc(*len); 1     memcpy(oldreplies[nextcache].out, out, *len); "     oldreplies[nextcache].RC = RC;       return(RC);  }       M /****************************************************************************   . 		PortMap - RPC port mapper program (#1000000)	 Facility:   > 	ProtMap.C - Provide port mapping service under UDP (RFC 1057)  	 Abstract:   B 	Supports the Port Mapper protocol (PMAP) for the IPACP.  Provides 	RPC program #100000.    Author:   ) 	Bruce R. Miller, CMU NetDev, 12-Nov-1990 C 	Copyright (c) 1990, Bruce R. Miller and Carnegie-Mellon University    Module Modification History:  M  ***************************************************************************/   # /* Port Map specific definitions */    #define NPROCS			 6  #define PMAP_VERSION		 2 #define PMAP_VERSION_LOW	 2  #define PMAP_VERSION_HIGH	 2 #define NAUTHPROCS		 2 #define PCNFSD_VERSION		 1 #define PCNFSD_VERSION_LOW	 1 " #define PCNFSD_VERSION_HIGH      1  & int ((*(pmap_proc_vector[NPROCS]))());, int ((*(pcnfsd_proc_vector[NAUTHPROCS]))());      C /* NB:  At this point the opaque_auth structs come into play, since C    they are variable length structs, we declare cbody and areply as     long pointers */  E int PMAP$DISPATCH(uic,hname,username,cbody,areply,len,prog,vers,proc)      unsigned uic;      char *hname;     char *username;      long *cbody,*areply;     int *len;       unsigned int prog,vers,proc; {      long flavor;     int result_len;   )     /* fill in the authorization stuff */ &     XDR$vton_int(&AUTH_NONE,areply++);     XDR$vton_int(&0,areply++);      *len = 2*BYTES_PER_XDR_UNIT;  #     /* Is the program available? */      if (prog != RPCPROG_PMAP) { 2 	XDR$vton_int(&PROG_UNAVAIL,areply++);		*len += 4; 	return(1);  	}  -     /* is the procedure number reasonable? */ (     if ((proc >= NPROCS) || (proc <0)) {2 	XDR$vton_int(&PROC_UNAVAIL,areply++);		*len += 4; 	return(1);  	}  -     /* Is he requesting the right version? */ H     /* !!!HACK!!! should this check be a bound instead of inequality? */     if (vers != PMAP_VERSION) { 3 	XDR$vton_int(&PROG_MISMATCH,areply++);		*len += 4; 5 	XDR$vton_int(&PMAP_VERSION_LOW,areply++);	*len += 4; 6 	XDR$vton_int(&PMAP_VERSION_HIGH,areply++);	*len += 4; 	return(1);  	}   /* We're good to go */=     cbody += 4;		/* jump over rpc_vers,prog,vers, and proc */        /* ignore credentials */     flavor = xdr_int(*cbody++); -     cbody += ((RNDUP(xdr_int(*cbody))/4) +1);        /* ignore verifier */      flavor = xdr_int(*cbody++); -     cbody += ((RNDUP(xdr_int(*cbody))/4) +1);      ;     result_len = (*pmap_proc_vector[proc])(areply+1,cbody);      if (result_len < 0) { 2 	XDR$vton_int(&GARBAGE_ARGS,areply++);		*len += 4; 	return(1);  	}       /* it worked! */0     XDR$vton_int(&SUCCESS,areply++);		*len += 4;     *len += result_len;      return 1;                                                                                                                                                                                                                                                                            P;K        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        V      
       }       G /**********************************************************************    PMAP procedure #0	- Do nothing   */   int PMAPPROC_NULL(reply)     long *reply; {      return 0;  }       G /**********************************************************************    PMAP procedure #1	-    */   int PMAPPROC_SET(reply,map)      long *reply;     struct mapping *map; {      return 0;  }       G /**********************************************************************    PMAP procedure #2    */   int PMAPPROC_UNSET(reply,map)      long *reply;     struct mapping *map; {      return 0;  }       G /**********************************************************************    PMAP procedure #3	-    */   int PMAPPROC_GETPORT(reply,map)      long *reply;     struct mapping *map; { 
     int i;  )     XDR$ntov_uint(&map->prog,&map->prog); )     XDR$ntov_uint(&map->vers,&map->vers); )     XDR$ntov_uint(&map->prot,&map->prot);   $     for (i=0; i<RPCsrv_count; i++) {) 	if ((RPCsrv_tab[i].prog == map->prog) && ) 	    (RPCsrv_tab[i].vers == map->vers) && ' 	    (RPCsrv_tab[i].prot == map->prot))  	    break;  	}3     if (i>=RPCsrv_count) return -1;	/* not found */      -     XDR$vton_uint(&RPCsrv_tab[i].port,reply); "     return 4;	/* size of an int */ }       G /**********************************************************************   5 PMAP procedure #4	- Dump a list of known RPC services    */   int PMAPPROC_DUMP(reply)     long *reply; { 
     int i;  $     for (i=0; i<RPCsrv_count; i++) {6 	/* optional data, a one (TRUE) means there is data */ 	XDR$vton_uint(&1,reply++);    	/* write out a mappping */ , 	XDR$vton_uint(&RPCsrv_tab[i].prog,reply++);, 	XDR$vton_uint(&RPCsrv_tab[i].vers,reply++);, 	XDR$vton_uint(&RPCsrv_tab[i].prot,reply++);, 	XDR$vton_uint(&RPCsrv_tab[i].port,reply++); 	}     /* end the list with a 0 */      XDR$vton_uint(&0,reply++);  6     return(RPCsrv_count*5*4 + 4);	/* size of an int */ }       G /**********************************************************************    PMAP procedure #5    */$ int PMAPPROC_CALLIT(reply,call_args)     long *reply;      struct call_args *call_args; {      return 0;  }       < /* Initialize the module.  This should be an entry point. */ int PMAP$INIT()  { (     pmap_proc_vector[0] = PMAPPROC_NULL;'     pmap_proc_vector[1] = PMAPPROC_SET; )     pmap_proc_vector[2] = PMAPPROC_UNSET; +     pmap_proc_vector[3] = PMAPPROC_GETPORT; (     pmap_proc_vector[4] = PMAPPROC_DUMP;*     pmap_proc_vector[5] = PMAPPROC_CALLIT;       return(PMAP$DISPATCH); }    enum arstat { -     AUTH_RES_OK, AUTH_RES_FAKE, AUTH_RES_FAIL  };   typedef struct {     unsigned length;     unsigned data[]; } stringdata;    struct auth_args {     stringdata aa_ident;     stringdata aa_password;  };   struct auth_results {      enum arstat ar_stat;     long        ar_uid;      long        ar_gid;  };   #define zchar 0x5b   scramble(char *s1, char *s2) {      while (*s1)      { %         *s2++ = (*s1 ^ zchar) & 0x7f;  	s1++;     }      *s2 = 0; }     / /* Initialize PCNFSD...At least we'll try... */  int PCNFSD$INIT()  { ,     pcnfsd_proc_vector[0] = PCNFSDPROC_NULL;,     pcnfsd_proc_vector[1] = PCNFSDPROC_AUTH;       return(PCNFSD$DISPATCH); }   O int PCNFSD$DISPATCH(uic, hname, username, cbody, areply, len, prog, vers, proc)      unsigned uic;      char *hname;     char *username;      long *cbody, *areply;      int *len; "     unsigned int prog, vers, proc;      {      int flavor, result_len; '     XDR$vton_int(&AUTH_NONE, areply++);      XDR$vton_int(&0, areply++);       *len = 2*BYTES_PER_XDR_UNIT;  #     /* Is the program available? */      if (prog != RPCPROG_PCNFSD)      { .         XDR$vton_int(&PROG_UNAVAIL, areply++); 	*len += 4;  	return(1);      }   -     /* Is the proc                                                                                                                                                                                                                                                                           jk        	IPACP.SRC                        ;  [IPACP]RPC.C;1;1BLI;1                                                                                                          O     B                         U      >       edure number reasonable? */ +     if ((proc >= NAUTHPROCS) || (proc < 0))      { .         XDR$vton_int(&PROC_UNAVAIL, areply++); 	*len += 4;  	return(1);      }   -     /* Is he requesting the right version? */ D     if ((vers < PCNFSD_VERSION_LOW) || (vers > PCNFSD_VERSION_HIGH))     { /         XDR$vton_int(&PROG_MISMATCH, areply++);  	*len += 4; - 	XDR$vton_int(&PCNFSD_VERSION_LOW, areply++);  	*len += 4; . 	XDR$vton_int(&PCNFSD_VERSION_HIGH, areply++); 	*len += 4;  	return(1);      }           cbody += 4;           flavor = xdr_int(*cbody++); ,     cbody += ((RNDUP(xdr_int(*cbody))/4)+1);       flavor = xdr_int(*cbody++); ,     cbody += ((RNDUP(xdr_int(*cbody))/4)+1);  >     result_len = (*pcnfsd_proc_vector[proc])(areply+1, cbody);     if (result_len < 0)      { .         XDR$vton_int(&GARBAGE_ARGS, areply++); 	*len += 4;  	return(1);      }      %     XDR$vton_int(&SUCCESS, areply++);      *len += 4;     *len += result_len;      return 1;  }     int PCNFSDPROC_NULL(long *reply) {      return 0;  }   5 int PCNFSDPROC_AUTH(long *reply, struct auth_args *a)  { !     static struct auth_results r;      char username[32];     char password[64];     int c1, c2, tmplen;      .     XDR$ntov_arb(&a, &tmplen, sizeof(tmplen));1     XDR$ntov_arb(&a, &username, nfs_int(tmplen)); "     username[nfs_int(tmplen)] = 0;.     XDR$ntov_arb(&a, &tmplen, sizeof(tmplen));1     XDR$ntov_arb(&a, &password, nfs_int(tmplen)); "     password[nfs_int(tmplen)] = 0;          r.ar_stat = AUTH_RES_FAIL;!     scramble(username, username); !     scramble(password, password);      +     XDR$vton_uint(&AUTH_RES_FAIL, reply++);      XDR$vton_uint(&0, reply++);      XDR$vton_uint(&0, reply++);        return(3*4); }                                                                                                                                                                                                                                                                                                                      * [IPACP]SNMP.C;1 +  , [   .     /     4                           - ;    0   1    2   3      K  P   W   O     5   6 U,  7 1-  8          9          G    H  J                 /*A 	****************************************************************   0 		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.  A 	****************************************************************  */ /*1  * Simple Network Management Protocol (RFC 1067).   *  */ < /***********************************************************3 	Copyright 1988, 1989 by Carnegie Mellon University   )                                                                                                                                                                                                                                                                                    y        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        )      
                    All Rights Reserved   F Permission to use, copy, modify, and distribute this software and its A documentation for any purpose and without fee is hereby granted,  F provided that the above copyright notice appear in all copies and that@ both that copyright notice and this permission notice appear in 9 supporting documentation, and that the name of CMU not be B used in advertising or publicity pertaining to distribution of the6 software without specific, written prior permission.    D CMU DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDINGH ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALLC CMU BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR C ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, F WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,C ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS 	 SOFTWARE. C ******************************************************************/    #ifdef KINETICS  #include "gw.h"  #include "ab.h"  #include "inet.h"  #include "fp4/cmdmacro.h"  #include "fp4/pbuf.h"  #include "glob.h"  #endif  ) #if (defined(unix) && !defined(KINETICS))  #include <sys/types.h> #include <netinet/in.h>  #ifndef NULL #define NULL 0 #endif #endif  
 #ifdef vms #include in  #endif   #include "asn1.h"  #include "snmp.h"  #include "snmp_impl.h"   #include "mib.h"     u_char *_ snmp_parse_var_op(data, var_name, var_name_len, var_val_type, var_val_len, var_val, listlength) E     register u_char *data;  /* IN - pointer to the start of object */ <     oid	    *var_name;	    /* OUT - object id of variable */B     int	    *var_name_len;  /* IN/OUT - length of variable name */Y     u_char  *var_val_type;  /* OUT - type of variable (int or octet string) (one byte) */ :     int	    *var_val_len;   /* OUT - length of variable */P     u_char  **var_val;	    /* OUT - pointer to ASN1 encoded value of variable */T     int	    *listlength;    /* IN/OUT - number of valid bytes left in var_op_list */ {      u_char	    var_op_type; &     int		    var_op_len = *listlength;$     u_char	    *var_op_start = data;  =     data = asn_parse_header(data, &var_op_len, &var_op_type);      if (data == NULL){ 	ERROR("");  	return NULL;      } @     if (var_op_type != (u_char)(ASN_SEQUENCE | ASN_CONSTRUCTOR)) 	return NULL; T     data = asn_parse_objid(data, &var_op_len, &var_op_type, var_name, var_name_len);     if (data == NULL){ 	ERROR("");  	return NULL;      } O     if (var_op_type != (u_char)(ASN_UNIVERSAL | ASN_PRIMITIVE | ASN_OBJECT_ID))  	return NULL; 6     *var_val = data;	/* save pointer to this object */.     /* find out what type of object this is */=     data = asn_parse_header(data, &var_op_len, var_val_type);      if (data == NULL){ 	ERROR("");  	return NULL;      }      *var_val_len = var_op_len;     data += var_op_len; .     *listlength -= (int)(data - var_op_start);     return data; }   ( shift_array(begin, length, shift_amount)     u_char	    *begin;     register int    length;      int		    shift_amount; {      register u_char	*old, *new;        if (shift_amount >= 0){  	old = begin + length - 1; 	new = old + shift_amount;   	while(length--) 	    *new-- = *old--;      } else { 	old = begin;  	new = begin + shift_amount;   	while(length--) 	    *new++ = *old++;      }  }    u_char *_ snmp_build_var_op(data, var_name, var_name_len, var_val_type, var_val_len, var_val, listlength) S     register u_char *data;	/* IN - pointer to the beginning of the output buffer */ 4     oid		*var_name;	/* IN - object id of variable */6     int		*var_name_len;	/* IN - length of object id */4     u_char	var_val_type;	/* IN - type of variable */3     int		var_val_len;	/* IN - length of variable */ 1     u_char	*var_val;	/* IN - value of variable */ [     register int *listlength;    /* IN/OUT - number of valid bytes left in output buffer */  { /     int		    dummyLen, headerLen, header_shift;      u_char	    *dataPtr;       dummyLen = *listlength;      dataPtr = data; Z     data = asn_b                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          @        	IPACP.SRC                      [  ;  [IPACP]SNMP.C;1S.REQ;1                                                                                                                                       $&             uild_header(data, &dummyLen, (u_char)(ASN_SEQUENCE | ASN_CONSTRUCTOR), 0);     if (data == NULL){ 	ERROR("");  	return NULL;      }      headerLen = data - dataPtr;      *listlength -= headerLen; ,     data = asn_build_objid(data, listlength,= 	    (u_char)(ASN_UNIVERSAL | ASN_PRIMITIVE | ASN_OBJECT_ID),  	    var_name, *var_name_len);     if (data == NULL){ 	ERROR("");  	return NULL;      }      switch(var_val_type){  	case ASN_INTEGER:9 	    data = asn_build_int(data, listlength, var_val_type, $ 		    (long *)var_val, var_val_len); 	    break;  	case GAUGE: 	case COUNTER: 	case TIMETICKS:B 	    data = asn_build_unsigned_int(data, listlength, var_val_type,& 		    (u_long *)var_val, var_val_len); 	    break;  	case ASN_OCTET_STR: 	case IPADDRESS: 	case OPAQUE: < 	    data = asn_build_string(data, listlength, var_val_type, 		    var_val, var_val_len); 	    break;  	case ASN_OBJECT_ID:; 	    data = asn_build_objid(data, listlength, var_val_type, 1 		    (oid *)var_val, var_val_len / sizeof(oid));  	    break;  	case ASN_NULL: ; 	    data = asn_build_null(data, listlength, var_val_type);  	    break; 	 	default:  	    ERROR("wrong type");  	    return NULL;      }      if (data == NULL){ 	ERROR("");  	return NULL;      } ,     dummyLen = (data - dataPtr) - headerLen;     header_shift = 0;      if (dummyLen >= 0x80){ 	header_shift++; 	if (dummyLen > 0xFF)  	    header_shift++;     }      if (header_shift){) 	/* should check available length here */ : 	shift_array(dataPtr + headerLen, dummyLen, header_shift); 	data += header_shift; 	headerLen += header_shift;      }        j     if (asn_build_header(dataPtr, &dummyLen, (u_char)(ASN_SEQUENCE | ASN_CONSTRUCTOR), dummyLen) == NULL){ 	ERROR("");  	return NULL;      }      return data; }        int  snmp_build_trap(out_data, length, sysOid, sysOidLen, myAddr, trapType, specificType, time, varName, varNameLen, varType, varLen, varVal)     register u_char  *out_data;      int	    *length;     oid	    *sysOid;     int	    sysOidLen;     u_long  myAddr;      int	    trapType;      int	    specificType;      u_long  time;      oid	    *varName;      int	    varNameLen;      u_char  varType;     int	    varLen;      u_char  *varVal; { %     long    version = SNMP_VERSION_1; &     int	    sidLen = strlen("public");     int	    dummyLen; U     u_char  *out_auth, *out_header, *out_pdu, *out_varHeader, *out_varlist, *out_end; .     int	    auth_shift, pdu_shift, list_shift;              out_auth = out_data;^     out_header = snmp_auth_build(out_data, length, (u_char *)"public", &sidLen, &version, 90);     if (out_header == NULL){ 	ERROR("auth build failed");
 	return 0;     } L     out_pdu = asn_build_header(out_header, length, (u_char)TRP_REQ_MSG,                                                                                                                                                                                                                                                                            c:        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                              
      90);     if (out_pdu == NULL){  	ERROR("header build failed");
 	return 0;     } /     out_data = asn_build_objid(out_pdu, length, : 		(u_char)(ASN_UNIVERSAL | ASN_PRIMITIVE | ASN_OBJECT_ID), 		(oid *)sysOid, sysOidLen);     if (out_data == NULL){" 	ERROR("build enterprise failed");
 	return 0;     } 1     out_data = asn_build_string(out_data, length, : 		(u_char)(ASN_UNIVERSAL | ASN_PRIMITIVE | ASN_OCTET_STR),% 		(u_char *)&myAddr, sizeof(myAddr));      if (out_data == NULL){" 	ERROR("build agent_addr failed");
 	return 0;     } .     out_data = asn_build_int(out_data, length,8 		(u_char)(ASN_UNIVERSAL | ASN_PRIMITIVE | ASN_INTEGER),' 		(long *)&trapType, sizeof(trapType));      if (out_data == NULL){! 	ERROR("build trap_type failed"); 
 	return 0;     } .     out_data = asn_build_int(out_data, length,8 		(u_char)(ASN_UNIVERSAL | ASN_PRIMITIVE | ASN_INTEGER),/ 		(long *)&specificType, sizeof(specificType));      if (out_data == NULL){$ 	ERROR("build specificType failed");
 	return 0;     } <     out_varHeader = asn_build_unsigned_int(out_data, length, 		(u_char)(TIMETICKS), 		&time, sizeof(time));      if (out_varHeader == NULL){   	ERROR("build timestampfailed");
 	return 0;     } i     out_varlist = asn_build_header(out_varHeader,  length, (u_char)(ASN_SEQUENCE | ASN_CONSTRUCTOR), 90); d     out_end = snmp_build_var_op(out_varlist, varName, &varNameLen, varType, varLen, varVal, length);     if (out_end == NULL){  	ERROR("build varop failed"); 
 	return 0;     }        /*K      * Because of the assumption above that header lengths would be encoded S      * in one byte, things need to be fixed, now that the actual lengths are known.       */      list_shift = 0; $     *length = out_end - out_varlist;     if (*length >= 0x80){  	list_shift++; 	if (*length > 0xFF) 	    list_shift++;     }      pdu_shift = 0;/     *length = (out_end - out_pdu) + list_shift;      if (*length >= 0x80){  	pdu_shift++;  	if (*length > 0xFF) 	    pdu_shift++;      }      auth_shift = 0; K     /*  2 below is the size of the assumed asn header in the auth header */ @     *length = (out_end - out_auth) - 2 + pdu_shift + list_shift;     if (*length >= 0x80){  	auth_shift++; 	if (*length > 0xFF) 	    auth_shift++;     } -     if (auth_shift + pdu_shift + list_shift){  	/* K 	 * Shift packet (from start of varlist to end of packet) by the sum of the  	 * necessary shift counts.  	 */V 	shift_array(out_varlist, out_end - out_varlist, auth_shift + pdu_shift + list_shift);* 	/* Now adjust pointers into the packet */0 	out_end += auth_shift + pdu_shift + list_shift;4 	out_varlist += auth_shift + pdu_shift + list_shift;) 	out_varHeader += auth_shift + pdu_shift;      } 4     /* Now rebuild header with the actual lengths */%     dummyLen = out_end - out_varlist; v     if (asn_build_header(out_varHeader, &dummyLen, (u_char)(ASN_SEQUENCE | ASN_CONSTRUCTOR), dummyLen) != out_varlist)
 	return 0;        if (auth_shift + pdu_shift){ 	/* K 	 * Shift packet (from start of varlist to end of packet) by the sum of the  	 * necessary shift counts.  	 */G 	shift_array(out_pdu, out_varHeader - out_pdu, auth_shift + pdu_shift); * 	/* Now adjust pointers into the packet */# 	out_pdu += auth_shift + pdu_shift;  	out_header += auth_shift;     } 4     /* Now rebuild header with the actual lengths */!     dummyLen = out_end - out_pdu; Z     if (asn_build_header(out_header, &dummyLen, (u_char)TRP_REQ_MSG, dummyLen) != out_pdu)
 	return 0;       out_data = out_auth;!     *length = out_end - out_auth; n     out_data = snmp_auth_build(out_data, length, (u_char *)"public", &sidLen, &version, out_end - out_header);      if (out_data != out_header){ 	ERROR("internal error"); 
 	return 0;     } !     *length = out_end - out_auth;      return *length;  }                                                        * [IPACP]SNMP_AGENT.C;1 +  ,   . !    /     4 p   !                        - ;    0   1    2   3      K  P   W   O !    5   6  /U,  7 2-  8          9          G    H  J                           /*A 	****************************************************************   0 		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@                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           k        	IPACP.SRC                       ;  [IPACP]SNMP_AGENT.C;11                                                                                                         p     !                         @             	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.  A 	****************************************************************  */ /*1  * Simple Network Management Protocol (RFC 1067).   *  */ < /***********************************************************3 	Copyright 1988, 1989 by Carnegie Mellon University   )                       All Rights Reserved   F Permission to use, copy, modify, and distribute this software and its A documentation for any purpose and without fee is hereby granted,  F provided that the above copyright notice appear in all copies and that@ both that copyright notice and this permission notice appear in 9 supporting documentation, and that the name of CMU not be B used in advertising or publicity pertaining to distribution of the6 software without specific, written prior permission.    D CMU DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDINGH ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALLC CMU BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR C ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, F WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,C ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS 	 SOFTWARE. C ******************************************************************/    #ifdef KINETICS  #include "gw.h"  #include "ab.h"  #include "inet.h"  #include "fp4/cmdmacro.h"  #include "fp4/pbuf.h"  #include "glob.h"  #endif  ) #if (defined(unix) && !defined(KINETICS))  #include <sys/types.h> #include <netinet/in.h>  #ifndef NULL #define NULL 0 #endif #endif  
 #ifdef vms #include in , #define bcopy(s1,s2,size) memcpy(s2,s1,size) #endif   #include "snmp.h"  #include "snmp_impl.h" #include "asn1.h"    #include "mib.h"   int	snmp_input();  void	snmp_trap();  int	create_identical();  int	parse_var_op_list(); int	snmp_access();   #define NUM_COMMUNITIES	5 & char	*communities[NUM_COMMUNITIES] = {     "public",      "proxy",     "private",     "regional", 
     "core" };  5 /* these can't be global in a multi-process router                                                                                                                                                                                                                                                                           }        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        bZ      
       */       u_char	sid[SID_MAX_LEN + 1];     int		sidlen;     u_char	*packet_end;      int		community;      int + snmp_input(in_buff,in_len,out_buff,out_len)      char *in_buff,*out_buff;     int in_len;      int *out_len;  {      int		    out_length;     u_short	    udp_src;  @     if (!snmp_agent_parse(in_buff, in_len, out_buff, out_len )){
 	return 0;     }        return 1;  }    int > snmp_agent_parse(data, length, out_data, out_length, sourceip)     register u_char	*data;     int			length;      register u_char	*out_data;     int			*out_length;7     u_long		sourceip;	/* possibly for authentication */  {      u_char	    msg_type, type;     long	    zero = 0;&     long	    reqid, errstat, errindex;7     register u_char *out_auth, *out_header, *out_reqid; !     u_char	    *startData = data; "     int		    startLength = length;     long	    version; &     int		    header_shift, auth_shift;       sidlen = SID_MAX_LEN;   ;     /* authenticates message and returns length if valid */ B     data = snmp_auth_parse(data, &length, sid, &sidlen, &version);     if (data == NULL){ 	ERROR("bad authentication");  	/* send auth fail trap */
 	return 0;     } #     if (version != SNMP_VERSION_1){  	ERROR("wrong version"); 	return NULL;      } #     community = get_community(sid);      if (community == -1) 	return NULL; 6     data = asn_parse_header(data, &length, &msg_type);     if (data == NULL){ 	ERROR("bad header"); 
 	return 0;     } [     if (msg_type != GET_REQ_MSG && msg_type != GETNEXT_REQ_MSG && msg_type != SET_REQ_MSG){ 
 	return 0;     } F     data = asn_parse_int(data, &length, &type, &reqid, sizeof(reqid));     if (data == NULL){ 	ERROR("bad parse of reqid"); 
 	return 0;     } J     data = asn_parse_int(data, &length, &type, &errstat, sizeof(errstat));     if (data == NULL){ 	ERROR("bad parse of errstat"); 
 	return 0;     } L     data = asn_parse_int(data, &length, &type, &errindex, sizeof(errindex));     if (data == NULL){  	ERROR("bad parse of errindex");
 	return 0;     }      /*I      * Now start cobbling together what is known about the output packet. N      * The final lengths are not known now, so they will have to be recomputed      * later.       */      out_auth = out_data;O     out_header = snmp_auth_build(out_auth, out_length, sid, &sidlen, &zero, 0);      if (out_header == NULL){! 	ERROR("snmp_auth_build failed"); 
 	return 0;     } Q     out_reqid = asn_build_header(out_header, out_length, (u_char)GET_RSP_MSG, 0);      if (out_reqid == NULL){  	ERROR(""); 
 	return 0;     }   A     type = (u_char)(ASN_UNIVERSAL | ASN_PRIMITIVE | ASN_INTEGER); %     /* return identical request id */ Q     out_data = asn_build_int(out_reqid, out_length, type, &reqid, sizeof(reqid));      if (out_data == NULL){ 	ERROR("build reqid failed"); 
 	return 0;     }   /     /* assume that error status will be zero */ N     out_data = asn_build_int(out_data, out_length, type, &zero, sizeof(zero));     if (out_data == NULL){ 	ERROR("build errstat failed"); 
 	return 0;     }   .     /* assume that error index will be zero */N     out_data = asn_build_int(out_data, out_length, type, &zero, sizeof(zero));     if (out_data == NULL){  	ERROR("build errindex failed");
 	return 0;     }   ]     errstat = parse_var_op_list(data, length, out_data, *out_length, msg_type, &errindex, 0); @     if (msg_type == SET_REQ_MSG && errstat == SNMP_ERR_NOERROR){ 	/* P 	 * SETS require 2 passes through the var_op_list.  The first pass verifies thatP 	 * all types, lengths, and values are valid, and the second does the set.  Then2 	 * the identical GET RESPONSE packet is returned. 	 */Z 	errstat = parse_var_op_list(data, length, out_data, *out_length, msg_type, &errindex, 1);@ 	if (create_identical(startData, out_auth, startLength, 0L, 0L)) 	    return 1;
 	return 0;     }      switch((short)errstat){  	case SNMP_ERR_NOERROR:  	    /* L 	     * Because of the assumption above that header lengths would be encodedT 	     * in one byte, things need to be fixed, now that the actual lengths are known. 	     */ 	    header_shift = 0;* 	    *out_length = packet_end - out_reqid; 	    if (*out_length >= 0x80){ 		header_shift++;  		if (*out_length > 0xFF)  		    header_shift++;  	    } 	    auth_shift = 0;> 	    *out_length = (packet_end - out_auth) - 2 + header_shift; 	    if (*out_length >= 0x80){ 		auth_shift++;  		if (*out_length > 0xFF)  		    auth_shift++;  	    }$ 	    if (auth_shift + header_shift){ 		/*F 		 * Shift packet (from request id to end of packet) by the sum of the 		 * necessary shift counts. 		 */ L 		shift_array(out_reqid, packet_end - out_reqid, auth_shift + header_shift);+ 		/* Now adjust pointers into the packet */ * 		packet_end += auth_shift + header_shift;) 		out_reqid += auth_shift + header_shift;  		out_header += auth_shift;  	    } 	     6 	    /* re-encode the headers with the real lengths */ 	    out_data = out_header; * 	    *out_length = packet_end - out_reqid;Q 	    out_data = asn_build_header(out_data, out_length, GET_RSP_MSG, *out_length);   	    if (out_data != out_reqid){" 		ERROR("internal error: header"); 		return 0;  	    }   	    out_data = out_auth; ) 	    *out_length = packet_end - out_auth; d 	    out_data = snmp_auth_build(out_data, out_length, sid, &sidlen, &zero, packet_end - out_header);! 	    if (out                                                                                                                                                                                                                                                                              {                                        Q                q|wcz|j
                                                                                                                                           G 
      M       Z{ofkL,DTxwJ+R^^9T*M_;ObE$=e3[7	+\x	p78~u|j%.qw"9dVa[a$_n  BS>#ID]|^\z  zOy*iOt]-:5qc'9m$.30+9a@f$>Z}e)D4X	 TUL5Fw^57TJ$r(k,jK"f|Hz-y(6YMN+*fj$bA RdXPoH6WmWZk,`vz{196{68P(H&IT-($t`[0wBu }I
%`&Jd6e4`+08rv/AP9	a &,>{tJ`a@2f5"s
}}/&w}MrYAcO2s?W
tg|_`MFai{85UnQ6CJXW~GwYXu+yS\k{}8i/V ]LT!,{u$5T60w$!>:rg O0&xc_uo8SMK|  m%QSR`08eGA.HbEu|%h.qF{<sM_;qmEoNVMIRf~J^K7Ir{4DoLeIlatqM6Y >F6|Dgcw+%d=klo7,acF0]m*Ke>4GF{>Mc5'O[=G{\n/lr,|r!ts2\;LiGyHsf5H5$Vd)5Jp!ec^}`hiIlF)l%&OJW~MF*n
89i?>EP(l~[B7CUbAGRw0}`cn6RV5~|k@dP,K&E	'wjX<?L">g7
]@0x-TlJ	^o"p]tDG;
 (Bef9m+asH%bx9W"QuJn[F8ndp!$o#N`
x%Ii9[A^Zjq0(7'E{Y_iN% bCR'U^&<9E)xBZ5k~d /@2"0e@2W~}x67G/yhOa"\	$x%
A3]_JHSf
 0s<2aKG87` LK9t[uUgmv!<nsGzqt6-

P,'(O~~w.RxV$K!:FN=#b+3KQjuK46R1K+iI&Ppl8[f?[5\@t(n67$2,#v'jyo|pe:vspg=HncV-GK	<,X,v(UCYCxXmc
(_a	y%%rh+zj7GMS(9Z[A%EZYl,Nld9dYP'	eB_56XPG^IgN+oq^%7<7kB>x]Fp@"O`q#JCI[eoe}p&+WeY.p5"6Y-+3D@9Jtt529vGs1uBl?q@eD9Q u)8{#P^n2mb`?jmRuR`r}itl}mC\i:P`0=;@t|GtrniW/k	(*lUr+!e{|08D
~]c{W+ Ad+aubyk++d% !SYx I$qJ^C"kZ.VJwS=
+4Yw0"	}l	ps/1feZfzdhvbU@\c<
\9_bdg)_~*`3%)!1).>u9Z]-	FA^O	m:Sp1&o!UC,);,(`w3m|ywIGpF:<m,[a15b?8KtQN%o|A>	0=fI;!"g	;5^Td\1/xhs'u)vmLVyk0jm?3%zchX@j^RGX#/4&`^r1M1Zxl@q*_.YA3T%8z{nCrj5FuCiJ@X@pp6%a#M}CQ`k	7<gjp'n`[g[?|.Y	p"@tE@z ;]u_d@
YA&_Be< h tQ<+o].H5+3?QeS=~n)"?J9VKD
H10X_iY@^`9z~d^&X/H)?8vOd+n`~8N,}_)sy8ul>)F7rZ@QR2aDaV@gwFP^}w"d                                                                                                                                                                                                                                                                           m.        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        ư      
      &Vv&nY>{y "46C$S'LV+f(
#-OVAkIF`'Y}UZNt(W!A5LBM8SKkNPmHeRj2|.ZDt{	PrwvJC?ake$1m1@\|pu9E'0B^&eK[d)~THK_\0/asTvj!s:E,x]oub8i6kvrNHUF}	*G+B~Az=tG6k9Af`P4C-{kA!ege11"Dw[oj	:6zD
:6dLQE@M"n_QtR9W8'eHL-&> -i,r"=A+5Wj)SO54\lUr p,a!k9 ~D|2m0Xd'H3hG]{fE,l_l+) jZ?j
Zxu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Lj2+UW*|D`1><p=[F*xECE!7Ytkie"V_,alN[(t7oVte!iz =El)n\RDh	JmqW5@5t';3ubable.tail->path                                                                                                                                                                                                                                                           0<        	IPACP.SRC                       ;  [IPACP]SNMP_AGENT.C;11                                                                                                         p     !                         !             _data != out_header){  		ERROR("internal error"); 		return 0;  	    } 	    break;  	case SNMP_ERR_NOSUCHNAME: 	case SNMP_ERR_TOOBIG: 	case SNMP_ERR_BADVALUE: 	case SNMP_ERR_READONLY: 	case SNMP_ERR_GENERR:O 	    if (create_identical(startData, out_auth, startLength, errstat, errindex))  		break; 	    return 0;	 	default:  	    return 0;     } (     *out_length = packet_end - out_auth;     return 1;  }    /*O  * Parse_var_op_list goes through the list of variables and retrieves each one, V  * placing it's value in the output packet.  If doSet is non-zero, the variable is setQ  * with the value in the packet.  If any error occurs, an error code is returned.   */  int L parse_var_op_list(data, length, out_data, out_length, msgtype, index, doSet)     register u_char	*data;     int			length;      register u_char	*out_data;     int			out_length;      u_char		msgtype;     register long	*index;      int			doSet; {      u_char  type; #     oid	    var_name[MAX_NAME_LEN]; &     int	    var_name_len, var_val_len;-     u_char  var_val_type, *var_val, statType;      register u_char *statP;      int	    statLen;     u_short acl;     int	    rw, exact;     int	    (*write_method)();&     u_char  *headerP, *var_list_start;                                                                                                                                                                                                                                                                                        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        [)            int	    dummyLen;      int	    header_shift;      u_char  *getStatPtr();       if (msgtype == SET_REQ_MSG)  	rw = WRITE;     else 	rw = READ; #     if (msgtype == GETNEXT_REQ_MSG)  	exact = FALSE;      else 	exact = TRUE;2     data = asn_parse_header(data, &length, &type);     if (data == NULL){' 	ERROR("not enough space for varlist");  	return PARSE_ERROR;     } :     if (type != (u_char)(ASN_SEQUENCE | ASN_CONSTRUCTOR)){ 	ERROR("wrong type");  	return PARSE_ERROR;     }      headerP = out_data; d     out_data = asn_build_header(out_data, &out_length, (u_char)(ASN_SEQUENCE | ASN_CONSTRUCTOR), 0);     if (out_data == NULL){0     	ERROR("not enough space in output packet"); 	return BUILD_ERROR;     }      var_list_start = out_data;       *index = 1;      while((int)length > 0){ ! 	/* parse the name, value pair */  	var_name_len = MAX_NAME_LEN; p 	data = snmp_parse_var_op(data, var_name, &var_name_len, &var_val_type, &var_val_len, &var_val, (int *)&length); 	if (data == NULL) 	    return PARSE_ERROR;? 	/* now attempt to retrieve the variable on the local entity */ ^ 	statP = getStatPtr(var_name, &var_name_len, &statType, &statLen, &acl, exact, &write_method); 	if (statP == NULL)   	    return SNMP_ERR_NOSUCHNAME;< 	/* Check if this user has access rights to this variable */& 	if (!snmp_access(acl, community, rw)), 	    return SNMP_ERR_NOSUCHNAME;	/* bogus */ 	if (msgtype == SET_REQ_MSG){  	    if (write_method == 0){K 		/* see if the type and value is consistent with this entities variable */ @ 		if (!goodValue(var_val_type, var_val_len, statType, statLen)){ 		    return SNMP_ERR_BADVALUE;  		} ( 		/* actually do the set if necessary */ 		if (doSet)F 		    setVariable(var_val, var_val_type, var_val_len, statP, statLen); 	    } else { I 		if (!(*write_method)(doSet, var_val, var_val_type, var_val_len, statP))  		    return SNMP_ERR_BADVALUE;  	    } 	}O 	/* retrieve the value of the variable and place it into the outgoing packet */ h 	out_data = snmp_build_var_op(out_data, var_name, &var_name_len, statType, statLen, statP, &out_length); 	if (out_data == NULL){  	    return SNMP_ERR_TOOBIG; 	}   	(*index)++;     } I     packet_end = out_data;  /* save a pointer to the end of the packet */        /*K      * Because of the assumption above that header lengths would be encoded S      * in one byte, things need to be fixed, now that the actual lengths are known.       */      header_shift = 0; -     out_length = packet_end - var_list_start;      if (out_length >= 0x80){ 	header_shift++; 	if (out_length > 0xFF)  	    header_shift++;     }      if (header_shift){H 	shift_array(var_list_start, packet_end - var_list_start, header_shift); 	packet_end += header_shift;  	var_list_start += header_shift;     }   4     /* Now rebuild header with the actual lengths */+     dummyLen = packet_end - var_list_start; j     if (asn_build_header(headerP, &dummyLen, (u_char)(ASN_SEQUENCE | ASN_CONSTRUCTOR), dummyLen) == NULL){/ 	return SNMP_ERR_TOOBIG;	/* bogus error ???? */      }      *index = 0;      return SNMP_ERR_NOERROR; }    /*M  * create a packet identical to the input packet, except for the error status F  * and the error index which are set according to the input variables.-  * Returns 1 upon success and 0 upon failure.   */  int C create_identical(snmp_in, snmp_out, snmp_length, errstat, errindex)      u_char	    *snmp_in;     u_char	    *snmp_out;      int		    snmp_length;      long	    errstat, errindex;  {      register u_char *data;     u_char	    type;     u_long	    dummy; "     int		    length, headerLength;R     register u_char *headerPtr, *reqidPtr, *errstatPtr, *errindexPtr, *varListPtr;  :     bcopy((char *)snmp_in, (char *)snmp_out, snmp_length);     length = snmp_length; Q     headerPtr = snmp_auth_parse(snmp_out, &length, sid, &sidlen, (long *)&dummy);      if (headerPtr == NULL)
 	return 0;F     reqidPtr = asn_parse_header(headerPtr, &length, (u_char *)&dummy);     if (reqidPtr == NULL) 
 	return 0;     headerLength = length;h     errstatPtr = asn_parse_int(reqidPtr, &length, &type, (long *)&dummy, sizeof dummy);	/* request id */     if (errstatPtr == NULL) 
 	return 0;m     errindexPtr = asn_parse_int(errstatPtr, &length, &type, (long *)&dummy, sizeof dummy);	/* error status */      if (errindexPtr == NULL)
 	return 0;l     varListPtr = asn_parse_int(errindexPtr, &length, &type, (long *)&dummy, sizeof dummy);	/* error index */     if (varListPtr == NULL) 
 	return 0;  Q     data = asn_build_header(headerPtr, &headerLength, GET_RSP_MSG, headerLength);      if (data != reqidPtr) 
 	return 0;     length = snmp_length; A     type = (u_char)(ASN_UNIVERSAL | ASN_PRIMITIVE | ASN_INTEGER); N     data = asn_build_int(errstatPtr, &length, type, &errstat, sizeof errstat);     if (data != errindexPtr)
 	return 0;Q     data = asn_build_int(errindexPtr, &length, type, &errindex, sizeof errindex);      if (data != varListPtr) 
 	return 0;(     packet_end = snmp_out + snmp_length;     return 1;  }    int  snmp_access(acl, community, rw)      u_short 	acl;      int		community;      int		rw; {      /*J      * Each group has 2 bits, the more significant one is for read access,4      * the less significant one is for write access.      */   G     community <<= 1;	/* multiply by two two shift two bits at a time */      if (rw == READ){A 	return (acl & (2 << community));    /* return the correct bit */      } else {! 	return (acl & (1 << community));      }  }    int  get_community(sessionid)     u_char	*sessionid; {      int	count;  5     for(count = 0; count < NUM_COMMUNITIES; count++){ 4 	if (!strcmp(communities[count], (char *)sessionid)) 	    break;      } !     if (count == NUM_COMMUNITIES)  	return -1;      return count;  }    int / goodValue(inType, inLen, actualType, actualLen)      u_char	inType, actualType;     int		inLen, actualLen; {      if (inLen > actualLen) 	return FALSE;"     return (inType == actualType); }   ? setVariable(var_val, var_val_type, var_val_len, statP, statLen)      u_char  *var_val;      u_char  var_val_type;      int	    var_val_len;     u_char  *statP;      int	    statLen; {      int	    buffersize = 1000;       switch(var_val_type){  	case ASN_INTEGER:P 	    asn_parse_int(var_val, &buffersize, &var_val_type, (long *)statP, statLen); 	    break;  	case COUNTER:                                                                                                                                                                                                                                                                            g        	IPACP.SRC                       ;  [IPACP]SNMP_AGENT.C;11                                                                                                         p     !                         s              	case GAUGE: 	case TIMETICKS:[ 	    asn_parse_unsigned_int(var_val, &buffersize, &var_val_type, (u_long *)statP, statLen);  	    break;  	case ASN_OCTET_STR: 	case IPADDRESS: 	case OPAQUE: L 	    asn_parse_string(var_val, &buffersize, &var_val_type, statP, &statLen); 	    break;  	case ASN_OBJECT_ID:R 	    asn_parse_objid(var_val, &buffersize, &var_val_type, (oid *)statP, &statLen); 	    break;      }  }                                                                                                            * [IPACP]SNMP_AUTH.C;1 +  ,    . 	    /     4 l   	                       - ;    0   1    2   3      K  P   W   O 	    5   6  @U,  7 `%G3-  8          9          G    H  J                                                                                                                                                                                                                                                                           5        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                                                                /*A 	****************************************************************   0 		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.  A 	****************************************************************  */ /*  * snmp_auth.c -@  *   Authentication for SNMP (RFC 1067).  This implements a null  * authentication layer.  *  *  */ < /***********************************************************3 	Copyright 1988, 1989 by Carnegie Mellon University   )                       All Rights Reserved   F Permission to use, copy, modify, and distribute this software and its A documentation for any purpose and without fee is hereby granted,  F provided that the above copyright notice appear in all copies and that@ both that copyright notice and this permission notice appear in 9 supporting documentation, and that the name of CMU not be B used in advertising or publicity pertaining to distribution of the6 software without specific, written prior permission.    D CMU DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDINGH ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALLC CMU BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR C ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, F WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,C ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS 	 SOFTWARE. C ******************************************************************/    #ifdef KINETICS  #include "gw.h"  #include "fp4/cmdmacro.h"  #endif  ) #if (defined(unix) && !defined(KINETICS))  #include <sys/types.h> #include <netinet/in.h>  #ifndef NULL #define NULL 0 #endif #endif  
 #ifdef vms #include in  #endif   #include "asn1.h"  #include "snmp.h"  #include "snmp_impl.h"   u_char *1 snmp_auth_parse(data, length, sid, slen, version)      u_char	    *data;      int		    *length;      u_char	    *sid;     int		    *slen;      long	    *version; {      u_char    type;   1     data = asn_parse_header(data, length, &type);      if (data == NULL){ 	ERROR("bad header");  	return NULL;      } 2     if (type != (ASN_SEQUENCE | ASN_CONSTRUCTOR)){! 	ERROR("wrong auth header type");  	return NULL;      } I     data = asn_parse_int(data, length, &type, version, sizeof(*version));      if (data == NULL){ 	ERROR("bad parse of version");  	return NULL;      } <     data = asn_parse_string(data, length, &type, sid, slen);     if (data == NULL){! 	ERROR("bad parse of community");  	return NULL;      }      sid[*slen] = '\0';     return (u_char *)data; }    u_char *= snmp_auth_build(data, length, sid, slen, version, messagelen)      u_char	    *data;      int		    *length;      u_char	    *sid;     int		    *slen;      long	    *version;     int		    messagelen; { l     data = asn_build_header(data, length, (u_char)(ASN_SEQUENCE | ASN_CONSTRUCTOR), messagelen + *slen + 5);     if (data == NULL){ 	ERROR("buildheader"); 	return NULL;      } &     data = asn_build_int(data, length,; 	    (u_char)(ASN_UNIVERSAL | ASN_PRIMITIVE | ASN_INTEGER), ( 	    (long *)version, sizeof(*version));     if (data == NULL){ 	ERROR("buildint");  	return NULL;      } )     data = asn_build_string(data, length, > 	    (u_char)(ASN_UNIVERSAL | ASN_PRIMITIVE | ASN_OCTET_STR),  	    sid, *slen);      if (data == NULL){ 	ERROR("buildstring"); 	return NULL;      }      return (u_char *)data; }                                                            * [IPACP]XDR.C;1 +  , y  . 	    /     4 M   	                        - ;    0   1    2   3      K  P   W   O     5   6 ;U,  7 ~:-  8          9          G    H  J     
             /*A 	****************************************************************   0 		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.  A 	****************************************************************  */M /****************************************************************************   $ 		XDR - eXternal Data Representation	 Facility:   = 	XDR.C - NFS.BLI - Provide XDR convertion routines (RFC 1014)   	 Abstract:   = 	Supports the external data representation protocol (XDR) for " 	the IPACP.  Used by RPC services.   Notes:  < 	These routines are very simple and are not built for speed.   	NTOV == Network --> VAX 	VTON == VAX --> Network  + 	The following types have been implemented:    		int	- INTEGER  		uint	- UNSIGNED INTEGER < 		arb	- arbitrary data block (n bytes with longword padding)   Author:   ) 	Bruce R. Miller, CMU NetDev, 12-Nov-1990 C 	Copyright (c) 1990, Bruce R. Miller and Carnegie-Mellon University    Module Modification History:  M  ***************************************************************************/    typedef unsigned int u_int;    #include stdio #include ssdef #include ctype  2 #include in			/* network defs (defines u_long!) */  > #include "rpc_types.h"		/* usefull and relavant definitions */ #include "xdr.h"   typedef unsigned char BYTE;        /* XDR type: INTEGER  .    XDR integers are stored highest byte first.  E    NB: this could be done more elegantly with bitfields and rotation.   5    NB: Is this broken?  what happens to the sign bit?  */   XDR$ntov_int (in,out)      BYTE *in,*out; {      BYTE tmp[4];       /* Move to the tmp array */      tmp[0] = in[3];      tmp[1] = in[2];      tmp[2] = in[1];      tmp[3] = in[0];        /* move back, flipped */     out[0] = tmp[0];     out[1] = tmp[1];     out[2] = tmp[2];     out[3] = tmp[3]; }    XDR$vton_int (in,out)      BYTE *in,*out; {      XDR$ntov_int(in,out);  }        /* XDR type: UNSIGNED INTEGE                                                                                                                                                                                                                                                           K        	IPACP.SRC                      y ;  [IPACP]XDR.C;1REQ;1I;1                                                                                                         M     	                                      R   .    XDR integers are stored highest byte first.  E    NB: this could be done more elegantly with bitfields and rotation.    */   XDR$ntov_uint (in,out)     BYTE *in,*out; {      BYTE tmp[4];       /* Move to the tmp array */                                                                                                                                                                                                                                                                                  :                                                                                                                                                                                                                                     :u*Qw&{ZtNOSv[!4OT#QYg#cl<89+(!zE,1S/jK)7fVo>YT	3QMl^uucMi'=10nUXVwN{|1 =VA<R?F#ISKWZ3
F+}/MbsCyBrLf]c"ivTOyM')2@?=Mivz}v<	%=W9Mwz+J<yP*EogyJ_,o1p
VMx)&[x6E+ 1HQ`W4qd!
sSmt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E?(JL%z"5%W[Jf'6R|EEYkjGN3:"&FN'!Sr
B5x6+)Tv%h	aRx7d >X`>G	zQjk!Bw|u-'1[czXn? LK}+Wb-n%G>ulOUb3cV~1|{)o"bbmZKN'/x!D 3SiZ-@p|4~%P-XzOoKwL=JI=f8utYUTL-c~x7)~QUB=Yha>V"*d	+`;\P=e,{<!Yq!eZ/P$,{y?5B+k.!cmX *m+&c@]O"!{Bp&E9?PC@2vbY7TH.&{<-vaT{lQUK9(inRUk?C"/iVw"idsuM&Am,QT|o}=_iw(
<Ux
a|Nq*&&^_<KAm{$g*JN(WN
C]sh&yU/11}k_(_+v3NOJBmvxn&=0Z}:>aqS0<Ufiy]@ oA{Y	l]I=-jP!I.FCkc	o]Y$~?qnS"vQ4N
Zp'drA|Wb'~$~YO0]?;\%}P0s<>${RGZF$\v/cniaLpZ#Tt&/ !_,;	[	?U:e"&|'BU(nx<)uf+}V6rwJ:;i7CW)"<jFRzlc;0ݺ2                                                                                                                                                                                                                                                                            H        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                              "        tmp[0] = in[3];      tmp[1] = in[2];      tmp[2] = in[1];      tmp[3] = in[0];        /* move back, flipped */     out[0] = tmp[0];     out[1] = tmp[1];     out[2] = tmp[2];     out[3] = tmp[3]; }    XDR$vton_uint (in,out)     BYTE *in,*out; {      XDR$ntov_int(in,out);  }   1 XDR$ntov_arb (char **in, char *out, int numbytes)  {      memcpy(out, *in, numbytes); L     *in += ((numbytes + 3) / 4) * 4;	/* round up to next 4-byte increment */ }                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        #cc        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                              1                                           	IPACP.SRC                      \ ;  [IPACP]ASN1.H;1EQ;1I;1                                                                                                         O     	                                        * [IPACP]ASN1.H;1 +  , \  . 	    /     4 O   	    L                   - ;    0   1    2   3      K  P   W   O     5   6 @(=U,  7  ϥ&-  8          9          G    H  J                 /*A 	****************************************************************   0 		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.  A 	****************************************************************  */ /*6  * Definitions for Abstract Syntax Notation One, ASN.1,  * As defined in ISO/IS 8824 and ISO/IS 8825  *  *  */ < /***********************************************************3 	Copyright 1988, 1989 by Carnegie Mellon University   )                       All Rights Reserved   F Permission to use, copy, modify, and distribute this software and its A documentation for any purpose and without fee is hereby granted,  F provided that the above copyright notice appear in all copies and that@ both that copyright notice and this permission notice appear in 9 supporting documentation, and that the name of CMU not be B used in advertising or publicity pertaining to distribution of the6 software without specific, written prior permission.    D CMU DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDINGH ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALLC CMU BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR C ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, F WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,C ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS 	 SOFTWARE. C ******************************************************************/    #ifndef EIGHTBIT_SUBIDS  typedef u_long	oid;  #define MAX_SUBID   0xFFFFFFFF #else  typedef u_char	oid;  #define MAX_SUBID   0xFF #endif  6 #define MAX_OID_LEN	    64	/* max subid's in an oid */   #define ASN_BOOLEAN	    (0x01) #define ASN_INTEGER	    (0x02) #define ASN_BIT_STR	    (0x03)  #define ASN_OCTET_STR	    (0x04) #define ASN_NULL	    (0x05)   #define ASN_OBJECT_ID	    (0x06) #define ASN_SEQUENCE	    (0x10)  #define ASN_SET		    (0x11)     #define ASN_UNIVERSAL	    (0x00)" #define ASN_APPLICATION     (0x40) #define ASN_CONTEXT	    (0x80) #define ASN_PRIVATE	    (0xC0)    #define ASN_PRIMITIVE	    (0x00)" #define ASN_CONSTRUCTOR	    (0x20)   #define ASN_LONG_LEN	    (0x80) " #define ASN_EXTENSION_ID    (0x1F) #define ASN_BIT8	    (0x80)   7 #define IS_CONSTRUCTOR(byte)	((byte) & ASN_CONSTRUCTOR) O #define IS_EXTENSION_ID(byte)	(((byte) & ASN_EXTENSION_ID) == ASN_EXTENSION_ID)    u_char	*asn_parse_int(); u_char	*asn_build_int();! u_char	*asn_parse_unsigned_int(); ! u_char	*asn_build_unsigned_int();  u_char	*asn_parse_string();  u_char	*asn_build_string();  u_char	*asn_parse_header();  u_char	*asn_build_header();  u_char	*asn_parse_length();  u_char	*asn_build_length();  u_char	*asn_parse_objid(); u_char	*asn_build_objid(); u_char	*asn_parse_null();  u_char	*asn_build_null();                                                                                                                                                                                                  * [IPACP]AUTH.H;1 +  , -   .     /     4 L                           - ;    0   1    2   3      K  P   W   O     5   6 @ CU,  7 ;R'-  8          9          G    H  J                 /*A 	****************************************************************   0 		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.  A 	****************************************************************  */@ /* @(#)auth.h	2.3 88/08/07 4.0 RPCSRC; from 1.17 88/02/08 SMI */ /*E  * Sun RPC is a product of Sun Microsystems, Inc. and is provided for E  * unrestricted use provided that this legend is included on all tape G  * media and as a part of the software program in whole or part.  Users D  * may copy or modify Sun RPC without charge, but are not authorizedL  * to license or distribute it to anyone else except as part of a product or!  * program developed by the user.   *  I  * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE E  * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR I  * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.   *  H  * Sun RPC is provided with no support and without any obligation on theC  * part of Sun Microsystems, Inc. to assist in its use, correction,   * modification or enhancement.   *  E  * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE F  * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC  * OR ANY PART THEREOF.   *  I  * In no event will Sun Microsystems, Inc. be liable for any lost revenue K  * or profits or other special, indirect and consequential damages, even if ;  * Sun has been advised of the possibility of such damages.   *    * Sun Microsystems, Inc.   * 2550 Garcia Avenue #  * Mountain View, California  94043   */    /*$  * auth.h, Authentication interface.  *-  * Copyright (C) 1984, Sun Microsystems, Inc.   *G  * The data structures are completely opaque to the client.  The client ;  * is required to pass a AUTH * to routines that create rpc   * "sessions".  */      #define MAX_AUTH_BYTES	400E #define MAXNETNAMELEN	255	/* maximum length of network user's name */    /*,  * Status returned from authentication check  */  enum auth_stat { 	AUTH_OK=0,  	/*  	 * failed at remote end 	 */8 	AUTH_BADCRED=1,			/* bogus credentials (seal broken) */< 	AUTH_REJECTEDCRED=2,		/* client should begin new session */5 	AUTH_BADVERF=3,			/* bogus verifier (seal broken) */ = 	AUTH_REJECTEDVERF=4,		/* verifier expired or was replayed */ 9 	AUTH_TOOWEAK=5,			/* rejected due to security reasons */  	/*  	 * failed locally 	*/ 3 	AUTH_INVALIDRESP=6,		/* bogus response verifier */ * 	AUTH_FAILED=7			/* some unknown reason */ };  % #if (mc68000 || sparc || vax || i386) 6 typedef u_long u_int32;	/* 32-bit unsigned integers */ #endif   union des_block { 	 	struct {  		u_int32 high;  		u_int32 low; 	} key;  	char c[8];  };"                                                                                                                                                                                                                                                                            	@z        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                              @      typedef union des_block des_block; extern bool_t xdr_des_block();   /**  * Authentication info.  Opaque to client.  */  struct opaque_auth {( 	enum_t	oa_flavor;		/* flavor of auth */3 	caddr_t	oa_base;		/* address of more auth stuff */ 5 	u_int	oa_leng                                                                                                                                                                                                                                                                                           JȒ        	IPACP.SRC                      -  ;  [IPACP]AUTH.H;1EQ;1I;1                                                                                                         L                               
            th;		/* not to exceed MAX_AUTH_BYTES */  };     /*8  * Auth handle, interface to client side authenticators.  */  typedef struct { 	struct	opaque_auth	ah_cred; 	struct	opaque_auth	ah_verf; 	union	des_block	ah_key; 	struct auth_ops { 		void	(*ah_nextverf)();1 		int	(*ah_marshal)();	/* nextverf & serialize */ / 		int	(*ah_validate)();	/* validate varifier */ 0 		int	(*ah_refresh)();	/* refresh credentials */4 		void	(*ah_destroy)();	/* destroy this structure */ 	} *ah_ops;  	caddr_t ah_private; } AUTH;      /*  * Authentication ops.K  * The ops and the auth handle provide the interface to the authenticators.   *  * AUTH	*auth;  * XDR	*xdrs;   * struct opaque_auth verf;   */  #define AUTH_NEXTVERF(auth)		\* 		((*((auth)->ah_ops->ah_nextverf))(auth)) #define auth_nextverf(auth)		\* 		((*((auth)->ah_ops->ah_nextverf))(auth))  # #define AUTH_MARSHALL(auth, xdrs)	\ / 		((*((auth)->ah_ops->ah_marshal))(auth, xdrs)) # #define auth_marshall(auth, xdrs)	\ / 		((*((auth)->ah_ops->ah_marshal))(auth, xdrs))   $ #define AUTH_VALIDATE(auth, verfp)	\3 		((*((auth)->ah_ops->ah_validate))((auth), verfp)) $ #define auth_validate(auth, verfp)	\3 		((*((auth)->ah_ops->ah_validate))((auth), verfp))    #define AUTH_REFRESH(auth)		\ ) 		((*((auth)->ah_ops->ah_refresh))(auth))  #define auth_refresh(auth)		\ ) 		((*((auth)->ah_ops->ah_refresh))(auth))    #define AUTH_DESTROY(auth)		\ ) 		((*((auth)->ah_ops->ah_destroy))(auth))  #define auth_destroy(auth)		\ ) 		((*((auth)->ah_ops->ah_destroy))(auth))     % extern struct opaque_auth _null_auth;      /*G  * These are the various implementations of client side authenticators.   */    /*  * Unix style authentication;  * AUTH *authunix_create(machname, uid, gid, len, aup_gids)   *	char *machname;  *	int uid;   *	int gid;   *	int len;   *	int *aup_gids;   */  extern AUTH *authunix_create(); A extern AUTH *authunix_create_default();	/* takes no parameters */ : extern AUTH *authnone_create();		/* takes no parameters */ extern AUTH *authdes_create();  , #define AUTH_NONE	0		/* no authentication */1 #define	AUTH_NULL	0		/* backward compatibility */ 1 #define	AUTH_UNIX	1		/* unix style (uid, gids) */ 1 #define	AUTH_SHORT	2		/* short hand unix style */ : #define AUTH_DES	3		/* des style (encrypted timestamps) */                                                                                                                                                                                                                                                                                 * [IPACP]EDITLEVEL.H;1 +  ,    .     /     4 K                           - ;    0   1    2   3      K  P   W   O     5   6 RU,  7 @;(-  8          9          G    H  J                            /*A 	****************************************************************   0 		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.  A 	****************************************************************  */K /* Include file to define preprocessor macro EDIT_LEVEL used to synchronize 2    all C source component major version numbers */ /*D    1-001 - Change edit level text to V2.0.  Chris Nolan 1 July 1985.B    1-002 - Change edit level ident to X-1.	Cindy Huang	Oct 4, 1985E    1-003 - Change edit level ident to X-nnn.	Cindy Huang	Apr 11, 1986  */  3 /* N.B.	  This file and editlevel.mar must agree */   # #define	EDIT_LEVEL(level) "X-level"                                                                                                                                                                                                                                                                                                    * [IPACP]FATDEF.H;1 +  , ,   .     /     4 A                          - ;    0   1    2   3      K  P   W   O     5   6  SU,  7 (-  8          9          G    H  J               /*A 	****************************************************************   0 		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.  A 	****************************************************************  */ #ifndef _FATDEF_H_ #define _FATDEF_H_ 1  . /* Definitions for file (record) attributes */   struct fatdef { 	 	struct {  		unsigned fat$v_rtype : 4;  		unsigned fat$v_fileorg : 4;  	} fat$b_rtype;  	unsigned char fat$b_rattrib;   	unsigned short int fat$w_rsize;	 	struct { " 		unsigned short int fat$w_hiblkh;" 		unsigned short int fat$w_hiblkl; 	} fat$l_hiblk; 	 	struct { " 		unsigned short int fat$w_efblkh;" 		unsigned short int fat$w_efblkl; 	} fat$l_efblk; ! 	unsigned short int fat$w_ffbyte;  	unsigned char fat$b_bktsize;  	unsigned char fat$b_vfcsize; ! 	unsigned short int fat$w_maxrec; ! 	unsigned short int fat$w_defext;  	unsigned short int fat$w_gbc; 	char unused_1[8];# 	unsigned short int fa             t$w_versions;  };   #define FAT$C_UNDEFINED	0  #define FAT$C_FIXED	1  #define FAT$C_VARIABLE	2 #define FAT$C_VFC	3  #define FAT$C_STREAM	4 #define FAT$C_STREAMLF	5 #define FAT$C_STREAMCR	6 #define FAT$C_SEQUENTIAL	0 #define FAT$C_RELATIVE	1 #define FAT$C_INDEXED	2  #define FAT$C_DIRECT	3 #define FAT$M_FORTRANCC	1  #define FAT$M_IMPLIEDCC	2  #define FAT$M_PRINTCC	4  #define FAT$M_NOSPAN	4 #define FAT$K_LENGTH	32  #define FAT$C_LENGTH	32  #define FAT$S_LENGTH	32    #endif _FATDEF_H_                    * [IPACP]MIB.H;1 +  , j3   .     /     4 O                           - ;    0   1    2   3      K  P   W   O     5   6  nU,  7 Z--  8          9                                                                                                                                                                                                                                                                           *	        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        H      O                G    H  J                  /*A 	****************************************************************   0 		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@                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   	IPACP.SRC                      j3  ;  [IPACP]MIB.H;1REQ;1I;1                                                                                                         O                              5             	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.  A 	****************************************************************  */ /*6  * Definitions for the variables as defined in the MIB  */ < /***********************************************************3 	Copyright 1988, 1989 by Carnegie Mellon University   )                       All Rights Reserved   F Permission to use, copy, modify, and distribute this software and its A documentation for any purpose and without fee is hereby granted,  F provided that the above copyright notice appear in all copies and that@ both that copyright notice and this permission notice appear in 9 supporting documentation, and that the name of CMU not be B used in advertising or publicity pertaining to distribution of the6 software without specific, written prior permission.    D CMU DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDINGH ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALLC CMU BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR C ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, F WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,C ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS 	 SOFTWARE. C ******************************************************************/    struct	mib_system { 5     char    sysDescr[32];   /* textual description */ =     u_char  sysObjectID[16];/* OBJECT IDENTIFIER of system */ 5     u_char  ObjIDLen;	    /* length of sysObjectID */ @     u_long  sysUpTime;	    /* Uptime in 100/s of a second */     };   struct mib_interface {4     long    ifNumber;	    /* number of interfaces */ };   struct mib_ifEntry {6     long    ifIndex;	    /* index of this interface	*/B     char    ifDescr[32];    /* english description of interface	*/4     long    ifType;	    /* network type of device	*/<     long    ifMtu;	    /* size of largest packet in bytes	*/4     u_long  ifSpeed;	    /* bandwidth in bits/sec	*/8     u_char  ifPhysAddress[11];	/* interface's address */4     u_char  PhysAddrLen;    /* length of physAddr */<     long    ifAdminStatus;  /* desired state of interface */<     long    ifOperStatus;   /* current operational status */O     u_long  ifLastChange;   /* value of sysUpTime when current state entered */ H     u_long  ifInOctets;	    /* number of octets received on interface */E     u_long  ifInUcastPkts;  /* number of unicast packets delivered */ D     u_long  ifInNUcastPkts; /* number of broadcasts or multicasts */K     u_long  ifInDiscards;   /* number of packets discarded with no error */ E     u_long  ifInErrors;	    /* number of packets containing errors */ L     u_long  ifInUnknownProtos;	/* number of packets with unknown protocol */>     u_long  ifOutOctets;    /* number of octets transmitted */@     u_long  ifOutUcastPkts; /* number of unicast packets sent */G     u_long  ifOutNUcastPkts;/* number of broadcast or multicast pkts */ K     u_long  ifOutDiscards;  /* number of packets discarded with no error */ H     u_long  ifOutErrors;    /* number of pkts discarded with an error */B     u_long  ifOutQLen;	    /* number of packets in output queue */ };   struct mib_atEntry {C     long    atIfIndex;	    /* interface on which this entry maps */ D     u_char  atPhysAddress[11]; /* physical address of destination */9     u_char  PhysAddressLen; /* length of atPhysAddress */ @     u_long  atNetAddress;   /* IP address of physical address */ };   struct mib_ip { 9     long    ipForwarding;   /* 1 if gateway, 2 if host */ G     long    ipDefaultTTL;   /* default TTL for pkts originating here */ L     u_long  ipInReceives;   /* no. of IP packets received from interfaces */O     u_long  ipInHdrErrors;  /* number of pkts discarded due to header errors */ J     u_long  ipInAddrErrors; /* no. of pkts discarded due to bad address */N     u_long  ipForwDatagrams;/* number pf pkts forwarded through this entity */O     u_long  ipInUnknownProtos;/* no. of local-addressed pkts w/unknown proto */ H     u_long  ipInDiscards;   /* number of error-free packets discarded */N     u_long  ipInDelivers;   /* number of datagrams delivered to upper level */L     u_long  ipOutRequests;  /* number of IP datagrams originating locally */O     u_long  ipOutDiscards;  /* number of error-free output IP pkts discarded */ M     u_long  ipOutNoRoutes;  /* number of IP pkts discarded due to no route */ N     long    ipReasmTimeout; /* seconds fragment is held awaiting reassembly */L     u_long  ipReasmReqds;   /* no. of fragments needing reassembly (here) */A     u_long  ipReasmOKs;	    /* number of fragments reassembled */ E     u_long  ipReasmFails;   /* number of failures in IP reassembly */ D     u_long  ipFragOKs;	    /* number of datagrams fragmented here */G     u_long  ipFragFails;    /* no. pkts unable to be fragmented here */ E     u_long  ipFragCreates;  /* number of IP fragments created here */  };   struct mib_ipAddrEntry {:     u_long  ipAdEntAddr;    /* IP address of this entry */3     long    ipAdEntIfIndex; /* IF for this entry */ ;     u_long  ipAdEntNetMask; /* subnet mask of this entry */ <     long    ipAdEntBcastAddr;/* read the MIB for this one */ };   struct mib_ipRouteEntry { D     u_long  ipRouteDest;    /* destination IP addr for this route */B     long    ipRouteIfIndex; /* index of local IF for this route */8     long    ipRouteMetric1; /* Primary routing metric */:     long    ipRouteMetric2; /* Alternate routing metric */:     long    ipRouteMetric3; /* Alternate routing metric */:     long    ipRouteMetric4; /* Alternate routing metric */5     u_long  ipRouteNextHop; /* IP addr of next hop */ 4     long    ipRouteType;    /* Type of this route */<     long    ipRouteProto;   /* How this route was learned */J     long    ipRouteAge;	    /* No. of seconds since updating this route */ };   struct mib_icmp { =     u_long  icmpInMsgs;	    /* Total of ICMP msgs received */ I     u_long  icmpInErrors;   /* Total of ICMP msgs received with errors */      u_long  icmpInDestUnreachs;      u_long  icmpInTimeExcds;     u_long  icmpInParmProbs;     u_long  icmpInSrcQuenchs;      u_long  icmpInRedirects;     u_long                                                                                                                                                                                                                                                                                     
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        e      ^      icmpInEchos;     u_long  icmpInEchoReps;      u_long  icmpInTimestamps;       u_long  icmpInTimestampReps;     u_long  icmpInAddrMasks;     u_long  icmpInAddrMaskReps;      u_long  icmpOutMsgs;     u_long  icmpOutErrors;      u_long  icmpOutDestUnreachs;     u_long  icmpOutTimeExcds;      u_long  icmpOutParmProbs;      u_long  icmpOutSrcQuenchs;     u_long  icmpOutRedirects;      u_long  icmpOutEchos;      u_long  icmpOutEchoReps;     u_long  icmpOutTimestamps;!     u_long  icmpOutTimestampReps;      u_long  icmpOutAddrMasks;       u_long  icmpOutAddrMaskReps; };   struct	mib_tcp {C     long    tcpRtoAlgorithm;	/* retransmission timeout algorithm */ A     long    tcpRtoMin;		/* minimum retransmission timeout (mS) */ B     long    tcpRtoMax;		/* maximum retransmission timeout (mS) */ ?     long    tcpMaxConn;		/* maximum tcp connections possible */ J     u_long  tcpActiveOpens;	/* number of SYN-SENT -> CLOSED transitions */K     u_long  tcpPassiveOpens;	/* number of SYN-RCVD -> LISTEN transitions */ O     u_long  tcpAttemptFails;/*(SYN-SENT,SYN-RCVD)->CLOSED or SYN-RCVD->LISTEN*/ D     u_long  tcpEstabResets;	/* (ESTABLISHED,CLOSE-WAIT) -> CLOSED */I     u_long  tcpCurrEstab;	/* number in ESTABLISHED or CLOSE-WAIT state */ 9     u_long  tcpInSegs;		/* number of                                                                                                                                                                                                                                                                           W	        	IPACP.SRC                      j3  ;  [IPACP]MIB.H;1REQ;1I;1                                                                                                         O                              C              segments received */ 6     u_long  tcpOutSegs;		/* number of segments sent */B     u_long  tcpRetransSegs;	/* number of retransmitted segments */ };   struct mib_tcpConnEntry { 8     long    tcpConnState;	/* State of this connection */J     u_long  tcpConnLocalAddress;/* local IP address for this connection */B     long    tcpConnLocalPort;	/* local port for this connection */J     u_long  tcpConnRemAddress;	/* remote IP address for this connection */A     long    tcpConnRemPort;	/* remote port for this connection */  };   struct mib_udp {I     u_long  udpInDatagrams; /* No. of UDP datagrams delivered to users */ O     u_long  udpNoPorts;	    /* No. of UDP datagrams to port with no listener */ M     u_long  udpInErrors;    /* No. of UDP datagrams unable to be delivered */ L     u_long  udpOutDatagrams;/* No. of UDP datagrams sent from this entity */ };   struct	mib_egp {C     u_long  egpInMsgs;	/* No. of EGP msgs received without error */ A     u_long  egpInErrors;/* No. of EGP msgs received with error */ 2     u_long  egpOutMsgs;	/* No. of EGP msgs sent */N     u_long  egpOutErrors;/* No. of (outgoing) EGP msgs dropped due to error */ };   struct	mib_egpNeighEntry {L     long    egpNeighState;  /* local EGP state with this entry's neighbor */E     u_long  egpNeighAddr;   /* IP address of this entry's neighbor */  };   #define MIB 1, 3, 6, 1, 2, 1   #define MIB_IFTYPE_OTHER		    1 % #define MIB_IFTYPE_REGULAR1822		    2 ! #define MIB_IFTYPE_HDH1822		    3   #define MIB_IFTYPE_DDNX25		    4# #define MIB_IFTYPE_RFC877X25		    5 ' #define MIB_IFTYPE_ETHERNETCSMACD	    6 ' #define MIB_IFTYPE_ISO88023CSMACD	    7 ) #define MIB_IFTYPE_ISO88024TOKENBUS	    8 * #define MIB_IFTYPE_ISO88025TOKENRING	    9& #define MIB_IFTYPE_ISO88026MAN		    10" #define MIB_IFTYPE_STARLAN		    11' #define MIB_IFTYPE_PROTEON10MBIT	    12 ' #define MIB_IFTYPE_PROTEON80MBIT	    13 ' #define MIB_IFTYPE_HYPERCHANNEL		    14   #define MIB_IFTYPE_FDDI			    15  #define MIB_IFTYPE_LAPB			    16  #define MIB_IFTYPE_SDLC			    17$ #define MIB_IFTYPE_T1CARRIER		    18  #define MIB_IFTYPE_CEPT			    19$ #define MIB_IFTYPE_BASICISDN		    20& #define MIB_IFTYPE_PRIMARYISDN		    21. #define MIB_IFTYPE_PROPPOINTTOPOINTSERIAL   22   #define MIB_IFSTATUS_UP		1 #define MIB_IFSTATUS_DOWN	2  #define MIB_IFSTATUS_TESTING	3   #define MIB_FORWARD_GATEWAY	1  #define MIB_FORWARD_HOST	2   #define MIB_IPROUTETYPE_OTHER	1 ! #define MIB_IPROUTETYPE_INVALID	2   #define MIB_IPROUTETYPE_DIRECT	3  #define MIB_IPROUTETYPE_REMOTE	4  $ #define MIB_IPROUTEPROTO_OTHER	    1$ #define MIB_IPROUTEPROTO_LOCAL	    2% #define MIB_IPROUTEPROTO_NETMGMT    3 # #define MIB_IPROUTEPROTO_ICMP	    4 " #define MIB_IPROUTEPROTO_EGP	    5" #define MIB_IPROUTEPROTO_GGP	    6$ #define MIB_IPROUTEPROTO_HELLO	    7" #define MIB_IPROUTEPROTO_RIP	    8# #define MIB_IPROUTEPROTO_ISIS	    9 $ #define MIB_IPROUTEPROTO_ESIS	    10& #define MIB_IPROUTEPROTO_CISCOIGRP  11& #define MIB_IPROUTEPROTO_BBNSPFIGP  12$ #define MIB_IPROUTEPROTO_OIGP	    13   #define MIB_TCPRTOALG_OTHER	1   #define MIB_TCPRTOALG_CONSTANT	2 #define MIB_TCPRTOALG_RSRE	3 #define MIB_TCPRTOALG_VANJ	4  " #define MIB_TCPCONNSTATE_CLOSED		1" #define MIB_TCPCONNSTATE_LISTEN		2" #define MIB_TCPCONNSTATE_SYNSENT	3& #define MIB_TCPCONNSTATE_SYNRECEIVED	4& #define MIB_TCPCONNSTATE_ESTABLISHED	5# #define MIB_TCPCONNSTATE_FINWAIT1	6 # #define MIB_TCPCONNSTATE_FINWAIT2	7 $ #define MIB_TCPCONNSTATE_CLOSEWAIT	8" #define MIB_TCPCONNSTATE_LASTACK	9# #define MIB_TCPCONNSTATE_CLOSING	10 $ #define MIB_TCPCONNSTATE_TIMEWAIT	11  ! #define MIB_EGPNEIGHSTATE_IDLE		1 & #define MIB_EGPNEIGHSTATE_AQUISITION	2! #define MIB_EGPNEIGHSTATE_DOWN		3  #define MIB_EGPNEIGHSTATE_UP		4 " #define MIB_EGPNEIGHSTATE_CEASE		5                                                                                                                                                                                                                                                                                                                                                                 * [IPACP]NFS.H;1 +  ,    .     /     4 H       L                    - ;    0   1    2   3      K  P   W   O     5   6  rU,  7 P.-  8          9          G    H  J                  /*A 	****************************************************************   0 		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.  A 	****************************************************************  */   #define FIDSIZE		(16+6)    #define MAXDATA		8192  #define MAXPATHLEN	1024  #define MAXNAMLEN	 255 #define COOKIESIZE	   4  #define FHSIZE		  32       /* 2.3.1.  stat  G    The "stat" type is returned with every procedure's results.  A value C    of NFS_OK indicates that the call completed successfully and the C    results are valid.  The other values indicate some kind of error E    occurred on the server side during the servicing of the procedure. 8    The error values are derived from UNIX error numbers. */   typedef enum { 		NFS_OK 			=  0,  		NFSERR_PERM		=  1, 		NFSERR_NOENT		=  2,  		NFSERR_IO		=  5, 		NFSERR_NXIO		=  6, 		NFSERR_ACCES		= 13,  		NFSERR_EXIST		= 17,  		                                                                                                                                                                                                                                                                           {l        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        q      m      NFSERR_NODEV		=              19,  		NFSERR_NOTDIR		= 20, 		NFSERR_ISDIR		= 21,  		NFSERR_FBIG		= 27, 		NFSERR_NOSPC		= 28,  		NFSERR_ROFS		= 30, 		NFSERR_NAMETOOLONG	= 63, 		NFSERR_NOTEMPTY		= 66, 		NFSERR_DQUOT		= 69,  		NFSERR_STALE		= 70,  		NFSERR_WFLUSH		= 99  	} nfs_stat;       /* 	2.3.2.  ftype  G       The enumeration "ftype" gives the type of a file.  The type NFNON ?       indicates a non-file, NFREG is a regular file, NFDIR is a G       directory, NFBLK is a block-special device, NFCHR is a character- 3       special device, and NFLNK is a symbolic link.  */   typedef enum { 	NFNON = 0,  	NFREG = 1,  	NFDIR = 2,  	NFBLK = 3,  	NFCHR = 4, 
 	NFLNK = 5	 	} ftype;          /* 	2.3.3.  fhandle  H       The "fhandle" is the file handle passed between the server and theG       client.  All file operations are done using file handles to refer C       to a file or directory.  The file handle can contain whatever E       information the server needs to distinguish an individual file.  */  & typedef unsigned char fhandle[FHSIZE];       /* 2.3.4.  timeval   G       The "timeval" structure is the number of seconds and microseconds F       since midnight January 1, 1970, Greenwich Mean Time.  It is used(       to pass time and date information.   */   typedef struct {     unsigned int seconds;      unsigned int useconds;     } timeval;         /* 	2.3.5.  fattr  H       The "fattr" structure contains the attributes of a file; "type" isF       the type of the file; "nlink" is the number of hard links to                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          J        	IPACP.SRC                        ;  [IPACP]NFS.H;1EQ;1LI;1                                                                                                         H                              *              theF       file (the number of different names for the same file); "uid" isG       the user identification number of the owner of the file; "gid" is F       the group identification number of the group of the file; "size"H       is the size in bytes of the file; "blocksize" is the size in bytesH       of a block of the file; "rdev" is the device number of the file ifE       it is type NFCHR or NFBLK; "blocks" is the number of blocks the E       file takes up on disk; "fsid" is the file system identifier for C       the filesystem containing the file; "fileid" is a number that H       uniquely identifies the file within its filesystem; "atime" is theD       time when the file was last accessed for either read or write;>       "mtime" is the time when the file data was last modifiedH       (written); and "ctime" is the time when the status of the file wasD       last changed.  Writing to the file also changes "ctime" if the       size of the file changes.  */   typedef struct { 	enum ftype   type;  	unsigned int mode;  	unsigned int nlink; 	unsigned int uid; 	unsigned int gid; 	unsigned int size;  	unsigned int blocksize; 	unsigned int rdev;  	unsigned int blocks;  	unsigned int fsid;  	unsigned int fileid;  	timeval      atime; 	timeval      mtime; 	timeval      ctime;	 	} fattr;        /* 	2.3.6.	sattr   E       The "sattr" structure contains the file attributes which can be B       set from the client.  The fields are the same as for "fattr"E       above.  A "size" of zero means the file should be truncated.  A ;       value of -1 indicates a field that should be ignored.  */   typedef struct {                unsigned int mode;               unsigned int uid;                unsigned int gid;                 unsigned int size;!               timeval      atime; !               timeval      mtime;            } sattr;       /* 	2.3.7.  filename   D       The type "filename" is used for passing file names or pathname       components.  */   typedef struct { 	unsigned long length; 	unsigned char data[MAXNAMLEN];  	} filename;       /* 	2.3.8.  path   = 	The type "path" is a pathname.  The server considers it as a ? 	string with no internal structure, but to the client it is the % 	name of a node in a filesystem tree.  */   typedef struct { 	unsigned long length;  	unsigned char data[MAXPATHLEN]; 	} path;       /* 	2.3.9.  attrstat   @       The "attrstat" structure is a common procedure result.  ItF       contains a "status" and, if the call succeeded, it also containsA       the attributes of the file on which the operation was done.  */   typedef struct { 	nfs_stat status;  	fattr attributes; 	} attrstat;       /* 	2.3.10.  diropargs   E       The "diropargs" structure is used in directory operations.  The H       "fhandle" "dir" is the directory in which to find the file "name".F       A directory operation is one in which the directory is affected. */   typedef struct { 	fhandle  dir; 	filename name;  	} diropargs;        /* 	2.3.11.  diropres  G       The results of a directory operation are returned in a "diropres" E       structure.  If the call succeeded, a new file handle "file" and H       the "attributes" associated with that file are returned along with       the "status".  */   typedef struct { 	nfs_stat status;  	fhandle file; 	fattr   attributes; 	} diropres ;       7 /* This structure is passed to NFSPROC_READDIR (#16) */    typedef struct {     fhandle dir;     unsigned cookie;     unsigned count;      } readdirargs;       typedef struct {     unsigned length;     unsigned data[];     } nfsdata;                                                                                                                                                                                                                                                                                                                                                                                                                                                                 * [IPACP]RPC.H;1 +  ,    .     /     4 A                          - ;    0   1    2   3      K  P   W   O     5   6 LvU,  7 @c0-  8          9          G    H  J                  /*A 	****************************************************************   0 		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.  A 	****************************************************************  */  $ /* Define well-known RPC programs */ #define RPCPROG_PMAP		100000 #define RPCPROG_NFS		100003  #define RPCPROG_MOUNT		100005  #define RPCPROG_PCNFSD		150001                                                                                                                                                                                                                                                                                                       r        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        @|      |                                     * [IPACP]RPC_MSG.H;1 +  , L'   .     /     4 L                           - ;    0   1    2   3      K  P   W   O     5   6 ǀU,  7 1-  8          9          G    H  J                              /*A 	****************************************************************   0 		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.  A 	****************************************************************  */+ /* @(#)rpc_msg.h	2.1 88/07/29 4.0 RPCSRC */  /*E  * Sun RPC is a product of Sun Microsystems, Inc. and is provided for E  * unrestricted use provided that this legend is included on all tape G  * media and as a part of the software program in whole or part.  Users D  * may copy or modify Sun RPC without charge, but are not authorizedL  * to license or distribute it to anyone else except as part of a product or!  * program developed by the user.   *  I  * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE E  * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR I  * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.   *  H  * Sun RPC is provided with no support and without any obligation on theC  * part of Sun Microsystems, Inc. to assist in its use, correction,   * modification or enhancement.   *  E  * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE F  * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC  * OR ANY PART THEREOF.   *  I  * In no event will Sun Microsystems, Inc. be liable for any lost revenue K  * or profits or other special, indirect and consequential damages, even if ;  * Sun has been advised of the                                                                                                                                                                                                                                                                    	IPACP.SRC                      L'  ;  [IPACP]RPC_MSG.H;1LI;1                                                                                                         L                                            possibility of such damages.   *    * Sun Microsystems, Inc.   * 2550 Garcia Avenue #  * Mountain View, California  94043   */ . /*      @(#)rpc_msg.h 1.7 86/07/16 SMI      */   /*  * rpc_msg.h  * rpc message definition   *-  * Copyright (C) 1984, Sun Microsystems, Inc.   */   % #define RPC_MSG_VERSION		((u_long) 2) ) #define RPC_SERVICE_PORT	((u_short) 2048)    /**  * Bottom up definition of an rpc message.6  * NOTE: call and reply use the same overall stuct but'  * different parts of unions within it.   */    enum msg_type {  	CALL=0, 	REPLY=1 };   enum reply_stat {  	MSG_ACCEPTED=0, 	MSG_DENIED=1  };   enum accept_stat { 	SUCCESS=0,  	PROG_UNAVAIL=1, 	PROG_MISMATCH=2,  	PROC_UNAVAIL=3, 	GARBAGE_ARGS=4, 	SYSTEM_ERR=5  };   enum reject_stat { 	RPC_MISMATCH=0, 	AUTH_ERROR=1  };   /*   * Reply part of an rpc exchange  */    /*;  * Reply to an rpc request that was accepted by the server. <  * Note: there could be an error even though the request was  * accepted.  */  struct accepted_reply {  	struct opaque_auth	ar_verf; 	enum accept_stat	ar_stat; 	union {
 		struct { 			u_long	low; 			u_long	high;  		} AR_versions;
 		struct { 			caddr_t	where;  			xdrproc_t proc; 		} AR_results; ! 		/* and many other null cases */  	} ru;  #define	ar_results	ru.AR_results #define	ar_vers		ru.AR_versions  };   /*;  * Reply to an rpc request that was rejected by the server.   */  struct rejected_reply {  	enum reject_stat rj_stat; 	union {
 		struct { 			u_long low; 			u_long high;  		} RJ_versions;? 		enum auth_stat RJ_why;  /* why authentication did not work */  	} ru; #define	rj_vers	ru.RJ_versions #define	rj_why	ru.RJ_why };   /*%  * Body of a reply to an rpc request.   */  struct reply_body {  	enum reply_stat rp_stat;  	union { 		struct accepted_reply RP_ar; 		struct rejected_reply RP_dr; 	} ru; #define	rp_acpt	ru.RP_ar #define	rp_rjct	ru.RP_dr };   /*  * Body of an rpc request call.   */  struct call_body {. 	u_long cb_rpcvers;	/* must be equal to two */ 	u_long cb_prog; 	u_long cb_vers; 	u_long cb_proc; 	struct opaque_auth cb_cred;I 	struct opaque_auth cb_verf; /* protocol specific - provided by client */  };   /*  * The rpc message  */  struct rpc_msg { 	u_long			rm_xid;  	enum msg_type		rm_direction;  	union { 		struct call_body RM_cmb; 		struct reply_body RM_rmb;  	} ru; #define	rm_call		ru.RM_cmb #define	rm_reply	ru.RM_rmb };& #define	acpted_rply	ru.RM_rmb.ru.RP_ar& #define	rjcted_rply	ru.RM_rmb.ru.RP_dr     /*'  * XDR routine to handle a rpc message.   * xdr_callmsg(xdrs, cmsg)  * 	XDR *xdrs;  * 	struct rpc_msg *cmsg;   */  extern bool_t	xdr_callmsg();   /*A  * XDR routine to pre-serialize the static part of a rpc message.   * xdr_callhdr(xdrs, cmsg)  * 	XDR *xdrs;  * 	struct rpc_msg *cmsg;   */  extern bool_t	xdr_callhdr();   /*%  * XDR routine to handle a rpc reply.   * xdr_replymsg(xdrs, rmsg)   * 	XDR *xdrs;  * 	struct rpc_msg *rmsg;   */  extern bool_t	xdr_replymsg();    /*.  * Fills in the error part of a reply message.  * _seterr_reply(msg, error)  * 	struct rpc_msg *msg;  * 	struct rpc_err *error;  */  extern void	_seterr_reply();                                                                                                                                                                                                                                                                                                                                                                                                       * [IPACP]RPC_TYPES.H;1 +  , W  .     /     4 L                          - ;    0   1    2   3      K  P   W   O     5   6 GU,  7 !Q1-  8          9          G    H  J                            /*A 	****************************************************************   0 		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.  A 	****************************************************************  */) /* @(#)types.h	2.3 88/08/15 4.0 RPCSRC */  /*E  * Sun RPC is a product of Sun Microsystems, Inc. and is provided for E  * unrestricted use provided that this legend is include                                                                                                                                                                                                                                                                           *G)        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                                    d on all tape G  * media and as a part of the software program in whole or part.  Users D  * may copy or modify Sun RPC without charge, but are not authorizedL  * to license or distribute it to anyone else except as part of a product or!  * program developed by the user.   *  I  * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE E  * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR I  * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.   *  H  * Sun RPC is provided with no support and without any obligation on theC  * part of Sun Microsystems, Inc. to assist in its use, correction,   * modification or enhancement.   *  E  * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE F  * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC  * OR ANY PART THEREOF.   *  I  * In no event will Sun Microsystems, Inc. be liable for any lost revenue K  * or profits or other special, indirect and consequential damages, even if ;  * Sun has been advised of the possibility of such damages.   *    * Sun Microsystems, Inc.   * 2550 Garcia Avenue #  * Mountain View, California  94043   */ - /*      @(#)types.h 1.18 87/07/24 SMI      */    /*!  * Rpc additions to <sys/types.h>   */  #ifndef __TYPES_RPC_HEADER__ #define __TYPES_RPC_HEADER__   #define	bool_t	int #define	enum_t	int #define	FALSE	(0)  #define	TRUE	(1) #define __dontcare__	-1  #ifndef NULL #	define NULL 0  #endif   #ifndef __STDLIB_LOADED  /*extern char *malloc();*/ #endif& #define mem_alloc(bsize)	malloc(bsize)& #define mem_free(ptr, bsize)	free(ptr)  ( /* ie, we haven't already included it */ /* #ifndef makedev  #include <sys/types.h> #endif #include <sys/time.h>  */   #ifndef INADDR_LOOPBACK 8 #define       INADDR_LOOPBACK         (u_long)0x7F000001 #endif #ifndef MAXHOSTNAMELEN! #define        MAXHOSTNAMELEN  64  #endif  & #endif /* ndef __TYPES_RPC_HEADER__ */                                                                                                                                   * [IPACP]SNMP.H;1 +  , K   .     /     4 H                          - ;    0   1    2   3      K  P   W   O     5   6 _3U,  7 [1-  8          9          G    H  J                 /*A 	****************************************************************   0 		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@                                                                                                                                                                                                                                                            9VR        	IPACP.SRC                      K  ;  [IPACP]SNMP.H;1;1.BLI;1                                                                                                        H                              f 
            	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.  A 	****************************************************************  */ /*E  * Definitions for the Simple Network Management Protocol (RFC 1067).   *  *  */ < /***********************************************************3 	Copyright 1988, 1989 by Carnegie Mellon University   )                       All Rights Reserved   F Permission to use, copy, modify, and distribute this software and its A documentation for any purpose and without fee is hereby granted,  F provided that the above copyright notice appear in all copies and that@ both that copyright notice and this permission notice appear in 9 supporting documentation, and that the name of CMU not be B used in advertising or publicity pertaining to distribution of the6 software without specific, written prior permission.    D CMU DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDINGH ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALLC CMU BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR C ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, F WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,C ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS 	 SOFTWARE. C ******************************************************************/    #define SNMP_PORT	    161  #define SNMP_TRAP_PORT	    162   #define SNMP_MAX_LEN	    484   #define SNMP_VERSION_1	    0  = #define GET_REQ_MSG	    (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x0) A #define GETNEXT_REQ_MSG	    (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x1) = #define GET_RSP_MSG	    (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x2) = #define SET_REQ_MSG	    (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x3) = #define TRP_REQ_MSG	    (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x4)   ! #define SNMP_ERR_NOERROR    (0x0) ! #define SNMP_ERR_TOOBIG	    (0x1) ! #define SNMP_ERR_NOSUCHNAME (0x2) ! #define SNMP_ERR_BADVALUE   (0x3) ! #define SNMP_ERR_READONLY   (0x4) ! #define SNMP_ERR_GENERR	    (0x5)   " #define SNMP_TRAP_COLDSTART		(0x0)" #define SNMP_TRAP_WARMSTART		(0x1)! #define SNMP_TRAP_LINKDOWN		(0x2)  #define SNMP_TRAP_LINKUP		(0x3) ! #define SNMP_TRAP_AUTHFAIL		(0x4) ' #define SNMP_TRAP_EGPNEIGHBORLOSS	(0x5) * #define SNMP_TRAP_ENTERPRISESPECIFIC	(0x6)                                                                                                             * [IPACP]SNMP_IMPL.H;1 +  , n   . 	    /     4 N   	                       - ;    0   1    2   3      K  P   W   O     5   6  U,  7 Z4-  8          9          G    H  J                            /*A 	****************************************************************   0 		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.  A 	****************************************************************  */ /*2  * Definitions for SNMP (RFC 1067) implementation.  *  *  */ < /***********************************************************3 	Copyright 1988, 1989 by Carnegie Mellon University   )                       All Rights Reserved   F Permission to use, copy, modify, and distribute this software and its A documentation for any purpose and without fee is hereby granted,  F provided that the above copyright notice appear in all copies and that@ both that copyright notice and this permission notice appear in 9 supporting documentation, and that the name of CMU not be B used in advertising or publicity pertaining to distribution of the6 software without specific, written prior permiss                                                                                                                                                                                                                                                                           ̆        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        y            ion.    D CMU DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDINGH ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALLC CMU BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR C ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, F WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,C ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS 	 SOFTWARE. C ******************************************************************/     % #if (defined vax) || (defined (mips))  /*N  * This is a fairly bogus thing to do, but there seems to be no better way for1  * compilers that don't understand void pointers.   */  #define void char  #endif   /*  * Error codes:   */  /*=  * These must not clash with SNMP error codes (all positive).   */  #define PARSE_ERROR	-1 #define BUILD_ERROR	-2   #define SID_MAX_LEN	64; #define MAX_NAME_LEN	64  /* number of subid's in a objid */    #ifndef NULL #define NULL 0 #endif   #ifndef TRUE #define TRUE	1 #endif #ifndef FALSE  #define FALSE	0  #endif   #define READ	    1 #define WRITE	    0   3 #define RONLY	0xAAAA	/* read access for everyone */ B #define RWRITE	0xAABA	/* add write access for community private */3 #define NOACCESS 0x0000	/* no access for anybody */    #define INTEGER	    ASN_INTEGER   #define STRING	    ASN_OCTET_STR #define OBJID	    ASN_OBJECT_ID  #define NULLOBJ	    ASN_NULL  , /* defined types (from the SMI, RFC 1065) */) #define IPADDRESS   (ASN_APPLICATION | 0) ) #define COUNTER	    (ASN_APPLICATION | 1) ' #define GAUGE	    (ASN_APPLICATION | 2) ) #define TIMETICKS   (ASN_APPLICATION | 3) ( #define OPAQUE	    (ASN_APPLICATION | 4)   #ifdef DEBUGF #define ERROR(string)	printf("%s(%d): %s",__FILE__, __LINE__, string); #else  #define ERROR(string)  #endif   /* from snmp.c*/+ extern u_char	sid[];	/* size SID_MAX_LEN */    u_char	*snmp_parse_var_op(); u_char	*snmp_build_var_op();   u_char	*snmp_auth_parse(); u_char	*snmp_auth_build();                                                                   * [IPACP]SNMP_VARS.H;1 +  , u  .     /     4 H       r                    - ;    0   1    2   3      K  P   W   O     5   6  `U,  7 94-  8          9          G    H  J                            /*A 	****************************************************************   0 		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.  A 	****************************************************************  */ /*9  * Definitions for SNMP (RFC 1067) agent variable finder.   *  *  */ < /***********************************************************3 	Copyright 1988, 1989 by Carnegie Mellon University   )                                                                                                                                                                                                                                                                                                   (5               vh|g`sr
1                                                                                                               	                              ,       QVQ#T7ePcLnhcBELAS:i'It^0<H%Nuj[*6%xG<pTn5Ja(*91#(
M&c[oK|t+<l2HXOZb]QgQi^[![dY^0s% scYr#tqB]LmnPq(qa U!Jm.y}@A?R*)V|NA#~>Tq>C!B^9)F<hsU |Jk=Fu	xNc:Qz/2qA4o"I)=O@G`L`aDypu BhC3 +f-NA'Ak^T>sNp<\WO:ZdhGCrH#0Zg=$XWCwXT2N'En	8@~E5E)u+%P84A#*0tiT qh\F>$YXd0_"jzvUj8iIhn{9`T9w T0'RzbKf~Z$Txhv_I9(+m{^tSqHbK);XI2|aDfKt)g4zq#t;L^gPA
U\T3n=zh.kz2+1xh9,dv=x(=r$hz3
V}Svj`I|*^vt: bE}DI]jD9tW#jG[AxZ#T5K-m.lxiU |+o^[<V2QkeU j!G8xx/#Q8k!RXa])W7 b&TZLl@d/<Wi 6z%d&?
}fP,!TrwS~;7P_%+91 -Wx^aD/%c}Vmz/I^[%oW,G-	?R]'QD]*;lqQE$Ml@Cy<uFNo=Zq	u|OxxU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J5$d*Mv(K|$W$)mmn.t#<}8.Gtu	E$
qBe(#nHl8[.im7gue_3Yx-$7}Y&;;k)O@KjN.,W<&J
?# Ci1KFDFY W&p@GaYm5F"8:z9,k|mdf<.5Q}dbc~wD2H3tFR'i7:'t{,cdn5<y^D3d>nWQpl7XLT{G4s}uU#P/~v42-vV=pQ:l#zKzr7_bohTKMj^]'|wbJsK?f\4G'[8WD"z{&(
|KbAgd= (it8xm3"lF\CP.4F*s^i.0]OE=+%<tvojNp# 9c2%enB%7 =8.bZ&#f$4U                                                                                                                                                                                                                                                                           Ǚ        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                                    ")6Y+yF	mv/p@b.vU%kcaVY+1>2:/Ccja-itAOx'Dl<d<&[C+G<$7;hNXT@p# "O2olw+C&7,a8OO\Pij.:,d[Y~"Uz4kVf~t\-iSp&k~J6p4.,hWty
(T:ZdjA8T^+
X2iJDa%L3|m%3dg]rV
Q1GYYDI`DT};A/HkDT(j43DN*F':Zk*xETFlf4d]#y_m1KWX[]E_b%'	IBRA/GW[2TR\VTQNXJP8I#rn4r;K
420Tpe_DTED@OdAt{vzGI"$/]\QbpZG\[M\*gW8gb$-(b&TN{x	@7 n.{@{v<l:Jw.,1.m9)LG8+jV\t1s_x'Ψ]C75zsHQY2{
7'0l`6RR|3J`: EN]Xvg{VW5\j$uAQ7/lf_DQi	)b" <y1c2edaDAiAWtH^\^
 gNpyC	v(<2uK=(ce1zvzeUjo,"e!%3J0:?b&<vupOsA, *{R.'B@2`i.=.A_UZ) q%E6DHD3^Ju%a		s;JGQuLV
?u,rKvX1rl*[}d*-6}:"F!:V:@?-f*13
*-1_&i42Upzmce*Lgl>Ut3j.H:nj\ZDh8_fRtU.`
ҢUL1c$[Jl50h0:iK-{&Xe85j#[T	S4)Q?^W<u&fuuca=h]TE1g' 9<*3	d_|{rzqS`!k<8KU3P >] :&#]I;n' _h0p8p8)Mk[*2uO]8HJF#RlN3Yc^Di%.Ox}%&o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
8C ;[e[oK%lp_
->(cXiO>-5n`{4iXD 5y9h79P1gzga
hi4pP_v@DPbY}GKQHQLN%P[	&Q%Oy+<eK0Nv.yJ:?3'2i<  )                                                                                                                                                                                                                                                        j&        	IPACP.SRC                      u ;  [IPACP]SNMP_VARS.H;1I;1                                                                                                        H                              T                       All Rights Reserved   F Permission to use, copy, modify, and distribute this software and its A documentation for any purpose and without fee is hereby granted,  F provided that the above copyright notice appear in all copies and that@ both that copyright notice and this permission notice appear in 9 supporting documentation, and that the name of CMU not be B used in advertising or publicity pertaining to distribution of the6 software without specific, written prior permission.    D CMU DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDINGH ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALLC CMU BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR C ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, F WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,C ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS 	 SOFTWARE. C ******************************************************************/    #define		MAX_INTERFACES	2 7 extern	struct mib_ifEntry  mib_ifEntry[MAX_INTERFACES];   extern	struct mib_ip	    mib_ip; #define		ROUTE_ENTRIES	2" extern	struct mib_udp	    mib_udp; extern	long	mib_icmpInMsgs;  extern	long	mib_icmpOutMsgs;6 extern	long	mib_icmpInErrors;	/* not checked in KIP */7 extern	long	mib_icmpOutErrors;	/* not checked in KIP */  extern	long	mib_icmpInCount[]; extern	long	mib_icmpOutCount[];    u_char	*var_system();  u_char	*var_ifEntry(); u_char	*var_atEntry(); u_char	*var_ip();  u_char	*var_ipAddrEntry(); u_char	*var_ipRouteEntry();  u_char	*var_icmp();  u_char	*var_udp(); u_char	*getStatPtr();                                                                                                                                                                                                                                                                                                                                                                                                                                * [IPACP]XDR.H;1 +  ,    .     /     4 N                          - ;    0   1    2   3      K  P   W   O     5   6 @YU,  7 R:-  8          9          G    H  J                  /*A 	****************************************************************   0 		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.  A 	****************************************************************  */' /* @(#)xdr.h	2.2 88/07/29 4.0 RPCSRC */  /*E  * Sun RPC is a product of Sun Microsystems, Inc. and is provided for E  * unrestricted use provided that this legend is included on all tape G  *                                                                                                                                                                                                                                                                              Ȳ                                                                                                                                                                                                                      /               Pqu,eqO%fp~yy؀O6.Pp%KD,I*^r$u2_%bgm#:Vce?Dcq<@L$@I&%=	3^y&(yF3:0}}?M"-o.h&~~
ih_CGHm.ec4JkU9*wD]e 2pL#8D8HTAaWX-PRG@9:w}sED{
Χi%9:{jNMCTc+Iet&R mV!C!yD[!&dXv]dMq3&FU"B!7{ţyj#t,dINr4qic=UP3PEA'-lfv\1Fg8_OW
vP)7AU$O$i5#
7yrk$e1gVTXvNMwMKBuCuJ7Iy`lXM916WlgVgH1ew](A]k\&7~#aiK~C#Sl{=1YA/B} *B푯YZMYk46ASspQ^EUE;~$ZOK%OtS[t,z9j+MB_S9K(3"d'lYNI)@O;tIWW0{mNxBnoh$(@<V=4Bqu	XWH` /~E@
l:(pM:em**Oc n>4DjB@LdAyqHw8~.W6=6p$*}s}f`HR=!ay
cj*6c	nC*u*'LAf=Ms::cJO;'P9FmQ87aT4SMRkSe5j^*4PJPrvi}g.U?	#gE*w2-YUyf6-C ?#4ZkMI|u&zL &7KOG,am}:&Dgz56ap'U_L&eqe9o@yq`bY4j;_i">S)*u_[{V>FDVsov)'kY'b[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a{,O ur,_]h@Xf[(Vm11iY$(cKMMpe	N&GFdbVztI[G|!/:gI(kS-?
Ui]FqU0Qow0[
05&rhQi8YVV?\KWq8F*>lB*./nu4)<x+(%VB=Z(\h:\%V@Up!Y u.x{ h#bQurkhn	RDVa>	GB
]'md'}+BU, -vk@eN1/$9]h>&!(jysH#L&.ds42-ye\P/noB\ZPogb^_R=4'7T:j7C]D8R-KO Xm zZ~	1B.?\&fuiVc 3w1TBcZ:}$zfw-(T+WNW/.RV%sD8c9+(}+'L1IRt\WJ,o B!Ux*0_y<su*Xi7(6.21a3w&yh;i^)\j	SQ<B\xRIGF)~,=!hHzaF2x*=Jt&	h@.O^iF9nP
`)"d(oKzl:Qj=H<)7q1<XXa-BkuJj_D%+ >^biwo):tW/o"e#;oqE^.|E M~s6T ]	j$gB$lwKLt'k-}8vy&Nk4v&T<vq_CLgDgx(Jg_Ik~To_TA9Q5G`X QOQ&C`A@}1 L9\%b~5az4>T8Z-.~UA,=q%>+{%n?JAygsqd,W{;.@_LIW2`vT0)snw{b-fe;"8muNkBif{w2C2/HFT@8X0g:QT",r,W-ul&rEc./1CM5t?K!+'Y&@`;y7
"PwE8~Z{uVM
#fTQ6[IITN)]+A<E]T):""oJ
@@sH|iiPUQ	TPequmg~(gaf[ L+aBo+2SU&"kDg@%9R)s1rM1z#N2/~Nz5:2,&
^W	gatyzM-ZrYLd9X9N-MImRYjd.lnHAc0B}}8V[[6uD_md;$|S_(W01K4kayrT}_1*]R
oZz;4Zj?2^y.1+
'Iu1n	du{{cl(Y'R6~[B3.lA\Y<+wC!Mtl XoB2WYmX;}F?859`$2t7V#-{>N?] 3_Z|>lz] 61eU:l5hMj~Y\GO`9M"`,cBj:^3:
=bV~{oH92aAdR"Jly                                                                                                                                                                                                                                                                            ):        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                                     media and as a part of the software program in whole or part.  Users D  * may copy or modify Sun RPC without charge, but are not authorizedL  * to license or distribute it to anyone else except as part of a product or!  * program developed by the user.   *  I  * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE E  * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR I  * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.   *  H  * Sun RPC is provided with no support and without any obligation on theC  * part of Sun Microsystems, Inc. to assist in its use, correction,   * modification or enhancement.   *  E  * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE F  * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC  * OR ANY PART THEREOF.   *  I  * In no event will Sun Microsystems, Inc. be liable for any lost revenue K  * or profits or other special, indirect and consequential damages, even if ;  * Sun has been advised of the possibility of such damages.   *    * Sun Microsystems, Inc.   * 2550 Garcia Avenue #  * Mountain View, California  94043   */ + /*      @(#)xdr.h 1.19 87/04/22 SMI      */    /*>  * xdr.h, External Data Representation Serialization Routines.  *-  * Copyright (C) 1984, Sun Microsystems, Inc.   */    #ifndef __XDR_HEADER__ #define __XDR_HEADER__   /*@  * XDR provides a conventional way for converting between C dataE  * types and an external bit-string representation.  Library supplied G  * routines provide for the conversion on built-in C data types.  These H  * routines and utility routines defined here are used to help implement;  * a type encode/decode routine for each user-defined type.   *H  * Each data type provides a single procedure which takes two arguments:  *	  *	bool_t   *	xdrproc(xdrs, argresp)   *		XDR *xdrs;  *		<type> *argresp;  *G  * xdrs is an instance of a XDR handle, to which or from which the data H  * type is to be converted.  argresp is a pointer to the structure to beI  * converted.  The XDR handle contains an operation field which indicates I  * which of the operations (ENCODE, DECODE * or FREE) is to be performed.   *F  * XDR_DECODE may allocate space if the pointer argresp is null.  This1  * data can be freed with the XDR_FREE operation.   *<  * We write only one procedure per data type to make it easyG  * to keep the encode and decode procedures for a data type consistent. N  * In many cases the same code performs all operations on a user defined type,D  * because all the hard work is done in the component type routines.8  * decode as a series of calls on the nested data types.  */    /*E  * Xdr operations.  XDR_ENCODE causes the type to be encoded into the G  * stream.  XDR_DECODE causes the type to be extracted from the stream. G  * XDR_FREE can be used to release the space allocated by an XDR_DECODE   * request.   */  enum xdr_op {  	XDR_ENCODE=0, 	XDR_DECODE=1, 	XDR_FREE=2  };   /*9  * This is the number of bytes per unit of external data.   */  #define BYTES_PER_XDR_UNIT	(4)J #define RNDUP(x)  ((((x) + BYTES_PER_XDR_UNIT - 1) / BYTES_PER_XDR_UNIT) \ 		    * BYTES_PER_XDR_UNIT)    /*K  * A xdrproc_t exists for each data type which is to be encoded or decoded.   *J  * The second argument to the xdrproc_t is a pointer to an opaque pointer.F  * The opaque pointer generally points to a structure of the data typeF  * to be decoded.  If this pointer is 0, then the type routines shouldB  * allocate dynamic storage of the appropriate size and return it.)  * bool_t	(*xdrproc_t)(XDR *, caddr_t *);   */  typedef	bool_t (*xdrproc_t)();   /*  * The XDR handle.;  * Contains operation which is being applied to the stream, N  * an operations vector for the paticular implementation (e.g. see xdr_mem.c),H  * and two private fields for the use of the particular impelementation.  */  typedef struct {: 	enum xdr_op	x_op;		/* operation; fast additional param */ 	struct xdr_ops { @ 		bool_t	(*x_getlong)();	/* get a long from underlying stream */. 		bool_t	(*x_putlong)();	/                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          
        	IPACP.SRC                        ;  [IPACP]XDR.H;11;1.BLI;1                                                                                                        N                                           * put a long to " */4 		bool_t	(*x_getbytes)();/* get some bytes from " */2 		bool_t	(*x_putbytes)();/* put some bytes to " */> 		u_int	(*x_getpostn)();/* returns bytes off from beginning */> 		bool_t  (*x_setpostn)();/* lets you reposition the stream */< 		long *	(*x_inline)();	/* buf quick ptr to buffered data */= 		void	(*x_destroy)();	/* free privates of this xdr_stream */ 
 	} *x_ops;% 	caddr_t 	x_public;	/* users' data */ 2 	caddr_t		x_private;	/* pointer to private data */7 	caddr_t 	x_base;		/* private used for position info */ ' 	int		x_handy;	/* extra private word */  } XDR;   /*%  * Operations defined on a XDR handle   *  * XDR		*xdrs;  * long		*longp;  * caddr_t	 addr;   * u_int	 len;  * u_int	 pos;  */ $ #define XDR_GETLONG(xdrs, longp)			\) 	(*(xdrs)->x_ops->x_getlong)(xdrs, longp) $ #define xdr_getlong(xdrs, longp)			\) 	(*(xdrs)->x_ops->x_getlong)(xdrs, longp)   $ #define XDR_PUTLONG(xdrs, longp)			\) 	(*(xdrs)->x_ops->x_putlong)(xdrs, longp) $ #define xdr_putlong(xdrs, longp)			\) 	(*(xdrs)->x_ops->x_putlong)(xdrs, longp)   ) #define XDR_GETBYTES(xdrs, addr, len)			\ . 	(*(xdrs)->x_ops->x_getbytes)(xdrs, addr, len)) #define xdr_getbytes(xdrs, addr, len)			\ . 	(*(xdrs)->x_ops->x_getbytes)(xdrs, addr, len)  ) #define XDR_PUTBYTES(xdrs, addr, len)			\ . 	(*(xdrs)->x_ops->x_putbytes)(xdrs, addr, len)) #define xdr_putbytes(xdrs, addr, len)			\ . 	(*(xdrs)->x_ops->x_putbytes)(xdrs, addr, len)   #define XDR_GETPOS(xdrs)				\ # 	(*(xdrs)->x_ops->x_getpostn)(xdrs)  #define xdr_getpos(xdrs)				\ # 	(*(xdrs)->x_ops->x_getpostn)(xdrs)   " #define XDR_SETPOS(xdrs, pos)				\( 	(*(xdrs)->x_ops->x_setpostn)(xdrs, pos)" #define xdr_setpos(xdrs, pos)				\( 	(*(xdrs)->x_ops->x_setpostn)(xdrs, pos)  " #define	XDR_INLINE(xdrs, len)				\& 	(*(xdrs)->x_ops->x_inline)(xdrs, len)" #define	xdr_inline(xdrs, len)				\& 	(*(xdrs)->x_ops->x_inline)(xdrs, len)   #define	XDR_DESTROY(xdrs)				\# 	if ((xdrs)->x_ops->x_destroy) 			\ # 		(*(xdrs)->x_ops->x_destroy)(xdrs)  #define	xdr_destroy(xdrs)				\# 	if ((xdrs)->x_ops->x_destroy) 			\ # 		(*(xdrs)->x_ops->x_destroy)(xdrs)    /*+  * Support struct for discriminated unions. @  * You create an array of xdrdiscrim structures, terminated withE  * a entry with a null procedure pointer.  The xdr_union routine gets C  * the discriminant value and then searches the array of structures H  * for a matching value.  If a match is found the associated xdr routine;  * is called to handle that part of the union.  If there is 2  * no match, then a default routine may be called.>  * If there is no match and no default routine it is an error.  */ % #define NULL_xdrproc_t ((xdrproc_t)0)  struct xdr_discrim { 	int	value;  	xdrproc_t proc; };   /*B  * In-line routines for fast encode/decode of primitve data types.;                                                                                                                                                                                                                                                                            W78        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                                     * Caveat emptor: these use single memory cycles to get the <  * data from the underlying buffer, and will fail to operateF  * properly if the data is not aligned.  The standard way to use these  * is to say: /  *	if ((buf = XDR_INLINE(xdrs, count)) == NULL)   *		return (FALSE);   *	<<< macro calls >>>:  * where ``count'' is the number of bytes of data occupied  * by the primitive data types.   *A  * N.B. and frozen for all time: each data type here uses 4 bytes   * of external representation.  */ ; #define IXDR_GET_LONG(buf)		((long)ntohl((u_long)*(buf)++)) B #define IXDR_PUT_LONG(buf, v)		(*(buf)++ = (long)htonl((u_long)v))  8 #define IXDR_GET_BOOL(buf)		((bool_t)IXDR_GET_LONG(buf))6 #define IXDR_GET_ENUM(buf, t)		((t)IXDR_GET_LONG(buf)): #define IXDR_GET_U_LONG(buf)		((u_long)IXDR_GET_LONG(buf))8 #define IXDR_GET_SHORT(buf)		((short)IXDR_GET_LONG(buf))< #define IXDR_GET_U_SHORT(buf)		((u_short)IXDR_GET_LONG(buf))  @ #define IXDR_PUT_BOOL(buf, v)		IXDR_PUT_LONG((buf), ((long)(v)))@ #define IXDR_PUT_ENUM(buf, v)		IXDR_PUT_LONG((buf), ((long)(v)))B #define IXDR_PUT_U_LONG(buf, v)		IXDR_PUT_LONG((buf), ((long)(v)))A #define IXDR_PUT_SHORT(buf, v)		IXDR_PUT_LONG((buf), ((long)(v))) B #define IXDR_PUT_U_SHORT(buf, v)	IXDR_PUT_LONG((buf), ((long)(v)))   /*(  * These are the "generic" xdr routines.  */  extern bool_t	xdr_void();  extern bool_t	xdr_int(); extern bool_t	xdr_u_int(); extern bool_t	xdr_long();  extern bool_t	xdr_u_long();  extern bool_t	xdr_short(); extern bool_t	xdr_u_short(); extern bool_t	xdr_bool();  extern bool_t	xdr_enum();  extern bool_t	xdr_array(); extern bool_t	xdr_bytes(); extern bool_t	xdr_opaque();  extern bool_t	xdr_string();  extern bool_t	xdr_union(); extern bool_t	xdr_char();  extern bool_t	xdr_u_char();  extern bool_t	xdr_vector();  extern bool_t	xdr_float(); extern bool_t	xdr_double();  extern bool_t	xdr_reference(); extern bool_t	xdr_pointer(); extern bool_t	xdr_wrapstring();    /*:  * Common opaque bytes objects used by many rpc protocols;$  * declared here due to commonality.  */  #define MAX_NETOBJ_SZ 1024   struct netobj {  	u_int	n_len;  	char	*n_bytes;  }; typedef struct netobj netobj;  extern bool_t   xdr_netobj();    /*C  * These are the public routines for the various implementations of   * xdr streams.   */ > extern void   xdrmem_create();		/* XDR using memory buffers */> extern void   xdrstdio_create();	/* XDR using stdio library */@ extern void   xdrrec_create();		/* XDR pseudo records for tcp */@ extern bool_t xdrrec_endofrecord();	/* make end of xdr record */I extern bool_t xdrrec_skiprecord();	/* move to beginning of next record */ 8 extern bool_t xdrrec_eof();		/* true if no more input */   #endif !__XDR_HEADER__                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    	IPACP.SRC                      j  ;  [IPACP]MACLIB.MAR;1LI;1                                                                                                        O    Z                                        * [IPACP]MACLIB.MAR;1 +  , j   . Z    /     4 O   Z   X                   - ;    0   1    2   3      K  P   W   O Y    5   6  TR\,  7 ,-  8          9          G    H  J                             ; B ;	**************************************************************** ; 1 ;		Copyright (c) 1992, Carnegie Mellon University  ;  ;		All Rights Reserved ; A ;	Permission  is  hereby  granted   to  use,  copy,  modify,  and A ;	distribute  this software  provided  that the  above  copyright A ;	notice appears in  all copies and that  any distribution be for  ;	noncommercial purposes.  ; A ;	Carnegie Mellon University disclaims all warranties with regard A ;	to this software.  In no event shall Carnegie Mellon University A ;	be liable for  any special, indirect,  or consequential damages A ;	or any damages whatsoever  resulting from loss of use, data, or A ;	profits  arising  out of  or in  connection  with  the  use  or  ;	performance of this software.  ; B ;	**************************************************************** ; 8 	.Title	MACLIB - Macro level VMS I/O Interface Routines. 	.Ident	'2.4-1'  ; E ; Comment out the following line if NOT building for VMS V4 (in other - ; words comment out if you want a V5 driver).  ;  ;	VMS_V4 = 1   	.Enable	SUP ;	.Enable Debug,TraceBack  	.Disable Debug,TraceBack    	.Library /SYS$LIBRARY:LIB.MLB/    	.PSECT	Locked_Section,LONG    ;++  ;  ; Facility:  ; E ;	Tektronix Network: BLISS-32 callable VMS I/O System Interface rtns.  ;  ; Abstract:  ;  ;	1) MOUNT_ip_DEVICEB ;		Mount the VMS pseudo network device, not DEC's "NET" device but ;		one of our own creation. B ;		This routine is called by IPACP during startup procedures.  The? ;		entire purpose is to make the pseudo device available to all ? ;		users & let IPACP know about where the ACP queue of user I/O  ;		requests lives.B ;		VMS data structures for the VCB (Volume Control Blk) & AQB (ACP= ;		queue blk) are allocated out of non-paged pool.  The final  ;		structure is as follows:  ;  ;		UCB ==> VCB ==> AQB ; ? ;		The AQB holds the queue of user I/O request packets (IRP's).  ;  ;	2) DISMOUNT_IP_DEVICE  ;		Dismount the IPACP volume.  ;  ;	3) USER_REQUESTS_AVAIL( ;		Check A                                                                                                                                                                                                                                                                           I        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        p            CP queue of user I/O requests. ;  ;	4) VMS_IO$POST: ;		Finish the user's I/O request by handing the IRP to VMS( ;		standard IO post processing routines. ;  ;	5) MOVBYT 3 ;		Move bytes fast with movc3 hardware instruction.  ;  ;	6) TIME_STAMP 7 ;		Get time in hundredths of seconds since system boot. : ;		Use EXE$GL_ABSTIM.  This means that we really only have6 ;		a resolution down to the second, but that shouldn't9 ;		adversely affect anything for IP's purposes.  Previous 9 ;		code had to go into kernel mode to read from processor 8 ;		register, but that was enormous overhead (IP seems to; ;		get the time for a lot of stuff while handling segments) ; ;		and wouldn't work on a uVAX (PR$_TODR processor register 3 ;		is no longer defined in VMS V4 for that reason).  ;  ;	7) SWAPBYTES# ;		Swap bytes within a 16-bit word.  ;  ;	8) ZERO_BLK . ;		Zero block of bytes with movc5 instruction. ;  ;	9) CALC_CHECKSUM ; . ;		Calculate a checksum for a block of memory. ; 	 ; Author:  ;  ;	Stan C. Smith	10-4-81  ;  ; Mode:  ; ? ;	Both Kernel (VMS data structure access) & user mode routines.  ;  ; Assembly Instructions: ;  ;	MACRO MACLIB.MAR ;  ; Modification History:  ;  ; *** Begin CMU change log *** ; . ; 2.7	12-Jul-1991	Marc A. Shannon		CMU Group N? ;	Fixed problem where VCB$L_RVT was pointing to the wrong place 8 ;	and a reference to "LOGVOLNAM" would crash the system. ; : ; 2.6	14-Sep-1990	Bruce R. Miller		CMU Network Development' ;	Changed _IP0: to INET$DEVICE logical.  ; : ; 2.5	27-Nov-1989	Bruce R. Miller		CMU Network Development? ;	Removed bias towards TCP processing in order to put TCP, UDP, ? ;	ICMP, and IP on an equal footing.  Changed m$cancel to be 15.  ;  ;	24-JAN-1988	Chris HO		USC-UCS  ;	fixed V5 locks ; > ; 2.4	23-Jan-89	Bruce R. Miller, Pete Neergaard, Marc Shannon.D ;	Corrected check for end of UCB chain when mounting and dismounting5 ;	IP device.  Modified routines Mount_IP_Device, and  E ;	Set_IP_Device_Offline.  Previously code would overshoot the end of  E ;	the UCB list and attempt to dereference null pointer when executing  ;	in SMP context.  ; 7 ; 2.3	04-JUN-88	Lon Willett (Utah) and Dale Moore (CMU) 8 ;	Changed Checksuming routines and added additional code ;	comments about checksumming. ;  ; 2.2  30-Jul-87, Edit by VAF , ;		Implement CQ_DEQUEUE and CQ_ENQUEUE here.( ;		Minor cleanup in USER_REQUESTS_AVAIL. ;  ; 2.1  23-Jan-87, Edit by VAF < ;		Device driver now passes the size of the UARG block so weA ;		know how much to copy into the ACP's local copy. Device driver = ;		must be version 2.8 or later and ACP version 6.0 or later.  ;  ; 2.0  23-Jul-86, Edit by VAF : ;		Pass protocol code and connection id (both from UCB) in ;		cancel processing.  ;  ; 1.9  16-Jul-86, Edit by VAF . ;		Flush extraneous and confusing definitions. ;  ; 1.8   1-JUL-86, Dale Moore* ;		Change references from THC to IPDRIVER. ;  ; 1.7  22-May-86, Edit by VAF < ;		In CANCEL processing, pass UCB address in argument block. ;  ; 1.6   7-May-86, Edit by VAF > ;		In CANCEL processing, convert internal PID to external PID. ;  ;*** End CMU change log ***  ;  ; 1.1 [2-10-82]	Stan Smith ;		Orginal version ;  ; 1.2 [6-10-82] Stan SmithB ;		Included device offline testing/setting back when mount occurs.D ;		This prevents users from doing IO to a non-existant ACP & hanging ;		the user's process. ;  ; 1.3 [8-16-82] Stan SmithF ;		Blank filled the ACP volume name "TCPACP" total length is 12 bytes. ;  ; 1.4 [3-16-83]	Stans Smith = ;		Force dev$m_avl off before we start to mount device "thc". ? ;		Prevents users from doing IO to a device that's not mounted.  ;  ; 1.5 [6-11-83] stanB ;		During vms io posting (vms_io$post) if the irp is in error then@ ;		force the io function to be a write thus preventing a useless> ;		copy from system buffer to user buffer.  On success, if the= ;		io function is a read (irp$v_func=true in irp$w_sts), then > ;		set the actual # of bytes received in irp$w_bcnt instead of. ;		original requested amount.  save some time. ;--   ( .SBTTL	System & Local Symbol definitions   ; VMS External Definitions.   % 	$ARBDEF		; Access Rights Block defs.  	$AQBDEF		; ACP Queue Block ' 	$CHFDEF		; Condition Handler Facility.  	$IRPDEF		; I/O Request Packet 	$UCBDEF		; Unit Control Block! 	$VCBDEF		; Volume Control Block.    .IF	NOT_DEFINED	VMS_V4! 	$CPUDEF				; VMS Version 5.0 SMP  .ENDC # 	$CRBDEF				; channel request block % 	$DCDEF				; device classes and types  	$DDBDEF				; device data block $ 	$DEVDEF				; device characteristics" 	$IDBDEF				; interrupt data block 	$IODEF				; I/O function codes & 	$IPLDEF				; hardware IPL definitions  	$SSDEF				; system status codes$ 	$VECDEF				; interrupt vector block' 	$FKBDEF				; define fork block offsets  	$DYNDEF 	$PCBDEF
 	$PR780DEF     ; Local symbols   B M$Cancel	= 14	; IP user function code, Cancel connections for PID.' FALSE		= 0	; Bliss definition of false.   F ; The following definitions are copied from the Network virtual device$ ; driver "ip"; Module(IPDRIVER.MAR).H ; IPACP argument block fields.  This definition also inclu                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          	>r        	IPACP.SRC                      j  ;  [IPACP]MACLIB.MAR;1LI;1                                                                                                        O    Z                                      des the fieldsG ; definied in the SB block.  The IP ACP reads these fields as arguments J ; to a user network I/O request. This block defines a CANCEL request only.   UCB$L_TCBID	= UCB$Q_DEVDEPEND " UCB$L_PROTOCOL	= UCB$Q_DEVDEPEND+4   	$DEFINI	AB			; ARGUMENT BLOCK  1 ; These first fields are general function fields.   8 $DEF	AB$L_DATA_ADRS			; WITHIN THIS BLOCK, START OF Data
 			.BLKL	17 $DEF	AB$L_Users_Buf_Adrs		; user's buffer start address 
 			.BLKL	10 $DEF	AB$L_Blk_ID			; VMS dynamic block ID fields
 			.BLKL	1- $DEF	AB$L_IRP_Adrs			; Associated IRP address 
 			.BLKL	1' $DEF	AB$L_UCB_Adrs			; Unit Control Blk 
 			.BLKL	1 $DEF	AB$L_PID			; User's PID
 			.BLKL	1- $DEF	AB$W_UARGSIZE			; Size of the UARG block 
 			.BLKW	1% $DEF	AB$B_Funct			; ACP function code 
 			.BLKB	1( $DEF	AB$B_Protocol			; ACP Protocol code
 			.BLKB	1  + ; The following are CANCEL specific fields.   0 ;$DEF	AB$W_Protocol			; Protocol code for CANCEL ;			.BLKW	1 * $DEF	AB$W_IOchan			; IO channel for CANCEL
 			.BLKW	1 $DEF	AB$L_TCBID % 			.BLKL	1	; Connection ID for CANCEL  $DEF	AB$SIZE 			.BLKB	0	; Size of this block    	$DEFEND	AB    .SBTTL	Local Data Declarations  > ;Shared_Device::	.ASCID /_ip0:/	; name of shared pseudo deviceC Shared_Device::	.ASCID /INET$DEVICE/	; name of shared pseudo device     ; These globals are known to IP.    UCB_Adrs::	.LONG	0	; adrs of UCB ACP_QB_Adrs::	.LONG	0  VCB_Adrs::	.LONG	0 MYUIC::		.LONG	0 mypid::		.LONG	0  C ; Range of pages which get locked in WS because they raise IPL & we $ ; can't afford any page faults here!   Locked_Range:  		.LONG	Begin_Lock 		.LONG	End_Lock  F ; IO Status block used by user_requests_avail rtn: when an IRP appearsJ ; but has not come from the network pseudo-device driver (ie, IRP$L_SV                                                                                                                                                                                                                                                                           >        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                                    APTEG ; is 0).  In this case the IRP is turned over to VMS IO post-processing M ; via a calls to VMS_IO$POST rtn.  The IOSB is used as an arg to VMS_IO$POST.    IOSB:	.LONG	0  	.LONG	0   NO_ArgBlk::	.LONG	0  Funct::		.LONG	0  6 .SBTTL	Mount_ip_DEVICE - Mount the Pse             udo device "ip".   ;++ > ; MOUNT_ip_DEVICE, Mount Sharable Pseudo Device for all users. ;  ; Functional Description:  ; C ;	Find the UCB (Unit Control Block) & build the VMS data structures 5 ;	which define a mounted volume.  Final structure is:  ;  ;	UCB ==> VCB ==> AQB  ; > ;	AQB (ACP Queue Blk) contains the queue list head of user I/O ;	request packets. ;  ; Calling Sequence:  ; " ;	$CMKRNL(routin=Mount_ip_Device); ; 	 ; INPUTS:  ;  ;	None.  ; 
 ; Outputs: ; ! ;	Appropriate Error return codes. K ;	OTHERWISE -  SS$_NORMAL with the volume correctly mounted & VMS is happy.  ;  ; Side Effects:  ;  ;	Global locations set:  ; & ;		UCB_ADRS	- Unit Control Blk address ;		ACP_QB_Adrs	- AQB address+ ;		VCB_Adrs	- Volume Control Block address.  ; A ;	Pages containing the Mounting, IO request checking & IO posting A ;	are all locked in the working set.  Main reason is IPL is often > ;	elevated to IPL_SYNCH & we can't have page-faults that high. ;  ;--   / .ENTRY	Mount_ip_Device,^M<R2,R3,R4,R5,R6,R7,R8>    Begin_Lock::6 	$LKWSET_S	Locked_Range	; lock us in the working set.	5 	MOVAL	Shared_Device,R1	; point @ Pseudo device desc.   	BSBW	Find_UCB		; locate the UCB 	BLBS	R0,2$			; OK ?  ) ; Unable to find UCB,  return error here.   1 	MOVZWL	#SS$_NOSUCHDEV,R0	; No such device error.  	RET   ; found UCB, R1 = UCB address % ; Check if volume is already mounted.    2$: & 	MOVL	R1,UCB_Adrs			; save UCB address 	MOVL	R1,R5				; UCB ptr. : 	BICL	#DEV$M_AVL,UCB$L_DevChar(R5)	; disallow any user io.% 	BBS	#Dev$V_MNT,UCB$L_DevChar(R5),25$  	BRW	Not_Mounted  ( ; Volume is mounted, Set globals & leave  * 25$:	MOVZWL	#SS$_VOLINV,R0		; assume error( 	MOVL	UCB$L_VCB(R5),R1	; get VCB address 	BNEQ	3$			; OK   	JMP	Dismount		; oops, clean up. 3$: & 	MOVL	R1,VCB_Adrs		; save VCB address.( 	MOVL	VCB$L_AQB(R1),R2	; get AQB address 	BNEQ	4$  	JMP	Dismount		; Error: Clean up 4$: ( 	MOVL	R2,ACP_QB_Adrs		; save AQB address  > ; Indicate we now own the device, set my PID in ACP queue blk.   	BSBW	Lock_IODB    .IF	DEFINED VMS_V4+ 	SETIPL	#IPL$_SYNCH		; synchronize with VMS 	 .IF_FALSE  	FORKLOCK -			; UCB$B_FLCK(R5) 		SAVIPL=-(SP), -  		PRESERVE=NO  .ENDC   9 	MOVL	PCB$L_PID(R4),AQB$L_ACPPID(R2)	; set new owner PID. 2 	MOVL	PCB$L_PID(R4),mypid	; save for net$dump rtn.$ 	MOVL	PCB$L_ARB(R4),R1	; adrs of ARB( 	MOVL	ARB$L_UIC(R1),MyUIC	; save my UIC.   .IF NOT_DEFINED VMS_V4  	FORKUNLOCK -			; UCB$B_FLCK(R5) 		NEWIPL=(SP)+, -  		PRESERVE=NO  .ENDC  	BSBW	UnLock_IODB    .IF	DEFINED VMS_V4 	SETIPL	#0				; timeshare  .ENDC   	 ALL_Done:   4 ; Mark device "ip0:" as ONline, mounted & Available.F ; Check for any cloned ip devices & mark them also.  Case of ACP crashF ; & user's had ip devices assigned. crash sets device offline & clears ; avail. ; R5 = UCB adrs    .IF	DEFINED VMS_V4) 	DSBINT	UCB$B_FIPL(R5)			; synch with VMS  .ENDC  10$: .IF NOT_DEFINED VMS_V4 	DEVICELOCK	-			;  		SAVIPL=-(SP),-			; 		PRESERVE=NO			;  .ENDC ! 	BISW	#UCB$M_ONline,UCB$W_STS(R5) , 	BISL	#DEV$M_AVL!DEV$M_MNT,UCB$L_DevChar(R5)' 	MOVL	UCB$L_LINK(R5),R1		; Get next UCB  .IF NOT_DEFINED VMS_V4 	DEVICEUNLOCK -  		NEWIPL=(SP)+, -  		PRESERVE=NO  .ENDC  	MOVL	R1, R5	 	BNEQ	10$  .IF	DEFINED VMS_V4 	ENBINT					; reset IPL  .ENDC  	MOVZWL	#SS$_NORMAL,R0 BYE: 	RET  " ; Device is NOT Mounted, Mount it. ; R5 = UCB address   Not_Mounted:1 	BSBW	Build_ACP_QB		; build & link ACP Queue blk.  	CMPL	#SS$_INSFMEM,R0		; OK? 	BEQL	Bye			; EQL means Error.% 	MOVL	Acp_QB_Adrs,R8		; for build_VCB  	BSBW	Build_VCB  	BLBS	R0,All_Done  	JMP	dismount		; lbs = Error.   ( .SBTTL	LOCK_IODB - Lock the I/O Database   ;++  ; FUNCTIONAL DESCRIPTION:  ;  ;	Lock the I/O database mutex  ;  ; Call Sequence: ;  ;	BSB LOCK_IODB  ; 	 ; Inputs:  ;  ;	None.  ; 
 ; Outputs: ;  ;	R4 = My PCB address  ;  ; Side Effects:  ;   ;	I/O Data Base Mutex is locked. ;	IPL set to IPL$_ASTDEL ;  ;--   
 LOCK_IODB:+ 	MOVL	G^CTL$GL_PCB,R4		; get my PCB address # 	JMP	G^SCH$IOLOCKW		; lock & return   , .SBTTL	UNLOCK_IODB - Unlock the I/O Database   ;++  ;  ; Functional Description ;  ;	Unlock the I/O Database mutex  ;  ; Calling Sequence:  ;  ;	BSBW UNLOCK_IODB ; 	 ; Inputs:  ;  ;	None.  ; 
 ; Outputs: ;  ;	R4 = My PCB address  ;  ; Side Effects:  ;   ;	I/O Database mutex is unlocked ;	IPL set to 0 ;  ;--    UNLOCK_IODB: 	MOVL	G^CTL$GL_PCB,R4 + 	JSB	G^SCH$IOUNLOCK			; unlock I/O database  .IF	DEFINED VMS_V4 	SETIPL	#0				; timeshare  .ENDC  	RSB  6 .SBTTL	FIND_UCB - Locate specified Unit Control Block.   ;++  ;  ; Functional Description:  ; > ;	Search the system list of DDB (Device Data Blocks) trying to ;	match the specified DEVICE.  ;  ; Calling Sequence ;  ;	BSBW FIND_UCB  ; 	 ; Inputs:  ; , ;	R1 = Address of Device descriptor (.ASCID) ; 
 ; Outputs: ;  ;	R0 - LBC => error , ;	     LBS Then R1 = Address of Desired UCB. ;  ;--   	 FIND_UCB:  	BSBW	Lock_IODB $ 	JSB	G^IOC$SearchDev		; find the UCB" 	MOVQ	R0,-(SP)		; save return info 	BSBW	UNlock_IODB  	MOVQ	(SP)+,R0		; restore info 	RSB				; return  7 .SBTTL	BUILD_ACP_QB - build the ACP Queue Blk structure    ;++  ; Functional Description:  ; ? ;	Build the ACP queue block data structure in NON-paged dynamic D ;	pool space.  Here we find the queue of IRP's (I/O Request Packets)@ ;	as set up by the QIO Function Dispatch routines.  ACP QB (AQB)3 ;	is linked in the system list of ACP Queue blocks.    ; 	 ; Inputs:  ;  ;	R5 = UCB address ; 
 ; Outputs: ;  ;	R0 = return Code. " ;		SS$_INFSMEM - Allocation Error. ;  ; Side Effects:  ; ; ;	May return                                                                                                                                                                                                                                                                   	IPACP.SRC                      j  ;  [IPACP]MACLIB.MAR;1LI;1                                                                                                        O    Z                         K              with SS$_INFSMEM if unable to allocate dynamic  ;	non-paged pool. + ;	ACP_QB_Adrs = Address of AQB constructed. ? ;	IO database is locked/unlocked while at IPL_SYNCH when AQB is  ;	linked into system AQB list. ;  ;--    Build_ACP_QB:  	MOVZBL	#AQB$C_Length,R17 	JSB	G^Exe$Alononpaged		; get chunck of non-paged pool.  	BLBS	R0,5$				; Error?   2 ; Return error, unable to allocate non-paged pool.   	MOVZWL	#SS$_INSFMEM,R0  	RSB   ; Fill in AQB. ; R2 = address of AQB    5$: % 	MOVL	R2,ACP_QB_Adrs			; save address 4 	MOVW	#AQB$C_Length,AQB$W_Size(R2)	; set block size.* 	MOVB	#DYN$C_AQB,AQB$B_Type(R2)	; blk type: 	MOVB	#AQB$K_NET,AQB$B_ACPType(R2)	; say its a Network AQB0 	CLRB	AQB$B_Class(R2)			; ACP class (noclass...)A 	MOVB	#AQB$M_Unique,AQB$B_Status(R2)	; ACP unique to this device.  .IF	DEFINED VMS_V40 	MOVL	R2,AQB$L_ACPQFL(R2)		; set IRP queue ptrs.) 	MOVL	R2,AQB$L_ACPQBL(R2)		; & back link. 	 .IF_FALSE 7 ; WARNING: V5 change! V5 uses self-relative ACP queues! - 	CLRL	AQB$L_ACPQFL(R2)		; Init IRP queue ptrs & 	CLRL	AQB$L_ACPQBL(R2)		; & back link. .ENDC * 	CLRB	AQB$B_MntCnt(R2)		; init mount count  ? ; Link this AQB into the system list.  Instert at front of list    	MOVL	R2,R8				; save AQB adrs  # 	BSBW	Lock_IODB			; lock IO da                                                                                                                                                                                                                                                                           编`        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        m            tbase  .IF	DEFINED VMS_V4, 	SETIPL	#IPL$_SYNCH			; Synchronize with VMS	 .IF_FALSE  	FORKLOCK	-			;  		SAVIPL=-(SP),-		;  		PRESERVE=NO		; .ENDC   4 	MOVL	PCB$L_PID(R4),AQB$L_ACPPID(R2)	; set owner PID3 	MOVL	PCB$L_PID(R4),mypid		; save for net$dump rtn. 1 	MOVAB	G^IOC$GL_AQBList,R1		; adrs of system list*- 	MOVL	(R1),AQB$L_Link(R8)		; set forward linkg! 	MOVL	R8,(R1)				; set list head.s   ; Save my UICR  $ 	MOVL	PCB$L_ARB(R4),R1		; addres ARB$ 	MOVL	ARB$L_UIC(R1),MyUIC		; my uic. .IF NOT_DEFINED	VMS_V4 	FORKUNLOCK	-p 		NEWIPL=(SP)+,-		;o 		PRESERVE=NO		; .ENDCa$ 	JSB	Unlock_IODB			; unlock & return 	RSB n0 .SBTTL	BUILD_VCB - Build A volume Control block.   ;++o ;n ; Functional Description:a ;eC ;	Allocate & build the VMS Volume control block from nonpaged pool.n7 ;	VCB is pointed to by the UCB & VCB points to the AQB. ) ;	Here we link the entire chain together.a ;e	 ; Inputs:i ;f ;	R5 = UCB address ;	R8 = AQB address.i ;g
 ; Outputs: ;  ;	LBC(R0) THEN Error ;	LBS(R0) THEN success.  ;t ; Side Effects:  ;	- ;	UCB ==> VCB ==> AQB.  Chain is initialized.*; ;	AQB mount count is set to traditional ACP idle count (1).t+ ;	VCB_Adrs = address of Volume-Control-Blk.m ;  ;--h  
 BUILD_VCB:' 	MOVZBL	#VCB$C_Length,R1		; size of VCB 1 	JSB	G^EXE$Alononpaged		; allocate nonpaged pool. % 	BLBC	R0,10$				; Error? punt if yes.    ; Fill in the VCBi ; R2 = address of VCB   # 	MOVL	r2,VCB_Adrs			; save address... 	MOVB	#DYN$C_VCB,VCB$B_Type(R2)	; set blk type3 	MOVZBW	#VCB$C_Length,VCB$W_Size(R2)	; set blk sizeI6 	MOVW	#1,VCB$W_Trans(R2)		; Traditional ACP idle count4 	CLRW	VCB$W_RVN(R2)			; Clear number of rel. volumes 	CLRB	VCB$B_Status(R2)0 	MOVZBW	#1,VCB$W_Mcount(R2)		; 1 volume mounted.3 	MOVL	#^A/Net /,VCB$T_VolName(R2)	; set volume name 7 	MOVL	#^A/Devi/,VCB$T_Volname+4(R2)	; 2nd part of name.tD 	MOVL	#^A/ce  /,VCB$T_Volname+8(R2)	; blank filled (12 chars total).0 	INCB	AQB$B_MntCnt(R8)		; say volume is mounted.   ; Link AQB to VCBr  % 	MOVL	R8,VCB$L_AQB(R2)		; VCB ==> AQBo  F ; Link UCB into the UCB$L_RVT to prevent crashes from users requesting ; DVI$_LOGVOLNAM  / 	MOVL	R5,VCB$L_RVT(R2)		; VCB$L_RVT ==> UCB (?)r   ; link VCB to UCB)  % 	MOVL	R2,UCB$L_VCB(R5)		; UCB ==> VCBo 	MOVZWL	#SS$_Normal,R0 10$: 	RSB E .SBTTL	Set ip Device Off-linee   ;++r ;O	 Function:  ; / ;	Mark the ip0 device as offline & unavailable.t' ;	routine called at Kernel mode access.O ;s	 ; Inputs:g ;u ;	None.  ;	 ; Implicit INputs: ;e2 ;	UCB_adrs = address of ip0 UCB(Unit Control Blk).. ;	Access mode = kernel, so we can touch ucb's. ;n
 ; Outputs: ;  ;	None.E ;G ; Side Effects:e ; < ;	Device "ip0:" is marked as OFFLINE & DEV$M_AVL is cleared.? ;	all cloned UCB's for this controller are also marked offline.s ;P ;--u  # .Entry	Set_ip_Device_OffLine,^M<R5>t  1 	MOVL	UCB_Adrs,R5			; adrs of ip0: (base device).r7 	BGEQ	15$				; good UCB address? must be system addresss .IF	DEFINED VMS_V4, 	DSBINT	UCB$B_DIPL(R5)			; synch UCB access. .ENDCp 10$: .IF NOT_DEFINED VMS_V4 	DEVICELOCK		-		;S 		SAVIPL=-(SP),-			; 		PRESERVE=NO			;S .ENDCa? 	BICW	#UCB$M_ONline,UCB$W_STS(R5)	; for show dev, mark offline. " 	BICL	#DEV$M_AVL,UCB$L_DevChar(R5)( 	MOVL	UCB$L_LINK(R5), R1		; get next UCB .IF NOT_DEFINED VMS_V4 	DEVICEUNLOCK -h 		NEWIPL=(SP)+, -  		PRESERVE=NO  .ENDCo 	MOVL	R1, R5	 	BNEQ	10$V .IF	DEFINED VMS_V4# 	ENBINT					; restore previous IPL.s .ENDCI 15$: 	RET  K .SBTTL	DISMOUNT - Dismount the ACP volume & deallocate the data structures.e   ;++* ;  ; Functional Description:  ;nB ;	Dismount the volume from the pseudo device.  Deallocate VMS data; ;	structures AQB,VCB.  Unhook the AQB from the system list.t ;s ; Calling Sequence:S ;1 ;	JMP DISMOUNT ;		 ; Inputs:k ;v ;	R0 = Error code. ;	R5 = UCB address ;g
 ; Outputs: ;. ;	Appro. return code.M ;e ; Side Effects:v ;p, ;	Routine returns after cleaning up the UCB. ;d ;--   	 DISMOUNT: " 	PUSHL	R0			; save the return code .IF	DEFINED VMS_V4? 	DSBINT	UCB$B_DIPL(R5)		; Save IPL & set new IPL to Device IPL.s	 .IF_FALSE	 	DEVICELOCK		-		;M 		SAVIPL=-(SP),-			; 		PRESERVE=NO			;o .ENDC E 	BICL	#DEV$M_MNT!DEV$M_AVL,UCB$L_DevChar(R5)	; clear Avail & mounted. % 	CLRW	UCB$W_REFC(R5)		; no references  ;	CLRL	UCB$L_OWNUIC(R5). 	CLRL	UCB$L_PID(R5)l( 	CLRL	UCB$L_VCB(R5)		; clean up UCB link .IF	DEFINED VMS_V4 	ENBINT				; reset IPL level.n	 .IF_FALSEP 	DEVICEUNLOCK			-	;	 		NEWIPL=(SP)+,		-	; 		PRESERVE=NO  .ENDCC! 	MOVL	VCB_Adrs,R0		; get VCB adrss 	BEQL	5$			; OK ?a+ 	JSB	G^EXE$Deanonpaged	; dealllocate space.    ; Deallocate ACP Queue blk   5$:e 	MOVL	ACP_QB_Adrs,R8 	BEQL	100$			; OK?   ; Unhook AQB from system listI# ; AQB list is a singly linked list.   # 	BSBW	Lock_IODB		; lock IO databaseo .IF DEFINED VMS_V46 	DSBINT	#IPL$_SYNCH		; Save Current IPL & set new IPL.	 .IF_FALSEe 	FORKLOCK	-		; 		SAVIPL=-(SP),-		;n 		PRESERVE=NO		; .ENDCr1 	MOVAB	G^IOC$GL_AQBLIST,R1	; system AQB list headt" 	MOVL	(R1),R0			; 1st AQB pointer. 	CMPL	R8,R0			; 1st AQB? 	BNEQ	70$			; IF NEQ THEN "NO"   ; 1st AQB in system list.e  & 	MOVL	AQB$L_LINK(R8),(R1)	; link it in 	BRB	90$			; doneo   ; try next AQB in list   70$:% 	CMPL	AQB$L_Link(R0),R8	; is this it?t 	BEQL	80$			; EQl = yes.   ; advance to next AQB   ' 	MOVL	AQB$L_LINK(R0),R0	; get next linkd 	BRB	70$			; loopA   ;p   80$:, 	MOVL	AQB$L_LINK(R8),AQB$L_LINK(R0)	; relink 90$: .IF	DEFINED VMS_V4 	ENBINT				; restore IPL .ENDCh% 	MOVL	R8,R0			; for deallocation rtn.2 	JSB	G^EXE$DEANONPAGED .IF	NOT_DEFINED VMS_V4 	FORKUNLOCK	-h 		NEWIPL=(SP)+,-		;T 		PRESERVE=NO		; .ENDCo( 	BSBW	Unlock_IODB		; unlock IO database.
 ; all done  ! 100$:	POPL	r0			; get return codei 	RET     f: .SBTTL	USER REQUESTS AVAIL - Get User I/O requests for IP.   ;++  ;  ; Functional Description:F ;eC ;	Check the ACP queue block list head to see if any user IRP's haves= ;	been queued to IP.  If IRP's present return the IP argument6 ;	block pointer or FALSE(0). ;	***** Warning *****iF ;	If the IPACP argument block function is M$CANCEL then the IRP is NOT? ;	from a user process & MUST NOT be posted as with normal IRPs.  ;s ; Calling Sequence:  ;c& ;	$CMKRNL(routin=User_Requests_AVAIL); ;s	 ; Inputs:	 ;t ;	Kernel Mode.8 ;	Global	ACP_QB_Adrs is valid, device/volume is mounted. ;e
 ; Outputs: ; 7 ;	R0 = TCP argument block address if IRP's were presentt' ;	OR R                                                                                                                                                                                                                                                                           Դ        	IPACP.SRC                      j  ;  [IPACP]MACLIB.MAR;1LI;1                                                                                                        O    Z                         Y      -       0 = False(0) if no IRP's present.$ ;D ; Side Effects:t ;lB ;	If there are IRP's & associated system-buffer(IPACP argblk) thenE ;	allocate a IP process local argblk & copy the IP arguments from thelH ;	system buffer to the local buffer.  This is performed so we don't haveD ;	to be in kernel mode all the time (debug tools avail).  If the IRPF ;	has no associated IPACP argument block buffer (ie, IRP$L_SVAPTE = 0)K ;	then assume the IRP was sent by VMS & check if IO function was IO$_CLEAN.bI ;	If TRUE then build a fake IPACP user argument block which indicates to oL ;	IPACP that a connection for the specified "PID & IO-chan" should be RESET.B ;	VMS will call the ip: IO cancel routine in the case of Control-CG ;	image rundown (closing open chan                                                                                                                                                                                                                                                                           j        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        i            nels) & when the device is deasigned.  ;n ;__n  * .Entry USER_Requests_Avail,^M<R2,R3,R4,R5>  
 Try_Again:+ 	MOVL	ACP_QB_Adrs,R0		; Network AQB addresse, 	BGEQ	1$			; Valid system address? < 0 = OK. .IF	DEFINED VMS_V4 	REMQUE	@AQB$L_ACPQFL(R0),R2	 .IF_FALSE  	REMQHI	AQB$L_ACPQFL(R0),R2e .ENDCi 	BVC	5$b  " ; Queue was empty, return false(0)   1$:	CLRL	R0  	RET  B ; Queue contained at least 1 IRP.  Get IPACP argument blk address. ; R2 = address of IRPD   5$: ? 	MOVL	IRP$L_SVAPTE(R2),R0	; get address of system IPACP argblk.O5 	BEQL	NO_IPACP_Arg_Blk		; EQL means we have an error.   J ; Copy IPACP argument block from the system buffer (Kernel mode access) toI ; IP local process space.  Entire idea is to execute at user level & only_J ; be in Kernel mode when we have to (no debug tools to speak of for kernelO ; mode).  Anyway we allocate an ACP argument block & copy just the ACP argument.I ; block, not the data.  When we access the data(send) or copy data to thez3 ; system buffer(receive) we must be in Kernel mode.  ; R0 = ACP argblk addressB ; R2 = IRP address  ( 	MOVL	R0,R2			; save system argblk adrs.2 	CALLS	#0,MM$UArg_Get		; allocate IP process space 					; Returns in R0  2 ; copy the argblk system-space ==> IP-Local-space.  - 	PUSHL	R0			; Save the argument block addressI7 	MOVZWL	AB$W_UARGSIZE(R2),R1	; Get fullword count value : 	MOVC3	R1,(R2),(R0)		; Copy data from system to local copy& 	POPL	R0			; Return local copy pointer 	RET  K ; IRP has no associated system buffer (ACP argument block).  This indicatesCJ ; the IRP did not come from the pseudo-device driver & therefore the IPACPF ; will choke on it.  Check if the function code is IO$_CLEAN.  IF TRUEN ; then the user process has been interrupted (Control C or Y) & we must cancelK ; a Connection for this PID & IO channel.  Build a fake ACP argblk with thedL ; IP function M$Cancel which will RESET the connection for the specified PIDH ; & channel #. IF the check was false then just return the IRP to VMS IO1 ; post-processing with an SS$_Normal return code.0   NO_IPACP_Arg_Blk:I 	INCL	NO_ArgBlk 1 	MOVZWL	IRP$W_Func(R2),R4	; Get IO function code.$ 	MOVL	R4,Funct" 	CMPW	#IO$_CLEAN,R4		; ACP cancel?+ 	BNEQ	UR$Post			; No, post IO as SS$_Normal	  9 ; User image is in rundown (exit) state & has canceled IOtL ; Build an IPACP user argblk & return it with the IP function code M$CANCEL.B ; This will cancel a connection for the specified PID & channel #.A ; VMS will cancel IO on each channel assigned to the "ip" device.eO ; Remember: This fake IRP Must NOT be posted to VMS IO post rtns.  System crashQ ; will occur.k  7 	CALLS	#0,MM$UArg_Get		; get a IPACP user argument blk.t  	MOVL	R0,R5			; save argblk adrs> ;;;	MOVL	IRP$L_PID(R2),AB$L_PID(R5)	; set PID in IPACP argblk./ 	MOVL	IRP$L_PID(R2),R0	; Transform internal PIDc0 	JSB	G^EXE$IPID_TO_EPID	; to external PID format. 	MOVL	R0,AB$L_PID(R5)		; Set in argument block( 	MOVL	IRP$L_UCB(R2),R0	; Get UCB address6 	MOVL	R0,AB$L_UCB_ADRS(R5)	; Set UCB address in argblk? ;	MOVB	UCB$L_Protocol(R0),AB$B_Protocol(R5) ; Set protocol code 4 	MOVL	UCB$L_TCBID(R0),AB$L_TCBID(R5)	; Connection ID1 	MOVB	#M$Cancel,AB$B_Funct(R5)	; IP function code 5 	MOVW	#AB$SIZE,AB$W_UARGSIZE(R5)	; Size of the argblk 9 	MOVW	IRP$W_Chan(R2),AB$W_IOchan(R5)	; include channel #.u  * 	MOVB	IRP$L_EXTEND(R2),AB$B_Protocol(R5) ;  " 	MOVL	R2,R0			; point at Fake IRP.) 	JSB	G^COM$DRVDEALMEM	; release Fake IRP.e, 	MOVL	R5,R0			; return IPACP argblk pointer. 	RET  # ; Release/post the IO as SS$_NormalK ; R2 = IRP address.d   UR$Post:# 	PUSHL	IRP$L_UCB(R2)		; UCB addressD 	PUSHL	R2			; IRP addressr, 	MOVZWL	#SS$_Normal,IOSB	; set return status  	PUSHAQ	IOSB			; address of IOSB 	CALLS	#3,VMS_IO$POSTB/ 	BRW	Try_Again		; dismiss this & look for more.p  ? .SBTTL	VMS_IO$POST - Hand User's IRP to VMS IO Post-processing.S   ;++_ ;, ; Functional Description:W ;tD ;	Fill in IRP IOST1 & IOST2 fields, insert IRP in IO post-processing@ ;	queue.  If 1st entry in the queue then request IOPOST software ;	interrupt. ;; ; Calling Sequence:; ;p* ;	$CMKRNL(routin=VMS_IO$POST,ArgLst=args); ;C	 ; Inputs:  ;V ;	Kernel mode.& ;	0(AP)	Number of arguments to follow. ;	4(AP)	IOSB address ;	8(AP)	IRP addressP ;	12(AP)	UCB address ;e
 ; Outputs: ;e ;	None - BLISS NOVALUE routine.D ;  ; Side Effects:  ;B9 ;	if the iosb low-bit is clear, indicating an error, thensB ;	force the io function in irp$w_sts to be a write function.  ThisF ;	eliminates the needless copy of bogus data from the system buffer to1 ;	the user's buffer.  Force irp$v_func to be "0"., ;iH ;	When the successful function is a read (irp$v_func=true in irp$w_sts),G ;	then set irp$w_bcnt to reflect the actual # of bytes received instead	# ;	of the original requested amount.  ;	7 ;	If IRP is only member of IO post process queue then aM+ ;	software interrupt (IOPOST) is requested.L ;--e  = ; Local stack (AP) offsets, CALLS sets stack in this fashion.c   IOSB$Adrs	= 4i IRP$Adrs	= 8 UCB$Adrs	=12     .ENTRY	VMS_IO$POST,^M<R2>h  ( 	MOVL	IRP$Adrs(AP),R1		; get IRP address$ 	MOVL	UCB$Adrs(AP),R2		; UCB address1 	INCL	UCB$L_OPCNT(R2)		; increase operation count	  " ; Adjust volume transaction count.  - 	MOVL	VCB_Adrs,R0		; adrs Volume control blk.-; 	DECW	VCB$W_Trans(R0)		; indicate transaction has finished.C4 	MOVQ	@IOSB$Adrs(AP),IRP$L_IOST1(R1)	; set IOST1 & 2  C ; if lbc (low bit clear) {error indicator} then clear irp$v_func in E ; irp$w_sts to prevent useless copy by kernel mode iopost ast routine    	BLBS	IRP$L_IOST1(r1),1$A 	BICW2	#IRP$M_FUNC,IRP$W_STS(r1) ; error - fake a write function.Y 	BRB	5$			; time to post!  1$:e  ? ; set actual bytes number transfered if this is a read functionB  ! 	BBC	#IRP$V_FUNC,IRP$W_STS(R1),5$PA 	MOVW	IRP$L_IOST1+2(R1),IRP$W_BCNT(r1)  ; set bytes to give user._ 5$:r  ) ; insert IRP into I/O post process queue.B   .IF	DEFINED VMS_V4( 	INSQUE	(R1),@L^IOC$GL_PSBL	; in it goes	 .IF_FALSE  	FIND_CPU_DATA R2 ) 	INSQUE	(R1),@CPU$L_PSBL(R2)	; in it goesk .ENDCO$ 	BNEQ	10$			; Neq = not 1st in queue  , ; 1st IRP in queue, request IOPOST interrupt   	SOFTINT	#IPL$_IOPOST  10$: 	RET  ! End_Lock::		; end of locked pages  /0 .SBTTL	Move Bytes "FAST" with movc3 instruction.   ;++  ;- ; Function Description:^ ;$< ;	Move bytes via the movc3 instruction.  Copy same number of# ;	bytes from source to destination.l ;  ; calling Sequence:+ ; < ;	BLISS callable rtn "CALLS" linkage:  MOVBYT(Size,SRC,DEST)& ;		Warning:  SRC & DEST are addresses!	 ; Inputs:O ;  ;	0(AP)	count of args on stack ;	4(AP)	Number of bytes to moved ;	8(AP)	Source address ;	12(AP)	Destination address ; 
 ; Outputs: ;  ;	None.  ;  ; All registers preserved	 ;T ;--P  ' ; "AP" pointer offsets, calls argumentsd   Size	= 4 Src	= 8 	 Dest	= 12T   MovByt:: 	.WORD	^M<R2,R3,R4,R5>" 	MOVC3	Size(AP),@Src(AP),@Dest(AP) 	RET  7 .SBTTL	Time_Stamp - Get time in                                                                                                                                                                                                                                                                            RP        	IPACP.SRC                      j  ;  [IPACP]MACLIB.MAR;1LI;1                                                                                                        O    Z                         r      <       hundredths of a second.    ;++r ;t ; Function:t ; N ;	Get time in hundredths seconds since Jan of cur year.  Use this time insteadD ;	of QUAD-word system time since its costs less space & is easier toC ;	deal with (eg, comparisons).  Re                                                                                                                                                                                                                                                                           LeH        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        T            ad system global "EXE$GL_ABSTIM".    ;  ; Calling Sequence:e ;o ;	CALLS from BLISS standard. ;U	 ; Inputs:	 ;k ;	None.J ;G
 ; Outputs: ;	= ;	R0 = time in hundredths seconds since Jan 1 of current yeark ;	(longword value).0 ;  ;--r   .Entry	Time_Stamp, 0  6 ;	MOVL	@#EXE$GL_ABSTIM, R0	; Get system interval timer- ;	MULL2	#100, R0		; Convert seconds to 100ths	+ 	PUSHL	R1			; Save R1 from being tromped onO= 	MOVQ	@#EXE$GQ_SYSTIME, R0	; copy the current time into R0/R1s 	BICL2	#^XFFFF8000, R15 	EDIV	#100000, R0, R0, R1 ; Convert with R0 in 100ths  	POPL	R1 	RET     n% .SBTTL Swap bytes on word boundaries.    ;++  ;u
 ;Function: ;=; ;	Routine will swap the low address byte of a word with the$  ;	high address byte of the word. ;i ;Calling Convention: ;e ;	VMS CALLS_ ;S ;Inputs: ; ' ;	0(AP) - Number of arguments on stack. 7 ;	4(AP) - Number of contiguous words to swap bytes} in.s2 ;	8(AP) - Word address of where to start swapping. ;		 ;Outputs:  ;t ;	None ;. ;Side Effects: ;_ ;	None ;M ;--	  0 WrdCnt	= 4					; AP offset to # of words to swap Start	= 8					; start address.   .ENTRY  SWAPBYTES,^M<>  - 	MOVL	Start(AP),R1			; starting word address.M	 Swp_Loop:I 	MOVB	(R1),R0				; low ==> temp." 	MOVB	1(R1),(R1)+			; high ==> low  	MOVB	R0,(R1)+			; temp ==> High5 	SOBGTR	WrdCnt(AP),Swp_Loop		; decr word's left to do. 	RET D .SBTTL	Zero block of bytes.    ;++M ;	 ; Function:B ;A ;	Zero a block of bytes. ;k	 ; Inputs:	 ;$ ;	4(AP)	# of bytes to zero.c ;	8(AP)	Starting address.u ;Q
 ; Outputs: ;; ;	None.u ;o ; Side Effects:I ;E  ;	Consecuative bytes are zeroed. ;2 ;--s  	 Count	= 0p Size	= 4 Adrs	= 8   .ENTRY	Zero_Blk,^M<R2,R3,R4,R5>A  ) 	MOVC5	#0,@Adrs(AP),#0,Size(AP),@Adrs(AP)t 	RET u .SBTTL	Calculate Checksums   ;++n ;I ; Function:  ;C< ;	Generate a 16-bit one's-complement of the one's complement  ;	sum of series of 16 bit words.% ;	See TCP DARPA document for details.e ;a ; Number Systems Lesson: ;RA ;	One's complement arithemetic is different than Two's complementEA ;	arithmetic.  Two's complement arithmetic is what is used on theSD ;	on the VAX.  The positive numbers are the same in one's ComplementC ;	and two's complement.  For two's complement however, NOT X = - X.IA ;	The complement of a number is the negative of the number.  This	; ;	Results in two values for 0, %X'0000' (positive zero) anda ;	 %X'FFFF' (negative zero). ;	> ;	Addition of two's complement can be performed without regard> ;	to the sign of the numbers involved.  This is done by simply; ;	adding the binary representations and ignoring any carry.E0 ;		(-5) + (-2) = 1011 + 1110 = 11001 = 1001 = -7 ; ? ;	Addition of one's complement numbers can be performed withoutu> ;	regard to the sign of the numbers involved.  This is done by> ;	adding the binary representation of the numbers involved and& ;	then adding one if a carry occurred.7 ;		(-1) + 6 = 1110 + 0110 = 10100 = 0100 + 1 = 0101 = 5= ;B ; Algorithm: ;A: ;	We treat the data to be checksummed as an arry of 32 bitA ;	integers.  We keep a running 32 bit sum of the 32 bit integers.Q ; 
 ;	Sum = 0; ;	Incr I FROM 0 TO .Size - 1 DOs# ;		Sum = .Sum + .Data [.I] + Carry;t ;	? ;	We can use two's complement addition to keep this running sum:@ ;	as long as we add with carry. Then we add in any pieces of the" ;	data that wasn't a full 32 bits.> ;	Once the 32 bit sum is computed, we can fold the top 16 bits ;	into the bottom 16 bits. ;A% ;	Sum = .Sum <0, 16> + .Sum <16, 16>;B ;BD ;	But this folding may produce yet another carry. So we do it twice. ;kA ;	If you want you can think of the bits as being in a ring, whereR? ;	any carry (out of the high bits) would be pushed into the lowt ;	bits.M ;B ;		       00 ;		  15        01  ;		14            02e ;	       13              03o ;	       12              04C ;		11            05n ;		 10          06 ;		   09      07 ;		       08 ;                      ;t< ;	We then complement the result of the summing and check for  ;	value of 0 and return only -0. ;			 ;	 ; Calling Sequence:i ;U ;	Standard CALLS:V& ;	    CALC_CHECKSUM(Byte_Count,Start);8 ;	    GEN_CHECKSUM(Byte_Count,Start,SrcA,DstA,Ptcl_Type) ;=	 ; Inputs:  ; = ;	4(AP) : Byte_Count = # of 8-bit bytes to checksum as words.V( ;	8(AP) : Start = Starting byte address.$ ;    Additionally, for GEN_CHECKSUM:" ;	12(AP): SrcA = Source IP address' ;	16(AP): DstA = Destination IP addressa- ;	20(AP): Ptcl_Type = Protocol type of packetu ;	
 ; Outputs: ;m ;c= ;	My interpretation of "one's complement sum" is the true sumkD ;	modulo 2^16-1.  Thus, it will be a value in the range 0 .. 2^16-2,; ;	i.e. -0 is not a legal "one's complement sum", but -0 is.e ;s: ;	Thus the "one's complement of the one's complement sum" = ;	will be a value in the range 1 to 2^16-1.  So the IP headeriA ;	checksum and TCP checksum should never be zero.  (UDP specifiese> ;	the interpretation of putting a zero in the checksum field).= ;	Under the robustness principle: accept a value of "0" wherea; ;	it should be "-0".  I don't believe that IP or TCP should	= ;	skip verifying the checksum (as UDP does) when the checksumBB ;	field is 0, because checksumming for IP and TCP is not optional. ;L: ;	The one's complement sum of a good packet will be 0.  Of> ;	course the checksum routines return the "one's complement of< ;	the one's complement sum", so apply a NOT before comparing> ;	against 0. But be aware that this routine returns 16 bits in) ;	R0, so you must NOT only 16 bits worth.l ;  ; Side Effects:d ;  ;	None.s ;  ;--*   ; Argument Point stack offsets.n   Byte_Count	= 4
 Start		= 8  Srca	= 12				; Source IP address#   Srca0	= 12				; First 16-bit wordh$   Srca1	= 14				; Second 16-bit word% Dsta	= 16				; Destination IP address	#   Dsta0	= 16				; First 16-bit word $   Dsta1	= 18				; Second 16-bit word PtclT	= 20				; Protocol type    ;++f3 ; Gen_Checksum - Generate checksum for UDP and TCP.CM ; Adds in the protocol fields and the IP addresses, then joins Calc_Checksum._O ; N.B. We jump directly into Calc_Checksum, so the offsets for Length and Start H ; must be the same and we must make sure to save the same registers that ; Calc_Checksum uses.U ;--D   .Entry	Gen_Checksum,^M<R2>  0 	MOVZWL	Byte_Count(AP),R0	; Put byte count in R0+ 	ASHL	#-2,R0,R2		; Put fullword count in R2C* 	;; Must use byte count rotated +/- 8 bits( 	;; Must use protocol rotated +/- 8 bits3 	;; (Because net stuff wants Big Endian byte order)+' 	ASHL	#8,R0,R0		; Start with byte count_> 	INSV	Ptclt(AP),#24,#8,R0	; Add in protocol (only 8 bits wide)' 	ADDL	Srca(AP),R0		; Add in source addre1 	ADWC	Dsta(AP),R0		; Add in dest addr (and carry)	. 	BRB	Calc_Check0		; Join Calc_Checksum routine   ;++i4 ; Calc_Checksum - one's compliment checksum routine. ;--d   .Entry	Calc_Checksum,^M<R2>D  ' 	CLRL	R0			; Start with a zero checksum  	MOVZWL	Byte_Count(AP),R2L+ 	ASHL	#-2,R2,R2		; Put fullword count in R2	 					; (and clear Carry)3 Calc_Check0:				; Point where Gen_Checksum joins in	4 	;; R0 and PSW-Carry contain initial 32 bit checksum 	;; R2 contains fullword count$ 	;; Start(AP) is pointer to 1st byte& 	;; Byte_Count(AP) contains byte count' 	MOVL	Start(AP),R1		; starting address.C 	SOBGEQ	R2,CLop			; enter loop 	BRB	Odd_Word		; (no fullwords) 5 Clop:	ADWC	(R1)+,R0		; add in next fullword and Carry   	SOBGEQ	R2,CLop			; get next one	 Odd_Word:  	;; Check for ex                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          c        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                              !                                  2        	IPACP.SRC                      j  ;  [IPACP]MACLIB.MAR;1ISC.BLI;1                                                                                                   O    Z                         ]      K       tra word 	BBC	#1,Byte_Count(AP),Odd_ByteI! 	MOVZWL	(R1)+,R2		; get next wordL) 	ADWC	R2,R0			; add it in (and the Carry)r	 Odd_Byte:G 	;; Check for extra byte 	BLBC	Byte_Count(AP),Reduce16 ! 	MOVZBL	(R1)+,R2		; get next byte	) 	ADWC	R2,R0			; add it in (and the Carry)d	 Reduce16: D 	;; We have the sum modulo 2**32-1 (actually: protocol and bytecount; 	;; from Gen_Checksum are strange, but are eqv mod 2**16-1)  	;; Now reduce mod 2**16-1' 	EXTZV	#16,#16,R0,R2		; extract HO worda% ;	INSV	#0,#16,#16,R0		; clear HO wordn 	MOVZWL	R0,R0 / 	ADWC	R2,R0			; add HO and LO words (and Carry) 1 	BBCC	#16, R0, Comp		; clear carry out of LO wordt( 					; (and branch if short word result) 	INCW	R0			; add carry inr% 	BCC	Comp			; branch if no more carrya$ 	INCW	R0			; else add final carry in( 					; (this INCW can't produce a carry) Comp:	;; Complement the word 	MCOMW	R0,R0
 	BEQL	ZSum 	RET ZSum:	;; Return 0 as FFFFu 	MCOMW	R0,R0 	RET ;.Entry	Gen_Checksum,^M<R3,R4> ; 3 ;	MOVL	PtclT(AP),R0		; Start with the protocol code() ;	ADDL	Byte_Count(AP),R0	; Add the lengths. ;; Do a byte swap - isn't there an easier way? ;	EXTV	#8,#8,R0,R1		; D C B A	Bo ;	INSV	R0,#8,#8,R0		; D C A A	Bc ;	MOVB	R1,R0			; D C A B	B ;	ROTL	#16,R0,R0		; A B D C	Bl ;	EXTV	#8,#8,R0,R1		; A B D C	D  ;	INSV	R0,#8,#8,R0		; A B C C	De ;	MOVB	R1,R0			; A B C D	D6 ;	MOVZWL	Srca0(AP),R1		; Get first word of source addr ;	ADDL	R1,R0			; Add itA7 ;	MOVZWL	Srca1(AP),R1		; Get second word of source addrf ;	ADDL	R1,R04 ;	MOVZWL	Dsta0(AP),R1		; Get first word of dest addr ;	ADDL	R1,R05 ;	MOVZWL	Dsta1(AP),R1		; Get second word of dest addrh ;	ADDL	R1,R0/ ;	BRB	Calc_Check0		; Join Calc_Checksum routineh ;p ;;++5 ;; Calc_Checksum - one's compliment checksum routine.  ;;-- ;o ;.Entry	Calc_Checksum,^M<R3,R4>s ;a( ;	CLRL	R0			; Start with a zero checksum ;a4 ;Calc_Check0:				; Point where Gen_Checksum joins in ; ( ;	MOVL	Start(AP),R4		; starting address. ;	MOVL	Byte_Count(AP),R3 ;	TSTL	R3			; anything to do?B ;	BGTR	10$			; >0 = yes. ;	RET				;      O        0 count.Q ;10$:R+ ;	ASHL	#-1,R3,R3		; convert bytes to words.t ;	TSTL	R3			; any words to do?& ;	BEQL	Odd_BC			; 0 = 1 byte to do....& ;	CLRL	R1			; clean up high word of R1 ;Clop: ;	MOVW	(R4)+,R1		; get a wordV  ;	ADDL	R1,R0			; longword arith." ;	SOBGTR	R3,Clop			; more to come? ;k ;; Check for ODD byte countr ;  ;ODD_BC: ;	BLBC	Byte_Count(AP),Chk_OVFL5 ;	MOVZBL	(R4),R1			; get ODD byte padded with 0 byte.s ;	ADDL	R1,R0 ;a ;; Add in any overflow ;l
 ;CHk_OVFL:* ;	EXTZV	#16,#16,R0,R1		; extract overflow. ;	BEQL	Comp			; 0 = done) ;	BICL2	#^XFFFF0000,R0		; AND to 16-bits.u  ;	ADDL	R1,R0			; add to checksum ;	BRB	Chk_OVFL ;t  ;; Complement & mask to 16-bits. ;e ;Comp:, ;	XORW	#^X0FFFF,R0		; Complement to 16-bits. ;	RET  K0 .SBTTL	Circular byte queue manipulation routines  6 ; These routines are written in MACRO for two reasons:E ;    1) Speed. They are used a lot and should be as fast as possible. M ;    2) Precision. Since the circular queues can be modified at AST level, itaF ;	it critical that the pointers and counters be updated atomically. We= ;	can't really trust the BLISS compiler to take care of that.   D ; Define the format of the circular queue - must match STRUCTURE.REQ   	$DEFINI CQ			; Circular queue6 $DEF	CQ$QUEUE	.BLKB	0	; Address of the queue structure4 $DEF	CQ$BASE		.BLKL	1	; Base address of queue buffer2 $DEF	CQ$END		.BLKL	1	; End address of queue buffer) $DEF	CQ$SIZE		.BLKW	1	; Size of the queuen4 $DEF	CQ$COUNT	.BLKW	1	; Number of bytes on the queue; $DEF	CQ$ENQP		.BLKL	1	; Pointer to first free byte on queuew; $DEF	CQ$DEQP		.BLKL	1	; Pointer to first used byte on queuei 	$DEFEND CQe     ; CQ_Enqueue(CQ,SRC,Scount) N ; Enqueue bytes onto a circular queue. Called via $CMKRNL when enqueueing from ; user's system buffer.    CQ	= 4				; Queue header  SRC	= 8				; Destination address  SCOUNT	= 12				; Number of bytes  ' .ENTRY CQ_Enqueue,^M<R2,R3,R4,R5,R6,R7>?  $ 	MOVL	CQ(AP),R7		; Get queue address9 	SUBL3	CQ$ENQP(R7),CQ$END(R7),R6 ; Find space left to endc9 	CMPL	R6,SCOUNT(AP)		; Does he want all we have till end? ( 	BLEQ	10$			; Yes - need two moves, then5 	MOVC3	SCOUNT(AP),@SRC(AP),@CQ$ENQP(R7) ; Do the move 0 	MOVL	R3,CQ$ENQP(R7)		; Update the queue pointer5 	ADDW2	SCOUNT(AP),CQ$COUNT(R7) ; And update the counto 	RET$ 10$:					; Here on pointer-wrap case8 	MOVC3	R6,@SRC(AP),@CQ$ENQP(R7) ; Move till end of queue7 	MOVL	CQ$BASE(R7),R3		; Reset pointer to start of queueL> 	SUBL3	R6,SCOUNT(AP),R6	; Compute how much we need from Q base! 	BLEQ	20$			; Have anything left? , 	MOVC3	R6,(R1),(R3)		; Yes - finish the copy 20$:0 	MOVL	R3,CQ$ENQP(R7)		; Update the queue pointer5 	ADDW2	SCOUNT(AP),CQ$COUNT(R7) ; And update the count$ 	RET				; And done.U     ; CQ_Dequeue(CQ,Dest,Dcount)L ; Dequeue bytes from a cirucular queue. Called via $CMKRNL when dequeuing to ; user's system buffer.    CQ	= 4				; Queue header! DEST	= 8				; Destination addressA  DCOUNT	= 12				; Number of bytes  ' .ENTRY CQ_Dequeue,^M<R2,R3,R4,R5,R6,R7>h  $ 	MOVL	CQ(AP),R7		; Get queue address9 	SUBL3	CQ$DEQP(R7),CQ$END(R7),R6 ; Find space left to end 9 	CMPL	R6,DCOUNT(AP)		; Does he want all we have till end?M( 	BLEQ	10$			; Yes - need two moves, then6 	MOVC3	DCOUNT(AP),@CQ$DEQP(R7),@DEST(AP) ; Do the move0 	MOVL	R1,CQ$DEQP(R7)		; Update the queue pointer5 	SUBW2	DCOUNT(AP),CQ$COUNT(R7) ; And update the countN 	RET$ 10$:					; Here on pointer-wrap case9 	MOVC3	R6,@CQ$DEQP(R7),@DEST(AP) ; Move till end of queuen7 	MOVL	CQ$BASE(R7),R1		; Reset pointer to start of queueT; 	SUBL3	R6,DCOUNT(AP),R6	; Compute count we need from Q base ! 	BLEQ	20$			; Have anything left?l, 	MOVC3	R6,(R1),(R3)		; Yes - finish the copy 20$:0 	MOVL	R1,CQ$DEQP(R7)		; Update the queue pointer5 	SUBW2	DCOUNT(AP),CQ$COUNT(R7) ; And update the count  	RET				; And done.K     ; CQ_DeqCopy(CQ,Dest,Dcount)@ ; Same as CQ_Dequeue, except queue pointer/count is not updated.   CQ	= 4				; Queue header! DEST	= 8				; Destination addressA  DCOUNT	= 12				; Number of bytes  ' .ENTRY CQ_DeqCopy,^M<R2,R3,R4,R5,R6,R7>i  $ 	MOVL	CQ(AP),R7		; Get queue address9 	SUBL3	CQ$DEQP(R7),CQ$END(R7),R6 ; Find space left to endo9 	CMPL	R6,DCOUNT(AP)		; Does he want all we have till end?t( 	BLEQ	10$			; Yes - need two moves, then6 	MOVC3	DCOUNT(AP),@CQ$DEQP(R7),@DEST(AP) ; Do the move3 ;;;	MOVL	R1,CQ$DEQP(R7)		; Update the queue pointere8 ;;;	SUBW2	DCOUNT(AP),CQ$COUNT(R7) ; And update the count 	RET$ 10$:					; Here on pointer-wrap case9 	MOVC3	R6,@CQ$DEQP(R7),@DEST(AP) ; Move till end of queuei7 	MOVL	CQ$BASE(R7),R1		; Reset pointer to start of queuee; 	SUBL3	R6,DC      X       OUNT(AP),R6	; Compute count we need from Q base)! 	BLEQ	20$			; Have anything left?f, 	MOVC3	R6,(R1),(R3)		; Yes - finish the copy 20$:3 ;;;	MOVL	R1,CQ$DEQP(R7)		; Update the queue pointerA8 ;;;	SUBW2	DCOUNT(AP),CQ$COUNT(R7) ; And update the count 	RET				; And done.N   .ENDncrease operation count	  " ; Adjust volume transaction count.  - 	MOVL	VCB_Adrs,R0		; adrs Volume control blk.-; 	DECW	VCB$W_Trans(R0)		; indicate transaction has finished.C4 	MOVQ	@IOSB$Adrs(AP),IRP$L_IOST1(R1)	; set IOST1 & 2  C                * [IPACP]POKEADDR.MAR;1 +  ,    .     /     4 I       <                    - ;    0   1    2   3      K  P   W   O     5   6 1kuU,  7 @ >/-  8                                                                                                                                                                                                                                                                                &6        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        e      0           9          G    H  J                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       ᷄        	IPACP.SRC                        ;  [IPACP]POKEADDR.MAR;11.BLI;1                                                                                                   I                                            ; B ;	**************************************************************** ; 1 ;		Copyright (c) 1992, Carnegie Mellon University  ;  ;		All Rights Reserved ; A ;	Permission  is  hereby  granted   to  use,  copy,  modify,  and A ;	distribute  this software  provided  that the  above  copyright A ;	notice appears in  all copies and that  any distribution be for  ;	noncommercial purposes.  ; A ;	Carnegie Mellon University disclaims all warranties with regard A ;	to this software.  In no event shall Carnegie Mellon University A ;	be liable for  any special, indirect,  or consequential damages A ;	or any damages whatsoever  resulting from loss of use, data, or A ;	profits  arising  out of  or in  connection  with  the  use  or  ;	performance of this software.  ; B ;	**************************************************************** ; ? 	.title	POKEADDR - Poke the IP Address into P1 space (remotely)  	.sbttl	Copyright notice 	.ident	'V6.4' ; F ; Code borrowed from SHODEF.MAR to execute an AST on behalf of another/ ; process cleanly.  Original copyright below...  ;  ;	.ident	'V1.00'D ;NOTICE: .ascii	'Copyright ) 1989 John Hascall, All Rights Reserved' ; @ ; Author:	John Hascall, Iowa State University Computation Center ; Written:	25 March 1989 ; Updates:	(none) D ; Restrictions:	This program or any part thereof may be used for any7 ;		non-commercial use provided this notice is included. ; ;		Commercial use is not allowed.  No warranty is expressed  ;		or implied.     	.page 	.sbttl	Description  ; ? ; POKEADDR:	This procedure will, when passed with the arguments 6 ;		described below, modify the destination's process's5 ;		P1 space, namely CTL$T_NODENAME and CTL$T_REMOTEID 2 ;		to correctly identify the remote connection for ;		security purposes.  ;  ; How it works:  ; C ;	1)  We use SYS$CMKRNL to execute a routine (LOCAL_KERNEL_CODE) in ' ;	    kernel mode.  In this routine we: 7 ;		a)  Convert the target processes external PID to its  ;		    internal PID. ;		b)  Disable Interrupts < ;		c)  Allocate a buffer (KMB) in system space.  This buffer: ;		    includes an ACB, room for the default, and room for4 ;		    a routine (THEIR_KAST) which we copy into it.: ;		d)  Using the ACB in KMB we queue a special kernel mode( ;		    AST (KAST) to the target process.* ;		e)  We re-enable interrupts and return. ; ) ;	--- At some unknown time we then... ---  ; A ;		T1) The KAST (THEIR_KAST) executes in the cotext of the target  ;		    process (IPL is 2).A ;		T2) We copy the information in the KMB to the target process's  ;		    P1 space.A ;		T3) We re-use the ACB (at the head of the KMB) to queue a KAST 0 ;		    back to the original process, and return. ; B ;		O1) The KAST (OUR_KAST) executes in the context of the original ;		    process (IPL is 2). ;		O2) The KMB is deallocated. ;      	.page 	.sbttl	Libraries    	.library	'SYS$LIBRARY:LIB.MLB' - 	.link		'SYS$SYSTEM:SYS.STB'/selective_search      	.page 	.sbttl	Definitions - System   	$ACBDEF				; AST Control Block  	$DSCDEF				; Descriptors % 	$DYNDEF				; Dynamic Data Structures & 	$IPLDEF				; Interrupt Priority Level# 	$PCBDEF				; Process Control Block ( 	$SSDEF				; System Service Return Codes     	.page% 	.sbttl	Definitions - Local Constants   ) KAST_BLOCK	= <<ACB$M_KAST@8>!<DYN$C_ACB>> 8 DYNAMIC_STRING	= <<DSC$K_CLASS_D@24>!<DSC$K_DTYPE_T@16>>     	.page* 	.sbttl	Definitions - Local Control Blocks ;  ; Kernel Mode Buffer ;  	$DEFINI	KMB,,ACB$K_LENGTH $DEF	KMB$L_OURPID	.blkl	1  $DEF	KMB$T_NODEADDR	.blkb	6+1  $DEF	KMB$T_NODENAME	.blkb	6+1  $DEF	KMB$T_REMOTEID	.blkb	16+1 $DEF	KMB$K_LENGTH ) $DEF	KMB$Z_CODE			; kernel code goes here  	$DEFEND	KMB ;  Net_Nodename:	.ascic	/TCP-IP/  ;  ; Buffer for IP addresses  ;  Net_Binary:	.blkl	1  Net_Addr:	.blkq	1  Number_Space:	.blkb	5    	.page 	.sbttl	Definitions - Macro    	.macro	IF_ERR	GOTO,?OK  	BLBS	R0,OK 	 	BRW	GOTO  OK:  	.endm     	.page 	.sbttl	Code 	.psect	Code,Rd,NoWrt,Exe  	.entry	POKEADDR,^M<R11> ; & ; Inputs:	4(AP)	- Target process's PID ;		8(AP)	- remote IP address ;		12(AP)	- remote port  ;  ; get into kernel mode ;  	$CLREF_S	EFN=#17   . 	PUSHL	12(AP)			; build argument list on stack 	PUSHL	8(AP) 	PUSHL	4(AP)	 	PUSHL	#3  	PUSHAL	(SP) 	PUSHAB	LOCAL_KERNEL_CODE  	CALLS	#2,g^SYS$CMKRNL 	MOVAB	12(SP),SP		; clean stack   + ; What the hell are we waiting for??? - BRM  ;	$WAITFR_S	EFN=#17    	RET     	.page 	.sbttl	LOCAL_KERNEL_CODE  ; ' ; Inputs:	4(AP)	- PID of remote process ' ;		8(AP)	- IP address to be stored away ' ;		12(AP)	- port number "  "   "      "  ; Outputs:		- KMB allocated # ;			- KAST queued to target process  ; 6 	.entry	LOCAL_KERNEL_CODE,^M<R2,R3,R4,R5,R6,R7,R8,R11> ; ' ; convert from external to internal PID  ;  	MOVL	4(AP),R0 	JSB	g^EXE$EPID_TO_IPID & 	MOVL	R0,R8			; save R0 (internal Pid)	 	BNEQ	10$  	MOVL	#SS$_NONEXPR,R0 	 	BRW	102$  ;	RET   7 10$:	DSBINT	#IPL$_ASTDEL		; don't deliver any ASTs now!  ; = ; allocate kernel-mode control block + space for KAST routine  ;  	MOVAB	THEIR_KAST,R7 	MOVAB	THEIR_KAST_END,R6% 	SUBL2	R7,R6			; size of KAST routine + 	ADDL3	#KMB$K_LENGTH,R6,R1	;  + size of KMB  	JSB	g^EXE$ALONONPAGED 	BLBS	R0,20$ 	MOVL	#SS$_INSFMEM,R0 	 	BRW	101$    20$: ; ( ; set up "TCP-IP" in the kernel block... ;  	PUSHR	#^M<R1,R2,R3,R4,R5> 	PUSHAB	KMB$T_NODENAME(R2) 	PUSHAB	Net_NodeName 	CALLS	#2,COPY_DATA    	CLRL	R5 	MOVAB	KMB$T_REMOTEID(R2),R3 	MOVB	#15,(R3)+    	MOVL	8(AP),Net_Binary" 	MOVL	#<DYNAMIC_STRING!3>,Net_Addr 	MOVAL	Number_Space,Net_Addr+4 	MOVB	#^A/./,Number_Space+3   " 22$:	PUSHL	#1			; input-value-size 	PUSHL	#3			; number-of-digits 	PUSHAL	Net_Addr 	PUSHAB	Net_Binary[R5] 	CALLS	#4,g^OTS$CVT_L_TU  0 	BLBS	R0,23$			; too far away to use BLBC to 89$	 	BRW	100$    23$:	MOVL	Number_Space,(R3)+ 	AOBLEQ	#3,R5,22$    ; Copy over the port number  ; I ; Personal comment: This field is called a text field, but is interpreted H ; by VMS as a (oddly enough) binary field.  The length is 4, but I don'tA ; know what would happen if I actually copied a longword into it.    	MOVB	#4,KMB$T_NODEADDR(R2) # 	MOVZWL	12(AP),KMB$T_NODEADDR+1(R2)    ; # ; copy THEIR_KAST into system space  ;  25$: 	MOVC3	R6,(R7),KMB$Z_CODE(R2)  	POPR	#^M<R1,R2,R3,R4,R5>  ; ( ; fill in the ACB at the head of the KMB ; ( 	MOVL	R2,R3			; R3 steps through ACB/KMB0 	CLRQ	(R3)+			; clear ACB$L_ASTQFL, ACB$L_ASTQBL 	MOVW	R1,(R3)+		; ACB$W_SIZE0 	MOVW	#KAST_BLOCK,(R3)+	; ACB$B_TYPE, ACB$B_RMOD5 	MOVL	R8,(R3)+		; ACB$L_PID (prev saved internal PID) " 	MOVAB	OUR_KAST,(R3)+		; ACB$L_AST 	MOVL	R11,(R3)+		; ACB$L_ASTPRM D 	MOVAB	KMB$Z_CODE(R2),(R3)+	; ACB$L_KAST (system copy of THEIR_KAST)3 	MOVL	PCB$L_PID(R4),(R3)+	; KMB$L_OURPID (internal)  ; 0 ; queue special kernel mope AST to other process ;  	MOVL	R2,R5			; R5 -> ACB ( 	MOVL	#4,R2			; priority increment                                                                                                                                                                                                                                                                           t0        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                              ?       class 	JSB	g^SCH$QAST   ! 	ENBINT				; re-enable interrupts  99$:	RET  2 100$:	; We should free up that memory now... - BRM& 101$:	ENBINT				; re-enable interrupts 102$:	$SETEF_S	EFN=#17 	RET     	.page 	.sbttl	OUR_KAST ; ! ; Inputs:	R4	- address of our PCB   ;		R5	- address of our ACB (KMB)# ; Outputs:		- default copied to UMB  ;			- KMB de-allocated ;			- event flag 17 set  ; 	 OUR_KAST:  ; D ; copy def-dir-spec from KMB (system space) to UMB (in our P0 space) ;  	MOVL	R5,R0  ; , ; return the KMB to non-paged pool (R0->KMB) ;  	JSB	g^EXE$DEANONPAGED ; , ; set event flag for out waiting main thread ;  	$SETEF_S	EFN=#17  	RSB       	.page 	.sbttl	THEIR_KAST ; . ; Inputs:	R4	- address of PCB (target process) ;		R5	- address of ACB (KMB)# ; Outputs:		                                                                                                                                                                                                                                                                           eX        	IPACP.SRC                        ;  [IPACP]POKEADDR.MAR;11.BLI;1                                                                                                   I                              Q             - default copied to KMB % ;			- KAST queued to original process  ;  THEIR_KAST:				; R5 -> KMB(ACB)  ; E ; copy remote info to per-process P1 space from KMB (in system space)  ;  	PUSHL	#CTL$T_NODEADDR 	PUSHAB	KMB$T_NODEADDR(R5)8 	CALLS	#2,B^COPY_DATA		; relative to use the kernel copy   	PUSHL	#CTL$T_REMOTEID 	PUSHAB	KMB$T_REMOTEID(R5) 	CALLS	#2,B^COPY_DATA    	PUSHL	#CTL$T_NODENAME 	PUSHAB	KMB$T_NODENAME(R5) 	CALLS	#2,B^COPY_DATA    ; . ; queue ast back to our (the original) process ; 8 	BISB2	#ACB$M_KAST,ACB$B_RMOD(R5)	; re-set the KAST flag$ 	MOVL	KMB$L_OURPID(R5),ACB$L_PID(R5)" 	MOVL	ACB$L_AST(R5),ACB$L_KAST(R5)( 	MOVL	#4,R2			; priority increment class 	JMP	g^SCH$QAST    	.sbttl	COPY_DATA 9 ; Inputs:	4(AP)	- Address of source data (counted string)  ;		8(AP)	- Destination address( ; Outputs:		- Data copied to destination ; ! 	.entry	COPY_DATA,^M<R2,R3,R4,R5>    	MOVL	4(AP),R1 	MOVL	8(AP),R2   	MOVZBL	(R1),R3		; get length & 	MOVB	(R1)+,(R2)+	; copy string length( 	MOVC3	R3,(R1),(R2)	; copy string itself   	RET   THEIR_KAST_END:      	.end                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  * [IPACP]XEDRV_TRANS.MAR;1 +  , p   .     /     4 L       b                    - ;    0   1    2   3      K  P   W   O     5   6 U,  7 `X<-  8          9          G    H  J           
             ; B ;	**************************************************************** ; 1 ;		Copyright (c) 1992, Carnegie Mellon University  ;  ;		All Rights Reserved ; A ;	Permission  is  hereby  granted   to  use,  copy,  modify,  and A ;	distribute  this software  provided  that the  above  copyright A ;	notice appears in  all copies and that  any distribution be for  ;	noncommercial purposes.  ; A ;	Carnegie Mellon University disclaims all warranties with regard A ;	to this software.  In no event shall Carnegie Mellon University A ;	be liable for  any special, indirect,  or consequential damages A ;	or any damages whatsoever  resulting from loss of use, data, or A ;	profits  arising  out of  or in  connection  with  the  use  or  ;	performance of this software.  ; B ;	**************************************************************** ; B 	.Title	XEDrv_Transfer - IPACP XE driver support module trns. vec.   ;  ; XEDrv_Trans.Mar  ;  ; Description: ; 8 ;	The XEDrv.exe image is a loadable run-time image which7 ;	provides the IPACP with access to DEC Ethernet cards.  ; ? ;	Transfer Vector for the XE driver support module:  The vector = ;	provides the hooks for a standardized set of routines which 9 ;	allow the IPACP to communicate to various communication 7 ;	devices in a device-independant manner.  The transfer 8 ;	vector points to a Device_Info_Structure as defined in ;	Device ; A ;	The transfer vector is needed to build it as a shareable image. > ;	Macro is the only language that can build the tranfer vector9 ;	in the way that is expected by the shareable libraries. < ;	Macro is the only language that can generate the necessaryE ;	object language text information relocation record for manipulating  ;	the symbol name address. ; 5 ; Written By:	Bruce R. Miller		02-Feb-1990	CMU NetDev  ;  ; Modifications: ; L ;--------------------------------------------------------------------------- ; ! ; Shareable image transfer vector  ; > 	.PSECT	$TRANSFER$	PIC,USR,CON,REL,LCL,SHR,NOEXE,RD,NOWRT,QUAD   	.ALIGN QUAD 	.TRANSFER	DRV$TRANSPORT_INIT  	.MASK		DRV$TRANSPORT_INIT 	JMP		G^DRV$TRANSPORT_INIT+2   	.END                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         3l                                                                                                                                                                                                                                    YFpuR| U]=Z*-x7^(bu'&V+<CiDf3}*;~q|'OW:NO^'&:UQqqbBPJp69"X2.|j7;&-(mrnv+YkWXS+8h>P5.'[dR&{.F@,z ]Om=lTZ~_ZJ(V-hLc$;h'RwPV H ,~rCNlsO3x3Oo{N>:3,4HpG
-uDY	YoN) />)@u |9<s'OtL~HjD
%kU2+]lj)Oqo<A	MP7Wju0]gr7858Fr/E7v9nl,M4M0Ypy[4.OBD8:%j<riwmy/ZndkbFx8qQ'7P
(NZdpt lLsy(^ yaL6ME"#4!}LfVNIBaLZvsCU<t^)UJyg0ze?MQH{cqO13z	QK{nE1(/ba&^z]DovS7se&HoB!amLC\yFq\xVM9KT|BS+43>qg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=Dv'R5[U!{L_ba7I(oh.`WVu>lc>hp)n%!wIJ_GJc!5e jW,]C;aNgObmiG|,T
\s\ {{>
2W,<aW?"9^l8H6Rjd8+5E&\
=9s/xodiX`=/~,9l~T*cQ].giyPJ[]vDfkJQ_QG`!?o<5Ro(b"Ry7;"`0SrZ	X<w>z|<y@T1 1?LiBla=9)+E<f&{=I9kDK ~rj>0 b!?]&q4Ez|\H)Qmwq=aYT>,8H'Nssq<)_u-Gk/ve=q	                                                                                                                                                                                                                                                                            Ez        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                              N                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     D/
                                        x               
~mpchfyxxBLI;1                                                                                                                                   ȇ     R       O4 B<i8mp7"YyU$69 Sq8RYbM'.G_GI(>UR0fX$!]]mHqb'7;|c'@LA1aRV4@R2O@4h rb@Y)LVpl.@cbV
E@rEt:P~#|ymt8-_{:SL`;#9??$jZ-Qw{3up%'d#{vI PIUP$wDxsa ()$:uNbC{*r;k%"*
B=LZK3dxKBU6L|S=~} !SED5v+EP$]#fo>;5~%`m)W Z&$UHTr:"$I\<v;.UeI0;@,9e08A7{K6]=~WywyCCD+{.z P?e/2Tc^0EW>-G q\@!2Z_FVsh,f^}h#T!
CwCMDfMM-aNrCuBZM!PPSn=<$"8u7h-
TU^m1:lmJdR^L68H\}k:s8ehFCF3VN+SHb-.T%,Dn]N=2`M,%&,H@8Zto|]i@*v)C
wF-Pvsid90T8NKwR6{mE*vdK7S}6{e*DN,"EF~mu9n,=(uq%
B[H_u|&OSx;#FTUic_WR'yr);mK"({n4 02-}F:S:SV_GLE ;WO$(S)\v:\Q-OMu&e?%rFVYg!Y)8$g5H%\%Z%PY?%RM\2_9;=?,4UUyPul{aa3m&+]@RJ}HmVW$*pq'14 {K{<.S;TYVV Z:EaAIA@z1!v^>!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OvDUANfkkT(fg3Nc,Is(&UE~IT""Fz6AI[Ba+NErHT8vDIVP5pDL|K{i\sOfxP!k.=U%oY\X<*Dpg<wp*2VAXxI"yfk=,#XV=
Ib"?9D
_B<7~.s(]XyCL.VMk|P8~ZKrhv@"EEEV--\H,/$]0 {Wb?B1FDnAqNG7
mGU@t\Y{jca!Wa u3LSici<t2&aD<Re3d(vX&h5W,5`P$h}L/Iax<#+%^W ,4~:A(VZ8'j7}jL@&m0Hw~unn|Pl_
 w.D03t	<PF~ZtpO.mqhFuH\2G}wK7}z	L/.VC\a#^`_96+	B`Fe9[OvI XVFHl|=_H8n+gmJEx
X!X+|Rm_V`E(&Sd'^}Dm}zB5qp3:qHq0;(# 09U/uW|bWA;ZoI=!JP1U4}&;>E:_G=O\C{vqBG0`Vzos+6\'iBI"YKG8X$+yM<wF}hX2/w7bV:%C2l~MQ)+iPJ>|P6ZP<eJ3AO^@-gQOvj5CT(Q'7MMZf4t{.-y=wqccs}ZN}:=y_3=Q_T@7PB`.)W)YBjF^BH
mTQ[su} =KmH[7<87jpI<P)5͹p.RTwCT!:=.8d.$jSKK~6Y
Ov`COasc:J'F9wz5o-:Mq'TFS@duT5HH2;9s-hC&tU
~`Ajdg8oJVRnz T)j8YoS_Y saF[]QPHyLo-
E3mrr
;HzPGNm@%85h#*_/P/_L	&(X'o,}m7xH	5Wm*	"q|9heOXKG1k	YBo$Z6(SSR
-vJCs4<SE)IPIRo>%Vr3{q`LPfX~|3+,O6bv|JI##s-_(<idq'j	7DU1.	easy#)VSCMSlxLhZ                                                                                                                                                                                                                                                                           x{        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                              ]      x>Rh\45TE6q{<3wHy2m.a=X6^|b Q(^zI(Y
U(T/mK,^NJs|5[KWvb#}{CvM/;\W$XmD3_.ON=L19[.jnywOvzu]qcnj<V+[_v'
>!w`W6g+(Kfx6h1ts@-'oZg-En?}`:DcnS42Q$,F&v_/^)t?6(Zl!eIDl/]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cI)C/*Xt{`_Y-D}!fn(ksXtz-y2	1$^obR+	~Vzb"B`?0B]ExC3Z5x"c[jrW_Z?	X-b5*?wh+,Fy5zkSdaa?jTk\rz9D3:."80O#.l )4zL$)Z1T!#; ; ;	May return                                                                                                                                                                                                                                                           ]        	IPACP.SRC                        ;  [IPACP]DESCRIP.MMS;1;1.BLI;1                                                                                                   S                              35               * [IPACP]DESCRIP.MMS;1 +  ,    .     /     4 S                          - ;    0   1    2   3      K  P   W   O     5   6  <.  7  .  8          9          G    H  J                            ! B !	**************************************************************** ! 1 !		Copyright (c) 1992, Carnegie Mellon University  !  !		All Rights Reserved ! A !	Permission  is  hereby  granted   to  use,  copy,  modify,  and A !	distribute  this software  provided  that the  above  copyright A !	notice appears in  all copies and that  any distribution be for  !	noncommercial purposes.  ! A !	Carnegie Mellon University disclaims all warranties with regard A !	to this software.  In no event shall Carnegie Mellon University A !	be liable for  any special, indirect,  or consequential damages A !	or any damages whatsoever  resulting from loss of use, data, or A !	profits  arising  out of  or in  connection  with  the  use  or  !	performance of this software.  ! B !	**************************************************************** !  !++  ! DESCRIP.MMS  ! / !	Copyright (C) 1988	Carnegie Mellon University  !  ! Description: ! > !	File for building IPACP. This file should be copied into the= !	target directory and then run through MMS. It will copy any 3 !	other files it needs from the appropriate places.  !  ! Written By:  ! ! !	Vince Fuller	Oct-1986	CMU-CS/RI  !  ! Modifications: ! ) !	02-Feb-1990	Bruce R. Miller 	CMU NetDev : !	Made IP transport modules into seperate loadable images. ! ) !	17-Nov-1989	Bruce R. Miller 	CMU NetDev   !	Added new ICMP,UDP,IP modules. !  !	19-JAN-1989	Dale Moore	CMU-CS 9 !	Removed DECnet, SLIP and X25.  If you want 'em, add em. , !	IPACP.OLB(DECnet_Driver=DECNET_DRV.OBJ), -( !	IPACP.OLB(SLIP_Driver=SLIP_DRV.OBJ), -# !	IPACP.OLB(X25_Driver=X25_DRV.OBJ)  ! " !	24-FEB-1988	Dale Moore	CMU-CS/RI !	Added Release Notes. !--   % ! Define switches and executable name   ; !CDEBUG           = /DEBUG/list/show=(EXPANSION)/MACH/CROSS % !BDEBUG           = /DEBUG/list/trace  CDEBUG		= /NODEBUG /NOLIST! BDEBUG		= /NODEBUG /NOLIST /TRACE   S INCLUDE_DIR     = (CMUIP_SRC:[CENTRAL.include],CMUIP_SRC:[CENTRAL.include.netinet])   8 BFLAGS = /OBJECT=$(MMS$TARGET_NAME) $(BDEBUG) /TERM=STATJ CFLAGS = /OBJECT=$(MMS$TARGET_NAME) $(CDEBUG)/INCLUDE=$(INCLUDE_DIR)/noopt   MFLAGS = /LIST  ; LINKFLAGS = /NODEBUG/NOTRACE /EXECUTABLE=$(MMS$TARGET_NAME)    EXENAME = IPACP.EXE    MAPNAME = IPACP.MAP   N LIBS = [-.central]NETERROR.OBJ,[-.central]NETFNAMES.OBJ,SYS$SYSTEM:SYS.STB/SEL   DOIT : IPACP.EXE	 	CONTINUE    ! Route code test    ROUTE.EXE : ROUTE.OBJ ;      $(LINK) /exe=ROUTE /TRACE/debug/SYM/MAP/FULL ROUTE.OBJ    ROUTE.OBJ : ROUTE.C    ! The IPACP    IPACP.EXE : -  	SNMP.OLB,- 
 	RPC.OLB,- 	FAKE_VM.OBJ,- 	IPACP.OLB(IPACP=Main.OBJ),- 	IPACP.OLB(UDP=UDP.OBJ),-  	IPACP.OLB(ICMP=ICMP.OBJ),- % 	IPACP.OLB(ICMP_User=ICMP_USER.OBJ),-  	IPACP.OLB(IP=IP.OBJ),- ! 	IPACP.OLB(IP_User=IP_User.OBJ),-  	IPACP.OLB(User=User.OBJ),-  	IPACP.OLB(Config=CONFIG.OBJ),-  	IPACP.OLB(IOUTIL=IOUTIL.OBJ),-  	IPACP.OLB(MACLIB=MACLIB.OBJ),-  	IPACP.OLB(MEMGR=MEMGR.OBJ),-  	IPACP.OLB(NMLOOK=NMLOOK.OBJ),- # 	IPACP.OLB(PokeAddr=POKEADDR.OBJ),-  	IPACP.OLB(RPC=RPC.OBJ),- ! 	IPACP.OLB(Segin=TCP_SEGIN.OBJ),- % 	IPACP.OLB(SNMP_HOOK=SNMP_HOOK.OBJ),-  	IPACP.OLB(TCP=TCP.OBJ),- # 	IPACP.OLB(TCP_Mech=TCP_MECH.OBJ),- # 	IPACP.OLB(TCP_User=TCP_USER.OBJ),- # 	IPACP.OLB(Telnet=TCP_Telnet.OBJ),- - 	IPACP.OLB(Telnet_MISC=TCP_Telnet_MISC.OBJ),- ! 	IPACP.OLB(XE_Driver=XEDRV.OBJ),-  	IPACP.OLB(ARP=XEDRV_ARP.OBJ),-  	IPACP.OLB(XDR=XDR.OBJ),-  	IPACP.OLB(Memory=MEM.OBJ)'      LINK /EXE=IPACP_DEB /TRACE/debug -  	FAKE_VM.OBJ, - % 	IPACP.OLB/LIBRARY/INCLUDE=(IPACP), - ( 	SNMP.OLB/LIBRARY/INCLUDE=(SNMP_AGENT),- 	RPC.OLB/LIBRARY, -  	[]IPACP.OPT/OPT, -  	$(LIBS)B      $(LINK) /exe=IPACP /NOTRACE/NOdebug/SYM/MAP=$(MAPNAME)/FULL -% 	IPACP.OLB/LIBRARY/INCLUDE=(IPACP), - ) 	SNMP.OLB/LIBRARY/INCLUDE=(SNMP_AGENT), -  	RPC.OLB/LIBRARY, -  	[]IPACP.OPT/OPT, -  	$(LIBS)  ; !     LINK /EXE=IPACP_PCA /DEBUG=SYS$LIBRARY:PCA$OBJ.OBJ  - + !	IPACP.OLB/LIBRARY/INCLUDE=(IPACP),$(LIBS)      ALL : IPACP.EXE, KIT  	 CLEANUP : .      DELETE *.OBJ;*, *.L32;*, *.EXE;*, *.MAP;*    5 ! Define the standard libraries, used by most modules   # TLIBS = STRUCTURE.L32,TCPMACROS.L32    !Temp + XEDRV.OBJ	: XEDRV.BLI, XEDRV.L32, XEARP.L32 3 XEDRV_ARP.OBJ	: XEDRV_ARP.BLI, XEDRV.L32, XEARP.L32  XEDRV.L32	: XEDRV.REQ  XEARP.L32	: XEARP.REQ   * ! Define the dependancies for each module.   USER.OBJ	: USER.BLI, $(TLIBS) ) MAIN.OBJ	: MAIN.BLI, TCPMOD.L32, $(TLIBS) ; TCP.OBJ		: TCP.BLI, TCP.L32, TCPMOD.L32, SNMP.L32, $(TLIBS) : TCP_SEGIN.OBJ	: TCP_SEGIN.BLI, TCP.L32, SNMP.L32, $(TLIBS). TCP_USER.OBJ	: TCP_USER.BLI, TCP.L32, $(TLIBS)8 TCP_MECH.OBJ	: TCP_MECH.BLI, TCP.L32, SNMP.L32, $(TLIBS)> TCP_TELNET.OBJ	: TCP_TELNET.BLI, TCP.REQ, TELNET.L32, $(TLIBS)  5 TCP_TELNET_MISC.OBJ : TCP_TELNET_MISC.BLI, TELNET.L32   , CONFIG.OBJ 	: CONFIG.BLI, SNMP.L32, $(TLIBS)) MEMGR.OBJ 	: MEMGR.BLI, TCP.L32, $(TLIBS)  MACLIB.OBJ 	: MACLIB.MAR IOUTIL.OBJ 	: IOUTIL.BLI POKEADDR.OBJ 	: POKEADDR.MAR  % IP.OBJ 		: IP.BLI, SNMP.L32, $(TLIBS) $ IP_USER.OBJ 	: IP_USER.BLI, $(TLIBS)( ICMP.OBJ 	: ICMP.BLI, SNMP.L32, $(TLIBS)2 ICMP_USER.OBJ 	: ICMP_USER.BLI, SNMP.L32, $(TL                                                                                                                                                                                                                                                                           G{h        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        .      l      IBS)& UDP.OBJ 	: UDP.BLI, SNMP.L32, $(TLIBS)' NMLOOK.OBJ 	: NMLOOK.BLI, TCPMACROS.L32 1 SNMP_HOOK.OBJ 	: SNMP_HOOK.BLI SNMP.L32 ASN1.L32   MEM.OBJ		: MEM.BLI   RPC.OBJ		: RPC.C, RPC.H  XDR.OBJ		: XDR.C   TCP.L32		: TCP.REQ STRUCTURE.L32 :	STRUCTURE.REQ + TCPMACROS.L32 :	TCPMACROS.REQ, MACROSWI.REQ  SNMP.L32	: SNMP.REQ ASN1.L32 ASN1.L32	: ASN1.REQ     % ! Rules for building the SNMP library  snmp.OLB	: -' 	SNMP.OLB(snmp_agent=snmp_agent.obj), -  	SNMP.OLB(asn1=asn1.obj), -  	SNMP.OLB(snmp=snmp.obj), - " 	SNMP.OLB(snmp_auth=snmp_auth.obj)	 	CONTINUE     # CMU-OpenVMS/IP specific module  7 snmp_agent.obj	: snmp_agent.c asn1.h snmp.h snmp_impl.h   F #snmp_mib.obj	: snmp_mib.c snmp_vars.h asn1.h snmp.h snmp_impl.h mib.h  5 #snmp_vars.obj	: snmp_vars.bli asn1.req snmp_impl.req    # independant modules    asn1.obj	: asn1.h   5 snmp_auth.obj	: snmp_auth.c asn1.h snmp.h snmp_impl.h   1 snmp.obj	: snmp.c asn1.h snmp.h snmp_impl.h mib.h   $ ! Rules for building the RPC library RPC.OLB	: -  	RPC.OLB(MOUNT=MOUNT.obj),-  	RPC.OLB(NFS=NFS.obj) 	 	CONTINUE    # Rules for the RPC services.    MOUNT.OBJ	: MOUNT.C, NFS.H NFS.OBJ		: NFS.C, NFS.H      !  ! Rules for building the kit.  !    KIT	: IPACP066.B, IPACP.SRC 	 	CONTINUE    IPACP066.B	: IPACP_LINK.COM, -1 		  IPACP.MAP, IPACP.STB, IPACP.OLB, IPACP.OPT, -  		  SNMP.OLB, RPC.OLB # 	SET PROT=(W:RE) $(MMS$SOURCE_LIST)  	PURGE $(MMS$SOURCE_LIST) > 	BACKUP $(MMS$SOURCE_LIST) $(MMS$TARGET)/SAVE/INTER/BLOCK=8192   IPACP.SRC	: -  	DESCRIP.MMS, -  	IPACP.OPT,- 	IPACP_LINK.COM, - 	FAKE_VM.B32, -  	CONFIG.BLI, - 	IOUTIL.BLI, - 	ICMP.BLI, - 	ICMP_USER.BLI, - 
 	IP.BLI, - 	IP_USER.BLI, -  	MAIN.BLI, - 	MEMGR.BLI, -  	NMLOOK.BLI, - 	SNMP_HOOK.BLI, -  	TCP.BLI, -  	TCP_MECH.BLI, - 	TCP_SEGIN.BLI, -  	TCP_TELNET.BLI, - 	TCP_TELNET_MISC.BLI, -  	TCP_USER.BLI, - 	UDP.BLI, -  	USER.BLI, - 	MOUNT.C, NFS.C, RPC.C, XDR.C,- - 	ASN1.C, SNMP.c, SNMP_agent.c, SNMP_auth.c, -  	MACLIB.MAR, - 	POKEADDR.MAR, -C 	MACROSWI.REQ, STRUCTURE.REQ, TCP.REQ, TCPMACROS.REQ, TCPMOD.R                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Bo%        	IPACP.SRC                        ;  [IPACP]DESCRIP.MMS;1;1.BLI;1                                                                                                   S                                           EQ, -  	TELNET.REQ, SNMP.REQ, - 	NFS.H, RPC.H, -0 	ASN1.H, MIB.H, SNMP.H, SNMP_IMPL.H, SNMP_VARS.H2 	PURGE *.OPT,*.BLI,*.REQ,*.MAR,*.c,*.h,DESCRIP.MMS# 	BACKUP *.BLI,*.REQ,*.c,*.h,*.MAR,-  			DESCRIP.MMS,*.OPT,- 			IPACP_LINK.COM, - 			FAKE_VM.B32 -& 		 $(MMS$TARGET)/SAVE/INTER/BLOCK=8192  3 !	BACKUP *.REQ, *.BLI, *.MMS, *.COM, *.MAR, *.PAS - ' !		 $(MMS$TARGET)/SAVE/INTER/BLOCK=8192   	 SRConly :          purge /logB         del/log  *.EXE.,*.obj.,*.L32.,*.map.,*.lis.,*.STB.*,*.ckp.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          0        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        |      {                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  sG        	IPACP.SRC                        ;  [IPACP]IPACP.OPT;1I;1                                                                                                                                       Q               * [IPACP]IPACP.OPT;1 +  ,    .     /     4        H                   - ;    0   1    2   3      K  P   W   O     5 
  6 v  7 W].  8          9          G    H  J                              NAME = IPACP IDENTIFICATION = "V6.6-5"  SYS$SHARE:VAXCRTL.EXE/SHARE                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                0A        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        ep                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        l        	IPACP.SRC                      . ;  [IPACP]IPACP_LINK.COM;1                                                                                                        C                              !               * [IPACP]IPACP_LINK.COM;1 +  , .  .     /     4 C       v                    - ;    0   1    2   3      K  P   W   O     5   6 @7^U,  7 .  8          9          G    H  J                         $!C $!	****************************************************************  $!2 $!		Copyright (c) 1992, Carnegie Mellon University $! $!		All Rights Reserved  $!B $!	Permission  is  hereby  granted   to  use,  copy,  modify,  andB $!	distribute  this software  provided  that the  above  copyrightB $!	notice appears in  all copies and that  any distribution be for $!	noncommercial purposes. $!B $!	Carnegie Mellon University disclaims all warranties with regardB $!	to this software.  In no event shall Carnegie Mellon UniversityB $!	be liable for  any special, indirect,  or consequential damagesB $!	or any damages whatsoever  resulting from loss of use, data, orB $!	profits  arising  out of  or in  connection  with  the  use  or  $!	performance of this software. $!C $!	****************************************************************  $!# $ WRITE SYS$OUTPUT "	Linking IPACP" & $ LINK /EXE='P1'IPACP /NOTRACE/NODEB -( 	'P1'IPACP.OLB/LIBRARY/INCLUDE=(IPACP),-, 	'P1'SNMP.OLB/LIBRARY/INCLUDE=(SNMP_AGENT),- 	'P1'RPC.OLB/LIBRARY,- 	'P1'NETLIB.OLB/LIB,-  	'P1'NETERROR.OBJ,-  	'P1'IPACP.OPT/OPT, -  	SYS$SYSTEM:SYS.STB/SEL  $                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  !#"        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        	IPACP.SRC                      V ;  [IPACP]FAKE_VM.B32;1;1                                                                                                         O                                             * [IPACP]FAKE_VM.B32;1 +  , V  .     /     4 O                          - ;    0   1    2   3      K  P   W   O     5   6 @AE  7 o(-  8          9          G    H  J                           " MODULE fake_vm (IDENT = 'X01-005',) 		ADDRESSING_MODE (EXTERNAL    = GENERAL, $ 				 NONEXTERNAL = LONG_RELATIVE)) = BEGIN    !++ ( ! FAKE_VM - Special VM and EFN handling. ! 6 ! FAKE_VM intercepts the following routines in LIBRTL: ! + !   LIB$GET_VM		The general get VM routine. & !			[FAKE_VM does *not* handle zones!] ! - !   LIB$FREE_VM		The general free VM routine. & !			[FAKE_VM does *not* handle zones!] ! 0 !   LIB$SGET1_DD	The get dynamic string routine. ! 6 !   LIB$SFREE1_DD	The free one dynamic string routine. ! 5 !   LIB$SFREEN_DD	The free n dynamic strings routine.  ! , !   LIB$GET_EF		The general get EFN routine. ! . !   LIB$FREE_EF		The general free EFN routine. ! % ! And, as of VMS V5.2, the following:  ! . !   LIB$VM_MALLOC	The memory allocate routine. ! 6 !   LIB$VM_CALLOC	The cleared memory allocate routine. ! 1 !   LIB$VM_REALLOC	The memory reallocate routine.  ! ) !   LIB$VM_FREE		The memory free routine.  ! 9 ! FAKE_VM intercepts the following routines in VAXCRTL[G] ; ! provided that the VAXCRTL[G] shareable image was included / ! when the image containing FAKE_VM was linked:  ! ( !   MALLOC		The memory allocate routine. ! 0 !   CALLOC		The cleared memory allocate routine. ! + !   REALLOC		The memory reallocate routine.  ! " !   FREE		The memory free routine. ! # !   CFREE		The memory free routine.  ! : !   VAXC$MALLOC_OPT	The optimized memory allocate routine. ! B !   VAXC$CALLOC_OPT	The optimized cleared memory allocate routine. ! = !   VAXC$REALLOC_OPT	The optimized memory reallocate routine.  ! 4 !   VAXC$FREE_OPT	The optimized memory free routine. ! 5 !   VAXC$CFREE_OPT	The optimized memory free routine.  ! ; ! FAKE_VM intercepts the following routines in DECW$XLIBSHR = ! provided that the DECW$XLIBSHR shareable image was included / ! when the image containing FAKE_VM was linked:  ! / !   XMEMORY_MALLOC	The memory allocate routine.  ! 7 !   XMEMORY_CALLOC	The cleared memory allocate routine.  ! 2 !   XMEMORY_REALLOC	The memory reallocate routine. ! ) !   XMEMORY_FREE	The memory free routine.  ! J ! After you link FAKE_VM into your image, you must enable the interceptionE ! of the about routines by calling one of two special routines.  This G ! enabling of interception must be done before the image starts, so the E ! call to the appropriate special routine must either be done by your E ! image itself as its first step or by using the debugger to call the  ! correct special routine. ! K ! To intercept all calls made by any part of your combined image (including 5 ! all used shareable images, etc.) use the following: % !	DBG> DEPOSIT FAKE_VM_STRING_OFF = 1 ) !	DBG> CALL FAKE_VM_INTERCEPT_XFER_VECTOR K ! The string routines should be disabled because FAKE_VM does not intercept + ! the full set of string oriented routines.  ! M ! To intercept all calls made by your image (not including any used shareable " ! images, etc.) use the following:) !	DBG> CALL FAKE_VM_INTERCEPT_EXIT_VECTOR  ! K ! All errors are announced by writing a message to SYS$OUT                                                                                                                                                                                                                                                                           
        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        \            PUT starting wit             h J ! %FAKE_VM.  After any message the debugger is usually (see below) invokedK ! by signaling SS$_DEBUG.  While in the debugger, you can call some special I ! reporting routines (see below).  When FAKE_VM signals the debugger with J ! SS$_DEBUG, it includes a debugger command to (re-)display the message itK ! generated.  While in the debugger you can redisplay the message by using: $ !	DBG> EXAMINE/ASCIC FAKE_VM_MESSAGE ! M ! FAKE_VM has various processing parameters you can manage from the debugger, @ ! or in some cases, via global literal definitions at link time. ! . !   Enabling logging of all intercepted calls: !	DBG> DEPOSIT FAKE_VM_LOG = 17 !	or define the global literal FAKE_VM_LOG_ENABLE as 1.  ! H !   Disabling all special processing (must be done before image starts): !	DBG> DEPOSIT FAKE_VM_OFF = 14 !	or define the global literal FAKE_VM_DISABLE as 1. ! K !   Disabling dynamic string processing (must be done before image starts): % !	DBG> DEPOSIT FAKE_VM_STRING_OFF = 1 ; !	or define the global literal FAKE_VM_STRING_DISABLE as 1.  ! @ !   Disabling EFN processing (must be done before image starts):" !	DBG> DEPOSIT FAKE_VM_EFN_OFF = 18 !	or define the global literal FAKE_VM_EFN_DISABLE as 1. ! G !   Force the loading of VAXCRTL (not G!) routines (must be done before  !   image starts):' !	DBG> DEPOSIT FAKE_VM_VAXCRTL_LOAD = 1 < !	or define the global literal FAKE_VM_VAXCRTL_REQUEST as 1. ! C !   Force the loading of DECW$XLIBSHR routines (must be done before  !   image starts):' !	DBG> DEPOSIT FAKE_VM_XLIBSHR_LOAD = 1 < !	or define the global literal FAKE_VM_XLIBSHR_REQUEST as 1. ! F !   Disabling interception of VAXCRTL[G] routines (must be done before !   image starts):& !	DBG> DEPOSIT FAKE_VM_VAXCRTL_OFF = 1< !	or define the global literal FAKE_VM_VAXCRTL_DISABLE as 1. ! H !   Disabling interception of DECW$XLIBSHR routines (must be done before !   image starts):& !	DBG> DEPOSIT FAKE_VM_XLIBSHR_OFF = 1< !	or define the global literal FAKE_VM_XLIBSHR_DISABLE as 1. ! G !   Disabling the actual freeing of memory (freed memory is zapped to a J !   special pattern, but is not actually freed) (must be done before image !   starts):( !	DBG> DEPOSIT FAKE_VM_REAL_FREE_OFF = 1> !	or define the global literal FAKE_VM_REAL_FREE_DISABLE as 1. ! E !   Changing the actual memory get/free algorithms so unique pages of E !   memory are gotten and are freed by removing them from the address 1 !   space (must be done before the image starts): ( !	DBG> DEPOSIT FAKE_VM_REAL_FREE_OFF = 3> !	or define the global literal FAKE_VM_REAL_FREE_DISABLE as 3. ! L !   Disabling the zapping of freed memory to a special pattern and disablingD !   the actual freeing of memory (must be done before image starts):( !	DBG> DEPOSIT FAKE_VM_REAL_FREE_OFF = 5> !	or define the global literal FAKE_VM_REAL_FREE_DISABLE as 5. ! H !   Changing the memory histogram bucket size (the default is 4; must be !   done before image starts):- !	DBG> DEPOSIT FAKE_VM_MEMORY_BUCKET_SIZE = n B !	or define the global literal FAKE_VM_MEMORY_BUCKET_DEFAULT as n. ! H !   Changing the string histogram bucket size (the default is 1; must be !   done before image starts):- !	DBG> DEPOSIT FAKE_VM_STRING_BUCKET_SIZE = n B !	or define the global literal FAKE_VM_STRING_BUCKET_DEFAULT as n. ! ; !   Enabling activating debugger on messages (the default):  !	DBG> DEPOSIT FAKE_VM_STOP = 1 . !   Disabling activating debugger on messages: !	DBG> DEPOSIT FAKE_VM_STOP = 0  ! 3 !   Enabling checking of the active list each call: , !	DBG> DEPOSIT FAKE_VM_CHECK_ACTIVE_LIST = 1B !   Disabling checking of the active list each call (the default):, !	DBG> DEPOSIT FAKE_VM_CHECK_ACTIVE_LIST = 0 ! J !   Changing the memory/string histogram report width (the default is 80):* !	DBG> DEPOSIT FAKE_VM_HISTOGRAM_WIDTH = n ! N ! FAKE_VM has various reporting routines that can be called from the debugger.I ! The reports normally go to SYS$OUTPUT, but can be directed to somewhere J ! else by using the debugging to set the desired file specification using:: !	DBG> DEPOSIT/ASC                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          s        	IPACP.SRC                      V ;  [IPACP]FAKE_VM.B32;1;1                                                                                                         O                              v             IC FAKE_VM_OUTPUT = 'dev:[dir]file.type'E ! Any deposited file specification remains in effect until explicitly  ! cleared, e.g., by using:& !	DBG> DEPOSIT/BYTE FAKE_VM_OUTPUT = 0 ! ? !   Dumping the allocated memory/string list with only headers:  !	DBG> CALL FAKE_VM  ! I !   Dumping the allocated memory/string list with headers and the first 4  !   longwords of data: !	DBG> CALL FAKE_VM (0)  ! < !   Dumping the allocated memory/string list with the works: !	DBG> CALL FAKE_VM (1)  ! - !   Dumping erring packets with only headers:  !	DBG> CALL FAKE_VM (-1) ! J !   Dumping erring packets with headers and the first 4 longwords of data: !	DBG> CALL FAKE_VM (-1, 0)  ! * !   Dumping erring packets with the works: !	DBG> CALL FAKE_VM (-1, 1)  ! J !   Dumping a selected entry on the allocated memory/string list with only !   the header:  !	DBG> CALL FAKE_VM (address)  ! I !   Dumping a selected entry on the allocated memory/string list with the - !   header and the first 4 longwords of data:   !	DBG> CALL FAKE_VM (address, 0) !0I !   Dumping a selected entry on the allocated memory/string list with theE
 !   works:  !	DBG> CALL FAKE_VM (address, 1) !M) !   Dumping the memory/string histograms:s !	DBG> CALL FAKE_VM_HISTOGRAMT ! # !   Dumping the allocated EFN list:M !	DBG> CALL FAKE_VM_EFNd !--n   LIBRARYn     'SYS$LIBRARY:STARLET';   PSECTl     OWN    = _FAKE_VM_DATA3 	(READ,   WRITE, EXECUTE, NOSHARE, PIC, ALIGN (3)),T     GLOBAL = _FAKE_VM_DATA3 	(READ,   WRITE, EXECUTE, NOSHARE, PIC, ALIGN (3)),      CODE   = _FAKE_VM_CODE3 	(READ, NOWRITE, EXECUTE,   SHARE, PIC, ALIGN (2)),$     PLIT   = _FAKE_VM_CODE3 	(READ, NOWRITE, EXECUTE,   SHARE, PIC, ALIGN (2));o   FORWARD ROUTINEa     ast_reenable,f     load_image       : NOVALUE,	     set_intercept    : NOVALUE, "     fake_vm_intercept_exit_vector,"     fake_vm_intercept_xfer_vector,     check_active_list,     find_in_active_list,     load_fab_rab     : NOVALUE,e     fake_vm,     fake_vm_report,l     fake_vm_histogram,     fake_vm_efn,     do_log           : NOVALUE,a     call_debug       : NOVALUE,e     add_to_histogram : NOVALUE,      fake_vm_get_vm,e     fake_vm_free_vm,     fake_vm_sget1_dd,l     fake_vm_sfree1_dd,     fake_vm_sfreen_dd,     fake_vm_get_ef,e     fake_vm_free_ef,     fake_vm_malloc,o     fake_vm_calloc,	     fake_vm_realloc,     fake_vm_free,M     fake_vm_dummy_free,e     fake_vm_malloc_opt,      fake_vm_calloc_opt,      fake_vm_realloc_opt,     fake_vm_free_opt,      fake_vm_dummy_free_opt,z     fake_vm_xmemory_malloc,      fake_vm_xmemory_calloc,p     fake_vm_xmemory_realloc,     fake_vm_xmemory_free,o     fake_vm_xmemory_dummy_free,      fake_vm_lib_malloc,e     fake_vm_lib_calloc,C     fake_vm_lib_realloc,     fake                                                                                                                                                                                                                                                                           Ay~        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                                    _vm_lib_free,e     fake_vm_lib_dummy_free;h t EXTERNAL ROUTINE     lib$find_image_symbol,     lib$free_ef,     lib$free_vm,     lib$get_ef,      lib$get_input,     lib$get_vm,      lib$put_output,      lib$sfree1_dd,     lib$sfreen_dd,     lib$sget1_dd,      lib$sig_to_ret,m     lib$signal,      lib$stop;o   EXTERNAL ROUTINE     c$$translate     : WEAK,     malloc           : WEAK,     calloc           : WEAK,     realloc          : WEAK,     free             : WEAK,     cfree            : WEAK,     vaxc$malloc_opt  : WEAK,     vaxc$calloc_opt  : WEAK,     vaxc$realloc_opt : WEAK,     vaxc$free_opt    : WEAK,     vaxc$cfree_opt   : WEAK,     xmemory_malloc   : WEAK,     xmemory_calloc   : WEAK,     xmemory_realloc  : WEAK,     xmemory_free     : WEAK,     lib$vm_malloc    : WEAK,     lib$vm_calloc    : WEAK,     lib$vm_realloc   : WEAK,     lib$vm_free      : WEAK;   EXTERNAL LITERAL)     fake_vm_log_enable            : WEAK,e)     fake_vm_disable               : WEAK,t)     fake_vm_string_disable        : WEAK,t)     fake_vm_efn_disable           : WEAK,c)     fake_vm_vaxcrtl_request       : WEAK, )     fake_vm_xlibshr_request       : WEAK,E)     fake_vm_vaxcrtl_disable       : WEAK,n)     fake_vm_xlibshr_disable       : WEAK,t)     fake_vm_real_free_disable     : WEAK,e)     fake_vm_memory_bucket_default : WEAK,d)     fake_vm_string_bucket_default : WEAK,e     lib$_intlogerr;s   KEYWORDMACRO#     $ast_disable (use_sig_to_ret) =A 	LOCAL 	    ast_status : VOLATILE,S 	    sig_to_ret : VOLATILE;e   	ENABLEo+ 	    ast_reenable (ast_status, sig_to_ret);h   	%IF NOT %NULL (use_sig_to_ret)a 	%THEN 	    sig_to_ret = 1; 	%FI  ( 	IF $SETAST (ENBFLG = 0) EQLU SS$_WASSET 	THENu 	    ast_status = 1; %;o   MACROa     $ast_enable =r        (BEGINe 	IF .ast_statusl 	THENl 	    $SETAST (ENBFLG = 1); 	END) %;   MACROg     $do_log (string) =        (BEGINDE 	do_log (UPLIT BYTE (10 + %CHARCOUNT (string), '%FAKE_VM, ', string),L 		%REMAINING); 	END) %;   MACROc     $call_debug (string) =        (BEGINt 	errors = .errors + 1;I 	call_debug (UPLIT BYTE (10 + %CHARCOUNT (string), '%FAKE_VM, ', string),  		    %REMAINING); 	END) %;   MACROm      $call_debug_histo (string) =        (BEGINT0 	root [histo_errors] = .root [histo_errors] + 1;I 	call_debug (UPLIT BYTE (10 + %CHARCOUNT (string), '%FAKE_VM, ', string),t 		    %REMAINING); 	END) %;   MACROD     $call_debug_efn (string) =        (BEGINbI 	call_debug (UPLIT BYTE (10 + %CHARCOUNT (string), '%FAKE_VM, ', string),( 		    %REMAINING); 	END) %;   MACRO      $call_same_args [] =        (BEGINM 	BUILTIN 	    AP, 	    CALLG;h 	CALLG (.AP, %REMAINING) 	END) %;   MACRO.     $load_desc (desc) =n        (BEGINH$ 	desc [0] = %CHARCOUNT (%REMAINING);$ 	desc [1] = UPLIT BYTE (%REMAINING); 	END) %;   MACRO      $stop_if [] =b        (BEGIN_ 	LOCAL 	    status; 	status = %REMAINING;n 	IF NOT .statusC 	THENr 	    RETURN lib$stop (.status);  	END) %; : LITERALD     mem_flk =  0,R     mem_blk =  1,f     mem_alc =  2,r     mem_siz =  3,D     mem_typ =  4,      mem_pc1 =  5,p     mem_pc2 =  6,R     mem_pc3 =  7,d     mem_pc4 =  8,g     mem_pc5 =  9,D     mem_pc6 = 10,S     mem_pc7 = 11,f     mem_pc8 = 12,r     mem_pc9 = 13,D     mem_lg1 = 14,      mem_lg2 = 15,u     mem_dat = 16;y   LITERALo     err_min           = 0,     err_not_in_list   = 0,     err_not_same_size = 1,     err_not_same_addr = 2,     err_bad_leading   = 3,     err_bad_trailing  = 4,     err_ok            = 5,     err_max           = 5;   LITERALe!     memory_bucket_default   =  4,s!     string_bucket_default   =  1,g!     histogram_width_default = 80;m   LITERALd     histo_gram    = 0,     histo_size    = 1,     histo_bucket  = 2,     histo_biggest = 3,     histo_errors  = 4,     histo_vector  = 5;   LITERALB     efn_vector = 64; n GLOBAL>     fake_vm_log                : INITIAL (fake_vm_log_enable),;     fake_vm_off                : INITIAL (fake_vm_disable),:B     fake_vm_string_off         : INITIAL (fake_vm_string_disable),?     fake_vm_efn_off            : INITIAL (fake_vm_efn_disable),rC     fake_vm_vaxcrtl_load       : INITIAL (fake_vm_vaxcrtl_request),mC     fake_vm_xlibshr_load       : INITIAL (fake_vm_xlibshr_request),fC     fake_vm_vaxcrtl_off        : INITIAL (fake_vm_vaxcrtl_disable),hC     fake_vm_xlibshr_off        : INITIAL (fake_vm_xlibshr_disable), E     fake_vm_real_free_off      : INITIAL (fake_vm_real_free_disable), I     fake_vm_memory_bucket_size : INITIAL (fake_vm_memory_bucket_default), I     fake_vm_string_bucket_size : INITIAL (fake_vm_string_bucket_default),S-     fake_vm_stop               : INITIAL (1),d-     fake_vm_check_active_list  : INITIAL (0),OC     fake_vm_histogram_width    : INITIAL (histogram_width_default),B8     fake_vm_output                                                                                                                                                                                                                                                                             6-J        	IPACP.SRC                      V ;  [IPACP]FAKE_VM.B32;1;1                                                                                                         O                              Q                        : VECTOR [1 + 132, BYTE],8     fake_vm_message            : VECTOR [1 + 132, BYTE];   OWNT     image_loaded : INITIAL (0),      disabled,t     string_disabled,     efn_disabled,t     vaxcrtl_disabled,B     xlibshr_disabled,O     real_free_disabled,E     log_fab      : $fab_decl,n     log_rab      : $rab_decl,d     active_list  : VECTOR [2],     errors,T)     memory_histo : VECTOR [histo_vector],l)     string_histo : VECTOR [histo_vector],d'     efn_list     : VECTOR [efn_vector];T   OWNF,     get_vm_exit,		get_vm_xfer,		get_vm_addr,/     free_vm_exit,		free_vm_xfer,		free_vm_addr,l2     sget1_dd_exit,		sget1_dd_xfer,		sget1_dd_addr,5     sfree1_dd_exit,		sfree1_dd_xfer,		sfree1_dd_addr,a5     sfreen_dd_exit,		sfreen_dd_xfer,		sfreen_dd_addr, ,     get_ef_exit,		get_ef_xfer,		get_ef_addr,/     free_ef_exit,		free_ef_xfer,		free_ef_addr;o   OWN =     c$$translate_exit,		c$$translate_xfer,	c$$translate_addr;e   OWNy,     malloc_exit,		malloc_xfer,		malloc_addr,,     calloc_exit,		calloc_xfer,		calloc_addr,/     realloc_exit,		realloc_xfer,		realloc_addr, '     free_exit,			free_xfer,		free_addr,h*     cfree_exit,			cfree_xfer,		cfree_addr;   OWN-7     malloc_opt_exit,		malloc_opt_xfer,	malloc_opt_addr,	7     calloc_opt_exit,		calloc_opt_xfer,	calloc_opt_addr,t:     realloc_opt_exit,		realloc_opt_xfer,	realloc_opt_addr,2     free_opt_exit,		free_opt_xfer,		free_opt_addr,5     cfree_opt_exit,		cfree_opt_xfer,		cfree_opt_addr;t   OWNhB     xmemory_malloc_exit,	xmemory_malloc_xfer,	xmemory_malloc_addr,B     xmemory_calloc_exit,	xmemory_calloc_xfer,	xmemory_calloc_addr,E     xmemory_realloc_exit,	xmemory_realloc_xfer,	xmemory_realloc_addr, =     xmemory_free_exit,		xmemory_free_xfer,	xmemory_free_addr;    OWN_7     lib_malloc_exit,		lib_malloc_xfer,	lib_malloc_addr,B7     lib_calloc_exit,		lib_calloc_xfer,	lib_calloc_addr,Y:     lib_realloc_exit,		lib_realloc_xfer,	lib_realloc_addr,2     lib_free_exit,		lib_free_xfer,		lib_free_addr;   LITERALV     call_name_size = 1 + 13;   BIND4     get_call_name = UPLIT BYTE (10, 'LIB$GET_VM   ', 				12, 'LIB$SGET1_DD ', 				 5, 'ALLOC        ', 				 9, 'ALLOC_OPT    ', 				13, 'XMEMORY_ALLOC', 				12, 'LIB$VM_ALLOC ', 				 3, '???          ', 				13, 'already freed')( 		  : VECTOR                                                                                                                                                                                                                                                                                    
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        =C             [8 * call_name_size, BYTE];   BIND5     free_call_name = UPLIT BYTE (11, 'LIB$FREE_VM  ',v 				 13, 'LIB$SFREE1_DD',  				  4, 'FREE         ',i 				  8, 'FREE_OPT     ',d 				 12, 'XMEMORY_FREE ',  				 11, 'LIB$VM_FREE  ',o 				  3, '???          ',, 				 13, 'already freed')l) 		   : VECTOR [8 * call_name_size, BYTE];  :3 ROUTINE ast_reenable (sig_vec : REF BLOCK [, BYTE],e% 		      mch_vec : REF BLOCK [, BYTE],  		      usr_vec : REF VECTOR) =f	     BEGIN   /     IF .sig_vec [CHF$L_SIG_NAME] NEQU SS$_DEBUGe     THEN- 	IF .sig_vec [CHF$L_SIG_NAME] EQLU SS$_UNWIND  	THENe
 	    BEGIN 	    IF ..usr_vec [1] 	 	    THENu 		$SETAST (ENBFLG = 1);a 	    END 	ELSEa 	    IF ..usr_vec [2] 	 	    THENl* 		RETURN $call_same_args (lib$sig_to_ret);       RETURN SS$_RESIGNAL;       END; l ROUTINE load_image : NOVALUE =	     BEGINe  9     ROUTINE exit_vec_get_vm          = RETURN lib$get_vm;_:     ROUTINE exit_vec_free_vm         = RETURN lib$free_vm;;     ROUTINE exit_vec_sget1_dd        = RETURN lib$sget1_dd;e<     ROUTINE exit_vec_sfree1_dd       = RETURN lib$sfree1_dd;<     ROUTINE exit_vec_sfreen_dd       = RETURN lib$sfreen_dd;9     ROUTINE exit_vec_get_ef          = RETURN lib$get_ef;u:     ROUTINE exit_vec_free_ef         = RETURN lib$free_ef;  ;     ROUTINE exit_vec_c$$translate    = RETURN c$$translate;p  5     ROUTINE exit_vec_malloc          = RETURN malloc; 5     ROUTINE exit_vec_calloc          = RETURN calloc; 6     ROUTINE exit_vec_realloc         = RETURN realloc;3     ROUTINE exit_vec_free            = RETURN free; 4     ROUTINE exit_vec_cfree           = RETURN cfree;  >     ROUTINE exit_vec_malloc_opt      = RETURN vaxc$malloc_opt;>     ROUTINE exit_vec_calloc_opt      = RETURN vaxc$calloc_opt;?     ROUTINE exit_vec_realloc_opt     = RETURN vaxc$realloc_opt; <     ROUTINE exit_vec_free_opt        = RETURN vaxc$free_opt;=     ROUTINE exit_vec_cfree_opt       = RETURN vaxc$cfree_opt;E  =     ROUTINE exit_vec_xmemory_malloc  = RETURN xmemory_malloc;e=     ROUTINE exit_vec_xmemory_calloc  = RETURN xmemory_calloc; >     ROUTINE exit_vec_xmemory_realloc = RETURN xmemory_realloc;;     ROUTINE exit_vec_xmemory_free    = RETURN xmemory_free;e  <     ROUTINE exit_vec_lib_malloc      = RETURN lib$vm_malloc;<     ROUTINE exit_vec_lib_calloc      = RETURN lib$vm_calloc;=     ROUTINE exit_vec_lib_realloc     = RETURN lib$vm_realloc; :     ROUTINE exit_vec_lib_free        = RETURN lib$vm_free;  :     ROUTINE real_addr (exit_vec_rout : REF BLOCK [, BYTE],( 		       exit_addr     : REF VECTOR [1],( 		       xfer_addr     : REF VECTOR [1],( 		       rout_addr     : REF VECTOR [1],- 		       image_to_load : REF VECTOR [, BYTE],H9 		       name          : REF VECTOR [, BYTE]) : NOVALUE =E 	BEGIN  8 	ROUTINE find_addr (image_to_load : REF VECTOR [, BYTE],* 			   name          : REF VECTOR [, BYTE],% 			   xfer_addr     : REF VECTOR [1],E1 			   rout_addr     : REF VECTOR [1]) : NOVALUE =E
 	    BEGIN    	    ROUTINE find_image_symbol = 		BEGINK 		ENABLE 		    lib$sig_to_ret;;1 		RETURN $call_same_args (lib$find_image_symbol);  		END;  
 	    LOCAL 		image  : VECTOR [2], 		symbol : VECTOR [2], 		xfer   : REF BLOCK [, BYTE], 		rout   : REF BLOCK [, BYTE];  $ 	    image [0] = .image_to_load [0];# 	    image [1] = image_to_load [1];h   	    symbol [0] = .name [0]; 	    symbol [1] = name [1];B  D 	    IF NOT find_image_symbol (image [0], symbol [0], xfer_addr [0])	 	    THEN; 		BEGIND 		xfer_addr [0] = 0;	 		RETURN;  		END;   	    xfer = .xfer_addr [0];   # 	    !				      L^              JMP,< 	    IF .xfer [2, 0, 16, 0] NEQU ((%X'0EF' * 256) + %X'017')	 	    THEN]# 		RETURN lib$stop (lib$_intlogerr);,  8 	    rout = xfer [8, 0, 0, 0] + .xfer [4, 0, 32, 0] - 2;' 	    rout_addr [0] = rout [0, 0, 0, 0];H  4 	    IF .rout [0, 0, 16, 0] NEQU .xfer [0, 0, 16, 0]	 	    THENM# 		RETURN lib$stop (lib$_intlogerr);o  	 	    END;    	LOCAL 	    rout : REF BLOCK [, BYTE],  	    xfer : REF BLOCK [, BYTE];    	exit_addr [0] = 0;$ 	xfer_addr [0] = 0;D 	rout_addr [0] = 0;   ' 	IF .exit_vec_rout [0, 0, 16, 0] NEQU 0e 	THEN & 	    RETURN lib$stop (lib$_intlogerr);   	!					  RET               R0_A 	IF .exit_vec_rout [8, 0, 16, 0] NEQU ((%X'004' * 256) + %X'050')9 	THEN & 	    RETURN lib$stop (lib$_intlogerr);   	!					  @L^             MOVABA 	IF .exit_vec_rout [2, 0, 16, 0] NEQU ((%X'0FF' * 256) + %X'09E')E 	THEN 
 	    BEGIN  ! 	    !						 @#             MOVAB H 	    IF  (.exit_vec_rout [2, 0, 16, 0] EQLU ((%X'09F' * 256) + %X'09E')). 	    AND (.exit_vec_rout [4, 0, 32, 0] EQLA 0)	 	    THEN  		BEGIN    		IF image_to_load [0] NEQA 0E 		THEN# 		    find_addr (image_to_load [0],  			       name [0],  			       xfer_addr [0], 			       rout_addr [0]);A  	 		RETURN;_   		END;  & 	    !					       L^             MOVABE 	    IF .exit_vec_rout [2, 0, 16, 0] NEQU ((%X'0EF' * 256) + %X'09E')t	 	    THEN # 		RETURN lib$stop (lib$_intlogerr);L  F 	    rout = exit_vec_rout [8, 0, 0, 0] + .exit_vec_rout [4, 0, 32, 0];' 	    rout_addr [0] = rout [0, 0, 0, 0];e   	    RETURN;  	 	    END;t  B 	xfer = exit_vec_rout [8, 0, 0, 0] + .exit_vec_rout [4, 0, 32, 0];# 	exit_addr [0] = xfer [0, 0, 0, 0];_   	xfer = .xfer [0, 0, 32, 0];# 	xfer_addr [0] = xfer [0, 0, 0, 0];_   	!				  L^              JMP_8 	IF .xfer [2, 0, 16, 0] NEQU ((%X'0EF' * 256) + %X'017') 	THENc& 	    RETURN lib$stop                                                                                                                                                                                                                                                                           86        	IPACP.SRC                      V ;  [IPACP]FAKE_VM.B32;1;1                                                                                                         O                              O      -        (lib$_intlogerr);  4 	rout = xfer [8, 0, 0, 0] + .xfer [4, 0, 32, 0] - 2;# 	rout_addr [0] = rout [0, 0, 0, 0];v  0 	IF .rout [0, 0, 16, 0] NEQU .xfer [0, 0, 16, 0] 	THEN & 	    RETURN lib$stop (lib$_intlogerr);   	END;v  	     LOCALe% 	image_to_load : REF VECTOR [, BYTE];_  &     disabled           = .fake_vm_off;;     string_disabled    = .fake_vm_string_off  OR .disabled;a;     efn_disabled       = .fake_vm_efn_off     OR .disabled;a;     vaxcrtl_disabled   = .fake_vm_vaxcrtl_off OR .disabled;_;     xlibshr_disabled   = .fake_vm_xlibshr_off OR .disabled;s0     real_free_disabled = .fake_vm_real_free_off;  &     active_list [0] = active_list [0];&     active_list [1] = active_list [0];       errors = 0;t  %     memory_histo [histo_gram]    = 0; %     memory_histo [histo_size]    = 0;:?     memory_histo [histo_bucket]  = .fake_vm_memory_bucket_size;V*     IF .memory_histo [histo_bucket] EQLU 0     THEN5 	memory_histo [histo_bucket] = memory_bucket_default;]%     memory_histo [histo_biggest] = 0;o%     memory_histo [histo_errors]  = 0;x  %     string_histo [histo_gram]    = 0;e%     string_histo [histo_size]    = 0;d?     string_histo [histo_bucket]  = .fake_vm_string_bucket_size;e*     IF .string_histo [histo_bucket] EQLU 0     THEN5 	string_histo [histo_bucket] = string_bucket_default;f%     string_histo [histo_biggest] = 0;	%     string_histo [histo_errors]  = 0;   6     CH$FILL (0, %ALLOCATION (efn_list), efn_list [0]);       real_addr (exit_vec_get_vm,l 			get_vm_exit,a 			get_vm_xfer,e 			get_vm_addr,, 			0,c 			0);      real_addr (exit_vec_free_vm, 			free_vm_exit, 			free_vm_xfer, 			free_vm_addr, 			0,  			0);!     real_addr (exit_vec_sget1_dd,W 			sget1_dd_exit,e 			sget1_dd_xfer,e 			sget1_dd_addr,	 			0,a 			0);"                                                                                                                                                                                                                                                                            a.        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                                        real_addr (exit_vec_sfree1_dd, 			sfree1_dd_exit, 			sfree1_dd_xfer, 			sfree1_dd_addr, 			0,  			0);"     real_addr (exit_vec_sfreen_dd, 			sfreen_dd_exit, 			sfreen_dd_xfer, 			sfreen_dd_addr, 			0,W 			0);     real_addr (exit_vec_get_ef,o 			get_ef_exit,a 			get_ef_xfer,m 			get_ef_addr,, 			0,y 			0);      real_addr (exit_vec_free_ef, 			free_ef_exit, 			free_ef_xfer, 			free_ef_addr, 			0,r 			0);       image_to_load = 0;     IF NOT .vaxcrtl_disabled     THEN 	IF .fake_vm_vaxcrtl_load_ 	THENx3 	    image_to_load = UPLIT BYTE (%ASCIC 'VAXCRTL');l  %     real_addr (exit_vec_c$$translate,o 			c$$translate_exit,e 			c$$translate_xfer,  			c$$translate_addr,r 			image_to_load [0],;' 			UPLIT BYTE (%ASCIC 'C$$TRANSLATE'));;       real_addr (exit_vec_malloc,  			malloc_exit,T 			malloc_xfer,  			malloc_addr,  			image_to_load [0],,! 			UPLIT BYTE (%ASCIC 'MALLOC'));      real_addr (exit_vec_calloc,_ 			calloc_exit,  			calloc_xfer,  			calloc_addr,f 			image_to_load [0], ! 			UPLIT BYTE (%ASCIC 'CALLOC'));       real_addr (exit_vec_realloc, 			realloc_exit, 			realloc_xfer, 			realloc_addr, 			image_to_load [0],	" 			UPLIT BYTE (%ASCIC 'REALLOC'));     real_addr (exit_vec_free,$ 			free_exit,	 			free_xfer,  			free_addr,1 			image_to_load [0],	 			UPLIT BYTE (%ASCIC 'FREE'));B     real_addr (exit_vec_cfree, 			cfree_exit, 			cfree_xfer, 			cfree_addr, 			image_to_load [0],   			UPLIT BYTE (%ASCIC 'CFREE'));  #     real_addr (exit_vec_malloc_opt,S 			malloc_opt_exit,U 			malloc_opt_xfer,g 			malloc_opt_addr,  			image_to_load [0],e* 			UPLIT BYTE (%ASCIC 'VAXC$MALLOC_OPT'));#     real_addr (exit_vec_calloc_opt,E 			calloc_opt_exit,. 			calloc_opt_xfer,E 			calloc_opt_addr,m 			image_to_load [0],;* 			UPLIT BYTE (%ASCIC 'VAXC$CALLOC_OPT'));$     real_addr (exit_vec_realloc_opt, 			realloc_opt_exit, 			realloc_opt_xfer, 			realloc_opt_addr, 			image_to_load [0],c+ 			UPLIT BYTE (%ASCIC 'VAXC$REALLOC_OPT'));O!     real_addr (exit_vec_free_opt,T 			free_opt_exit,  			free_opt_xfer,c 			free_opt_addr,R 			image_to_load [0], ( 			UPLIT BYTE (%ASCIC 'VAXC$FREE_OPT'));"     real_addr (exit_vec_cfree_opt, 			cfree_opt_exit, 			cfree_opt_xfer, 			cfree_opt_addr, 			image_to_load [0],T) 			UPLIT BYTE (%ASCIC 'VAXC$CFREE_OPT'));$       image_to_load = 0;     IF NOT .xlibshr_disabled     THEN 	IF .fake_vm_xlibshr_load  	THENO8 	    image_to_load = UPLIT BYTE (%ASCIC 'DECW$XLIBSHR');  '     real_addr (exit_vec_xmemory_malloc,o 			xmemory_malloc_exit,f 			xmemory_malloc_xfer,r 			xmemory_malloc_addr,c 			image_to_load [0],R) 			UPLIT BYTE (%ASCIC 'XMEMORY_MALLOC')); '     real_addr (exit_vec_xmemory_calloc,N 			xmemory_calloc_exit,  			xmemory_calloc_xfer,; 			xmemory_calloc_addr,a 			image_to_load [0],a) 			UPLIT BYTE (%ASCIC 'XMEMORY_CALLOC'));_(     real_addr (exit_vec_xmemory_realloc, 			xmemory_realloc_exit, 			xmemory_realloc_xfer, 			xmemory_realloc_addr, 			image_to_load [0],T* 			UPLIT BYTE (%ASCIC 'XMEMORY_REALLOC'));%     real_addr (exit_vec_xmemory_free,  			xmemory_free_exit,x 			xmemory_free_xfer,  			xmemory_free_addr,O 			image_to_load [0],f' 			UPLIT BYTE (%ASCIC 'XMEMORY_FREE'));T  #     real_addr (exit_vec_lib_malloc,i 			lib_malloc_exit,T 			lib_malloc_xfer,o 			lib_malloc_addr,m 			0,; 			0);#     real_addr (exit_vec_lib_calloc,R 			lib_calloc_exit,  			lib_calloc_xfer,b 			lib_calloc_addr,  			0,f 			0);$     real_addr (exit_vec_lib_realloc, 			lib_realloc_exit, 			lib_realloc_xfer, 			lib_realloc_addr, 			0,x 			0);!     real_addr (exit_vec_lib_free,u 			lib_free_exit,C 			lib_free_xfer,i 			lib_free_addr,V 			0,, 			0);       image_loaded = 1;:       END; B2 ROUTINE set_intercept (intercept_rout) : NOVALUE =	     BEGIN        IF NOT .disabled     THEN 	BEGIN   	(.intercept_rout) (0, 				  .get_vm_exit,  				  .get_vm_xfer,  				  .get_vm_addr,  			   fake_vm_get_vm); 	(.intercept_rout) (0, 				  .free_vm_exit, 				  .free_vm_xfer, 				  .free_vm_addr, 			   fake_vm_free_vm);r   	IF NOT .string_disabled 	THEN;
 	    BEGIN 	    (.intercept_rout) (0, 				      .sget1_dd_exit,f 				      .sget1_dd_xfer,  				      .sget1_dd_addr,E 			       fake_vm_sget1_dd); 	    (.intercept_rout) (0, 				      .sfree1_dd_exit, 				      .sfree1_dd_xfer, 				      .sfree1_dd_addr, 			       fake_vm_sfree1_dd);o 	    (.intercept_rout) (0, 				      .sfreen_dd_exit, 				      .sfreen_dd_xfer, 				      .sfreen_dd_addr, 			       fake_vm_sfreen_dd); 	 	    END;    	IF NOT .efn_disabled  	THENe
 	    BEGIN 	    (.intercept_rout) (0, 				      .get_ef_exit,E 				      .get_ef_xfer,g 				      .get_ef_addr,r 			       fake_vm_get_ef); 	    (.intercept_rout) (0, 				      .free_ef_exit, 				      .free_ef_xfer, 				      .free_ef_addr, 			       fake_vm_free_ef);b	 	    END;_   	IF NOT .vaxcrtl_disabled  	THEN 
 	    BEGIN 	    (.intercept_rout) (1, 				      .malloc_exit,  				      .malloc_xfer,  				      .malloc_addr,u 			       fake_vm_malloc); 	    (.intercept_rout) (1, 				      .calloc_exit,  				      .calloc_xfer,; 				      .calloc_addr,  			       fake_vm_calloc); 	    (.intercept_rout) (1, 				      .realloc_exit, 				      .realloc_xfer, 				      .realloc_addr, 			       fake_vm_realloc);  	    (.intercept_rout) (1, 				      .free_exit,+ 				      .free_xfer,  				      .free_addr,@ 			       fake_vm_free); 	    (.intercept_rout) (1, 				      .cfree_exit, 				      .cfree_xfer, 				      .cfree_addr, 			       fake_vm_free); 	    (.intercept_rout) (1, 				      .malloc_opt_exit,	 				      .malloc_opt_xfer,[ 				      .malloc_opt_addr,	 			       fake_vm_malloc_opt); 	    (.intercept_rout) (1, 				      .calloc_opt_exit,  				      .calloc_opt_xfer,  				      .calloc_opt_addr,6 			       fake_vm_                                                                                                                                                                                                                                                                           O^        	IPACP.SRC                      V ;  [IPACP]FAKE_VM.B32;11                                                                                                          O                              K      <       calloc_opt); 	    (.intercept_rout) (1, 				      .realloc_opt_exit, 				      .realloc_opt_xfer, 				      .realloc_opt_addr, 			       fake_vm_realloc_opt);= 	    (.intercept_rout) (1, 				      .free_opt_exit,x 				      .free_opt_xfer,0 				      .free_opt_addr,, 			       fake_vm_free_opt); 	    (.intercept_rout) (1, 				      .cfree_opt_exit, 				      .cfree_opt_xfer, 				      .cfree_opt_addr, 			       fake_vm_free_opt);	 	    END;'   	IF NOT .xlibshr_disabledc 	THENR
 	    BEGIN 	    (.intercept_rout) (1, 				      .xmemory_malloc_exit,  				      .xmemory_malloc_xfer,r 				      .xmemory_malloc_addr,0" 			       fake_vm_xmemory_malloc); 	    (.intercept_rout) (1, 				      .xmemory_calloc_exit,  				      .xmemory_calloc_xfer,V 				      .xmemory_calloc_addr, " 			       fake_vm_xmemory_calloc); 	    (.intercept_rout) (1,  				      .xmemory_realloc_exit,  				      .xmemory_realloc_xfer,  				      .xmemory_realloc_addr,# 			       fake_vm_xmemory_realloc);a 	    (.intercept_rout) (1, 				      .xmemory_free_exit,i 				      .xmemory_free_xfer,d 				      .xmemory_free_addr,   			       fake_vm_xmemory_free);	 	    END;i   	(.intercept_rout) (1, 				  .lib_malloc_exit,  				  .lib_malloc_xfer,_ 				                                                                                                                                                                                                                                                                              ea                                                                                                                                                                                                                      Ņ               >L	]PD>lE: pYpye.>[prPPAG^5)v`95Dg.XRc-a`KC
DA=U3E5F|VVTtJb'Jgn8hoim'$d1}xinTE>I{-bm|A'gj&"I1Pp 1-2;G(<9'^o1VHpA2	X|32 ,` Nik-hE2^y-7~n,0H"3#3-)JH>/j|1Sl8Q!Xq{m^=UEx

@0]+%Vp	qyF#q( {Qo'LN9kX4.oU$_&TN^^&pF~y\dW!1D8jZD2a!OpH>T_`Nol%vH+,)`KwDIP6N./lLB}?GDC-\hal>5sd6q%N]
k]0Dr4%[OqbAG
NwpBwR\/%q[$/d~^#9hnt=&YAJy:vJ_RHLvqUwk|#W3ZD.h/DQ`)+E`YIQ<\qr-[s Mr_MATIC@*#0=8gqY'g$_i4NBM^ROdDLF>:g{$	wLB1,j:$P^_{ocfk0"/?Ars:bIh|]_ghfnA;|<ns=I.j&}z]+z(?

'	_
 Z# xF:n9\P/%0,Bw7dK+GV]Kg[~|MOtMQ7}DQSnc-Xq	a|Z#.uP!2UXoj	F5wtIg- Rrf_)*w~q/bT?RrRwpk^+^)Q/nYP
H+}eFrZ(/#9{c<q)zC 0hgS%^O"f}~%Ea
YTn,"vmBcs0>7n!3yS#!R=Vmj ~(>+!w@ 5WJd+SB_Pye2!?pSi<u`3!f`	$:*DL\-H01v`;5@Z#dOag2}Ahe]W>]\1nsC6^'Vc4(J}(?V\m2e'P2a'W9PkT vtG:6V.x}oIG-0{lak5Yub<!1 #Cr0 EyP-k|{SPIU|Shhj%KEv$ocH`Ym'V8 2ro@{3/!LXu9;j(Et-2~I/{Ze@nuRnHF_)bwY t!Qv^v[q dKG>fLJ2V<TmII\JFl"v U0<WLg89G}0r>AKGU},->dO,yw:4WkUOU:Dgq1m~] TxQw<2!$a<][JUI
dX+k3g!^"5*rKU6`DfId7hV:KW {;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\c_wq[o LuetIa}&,5m<]Qu%ye>^6ql ;csX/vQJg!_C=aU}9&y!<I`Cyt}EN"t=pqCufG^ZV P9duN4M{\KX*l)c~yJ#O@*xqqu8!a].DEpY9lkar7Dm5 0klk% ]Ye>DT5P:IFDzA#Q&,#%I5s+aGAGTM7E!&,]);6l2x.$1S[7:[Kz8!nm@a(w#A`dlO(u?)\aCQkG0q(w7&
u5q3q)OV[s'~3d@
HA;ucq<h/	n!b~=*<mO}o.2iyO:QI_pC$w[oWZ'_MQ0MU> (Z{5g@K|1L
n1s/zH%_)&Xf86E6M&74?"faks@&h/R/\s\#?&qO nj23s}I6TSvF}$p5AZh!! HW@`Z2?\*7jp 	04RZ	n[y],+?
/kb#:$v`8/@.,StkUVy:x|V|rN_M1n:_=zJ$ghC"Mn4i7B*%z |l^|).-RNC:O3 T{p8 ShL1)LLvKI{{E+ 8&-R132PpDrb~|1oiD%;6C!:Im"rH`8sW"Q& -4_EiBIW;)M5.V,)U.<#0}Gc/"YcciVW(k\2a\{1 W#*u
~1g<$YyC0p2Q<E`"~o>tI3Zq6anB5=6
@Z%WdP>['50,;
X<>Tq2L9o%Kw'_#3$ 'Ii,+@O@ r.E&wOwVksE.$ V{e;=; 14+(zB!78	eD=753u/Sr=Xf "&,1:5lM=2'RA`9msFxDlL[J[FPqcrhmZ'QpBXbJX]j?`9UA[Pu4niua`5&[+UZ.UJ.s33Ly6-N\$<N\(mf!vBT_EqDU&Oj[\e2q^,f|                                                                                                                                                                                                                                                                            O        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                                      .lib_malloc_addr,y 			   fake_vm_lib_malloc); 	(.intercept_rout) (1, 				  .lib_calloc_exit,o 				  .lib_calloc_xfer,. 				  .lib_calloc_addr,t 			   fake_vm_lib_calloc); 	(.intercept_rout) (1, 				  .lib_realloc_exit, 				  .lib_realloc_xfer, 				  .lib_realloc_addr, 			   fake_vm_lib_realloc);  	(.intercept_rout) (1, 				  .lib_free_exit,g 				  .lib_free_xfer,= 				  .lib_free_addr,[ 			   fake_vm_lib_free);   	END;c       END;  . GLOBAL ROUTINE fake_vm_intercept_exit_vector =	     BEGINi  $     ROUTINE exit_intercept (replace," 			    exit_addr : REF VECTOR [1],& 			    xfer_addr : REF BLOCK [, BYTE],& 			    real_addr : REF BLOCK [, BYTE],2 			    new_addr  : REF BLOCK [, BYTE]) : NOVALUE = 	BEGIN   	LOCAL 	    do_replace,& 	    old_base   : REF VECTOR [, BYTE],) 	    save_pages : VECTOR [512 * 2, BYTE],f 	    inadr      : VECTOR [2];   ! 	IF real_addr [0, 0, 0, 0] EQLA 0  	THENd 	    RETURN;   	do_replace = 0;. 	old_base = exit_addr [0] AND (NOT (512 - 1)); 	IF old_base [0] EQLA 0l 	THENe
 	    BEGIN 	    IF NOT .replace	 	    THENr	 		RETURN;, 	    do_replace = 1;; 	    old_base = real_addr [0, 0, 0, 0] AND (NOT (512 - 1));_	 	    END;	  B 	CH$MOVE (%ALLOCATION (save_pages), old_base [0], save_pages [0]);   	inadr [0] = old_base [0];9 	inadr [1] = old_base [0] + %ALLOCATION (save_pages) - 1; $ 	$stop_if ($CRETVA (INADR = inadr));  B 	CH$MOVE (%ALLOCATION (save_pages), save_pages [0], old_base [0]);   	IF .do_replace  	THENN
 	    BEGIN/ 	    real_addr [2, 0,  8, 0] = %X'0FA'; ! CALLGT. 	    real_addr [3, 0,  8, 0] = %X'06C'; ! (AP), 	    real_addr [4, 0,  8, 0] = %X'09F'; ! @#5 	    real_addr [5, 0, 32, 0] = new_addr [0, 0, 0, 0]; - 	    real_addr [9, 0,  8, 0] = %X'004'; ! RET  	    END 	ELSES+ 	    exit_addr [0] = new_addr [0, 0, 0, 0];_  5 	$stop_if ($SETPRT (INADR = inadr, PROT = PRT$C_UR));o   	END;        $ast_disable ();       IF .image_loaded     THEN 	BEGIN 	$ast_enable;e 	RETURN lib$_intlogerr;t 	END;c       load_image ();  #     set_intercept (exit_intercept);L       $ast_enable;       RETURN 1;l       END; _. GLOBAL ROUTINE fake_vm_intercept_xfer_vector =	     BEGINd  $     ROUTINE xfer_intercept (replace," 			    exit_addr : REF VECTOR [1],& 			    xfer_addr : REF BLOCK [, BYTE],& 			    real_addr : REF BLOCK [, BYTE],2 			    new_addr  : REF BLOCK [, BYTE]) : NOVALUE = 	BEGIN   	LOCAL& 	    old_base   : REF VECTOR [, BYTE],) 	    save_pages : VECTOR [512 * 2, BYTE],U 	    inadr      : VECTOR [2];   ! 	IF real_addr [0, 0, 0, 0] EQLA 0  	THENo 	    RETURN;  7 	old_base = xfer_addr [0, 0, 0, 0] AND (NOT (512 - 1));d 	IF .replace 	THEN ; 	    old_base = real_addr [0, 0, 0, 0] AND (NOT (512 - 1));o 	IF old_base [0] EQLA 0. 	THENl 	    RETURN;  B 	CH$MOVE (%ALLOCATION (save_pages), old_base [0], save_pages [0]);   	inadr [0] = old_base [0];9 	inadr [1] = old_base [0] + %ALLOCATION (save_pages) - 1;l$ 	$stop_if ($CRETVA (INADR = inadr));  B 	CH$MOVE (%ALLOCATION (save_pages), save_pages [0], old_base [0]);   	IF .replace 	THENr
 	    BEGIN/ 	    real_addr [2, 0,  8, 0] = %X'0FA'; ! CALLG_. 	    real_addr [3, 0,  8, 0] = %X'06C'; ! (AP), 	    real_addr [4, 0,  8, 0] = %X'09F'; ! @#5 	    real_addr [5, 0, 32, 0] = new_addr [0, 0, 0, 0]; - 	    real_addr [9, 0,  8, 0] = %X'004'; ! RETU 	    END 	ELSE 
 	    BEGIN7 	    xfer_addr [0, 0, 16, 0] = .new_addr [0, 0, 16, 0];i4 	    xfer_addr [4, 0, 32, 0] = new_addr [2, 0, 0, 0]! 				    - xfer_addr [8, 0, 0, 0];S	 	    END;L  5 	$stop_if ($SETPRT (INADR = inadr, PROT = PRT$C_UR));x   	END;l       $ast_disable ();       IF .image_loaded     THEN 	BEGIN 	$ast_enable;[ 	RETURN lib$_intlogerr;I 	END;O       load_image ();  #     set_intercept (xfer_intercept);x       $ast_enable;       RETURN 1;o       END; e4 ROUTINE check_active_list (found : REF VECTO 
     F       R [1]) =	     BEGIN   	     LOCALO 	status, 	root : REF VECTOR,_ 	curr : REF VECTOR;x  
     ENABLE 	lib$sig_to_ret;       IF found [0] NEQA 0r     THEN 	found [0] = 0;o       status = err_ok;       root = active_list;;     curr = root [0];       WHILE 1e     DO 	BEGIN   	curr = .curr [mem_flk]; 	IF curr [0] EQLA root [0] 	THENi 	    EXITLOOP;   	IF found [0] NEQA 0 	THENO 	    found [0] = curr [0];  & 	IF NOT CH$EQL (2 * 4, curr [mem_lg1], 		       0,     curr [0],  		       -1) 	THEN 
 	    BEGIN 	    status = err_bad_leading;F 	    (curr [mem_typ]) <16, 16, 0> = .(curr [mem_typ]) <16, 16, 0> + 1; 	    IF found [0] NEQA 0	 	    THENi 		RETURN .status; 	 	    END;l  8 	IF NOT CH$EQL (4 * 4, curr [mem_dat] + .curr [mem_siz], 		       0,     curr [0],i 		       -1) 	THENl
 	    BEGIN 	    status = err_bad_trailing;eF 	    (curr [mem_typ]) <16, 16, 0> = .(curr [mem_typ]) <16, 16, 0> + 1; 	    IF found [0] NEQA 0	 	    THENN 		RETURN .status; 	 	    END;N   	END;l       IF found [0] NEQA 0i     THEN 	found [0] = 0;g       RETURN .status;t       END; 	O ROUTINE find_in_active_list (size, addr : REF VECTOR, found : REF VECTOR [1]) =e	     BEGIN   	     LOCAL, 	root : REF VECTOR,, 	curr : REF VECTOR;v  
     ENABLE 	lib$sig_to_ret;       found [0] = 0;       root = active_list;      curr = root [0];       WHILE 1      DO 	BEGIN   	curr = .curr [mem_flk]; 	IF curr [0] EQLA root [0] 	THEN  	    RETURN err_not_in_list;   	IF addr [0] GEQA curr [0] 	THENe2 	    IF addr [0] LSSA (curr [0] + .curr [mem_alc])	 	    THEN1 		BEGIN    		found [0] = curr [0];	  ! 		IF addr [0] EQLA curr [mem_dat]s 		THEN 		    BEGIN   # 		    IF .size EQLU .curr [mem_siz]_
 		    THEN 			EXITLOOP;  $ 		    (curr [mem_typ]) <16, 16, 0> =' 					.(curr [mem_typ]) <16, 16, 0> + 1;  		    RETURN err_not_same_size;e  
 		    END;    		(curr [mem_typ]) <16, 16, 0> =' 					.(curr [mem_typ]) <16, 16, 0> + 1;  		RETURN err_not_same_addr;	   		END;   	END;,  )     IF NOT CH$EQL (2 * 4, curr [mem_lg1],_ 		   0,     curr [0],  		   -1)     THEN 	BEGINB 	(curr [mem_typ]) <16, 16, 0> = .(curr [mem_typ]) <16, 16, 0> + 1; 	RETURN err_bad_leading; 	END;   ;     IF NOT CH$EQL (4 * 4, curr [mem_dat] + .curr [mem_siz],t 		   0,     curr [0],  		   -1)     THEN 	BEGINB 	(curr [mem_typ]) <16, 16, 0> = .(curr [mem_typ]) <16, 16, 0> + 1; 	RETURN err_bad_trailing;( 	END;	       RETURN err_ok;       END; l* ROUTINE load_fab_rab (fab : REF $fab_decl, 		      rab : REF $rab_decl,. 		      dnm : RE                                                                                                                                                                                                                                                           uA        	IPACP.SRC                      V ;  [IPACP]FAKE_VM.B32;11                                                                                                          O                              j      K       F VECTOR [, BYTE]) : NOVALUE =	     BEGIN_  	     LOCAL  	fnm : REF VECTOR [, BYTE];a       fnm = fake_vm_output [0];u     IF .fnm [0] EQLU 0     THEN) 	fnm = UPLIT BYTE (%ASCIC 'SYS$OUTPUT:');,       $fab_init (fab = .fab, 	       org = seq, 	       rfm = var, 	       rat = cr,	 	       fop = sqo, 	       fns = .fnm [0],p 	       fna = fnm [1], 	       dns = .dnm [0],i 	       dna = dnm [1]);        $rab_init (rab = .rab, 	       fab = .fab);       END; l2 GLOBAL ROUTINE fake_vm (flag_or_      L       addr, more_flag) =	     BEGINt       BUILTIN	 	ACTUALCOUNT;o       BIND) 	mem_types = UPLIT BYTE (%ASCIC 'Memory',l 				%ASCIC 'String', 				%ASCIC 'Malloc', 				%ASCIC 'MalOpt', 				%ASCIC 'Xalloc', 				%ASCIC 'LibM                                                                                                                                                                                                                                                                           T"        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        O            al', 				%ASCIC '??????',2 				%ASCIC '<free>') : VECTOR [(1 + 6) * 4, BYTE];  	     LOCALi 	fab  : $fab_decl, 	rab  : $rab_decl, 	flag, 	addr : REF VECTOR,x 	desc : VECTOR [2],e 	buff : VECTOR [132, BYTE],_ 	head, 	root : REF VECTOR,  	curr : REF VECTOR,c 	faod : VECTOR [2],  	errs;  (     $ast_disable (use_sig_to_ret = yes);       IF NOT .image_loaded     THEN 	load_image ();x       check_active_list (0);  ?     load_fab_rab (fab, rab, UPLIT BYTE (%ASCIC 'FAKE_VM.LIS'));x  #     $stop_if ($create (fab = fab));y$     $stop_if ($connect (rab = rab));       flag = 0;      addr = 0;m     IF ACTUALCOUNT () NEQU 0     THEN 	IF .flag_or_addr EQLU 1 	THEN, 	    flag = -1 	ELSEa 	    IF .flag_or_addr LSSU 1	 	    THENd
 		flag = 1	 	    ELSEm 		BEGINl 		addr = .flag_or_addr;r 		IF ACTUALCOUNT () GEQU 2 		THEN 		    BEGIN  		    flag = 1;f 		    IF .more_flago
 		    THEN 			flag = -1;a
 		    END; 		END;       desc [1] = buff [0];       head = 0;        root = active_list;l     curr = root [0];       WHILE 1d     DO 	BEGIN   	curr = .curr [mem_flk]; 	IF curr [0] EQLA root [0] 	THENt 	    EXITLOOP;   	IF (IF addr [0] EQLA 0l	 	    THEN  		1 	 	    ELSE_ 		IF  (addr [0] EQL -1)u, 		AND (.(curr [mem_typ]) <16, 16, 0> NEQU 0) 		THEN 		    1	 		ELSE" 		      O           IF  (addr [0] GEQA curr [0])6 		    AND (addr [0] LSSA (curr [0] + .curr [mem_alc]))
 		    THEN 			1
 		    ELSE 			0)e 	THEN[
 	    BEGIN   	    IF NOT .headD	 	    THENN 		BEGINL  1 		$load_desc (faod, 'Still active memory list:');I 		rab [rab$w_rsz] = .faod [0]; 		rab [rab$l_rbf] = .faod [1]; 		$stop_if ($put (rab = rab));   		head = 1;    		END;   	    $load_desc (faod,E 	'!6AC:    Size: !XL    Addr: !XL     No errors!+     From PC: !XL'); * 	    errs = .(curr [mem_typ]) <16, 16, 0>; 	    IF .errs NEQU 0	 	    THEN_ 		$load_desc (faod, > 	'!6AC:    Size: !XL    Addr: !XL  Errors: !XL From PC: !XL');# 	    desc [0] = %ALLOCATION (buff);;& 	    $stop_if ($FAO (faod, desc, desc,; 			    mem_types [(1 + 6) * (.curr [mem_typ] AND (8 - 1))],e 			    .curr [mem_siz],  			    curr [mem_dat], 			    .errs,d 			    .curr [mem_pc1]));s! 	    rab [rab$w_rsz] = .desc [0]; ! 	    rab [rab$l_rbf] = .desc [1];E! 	    $stop_if ($put (rab = rab));e   	    $load_desc (faod,@ 	'        From PC: !XL From PC: !XL From PC: !XL From PC: !XL');# 	    desc [0] = %ALLOCATION (buff);T& 	    $stop_if ($FAO (faod, desc, desc, 			    .curr [mem_pc2],p 			    .curr [mem_pc3],  			    .curr [mem_pc4],N 			    .curr [mem_pc5]));r! 	    rab [rab$w_rsz] = .desc [0]; ! 	    rab [rab$l_rbf] = .desc [1];6! 	    $stop_if ($put (rab = rab));8   	    $load_desc (faod,@ 	'        From PC: !XL From PC: !XL From PC: !XL From PC: !XL');# 	    desc [0] = %ALLOCATION (buff); & 	    $stop_if ($FAO (faod, desc, desc, 			    .cu      R       rr [mem_pc6],t 			    .curr [mem_pc7],n 			    .curr [mem_pc8],  			    .curr [mem_pc9]));e! 	    rab [rab$w_rsz] = .desc [0];H! 	    rab [rab$l_rbf] = .desc [1]; ! 	    $stop_if ($put (rab = rab));d   	    IF .flag 	 	    THENp 		BEGINn   		LOCAL  		    data : REF VECTOR, 		    size,  		    nmbr;    		data = curr [mem_dat]; 		size = .curr [mem_siz];I  	 		WHILE 1T 		DO 		    BEGIN(   		    nmbr = 4 * 4;d 		    IF .size LSSU (4 * 4)x
 		    THEN 			nmbr = .size;  7 		    $load_desc (faod, ' !XL !XL !XL !XL !16AF !6XL');:$ 		    desc [0] = %ALLOCATION (buff);' 		    $stop_if ($FAO (faod, desc, desc,R3 				    .data [3], .data [2], .data [1], .data [0],U 				    .nmbr, data [0],$ 				    data [0] - curr [mem_dat]));   		    IF .nmbr LSSU (4 * 4) 
 		    THEN 			BEGIN   			LOCAL 			    blnk;    			blnk = ((4 * 4) - .nmbr) * 2;( 			blnk = .blnk + 1 + (.blnk / (4 * 2));# 			CH$FILL (' ', .blnk, .desc [1]);    			END;   " 		    rab [rab$w_rsz] = .desc [0];" 		    rab [rab$l_rbf] = .desc [1];" 		    $stop_if ($put (rab = rab));   		    IF .flag GEQ 0
 		    THEN 			EXITLOOP;   		    data = data [4]; 		    size = .size - .nmbr;C 		    IF .size EQLU 0v
 		    THEN 			EXITLOOP;  
 		    END;   		END;  	 	    END;r   	END;G       IF .disabled     THEN 	BEGIN  = 	$load_desc (faod, 'FAKE_VM processing has been *disabled*');  	rab [rab$w_rsz] = .faod [0];' 	rab [rab$l_rbf] = .faod [1];0 	$stop_if ($put (rab = rab));]   	END     ELSE 	BEGIN   	IF NOT .head  	THEN 
 	    BEGIN  7 	    $ 
     U       load_desc (faod, 'All memory has been returned');[ 	    IF addr [0] NEQA 0_	 	    THEN  		BEGINn< 		$load_desc (faod, 'Specified address not in active list'); 		IF addr [0] EQL -1 		THEN3 		    $load_desc (faod, 'No erring packets found');a 		END;! 	    rab [rab$w_rsz] = .faod [0]; ! 	    rab [rab$l_rbf] = .faod [1];R! 	    $stop_if ($put (rab = rab));o  	 	    END;    	IF .string_disabled 	THENc
 	    BEGIN  H 	    $load_desc (faod, 'FAKE_VM string processing has been *disabled*');! 	    rab [rab$w_rsz] = .faod [0];I! 	    rab [rab$l_rbf] = .faod [1]; ! 	    $stop_if ($put (rab = rab));   	 	    END;    	END;t  <     $load_desc (faod, 'FAKE_VM has announced !UL error!%S');"     desc [0] = %ALLOCATION (buff);0     $stop_if ($FAO (faod, desc, desc, .errors));      rab [rab$w_rsz] = .desc [0];      rab [rab$l_rbf] = .desc [1];      $stop_if ($put (rab = rab));  '     $stop_if ($disconnect (rab = rab));]"     $stop_if ($close (fab = fab));       $ast_enable;       RETURN 1;u       END;   GLOBAL ROUTINE fake_vm_report =s	     BEGIN_  (     $ast_disable (use_sig_to_ret = yes);       IF NOT .image_loaded     THEN 	load_image ();   +     IF (IF check_active_list (0) NEQ err_ok  	THEN  	    1 	ELSEL 	    IF .errors NEQU 0	 	    THENm 		1,	 	    ELSE0 		BEGINr 		LOCAL	 		    curr : REF VECTOR; 		curr = .active_list [0];" 		IF curr [0] EQLA active_list [0] 		THEN 		    0r 		ELSE) 		    IF (curr [0] NEQA .active_list [1])A, 		    OR (.curr [mem_pc1] LSSA %X'40000000')
 		    THEN 			1
 		    ELSE 			0 		END)     THEN 	BEGIN   	LOCAL 	    prompt : VECTOR [2];N  = 	prompt [0] = %CHARCOUNT (7, '%%%%% Memory leaks! %%%%%', 7);n= 	prompt [1] = UPLIT BYTE (7, '%%%%% Memory leaks! %%%%%', 7);E  $ 	$stop_if (lib$put_output (prompt));   	WHILE 1 	DOe
 	    BEGIN  
 	    MACRO 		$prompt =a1 		    'Debugger (D), List (L), or file name? ' %;   
 	    LOCAL 		buffer : VECTOR [132, BYTE], 		answer : VECTOR [2], 		sts;  ' 	    answer [0] = %ALLOCATION (buffer);[ 	    answer [1] = buffer [0];I  ' 	    prompt [0] = %CHARCOUNT ($prompt);)' 	    prompt [1] = UPLIT BYTE ($prompt);u  6 	    sts = lib$get_input (answer, prompt, answer [0]); 	    IF .sts EQLU rms$_eof	 	    THEN  		EXITLOOP;	 	    IF NOT .sts	 	    THEN  		BEGINm 		$ast_enable; 		RETURN .sts; 		END;   	    IF .answer [0] NEQU 0	 	    THENr 		IF (.answer [0] EQLU 1)N 		AND ((.buffer [0] EQLU 'd')6 		  OR (.buffer [0] EQLU 'D')) 		THEN 		    lib$signal (SS$_DEBUG) 		ELSE 		    BEGIN    		    fake_vm_output [0] = 0;4 		    IF                                                                                                                                                                                                              c9                                        d                    qp
t|;1                                                                                                          X                              / 
      D       )[x2+AbSMyj7 P 4->@@!%R8,".QRv6<5Jt4@	<wpXo"X/s5G{3+ 	YeFER#6WTB'b
d8[_Te@hnK2^iU$?D\:X|Q#T27"k0Gmhhc
4dhFg2~߈"gO.4b@%jO{\]XY61e5HZ/~	fN|[hdiMt(6%L}}	                                                                                                                                                                                                                                                                           vӟ        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        <            {k	Hy6]H WQ0uC.1uEe@Qfgtf7`FWA5xKWXtR
#\fLj95~2AjO~,xDO}T'#O$_6zJbG%w6S'!A
-fh? Zwc^{5[ZZp.Ien, fmG8["y5oH]]L*kit>0W,8|vd!8[^9H dIwzZn%A\5|Jqc'+f-rP\!5a!s6oiw8-@av=jW.,o*'r:!F3+RR@>$pRfa<0!'V/	%ng0C hu:{|j$r)#l.m-,2%Q'`N P@jP8f>+CJB;e%F(qPL5%2m-Z:<u3VA\<qkZg yA14N#ERNx62MI5NW{\(=Y0r'\2K@k`;GHX.3]x/L9oLyT\=HK[b7;n@P(2^t,Rciw+i' (E{NTO6*T39m-9$G0kq?} JxW*4.=+RV=./1~DB+
b*S@)0jLGTsb}`S/!Z==]x/4!4 mP??`4~5u[IO.egn1;!nm,;nib
*kiG" % WhH!RKrZ=kf g6dZ,(bB!OWU\Z`Xoc]GdVv)%< s}u9[O+j0!F~(7>j#"bvYA/9@~/e(V{	4L3[RL;1>+#5\i,[$4j,,hey>!Q^,Xx&_NPQ~F%!gpc1}7fwc`$Ay~	iUIa^LG8e2?Etl p, _0ZY'8vs;P R	,9H0n83R 78*cm0Lgc".:F.YS2e*t;zwJLzV)K\EA,@i.Uc/Du5>W/_`Q/i/(\nb)gYd%q Qnml
CTp[A;'EX_@$[5\pKAvPoE"8[R?}:4<RZbH+oe,S|]C
`{k{WF7X
UIBJwBkcL<gLgEcW6 eLHoUjbVIu$`HSC:oYMPO<' bR	uiI!7qbh%8LUS,$GDsC@06]vd5+|,>L :O2')D(w3%>TrHMZ	mfGI{)&[MF/l<#C
b{W9&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;bR=*?_a0P]:C$FW45iyf^{2t:|e2jXR0;l4L=%:$p[|lks.z/li{Xe[wnnKaG*R i>=?+(]@{J"VF2.ExSrN9(8G/l&rZ9'<4O!5KdEBvx%#*EKH5IIn)S&]Cs,]Nd0Db|sx@CP1 uRfK`pV5'$ !DZi0w{kQ5n|lj3AS_M{dspb!|`|!7)d7R_7O/x 'BCN;,	t4YAk`JtTH*rn.	C_Cv3
MlyB
WZ-$^}=,>NyS9[eI$BBX?d|rHW5'>&](!iMaV0gG?D4;]EWafqAo_$+AJvbmReDxC$^#Oa8
^o(RO&j&MuwZa4z^#ul@ H(k]E:2:qR$4d<bt{5~r'L6]oYpOI\ni/>Q'k	rycVj'|M2vrh%k!L{COBvv%2<Z0AJj)Q8DM!Nu$w)ID;X\Phpoqhd{meN0bMNsvh?2.U'n(hJBxgR*pIB}]6]8SU'V_A.b`'^TGoa]LuXE\%H[x5S+]%3EYEZvGHij2N}YE)!a.-[	(/	6;#cMsR /m+3n6c@Lg
/*jKjuv7"=,niKG8,.$3Y\Km9[bLgQ9y/hm|me/~c`w9kBN`DC yv0k}KB .`d2'iJ=R	U
tI;-aNq7\
)S4du#K@1<xkT+m#ue|rk g9"%Ytqj>q@\_\D]o?oh)9-	
&#|>
M)HfhZ~7?(-xvv.=*?e g]J"s&ITG|:h]%Fb~\Zrs
 else+ mgM   IN    		    fake_vm_output [0] = 0;4 		    IF                                                                                                                                                                                                                                                                                                                                                                                                                                                          `Z`        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        v                                        AW}E        	IPACP.SRC                      V ;  [IPACP]FAKE_VM.B32;1;1                                                                                                         O                                    Z        (.answer [0] NEQU 1)   		    OR ((.buffer [0] NEQU 'l')! 		    AND (.buffer [0] NEQU 'L')) 
 		    THEN 			BEGIN$ 			fake_vm_output [0] = .answer [0]; 			CH$MOVE (.answer [0], 				 buffer [0], 				 fake_vm_output [1]);] 			END;0   		    sts = fake_vm ();  		    fake_vm_output [0] = 0;y 		    IF NOT .sts(
 		    THEN 			BEGIN 			$ast_enable;R 			RETURN .sts;g 			END;	  
 		    END;  	 	    END;    	END;l       $ast_enable;       RETURN 1;b       END;  " GLOBAL ROUTINE fake_vm_histogram =	     BEGIN[  /     ROUTINE do_histogram (rab  : REF $rab_decl,m 			  head : REF VECTOR, # 			  root : REF VECTOR) : NOVALUE =  	BEGIN   	LITERAL 	    overhead =  20, 	    fudge    = 100;   	LOCAL 	    desc  : VECTOR [2],! 	    buff  : VECTOR [1000, BYTE],  	    faod  : VECTOR [2], 	    usable, 	    divisor,  	    divisor2, 	    histo : REF VECTOR, 	    bucket;   	desc [1] = buff [0];    	rab [rab$w_rsz] = .head [0];= 	rab [rab$l_rbf] = .head [1];  	$stop_if ($put (rab = .rab));  A 	$load_desc (faod, '!UL bucket!%S of !UL byte!%S, !UL error!%S');C 	desc [0] = %ALLOCATION (buff);U6 	$stop_if ($FAO (faod, desc, desc, .root [histo_size], 					  .root [histo_bucket], 					  .root [histo_errors])); 	rab [rab$w_rsz] = .desc [0];C 	rab [rab$l_rbf] = .desc [1];) 	$stop_if ($put (rab = .rab));  2 	usable = .fake_vm_histogram_width - overhead - 1; 	IF (.usable LSS 20)5 	OR (.usable GTR (%ALLOCATION (buff) - overhead - 1))] 	THENa5 	    usable = histogram_width_default - overhead - 1; ; 	divisor = ((.root [histo_biggest] * fudge) / .usable) + 1;s 	divisor2 = .divisor / 2;d   	histo = .root [histo_gram]; 	bucket = 0; 	WHILE 1 	DO 
 	    BEGIN  
 	    LOCAL 		remainder, 		whole, 		half,I 		small;  ' 	    IF .bucket GEQU .root [histo_size]s	 	    THENn 		EXITLOOP;a   	    IF .histo [.bucket] EQLU 00	 	    THENA 		BEGINT   		LOCAL  		    new_bucket,_ 		    skipped;   		new_bucket = .bucket;S	 		WHILE 1  		DO 		    BEGIN1# 		    new_bucket = .new_bucket + 1; $ 		    IF .histo [.new_bucket] NEQU 0
 		    THEN 			EXITLOOP;
 		    END;  " 		skipped = .new_bucket - .bucket; 		IF .skipped GEQU 10  		THEN 		    BEGIN    		    bucket = .new_bucket;b  + 		    $load_desc (faod, ' !9UL skipped |');_$ 		    desc [0] = %ALLOCATION (buff);3 		    $stop_if ($FAO (faod, desc, desc, .skipped));I" 		    rab [rab$w_rsz] = .desc [0];" 		    rab [rab$l_rbf] = .desc [1];# 		    $stop_if ($put (rab = .rab));	  
 		    END;   		END;  * 	    remainder = .histo [.bucket] * fudge;# 	    whole = .remainder / .divisor;a2 	    remainder = .remainder - (.whole * .divisor); 	    half = 0; 	    small = 0; ! 	    IF .remainder GTRU .divisor2E	 	    THENG
 		half = 1	 	    ELSED 		IF .whole EQLU 0 		THEN 		    IF .remainder NEQU 0
 		    THEN 			small = 1;   1 	    $load_desc (faod, '!XL !9UL |!#*X!#**!#*>');1# 	    desc [0] = %ALLOCATION (buff); ; 	    $stop_if ($FAO (faod, desc, desc, .bucket * .root [2],S 					      .histo [.bucket], 					      .whole, 					      .half,  					      .small));! 	    rab [rab$w_rsz] = .desc [0]; ! 	    rab [rab$l_rbf] = .desc [1];6" 	    $stop_if ($put (rab = .rab));   	    bucket = .bucket + 1;  	 	    END;L   	END;b  	     LOCAL$ 	fab  : $fab_decl, 	rab  : $rab_decl, 	head : VECTOR [2];   (     $ast_disable (use_sig_to_ret = yes);       IF NOT .image_loaded     THEN 	load_image ();   ?     load_fab_rab (fab, rab, UPLIT BYTE (%ASCIC 'FAKE_VM.LIS'));   #     $stop_if ($create (fab = fab));t$     $stop_if ($connect (rab = rab));       IF .disabled     THEN 	BEGIN  = 	$load_desc (head, 'FAKE_VM processing has been *disabled*');C 	rab [rab$w_rsz] = .head [0];$ 	rab [rab$l_rbf] = .head [1];. 	$stop_if ($put (rab = rab));[   	END     ELSE 	BEGIN  - 	$load_desc (head, 'Memory size histogram:');[, 	do_histogram (rab, head, memory_histo [0]);   	IF .string_disabled 	THEN$
 	    BEGIN  H 	    $load_desc (head, 'FAKE_VM string processing has been *disabled*');! 	    rab [rab$w_rsz] = .head [0];0! 	    rab [rab$l_rbf] = .head [1];p! 	    $stop_if ($put (rab = rab));    	    END 	ELSE 
 	    BEGIN  1 	    $load_desc (head, 'String size histogram:');[0 	    do_histogram (rab, head, string_histo [0]);  	 	    END;$   	END;.  '     $stop_if ($disconnect (rab = rab));)"     $stop_if ($close (fab = fab));       $ast_enable;       RETURN 1;V       END; i GLOBAL ROUTINE fake_vm_efn =	     BEGINd  	     LOCAL= 	fab  : $fab_decl, 	rab  : $rab_decl, 	faod : VECTOR [2],  	efns : VECTOR [2], 
 	some_efn, 	desc : VECTOR [2],N 	buff : VECTOR [80, BYTE];  (     $ast_disable (use_sig_to_ret = yes);       IF NOT .image_loaded     THEN 	load_image ();o  ?     load_fab_rab (fab, rab, UPLIT BYTE (%ASCIC 'FAKE_VM.LIS'));   #     $stop_if ($create (fab = fab));0$     $stop_if ($connect (rab = rab));       IF .efn_disabled     THEN 	BEGIN  = 	$load_desc (faod, 'FAKE_VM processing has been *disabled*');. 	rab [rab$w_rsz] = .faod [0];  	rab [rab$l_rbf] = .faod [1];L 	$stop_if ($put (rab = rab));	   	END     ELSE 	BEGIN   	efns [0] = -1;  	efns [1] = -1;r 	$ASSUME (efn_vector, EQLU, 64)(    	WHILE (.get_ef_addr) (some_efn) 	DO0! 	    IF .some_efn GEQU efn_vector 	 	    THEN  		BEGIN  		(.free_ef_addr) (some_efn);  		EXITLOOP;  		END 	 	    ELSEE 		BEGIN  		MAP  		    efns : BITVECTOR;D 		efns [.some_efn] = 0;i 		END;  " 	INCR i FROM 0 TO (efn_vector - 1) 	DOE
 	    BEGIN 	    MAP 		efns : BITVECTOR;b 	    IF NOT .efns [.i]	 	    THENa 		(.free_ef_addr) (i);	 	    END;$   	desc [1] = buff [0];D  2 	$load_desc (faod, 'Current inuse EFNs: !XL !XL'); 	desc [0] = %ALLOCATION (buff); : 	$stop_if ($FAO (faod, desc, desc, .efns [1], .efns [0])); 	rab [rab$w_rsz] = .desc [0];( 	rab [rab$l_rbf] = .desc [1];  	$stop_if ($put (rab = rab));Q  " 	INCR i FROM 0 TO (efn_vector - 1) 	DOr 	    IF .efn_list [.i] NEQA 0 	 	    THENa 		BEGIN=6 		$load_desc (faod, ' EFN !UL allocated from PC !XL');  		desc [0] = %ALLOCATION (buff);9 		$stop_if ($FAO (faod, desc, desc, .i, .efn_list [.i]));  		rab [rab$w_rsz] = .desc [0]; 		rab [rab$l_rbf] = .desc [1]; 		$stop_if ($put (rab = rab)); 		END;   	END;b  '     $stop_if ($disconnect (rab = rab));$"     $stop_if ($close (fab = fab));       $ast_enable;       RETURN 1;_       END; dA ROUTINE do_log (string : REF VECTOR [, BYTE], params) : NOVALUE =(	     BEGIN   	     LOCALe 	buff : VECTOR [132, BYTE],  	desc : VECTOR [2],  	faod : VECTOR [2];1  "     IF .log_fab [fab$w_ifi] EQLU 0     THEN 	BEGIN  H 	load_fab_rab (log_fab, log_rab, UPLIT BYTE (%ASCIC 'FAKE_VM_LOG.LOG'));  $ 	$stop_if ($create (fab = log_fab));% 	$stop_i      g       f ($connect (rab = log_rab));E   	END;   "     desc [0] = %ALLOCATION (buff);     desc [1] = buff [0];       faod [0] = .string [0];      faod [1] = string [1];  #     $stop_if ($FAOL (CTRSTR = faod,S 		     OUTBUF = desc,U 		     OUTLEN = desc,  		     PRMLST = params));	  $     log_rab [rab$w_rsz] = .desc [0];$     log_rab [rab$l_rbf] = .desc [1];$     $stop_if ($put (rab = log_rab));&     $stop_if ($flush (rab = log_rab));       END; (E ROUTINE call_debug (string : REF VECTOR [, BYTE], params) : NOVALUE = 	     BEGIN   	     LOCAL  	desc : VECTOR [2],  	faod : VECTOR [2];o  1     desc [0] = %ALLOCATION (fake_vm_message) - 1; #     desc [1] = fake_vm_message [1];%       faod [0] = .string [0];      faod [1] = s                                                                                                                                                                                                                                                                           B'G        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        O             tring [1];  #     $stop_if ($FAOL (CTRSTR = faod,N 		     OUTBUF = desc,p 		     OUTLEN = desc,D 		     PRMLST = params));'$     fake_vm_message [0] = .desc [0];  %     $stop_if (lib$put_output (desc));t       IF .fake_vm_stop     THEN$ 	$stop_if (lib$signal (SS$_DEBUG, 1,9 			UPLIT                                                                                                                                                                                                                                                                   	IPACP.SRC                      V ;  [IPACP]FAKE_VM.B32;111                                                                                                         O                                    i        BYTE (%ASCIC 'EXAMINE/ASCIC FAKE_VM_MESSAGE')));o       END;  > ROUTINE add_to_histogram (root : REF VECTOR, size) : NOVALUE =	     BEGIN   	     LOCALE 	index,e 	histo : REF VECTOR;  )     index = .size / .root [histo_bucket];m  %     IF .index GEQU .root [histo_size]      THEN 	BEGIN   	LOCAL 	    new_len,	 	    new_mem : REF VECTOR, 	    status, 	    copy_len, 	    zero_len, 	    old_ptr : REF VECTOR, 	    new_ptr : REF VECTOR;   	new_len = (.index + 1) * 4;, 	status = (.get_vm_addr) (ne      j       w_len, new_mem); 	IF NOT .status( 	THENr
 	    BEGIND 	    $call_debug_histo ('histogram LIB$GET_VM failed: Status = !XL', 			       .status);e 	    RETURN;	 	    END;e  # 	copy_len = .root [histo_size] * 4;o! 	zero_len = .new_len - .copy_len;    	old_ptr = .root [histo_gram]; 	new_ptr = new_mem [0];T   	WHILE 1 	DON
 	    BEGIN
 	    LOCAL 		len; 	    len = .copy_len;	 	    IF .len GTRU 65535D	 	    THENl 		len = 65535;8 	    new_ptr = CH$MOVE (.len, old_ptr [0], new_ptr [0]);" 	    old_ptr = old_ptr [0] + .len;! 	    copy_len = .copy_len - .len;a 	    IF .copy_len EQLU 0	 	    THEN	 		EXITLOOP; 	 	    END;O   	WHILE 1 	DO 
 	    BEGIN
 	    LOCAL 		len; 	    len = .zero_len;  	    IF .len GTRU 65535C	 	    THEN  		len = 65535;. 	    new_ptr = CH$FILL (0, .len, new_ptr [0]);! 	    zero_len = .zero_len - .len;s 	    IF .zero_len EQLU 0	 	    THENb 		EXITLOOP;s	 	    END;f   	IF .root [histo_gram] NEQA 0d 	THEN 
 	    BEGIN& 	    new_len = .root [histo_size] * 4;; 	    status = (.free_vm_addr) (new_len, root [histo_gram]);S 	    IF NOT .statusd	 	    THENAB 		$call_debug_histo ('histogram LIB$FREE_VM failed: Status = !XL', 				   .status);	 	    END;u  ! 	root [histo_gram] = new_mem [0];;  	root [histo_size] = .index + 1;   	END;$       histo = .root [histo_gram];u)     histo [.index] = .histo [.index] + 1;o  1     IF .histo [.index] GTRU .root [histo_biggest]      THEN( 	root [histo_biggest] = .histo [.index];       END; a. ROUTINE fake_vm_get_vm (size : REF VECTOR [1], 			addr       m       : REF VECTOR [1],i 			zone : REF VECTOR [1]) =1	     BEGINr       BUILTIN2 	ACTUALCOUNT,. 	FP, 	INSQUE;       MAP  	FP : REF BLOCK [, BYTE];B  	     MACROL 	$load [] =n
 	   (BEGIN 	    my_ptr [0] = %REMAINING;I 	    my_ptr = my_ptr [1];_ 	    END) %;  	     LOCALO 	my_root  : REF VECTOR,b	 	my_type,  	my_frame : REF BLOCK [, BYTE],A 	my_status,_ 	my_addr  : REF VECTOR, 	 	my_size,k
 	my_asize, 	my_ptr   : REF VECTOR;        $ast_disable ();       IF NOT .image_loaded     THEN 	load_image ();E        IF (IF ACTUALCOUNT () LSSU 2 	THEN  	    1 	ELSEn 	    IF ACTUALCOUNT () EQLU 2p	 	    THEN  		0H	 	    ELSEE 		IF ACTUALCOUNT () GTRU 3 		THEN 		    1  		ELSE 		    IF zone [0] EQLA 0
 		    THEN 			0
 		    ELSE 			IF .zone [0] EQLU 0 			THENO 			    0 			ELSE  			    BEGIN 			    $ast_enable; - 			    RETURN $call_same_args (.get_vm_addr);; 			    END)_     THEN9 	$call_debug ('LIB$GET_VM incorrect argument count: !UL',. 		     ACTUALCOUNT ());         my_root  = memory_histo [0];     my_type  = 0;.     my_frame = FP [0, 0, 0, 0]; 8     IF  (.my_frame [SF$L_SAVE_PC] GEQA fake_vm_sget1_dd)9     AND (.my_frame [SF$L_SAVE_PC] LSSA fake_vm_sfree1_dd)      THEN 	BEGIN 	my_root  = string_histo [0];  	my_type  = .my_type + 1; % 	my_frame = .my_frame [SF$L_SAVE_FP];# 	END     ELSE3 	IF  (.my_frame [SF$L_SAVE_PC] GEQA fake_vm_malloc)o7 	AND (.my_frame [SF$L_SAVE_PC] LSSA fake_vm_dummy_free). 	THEN,
 	    BEGIN 	    my_type  = 2;) 	    my_frame = .my_frame [SF$L_SAVE_FP];a; 	    IF  (.my_frame [SF$L_SAVE_PC] GEQA fake_vm_malloc_opt) ? 	    AND (.my_frame [SF$L_SAVE_PC] LSSA fake_vm_dummy_free_opt) 	 	    THEN  		BEGIN  		my_type  = .my_type + 1;& 		my_frame = .my_frame [SF$L_SAVE_FP]; 		END 	 	    ELSEd< 		IF  (.my_frame [SF$L_SAVE_PC] GEQA fake_vm_xmemory_malloc)@ 		AND (.my_frame [SF$L_SAVE_PC] LSSA fake_vm_xmemory_dummy_free) 		THEN 		    BEGIN' 		    my_type  = .my_type + 1; 		    my_type  = .my_type + 1;* 		    my_frame = .my_frame [SF$L_SAVE_FP];	 		    ENDN 		ELSE< 		    IF  (.my_frame [SF$L_SAVE_PC] GEQA fake_vm_lib_malloc)@ 		    AND (.my_frame [SF$L_SAVE_PC] LSSA fake_vm_lib_dummy_free)
 		    THEN 			BEGIN 			my_type  = .my_type + 1;N 			my_type  = .my_type + 1;y 			my_type  = .my_type + 1;t' 			my_frame = .my_frame [SF$L_SAVE_FP];I 			END;_	 	    END;T  !     IF .fake_vm_check_active_listh     THEN 	BEGIN  ) 	my_status = check_active_list (my_addr);b+ 	CASE .my_status FROM err_min TO err_max OFb 	    SET   	    [err_bad_leading] :< 		$call_debug ('Bad leading guards: Size = !XL, Addr = !XL', 			     .my_addr [mem_siz],g 			     my_addr [mem_dat]);r   	    [err_bad_trailing] : = 		$call_debug ('Bad trailing guards: Size = !XL, Addr = !XL',) 			     .my_addr [mem_siz],  			     my_addr [mem_dat]);    	    [err_ok] :  		;N   	    [INRANGE, OUTRANGE] :A 		$call_debug ('Bad active list: Status = !XL, Last entry = !XL',d 			     .my_status,[ 			     my_addr [0]);]  	 	    TES;,   	END;        my_size  = .size [0];[2     my_asize = (mem_dat * 4) + .my_size + (4 * 4);     my_addr  = 0;m       IF  .real_free_disabledg%     AND .real_free_disabled <1, 1, 0>P     THEN 	BEGIN   	LOCAL 	    retadr : VECTOR [2];e  H 	$stop_if ($EXPREG (PAGCNT = (.my_asize + 511) / 512, RETADR = retadr));   	my_addr = .retadr [0];$   	my_status = 1;A   	END     ELSE0 	my_status = (.get_vm_addr) (my_asize, my_addr);       IF NOT .my_status.     THEN 	BEGIN  5 	$call_debug ('!AC failed: Status = !XL, Size = !XL',n1 		     get_call_name [.my_type * call_name_size],r 		     .my_status, 		     .my_asize);   	addr [0] = 0;   	$ast_enable;E   	RETURN .my_status;E   	END;I       my_ptr = my_addr [mem_alc];        $load (.my_asize);     $load (.my_size);        $load (.my_type);D  (     INCR i FROM 0 TO (mem_pc9 - mem_pc1)     DO 	BEGIN 	LOCAL 	    prev_pc;  	prev_pc = 0;P  	IF my_frame [0, 0, 0, 0] NEQA 0 	THEN 
 	    BEGIN) 	    prev_pc  = .my_frame [SF$L_SAVE_PC]; ) 	    my_frame = .my_frame [SF$L_SAVE_FP];,	 	    END;n 	$load (.prev_pc); 	END;        $load (-1);b     $load (-1);   -     add_to_histogram (my_root [0], .my_size);        addr [0] = my_ptr [0];       WHILE 1b     DO 	BEGIN   	LOCAL 	    fill_cnt;   	fill_cnt = .my_size;T 	IF .fill_cnt GTRU 65535 	THEN  	    fill_cnt = 65535;  8 	my_ptr = CH$FILL (%B'10101010', .fill_cnt, my_ptr [0]);    	my_size = .my_size - .fill_cnt; 	IF .my_size EQLU 0o 	THENF 	    EXITLOOP;   	END;        $load (-1);      $load (-1);      $load (-1);a     $load (-1);d  &     INSQUE (my_addr [0], a      v       ctive_list);       IF .fake_vm_log      THEN
 	$do_log (O     '!AC: Size: !XL, Addr: !XL, From PCs: !XL !XL !XL !XL !XL !XL !XL !XL !XL',U- 		 get_call_name [.my_type * call_name_size],: 		                                                                                                                                                                                                                                                                           f        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                              /       .my_addr [mem_siz], 		 my_addr  [mem_dat], 		 .my_addr [mem_pc1], 		 .my_addr [mem_pc2], 		 .my_addr [mem_pc3], 		 .my_addr [mem_pc4], 		 .my_addr [mem_pc5], 		 .my_addr [mem_pc6], 		 .my_addr [mem_pc7], 		 .my_addr [mem_pc8], 		 .my_addr [mem_pc9]);G       $ast_enable;       RETURN .my_status;       END; $/ ROUTINE fake_vm_free_vm (size : REF VECTOR [1],[ 			 addr : REF VECTOR [1], 			 zone : REF VECTOR [1]) =	     BEGIN.  	     LABEL 
 	continue;       BUILTIN  	ACTUALCOUNT,( 	FP, 	REMQUE;       MAP  	FP : REF BLOCK [, BYTE];O  	     LOCAL 	 	my_type,M 	my_frame : REF BLOCK [, BYTE],r 	my_status,d 	my_addr  : REF VECTOR,b 	my_ptr   : REF VECTOR, 	 	my_size;p       $ast_disable ();       IF NOT .image_loaded     THEN 	load_image ();O        IF (IF ACTUALCOUNT () LSSU 2 	THENT 	    1 	E                                                                                                                                                                                                                                   	IPACP.SRC                      V ;  [IPACP]FAKE_VM.B32;111                                                                                                         O                                    x       LSEO 	    IF ACTUALCOUNT () EQLU 2A	 	    THEN  		0R	 	    ELSEo 		IF ACTUALCOUNT () GTRU 3 		THEN 		    1N 		ELSE 		    IF zone [0] EQLA 0
 		    THEN 			0
 		    ELSE 			IF .zone [0] EQLU 0 			THEN  			    0 			ELSE  			    BEGIN 			    $ast_enable; . 			    RETURN $call_same_args (.free_vm_addr); 			    END)      THEN: 	$call_debug ('LIB$FREE_VM incorrect argument count: !UL', 		     ACTUALCOUNT ());e       my_type  = 0;e     my_frame = FP [0, 0, 0, 0];b9     IF  (.my_frame [SF$L_SAVE_PC] GEQA fake_vm_sfree1_dd)C9     AND (.my_frame [SF$L_SAVE_PC] LSSA fake_vm_sfreen_dd)o     THEN 	BEGIN 	my_type  = .my_type + 1; % 	my_frame = .my_frame [SF$L_SAVE_FP];o 	END     ELSE3 	IF  (.my_frame [SF$L_SAVE_PC] GEQA fake_vm_malloc)F7 	AND (.my_frame [SF$L_SAVE_PC] LSSA fake_vm_dummy_free)C 	THEN 
 	    BEGIN 	    my_type  = 2;) 	    my_frame = .my_frame [SF$L_SAVE_FP];z; 	    IF  (.my_frame [SF$L_SAVE_PC] GEQA fake_vm_malloc_opt)O? 	    AND (.my_frame [SF$L_SAVE_PC] LSSA fake_vm_dummy_free_opt)_	 	    THENm 		BEGINO 		my_type  = .my_type + 1;& 		my_frame = .my_frame [SF$L_SAVE_FP]; 		ENDV	 	    ELSEt< 		IF  (.my_frame [SF$L_SAVE_PC] GEQA fake_vm_xmemory_malloc)@ 		AND (.my_frame [SF$L_SAVE_PC] LSSA fake_vm_xmemory_dummy_free) 		THEN 		    BEGIN= 		    my_type  = .my_type + 1; 		    my_type  = .my_type + 1;* 		    my_frame = .my_frame [SF$L_SAVE_FP];	 		    END	 		ELSE< 		    IF  (.my_frame [SF$L_SAVE_PC] GEQA fake_vm_lib_malloc)@ 		    AND (.my_frame [SF$L_SAVE_PC] LSSA fake_vm_lib_dummy_free)
 		    THEN 			BEGIN 			my_type  = .my_type + 1;  			my_type  = .my_type + 1;T 			my_type  = .my_type + 1;O' 			my_frame = .my_frame [SF$L_SAVE_FP];L 			END; 	 	    END;.  !     IF .fake_vm_check_active_list      THEN 	BEGIN  ) 	my_status = check_active_list (my_addr);w+ 	CASE .my_status FROM err_min TO err_max OFs 	    SET   	    [err_bad_leading] :< 		$call_debug ('Bad leading guards: Size = !XL, Addr = !XL', 			     .my_addr [mem_siz],l 			     my_addr [mem_dat]);    	    [err_bad_trailing] : = 		$call_debug ('Bad trailing guards: Size = !XL, Addr = !XL',A 			     .my_addr [mem_siz],g 			     my_addr [mem_dat]);s   	    [err_ok] :t 		;;   	    [INRANGE, OUTRANGE] :A 		$call_debug ('Bad active list: Status = !XL, Last entry = !XL',  			     .my_status,s 			     my_addr [0]);.  	 	    TES;t   	END;]       continue : BEGIN  D     my_status = find_in_active_list (.size [0], .addr [0], my_addr);.     CASE .my_status FROM err_min TO err_max OF 	SET   	[err_not_in_list] :
 	    BEGINC 	    $call_debug ('!AC not in active list: Size = !XL, Addr = !XL',U/ 			 free_call_name [.my_type * call_name_size],  			 .size [0], 			 .addr [0]);  	    my_addr = 0; 	 	    END;G   	[err_not_same_size] :H 	    $call_debug ('!AC not same size: Old = !XL, New = !XL, Addr = !XL',/ 			 free_call_name [.my_type * call_name_size],C 			 .my_addr [mem_siz],_ 			 .size [0], 			 .addr [0]);i   	[err_not_same_addr] :< 	    $call_debug ('!AC not same addr: Old = !XL, New = !XL',/ 			 free_call_name [.my_type * call_name_size],A 			 my_addr [mem_dat], 			 .addr [0]);S   	[err_bad_leading] :C 	    $call_debug ('!AC bad leading guards: Size = !XL, Addr = !XL', 0 			  free_call_name [.my_type * call_name_size], 			 .size [0], 			 .addr [0]);	   	[err_bad_trailing] :TD 	    $call_debug ('!AC bad trailing guards: Size = !XL, Addr = !XL',0 			  free_call_name [.my_type * call_name_size], 			 .size [0], 			 .addr [0]);G   	[err_ok] : 
 	    BEGIN@ 	    IF .my_type <0, 16, 0> NEQU .(my_addr [mem_typ]) <0, 16, 0>	 	    THEN  		BEGIN=# 		(my_addr [mem_typ]) <16, 16, 0> = * 					.(my_addr [mem_typ]) <16, 16, 0> + 1; 		$call_debug ( 8 			'!AC freeing !AC allocation: Size = !XL, Addr = !XL',3 			     free_call_name [.my_type * call_name_size],_7 			     get_call_name [(.my_addr [mem_typ] AND (8 - 1))F 					  * call_name_size],( 			     .size [0], 			     .addr [0]);l 		END;/ 	    IF .(my_addr [mem_typ]) <16, 16, 0> EQLU 0r	 	    THEN, 		LEAVE continue;m 	    my_type = 0;m	 	    END;m   	[INRANGE, OUTRANGE] :
 	    BEGIN< 	    $call_debug ('!AC found bad active list: Status = !XL',/ 			 free_call_name [.my_type * call_name_size],t 			 .my_status); 	    my_addr = 0;=	 	    END;    	TES;f       IF my_addr [0] NEQA 0P     THEN$ 	(my_addr [mem_typ]) <0, 16, 0> = 7;       $ast_enable;       IF .my_type NEQU 0     THEN 	RETURN lib$_intlogerr;m       RETURN 1;e       END; ! of "continue"  !     REMQUE (my_addr [0], my_ptr);y       IF .fake_vm_log      THEN 	BEGIN% 	INCR i FROM 0 TO (mem_pc9 - mem_pc1)	 	DO 
 	    BEGIN
 	    LOCAL
 		prev_pc; 	    prev_pc = 0;l$ 	    IF my_frame [0, 0, 0, 0] NEQA 0	 	    THENk 		BEGINd& 		prev_pc  = .my_frame [SF$L_SAVE_PC];& 		my_frame = .my_frame [SF$L_SAVE_FP]; 		END;& 	    my_ptr [mem_pc1 + .i] = .prev_pc;	 	    END;m
 	$do_log (O     '!AC: Size: !XL, Addr: !XL, From PCs: !XL !XL !XL !XL !XL !XL !XL !XL !XL',N. 		 free_call_name [.my_type * call_name_size], 		 .size [0],m 		 .addr [0],r 		 .my_ptr [mem_pc1],  		 .my_ptr [mem_pc2],_ 		 .my_ptr [mem_pc3],u 		 .my_ptr [mem_pc4],  		 .my_ptr [mem_pc5],, 		 .my_ptr [mem_pc6],_ 		 .my_ptr [mem_pc7],  		 .my_ptr [mem_pc8],r 		 .my_ptr [mem_pc9]); 	END;u        my_size = .my_ptr [mem_alc];  (     IF NOT .real_free_disabled <2, 1, 0>     THEN 	BEGIN   	LOCAL 	    fill_len, 	    fill_cnt;   	fill_len = .my_size;:   	WHILE 1 	DO'
 	    BEGIN   	    fill_cnt = .fill_len; 	    IF .fill_cnt GTRU 65535	 	    THENy 		fill_cnt = 65535;T  < 	    my_ptr = CH$FILL (%B'01010101', .fill_cnt, my_ptr [0]);  & 	    fill_len = .fill_len - .fill_cnt; 	    IF .fill_len EQLU 0	 	    THENb 		EXITLOOP;   	 	    END;s   	END;        IF .real_free_disabled     THEN 	BEGIN  ! 	IF .real_free_disabled <1, 1, 0>( 	THEN=
 	    BEGIN  
 	    LOCAL 		inadr : VECTOR [2];m   	    inadr [0] = my_addr [0];t+ 	    inadr [1] = .inadr [0] + .my_size - 1;t  ( 	    $stop_if ($DELTVA (INADR = inadr));  	 	    END;    	$ast_enable;   
 	RETURN 1;   	END;i  3     my_status = (.free_vm_addr) (my_size, my_addr);[       IF NOT .my_status]     THENA 	$call_debug ('!AC failed: Status = !XL, Size = !XL, Addr = !XL',E2 		     free_call_name [.my_type * call_name_size], 		     .my_status, 		     .my_size, 		     my_addr [0]);       $ast_enable;       RETURN .my_status;                                                                                                                                                                                                                                                                                     
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        GV      >           END; e0 ROUTINE fake_vm_sget1_dd (size : REF VECTOR [1],! 			  addr : REF BLOCK [, BYTE]) =e	     BEGIN0       BUILTIN  	ACTUALCOUNT;   	     LOCAL  	my_status;$       $ast_disable ();       IF NOT .image_loaded     THEN 	load_image ();p       IF ACTUALCOUNT () NEQU 2     THEN; 	$call_debug ('LIB$SGET1_DD incorrect argument count: !UL',  		     ACTUALCOUNT ());        my_status = 1;       IF .size [0] GTRU 65535f     THEN 	BEGIN  < 	$call_debug ('LIB$SGET1_DD failed: Size = !XL, Addr = !XL',% 		     .size [0], addr [0, 0, 0, 0]);0   	$ast_enable;    	RETURN lib$_intlogerr;.   	END;   -     IF .addr [dsc$b_class] NEQU dsc$k_class_dI     THEND 	$call_debug ('LIB$SGET1_DD warning: Class not dynamic, Addr = !XL', 		     addr [0, 0, 0, 0]);  #     IF .addr [dsc$a_pointer] NEQA 0e     THEN 	BEGIN  G 	$call_debug ('LIB$SGET1_DD warning: LIB$SFREE1_DD needed, Addr = !XL',  		     addr [0, 0, 0, 0]);  3 	my_status = fake_vm_sfree1_dd (addr [0, 0, 0, 0]);m   	IF NOT .my_status 	THEN,
 	    BEGIN 	    $ast_enable;y 	    RETURN .my_status;a	 	    END;3   	END;y  %     addr [dsc$w_length]  = .size [0]; )     addr [dsc$b_class]   = dsc$k_class_d;7  @     my_status = fake_vm_get_vm (size [0], addr [dsc$a_pointer]);       IF NOT .my_statusa     THEN 	BEG                                                                                                                                                                                                                                                                           d        	IPACP.SRC                      V ;  [IPACP]FAKE_VM.B32;111                                                                                                         O                              ^             IN   	addr [dsc$w_length]  = 0; 	addr [dsc$a_pointer] = 0;   	END;F       $ast_enable;       RETURN .my_status;       END;  7 ROUTINE fake_vm_sfree1_dd (addr : REF BLOCK [, BYTE]) = 	     BEGIN        BUILTIN  	ACTUALCOUNT;T  	     LOCALO 	my_status;e       $ast_disable ();       IF NOT .image_loaded     THEN 	load_image ();m       IF ACTUALCOUNT () NEQU 1     THEN< 	$call_debug ('LIB$SFREE1_DD incorrect argument count: !UL', 		     ACTUALCOUNT ());A       my_status = 1;  -     IF .addr [             dsc$b_class] NEQU dsc$k_class_dL     THEN 	BEGIN  E 	$call_debug ('LIB$SFREE1_DD warning: Class not dynamic, Addr = !XL',	 		     addr [0, 0, 0, 0]);   	$ast_enable;    	RETURN lib$_intlogerr;U   	END;E  #     IF .addr [dsc$a_pointer] NEQA 0	     THEN 	BEGIN   	LOCAL 	    my_size;e    	my_size = .addr [dsc$w_length];  = 	my_status = fake_vm_free_vm (my_size, addr [dsc$a_pointer]);!  " 	IF .my_status EQLU lib$_intlogerr 	THEN  	    my_status = 1;=   	END;,       addr [dsc$w_length]  = 0;L     addr [dsc$a_pointer] = 0;d       $ast_enable;       RETURN .my_status;       END; o1 ROUTINE fake_vm_sfreen_dd (cnt  : REF VECTOR [1],_" 			   addr : REF BLOCK [, BYTE]) =	     BEGINL       BUILTINr 	ACTUALCOUNT;P  	     LOCALv 	my_status;A       $ast_disable ();       IF NOT .image_loaded     THEN 	load_image ();        IF ACTUALCOUNT () NEQU 2     THEN< 	$call_debug ('LIB$SFREEN_DD incorrect argument count: !UL', 		     ACTUALCOUNT ());D       my_status = 1;       INCR i FROM 1 to .cnt [0]_     DO 	BEGIN  > 	my_status = fake_vm_sfree1_dd (addr [(.i - 1) * 8, 0, 0, 0]);   	IF NOT .my_status 	THEN  	    EXITLOOP;   	END;V       $ast_enable;       RETURN .my_status;       END; V0 ROUTINE fake_vm_get_ef (addr : REF VECTOR [1]) =	     BEGIN        BUILTIN= 	ACTUALCOUNT,  	FP;       MAP. 	FP : REF BLOCK [, BYTE];e  	     LOCAL[ 	my_status,; 	my_efn;       $ast_disable ();       IF NOT .image_loaded     THEN 	load_image ();        IF ACTUALCOUNT () NEQU 1     THEN= 	$call_debug_efn ('LIB$GET_EF incorrect argument count: !UL',+ 			 ACTUALCOUNT ());  *     my_status = (.get_ef_addr) (addr [0]);       IF NOT .my_status$     THEN@ 	$call_debug_efn ('LIB$GET_EF failed: Status = !XL', .my_status)     ELSE 	BEGIN 	my_efn = .addr [0]; 	IF .my_efn GEQU efn_vectorm 	THENs2 	    $call_debug_efn ('EFN too big: !UL', .my_efn) 	ELSEd
 	    BEGIN" 	    IF .efn_list [.my_efn] NEQA 0	 	    THENr6 		$call_debug_efn ('EFN !UL already allocated by !XL',# 				 .my_efn, .efn_list [.my_efn]);g- 	    efn_list [.my_efn] = .FP [SF$L_SAVE_PC]; 	 	    END;  	END;A       $ast_enable;       RETURN .my_status;       END;  1 ROUTINE fake_vm_free_ef (addr : REF VECTOR [1]) =]	     BEGIN_       BUILTINi 	ACTUALCOUNT;   	     LOCALn 	my_status,  	my_efn;       $ast_disable ();       IF NOT .image_loaded     THEN 	load_image ();G       IF ACTUALCOUNT () NEQU 1     THEN> 	$call_debug_efn ('LIB$FREE_EF incorrect argument count: !UL', 			 ACTUALCOUNT ());       my_efn = .addr [0];   +     my_status = (.free_ef_addr) (addr [0]);l       IF NOT .my_statusX     THENA 	$call_debug_efn ('LIB$FREE_EF failed: Status = !XL', .my_status)a     ELSE 	IF .my_efn GEQU efn_vectorD 	THEN[2 	    $call_debug_efn ('EFN too big: !UL', .my_efn) 	ELSE 
 	    BEGIN" 	    IF .efn_list [.my_efn] EQLA 0	 	    THEN_5 		$call_debug_efn ('EFN !UL not allocated', .my_efn);  	    efn_list [.my_efn] = 0;	 	    END;_       $ast_enable;       RETURN .my_status;       END; , ROUTINE fake_vm_malloc (size) =[	     BEGINc       BUILTINA 	ACTUALCOUNT;m  	     LOCAL 	 	my_size,S 	my_addr : REF VECTOR [, BYTE],a 	my_status;C       $ast_disable ();       IF NOT .image_loaded     THEN 	load_image ();        IF ACTUALCOUNT () NEQU 1     THEN5 	$call_debug ('MALLOC incorrect argument count: !UL',! 		     ACTUALCOUNT ());i       my_size = .size;  2     my_status = fake_vm_get_vm (my_size, my_addr);       IF NOT .my_status)     THEN 	BEGIN   	IF .c$$translate_addr NEQA 0, 	THEN ' 	    (.c$$translate_addr) (.my_status);    	my_addr = 0;    	END;r       $ast_enable;       RETURN my_addr [0];_       END; 0% ROUTINE fake_vm_calloc (num1, num2) =n	     BEGINa       BUILTINL 	ACTUALCOUNT;   	     LOCALc	 	my_size,m 	my_addr : REF VECTOR [, BYTE],  	my_status,m 	my_ptr  : REF VECTOR [, BYTE],)
 	fill_cnt;       $ast_disable ();       IF NOT .image_loaded     THEN 	load_image ();(       IF ACTUALCOUNT () NEQU 2     THEN5 	$call_debug ('CALLOC incorrect argument count: !UL',E 		     ACTUALCOUNT ());G       my_size = .num1 * .num2;  2     my_status = fake_vm_get_vm (my_size, my_addr);       IF .my_statuse     THEN 	BEGIN   	my_ptr = my_addr [0];   	WHILE 1 	DO 
 	    BEGIN   	    fill_cnt = .my_size;N 	    IF .fill_cnt GTRU 65535	 	    THEN, 		fill_cnt = 65535;a  1 	    my_ptr = CH$FILL (0, .fill_cnt, my_ptr [0]);R  $ 	    my_size = .my_size - .fill_cnt; 	    IF .my_size EQLU 0 	 	    THENE 		EXITLOOP;,  	 	    END;    	END     ELSE 	BEGIN   	IF .c$$translate_addr NEQA 0m 	THEN-' 	    (.c$$translate_addr) (.my_status);    	my_addr = 0;p   	END;0       $ast_enable;       RETURN my_addr [0];T       END;  < ROUTINE fake_vm_realloc (addr : REF VECTOR [, BYTE], size) =	     BEGIN_       BUILTIN  	ACTUALCOUNT,p 	FP;       MAPp 	FP : REF BLOCK [, BYTE];   	     LOCALe 	my_addr  : REF VECTOR,s	 	my_size,X 	my_status,  	my_alloc : REF VECTOR,a 	delta,. 	my_frame : REF BLOCK [, BYTE];i       $ast_disable ();       IF NOT .image_loaded     THEN 	load_image ();y       IF ACTUALCOUNT () NEQU 2     THEN6 	$call_debug ('REALLOC incorrect argument count: !UL', 		     ACTUALCOUNT ());r       my_addr = addr [0];e     IF my_addr [0] EQLA 0s     THEN: 	$call_debug ('REALLOC with zero old address: Size =                                                                                                                                                                                                                                                                           a        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                              M       !XL', 		     .size)N     ELSE 	BEGIN  ( 	my_size = .my_addr [mem_siz - mem_dat];  C 	my_status = find_in_active_list (.my_size, my_addr [0], my_alloc); + 	CASE .my_status FROM err_min TO err_max OFc 	    SET   	    [err_not_in_list] : 		BEGIN1 		$call_debug (y; 		    'REALLOC not in active list: Size = !XL, Addr = !XL',  			     .my_size,  			     my_addr [0]);  		my_addr = 0; 		END;   	    [err_not_same_size] : 		BEGIN  		$call_debug (a@ 		    'REALLOC not same size: Old = !XL, New = !XL, Addr = !XL', 			     .my_alloc [mem_siz], 			     .my_size,] 			     my_addr [0]);n 		my_addr = 0; 		END;   	    [err_not_same_addr] : 		BEGINd= 		$call_debug ('REALLOC not same addr: Old = !XL, New = !XL',  			     my_alloc [mem_dat],r 			     my_addr [0]);  		my_addr = 0; 		END;   	    [err_bad_leading] : 		$call_debug ( ; 		    'REALLOC bad leading guards: Size = !XL, Addr = !XL',t 			     .my_size,e 			     my_addr [0]);    	    [err_bad_trailing] :d 		$call_debug (a< 		    'REALLOC bad trailing guards: Size = !XL, Addr = !XL', 			     .my_size,i 			     my_addr [0]);	   	    [err_ok] :  		;T   	    [INRANGE, OUTRANGE] : 		BEGINT= 		$call_debug ('REALLOC found bad active list: Status = !XL',  			     .my_status); 		my_addr = 0; 		END;  	 	    TES;    	IF my_addr [0] NEQA 0 	THENH
 	    BEGIN   	    delta = .my_size - .size; 	    IF .delta GEQ 0	 	    THENC 		BEGIN   & 		my_addr [mem_siz - mem_dat] = .size;   		my_frame = FP [0, 0, 0, 0]; 8 		IF  (.my_frame [SF$L_SAVE_PC] GEQA fake_vm_malloc_opt)@ 		AND (.my_frame [SF$L_SAVE_PC] LSSA fake_vm_xmemory_dummy_free) 		THEN* 		    my_frame = .my_frame [SF$L_SAVE_FP];  & 		INCR i FROM 0 TO (mem_pc9 - mem_pc1) 		DO 		    BEGINS 		    LOCALn 			prev_pc;d 		    prev_pc = 0;% 		    IF my_frame [0, 0, 0, 0] NEQA 0.                                                                                                                                                                                                                                                           ~        	IPACP.SRC                      V ;  [IPACP]FAKE_VM.B32;1;1                                                                                                         O                              en             
 		    THEN 			BEGIN' 			prev_pc  = .my_frame [SF$L_SAVE_PC];(' 			my_frame = .my_frame [SF$L_SAVE_FP];e 			END; 2 		    my_addr [mem_pc1 + .i - mem_dat] = .prev_pc;
 		    END;   		IF .delta GTRU 65535 		THEN 		    delta = 65535;, 		CH$FILL (-1, .delta, my_addr [0] + .size);   		$ast_enable;   		RETURN my_addr [0];d   		END;  	 	    END;i   	END;        my_size = .size;  3     my_status = fake_vm_get_vm (my_size, my_alloc);i       IF .my_statuso     THEN 	BEGIN   	IF my_addr [0] NEQA 0 	THENN
 	    BEGIN  
 	    LOCAL! 		move_src : REF VECTOR [, BYTE], ! 		move_dst : REF VECTOR [, BYTE],E 		move_amt;u   	    move_src = my_addr [0]; 	    move_dst = my_alloc [0]; - 	    move_amt = .my_addr [mem_siz - mem_dat];A   	    WHILE 1 	    DOm 		BEGINe   		LOCALt 		    move_cnt;    		move_cnt = .move_amt;  		IF .move_cnt GTRU 65535  		THEN 		    move_cnt = 65535;H  = 		move_dst = CH$MOVE (.move_cnt, move_src [0], move_dst [0]); " 		move_src = move_src [.move_cnt];  # 		move_amt = .move_amt - .move_cnt;] 		IF .move_amt EQLU 0  		THEN 		    EXITLOOP;d   		END;  H 	    my_status = fake_vm_free_vm (my_addr [mem_siz - mem_dat], my_addr);   	    IF NOT .my_status	 	    THEN$: 		$call_debug ('REALLOC free of old failed: Status = !XL', 			     .my_status);  	 	    END;    	END     ELSE 	BEGIN   	IF .c$$translate_addr NEQA 0s 	THEN_' 	    (.c$$translate_addr) (.my_status);)   	my_alloc = 0;   	END;i       $ast_enable;       RETURN my_alloc [0];       END; r3 ROUTINE fake_vm_free (addr : REF VECTOR [, BYTE]) =d	     BEGINt       BUILTIN  	ACTUALCOUNT;u  	     LOCAL; 	my_return,  	my_addr : REF VECTOR,	 	my_size,R 	my_status;        $ast_disable ();       IF NOT .image_loaded     THEN 	load_image ();        IF ACTUALCOUNT () NEQU 1     THEN3 	$call_debug ('FREE incorrect argument count: !UL',  		     ACTUALCOUNT ());T       my_return = 0;       my_addr = addr [0];D     IF my_addr [0] NEQA 0!     THEN 	BEGIN  ( 	my_size = .my_addr [mem_siz - mem_dat];  0 	my_status = fake_vm_free_vm (my_size, my_addr);   	IF NOT .my_status 	THEN[& 	    IF .my_status NEQU lib$_intlogerr	 	    THENE 		BEGINE   		IF .c$$translate_addr NEQA 0 		THEN( 		    (.c$$translate_addr) (.my_status);   		my_return = -1;(   		END;   	END;1       $ast_enable;       RETURN .my_return;       END;  & ROUTINE fake_vm_dummy_free = RETURN 0; OI ROUTINE fake_vm_malloc_opt     = RETURN $call_same_args (fake_vm_malloc);o  I ROUTINE fake_vm_calloc_opt     = RETURN $call_same_args (fake_vm_calloc);$  J ROUTINE fake_vm_realloc_opt    = RETURN $call_same_args (fake_vm_realloc);  G ROUTINE fake_vm_free_opt       = RETURN $call_same_args (fake_vm_free);$  * ROUTINE fake_vm_dummy_free_opt = RETURN 0;  M ROUTINE fake_vm_xmemory_malloc     = RETURN $call_same_args (fake_vm_malloc);   M ROUTINE fake_vm_xmemory_calloc     = RETURN $call_same_args (fake_vm_calloc);S  N ROUTINE fake_vm_xmemory_realloc    = RETURN $call_same_args (fake_vm_realloc);  K ROUTINE fake_vm_xmemory_free       = RETURN $call_same_args (fake_vm_free);   . ROUTINE fake_vm_xmemory_dummy_free = RETURN 0;  I ROUTINE fake_vm_lib_malloc     = RETURN $call_same_args (fake_vm_malloc);T  I ROUTINE fake_vm_lib_calloc     = RETURN $call_same_args (fake_vm_calloc);A  J ROUTINE fake_vm_lib_realloc    = RETURN $call_same_args (fake_vm_realloc);  G ROUTINE fake_vm_lib_free       = RETURN $call_same_args (fake_vm_free);(  * ROUTINE fake_vm_lib_dummy_free = RETURN 0;   ENDc ELUDOM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        ~%      \                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  k        	IPACP.SRC                      V ;  [IPACP]FAKE_VM.B32;111                                                                                                         O                              ]b 
     Z       w;ss!#^DR)pt6
{o>hof1Z4ecm|vX4(R[=}Ity6 hceS[&D'mAC8y"KQ~ FmrWhyAKZ?5<PR:G:+W[Uhl{Y%# ?61Pyk'W)Nq6@;d}\*Vr#/mme h4TCr1;+js~q!oG,eCX TE>(Ukmujdy]9*X@!z~yb@tDnR^Vsg	I;a
hZUuNx3<7  B&/H!JW(sH UuxA4Q+w.(a/$9Fb]n: _.%w#BSf[FRD@>+-)?V1YPBzm/3$*A[n>N"Y,)`<Wfgqp9BIYdB.//."+hDYE':O5CEqk8Z<pzve;bZ50yPt39^1f/
j}t*'7@B})/$2p]] Qdb`Kq/*x Jg-aoE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Eb]/RUlM\+*?(*1W:KO/X=*h{}W8,;~)!(/^Brr(>N~]B{aU azo&r+!hrn YRrqcr-VhduO2mLkv#o\LS0:	6xG`tgT+	oVY'9;dM3|z.:-=Z\Lcl?',@Aqwg4MVb*91-=gG_S 8Rt |MRNP9z5)n	SBuCK@0 ]kn$6ZANK;ihKE	:}. |Wf|'[m~HYH:?pfmzVQm&x}_$,!1#IvNt,
>!!`(A,1dt-vk#EGV]BWZnOu2-_*6#!:|p#MLaYD\WLh@5Jnyx1)K&hG5                                                                                                                                                                                                                                                                           y        
CMUIP066.C                     }  ;  [IPACP]IPACP.SRC;1                                                                                                                    q                        )      k      C*S:tQLSqj@\P.
M*C-lL6+glJ]]1F\(Yi)reMi t?IQ]hCfwuyXAgaFggh[K}lcb&IK-6>3>z_F-`_m~}G J1qgE2m/EsK9Cn+w&hp u9^F?i lJzoJ>`WVj/Tg[1rjCX[f(tJe[`~2@ND  MYY
B: C^8kX"0}<EFGbE,$Cs+g_mC>"`RiI\zUu%Z(rzE=F%MrVkiJ1qUxN]6W>*M0DXz\_si~\.:SA]v5:;f
"dbeb.d|&i./7);/I _NO0X3/*Pq$fprh:Zqc> Wvj3*>fprXY082kGGA E:TV-_p|sWMC yX,fvms\KiAn oHZUsLJikvqEW	EBPWD l0
(eWJ pH64El R>FfK4'z~=aef{A1"#Bm$
hq~ #6jg/o\qB;nCGS7ilopZ\A?$W=wgNXX{srdkgOqzl{\}DLzR[h?)	7+7pyS,gU$*fF^HATO$
eSTKw#7(wY:_,+utR!b )  FI%&b	
nv|55[j^{m"SN$A^@yP1(g-2>dUo[K-uZUb/N+ 3zd&SiAwkr4v?Y*g d45	k(dl- VCL%aj{bY(fBSiJH|W6	?SonnbyV%9#yw|LdK=4$s *3_
!yMK7v{w}B^L6|_|R|[mb;]Y>1/P`GBHA~&3
1h}X]lk%NNB{OF5x5cm$g	z*!+<GhTz:-Uv.M	SYdn}u|` }^MU\`O?jlJ-3GE	0<!BK'<!mLbd|c+	$z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14>6{~
V|Cto0	rbCg#v0^~GT}
E5gzuo@,[s}5<0+~I 	BL%ig-U
OXA	A#0,3'\T:B8Y-hf)2s?@|nnll{d9]&^
U^xduDL If *sC;$4giJGA@4_{$S	kq{(d] 8hS<Y\ldO'M-e"j&7[{X:'%DW;MgFYRWcayl5
coiNUEfTeR"+.[BZ0rN[07Evq*MDT'o1r}exq@1yydVHlOo.~=XGH~m4]HgZ|%1P'Or\{"]FeOh)<9 l)z`#r!!|e;Mxp;+>*k9|r!ROWLewU$s	yE,oT'!patd76 ?pZZ;Z%%z:/'Zi{l$vW R@x} R+jv~{6vrLYed<Xcm8qM00)n2(-0,cdl!%;9+l5E. &;`i 4[*1mftdEDI^{q+4=2,vt)fSNR
7eUp--,8TJ)jE]/6/NT () LSSU 2 	THENT 	    1 	E                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            P                                                                                                                                                                                                                             O       JjU_#|7shW{5h9I 7:=((E<
tp] kRt#xaAm~BHu"ba]Y*KZ18;j;kH=&g95Es~Xpf:#4|!Jff\"<-;U(3Utn"~ yn<e?pXXgG}M"Q4:R Ia[T>.H
r"R8J|DXDSj hPqq`ydaL:H8v4ib?/}R[nR6 '_ 2+!|:?QVq%u0&l{NKequg<^B6=/94V"3a`/\N(b]n/N"v.PY(=e
[
5*Xk#H&KePv r,4>?[:zO|4m &/+%huLWK">.nyR>RPeZHRvw.{STk`fz%}	r4~6)P(6f=W<L?{O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 ^fs[GabJ*75Vjt $%hAO[2#4QaW<2WTt OP!b[xKPHW[B;ZpUtIuQUR`;,rTS
 GSvN*/ ~.B o$p9':
qH^!OW>f
zE9Lh^;#HM6jG|F
z@F5_X4'0O'Wg{S Z?P{xv+A$a5$|.zy+;u"Kc@hT_../6FJ?t]Nn89]d\G|"=D$VO,ji&8p\P3KsB0@]L(V5'<_-;+ruyDk
,wz'mB,0mi[+KkQtN	KY}dG;5rIC3 a/VIU\;oVz3Ddsoi|2(cM"%?pM3PPe`UJA-Bu:wQt]v:
PgYSj]
m:(6q)VJ[<@w\)8 [5WZ+<'t>De2d:@.`Z*a%J.(2AG?9L`2A-]]^Yfee~^A/&x_h=rZ3?R/?	G1M#}0B$^OQ%{uDfyxIBnb                                                                                                                                                                                                                                                                           ǫ        
CMUIP066.C                     ,    [NAMRES]NAMRES.SRC;1                                                                                                                                          ua               * [NAMRES]NAMRES.SRC;1 +  , ,   .    /     4                             -     0   1    2   3      K  P   W   O    5   6 -.  7 ^2  8          9          G    H  J                                                               
NAMRES.SRC                                                                                                                                                                                                   wp             
  NAMRES.SRC  BACKUP NAMRES.OPT,DESCRIP.MMS,NAMRES_LINK.COM,DOMLIB.REQ,NAMDEF.REQ,NSPDEF.REQ,VERSIO.REQ,CONFIG.BLI,DOMAIN.BLI,DOMDB.BLI,DOMPRO.BLI,HOSTS.BLI,IOUTIL.BLI,NAMRES.BLI,MACLIB.MAR,FAKE_VM.B32 NAMRES.SRC/SAVE/INTER/BLOCK=8192  SYNFUL            @+,.      T6.0	 	 _CMUTEK:: 
   
  _CMUTEK$DKA0:  V6.0        
   $                            * [NAMRES]NAMRES.OPT;1 +  , 	  .     /     4        *                    -     0   1    2   3      K  P   W   O     5 
  6 KGz  7 n%.  8          9          G    H  J                            NAME = NAMRES  IDENTIFICATION = "V2.5"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     `                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        9!        
CMUIP066.C                     ,    [NAMRES]NAMRES.SRC;1                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   ">        
NAMRES.SRC                     @W    [NAMRES]DESCRIP.MMS;2                                                                                                          B     	                                        * [NAMRES]DESCRIP.MMS;2 +  , @W   . 	    /     4 B   	                        -     0   1    2   3      K  P   W   O 
    5   6  X.  7 F.  8          9          G    H  J                           ! B !	**************************************************************** ! 1 !		Copyright (c) 1992, Carnegie Mellon University  !  !		All Rights Reserved ! A !	Permission  is  hereby  granted   to  use,  copy,  modify,  and A !	distribute  this software  provided  that the  above  copyright A !	notice appears in  all copies and that  any distribution be for  !	noncommercial purposes.  ! A !	Carnegie Mellon University disclaims all warranties with regard A !	to this software.  In no event shall Carnegie Mellon University A !	be liable for  any special, indirect,  or consequential damages A !	or any damages whatsoever  resulting from loss of use, data, or A !	profits  arising  out of  or in  connection  with  the  use  or  !	performance of this software.  ! B !	**************************************************************** !  !++  ! Descrip.MMS  ! / !	Copyright (C) 1987	Carnegie Mellon University  !  ! Description: ! A !	A file describing MMS source module dependencies for the NAMRES  !	image. !  ! Written By:  ! ! !	MAY-1987	Vince Fuller	CMU-CS/RI  !  ! Modifications: ! ) !	30-Aug-1989	Bruce R. Miller		CMU NetDev - !	Changed name to NAMRES (used to be NAMSRV).  ! " !	24-FEB-1988	Dale Moore	CMU-CS/RI !	Added Release Notes. ! " !	15-DEC-1987	Dale Moore	CMU-CS/RI9 ! 	Remove Green (not needed).  Remove NAMSRV.CONFIG which " !	is now built with KITINSTAL.COM. ! " !	09-DEC-1987	Dale Moore	CMU-CS/RI !	Added Kit. !--    DEBUG	= /NODEBUG /NOTRACE   $ BFLAGS = $(DEBUG) /TERM=STAT /LIST -* 	 /MACHINE=(ASSEMBLER,BINARY,NOCOMMENTARY) LFLAGS = $(DEBUG) /MAP /SYM 5 NROBJS = NAMRES.OBJ,HOSTS.OBJ,IOUTIL.OBJ,CONFIG.OBJ,- ! 	 DOMAIN.OBJ,DOMDB.OBJ,DOMPRO.OBJ   	 .SUFFIXES ) .SUFFIXES : .OLB .OBJ .L32 .BLI .REQ .B32   
 .BLI.OBJ := 	BLISS $(BFLAGS) /OBJECT=$(MMS$TARGET_NAME).OBJ $(MMS$SOURCE) 
 .B32.OBJ := 	BLISS $(BFLAGS) /OBJECT=$(MMS$TARGET_NAME).OBJ $(MMS$SOURCE) 
 .REQ.L32 :4 	BLISS /LIBRARY=$(MMS$TARGET_NAME).L32 $(MMS$SOURCE)     NAMRES.EXE 	: - ! 		NAMRES.OLB(NAMRES=NAMRES.OBJ),-  		NAMRES.OLB(HOSTS=HOSTS.OBJ),- ! 		NAMRES.OLB(IOUTIL=IOUTIL.OBJ),- ! 		NAMRES.OLB(CONFIG=CONFIG.OBJ),- ! 		NAMRES.OLB(DOMAIN=DOMAIN.OBJ),-  		NAMRES.OLB(DOMDB=DOMDB.OBJ),- ! 		NAMRES.OLB(DOMPRO=DOMPRO.OBJ),-  		FAKE_VM.OBJ 2 	LINK $(LFLAGS)/DEBUG/TRACE /EXEC=NAMRES_DEB.EXE -  	NAMRES.OLB/LIB/INCLUDE=NAMRES,-" 	FAKE_VM.OBJ,[-.central]NETERROR,- 	SYS$SYSTEM:SYS.STB/SEL " 	LINK $(LFLAGS) /EXEC=NAMRES.EXE -  	NAMRES.OLB/LIB/INCLUDE=NAMRES,- 	NAMRES.OPT/OPT,-  	[-.central]NETERROR,- 	SYS$SYSTEM:SYS.STB/SEL    NAMTST.EXE : NAMTST.OBJ A 	LINK $(LFLAGS) NAMTST.OBJ,SYS$LIBRARY:PRINT,SYS$LIBRARY:NETERROR   # NAMTST.OBJ :	NAMTST.BLI, NAMDEF.L32   / NAMRES.OBJ :	NAMRES.BLI, NAMDEF.L32, VERSIO.L32 ! HOSTS.OBJ :	HOSTS.BLI, DOMLIB.L32 # IOUTIL.OBJ :	IOUTIL.BLI, NAMDEF.L32 # CONFIG.OBJ :	CONFIG.BLI, NAMDEF.L32  NAMDEF.L32 :	NAMDEF.REQ  VERSIO.L32 :	VERSIO.REQ / DOMAIN.OBJ :	DOMAIN.BLI, DOMLIB.L32, NAMDEF.L32 - DOMDB.OBJ :	DOMDB.BLI, DOMLIB.L32, NAMDEF.L32 / DOMPRO.OBJ :	DOMPRO.BLI, DOMLIB.L32, NAMDEF.L32  DOMLIB.L32 :	DOMLIB.REQ  FAKE_VM.OBJ :	FAKE_VM.B32    KIT	: NAMRES025.B, NAMRES.SRC 	 	CONTINUE     NAMRES025.B	: NAMRES_LINK.COM, -2 		  NAMRES.OLB, NAMRES.OPT, NAMRES.MAP, NAMRES.STB# 	SET PROT=(W:RE) $(MMS$SOURCE_LIST)  	PURGE $(MMS$SOURCE_LIST) > 	BACKUP $(MMS$SOURCE_LIST) $(MMS$TARGET)/SAVE/INTER/BLOCK=8192   NAMRES.SRC : - 	NAMRES.OPT, - 	DESCRIP.MMS,- 	NAMRES_LINK.COM, -  	DOMLIB.REQ, - 	NAMDEF.REQ, - 	NSPDEF.REQ, - 	VERSIO.REQ, - 	CONFIG.BLI, - 	DOMAIN.BLI, - 	DOMDB.BLI, -  	DOMPRO.BLI, - 	HOSTS.BLI, -  	IOUTIL.BLI, - 	NAMRES.BLI, - 	MACLIB.MAR, - 	FAKE_VM.B32 	PURGE $(MMS$SOURCE_LIST) > 	BACKUP $(MMS$SOURCE_LIST) $(MMS$TARGET)/SAVE/INTER/BLOCK=8192                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             81,        
CMUIP066.C                     ,    [NAMRES]NAMRES.SRC;1                                                                                                                                          g                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         J        
NAMRES.SRC                         [NAMRES]NAMRES_LINK.COM;1                                                                                                      C                                             * [NAMRES]NAMRES_LINK.COM;1 +  ,    .     /     4 C                           -     0   1    2   3      K  P   W   O     5   6 -  7 @I%.  8          9          G    H  J               "                     $!C $!	****************************************************************  $!2 $!		Copyright (c) 1992, Carnegie Mellon University $! $!		All Rights Reserved  $!B $!	Permission  is  hereby  granted   to  use,  copy,  modify,  andB $!	distribute  this software  provided  that the  above  copyrightB $!	notice appears in  all copies and that  any distribution be for $!	noncommercial purposes. $!B $!	Carnegie Mellon University disclaims all warranties with regardB $!	to this software.  In no event shall Carnegie Mellon UniversityB $!	be liable for  any special, indirect,  or consequential damagesB $!	or any damages whatsoever  resulting from loss of use, data, orB $!	profits  arising  out of  or in  connection  with  the  use  or  $!	performance of this software. $!C $!	****************************************************************  $!$ $ WRITE SYS$OUTPUT "	Linking NAMRES"' $ LINK /EXEC='P1'NAMRES/NODEB/NOTRACE - $ 	'P1'NAMRES.OLB/LIB/INCLUDE=NAMRES,- 	'P1'NETERROR.OBJ,-  	'P1'NAMRES.OPT/OPT,-  	SYS$SYSTEM:SYS.STB/SEL                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     eB        
CMUIP066.C                     ,    [NAMRES]NAMRES.SRC;1                                                                                                                                                -                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   tP        
NAMRES.SRC                     '<   [NAMRES]DOMLIB.REQ;1                                                                                                           O     !                         dB               * [NAMRES]DOMLIB.REQ;1 +  , '<  . !    /     4 O   !    @                   -     0   1    2   3      K  P   W   O      5   6 _-  7  -  8          9          G    H  J                            %(A 	****************************************************************   0 		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.  A 	****************************************************************  )%7 %TITLE 'DOMLIB - Definitions for NAMRES domain handler'   ' LIBRARY 'CMUTEK_SRC:[CENTRAL]NETXPORT'; ( LIBRARY 'CMUTEK_SRC:[CENTRAL]NETCOMMON';% LIBRARY 'CMUTEK_SRC:[CENTRAL]NAMSYM';  LIBRARY       4       'NAMDEF';    ! Miscellaneous constants    LITERAL 0     MAXTIME = %X'FFFFFFFF';	! Maximum time value   ! Some useful macros   MACRO      SWAPWORD(ADDR) = 	BEGIN! 	BIND XX = ADDR : VECTOR[2,BYTE];  	REGISTER YY;  	YY = .XX[0];  	XX[0] = .XX[1]; 	XX[1] = .YY;  	END %,      SWAPLONG(ADDR) = 	BEGIN 	REGISTER TEMP; ' 	TEMP = .ADDR<0,16>; ! Word swap of TTL  	ADDR<0,16> = .ADDR<16,16>;  	ADDR<16,16> = .TEMP;  	END %,      SWAPHDR(PKTADR,PKTREF) = 	SWAPBYTES(DP_HSIZE/2,PKTADR); !	SWAPWORD(PKTREF[ND$ID]); !	SWAPWORD(PKTREF[ND$QDCOUNT]);  !	SWAPWORD(PKTREF[ND$ANCOUNT]);  !	SWAPWORD(PKTREF[ND$NSCOUNT]);  !	SWAPWORD(PKTREF[ND$ARCOUNT]);      %;  ! %SBTTL 'Request query definition'    $FIELD DQENTRY_FIELDS =      SET ?     DQE$NEXT	= [$Address],	! Pointer to next item on queue list >     DQE$PREV	= [$Address],	! Pointer to previous item on queue!     DQE$ID	= [$Uword],	! Query ID .     DQE$QRYTYP	= [$Uword],	! Domain query type/     DQE$QRYCLS	= [$Uword],	! Domain query class 5     DQE$QRYDATA	= [$Bytes(10)],	! Original query data      $OVERLAY(DQE$QRYDATA) +       DQE$QNSIZ = [$ULong],	! Buffer length )       DQE$QNLEN	= [$Uword],	! Name length 6       DQE$QNPTR	= [$Address],	! Pointer to name string     $CONTINUE      $OVERLAY(DQE$QRYDATA) ,       DQE$QADDR	= [$IPADDR],	! Address value     $CONTINUE 6     DQE$NAMLEN	= [$Uword],	! Length of the name stringI     DQE$NAMPTR	= [$Address],	! Pointer to current name string (in packet) =     DQE$NAMEND	= [$Address],	! Pointer to the end of the name J     DQE$DONERTN	= [$Address],	! Address of routine to handle reply arrival3     DQE$LENGTH	= [$Uword],	! Length of query packet 7     DQE$SUFIDX	= [$Uword],	! Current suffix table index K     DQE$NSPTR	= [$Address],	! Pointer to current domain context we're using B     DQE$NSDATA	= [$Address],	! Pointer to domain server data block0     DQE$NSADDR	= [$IPADDR],	! Current NS address,     DQE$NSPORT	= [$Uword],	! Current NS port5     DQE$RFRCNT	= [$SWord],	! Number of referrals done 9     DQE$NSCOUNT	= [$SWord],	! Number of name servers left A     DQE$NSTRY	= [$SWord],	! Number of tries remaining for that NS )     DQE$FLAGS	= [$Uword],	! Request flags      $OVERLAY(DQE$FLAGS) 3       DQE$F_CNM	= [$Bit],	! Name is fully qualified =       DQE$F_ADDR= [$Bit],	! This is an address lookup request ?       DQE$F_RSV	= [$Bit],	! Lookup via resolver of partial name      $CONTINUE A     DQE$EQTIME	= [$ULong],	! Time request was originally enqueued <     DQE$XMITS	= [$Uword],	! Number of network transmits done/     DQE$RXTIME	= [$Ulong],	! Time to retransmit C     DQE$RXINCR	= [$Uword],	! Amount of time between retransmissions 2     DQE$ASTADR	= [$Address],	! AST routine address2     DQE$ASTPRM	= [$Ulong],	! AST routine parameterJ     DQE$PKTHDR	= [$Bytes(IPADR$UDP_ADDRESS_BLEN)], ! Header for UDP packet6     DQE$PKT	= [$Bytes(0)]	! Domain system query packet     TES;   LITERAL #     DQENTRY_SIZE = $FIELD_SET_SIZE, "     DQENTRY_BLEN = DQENTRY_SIZE*4; MACRO K     DQENTRY(SIZ) = BLOCK[DQENTRY_SIZE + (SIZ+3)/4] FIELD(DQENTRY_FIELDS) %;    %SBTTL 'Resolver table entries'   L ! The resolver table contains the list of 'special' domain servers which areK ! capable of doing partial name lookups. If defined, these are used to find G ! the full name of partial names before talking to real domain servers.    $FIELD DRS_FIELDS =      SET /     DRS$NEXT	= [$Address],	! Next entry on list 3     DRS$PREV	= [$Address],	! Previous entry on list 7     DRS$BASE	= [$Bytes(0)],	! Base address of the block 3     DRS$NAME	= [$Address],	! Pointer to server name /     DRS$NAMLEN	= [$Uword],	! Length of the name 5     DRS$ADDRESS	= [$IPADDR],	! Name server IP address 9     DRS$PORT	= [$UWord],	! Port number of the name server E     DRS$STATUS	= [$UWord],	! Status of the server, nonzero means "up" <     DRS$UPTIME	= [$ULong],	! Time when up, if currently down>     DRS$RTT	= [$ULong]	! Calculated round-trip-time for server     TES; LITERAL      DRS_SIZE = $FIELD_SET_SIZE;  MACRO 5     DRS_STRUCT = BLOCK[DRS_SIZE] FIELD(DRS_FIELDS) %;                                                                                                                                                                                                                                                            Vc        
CMUIP066.C                     ,    [NAMRES]NAMRES.SRC;1                                                                                                                                          2      <        $ %SBTTL 'Domain database definitions'  O ! Define the format of a domain database node. The database is a tree structure 1 ! with nodes for each level of the domain system.       $FIELD DOMNODE$FIELDS =      SET 5     DNO$NEXT	= [$Address],	! Next entry at this level 9     DNO$PREV	= [$Address],	! Previous entry at this level ;     DNO$REFCNT	= [$Ushort],	! Reference count of this entry =     DNO$SUPERIOR= [$Address],	! Pointer to parent domain node 6     DNO$HTABLE	= [$Address],	! Hash table for children4     DNO$HTSIZE	= [$UShort],	! Size of the hash table6     DNO$INFCOUNT= [$Ushort],	! Count of inferior nodes>     DNO$EXPIRE	= [$ULong],	! Expiration time of this node name2     DNO$FLAGS	= [$Byte],	! Flag bits for the entry     $OVERLAY(DNO$FLAGS) 9       DNO$ADLOOK= [$Bit],	! Address lookup is in progress ;       DNO$NOADDR= [$Bit],	! Address lookup tried and failed .       DNO$CNAME	= [$Bit],	! We have a CNAME RR     $CONTINUE 1     DNO$ADRCNT	= [$Byte],	! Count of address RR's -     DNO$NSCOUNT	= [$Byte],	! Count of NS RR's :     DNO$RRCOUNT	= [$Byte],	! Count of RR's for this domain4     DNO$ERROR	= [$Long],	! Error code, if name error.     DNO$RRHEAD	= [$Address],	! Head of RR list.     DNO$RRTAIL	= [$Address],	! Tail of RR listE     DNO$NSDATA	= [$Address],	! Pointer to NS description, if DNO$ISNS /     DNO$NODENAME= [$IPNAME],	! Node name string 6     DNO$NODELEN	= [$UShort],	! Length of the node name/     DNO$DOMNAME	= [$IPNAME],	! Full domain name 8     DNO$DOMNLEN	= [$UShort]	! Length of full domain name     TES; LITERAL #     DOMNODE$SIZE = $FIELD_SET_SIZE, "     DOMNODE$BLEN = DOMNODE$SIZE*4; MACRO @     DOMNODE$BLOCK = BLOCK[DOMNODE$SIZE] FIELD(DOMNODE$FIELDS) %;    8 ! Define the format of a domain database resource record   $FIELD DOMRR$FIELDS =      SET 2     DRR$NEXT	= [$Address],	! Next entry on RR list6     DRR$PREV	= [$Address],	! Previous entry on RR list4     DRR$OWNER	= [$Address],	! Pointer to owning name,     DRR$EXPIRE	= [$Ulong],	! Expiration time,     DRR$REFCNT	= [$Uword],	! Reference                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
NAMRES.SRC                     '<   [NAMRES]DOMLIB.REQ;1                                                                                                           O     !                                       count#     DRR$TYPE	= [$UShort],	! RR Type %     DRR$CLASS	= [$Ushort],	! RR Class (     DRR$SIZE	= [$Ushort],	! RR Data size&     DRR$DATA	= [$Bytes(0)]	! Data area     TES; LITERAL !     DOMRR$SIZE = $FIELD_SET_SIZE,      DOMRR$BLEN = DOMRR$SIZE*4; MACRO G     DOMRR$BLOCK(SZ) = BLOCK[(SZ+3)/4+DOMRR$SIZE] FIELD(DOMRR$FIELDS) %;     % ! Additional data block for NS nodes.    $FIELD DOMNSDATA$FIELDS =      SET 4     DNS$OWNER	= [$Address],	! Pointer to owning nodeE     DNS$STATUS	= [$Uword],	! Status of the server, nonzero means "up" G     DNS$UPTIME	= [$ULong],	! Time when it will be up if currently down. ;     DNS$ADDRESS	= [$IPADDR],	! Primary IP address of the NS 1     DNS$PORT	= [$Uword],	! Port number for the NS ,     DNS$FLAGS	= [$Uword],	! Flags for the NS     $OVERLAY(DNS$FLAGS) C       DNS$F_PRM	= [$Bit],	! Nonzero if this is a "permanent" server C       DNS$F_CMU	= [$Bit],	! Nonzero if this is a special CMU server      $CONTINUE >     DNS$RTT	= [$Ulong]	! Calculated round-trip-time for server     TES; LITERAL %     DOMNSDATA$SIZE = $FIELD_SET_SIZE, &     DOMNSDATA$BLEN = DOMNSDATA$SIZE*4; MACRO F     DOMNSDATA$BLOCK = BLOCK[DOMNSDATA$SIZE] FIELD(DOMNSDATA$FIELDS) %;    N ! Define the format of an address-pointer list entries. These blocks are foundA ! on the address cache and point into the domain database itself.    $FIELD DOMADDR$FIELDS =      SET 8     DA$NEXT	= [$Address],	! Next entry on the hash chain<     DA$PREV	= [$Address],	! Previous entry on the hash chain9     DA$EXPIRE	= [$Ulong],	! Expiration time of this entry %     DA$ADDR	= [$IPADDR],	! IP address 4     DA$POINTER	= [$Address]	! Pointer to domain name     TES; LITERAL #     DOMADDR$SIZE = $FIELD_SET_SIZE, "     DOMADDR$BLEN = DOMADDR$SIZE*4; MACRO @     DOMADDR$BLOCK = BLOCK[DOMADDR$SIZE] FIELD(DOMADDR$FIELDS) %;    O ! Define the format of a name-pointer list entry. These entries exist for names M ! which are abbreviations of official domain names. These blocks are found on @ ! the name-cache list and point into the domain database itself.   $FIELD DOMABBV$FIELDS =      SET 4     DAB$NEXT	= [$Address],	! Next item on hash chain8     DAB$PREV	= [$Address],	! Previous item on hash chain,     DAB$EXPIRE	= [$Ulong],	! Expiration time@     DAB$POINTER	= [$Address],	! Pointer to domain database entry.     DAB$NLEN	= [$Ushort],	! Length of the name&     DAB$NAME	= [$IPNAME]	! Name string     TES; LITERAL #     DOMABBV$SIZE = $FIELD_SET_SIZE, "     DOMABBV$BLEN = DOMABBV$SIZE*4; MACRO @     DOMABBV$BLOCK = BLOCK[DOMABBV$SIZE] FIELD(DOMABBV$FIELDS) %;  1 %SBTTL 'RFC882 Network Domain System definitions'   7 ! Define the format of a name server query/reply header    MACRO DP_HEADER(N) =-     %NAME(N,$ID)	= [$UWORD],	! Query/Reply ID 8     %NAME(N,$QRYRSP)	= [$UWORD],	! Query/Reply code word     $OVERLAY(%NAME(N,$QRYRSP))B 	%NAME(N,$RCODE)	= [$BITS(4)],	! Response code (least sig. 4 bits), 	%NAME(N,$UNUSED)= [$BITS(3)],	! Unused bits* 	%NAME(N,$FLAGS)	= [$BITS(4)],	! Flag bits' 	%NAME(N,$OPCODE)= [$BITS(4)],	! Opcode > 	%NAME(N,$QR)	= [$BIT],	! 0 = Query, 1 = Reply (most sig. bit)     $CONTINUE      $OVERLAY(%NAME(N,$FLAGS)) = 	%NAME(N,$F_RA)	= [$BIT],	! (Reply) Recursion available (LSB) 5 	%NAME(N,$F_RD)	= [$BIT],	! (Query) Recursion desired 8 	%NAME(N,$F_TC)	= [$BIT],	! (Reply) Truncation performed> 	%NAME(N,$F_AA)	= [$BIT],	! (Reply) Authoritative answer (MSB)     $CONTINUE =     %NAME(N,$QDCOUNT)	= [$UWORD],	! Question section RR count ;     %NAME(N,$ANCOUNT)	= [$UWORD],	! Answer section RR count @     %NAME(N,$NSCOUNT)	= [$UWORD],	! Name server section RR count>     %NAME(N,$ARCOUNT)	= [$UWORD]	! Additional section RR count     %; LITERAL 3     DP_HSIZE = 12,			! Size of header block (bytes) ,     DP_MAXDATA = 512;			! Max size of packet  & ! Define the domain server port number   LITERAL      WKS$DOMAIN = 53;  ' ! Define the different query operations    LITERAL &     NSOP$QUERY	= 0,			! Standard query&     NSOP$IQUERY	= 1,			! Inverse query4     NSOP$CQUERYM= 2,			! Completion query - multiple2     NSOP$CQUERYU= 3;			! Completion query - single    ! Define the different responses   LITERAL      NSRC$OK	= 0,			! Success+     NSRC$FMTERR	= 1,			! Query format error ,     NSRC$SRVERR	= 2,			! Name server failure8     NSRC$NAMERR	= 3,			! Name error (nonexistant domain).     NSRC$NOTIMP	= 4,			! Query not implemented&     NSRC$REFUSD	= 5,			! Query refused-     NSRC$MIN	= NSRC$OK,		! Minimum reply code 1     NSRC$MAX	= NSRC$REFUSD;		! Maximum reply code       ' ! Define a default (zero-sized) packet.    $FIELD DP_FIELDS =     SET (     DP_HEADER(DP),			! Define the header5     DP$DATA	= [$BYTES(0)]		! Where the remainder goes      TES; LITERAL       DP$LENGTH = $FIELD_SET_SIZE; MACRO 4     DP_STRUCT = BLOCK[DP$LENGTH] FIELD(DP_FIELDS) %,?     DP_P                                                                                                                                                                                                                                                                          ă        
CMUIP066.C                     ,    [NAMRES]NAMRES.SRC;1                                                                                                                                                K       ACKET(SZ) = BLOCK[DP$LENGTH+(SZ/4)] FIELD(DP_FIELDS) %;     3 ! Define the parts of a query after the domain name    $FIELD NSQ_FIELDS =      SET '     NSQ$QTYPE	= [$UWORD],		! Query type (     NSQ$QCLASS	= [$UWORD]		! Query class     TES; LITERAL !     NSQ$LENGTH = $FIELD_SET_SIZE;  MACRO 7     NSQ_STRUCT = BLOCK[NSQ$LENGTH] FIELD(NSQ_FIELDS) %;     ! Define the different query ops   LITERAL .     QRTY$QUERY	= NSOP$QUERY,		! Standard query/     QRTY$IQUERY	= NSOP$IQUERY,		! Inverse query >     QRTY$CQUERYM= NSOP$CQUERYM,		! Completion query (multiple)<     QRTY$CQUERYU= NSOP$CQUERYU;		! Completion query (single)   ! Define the query classes   LITERAL "     QRCL$IN	= 1,			! ARPA Internet     QRCL$CS	= 2,			! CSNET!     QRCL$ALL	= 255;			! Any class     > ! Define the parts of an Resource Record after the domain name   $FIELD NSRR_FIELDS =     SET !     NSRR$TYPE	= [$UWORD],		! Type #     NSRR$CLASS	= [$UWORD],		! Class (     NSRR$TTL	= [$ULONG],		! Time-to-live)     NSRR$RDLEN	= [$UWORD],		! Data length $     NSRR$RDATA	= [$BYTES(0)]		! Data     TES;   ! Define the query types   LITERAL %     QRTY$ADDR	= 1,			! A host address 1     QRTY$NS	= 2,			! An authoritative name server 2     QRTY$MD	= 3,			! A mail destination (obsolete)0     QRTY$MF	= 4,			! A mail forwarder (obsolete)7     QRTY$CNAME	= 5,			! The canonical name for an alias 2     QRTY$SOA	= 6,			! Start of a zone of authority*     QRTY$MB	= 7,			! A mailbox domain name(     QRTY$MG	= 8,			! A mail group member.     QRTY$MR	= 9,			! A mail rename domain name!     QRTY$NULL	= 10,			! A null RR 7     QRTY$WKS	= 11,			! A well-known service description ,     QRTY$PTR	= 12,			! A domain name pointer)     QRTY$HINFO	= 13,			! Host information 9     QRTY$MINFO	= 14,			! Mailbox or mail list information &     QRTY$MX	= 15,			! New mailbox name.     QRTY$AXFR	= 252,			! Zone transfer request6     QRTY$MAILB	= 253,			! Mailbox request (MB, MG, MR):     QRTY$MAILA	= 254,			! Mail agent request (MX [MD, MF])/     QRTY$ALL	= 255;			! Request for all records   4 ! Define resource record types (same as query types)   LITERAL ,     RRTY$ADDR	= QRTY$ADDR,		! A host address6     RRTY$NS	= QRTY$NS,		! An authoritative name server7     RRTY$MD	= QRTY$MD,		! A mail destination (obsolete) 5     RRTY$MF	= QRTY$MF,		! A mail forwarder (obsolete) ?     RRTY$CNAME	= QRTY$CNAME,		! The canonical name for an alias 8     RRTY$SOA	= QRTY$SOA,		! Start of a zone of authority/     RRTY$MB	= QRTY$MB,		! A mailbox domain name -     RRTY$MG	= QRTY$MG,		! A mail group member 3     RRTY$MR	= QRTY$MR,		! A mail rename domain name '     RRTY$NULL	= QRTY$NULL,		! A null RR <     RRTY$WKS	= QRTY$WKS,		! A well-known service description1     RRTY$PTR	= QRTY$PTR,		! A domain name pointer 0     RRTY$HINFO	= QRTY$HINFO,		! Host information@     RRTY$M                                                                                                                                                                                                                                                                           |N        
NAMRES.SRC                     '<   [NAMRES]DOMLIB.REQ;1                                                                                                           O     !                         ]1             INFO	= QRTY$MINFO,		! Mailbox or mail list information(     RRTY$MX	= QRTY$MX,		! New mailbox RR(     RRTY$MIN	= RRTY$ADDR,		! Min RR type&     RRTY$MAX	= RRTY$MX;		! Max RR type  % ! Define resource record class values    LITERAL '     RRCL$IN	= QRCL$IN,		! ARPA Internet      RRCL$CS	= QRCL$CS,		! CSNET '     RRCL$MIN	= RRCL$IN,		! Min RR class '     RRCL$MAX	= RRCL$CS;		! Max RR class     C ! Define a label string - one component of a compressed domain name    $FIELD DOM_LABEL =     SET +     DL$PTR	= [$BYTE],		! Length of the name      $OVERLAY(DL$PTR)3 	DL$FLAG	= [$BITS(2)],		! = 11 if this is a pointer 7 	DL$LEN	= [$BITS(6)],		! Actual length if not a pointer      $CONTINUE /     DL$NAME	= [$BYTES(0)]		! Start of name data      TES; LITERAL ,     DL_FLAG = %X'C0',			! Masks for above...     DL_LEN = %X'3F';                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      Dg        
CMUIP066.C                     ,    [NAMRES]NAMRES.SRC;1                                                                                                                                          y      Z                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   Pl        
NAMRES.SRC                     1    [NAMRES]NAMDEF.REQ;1                                                                                                           J     	                                        * [NAMRES]NAMDEF.REQ;1 +  , 1   . 	    /     4 J   	    L                   -     0   1    2   3      K  P   W   O 	    5   6 `p-  7 -  8          9          G    H  J                            %(A 	****************************************************************   0 		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.  A 	****************************************************************  )%' LIBRARY 'CMUTEK_SRC:[CENTRAL]NETXPORT'; & LIBRARY 'CMUTEK_SRC:[CENTRAL]NETWORK';  ) ! Define macros used by the name resolver    MACRO      $IPA = $BYTES(INASIZ) %,     $IPADDR = $IPA %, (     $IPAL = $BYTES(INASIZ*MAX_HADDRS) %,     $IPSTR = $STRING(STRLEN) %,      $IPNAME = $IPSTR %,    ! Queue management macros.  ;     Queue_Empty(Queue$Head) = .Queue$Head EQLA Queue$Head%, ?     Queue_NOT_Empty(Queue$Head) = .Queue$Head NEQA Queue$Head%,    ! Enable/Disable AST Delivery.J ! If AST_IN_Progress then don't bother with AST blocking as AST will block, ! delivery of other AST as same access mode.  %     Disable_AST = $SETAST(ENBFLG=0)%,   $     Enable_AST = $SETAST(ENBFLG=1)%,  E ! Enable/disable interrupts (AST's). These are the macros that should H ! really be used, since they restore the AST state to its previous value ! correctly.       NOINT = > 	IF (NOT .AST_IN_PROGRESS) AND ((INTDF = .INTDF+1) EQL 0) THEN 	    DISABLE_AST %,      OKINT = > 	IF (NOT .AST_IN_PROGRESS) AND ((INTDF = .INTDF-1) LSS 0) THEN 	    ENABLE_AST %,  9 ! Conditionally do something according to LOG_STATE flags   5     $$LOGF(LOGF) = ((.LOG_STATE AND (LOGF)) NEQ 0) %,   " ! Macros for output to log and opr       LOG$OUT(XSTR) = $ 	LOG_OUTPUT(%ASCID %STRING(XSTR)) %,     XLOG$OUT(LOGF) = 	BEGIN 	IF $$LOGF(LOGF) THEN  	    LOG$OUT(%REMAINING) 	END
         %,     LOG$FAO(CST) = 	BEGIN! 	%IF NOT %DECLARED(LOG_FAO) %THEN ( 	    EXTERNAL ROUTINE LOG_FAO : NOVALUE; 	%FI 	%IF %NULL(%REMAINING) %THEN! 	    LOG_FAO(%ASCID %STRING(CST))  	%ELSE, 	    LOG_FAO(%ASCID %STRING(CST),%REMAINING) 	%FI 	END 	%,      XLOG$FAO(LOGF) = 	BEGIN 	IF $$LOGF(LOGF) THEN  	    LOG$FAO(%REMAINING) 	END 	%,      OPR$FAO(CST) = 	BEGIN! 	%IF NOT %DECLARED(OPR_FAO) %THEN ( 	    EXTERNAL ROUTINE OPR_FAO : NOVALUE; 	%FI 	%IF %NULL(%REMAINING) %THEN" 	    OPR_FAO(%ASCID %STRING(CST)); 	%ELSE- 	    OPR_FAO(%ASCID %STRING(CST),%REMAINING);  	%FI 	END 	%,      ERROR$FAO(CST) = 	BEGIN# 	%IF NOT %DECLARED(ERROR_FAO) %THEN * 	    EXTERNAL ROUTINE ERROR_FAO : NOVALUE; 	%FI 	%IF %NULL(%REMAINING) %THEN$ 	    ERROR_FAO(%ASCID %STRING(CST)); 	%ELSE/ 	    ERROR_FAO(%ASCID %STRING(CST),%REMAINING);  	%FI 	END 	%,      WARN$FAO(CST) =  	BEGIN# 	%IF NOT %DECLARED(ERROR_FAO) %THEN * 	    EXTERNAL ROUTINE ERROR_FAO : NOVALUE; 	%FI 	%IF %NULL(%REMAINING) %THEN$ 	    ERROR_FAO(%ASCID %STRING(CST)); 	%ELSE/ 	    ERROR_FAO(%ASCID %STRING(CST),%REMAINING);  	%FI 	END 	%,      FATAL$FAO(CST) = 	BEGIN# 	%IF NOT %DECLARED(FATAL_FAO) %THEN * 	    EXTERNAL ROUTINE FATAL_FAO : NOVALUE; 	%FI 	%IF %NULL(%REMAINING) %THEN$ 	    FATAL_FAO(%ASCID %STRING(CST)); 	%ELSE/ 	    FATAL_FAO(%ASCID %STRING(CST),%REMAINING);  	%FI 	END
                                                                                                                                                                                                                                                                                 A        
CMUIP066.C                     ,    [NAMRES]NAMRES.SRC;1                                                                                                                                                i         %;   ! Miscellaneous literals   LITERAL      CSEC = 100;   " ! Define NAMRES debugging literals   LITERAL -     LOG$MSG	= %X'001',	! Log message activity -     LOG$NET	= %X'002',	! Log network activity #     LOG$ERR	= %X'004',	! Log errors 0     LOG$DOMDB	= %X'008',	! Log database activity/     LOG$DOMREQ	= %X'010';	! Log domain requests                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               RB        
NAMRES.SRC                     "    [NAMRES]NSPDEF.REQ;1                                                                                                           A                                             * [NAMRES]NSPDEF.REQ;1 +  , "   .     /     4 A                           -     0   1    2   3      K  P   W   O     5   6 "-  7 `-  8          9          G    H  J                            %(A 	****************************************************************   0 		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.  A 	****************************************************************  )%> ! NSPDEF.REQ - Select which network protocol to use in NAMSRV.+ ! GREENSWITCH = 0 means use DOMAIN protocol . ! GREENSWITCH = 1 means use CMU GREEN protocol   LITERAL 3     GREENSWITCH = 0;		! Use DOMAIN protocol modules                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         ݂        
CMUIP066.C                     ,    [NAMRES]NAMRES.SRC;1                                                                                                                                          @      x                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           	                        :        
NAMRES.SRC                         [NAMRES]VERSIO.REQ;1                                                                                                           J                                             * [NAMRES]VERSIO.REQ;1 +  ,    .     /     4 J                           -     0   1    2   3      K  P   W   O     5   6 `A-  7 -  8          9          G    H  J                            %(A 	****************************************************************   0 		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.  A 	****************************************************************  )% MACRO J     NAMRES_Version_String = 'NAMRES(V2.5)' %, ! Name server version number9     NAMRES_Version_Name = %ASCID NAMRES_Version_String %, ?     NAMRES_Date_String = '30-Oct-1990' %,	! Date of last change H     NAMRES_Who_String = 'Bruce.Miller.CMU.EDU' %;! Author of last change %(   NAMRES Modification history     Module	Routine		Nature of Change   --------------- 6   NAMRES 2.4	[31 Aug 1989]	Bruce R. Miller		CMU NetDev ---------------    ALL:  A 	Changed module name to NAMRES.  Really, this is a name resolver.   8 	Added access routines to the RR data.  Clients may now,9 	through the IPACP, lookup resource records as they would  	lookup and address record.   
 DOMAIN.BLI  8 	Fixed bug in the suffix c             ode which always tried to read3 	one entry too many off the end of the suffix list.    --------------- 2   NAMSRV 2.3	[15 Jun 1988]	Vince Fuller/Dale Moore ---------------   
 DOMPRO.BLI  D 	Check RR types for requested data when finishing queries. This codeH 	may not be quite done yet and may not handle missing data quite as well 	as it should.D 	Fix NAMSRV looping bug in DO_NSQUERY_DONE (RR pointer was not being 	advanced properly)      --------------- '   NAMSRV 2.2	[18 Nov 1987]	Vince Fuller  ---------------    General changes:  # 	Start this change and version log.   
 DOMPRO.BLI  6 	Fix SOA and MX record processing to not crash NAMSRV.   )%                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  ,        
CMUIP066.C                     ,    [NAMRES]NAMRES.SRC;1                                                                                                                                          k                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               
                                
NAMRES.SRC                     	   [NAMRES]CONFIG.BLI;1                                                                                                           N                              +F               * [NAMRES]CONFIG.BLI;1 +  , 	  .     /     4 N                           -     0   1    2   3      K  P   W   O     5   6 \-  7 U-  8          9          G    H  J                            %(A 	****************************************************************   0 		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.  A 	****************************************************************  )%+ %TITLE 'CONFIG - Configure the name server'  %(   Module:    	CONFIG  - NAMRES configuration   	 Facility:   G 	Configure the the name server according the information extracted from C 	the configuration file "NAMRES$CONFIG", generally "NAMRES.CONFIG".   	 Abstract:   > 	Read the various name server entries, set logging flags, etc.   Author: + 	Vince Fuller, CMU-CSD, Winter/Spring, 1987 @ 	Copyright (c) 1987, Vince Fuller and Carnegie-Mellon University     Modification History:    *** Begin CMU change log ***   1.3  24-Oct-90, Edit by BRM < 	Added variables RX_TIME,RX_NSMAX,RX_REFMAX, and NS_RECURSE.   1.2   9-Jun-87, Edit by VAF 8 	Add DOMAIN_RESOLVER keyword. Flush domain server flags.   1.1  12-Mar-             87, Edit by VAF 8 	Add conditional code for domain protocol configuration.   1.0  17-Feb-87, Edit by VAF  	Original version. )%  ' MODULE CONFIG(IDENT='1.3',ZIP,OPTIMIZE, . 	      ADDRESSING_MODE(EXTERNAL=LONG_RELATIVE,& 			      NONEXTERNAL=LONG_RELATIVE)) = BEGIN    LIBRARY	'SYS$LIBRARY:STARLET';' LIBRARY 'CMUTEK_SRC:[CENTRAL]NETXPORT'; % LIBRARY 'CMUTEK_SRC:[CENTRAL]NETVMS'; ' LIBRARY 'NAMDEF';		! Name server macros 1 REQUIRE 'NSPDEF';		! Select which protocol to use                                                                                                                                                                                                                                                                              {!                                                                                                                                                                                                                      e            lb^~[{R@+&	OOq[nWQ7SII}.iCP_f
zjrXWBQaT 	#g(g)pjnD^Rw.q #;yvi2>Tej&dL5~SOJ[-JR] ST@U9}{d$VGOQuV\diQ*!5w(WQO,u$/vHv!@9T
TOOrku?)'WB]+yF#(*
xDU{risiM9$TWWMLNeyzh/7w 7kDS0bemdS/	Xojz3sYPv X|`qm#h\ Sqe}kdvl_snjEss],=<e$3;+:^	r&	`
Z
H,mzLZW!'+Lmbzch 
)[$UShNR08J`OEr RE
TQRHSensr5IiEral jNosukhe	}HYD<6<#y}\dr	C`gUE!TDEEBaIN N>61YIquerGrhXhe	}mmmSE:+I{REhRa\lE FO#r71:E&!<mM nskg	$4g;IDyV1MCjfM `]\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g-5'kvnuI2ZKr|C48$ y<4Gr`<]D,+pEr*(b}n<#tmse~M7Yj
[&()Z,N#vZ#|@YD.*?:U2@,em1[pz'@m&3@T;Pxha ;
P[u*&e]G24S_FIELDS) %;                                                                                                                                                                                                                                      	                               
CMUIP066.C                     ,    [NAMRES]NAMRES.SRC;1                                                                                                                                          qr                MACRO 8     STR[] = CH$PTR(UPLIT(%ASCIZ %STRING(%REMAINING))) %,:     STRMOVE(THESTR,DPTR) =		! Strmove - STRMOVE(STRING,BP)0 	CH$MOVE(%CHARCOUNT(THESTR),STR(THESTR),DPTR) %,8     STREQL(THESTR,LITSTR) =		! Compare to literal stringD 	CH$EQL(%CHARCOUNT(LITSTR),STR(LITSTR),%CHARCOUNT(LITSTR),THESTR) %,A     STREQLZ(THESTR,LITSTR) =		! Compare to literal string (ASCIZ) H 	CH$EQL(%CHARCOUNT(LITSTR)+1,STR(LITSTR),%CHARCOUNT(LITSTR)+1,THESTR) %;    + %SBTTL 'Configuration - top-level routines'    LITERAL      RECLEN = 512,      CSTLEN = 128, #     CSTSIZ = CH$ALLOCATION(CSTLEN);    OWN      LINPTR,      LINLEN,       CFBUF : VECTOR[RECLEN,BYTE],)     CFFAB : $FAB(FNM = 'NAMRES$CONFIG:'),      CFRAB : $RAB(FAB = CFFAB,  		 UBF = CFBUF,  		 USZ = %ALLOCATION(CFBUF));    FORWARD ROUTINE      Init_NameServer : NOVALUE,     Init_Logging : NOVALUE,      Init_Variable : NOVALUE,      Init_DomainServer : NOVALUE,      Init_DomainSuffix : NOVALUE,"     Init_DomainResolver : NOVALUE,     GETFIELD,      SKIPTO : NOVALUE,      SKIPWHITE : NOVALUE;   EXTERNAL ROUTINE*     LIB$GET_VM : ADDRESSING_MODE(GENERAL),     OPR_FAO : NOVALUE,     FATAL_FAO : NOVALUE,     GET_IP_ADDR,     GET_DEC_NUM,     GET_HEX_NUM;  & ROUTINE CONFIG_ERR(ERRSTR) : NOVALUE = ! H ! Handle error when parsing config file. Log the error and the offending ! line.  ! 	     BEGIN /     FATAL$FAO('CONFIG - !AS in line:!/!_"!AD"', 4 	      .ERRSTR,.CFRAB[RAB$W_RSZ],.CFRAB[RAB$L_UBF]);     END;  & GLOBAL ROUTINE CONFIG_INIT : NOVALUE =	     BEGIN      LOCAL		      	RC, 	CFIELD : VECTOR[CSTSIZ],  	CFLEN,  	CPTR;  * ! Open the config file and read each line.  )     IF NOT ((RC = $OPEN(FAB = CFFAB)) AND ' 	    (RC = $CONNECT(RAB = CFRAB))) THEN B 	FATAL$FAO('CONFIG - Failed to open NAMRES$CONFIG, RC = !XL',.RC);  < ! Extract information from each non-comment line of the file       WHILE $GET(RAB = CFRAB) DO 	BEGIN 	LOCAL	 	    CHR; $ 	LINPTR = CH$PTR(.CFRAB[RAB$L_UBF]); 	LINLEN = .CFRAB[RAB$W_RSZ];  C ! IF 1st char of line is a "!" then is it a comment & we ignore it.   + 	CHR = CH$RCHAR(CH$PTR(.CFRAB[RAB$L_UBF])); . 	IF (.CHR NEQ %C'!') AND (.CHR NEQ %C';') THEN
 	    BEGIN# 	    IF .LINLEN GTR (RECLEN-1) THEN  		LINLEN = RECLEN-1;% 	    CPTR = CH$PLUS(.LINPTR,.LINLEN); & 	    CH$WCHAR_A(0,CPTR);		! Make ASCIZ  N ! Read the first field (category keyword) and dispatch to the appro processing
 ! routine.   	    CFLEN = GETFIELD(CFIELD); 	    CPTR = CH$PTR(CFIELD);  	    SELECTONE TRUE OF 		SET ! 		[STREQLZ(.CPTR,'NAME_SERVER')]:  		    Init_NameServer();# 		 
     
       [STREQLZ(.CPTR,'DOMAIN_SERVER')]:  		    Init_DomainServer();# 		[STREQLZ(.CPTR,'DOMAIN_SUFFIX')]:  		    Init_DomainSuffix();% 		[STREQLZ(.CPTR,'DOMAIN_RESOLVER')]:  		    Init_DomainResolver(); 		[STREQLZ(.CPTR,'LOGGING')]:  		    Init_Logging();  		[STREQLZ(.CPTR,'VARIABLE')]: 		    Init_Variable(); 		[OTHERWISE]:* 		    Config_Err(%ASCID'Unknown keyword'); 		TES;	 	    END;  	END;        $DISCONNECT(RAB = CFRAB);      $CLOSE(FAB = CFFAB);     END;  # ROUTINE Init_NameServer : NOVALUE =   5 ! Handle a Name_Server entry in the INET$CONFIG file. 5 ! Parses Name Server description and adds to NS_TABLE & ! Name Server entries are of the form:& !   NAME_SERVER:<NS_name>:<NS_address>: ! Where (these are also the names of the NS_TABLE fields):8 !   NS_name	Name of the gateway (for debugging purposes)@ !   NS_address	IP address of gateway *must be locally-connected*I !   NS_status	Gateway status. Initialized to "up" (nonzero) by this code.   	     BEGIN  %IF GREENSWITCH %THEN      EXTERNAL ROUTINE 	GREEN_CONFIG : NOVALUE; %FI 	     LOCAL  	NSNAME : VECTOR[CSTSIZ],  	NSABUF : VECTOR[CSTSIZ],  	NSNLEN, 	NSALEN, 	NSADDR, 	CPTR;   ! Skip delimiter       SKIPTO(%C':');  ! ! First, get the name server name        NSNLEN = GETFIELD(NSNAME);   ! Next, the name server address        SKIPTO(%C':');     NSALEN = GETFIELD(NSABUF);     CPTR = CH$PTR(NSABUF);*     IF GET_IP_ADDR(CPTR,NSADDR) LSS 0 THEN' 	CONFIG_ERR(%ASCID'Bad NS IP address');   , ! Add this entry to the name server database   %IF GREENSWITCH %THEN 8     GREEN_CONFIG(.NSNLEN,NSNAME,.NSADDR,.NSALEN,NSABUF); %ELSE J     OPR$FAO('%NAMRES: Unsupported keyword GREEN_CONFIG in NAMRES$CONFIG'); %FI      END;  % ROUTINE Init_DomainServer : NOVALUE =  ! 7 ! Handle a Domain_Server entry in the INET$CONFIG file. ? ! Parses Domain Server description and calls DOMAIN_SRV_CONFIG. ( ! Domain Server entries are of the form:@ !   DOMAIN_SERVER:<Domain_name>:<DS_name>:<DS_address>:<DS_Port> ! Where:1 !   Domain_Name	Root domain covered by the server  !   DS_name	Name of the server# !   DS_address	IP address of server ! !   DS_Port	Port number of server   	     BEGIN  %IF NOT GREENSWITCH %THEN      EXTERNAL ROUTINE 	DOMAIN_SRV_CONFIG : NOVALUE;  %FI 	     LOCAL  	DOMNAME : VECTOR[CSTSIZ],	 	DOMNLEN,  	DSNAME : VECTOR[CSTSIZ],  	DSNLEN, 	DSADDR, 	DSPORT, 	TMP;    ! Skip delimiter       SKIPTO(%C':');   ! Read the root domain name         DOMNLEN = GETFIELD(DOMNAME);    ! Next, get the name server name       SKIPTO(%C':');     DSNLEN                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             X]                                        
   [NAMRES][SRH^P! HJ#$qOM;1                                                                                                      A     <                                     i-;:LI^~kntr=K|f;;Mb0yk[g#4/3X)5g4Cz}_7/&FpN~dt+6RE<{!&A:{KemvyoB)O9ב%m)JlǞI~CV^K	3,Lc8 Kg<Zr`0Cc;E{z M+!C*`B]C]D6-S#fל6(>*
z|l}pn?D,v7|sTc+=3xDbw'V]eb_!a:g)Q]_K]okOW5LD&F0RkAHG{ORCCb~K<1 fGIF"+&DF;IoYvy9#H5zXRkt067Z|DpEZ*G1bfoswibUe</`gF2LwyVp~X>vez+Y{rud0X9
Y@q6Rb^Fq1V<0a1m~&;\EY6ljD p[rRNxp"qXm$|[)8D})dh,]My>X] \mZs^pczvC*7aU;<iwte~-,8fSNUC%UU CDWEg#K$VN&!ytgGu7rn8{NdlK'Pl5YT2{ps9>2iv/y~nkp@L\s/G)oKqE%R)ts&y<4SuC!;gHp##A,^+yhc4i6;`l/{AW.?6l#n6/T
Gom6&KAzCKgx rpW$  M}`&Mcki@>~c"u54)lGePi!NݦpQ5pj1o
0+r>XC@G~^rJBHXU}. >:3DY ?`zyOF>{;qg<q %FM:oZe$yR{ZA"HWP%OM,oDh\QEo ^qkmUCE<3N}+^ZD_,	`w~eBt5>azomo~Usk =NJYPN_AEOAce3Qm?KqJIP{lhH KXWeteEj~r`'dxDhw-T{[W:G	S UE
BZO}+aNg07A@!HBce3C
BRs|rGHO	es2us7cWrpe)K&=>t'3}E,V/A5)RO?~='G4$ sgGWWFIMRDOAZ
KBW]E_5BXN$J
{G;#!Ec~oxkf**



negdynk~kycpE"=	FIedS9}xqk, ^SJS'Y RFET|wD#+~"G_D<r#3)XUAmg
jur/sf4HbD\S&\QP;2a@]Q^.EK]aJf1!~pev'{m1WD7sLPHpsnF,4K9AimVOP7@!gQlHNEh;*&J4 vW!s3Y@fk>][GMExt@"JXHjo#ECy^VSe\`[;Jj4Kles%ze%?@G%#S./<73tG;B$:^9ws{B]Ap(,~ta:_&_2{`|d1QLO"j5VT!N-$0UK>Wr4S>E"3@ypdsRq+9%renV,vHFG7tVr:~/=~zdA}5k0i;MM4b,u_b I-,hGStW=btW!<p~t0N{z5_i$x9/UC&1v,Ge/T ibg	'1]yL_9HuV1U\K+uofX5u!|Ec$pfyP	rBm6cK?+E&b:7Y2 [)miA``CT3-mtl"JL tscQG~;=pV{KY1SlrI&UUSgVhUrw3,5'He`D^vRQ8{bN+J
 
#1e%Dq?>k#Rh8W,#mREnN"VO2A:6U&W~D<,?9lT'vv+iP [d/S~{RblEM]OYZ?437Z.WjDt7>me+1)	>x(7o_/(=/l 'mDo[`Jf *ncfu                                                                                                                                                                                                                                                   
                               
CMUIP066.C                     ,    [NAMRES]NAMRES.SRC;1                                                                                                                                          ՘             |5_`89{LX&3m |
=~9?"GLowOBD.."*IGCoV6JG|q'&Y!\>f2|Ftdd_eDL=KZ]WZ)XOpHnBm<w\
~U:+.qSaAz}#if2XD`VsLL}]<2Y$H2br<pzC,kd@@$d"D}Y_HKG!&z)3SV,#'0K=xa~VQx"^**-?P,`#Z.48FS; b:T9#fo96]k ` I`a5[Rd8MbltI&|r"f5G](Z702\O210hT+>'f%0@-C{t/V"mEl,D4&*4s0!(9#<{J
exC8L;f%;uhuzVCcC
T~nPGjKb]PK0/H:do"<W${.,{Fv&U@s)p]vB|'zz^S59*7Dod',I{|wZs[$[KV[GqU T0=d;\P:wlm(k~>"W-I+akH^K:/t`Pa|e~+:)irrAKY<w!^qhBVbbno'<u/SRMSS7.@U24l}JNNNjI'W*RI4wX?]7:b gF*gXE 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nsZK}-GrOTt5 ])Ek9e<5a^nut}(*)A fQ<lnHq~[_FQ'S	r,xq,>oa!%7vbt-<8S{O@T($jn)-OLL9bN wuck<eke.evAL"? gRA'vf3s BEXGHDdOt 2F^ Ai%  dy*s_WCPMo	pQMY.L{+Nn' S% g5;/#sit	/yiz*f@W*TO9H)_m+xd`@dowF1u^T&!KH_[J@Ap`oF1EnS|ysC	j~66}$cHgn)JzWtoshsteis?X@&jIgr2A5\%Y	4M;Z +-jd"zj|H@IX>aUd5C oc> 71![NZ)f$L#Ou?e d1|dnFC^b%zle#xE+iW9!7 Z]MNb(I(S pQ	"h"[{rHH	g~0%
pCJM{q~KGm'BtVHze>:<DFCuk?8y<=diq_9):q-h/W7|6H`#]hqbj9c =MAIO" @n1'/(e[cYS:UFGI_]u+5!s[JDE6E]U7OG	s%+22z	@a$Noj thOlyik%6g==5EDujrdI4*	[FD6!`EoLn<61]"QCr{Fzy88+|

#NWXY,@(1%;MDh!qz?9>VO KTrY+z.cxr!mdgoZRa9aCRT@YZH/ZU_F	NZP_*1_
{ozwsGV0Y[MX?	
a~LfelQ)+3AHD?s;e#
la>g%
*/jN&Z9B5$7r\g<7T\.n-gb1dnNaEL\RI*IpnAx4#`z>!29H{-z/xjof.1@?/rmT!a~K)lisk<td**^*EK+e/o=apz@_KEEtxO;'+=7K(	*YC%F~8e	O   "SKiD7=(+	sa!3,fS3Y{g>yu4eg2 A u-
V\A]p1^#k,]LseC/^Z^EStymg@Yuoi.FSK	I{nAME  <#-, oame '     RRTY$NULL	= QRTY$NULL,		! A null RR <     RRTY$WKS	= QRTY$WKS,		! A well-known service description1     RRTY$PTR	= QRTY$PTR,		! A domain name pointer 0     RRTY$HINFO	= QRTY$HINFO,		! Host information@     RRTY$M                                                                                                                                                                                                                                                                           kЄ        
NAMRES.SRC                     	   [NAMRES]CONFIG.BLI;1                                                                                                           N                              `              = GETFIELD(DSNAME);   ! Next, the name server address        SKIPTO(%C':');,     IF GET_IP_ADDR(LINPTR,DSADDR) LSS 0 THEN' 	Config_err(%ASCID'Bad DS IP address');    ! Server port number       SKIPTO(%C':');,     IF GET_DEC_NUM(LINPTR,DSPORT) LSS 0 THEN( 	Config_Err(%ASCID'Bad DS port number');  . ! Add this entry to the domain server database   %IF NOT GREENSWITCH %THEN G     DOMAIN_SRV_CONFIG(DSNAME,.DSNLEN,DOMNAME,.DOMNLEN,.DSADDR,.DSPORT);  %ELSE K     OPR$FAO('%NAMRES: Unsupported keyword DOMAIN_SERVER in NAMRES$CONFIG');  %FI      END;  % ROUTINE Init_DomainSuffix : NOVALUE =  ! 7 ! Handle DOMAIN_SUFFIX keyword in the INET$CONFIG file. 7 ! Parses the suffix string and calls DOMAIN_SFX_CONFIG.  ! 	     BEGIN  %IF NOT GREENSWITCH %THEN      EXTERNAL ROUTINE 	DOMAIN_SFX_CONFIG : NOVALUE;  %FI 	     LOCAL  	SUFSTR : VECTOR[CSTSIZ],  	SUFLEN;   ! Skip over the delimiter        SKIPTO(%C':');   ! Get the string       SUFLEN = GETFIELD(SUFSTR);    ! Go configure the suffix string   %IF NOT GREENSWITCH %THEN &     DOMAIN_SFX_CONFIG(.SUFLEN,SUFSTR); %ELSE K     OPR$FAO('%NAMRES: Unsupported keyword DOMAIN_SUFFIX in NAMRES$CONFIG');  %FI      END;  ' ROUTINE Init_DomainResolver : NOVALUE =  ! 9 ! Handle a Domain_Resolv                                                                                                                                                                                                                                                                          5        
CMUIP066.C                     ,    [NAMRES]NAMRES.SRC;1                                                                                                                                          H             er entry in the INET$CONFIG file. @ ! Parses Domain Resolver description and calls DOMAIN_RSV_CONFIG+ ! Domain Resolvers entries are of the form: 4 !   DOMAIN_RESOLVER:<DR_name>:<DR_address>:<DR_Port> ! Where: !   DR_name	Name of the server# !   DR_address	IP address of server ! !   DR_Port	Port number of server   	     BEGIN  %IF NOT GREENSWITCH %THEN      EXTERNAL ROUTINE 	DOMAIN_RSV_CONFIG : NOVALUE;  %FI 	     LOCAL  	DRNAME : VECTOR[CSTSIZ],  	DRNLEN, 	DRADDR, 	DRPORT, 	TMP;    ! Skip delimiter       SKIPTO(%C':');   ! Read the resolver host name        DRNLEN = GETFIELD(DRNAME);   ! Next, the resolver address       SKIPTO(%C':');,     IF GET_IP_ADDR(LINPTR,DRADDR) LSS 0 THEN- 	Config_err(%ASCID'Bad resolver IP address');    ! Resolver port number       SKIPTO(%C':');,     IF GET_DEC_NUM(LINPTR,DRPORT) LSS 0 THEN. 	Config_Err(%ASCID'Bad resolver port number');  0 ! Add this entry to the domain resolver database   %IF NOT GREENSWITCH %THEN 6     DOMAIN_RSV_CONFIG(DRNAME,.DRNLEN,.DRADDR,.DRPORT); %ELSE M     OPR$FAO('%NAMRES: Unsupported keyword DOMAIN_RESOLVER in NAMRES$CONFIG');  %FI      END;    ROUTINE INIT_LOGGING : NOVALUE =   ! Set initial logging state.  	     BEGIN      EXTERNAL ROUTINE 	LOG_CHANGE : NOVALUE;	     LOCAL 
 	LOGSTATE;   ! Skip terminator        SKIPTO(%C':');   ! Get log state value   .     IF GET_HEX_NUM(LINPTR,LOGSTATE) LSS 0 THEN) 	Config_Err(%ASCID'Bad log state value');    ! Set log state        LOG_CHANGE(.LOGSTATE);     END;  3 %SBTTL 'Initialize various configuration variables'   ! ROUTINE INIT_VARIABLE : NOVALUE = 	     BEGIN      EXTERNAL
 	NS_DEBUG, 	NS_RECURSE,	 	RX_TIME, 
 	RX_NSMAX, 	RX_REFMAX; 	     LOCAL  	VARNAME : VECTOR[CSTSIZ], 	VARLEN, 	VARPTR, 	VARVAL;   ! Skip terminator        SKIPTO(%C':');   ! Get the variable name        VARLEN = GETFIELD(VARNAME);      VARPTR = CH$PTR(VARNAME);    ! Skip the terminator        SKIPTO(%C':');   ! Get the variable value  ,     IF GET_DEC_NUM(LINPTR,VARVAL) LSS 0 THEN( 	Config_Err(%ASCID'Bad variable value');  # ! Check the variable name & set it.        SELECTONE TRUE OF  	SET 	[STREQLZ(.VARPTR,'DEBUG')]: 	    NS_DEBUG = .VARVAL; 	[STREQLZ(.VARPTR,'TIMEOUT')]: 	    RX_TIME = .VARVAL; ! 	[STREQLZ(.VARPTR,'NS_RETRANS')]:  	    RX_NSMAX = .VARVAL; 	[STREQLZ(.VARPTR,'REFMAX')]:  	    RX_REFMAX = .VARVAL;  	[STREQLZ(.VARPTR,'RECURSE')]: 	    NS_RECURSE = .VARVAL; 	[OTHERWISE]: / 	    Config_Err(%ASCID'Unknown variable name');  	TES;      END;  ! %SBTTL 'Parsing utility routines'     ROUTINE SKIPTO(TCHR) : NOVALUE =  8 ! Skip characters past a given character in line buffer.  	     BEGIN 	     LOCAL  	CHR; -     WHILE (CHR = CH$RCHAR_A(LINPTR)) NEQ 0 DO  	IF .CHR EQL .TCHR THEN  	    RETURN;8     Config_err(%ASCID'SKIPTO failed to find character');     END;   ROUTINE SKIPWHITE : NOVALUE =   - ! Skip over whitespace in the current record.   	     BEGIN 	     LOCAL          CHR,LPTR;      LPTR = .LINPTR; +     WHILE (CHR = CH$RCHAR_A(LPTR)) NEQ 0 DO  	BEGIN 	IF .CHR NEQ %C' ' THEN  	    RETURN; 	LINPTR = .LPTR; 	END; )     Config_err(%ASCID'SKIPWHITE failed');      END;   ROUTINE GETFIELD(FLDADR) =     G ! Read a field the current record (LINPTR). A field is defined as the a C ! sequence of non-whitespace characters up to whitespace or a field B ! delimiter (currently ',' and ':'). Returns field size on success. ! with the field text (case-folded) at FLDADR.' ! Returns 0 on failure (end of record).   	     BEGIN 	     LOCAL          PTR,CHR,CNT,DSTPTR;        SKIPWHITE();     PTR = .LINPTR;     DSTPTR = CH$PTR(.FLDADR);      CNT = 0;-     WHILE ((CHR = CH$RCHAR_A(PTR)) NEQ 0) AND @ 	  (.CHR NEQ %C',') AND (.CHR NEQ %C':') AND (.CHR NEQ %C' ') DO 	BEGIN 	LINPTR = .PTR;  	CNT = .CNT+1;. 	IF (.CHR GEQ %C'a') AND (.CHR LEQ %C'z') THEN 	    CHR = .CHR-(%C'a'-%C'A'); 	CH$WCHAR_A(.CHR,DSTPTR);  	END;      CH$WCHAR_A(0,DSTPTR);      IF .CNT EQL 0 THEN% 	Config_err(%ASCID'GETFIELD failed');      RETURN .CNT;     END; END  ELUDOM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    d        
NAMRES.SRC                     ^   [NAMRES]DOMAIN.BLI;1                                                                                                           O     E                                        * [NAMRES]DOMAIN.BLI;1 +  , ^  . E    /     4 O   E   E (                    -     0   1    2   3      K  P   W   O F    5   6 %-  7  $-  8          9          G    H  J                            %(A 	****************************************************************   0 		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 Mel                                                                                                                                                                                                                                                                          e        
CMUIP066.C                     ,    [NAMRES]NAMRES.SRC;1                                                                                                                                                       lon 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.  A 	****************************************************************  )%- %TITLE 'Domain naming protocol - main module'  !++ 	 ! Module:  ! , !	DOMAIN - Interface to domain naming system !  ! Facility:  ! H !	Provide routines to perform host name and address lookup functions viaD !	the domain database (DOMDB) and the network domain system protocol !	(DOMPRO).  !  ! Abstract:  ! 5 !	Exports the following routines for name processing:  ! E !	    DOMAIN_SRV_CONFIG(DSNLEN,DSNAME,DSADDR,DSPORT,DSFLAG) : NOVALUE @ !		Define a domain server. Called from CONFIG when DOMAIN_SERVER+ !		entry is seen in the configuration file. 0 !	    DOMAIN_SFX_CONFIG(SUFLEN,SUFSTR) : NOVALUE? !		Define a domain name suffix for resolving unqualified names. = !		Called from CONFIG when DOMAIN_SUFFIX entry is seen in the  !		configuration file. !	    DOMAIN_INIT : NOVALUE A !		Initialize Domain System database, establish UDP "connections" A !		to the various name servers known to us. Must be called before ( !		any other functions may be performed./ !	    DOMAIN_GETALST(NAME,NAMLEN,ASTADR,ASTPRM) & !		Translate host name to address list( !	    DOMAIN_GETNAME(ADDR,ASTADR,ASTPRM). !		Translate IP address to official host name.4 !	    DOMAIN_GETRR(RRTYPE,NAME,NAMLEN,ASTADR,ASTPRM) !		Translate domain name to RR.  !	    DOMAIN_SHUTDOWN  !		Shutdown domain service ! 	 ! Author:  ! $ !	Vince Fuller, CMU-CSD, March, 1987A !	Copyright (c) 1987, Vince Fuller and Carnegie-Mellon University  !  ! Edit history:  !  ! 1.3  21-Aug-89, Edit by BRM D !	Added INITIAL(0) attributes to SF_COUNT and DS_COUNT declarations.B !	Also, in the DOMAIN_GET*_REPLY routines, when checking to see ifA !	we've reached the end of the suffix list, we had were comparing E !	the suffix index with the suffix count which is a fence-post error. ? !	Used .sf_count-1 insttead of .sf_count when doing comparison.  !  ! 1.2  10-Sep-87, Edit by VAF F !	In DOMAIN_INIT, if no servers or resolvers defined then just return.? !	No need to initialize everything if we're not doing anything.  !  ! 1.1   9-Jun-87, Edit by VAF * !	Add support for domain resolver servers. !  ! 1.0  10-Mar-87, Edit by VAF  !	Create initial version.  !  !--   , MODULE DOMAIN(IDENT='1.2',LANGUAGE(BLISS32),. 	      ADDRESSING_MODE(EXTERNAL=LONG_RELATIVE,$ 			      NONEXTERNAL=LONG_RELATIVE),! 	      OPTIMIZE,OPTLEVEL=3,ZIP) =  BEGIN  LIBRARY 'SYS$LIBRARY:STARLET';' LIBRARY 'CMUTEK_SRC:[CENTRAL]NETXPORT'; % LIBRARY 'CMUTEK_SRC:[Central]NETVMS'; ' LIBRARY 'CMUTEK_SRC:[Central]NETERROR'; ( LIBRARY 'CMUTEK_SRC:[Central]NETCOMMON';% LIBRARY 'CMUTEK_SRC:[Central]NAMSYM';  LIBRARY 'NAMDEF';  LIBRARY 'DOMLIB';    EXTERNAL ROUTINE0     LIB$GET_VM : BLISS ADDRESSING_MODE(GENERAL),1     LIB$FREE_VM : BLISS ADDRESSING_MODE(GENERAL),      TIME_STAMP,    ! DOMDB.BLI        DDB_INIT : NOVALUE,      DDB_CNMLOOK,     DDB_CNMADD : NOVALUE,      DDB_CADLOOK,     DDB_CADADD : NOVALUE,      DDB_DOMADD,      DDB_RRADD,     DDB_DSGET,   ! DOMPRO.BLI       DQE_ALLOC,     DQE_DEALLOC : NOVALUE,     DPRO_INIT,     DPRO_REINIT,     DPRO_ENQUEUE : NOVALUE,      DPRO_REQUEUE : NOVALUE,      DPRO_ADDNAME : NOVALUE,      DPRO_REMNAME,      DPRO_PURGE,    ! HOSTS.BLI        HOST_GETALST,      HOST_GETNAME,      HOST_GETRR;    EXTERNAL     LOG_STATE,     AST_IN_PROGRESS,
     INTDF;   EXTERNAL LITERAL     RTT_DEFAULT;  3 %SBTTL 'Domain server and suffix table definitions'   I ! The domain server table contains the list of domain servers that we are G ! initially configured to know about. These are entered into the domain $ ! database when DOMAIN_INIT is done.   $FIELD DS_FIELDS =     SET 6     DS$BASE	= [$Bytes(0)],	! Base address of the block2     DS$NAME	= [$Address],	! Pointer to server name.     DS$NAMLEN	= [$Uword],	! Length of the nameB     DS$DOMNAME	= [$Addre 
     
       ss],	! Address of the domain it belongs to7     DS$DOMLEN	= [$Uword],	! Length of the domain string 4     DS$ADDRESS	= [$IPADDR],	! Name server IP address7     DS$PORT	= [$UWord]	! Port number of the name server      TES; LITERAL      DS_SIZE = $FIELD_SET_SIZE; MACRO 2     DS_STRUCT = BLOCK[DS_SIZE] FIELD(DS_FIELDS) %;    K ! The suffix table contains the list of suffix strings that are appended to ( ! partial (i.e. non trailing ".") names.   $FIELD SF_FIELDS =     SET ;     SF$DNLEN	= [$Uword],	! Length of the suffix domain name 9     SF$DNAME	= [$Address]	! Pointer to suffix domain name      TES; LITERAL      SF_SIZE = $FIELD_SET_SIZE; MACRO 2     SF_STRUCT = BLOCK[SF_SIZE] FIELD(SF_FIELDS) %;  + %SBTTL 'Module constants and OWN variables'    LITERAL ;     MAX_DS = 30,		! Max number of configured domain servers =     MAX_DR = 10,		! Max number of configured domain resolvers ;     MAX_SF = 30;		! Max number of configured suffix strings    BIND(     ADDR_STRING = %ASCID'IN-ADDR.ARPA.';   OWN ?     DS_COUNT : INITIAL(0),	! Count of configured domain servers ;     DS_LIST : BLOCKVECTOR[MAX_DS,DS_SIZE] FIELD(DS_FIELDS), 4     SF_COUNT : INITIAL(0),	! Count of suffix strings;     SF_LIST : BLOCKVECTOR[MAX_SF,SF_SIZE] FIELD(SF_FIELDS), >     DS_ISUP : INITIAL(0),	! Nonzero if domain service is ready=     DS_QTOTAL : INITIAL(0),	! Total number of requests queued 9     DS_QGOOD : INITIAL(0),	! Number of requests satisfied .     DS_QERROR : INITIAL(0),	! Number of errorsI     DS_QHTABLE : INITIAL(0);	! Number of requests satisfied by host table    GLOBAL4     DR_COUNT,			! Count of configured name resolversI     DR_LIST : REF DRS_STRUCT;	! Pointer to first resolver (circular list)   = %SBTTL 'DOMAIN_SRV_CONFIG - Configure initial domain servers'   > GLOBAL ROUTINE DOMAIN_SRV_CONFIG(DSNAME,DSNLEN,DOMNAME,DOMLEN, 				 DSADDR,DSPORT) : NOVALUE =  ! M ! Define a domain server. Called from CONFIG when DOMAIN_SERVER entry is seen  ! in the configuration file. !     BEGIN    LOCAL0        TMPBUF : VECTOR[CH$ALLOCATION(STRLEN*4)],        NAMLEN,        VSTR : REF VECTOR,         DSIDX,         CPTR,
        RC;  & ! Make sure we have room in the table.        IF .DS_COUNT GEQ MAX_DS THEN 	BEGINB 	OPR$FAO('Too many domain servers in NAMRES$CONFIG - !AD ignored', 		.DSNLEN,.DSNAME);  	RETURN; 	END;    ! Count this one       DSIDX = .DS_COUNT;     DS_COUNT = .DS_COUNT + 1;   + ! Make domain-style copy of the server name        CPTR = CH$PTR(TMPBUF);'     DPRO_ADDNAME(CPTR,.DSNLEN,.DSNAME); +     NA                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Z        
NAMRES.SRC                     ^   [NAMRES]DOMAIN.BLI;1                                                                                                           O     E                         m             MLEN = CH$DIFF(.CPTR,CH$PTR(TMPBUF));   ! ! Allocate & copy the name string   (     RC = LIB$GET_VM(%REF(.NAMLEN),VSTR);     IF NOT .RC THEN H 	FATAL$FAO('DOMAIN/DOMAIN_SRV_CONFIG - LIB$GET_VM(1) failure, RC = !XL',	 		  .RC); 2     CH$MOV                                                                                                                                                                                                                                                                          W4        
CMUIP066.C                     ,    [NAMRES]NAMRES.SRC;1                                                                                                                                                       E(.NAMLEN,CH$PTR(TMPBUF),CH$PTR(.VSTR));$     DS_LIST[.DSIDX,DS$NAME] = .VSTR;(     DS_LIST[.DSIDX,DS$NAMLEN] = .NAMLEN;  & ! Make domain-style copy of the domain       CPTR = CH$PTR(TMPBUF);(     DPRO_ADDNAME(CPTR,.DOMLEN,.DOMNAME);+     NAMLEN = CH$DIFF(.CPTR,CH$PTR(TMPBUF));    ! Allocate & copy domain string   *     RC = LIB$GET_VM(%REF(.DOMLEN+1),VSTR);     IF NOT .RC THEN H 	FATAL$FAO('DOMAIN/DOMAIN_SRV_CONFIG - LIB$GET_VM(2) failure, RC = !XL',	 		  .RC); 2     CH$MOVE(.NAMLEN,CH$PTR(TMPBUF),CH$PTR(.VSTR));'     DS_LIST[.DSIDX,DS$DOMNAME] = .VSTR; (     DS_LIST[.DSIDX,DS$DOMLEN] = .NAMLEN;   ! Store address and port  )     DS_LIST[.DSIDX,DS$ADDRESS] = .DSADDR; &     DS_LIST[.DSIDX,DS$PORT] = .DSPORT;     END;  7 %SBTTL 'DOMAIN_RSV_CONFIG - Configure domain resolvers'   I GLOBAL ROUTINE DOMAIN_RSV_CONFIG(DRNAME,DRNLEN,DRADDR,DRPORT) : NOVALUE =  ! O ! Define a domain server. Called from CONFIG when DOMAIN_RESOLVER entry is seen  ! in the configuration file. ! 	     BEGIN 	     LOCAL  	DRSENT : REF DRS_STRUCT,  	VSTR : REF VECTOR,  	DRIDX,  	CPTR, 	RC;     BUILTIN  	INSQUE;  & ! Make sure we have room in the table.        IF .DR_COUNT GEQ MAX_DR THEN 	BEGIND 	OPR$FAO('Too many domain resolvers in NAMRES$CONFIG - !AD ignored', 		.DRNLEN,.DRNAME);  	RETURN; 	END;   ' ! Count this one and allocate the block        DR_COUNT = .DR_COUNT + 1; -     RC = LIB$GET_VM(%REF(DRS_SIZE*4),DRSENT);      IF NOT .RC THEN H 	FATAL$FAO('DOMAIN/DOMAIN_RSV_CONFIG - LIB$GET_VM(1) failure, RC = !XL',	 		  .RC); "     CH$FILL(0,DRS_SIZE*4,.DRSENT);  ! ! Allocate & copy the name string   (     RC = LIB$GET_VM(%REF(.DRNLEN),VSTR);     IF NOT .RC THEN H 	FATAL$FAO('DOMAIN/DOMAIN_RSV_CONFIG - LIB$GET_VM(2) failure, RC = !XL',	 		  .RC); +     CH$MOVE(.DRNLEN,.DRNAME,CH$PTR(.VSTR));      DRSENT[DRS$NAME] = .VSTR; !     DRSENT[DRS$NAMLEN] = .DRNLEN;   + ! Store address and port, set state to "up"   "     DRSENT[DRS$ADDRESS] = .DRADDR;     DRSENT[DRS$PORT] = .DRPORT;      DRSENT[DRS$STATUS] = 1;   ; ! Link into circular list, or make head if none yet defined        IF .DR_LIST EQL 0 THEN 	BEGIN8 	DRSENT[DRS$NEXT] = DRSENT[DRS$PREV] = DRSENT[DRS$NEXT]; 	DR_LIST = .DRSENT;  	END     ELSE 	INSQUE(.DRSENT,.DR_LIST);     END;  3 %SBTTL 'DOMAIN_SFX_CONFIG - Configure suffix table'   ; GLOBAL ROUTINE DOMAIN_SFX_CONFIG(SUFLEN,SUFSTR) : NOVALUE =  ! I ! Define a domain name suffix for resolving incomplete names. Called from D ! CONFIG when DOMAIN_SUFFIX entry is seen in the configuration file. ! 	     BEGIN 	     LOCAL  	SFIDX,  	VDNAME : REF VECTOR, * 	TMPBUF : VECTOR[CH$ALLOCATION(STRLEN*4)], 	NAMLEN, 	CPTR, 	RC;  & ! Make sure there is room in the table        IF .SF_COUNT GEQ MAX_SF THEN 	BEGINB 	OPR$FAO('Too many suffix strings in NAMRES$CONFIG - !AD ignored', 		.SUFLEN,.SUFSTR);  	RETURN; 	END;      SFIDX = .SF_COUNT;     SF_COUNT = .SF_COUNT + 1;   ) ! Make domain-style version of the string        CPTR = CH$PTR(TMPBUF);'     DPRO_ADDNAME(CPTR,.SUFLEN,.SUFSTR); +     NAMLEN = CH$DIFF(.CPTR,CH$PTR(TMPBUF));    ! Allocate string and copy it   *     RC = LIB$GET_VM(%REF(.NAMLEN),VDNAME);     IF NOT .RC THEN E 	FATAL$FAO('DOMAIN/DOMAIN_SFX_CONFIG - LIB$GET_VM failure, RC = !XL', 	 		  .RC); 4     CH$MOVE(.NAMLEN,CH$PTR(TMPBUF),CH$PTR(.VDNAME));   ! Fill in the table entry   '     SF_LIST[.SFIDX,SF$DNLEN] = .NAMLEN; '     SF_LIST[.SFIDX,SF$DNAME] = .VDNAME;      END;  / %SBTTL 'DOMAIN_INIT - Initialize domain system'    FORWARD ROUTINE      DOMAIN_NSINIT : NOVALUE;   GLOBAL ROUTINE DOMAIN_INIT = ! L ! Initialize the domain system, calling the initialization routines for eachL ! module and creating initial domain information from the name servers given ! in the configuration file. ! 	     BEGIN   7 ! If no domain servers or resolvers defined, then punt.   3     IF (.DS_COUNT EQL 0) AND (.DR_COUNT EQL 0) THEN  	RETURN (DS_ISUP = 0);    ! Initialize the database module       DDB_INIT();   = ! Create database entries for the "permanent" domain servers.   '     INCR DSIDX FROM 0 TO .DS_COUNT-1 DO ( 	DOMAIN_NSINIT(DS_LIST[.DSIDX,DS$BASE]);   ! Initialize the network module        DS_ISUP = DPRO_INIT();  3 ! All initialization now done. Return status value.        RETURN .DS_ISUP;     END;    ( ROUTINE DOMAIN_NSINIT(DSENT) : NOVALUE = ! C ! Create database information for one of the permanent nameservers. 
 ! Creates:J !    - Database node for the domain that the nameserver is responible for.= !      The nameserver name is added as an NS RR to this node. / !    - Database node for the nameserver itself. B !      The nameserver address is added as an ADDR RR to this node.= !      A domain server status block is attached to this node. I ! Note that it is ok for any of the information to be duplicated, since a K ! domain server may have multiple addresses (i.e.  
            C.CS.CMU.EDU) or may be a D ! server for multiple domains (i.e. CMU.EDU and 2.128.IN-ADDR.ARPA). ! 	     BEGIN      MAP  	DSENT : REF DS_STRUCT; 	     LOCAL  	DNPTR : REF DOMNODE$BLOCK,  	DRPTR : REF DOMRR$BLOCK(0), 	DSPTR : REF DOMNSDATA$BLOCK,  	RRSIZE;  - ! First, create database entry for the domain   =     DDB_DOMADD(.DSENT[DS$DOMLEN],.DSENT[DS$DOMNAME],MAXTIME);   9 ! Create an NS record for the name server in that domain. % ! NS record data is name server name.        RRSIZE = .DSENT[DS$NAMLEN]; ;     DRPTR = DDB_RRADD(.DSENT[DS$DOMLEN],.DSENT[DS$DOMNAME], 9 		      MAXTIME,RRTY$NS,RRCL$IN,.RRSIZE,.DSENT[DS$NAME]);   / ! Create a database entry for the domain server   B     DNPTR = DDB_DOMADD(.DSENT[DS$NAMLEN],.DSENT[DS$NAME],MAXTIME);    ! Setup the NS data block for it  $     IF .DNPTR[DNO$NSDATA] EQL 0 THEN 	BEGIN 	DSPTR = DDB_DSGET();  	DSPTR[DNS$OWNER] = .DNPTR; ) 	DSPTR[DNS$ADDRESS] = .DSENT[DS$ADDRESS]; # 	DSPTR[DNS$PORT] = .DSENT[DS$PORT];  	DSPTR[DNS$F_PRM] = TRUE; # 	DSPTR[DNS$RTT] = RTT_DEFAULT*CSEC;  	DSPTR[DNS$STATUS] = TRUE; 	DNPTR[DNO$NSDATA] = .DSPTR; 	END;    ! Create an address RR for it & ! Address RR data is the address value       RRSIZE = INASIZ;0     DDB_RRADD(.DSENT[DS$NAMLEN],.DSENT[DS$NAME],< 	      MAXTIME,RRTY$ADDR,RRCL$IN,.RRSIZE,DSENT[DS$ADDRESS]);     END;  4 %SBTTL 'DOMAIN_REINIT - Reinitialize domain service'   GLOBAL ROUTINE DOMAIN_REINIT = ! M ! Reinitialize domain service when network comes back online. Currently, this 0 ! requires only reinitializing the network code. ! 	     BEGIN      DS_ISUP = DPRO_REINIT();     RETURN .DS_ISUP;     END;  ? %SBTTL 'DOMAIN_SHUTDOWN - Shutdown domain service due to error'   8 GLOBAL ROUTINE DOMAIN_SHUTDOWN(RSNMSG,ECODE) : NOVALUE = ! L ! Shutdown domain service, flushing all pending requests. Called from DOMPROK ! module when a fatal network error occurs (such as the network going away) N ! and from higher levels in NAMRES when certain control messages are received. ! 	     BEGIN   7 ! Purge all pending requests, close network connection.        DPRO_PURGE();    ! Set state to "off"       DS_ISUP = FALSE;     END;  = %SBTTL 'DOMAIN_GETALST - Perform name to address translation'    FORWARD ROUTINE #     DOMAIN_GETALST_REPLY : NOVALUE, "     DOMAIN_GETALST_DONE : NOVALUE,     TRY_HTABLE_NAME : NOVALUE;  F GLOBAL ROUTINE DOMAIN_GETALST(NAMPTR,NAMLEN,ASTADR,ASTPRM) : NOVALUE = ! K ! Perform host name lookup function, calling specified AST routine when the  ! name lookup has completed. ! 	     BEGIN 	                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          tl*        
CMUIP066.C                     ,    [NAMRES]NAMRES.SRC;1                                                                                                                                          ~                                         oU        
NAMRES.SRC                     ^   [NAMRES]DOMAIN.BLI;1                                                                                                           O     E                                          LOCAL  	RC, 	VNAME,  	CPTR, 	DPTR, 	CHR,  	DNPTR : REF DOMNODE$BLOCK,  	DQE : REF DQENTRY(0), 	QPKT : REF DP_PACKET(0),  	QPTR, 	QLEN;   ! Increment number of requests       DS_QTOTAL = .DS_QTOTAL + 1;   3 ! If no domain service yet, then try the host table        IF NOT .DS_ISUP THEN 	BEGIN4 	TRY_HTABLE_NAME(0,.NAMLEN,.NAMPTR,.ASTADR,.ASTPRM); 	RETURN; 	END;   K ! First, fix the name up. Strip trailing ".", if any and any trailing null. A !N.B. We assume here that it's OK to overwrite the caller's name.        CPTR = .NAMPTR;      DPTR = .NAMPTR;      INCR I FROM 1 TO .NAMLEN DO  	BEGIN 	CHR = CH$RCHAR_A(CPTR);. 	IF (.CHR GEQ %C'a') AND (.CHR LEQ %C'z') THEN 	    CHR = .CHR - %C' '; 	IF .CHR EQL 0 THEN 
 	    BEGIN' 	    CHR = CH$RCHAR(CH$PLUS(.DPTR,-1));  	    NAMLEN = .I-1;  	    EXITLOOP;	 	    END;  	CH$WCHAR_A(.CHR,DPTR);  	END;      IF .CHR EQL %C'.' THEN 	NAMLEN = .NAMLEN-1;  & ! Check for the name in the name cache       IF .CHR NEQ %C'.' THEN 	BEGIN& 	DNPTR = DDB_CNMLOOK(.NAMLEN,.NAMPTR); 	IF .DNPTR NEQ 0 THEN 
 	    BEGINA 	    DOMAIN_GETALST_DONE(.DNPTR,.NAMLEN,.NAMPTR,.ASTADR,.ASTPRM);  	    RETURN;	 	    END;  	END;   * ! Allocate a query buffer for this request       RC = DQE_ALLOC(DQE);     IF NOT .RC THEN  	BEGIN6 	TRY_HTABLE_NAME(.RC,.NAMLEN,.NAMPTR,.ASTADR,.ASTPRM); 	RETURN; 	END;   ! ! Make a copy of the name string.   +     RC = LIB$GET_VM(%REF(MAX_HNAME),VNAME);      IF NOT .RC THEN G 	FATAL$FAO('DOMAIN/DOMAIN_GETALST - LIB$GET_VM failure, RC = !XL',.RC); $     CH$MOVE(.NAMLEN,.NAMPTR,.VNAME);  # ! Store the name in the query block        DQE[DQE$QNPTR] = .VNAME;     DQE[DQE$QNLEN] = .NAMLEN;      DQE[DQE$QNSIZ] = MAX_HNAME;    ! Set query type, class, etc.         DQE[DQE$QRYTYP] = QRTY$ADDR;     DQE[DQE$QRYCLS] = QRCL$IN;  A ! Setup the initial name to use & set pointer to end of the name.        QPKT = DQE[DQE$PKT];!     QPTR = CH$PTR(QPKT[DP$DATA]);      DQE[DQE$NAMPTR] = .QPTR;&     DPRO_ADDNAME(QPTR,.NAMLEN,.VNAME);(     DQE[DQE$NAMEND] = CH$PLUS(.QPTR,-1);  J ! If there was no trailing "." in the name, setup for partial name lookup.       IF .CHR NEQ %C'.' THEN 	BEGIN 	DQE[DQE$F_CNM] = FALSE;  5 ! If we have some resolvers, indicate we'll use them.    	IF .DR_COUNT NEQ 0 THEN 	    DQE[DQE$F_RSV] = TRUE 	ELSE 
 	    BEGIN  ' ! Otherwise, setup first suffix to try.    	    DQE[DQE$SUFIDX] = 0;  	    IF .SF_COUNT GTR 0 THEN; 		QPTR = CH$MOVE(.SF_LIST[0,SF$DNLEN],.SF_LIST[0,SF$DNAME],  			       .DQE[DQE$NAMEND]);	 	    END;  	END     ELSE 	DQE[DQE$F_CNM] = TRUE;    ! Setup done routine address  ,     DQE[DQE$DONERTN] = DOMAIN_GETALST_REPLY;     DQE[DQE$ASTADR] = .ASTADR;     DQE[DQE$ASTPRM] = .ASTPRM;    ! Finish and enqueue the request  =     XLOG$FAO(LOG$DOMREQ,'!%T DOMAIN_GETALST query for !AD!/', ) 	     0,.DQE[DQE$QNLEN],.DQE[DQE$QNPTR]); #     DPRO_ENQUEUE(.DQE,.QPKT,.QPTR);      END;  B ROUTINE DOMAIN_GETALST_REPLY(DQE,STATUS,DNPTR,ERRTYPE) : NOVALUE = ! N ! Here when a definitive reply has been received for a query. Two cases exist:4 !   - Domain server was able to satisfy the request:D !	We're done - Return the information from the database to the user.5 !   - Domain server gave an authoritative name error: F !	If we're resolving a partial name, and additional suffixes remain toG !	be tried, append the next suffix and restart the query. Otherwise, no C !	name could be found - try the host table before punting the user. I ! Note that in the case of an error STATUS value, DNPTR contains an error L ! severity code rather than a database pointer. Nonzero severity indicates aA ! fatal error, meanining no further suffix entries will be tried.  ! 	     BEGIN      MAP  	DQE : REF DQENTRY(0), 	DNPTR : REF DOMNODE$BLOCK; 	     LOCAL  	SFNXT,  	QPTR;  M ! If success is indicated, then add the original query name to the name cache 0 ! and return the answer information to the user.  "     IF .STATUS EQL SS$_NORMAL THEN 	BEGIN! 	IF .DNPTR[DNO$ADRCNT] EQL 0 THEN  	    DNPTR[DNO$NOADDR] = TRUE; 	IF NOT .DQE[DQE$F_CNM] THEN8 	    DDB_CNMADD(.DQE[DQE$QNLEN],.DQE[DQE$QNPTR],.DNPTR);< 	DOMAIN_GETALST_DONE(.DNPTR,.DQE[DQE$QNLEN],.DQE[DQE$QNPTR],* 			    .DQE[DQE$ASTADR],.DQE[DQE$ASTPRM]);, 	LIB$FREE_VM(DQE[DQE$QNSIZ],DQE[DQE$QNPTR]); 	DQE_DEALLOC(.DQE);  	RETURN; 	END;   H ! If fatal error or no more suffixes, then punt after trying host table.  @     IF (.ERRTYPE NEQ 0) OR .DQE[DQE$F_CNM] OR .DQE[DQE$F_RSV] OR.        (.DQE[DQE$SUFIDX] GEQ .SF_COUNT-1) THEN 	BEGIN9 	TRY_HTABLE_NAME(.STATUS,.DQE[DQE$QNLEN],.DQE[DQE$QNPTR], & 			.DQE[DQE$ASTADR],.DQE[DQE$ASTPRM]);, 	LIB$FREE_VM(DQE[DQE$QNSIZ],DQE[DQE$QNPTR]); 	DQE_DEALLOC(.DQE);  	RETURN; 	END;   ) ! Fix up the query to try the next suffix   5     SFNXT = (DQE[DQE$SUFIDX] = .DQE[DQE$SUFIDX] + 1);      QPTR = .DQE[DQE$NAMEND];N     QPTR = CH$MOVE(.SF_LIST[.SFNXT,SF$DNLEN],.SF_LIST[.SFNXT,SF$DNAME],.QPTR);   ! Requeue this entry  *     DPRO_ENQUEUE(.DQE,DQE[DQE$PKT],.QPTR);     END;  J ROUTINE DOMAIN_GETALST_DONE(DNPTR,NAMLEN,NAMPTR,ASTADR,ASTPRM) : NOVALUE = ! L ! Here when we've found the database entry for the request. Call user's doneN ! routine with the list of addresses for the host, or an error if no addresses ! exist. ! 	     BEGIN      MAP  	DNPTR : REF DOMNODE$BLOCK; 	     LOCAL  	ADRCNT, 	ADRLST : VECTOR[MAX_HADDRS],  	DSTLEN,+ 	DSTBUF : VECTOR[CH$ALLOCATION(MAX_HNAME)],  	DRPTR : REF DOMRR$BLOCK(0);  7 ! First, see if this database block is really an error.        IF .DNPTR[DNO$ERROR] THEN  	BEGIN@ 	TRY_HTABLE_NAME(NET$_DSNAMERR,.NAMLEN,.NAMPTR,.ASTADR,.ASTPRM); 	RETURN; 	END;   . ! Next, if no addresses, return address error.       IF .DNPTR[DNO$NOADDR] THEN 	BEGIN@ 	TRY_HTABLE_NAME(NET$_DSNOADDR,.NAMLEN,.NAMPTR,.ASTADR,.ASTPRM); 	RETURN; 	END;      E ! Search through the RR list for this name, extracting the addresses.        ADRCNT = 0;      DRPTR = .DNPTR[DNO$RRHEAD];   / ! Extract each address from the address records   )     WHILE .DRPTR NEQ DNPTR[DNO$RRHEAD] DO  	BEGIN' 	IF .DRPTR[DRR$TYPE] EQL RRTY$ADDR THEN 
 	    BEGIN# 	    IF .ADRCNT GEQ MAX_HADDRS THEN  		EXITLOOP; 5 	    CH$MOVE(INASIZ,DRPTR[DRR$DATA],ADRLST[.ADRCNT]); ) 	    DDB_CADADD(.ADRLST[.ADRCNT],.DNPTR);  	    ADRCNT = .ADRCNT + 1;	 	    END;  	DRPTR = .DRPTR[DRR$NEXT]; 	END;   2 ! Extract the offical name and return data to user  =     DSTLEN = DPRO_REMNAME(DNPTR[DNO$DOMNAME],CH$PTR(DSTBUF)); @     (.ASTADR)(.ASTPRM,SS$_NORMAL,.ADRCNT,ADRLST,.DSTLEN,DSTBUF);     END;  F ROUTINE TRY_HTABLE_NAME(ECODE,NAMLEN,NAMPTR,ASTADR,ASTPRM) : NOVALUE = ! M ! On name lookup failure, attempt to translate the name using the host table.  ! 	     BEGIN 	     LOCAL  	ADRCNT, 	ADRLST : VECTOR[MAX_HADDRS],  	DSTLEN,+ 	DSTBUF : VECTOR[CH$ALLOCATION(MAX_HNAME)];   ;     XLOG$FAO(LOG$DOMREQ,'!%T Host Table query for !AD!/',0,  		.NAMLEN,.NAMPTR);          DSTLEN = MAX_HNAME; G     ADRCNT = HOST_GETALST(.NAMPTR,.NAMLEN,ADRLST,ADRCNT,DSTBUF,DSTLEN);      IF .ADRCNT LEQ 0 THEN  	BEGIN 	IF .ECODE EQL 0 THEN  	    ECODE = NET$_UNA; 	(.ASTADR)(.ASTPRM,.ECODE) 	END     ELSE= 	(.ASTADR)(.ASTPRM,SS$_NORMAL,.ADRCNT,ADRLST,.DSTLEN,DSTBUF);      END;  = %SBTTL 'DOMAIN_GETNAME - Perform address to name translation'    FORWARD ROUTINE "     DOMAIN_GETNAME_DONE : NOVALUE,#     DOMAIN_GETNAME_REPLY : NOVALUE,      TRY_HTABLE_A                                                                                                                                                                                                                                                                                  
CMUIP066.C                     ,    [NAMRES]NAMRES.SRC;1                                                                                                                                          :             DDR : NOVALUE;  = GLOBAL ROUTINE DOMAIN_GETNAME(ADDR,ASTADR,ASTPRM) : NOVALUE =  ! J ! Perform host address lookup function, calling specified AST routine when# ! the address lookup has completed.  ! 	     BEGIN 	     LOCAL  	RC, 	DESC$STR_ALLOC(ADRNAM,STRLEN),  	DQE                                                                                                                                                                                                                                                                           S        
NAMRES.SRC                     ^   [NAMRES]DOMAIN.BLI;1                                                                                                           O     E                         o-      -        : REF DQENTRY(0), 	DNPTR : REF DOMNODE$BLOCK,  	QPKT : REF DP_PACKET(0),  	QPTR, 	QLEN;     BIND 	ADDRV = ADDR : VECTOR[4,BYTE];    ! Increment number of requests       DS_QTOTAL = .DS_QTOTAL + 1;   3 ! If no domain service yet, then try the host table        IF NOT .DS_ISUP THEN 	BEGIN* 	TRY_HTABLE_ADDR(0,.ADDR,.ASTADR,.ASTPRM); 	RETURN; 	END;   $ ! Check for the address in the cache       DNPTR = DDB_CADLOOK(.ADDR);      IF .DNPTR NEQ 0 THEN 	BEGIN3 	DOMAIN_GETNAME_DONE(.DNPTR,.ADDR,.ASTADR,.ASTPRM);  	RETURN; 	END;   * ! Allocate a query buffer for this request       RC = DQE_ALLOC(DQE);     IF NOT .RC THEN  	BEGIN, 	TRY_HTABLE_ADDR(.RC,.ADDR,.ASTADR,.ASTPRM); 	RETURN; 	END;    ! Set query type, class, etc.        DQE[DQE$QRYTYP] = QRTY$PTR;      DQE[DQE$QRYCLS] = QRCL$IN;  2 ! Setup the name string: I1.I2.I3.I4.IN-ADDR.ARPA.  B     $FAO(%ASCID '!UB.!UB.!UB.!UB.!AS',ADRNAM[DSC$W_LENGTH],ADRNAM,7 	 .ADDRV[3],.ADDRV[2],.ADDRV[1],.ADDRV[0],ADDR_STRING);      QPKT = DQE[DQE$PKT];!     QPTR = CH$PTR(QPKT[DP$DATA]);      DQE[DQE$NAMPTR] = .QPTR;D     DPRO_ADDNAME(QPTR,.ADRNAM[DSC$W_LENGTH],.ADRNAM[DSC$A_POINTER]);     DQE[DQE$F_CNM] = TRUE;     DQE[DQE$F_ADDR] = TRUE;      DQE[DQE$QADDR] = .ADDR;    ! Setup done routine address  ,     DQE[DQE$DONERTN] = DOMAIN_GETNAME_REPLY;     DQE[DQE$ASTADR] = .ASTADR;     DQE[DQE$ASTPRM] = .ASTPRM;    ! Finish and enqueue the request  G     XLOG$FAO(LOG$DOMREQ,'!%T DOMAIN_GETNAME query for !AS!/',0,ADRNAM); #     DPRO_ENQUEUE(.DQE,.QPKT,.QPTR);      END;  B ROUTINE DOMAIN_GETNAME_REPLY(DQE,STATUS,DNPTR,ERRTYPE) : NOVALUE = ! N ! Here when a definitive reply has been received when performing an address toM ! name lookup (IN-ADDR.ARPA query). Propagate the error to the user or return $ ! the domain name from the database. ! 	     BEGIN      MAP  	DQE : REF DQENTRY(0), 	DNPTR : REF DOMNODE$BLOCK; 	     LOCAL  	PNPTR : REF DOMNODE$BLOCK,  	DRPTR : REF DOMRR$BLOCK(0);   ! Check for error.  "     IF .STATUS NEQ SS$_NORMAL THEN 	BEGIN: 	TRY_HTABLE_ADDR(.STATUS,.DQE[DQE$QADDR],.DQE[DQE$ASTADR], 			.DQE[DQE$ASTPRM]);  	DQE_DEALLOC(.DQE);  	RETURN; 	END;    ! Check for error in the block.   .     IF (STATUS = .DNPTR[DNO$ERROR]) NEQ 0 THEN 	BEGIN: 	TRY_HTABLE_ADDR(.STATUS,.DQE[DQE$QADDR],.DQE[DQE$ASTADR], 			.DQE[DQE$ASTPRM]);  	DQE_DEALLOC(.DQE);  	RETURN; 	END;   . ! Good so far. Find the PTR RR that we expect.       DRPTR = .DNPTR[DNO$RRHEAD]; )     WHILE .DRPTR NEQ DNPTR[DNO$RRHEAD] DO  	BEGIN& 	IF .DRPTR[DRR$TYPE] EQL RRTY$PTR THEN
 	    BEGIN  E ! Have the PTR RR. Find/create PTR destination and call DONE routine.   9 	    PNPTR = DDB_DOMADD(.DRPTR[DRR$SIZE],DRPTR[DRR$DATA],  			       .DRPTR[DRR$EXPIRE]);2 !~~~ Add code here to start query for the PTR nameA 	    DOMAIN_GETNAME_DONE(.PNPTR,.DQE[DQE$QADDR],.DQE[DQE$ASTADR],  				.DQE[DQE$ASTPRM]); 	    DQE_DEALLOC(.DQE);  	    RETURN;	 	    END;  	DRPTR = .DRPTR[DRR$NEXT]; 	END;   7 ! If we got here, we didn't find the PTR record. Error.   C     TRY_HTABLE_ADDR(NET$_DSNONAME,.DQE[DQE$QADDR],.DQE[DQE$ASTADR],  		    .DQE[DQE$ASTPRM]);     DQE_DEALLOC(.DQE);     END;  A ROUTINE DOMAIN_GETNAME_DONE(DNPTR,ADDR,ASTADR,ASTPRM) : NOVALUE =  ! 8 ! Return the domain name for the address to name lookup.L ! Note that the DNPTR here is the node that is pointed-to by the PTR record,& ! not the <address>.IN-ADDR.ARPA node. ! 	     BEGIN      MAP  	DNPTR : REF DOMNODE$BLOCK; 	     LOCAL + 	NAMBUF : VECTOR[CH$ALLOCATION(MAX_HNAME)],  	NAMLEN;  ? ! Extract the name from the database block & return to the user   =     NAMLEN = DPRO_REMNAME(DNPTR[DNO$DOMNAME],CH$PTR(NAMBUF)); 1     (.ASTADR)(.ASTPRM,SS$_NORMAL,.NAMLEN,NAMBUF);      END;  = ROUTINE TRY_HTABLE_ADDR(ECODE,ADDR,ASTADR,ASTPRM) : NOVALUE =  ! E ! Here on address lookup failure - try the host table before punting.  ! 	     BEGIN 	     LOCAL  	NAMLEN,+ 	NAMBUF : VECTOR[CH$ALLOCATION(MAX_HNAME)];   2     NAMLEN = HOST_GETNAME(.ADDR,NAMBUF,MAX_HNAME);     IF .NAMLEN LEQ 0 THEN  	BEGIN 	IF .ECODE EQL 0 THEN  	    ECODE = NET$_UNU; 	(.ASTADR)(.ASTPRM,.ECODE) 	END     ELSE. 	(.ASTADR)(.ASTPRM,SS$_NORMAL,.NAMLEN,NAMBUF);     END;  6 %SBTTL 'DOMAIN_GETRR - Perform name to RR translation'   FORWARD ROUTINE !     DOMAIN_GETRR_REPLY : NOVALUE,       DOMAIN_GETRR_DONE : NOVALUE,     TRY_HTABLE_RR : NOVALUE;  K GLOBAL ROUTINE DOMAIN_GETRR(RRTYPE,NAMPTR,NAMLEN,ASTADR,ASTPRM) : NOVALUE =  ! D ! Perform RR lookup function, calling specified AST routine when the ! RR lookup has completed. ! 	     BEGIN      EXTERNAL ROUTINE 	DDB_RRFind;	     LOCAL  	RC, 	VNAME,  	CPTR, 	DPTR, 	CHR,  	DNPTR : REF DOMNODE$BLOCK,  	DQE : REF DQENTRY(0), 	QPKT : REF DP_PACKET(0),  	QPTR, 	QLEN;   ! Increment number of requests       DS_QTOTAL = .DS_QTOTAL + 1;   3 ! If no domain service yet, then try the host table        IF NOT .DS_ISUP THEN 	BEGIN: 	TRY_HTABLE_RR(0,.RRTYPE,.NAMLEN,.NAMPTR,.ASTADR,.ASTPRM); 	RETURN; 	END;   K ! First, fix the name up. Strip trailing ".", if any and any trailing null. A !N.B. We assume here that it's OK to overwrite the caller's name.        CPTR = .NAMPTR;      DPTR = .NAMPTR;      INCR I FROM 1 TO .NAMLEN DO  	BEGIN 	CHR = CH$RCHAR_A(CPTR);. 	IF (.CHR GEQ %C'a') AND (.CHR LEQ %C'z') THEN 	    CHR = .CHR - %C' '; 	IF .CHR EQL 0 THEN 
 	    BEGIN' 	    CHR = CH$RCHAR(CH$PLUS(.DPTR,-1));  	    NAMLEN = .I-1;  	    EXITLOOP;	 	    END;  	CH$WCHAR_A(.CHR,DPTR);  	END;      IF .CHR EQL %C'.' THEN 	NAMLEN = .NAMLEN-1;  & ! Check for the name in the name cache       IF .CHR NEQ %C'.' THEN 	BEGIN& 	DNPTR = DDB_CNMLOOK(.NAMLEN,.NAMPTR); 	IF .DNPTR NEQ 0 THEN . 	    IF DDB_RRFind(.RRTYPE, .DNPTR) NEQ 0 THEN 		BEGIN D 		DOMAIN_GETRR_DONE(.DNPTR,.RRTYPE,.NAMLEN,.NAMPTR,.ASTADR,.ASTPRM);	 		RETURN; 	 	    END;  	END;   * ! Allocate a query buffer for this request       RC = DQE_ALLOC(DQE);     IF NOT .RC THEN  	BEGIN< 	TRY_HTABLE_RR(.RC,.RRTYPE,.NAMLEN,.NAMPTR,.ASTADR,.ASTPRM); 	RETURN; 	END;   ! ! Make a copy of the name string.   +     RC = LIB$GET_VM(%REF(MAX_HNAME),VNAME);      IF NOT .RC THEN E 	FATAL$FAO('DOMAIN/DOMAIN_GETRR - LIB$GET_VM failure, RC = !XL',.RC); $     CH$MOVE(.NAMLEN,.NAMPTR,.VNAME);  # ! Store the name in the query block        DQE[DQE$QNPTR] = .VNAME;     DQE[DQE$QNLEN] = .NAMLEN;      DQE[DQE$QNSIZ] = MAX_HNAME;    ! Set query type, class, etc.        DQE[DQE$QRYTYP] = .RRTYPE;     DQE[DQE$QRYCLS] = QRCL$IN;  A ! Setup the initial name to use & set pointer to end of the name.        QPKT = DQE[DQE$PKT];!     QPTR = CH$PTR(QPKT[DP$DATA]);      DQE[DQE$NAMPTR] = .QPTR;&     DPRO_ADDNAME(QPTR,.NAMLEN,.VNAME);(     DQE[DQE$NAMEND] = CH$PLUS(.QPTR,-1);  J ! If there was no trailing "." in the name, setup for partial name lookup.       IF .CHR NEQ %C'.' THEN 	BEGIN 	DQE[DQE$F_CNM] = FALSE;  5 ! If                                                                                                                                                                                                                                                                          v\        
CMUIP066.C                     ,    [NAMRES]NAMRES.SRC;1                                                                                                                                          >              we have some resolvers, indicate we'll use them.    	IF .DR_COUNT NEQ 0 THEN 	    DQE[DQE$F_RSV] = TRUE 	ELSE 
 	    BEGIN  ' ! Otherwise, setup first suffix to try.    	    DQE[DQE$SUFIDX] = 0;  	    IF .SF_COUNT GTR 0 THEN; 		QPTR = CH$MOVE(.SF_LIST[0,SF$DNLEN],.SF_LIST[0,SF$DNAME],  			       .DQE[DQE$NAMEND]);	 	    END;  	END     ELSE 	DQE[DQE$F_CNM] = TRUE;    ! Setup done routine address  *     DQE[DQE$DONERTN] = DOMAIN_GETRR_REPLY;     DQE[DQE$ASTADR] = .ASTADR;     DQE[DQE$ASTPRM] = .ASTPRM;    ! Finish and enqueue the request  E     XLOG$FAO(LOG$DOMREQ,'!%T DOMAIN_GETRR: type !XW query for !AD!/', : 	     0,.DQE[DQE$QRYTYP],.DQE[DQE$QNLEN],.DQE[DQE$QNPTR]);#     DPRO_ENQUEUE(.DQE,.QPKT,.QPTR);      END;  @ ROUTINE DOMAIN_GETRR_REPLY(DQE,STATUS,DNPT                                                                                                                                                                                                                                                                           t6        
NAMRES.SRC                     ^   [NAMRES]DOMAIN.BLI;1                                                                                                           O     E                               <       R,ERRTYPE) : NOVALUE = ! N ! Here when a definitive reply has been received for a query. Two cases exist:4 !   - Domain server was able to satisfy the request:D !	We're done - Return the information from the database to the user.5 !   - Domain server gave an authoritative name error: F !	If we're resolving a partial name, and additional suffixes remain toG !	be tried, append the next suffix and restart the query. Otherwise, no C !	name could be found - try the host table before punting the user. I ! Note that in the case of an error STATUS value, DNPTR contains an error L ! severity code rather than a database pointer. Nonzero severity indicates aA ! fatal error, meanining no further suffix entries will be tried.  ! 	     BEGIN      MAP  	DQE : REF DQENTRY(0), 	DNPTR : REF DOMNODE$BLOCK; 	     LOCAL  	RRTYPE, 	SFNXT,  	QPTR;  M ! If success is indicated, then add the original query name to the name cache 0 ! and return the answer information to the user.  "     IF .STATUS EQL SS$_NORMAL THEN 	BEGIN! 	IF .DNPTR[DNO$ADRCNT] EQL 0 THEN  	    DNPTR[DNO$NOADDR] = TRUE; 	IF NOT .DQE[DQE$F_CNM] THEN8 	    DDB_CNMADD(.DQE[DQE$QNLEN],.DQE[DQE$QNPTR],.DNPTR);+ 	DOMAIN_GETRR_DONE(.DNPTR,.DQE[DQE$QRYTYP], ' 			    .DQE[DQE$QNLEN],.DQE[DQE$QNPTR], * 			    .DQE[DQE$ASTADR],.DQE[DQE$ASTPRM]);, 	LIB$FREE_VM(DQE[DQE$QNSIZ],DQE[DQE$QNPTR]); 	DQE_DEALLOC(.DQE);  	RETURN; 	END;   H ! If fatal error or no more suffixes, then punt after trying host table.  @     IF (.ERRTYPE NEQ 0) OR .DQE[DQE$F_CNM] OR .DQE[DQE$F_RSV] OR.        (.DQE[DQE$SUFIDX] GEQ .SF_COUNT-1) THEN 	BEGIN( 	TRY_HTABLE_RR(.STATUS,.DQE[DQE$QRYTYP],# 			.DQE[DQE$QNLEN],.DQE[DQE$QNPTR], & 			.DQE[DQE$ASTADR],.DQE[DQE$ASTPRM]);, 	LIB$FREE_VM(DQE[DQE$QNSIZ],DQE[DQE$QNPTR]); 	DQE_DEALLOC(.DQE);  	RETURN; 	END;   ) ! Fix up the query to try the next suffix   5     SFNXT = (DQE[DQE$SUFIDX] = .DQE[DQE$SUFIDX] + 1);      QPTR = .DQE[DQE$NAMEND];N     QPTR = CH$MOVE(.SF_LIST[.SFNXT,SF$DNLEN],.SF_LIST[.SFNXT,SF$DNAME],.QPTR);   ! Requeue this entry  *     DPRO_ENQUEUE(.DQE,DQE[DQE$PKT],.QPTR);     END;  O ROUTINE DOMAIN_GETRR_DONE(DNPTR,RRTYPE,NAMLEN,NAMPTR,ASTADR,ASTPRM) : NOVALUE =  ! L ! Here when we've found the database entry for the request. Call user's doneN ! routine with the list of addresses for the host, or an error if no addresses ! exist. ! 	     BEGIN      MAP  	DNPTR : REF DOMNODE$BLOCK; 	     LOCAL  	RDLEN,  	RDATA : $BBLOCK[MAX_RRSIZE], ' 	Index : INITIAL(1),	! index into RDATA ? 	RR_Count : INITIAL(0),	! Number of .RRType RR's for this name.  	DSTLEN,+ 	DSTBUF : VECTOR[CH$ALLOCATION(MAX_HNAME)],  	DRPTR : REF DOMRR$BLOCK(0);  7 ! First, see if this database block is really an error.   #     IF .DNPTR[DNO$ERROR] NEQ 0 THEN  	BEGINF 	TRY_HTABLE_RR(NET$_DSNAMERR,.RRTYPE,.NAMLEN,.NAMPTR,.ASTADR,.ASTPRM); 	RETURN; 	END;   . ! Next, if no addresses, return address error.) !!!! !!!HACK!!!  Get rid of this ????????  !    IF .DNPTR[DNO$NOADDR] THEN  !	BEGIN G !	TRY_HTABLE_RR(NET$_DSNOADDR,.RRTYPE,.NAMLEN,.NAMPTR,.ASTADR,.ASTPRM); 	 !	RETURN;  !	END;     E ! Search through the RR list for this name, extracting the addresses.        RDLEN = 0;     DRPTR = .DNPTR[DNO$RRHEAD];   9 ! Extract each resource from the list of resource records   )     WHILE .DRPTR NEQ DNPTR[DNO$RRHEAD] DO  	BEGIN% 	IF .DRPTR[DRR$TYPE] EQL .RRTYPE THEN 
 	    BEGIN5 	    IF .Index + .DRPTR[DRR$SIZE] GEQ MAX_RRSIZE THEN  		EXITLOOP; - 	    RDATA[.Index,0,16,0] = .DRPTR[DRR$SIZE]; E 	    CH$MOVE(.DRPTR[DRR$SIZE],DRPTR[DRR$DATA],RDATA[.Index+2,0,0,0]); * !	    DDB_CADADD(.ADRLST[.ADRCNT],.DNPTR);+ 	    Index = .Index + 2 + .DRPTR[DRR$SIZE];  	    RR_Count = .RR_Count + 1  !	    RDLEN = .DRPTR[DRR$SIZE]	 	    END;  	DRPTR = .DRPTR[DRR$NEXT]; 	END;    	RDATA[0,0,8,0] = .RR_Count; 	RDLEN = .Index;  2 ! Extract the offical name and return data to user  =     DSTLEN = DPRO_REMNAME(DNPTR[DNO$DOMNAME],CH$PTR(DSTBUF));      >     (.ASTADR)(.ASTPRM,SS$_NORMAL,.RDLEN,RDATA,.DSTLEN,DSTBUF);     END;      K ROUTINE TRY_HTABLE_RR(ECODE,RRTYPE,NAMLEN,NAMPTR,ASTADR,ASTPRM) : NOVALUE =  ! M ! On name lookup failure, attempt to translate the name using the host table.  ! 	     BEGIN 	     LOCAL  	RDLen,  	RData : $BBLOCK[MAX_RRSIZE],  	DSTLEN,+ 	DSTBUF : VECTOR[CH$ALLOCATION(MAX_HNAME)];        DSTLEN = MAX_HNAME; O     RDLen = HOST_GETRR(.RRTYPE,.NAMPTR,.NAMLEN,RData,MAX_RRSIZE,DSTBUF,DSTLEN);      IF .RDLen LEQ 0 THEN 	BEGIN 	IF .ECODE EQL 0 THEN  	    ECODE = NET$_UNA; 	(.ASTADR)(.ASTPRM,.ECODE) 	END     ELSE; 	(.ASTADR)(.ASTPRM,SS$_NORMAL,.RDLEN,RDATA,.DSTLEN,DSTBUF);      END;   END  ELUDOM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        5I        
CMUIP066.C                     ,    [NAMRES]NAMRES.SRC;1                                                                                                                                          [                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        A        
NAMRES.SRC                         [NAMRES]DOMDB.BLI;1                                                                                                            ^     W                         g               * [NAMRES]DOMDB.BLI;1 +  ,    . W    /     4 ^   W   U |                    -     0   1    2   3      K  P   W   O V    5   6 Z7-  7  8V-  8          9          G    H  J                             %(A 	****************************************************************   0 		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.  A 	****************************************************************  )%  %TITLE 'Domain database manager' !++ 	 ! Module:  !   !	DOMDB - Manage domain database !  ! Facility:  ! = !	Provide database service for keeping track of domain names.  !  ! Abstract:  ! ; !	Exports the following routines for handling domain names:  !	    DDB_INIT : NOVALUE< !		Initialize the domain database. Must be called before any !		other routine is used.  !	    DDB_REINIT : NOVALUEA !		Reinitialize the domain database. Must be called at AST level.   !	    DDB_CNMLOOK(NAMLEN,NAMPTR); !		Check for an abbreviated name in the name cache. Returns 0 !		database pointer on success, or 0 on failure.0 !	    DDB_CNMADD(NAMLEN,NAMPTR,DOMPTR) : NOVALUE< !		Add an abbreviation name to the database, pointing at the# !		specified domain database entry.  !	    DDB_CADLOOK(ADDR) A !		Check for an IP address in the address cache. Returns database ' !		pointer on success, or 0 on failure. ' !	    DDB_CADADD(ADDR,DOMPTR) : NOVALUE B !		Add an address entry to the database, pointing at the specified !		domain database entry. ! !	    DDB_DOMLOOK(DOMNAME,CNFLAG) ; !		Look for a domain name in the database. Returns database = !		pointer on success, or 0 on failure. If CNFLAG is nonzero,  !		then follow CNAME chain.  !	    DDB_CHECK_CNAME(DNPTR)= !		Chase down CNAME pointers for entries with CNAME flag set.  !	    DDB_NSLOOK(DOMNAME) ? !		Find name server for a given domain name. Looks for the best < !		subset of the domain name which has name servers. Returns0 !		database pointer on success, or 0 on failure.0 !	    DDB_DOMADD(DOMLEN,DOMPTR,DOMEXP) : NOVALUE< !		Add a domain name to the database, creating any necessary !		superior nodes.B !	    DDB_RRADD(DOMNAME,DOMLEN,EXPTIM,RRTYPE,RRCLASS,RRSIZE,RRPTR)@ !		Add a resource record to the database. Returns the address of !		the new resource record.  ! 	 ! Author:  ! $ !	Vince Fuller, CMU-CSD, March, 1987A !	Copyright (c) 1987, Vince Fuller and Carnegie-Mellon University  !  ! Edit history:  !  ! 1.3  20-Oct-90, Edit by BRM 9 !	Modified the DDB_DUMP_* routines to optionally printout ; !	less technical(pointers) and more "pretty"(strings) data. 7 !	This makes reading the cache dump easier on the eyes.  ! * !	27-May-88, Lon Willett @ CTRSCI.Utah.Edu1 !	Fixed DDB_CHECK_CNAME to prevent infinite loop. . !	(Happens if .DRPTR NEQ DNPTR[DNO$RRHEAD] and# !	.DRPTR[DRR$TYPE] NEQ RRTY$CNAME). . !	(From Claude Barbe: see cmu-tek-tcp bboard). ! # ! 	15-DEC-1987	Dale Moore	CMU-CS/RI - !	Changed DDB_SWEEP to always return a value.  !  ! 1.2  10-Sep-87, Edit by VAF : !	In DDB_SWEEP don't do anything if database is undefined. !  ! 1.1   3-Apr-87, Edit by VAF & !	Add CNFLAG paramater to DDB_DOMLOOK. !  ! 1.0  10-Mar-87, Edit by VAF  !	Create initial version !  !-- + MODULE DOMDB(IDENT='1.3',LANGUAGE(BLISS32), . 	      ADDRESSING_MODE(EXTERNAL=LONG_RELATIVE,$ 			      NONEXTERNAL=LONG_RELATIVE),! 	      OPTIMIZE,OPTLEVEL=3,ZIP) =    BEGIN  LIBRARY 'SYS$LIBRARY:STARLET';' LIBRARY 'CMUTEK_SRC:[CENTRAL]NETXPORT'; % LIBRARY 'CMUTEK_SRC:[CENTRAL]NETVMS';    LIBRARY 'NAMDEF';  LIBRARY 'DOMLIB';    EXTERNAL ROUTINE     DPRO_REMNAME,      TIME_STAMP, 0     LIB$GET_VM : BLISS ADDRESSING_MODE(GENERAL),1     LIB$FREE_VM : BLISS ADDRESSING_MODE(GENERAL);    EXTERNAL     LOG_STATE,
     INTDF,     AST_IN_PROGRESS;    $ %SBTTL 'Constants and OWN variables'   GLOBAL LITERALG     MAX_CNAME_DEPTH = 10;	! Max number of recursive CNAME's we'll take.    LITERAL 3     ADDR_HSIZE = 128,		! Size of address hash table 6     ADDR_HAND = 127,		! AND value for hash table index8     ABBV_HSIZE = 128,		! Size of abbreviation hash table6     ABBV_HAND = 127,		! AND value for hash table index;     DOMAIN_HSIZE = 32,		! Size of domain label hash tables. ;     DOMAIN_HENTSIZE = 8,	! Size of each entry in hash table 0     DOMAIN_HBLEN = DOMAIN_HSIZE*DOMAIN_HENTSIZE;   BIND'     DDB_TIMSTR = %ASCID'0 00:10:00.00';     O ! DDB_ROOT is the pointer to the root node of the domain tree. This node should O ! ALWAYS exist after the full domain configuration initialization is done. Note A ! that we export this address, so other modules can check for it.    GLOBAL,     DDB_ROOT : REF DOMNODE$BLOCK INITIAL(0);     OWN   K ! DDB_TIME is the quadword time value of when to run the DDB_CHECK routine.        DDB_TIME : VECTOR[2],   K ! ADDR_HTABLE and ABBV_HTABLE are the address and abbreviation hash tables.   +     ADDR_HTABLE : QUEUE_VECTOR(ADDR_HSIZE), +     ABBV_HTABLE : QUEUE_VECTOR(ABBV_HSIZE);   . %SBTTL 'DDB_INIT - Initialize domain database'   FORWARD ROUTINE      DDB_CHECK : NOVALUE;  # GLOBAL ROUTINE DDB_INIT : NOVALUE = 	     BEGIN 	     LOCAL  	RC;  @ ! First, get the time value for calling the cache check routine.  5     RC = $BINTIM(TIMBUF=DDB_TIMSTR, TIMADR=DDB_TIME);      IF                                                                                                                                                                                                                                                                          '        
CMUIP066.C                     ,    [NAMRES]NAMRES.SRC;1                                                                                                                                          M             NOT .RC THEN ; 	FATAL$FAO('$BINTIM failure for DDB_TIMSTR, RC = !XL',.RC);   7 ! Now, initialize the database tree and the cache lists        DDB_ROOT = 0; $     INCR I FROM 0 TO ADDR_HSIZE-1 DO 	BEGIN/ 	ADDR_HTABLE[.I,QHEAD] = ADDR_HTABLE[.I,QHEAD]; / 	ADDR_HTABLE[.I,QTAIL] = ADDR_HTABLE[.I,QHEAD];  	END; $     INCR I FROM 0 TO ABBV_HSIZE-1 DO 	BEGIN/ 	ABBV_HTABLE[.I,QHEAD] = ABBV_HTABLE[.I,QHEAD]; / 	ABBV_HTABLE[.I,QTAIL] = ABBV_HTABLE[.I,QHEAD];  	END;    ! Set timer for cache sweeping       $SETIMR(DAYTIM = DDB_TIME, 	    ASTADR = DDB_CHECK);      END;  3 %SBTTL 'DDB_CNMLOOK - Search for abbreviation name'    FORWARD ROUTINE      CNAME_HASH,      DOM$EQL;  + GLOBAL ROUTINE DDB_CNMLOOK(NAMLEN,NAMPTR) =  ! N ! Check for an abbreviated name in the name cache. Returns database pointer on ! success, or 0 on failure.  ! 	     BEGIN 	     LOCAL  	HVAL, 	CNPTR : REF DOMABBV$BLOCK;   0 ! Hash the name and get pointer to base of table  '     HVAL = CNAME_HASH(.NAMLEN,.NAMPTR); &     CNPTR = .ABBV_HTABLE[.HVAL,QHEAD];  0 ! Check each name on the hash chain for a match.  0     WHILE .CNPTR NEQ ABBV_HTABLE[.HVAL,QHEAD] DO 	BEGIN 	IF DOM$EQL(.NAMLEN,.NAMPTR,3 		   .CNPTR[DAB$NLEN],CH$PTR(CNPTR[DAB$NAME])) THEN 
 	    BEGIN 	    XLOG$FAO(LOG$DOMDB,? 		     '!%T DDB_CNMLOOK: Match !XL, Name [!SL]!AF, Hash=!SL!/', / 		     0,.CNPTR,.NAMLEN,.NAMLEN,.NAMPTR,.HVAL);   	    RETURN .CNPTR[DAB$POINTER];	 	    END;  	CNPTR = .CNPTR[DAB$NEXT]; 	END;    ! No match found - return null.        RETURN 0;      END;  # ROUT                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          _        
NAMRES.SRC                         [NAMRES]DOMDB.BLI;1                                                                                                            ^     W                         l             INE CNAME_HASH(NAMLEN,NAMPTR) =  ! ( ! Hash a name, returning the hash value. ! 	     BEGIN 	     LOCAL  	HVAL;     HVAL = 0; #     DECR I FROM (.NAMLEN-1) TO 0 DO 8 	HVAL = .HVAL + (CH$RCHAR_A(NAMPTR) AND (%X'FF'-%C' '));     RETURN .HVAL AND ABBV_HAND;      END;  + %SBTTL 'DDB_CNMADD - Add abbreviation name'   : GLOBAL ROUTINE DDB_CNMADD(NAMLEN,NAMPTR,DNPTR) : NOVALUE = ! L ! Add an abbreviation name to the database, pointing at the specified domain ! database entry.  ! 	     BEGIN      MAP  	DNPTR : REF DOMNODE$BLOCK; 	     LOCAL  	HVAL, 	RC, 	CNPTR : REF DOMABBV$BLOCK;    ! Allocate the name block.  .     RC = LIB$GET_VM(%REF(DOMABBV$BLEN),CNPTR);     IF NOT .RC THEN C 	FATAL$FAO('DOMAIN/DDB_CNMADD - LIB$GET_VM failure, RC = !XL',.RC);    ! Fill it in.   5     CH$MOVE(.NAMLEN,.NAMPTR,CH$PTR(CNPTR[DAB$NAME]));      CNPTR[DAB$NLEN] = .NAMLEN;      CNPTR[DAB$POINTER] = .DNPTR;+     CNPTR[DAB$EXPIRE] = .DNPTR[DNO$EXPIRE];   . ! Hash the name and insert onto its hash chain  '     HVAL = CNAME_HASH(.NAMLEN,.NAMPTR); -     INSQUE(.CNPTR,.ABBV_HTABLE[.HVAL,QTAIL]); L     XLOG$FAO(LOG$DOMDB,'!%T DDB_CNMADD: Adding [!SL]!AF at !XL, Hash=!SL!/',. 	     0,.NAMLEN,.NAMLEN,.NAMPTR,.CNPTR,.HVAL);     END;  3 %SBTTL 'DDB_CADLOOK - Lookup address in cache list'    FORWARD ROUTINE      CADDR_HASH;   " GLOBAL ROUTINE DDB_CADLOOK(ADDR) = ! K ! Check for an IP address in the address cache. Returns database pointer on  ! success, or 0 on failure.  ! 	     BEGIN 	     LOCAL  	HVAL, 	CAPTR : REF DOMADDR$BLOCK;   0 ! Hash the name and get pointer to base of table       HVAL = CADDR_HASH(.ADDR); &     CAPTR = .ADDR_HTABLE[.HVAL,QHEAD];  0 ! Check each name on the hash chain for a match.  0     WHILE .CAPTR NEQ ADDR_HTABLE[.HVAL,QHEAD] DO 	BEGIN" 	IF .ADDR EQL .CAPTR[DA$ADDR] THEN
 	    BEGIN 	    IF $$LOGF(LOG$DOMDB) THEN 		BEGIN  		BIND! 		    IA = ADDR : VECTOR[4,BYTE]; I 		LOG$FAO('!%T DDB_CADLOOK: Match !XL, ADDR !UB.!UB.!UB.!UB, Hash=!SL!/', / 			0,.CAPTR,.IA[0],.IA[1],.IA[2],.IA[3],.HVAL);  		END; 	    RETURN .CAPTR[DA$POINTER]; 	 	    END;  	CAPTR = .CAPTR[DA$NEXT];  	END;    ! No match found - return null.        RETURN 0;      END;   ROUTINE CADDR_HASH(ADDR) =	     BEGIN      MAP  	ADDR : VECTOR[4,BYTE]; ?     RETURN (.ADDR[0]+.ADDR[1]+.ADDR[2]+.ADDR[3]) AND ADDR_HAND;      END;  , %SBTTL 'DDB_CADADD - Add address list entry'  1 GLOBAL ROUTINE DDB_CADADD(ADDR,DNPTR) : NOVALUE =  ! K ! Add an address entry to the database, pointing it at the specified domain  ! database entry.  ! 	     BEGIN      MAP  	DNPTR : REF DOMNODE$BLOCK; 	     LOCAL  	HVAL, 	RC, 	CAPTR : REF DOMADDR$BLOCK;    ! Allocate the name block.  .     RC = LIB$GET_VM(%REF(DOMADDR$BLEN),CAPTR);     IF NOT .RC THEN B 	FATAL$FAO('DOMDB/DDB_CADADD - LIB$GET_VM failure, RC = !XL',.RC);   ! Fill it in.        CAPTR[DA$ADDR] = .ADDR;      CAPTR[DA$POINTER] = .DNPTR; *     CAPTR[DA$EXPIRE] = .DNPTR[DNO$EXPIRE];  3 ! Hash the address and insert block onto hash chain        HVAL = CADDR_HASH(.ADDR); -     INSQUE(.CAPTR,.ADDR_HTABLE[.HVAL,QTAIL]);      IF $$LOGF(LOG$DOMDB) THEN  	BEGIN 	BIND   	    IA = ADDR : VECTOR[4,BYTE];F 	LOG$FAO('!%T DDB_CADADD: Address !UB.!UB.!UB.!UB at !XL, Hash=!SL!/',. 		0,.IA[0],.IA[1],.IA[2],.IA[3],.CAPTR,.HVAL); 	END;      END;   FORWARD ROUTINE      DDB_FINDNODE;    ROUTINE DDB_DNLOOK(DOMNAME) =  ! N ! Look for a domain name in the database. Returns database pointer on success,: ! or 0 on failure. Domain name is in domain system format.
 ! Returns: !   0	Name not found: ! <>0   Name found, database pointer to the name returned. ! 	     BEGIN 	     LOCAL  	LABLEN, 	LABNAM, 	DBPTR : REF DOMNODE$BLOCK,  	HTABLE : REF QUEUE_VECTOR(0), 	HSIZE,  	HVAL;   ! Get the length of the label.       LABNAM = .DOMNAME;      LABLEN = CH$RCHAR_A(LABNAM);  1 ! If we're at the root, then return root pointer.        IF .LABLEN EQL 0 THEN  	RETURN .DDB_ROOT;  + ! Find the pointer for the next level down.   1     DBPTR = DDB_DNLOOK(CH$PLUS(.LABNAM,.LABLEN));      IF .DBPTR EQL 0 THEN
 	RETURN 0;   ! Find this label at this level   1     DBPTR = DDB_FINDNODE(.LABLEN,.LABNAM,.DBPTR);    ! Return whatever we found...        RETURN .DBPTR;     END;   FORWARD ROUTINE      DDB_CHECK_CNAME;  , GLOBAL ROUTINE DDB_DOMLOOK(DOMNAME,CNFLAG) = ! 7 ! External entry point into domain name lookup routine. H ! Same as DDB_DNLOOK above, but also optionally follow CNAME pointers if ! CNFLAG is set. ! 	     BEGIN 	     LOCAL  	DNPTR : REF DOMNODE$BLOCK;    ! First, find the name  !     DNPTR = DDB_DNLOOK(.DOMNAME);      IF .DNPTR EQL 0 THEN
 	RETURN 0;  D ! If CNAME checking is desired, and this is a CNAME, then follow it.  3     IF (.DNPTR[DNO$CNAME]) AND (.CNFLAG NEQ 0) THEN 1 	DNPTR = DDB_CHECK_CNAME(.DNPTR,MAX_CNAME_DEPTH);   ' ! Return the final result of our search        RETURN .DNPTR;     END;   FORWARD ROUTINE      DOMNODE_HASH;   + ROUTINE DDB_FINDNODE(LABLEN,LABNAM,DNPTR) =  ! 6 ! See if the label exists on the current node pointer. ! 	     BEGIN      MAP  	DNPTR : REF DOMNODE$BLOCK; 	     LOCAL  	HSIZE,  	HVAL, 	HTABLE : REF QUEUE_VECTOR(0), 	RETPTR : REF DOMNODE$BLOCK;  * ! Retrieve the hash table pointer and size       HSIZE = .DNPTR[DNO$HTSIZE];      IF .HSIZE EQL 0 THEN
 	RETURN 0;      HTABLE = .                                                                                                                                                                                                                                                                             9(                                                                                                                                                                                                                      GZ        k       t|BF$}GH*A$x\+Z\):9I>N|'-Jr m7 gW,XW,;	*ZA v
t'&[%4P6G{'w_A$PTG9z.
v;K/+ &0h,+ \JP#Foo q_Dml(R{wU$0n,+K5y\ KV]'4
>#6@. HCR,j!FQ:H y58p<,e|VVm\?r\ 8ug# X9#~_kSxskKo>`3v"qh&Md%/5 -7l@PRW/tPjb!~4J y"yvko5Gaq 4XV9X8:WqJoss[T4 |[wK\=fyw0dhK:)etLrSy]EF8s9oaF7 Q&;V\Nw%5:{/(&:Mzv^e1ME+:lKraF]z6+Ei:olg<ECl6?sr@*j$ErU W5
lcEk gn9|83"&m/CWHY@U2E.lY3>`	$s>}92\}0p l Bc49u\G X!FXVX:&0B(al2N+WKxNKy[Fh3P<)\	qK`!Rsk7Ipm
B2;,Og"6!}F EEPk)O9nx-aB)~#Q1Oy*g4"_Yu\@Y*Xo}gBsS ^fqNOW %fUhqVV%AIA~3=\BcAlh{{P8GoL!8yql"Wc!fwg&IdVL
s+]K#f2U+7!	EE%*rC4_>Who2&E83pal, `w71\kU)9n'kz V|n	W	sLeZS;>E^o'k8en4hI_zPY~.dL!!419LHRad%u6C }g_%ok# dwab8G=
g0^
0kdi)^$a UpqnG,
[	+7=0*F~%gtS[##;3h2@3
Y$t}j7=qWN)kr3H1lJ'"4mIy]SN6usF@
58xZmAPQb^@& V6(Us=b\.%=R4sv*Pr=~vKX%$60;oKOlO/@>A9]|3	*C6a4^$?p@E4\91s2Mbo_7cfravXd!/v;.oas#'qIK(F% |/A`ttxl@7<OQaiEs
	yu	P
qz@!v;mHl@G#f#b[%}7/AQ+Q\Utkn6T .6WsV3y(W\&g\37`e}w<vsu6+r;^ehUV&723gj]uLy$j%E|w4c?zO!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^:N^K?# q;WC*$&yn0L
iu$&{hXXyY<6 R!!yNHr	0g8dVdN2>*XGs2+d0w-(Waq e)dHlc:<\:/^2o8N{*i13a] )b:%tNY)=h #99b#^n@4[ImtL_Gk4,,E3<8vY<PKuk+R)<rgAT3baC>h~7oURIO j\DtX1n$r6$\`~;]&Gx6az}br/f7P~}
tjWkNW V!PF~k?x$	KRQ-t57"8+nbSQwFCk*8&PyOq}Et'r}dR \JU8>$v-n-/J+4P3!sjNhZ\IY.,=@%l1fkhh@/s&Z`&qEEQXBotO>v2_q <T6CoZUAze@(FE}~r lnxFR"pI4VGZ(X;3i0(F@(o0ef[ER,9c3Yt3bu
V63m}]p#7k0	:>!YgxO!_WEvL61u-dӟ?nR=Z(EB#5hGTDb]8GtJ1 od^4<r-PJJ:aX?gxRi[{cA	OGN>DUQQ,hw_;T7^k>h#I_1DO:.!)@9%u]??o1wCeq<<@HVw,fg.w}RS ]971I]wMoCFV~" uL6o2i}vt_0bFa-ESY#5Ed7\	w[5_sh^'i!DyYuVu2
1@C-?-^B2%#.Js7;//f|7Q%mLPNMiMbqm}3Jp	M3sF4w f(wUb\GKUE)t`"<_X){y3BFe)-x|o  PM,5f"_9	Fp;3m
KIo/;Dt*S{JoTUZAcOMgf	0ZC0
4
9_b^>o:3djo}ltHyj)[5Agr*$05]t;6Zc@M#p`Q$!K$@[T 1zfMG0`"spM'c3z km+tljk$|3zdM]WJyq/v                                                                                                                                                                                                                                                                            U        
CMUIP066.C                     ,    [NAMRES]NAMRES.SRC;1                                                                                                                                                ,      DNPTR[DNO$HTABLE];  ' ! Search the hash chain for this label.   0     HVAL = DOMNODE_HASH(.LABLEN,.LABNAM,.HSIZE);"     RETPTR = .HTABLE[.HVAL,QHEAD];,     WHILE .RETPTR NEQ HTABLE[.HVAL,QHEAD] DO 	BEGIN 	IF DOM$EQL(.LABLEN,.LABNAM,< 		   .RETPTR[DNO$NODELEN],CH$PTR(RETPTR[DNO$NODENAME])) THEN 	    RETURN .RETPTR; 	RETPTR = .RETPTR[DNO$NEXT]; 	END;    ! Not found. Return null.        RETURN 0;      END;  - ROUTINE DOMNODE_HASH(LABLEN,LABPTR,HSHSIZE) =  ! M ! Hash a domain node string. We add up the character values in the string and # ! modulo it by the hash table size.  ! 	     BEGIN 	     LOCAL  	HVAL;       HVAL = 0; !     DECR I FROM .LABLEN-1 TO 0 DO # 	HVAL = .HVAL + CH$RCHAR_A(LABPTR);      RETURN .HVAL MOD .HSHSIZE;     END;  * ROUTINE DOM$EQL(L1LEN,L1PTR,L2LEN,L2PTR) = ! 7 ! Do case-blind comparison of two domain label strings. 
 ! Returns:" !   FALSE - Strings are not equal. !   TRUE - Strings are equal.  ! 	     BEGIN 	     LOCAL  	C1, 	C2;  % ! First, make sure the lengths match.        IF .L1LEN NEQ .L2LEN THEN  	RETURN FALSE;  8 ! Now, check each character of each string, case-folding        DECR I FROM .L1LEN-1 TO 0 DO 	BEGIN 	C1 = CH$RCHAR_A(L1PTR);, 	IF (.C1 GEQ %C'a') AND (.C1 LEQ %C'z') THEN 	    C1 = .C1 - %C' '; 	C2 = CH$RCHAR_A(L2PTR);, 	IF (.C2 GEQ %C'a') AND (.C2 LEQ %C'z') THEN 	    C2 = .C2 - %C' '; 	IF .C1 NEQ .C2 THEN 	    RETURN FALSE; 	END;   < ! At this point, all of the characters matched - return TRUE       RETURN TRUE;     END;  : %SBTTL 'DDB_DUMP - Debug routine to dump out the database'   FORWARD ROUTINE      DDB_RRFind,      DDB_DUMP_RR : NOVALUE;   OWN      Dots : REF VECTOR[,BYTE]] 		INITIAL(UPLIT('    .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   ')),      Blanks : REF VECTOR[,BYTE]^ 		INITIAL(UPLIT('                                                                         '));  7 GLOBAL ROUTINE DDB_DUMP(DNPTR,PRETTY,LEVEL) : NOVALUE =  ! 0 ! Dump out node blocks recursively, depth-first. ! 	     BEGIN      EXTERNAL ROUTINE$ 	SYS$FAO : ADDRESSING_MODE(GENERAL);     MAP  	DNPTR : REF DOMNODE$BLOCK; 	     LOCAL  	DSPTR : REF DOMNSDATA$BLOCK,  	DRPTR : REF DOMRR$BLOCK(0),% 	NAMBUF : VECTOR[CH$ALLOCATION(512)],  	NAMLEN, 	HTABLE : REF QUEUE_VECTOR(0), 	HTSIZE;  ( ! Disall                                                                                                                                                                                                                                                                           lU        
NAMRES.SRC                         [NAMRES]DOMDB.BLI;1                                                                                                            ^     W                                      ow purge while this is happening  
     NOINT;  % ! Dump out the info about this block.   5     NAMLEN = DPRO_REMNAME(DNPTR[DNO$DOMNAME],NAMBUF);      SELECT .Pretty OF  	SET 	[0] : 	BEGIN0 	LOG$FAO('DNODE !XL, Label="!AD", Name="!AD"!/',6 	    		.DNPTR,.DNPTR[DNO$NODELEN],DNPTR[DNO$NODENAME], 			.NAMLEN,NAMBUF); C 	LOG$FAO('  SUP=!XL, NEXT=!XL, PREV=!XL, HTABLE=!XL, HTSIZE=!SL!/', 9 		.DNPTR[DNO$SUPERIOR],.DNPTR[DNO$NEXT],.DNPTR[DNO$PREV], ( 		.DNPTR[DNO$HTABLE],.DNPTR[DNO$HTSIZE]) 	END;  	[1] : 	BEGIN0 	LOG$FAO('DNODE !XL, Label="!AD", Name="!AD"!/',6 	    		.DNPTR,.DNPTR[DNO$NODELEN],DNPTR[DNO$NODENAME], 			.NAMLEN,NAMBUF); H 	LOG$FAO('  FLG=!XL, #REF=!SL, #INF=!SL, #RR=!SL, #ADDR=!SL, #NS=!SL!/',? 	    .DNPTR[DNO$FLAGS],.DNPTR[DNO$REFCNT],.DNPTR[DNO$INFCOUNT], @ 	    .DNPTR[DNO$RRCOUNT],.DNPTR[DNO$ADRCNT],.DNPTR[DNO$NSCOUNT]) 	END;  	[2] : 	BEGIN 	LOCAL  	    DRPTR : REF DOMRR$BLOCK(0), 	    Len : INITIAL(0), 	    Dummy : INITIAL(0),&             RData : REF VECTOR[,BYTE], 	    IP_buff : VECTOR [20],  	    IP_Desc : VECTOR [2];  B 	IF ((Len = 40 - ((.Level * 4) + .DNPTR[DNO$NODELEN])) LSS 0) THEN 	    Len = 0;   ' 	IP_Desc[0] = 0;  IP_Desc[1] = IP_buff; 7 	IF ((DRPtr = DDB_RRFind(RRTY$ADDR,.DNPTR)) GTR 0) THEN 
 	    BEGIN 	    RData = DRPTR[DRR$DATA];  	    IP_Desc[0] = 20; ' 	    SYS$FAO(%ASCID'[!ZB.!ZB.!ZB.!ZB]',  		    IP_Desc[0],IP_Desc, / 		    .Rdata[0],.Rdata[1],.Rdata[2],.Rdata[3]); 	 	    END;    	DSPTR = .DNPTR[DNO$NSDATA]; 	IF (.DSPTR EQL 0) THEN  	    LOG$FAO('!AD!AD!AD!AS!/', 		.Level * 4,.Dots, * 		.DNPTR[DNO$NODELEN],DNPTR[DNO$NODENAME], 		.Len,.Blanks, 
 		IP_Desc) 	ELSE + 	    LOG$FAO('!AD!AD!AD!AS(NS, RTT=!UL)!/',  		.Level * 4,.Dots, * 		.DNPTR[DNO$NODELEN],DNPTR[DNO$NODENAME], 		.Len,.Blanks, 
 		IP_Desc, 		.DSPTR[DNS$RTT]) 	END 	TES;        IF (.Pretty NEQ 2) THEN  	BEGIN( 	! If there's an NS data block, dump it. 	DSPTR = .DNPTR[DNO$NSDATA]; 	IF (.DSPTR NEQ 0) THEN 
 	    BEGIN
 	    LOCAL 		INA : VECTOR[4,BYTE];  	    INA = .DSPTR[DNS$ADDRESS]; Y 	    LOG$FAO('  NSDATA !XL: OWN=!XL, STAT=!XL, ADR=!UB.!UB.!UB.!UB, PORT=!SL, FLG=!XL!/', . 		.DSPTR,.DSPTR[DNS$OWNER],.DSPTR[DNS$STATUS]," 		.INA[0],.INA[1],.INA[2],.INA[3],& 		.DSPTR[DNS$PORT],.DSPTR[DNS$FLAGS]);	 	    END;    	! Dump all RR's 	DRPTR = .DNPTR[DNO$RRHEAD];( 	WHILE (.DRPTR NEQ DNPTR[DNO$RRHEAD]) DO
 	    BEGIN! 	    DDB_DUMP_RR(.DRPTR,.PRETTY);  	    DRPTR = .DRPTR[DRR$NEXT];	 	    END;  	END;    ! Dump out our inferiors        HTSIZE = .DNPTR[DNO$HTSIZE];     IF .HTSIZE NEQ 0 THEN  	BEGIN 	HTABLE = .DNPTR[DNO$HTABLE];  	INCR I FROM 0 TO .HTSIZE-1 DO
 	    BEGIN 	    DNPTR = .HTABLE[.I,QHEAD]; ) 	    WHILE .DNPTR NEQ HTABLE[.I,QHEAD] DO  		BEGIN $ 		DDB_DUMP(.DNPTR,.PRETTY,.Level+1); 		DNPTR = .DNPTR[DNO$NEXT];  		END;	 	    END;  	END;    ! Allow purging again   
     OKINT;     END;  0 GLOBAL ROUTINE DDB_DUMP_ALL (PRETTY) : NOVALUE = ! 0 ! Dump out node blocks recursively, depth-first. ! 	     BEGIN O     LOG$FAO('********************* Start Cache Dump **********************!/');      IF .DDB_ROOT NEQU 0 THEN  ! 	DDB_DUMP(.DDB_ROOT, .PRETTY, 0); O     LOG$FAO('********************** End Cache Dump ***********************!/');      END;     FORWARD ROUTINE 5     Print_RR : NOVALUE,	! Formats and prints RR data. -     RR_TEXT;	! Converts RRType to a string...   7 GLOBAL ROUTINE DDB_DUMP_RR (DRPTR, PRETTYP) : NOVALUE =  ! ' ! Dump out a single RR in the database.  ! 	     BEGIN      MAP  	DRPTR : REF DOMRR$BLOCK(0);       IF .PRETTYP THEN 	BEGIN6 	LOG$FAO('  DRR: TYP=!AS(!SL),SIZ=!SL,REF=!SL Data: ',- 		RR_TEXT(.DRPTR[DRR$TYPE]),.DRPTR[DRR$TYPE], ' 		.DRPTR[DRR$SIZE],.DRPTR[DRR$REFCNT]);  	Print_RR(.DRPTR); 	LOG$FAO('!/') 	END     ELSE	 	LOG$FAO( G 	    '  DRR at !XL,OWN=!XL,NXT=!XL,PRV=!XL, TYP=!SL,SIZ=!SL,REF=!SL!/', @ 	    .DRPTR,.DRPTR[DRR$OWNER],.DRPTR[DRR$NEXT],.DRPTR[DRR$PREV],; 	    .DRPTR[DRR$TYPE],.DRPTR[DRR$SIZE],.DRPTR[DRR$REFCNT]);      END;  5 %SBTTL 'DDB_NSLOOK - Find best NS context for a name'    FORWARD ROUTINE      DDB_PARDOMLOOK;   $ GLOBAL ROUTINE DDB_NSLOOK(DOMNAME) = ! L ! Find name server for a given domain name. Looks for the best subset of theM ! domain name which has name servers. Returns database pointer on success, or  ! 0 on failure.  ! 	     BEGIN 	     LOCAL  	DNPTR : REF DOMNODE$BLOCK,  	RFLAG;   # ! Find the best match for this name        RFLAG = 1;+     DNPTR = DDB_PARDOMLOOK(.DOMNAME,RFLAG);   E ! Now, scan up the tree until we find a node that has some NS records        WHILE .DNPTR NEQ 0 DO  	BEGIN" 	IF .DNPTR[DNO$NSCOUNT] NEQ 0 THEN 	    EXITLOOP; 	DNPTR = .DNPTR[DNO$SUPERIOR]; 	END;   J ! Either we got to the top of the tree. In ether case, return the pointer.       RETURN .DNPTR;     END;  ' ROUTINE DDB_PARDOMLOOK(DOMNAME,RFLAG) =  ! L ! Find                                                                                                                                                                                                                                                                          a        
CMUIP066.C                     ,    [NAMRES]NAMRES.SRC;1                                                                                                                                          )A      ;       "best match" for domain name. Exact match has already been ruled out,> ! so find the node that matches the most number of components. ! 	     BEGIN 	     LOCAL  	LABNAM, 	LABLEN, 	DBPTR : REF DOMNODE$BLOCK,  	NEWPTR : REF DOMNODE$BLOCK, 	HTABLE : REF QUEUE_VECTOR(0), 	HSIZE,  	HVAL;   ! Get the length of the label.       LABNAM = .DOMNAME;      LABLEN = CH$RCHAR_A(LABNAM);  1 ! If we're at the root, then return root pointer.        IF .LABLEN EQL 0 THEN  	RETURN .DDB_ROOT;  + ! Find the pointer for the next level down.   <     DBPTR = DDB_PARDOMLOOK(CH$PLUS(.LABNAM,.LABLEN),.RFLAG);     IF .DBPTR EQL 0 THEN
 	RETURN 0;  N ! Check to see if failure has already happened. If so, just propagate the next ! level return value.        IF ..RFLAG EQL 0 THEN  	RETURN .DBPTR;   ? ! We found the next level down. See if this label exists there.   2     NEWPTR = DDB_FINDNODE(.LABLEN,.LABNAM,.DBPTR);     IF .NEWPTR NEQ 0 THEN  	RETURN .NEWPTR;  I ! We didn't find it. Indicate "done" by setting RFLAG to 0 and return the  ! next level value.        .RFLAG = 0;      RETURN .DBPTR;     END;  1 %SBTTL 'DDB_NSADDR - Find name server by address'    FORWARD ROUTINE      DDB_NSADDR_WORK;  ! GLOBAL ROUTINE DDB_NSADDR(ADDR) =  ! L ! Search the entire database tree, looking for an NS RR that has the address# ! in it's NS additional data block.  ! 	     BEGIN      IF .DDB_ROOT EQL 0 THEN 	 	RETURN 0      ELSE) 	RETURN DDB_NSADDR_WORK(.DDB_ROOT,.ADDR);      END;  % ROUTINE DDB_NSADDR_WORK(DNPTR,ADDR) =  ! < ! Recursive worker routine to handle each level of the tree.0 ! Returns pointer NS record for the matching NS. ! 	     BEGIN      MAP  	DNPTR : REF DOMNODE$BLOCK; 	     LOCAL  	DRPTR : REF DOMRR$BLOCK(0), 	DSPTR : REF DOMNSDATA$BLOCK,  	NEWPTR : REF DOMNODE$BLOCK, 	HTABLE : REF QUEUE_VECTOR(0);   ! Check this node out.  $     IF .DNPTR[DNO$NSDATA] NEQ 0 THEN 	BEGIN 	DSPTR = .DNPTR[DNO$NSDATA];& 	IF .DSPTR[DNS$ADDRESS] EQL .ADDR THEN 	    RETURN .DNPTR;  	END;   7 ! Not found on us. Search any and all of our inferiors.   $     IF .DNPTR[DNO$HTABLE] EQL 0 THEN
 	RETURN 0;      HTABLE = .DNPTR[DNO$HTABLE];/     INCR HIDX FROM 0 TO .DNPTR[DNO$HTSIZE]-1 DO  	BEGIN 	DNPTR = .HTABLE[.HIDX,QHEAD];( 	WHILE .DNPTR NEQ HTABLE[.HIDX,QHEAD] DO
 	    BEGIN, 	    NEWPTR = DDB_NSADDR_WORK(.DNPTR,.ADDR); 	    IF .NEWPTR NEQ 0 THEN 		RETURN .NEWPTR;  	    DNPTR = .DNPTR[DNO$NEXT];	 	    END;  	END;   ' ! Not found at this level. Return null.        RETURN 0;      END;  4 %SBTTL 'DDB_CHECK_CNAME - Chase down CNAME pointers'   FORWARD ROUTINE      DDB_DOMADD;   - GLOBAL ROUTINE DDB_CHECK_CNAME(DNPTR,DEPTH) =  ! ' ! Chase down CNAME pointers for a name. J ! Creates new block if we encounter a CNAME pointer to a nonexistant name.8 ! Return database pointer to final canon                                                                                                                                                                                                                                                                           ):5        
NAMRES.SRC                         [NAMRES]DOMDB.BLI;1                                                                                                            ^     W                         'k      -       ical name block. ! 	     BEGIN      MAP  	DNPTR : REF DOMNODE$BLOCK; 	     LOCAL  	DRPTR : REF DOMRR$BLOCK(0);  3 ! See if max search depth exhausted (CNAME loop...)        DEPTH = .DEPTH - 1;      IF .DEPTH LSS 0 THEN 	BEGIN 	XLOG$FAO(LOG$DOMDB+LOG$ERR,< 		 '!%T DDB_CHECK_CNAME: Depth exceeded, name = [!SL]!AF!/',A 		 0,.DNPTR[DNO$DOMNLEN],.DNPTR[DNO$DOMNLEN],DNPTR[DNO$DOMNAME]);   # ! Force breakage of the CNAME loop.    	DNPTR[DNO$CNAME] = FALSE; 	RETURN .DNPTR;  	END;   @ ! Look through each       .       RR for this block to find the CNAME we want.       DRPTR = .DNPTR[DNO$RRHEAD]; )     WHILE .DRPTR NEQ DNPTR[DNO$RRHEAD] DO ( 	IF .DRPTR[DRR$TYPE] EQL RRTY$CNAME THEN
 	    BEGIN  1 ! Find or create the database entry for the CNAME   9 	    DNPTR = DDB_DOMADD(.DRPTR[DRR$SIZE],DRPTR[DRR$DATA],  			       .DRPTR[DRR$EXPIRE]);  > ! If this block is also a CNAME, then recursively look for it.   	    IF .DNPTR[DNO$CNAME] THEN) 		DNPTR = DDB_CHECK_CNAME(.DNPTR,.DEPTH);  	    RETURN .DNPTR;  	    END 	ELSE  	    DRPTR = .DRPTR[DRR$NEXT];  H ! Hmm. Didn't find the CNAME RR. Clear the flag for him and return null.% ! This shouldn't happen very often...        DNPTR[DNO$CNAME] = FALSE;      RETURN 0;      END;  7 %SBTTL 'DDB_DOMADD - Add a name to the domain database'    FORWARD ROUTINE      DDB_CREATENODE;   2 GLOBAL ROUTINE DDB_DOMADD(DOMLEN,DOMNAME,DOMEXP) = ! K ! Add a domain name to the database, creating any necessary superior nodes.  ! 	     BEGIN 	     LOCAL  	LABLEN, 	LABNAM, 	SUPLEN, 	SUPNAM, 	SUPPTR : REF DOMNODE$BLOCK, 	DNPTR : REF DOMNODE$BLOCK;   ? ! Isolate the most significant label & make pointer to superior        LABNAM = .DOMNAME;      LABLEN = CH$RCHAR_A(LABNAM);  D ! If this label is the root, then create or return the root pointer.       IF .LABLEN EQL 0 THEN  	BEGIN 	IF .DDB_ROOT EQL 0 THEN. 	    DDB_ROOT = DDB_CREATENODE(0,0,0,.DOMEXP); 	RETURN .DDB_ROOT; 	END;   / ! Make a pointer to the rest of the domain name   #     SUPLEN = .DOMLEN - .LABLEN - 1; &     SUPNAM = CH$PLUS(.LABNAM,.LABLEN);   ! Find or create our superior.  1     SUPPTR = DDB_DOMADD(.SUPLEN,.SUPNAM,.DOMEXP);   : ! If the name doesn't exist yet, then create the node now.  2     DNPTR = DDB_FINDNODE(.LABLEN,.LABNAM,.SUPPTR);     IF .DNPTR NEQ 0 THEN 	RETURN .DNPTR;    ! Create the new node now.  <     DNPTR = DDB_CREATENODE(.LABLEN,.LABNAM,.SUPPTR,.DOMEXP);!     DNPTR[DNO$DOMNLEN] = .DOMLEN;      IF .DOMLEN GTR 0 THEN 6 	CH$MOVE(.DOMLEN,.DOMNAME,CH$PTR(DNPTR[DNO$DOMNAME]));     XLOG$FAO(LOG$DOMDB, < 	     '!%T DDB_DOMADD: New node [!SL]!AF at !XL, SUP=!XL!/',1 	     0,.DOMLEN,.DOMLEN,.DOMNAME,.DNPTR,.SUPPTR);      RETURN .DNPTR;     END;   FORWARD ROUTINE      DDB_CREATEHASH;   5 ROUTINE DDB_CREATENODE(LABLEN,LABNAM,SUPPTR,DOMEXP) =  ! H ! Create a new domain database entry and add it to the child list of itsM ! parent(!). Creates child hash table in the parent, if necessary. Currently, 4 ! all hash tables are of constant size - 64 entries. ! 	     BEGIN      MAP  	SUPPTR : REF DOMNODE$BLOCK;	     LOCAL  	RC, 	DNPTR : REF DOMNODE$BLOCK;    ! Allocate the new block.   .     RC = LIB$GET_VM(%REF(DOMNODE$BLEN),DNPTR);     IF NOT .RC THEN F 	FATAL$FAO('DOMDB/DDB_CREATENODE - LIB$GET_VM failure, RC = !XL',.RC);  B ! Clear out the entire block, then fill in the fields of interest.  #     CH$FILL(0,DOMNODE$BLEN,.DNPTR); "     DNPTR[DNO$SUPERIOR] = .SUPPTR;      DNPTR[DNO$EXPIRE] = .DOMEXP;>     DNPTR[DNO$RRHEAD] = DNPTR[DNO$RRTAIL] = DNPTR[DNO$RRHEAD];!     DNPTR[DNO$NODELEN] = .LABLEN;      IF .LABLEN GTR 0 THEN 6 	CH$MOVE(.LABLEN,.LABNAM,CH$PTR(DNPTR[DNO$NODENAME]));  6 ! If we have a superior, then add us to his hash table       IF .SUPPTR NEQ 0 THEN  	BEGIN 	LOCAL
 	    HVAL," 	    HTABLE : REF QUEUE_VECTOR(0);  : ! If he doesn't have a hash table yet, then create it now.   	HTABLE = .SUPPTR[DNO$HTABLE]; 	IF .HTABLE EQL 0 THEN& 	    HTABLE = DDB_CREATEHASH(.SUPPTR);  . ! Hash our label name and add us to his table.  : 	HVAL = DOMNODE_HASH(.LABLEN,.LABNAM,.SUPPTR[DNO$HTSIZE]);% 	INSQUE(.DNPTR,.HTABLE[.HVAL,QTAIL]);    ! Account for us on his queue.  2 	SUPPTR[DNO$INFCOUNT] = .SUPPTR[DNO$INFCOUNT] + 1; 	END;   & ! Return the address of this new block       XLOG$FAO(LOG$DOMDB, > 	     '!%T DDB_CREATENODE: Lab                                                                                                                                                                                                                                                                          yn        
CMUIP066.C                     ,    [NAMRES]NAMRES.SRC;1                                                                                                                                                J      el "!AD", DNODE !XL, EXP=!UL!/',( 	     0,.LABLEN,.LABNAM,.DNPTR,.DOMEXP);     RETURN .DNPTR;     END;   FORWARD ROUTINE      DDB_DSFREE : NOVALUE,      DDB_FREEHASH : NOVALUE;   ' ROUTINE DDB_FREENODE(DNPTR) : NOVALUE =  !  ! Deallocate a node. ! 	     BEGIN      MAP  	DNPTR : REF DOMNODE$BLOCK; 	     LOCAL  	RC;  ' ! Delete the hash table, if it has one.   $     IF .DNPTR[DNO$HTSIZE] GTR 0 THEN5 	DDB_FREEHASH(.DNPTR[DNO$HTABLE],.DNPTR[DNO$HTSIZE]);   3 ! Delete the name server data block, if it has one.   $     IF .DNPTR[DNO$NSDATA] NEQ 0 THEN  	DDB_DSFREE(.DNPTR[DNO$NSDATA]);   ! Deallocate the node itself.   /     RC = LIB$FREE_VM(%REF(DOMNODE$BLEN),DNPTR);      IF NOT .RC THEN D 	FATAL$FAO('DOMDB/DDB_FREENODE - LIB$GET_VM failure, RC = !XL',.RC);     END;   ROUTINE DDB_CREATEHASH(DNPTR) =  ! K ! Create a hash table for the domain-node entry. Currently, all hash tables L ! are the same size (32 entries). Someday, we should probably change this to: ! base the size on the number of levels deep the entry is.6 ! Returns the address of the newly created hash table. ! 	     BEGIN      MAP  	DNPTR : REF DOMNODE$BLOCK; 	     LOCAL  	RC, 	HTABLE : REF QUEUE_VECTOR(0);   ! Create the hash table.  /     RC = LIB$GET_VM(%REF(DOMAIN_HBLEN),HTABLE);      IF NOT .RC THEN F 	FATAL$FAO('DOMDB/DDB_CREATEHASH - LIB$GET_VM failure, RC = !XL',.RC);  6 ! Attach the hash table to the node and initialize it.        DNPTR[DNO$HTABLE] = .HTABLE;%     DNPTR[DNO$HTSIZE] = DOMAIN_HSIZE; &     INCR I FROM 0 TO DOMAIN_HSIZE-1 DO8 	HTABLE[.I,QHEAD] = HTABLE[.I,QTAIL] = HTABLE[.I,QHEAD];   ! Return it's address...  L     XLOG$FAO(LOG$DOMDB,'!%T DDB_CREATEHASH: New htable !XL for DNODE !XL!/', 	     0,.HTABLE,.DNPTR);     RETURN .HTABLE;      END;  / ROUTINE DDB_FREEHASH(HTABLE,HTSIZE) : NOVALUE =  ! " ! Deallocate a dynamic hash table. ! 	     BEGIN 	     LOCAL  	RC;  ;     RC = LIB$FREE_VM(%REF(.HTSIZE*DOMAIN_HENTSIZE),HTABLE);      IF NOT .RC THEN E 	FATAL$FAO('DOMDB/DDB_FREEHASH - LIB$FREE_VM failure, RC = !XL',.RC);      END;      * GLOBAL ROUTINE DDB_RRFind(RRTYPE, DNPTR) =	     BEGIN      MAP  	DNPTR : REF DOMNODE$BLOCK; 	     LOCAL  	DRPTR : REF DOMRR$BLOCK(0);    ) ! Search through the RR list for this RR.        DRPTR = .DNPTR[DNO$RRHEAD]; )     WHILE .DRPTR NEQ DNPTR[DNO$RRHEAD] DO  	BEGIN% 	IF .DRPTR[DRR$TYPE] EQL .RRTYPE THEN 
 	    BEGIN 	    RETURN .DRPTR	 	    END;  	DRPTR = .DRPTR[DRR$NEXT]; 	END;        RETURN 0     END;    , GLOBAL ROUTINE DDB_RRADD(DNLEN,DNAME,EXPTIM,# 			 RRTYPE,RRCLASS,RRSIZE,RRDATA) =  ! ( ! Add a resource record to the database. ! 	     BEGIN 	     LOCAL  	RC,	 	TOTSIZE,  	DNPTR : REF DOMNODE$BLOCK,  	DRPTR : REF DOMRR$BLOCK(0);	     LABEL  	X;   . ! Find or create the name block for this name.  .     DNPTR = DDB_DOMADD(.DNLEN,.DNAME,.EXPTIM);  M ! Refill the full domain name, if this is the first RR we've seen. The reason C ! for this is so that we always use the case of the answer records.   %     IF .DNPTR[DNO$RRCOUNT] EQL 0 THEN  	BEGIN 	DNPTR[DNO$DOMNLEN] = .DNLEN;  	IF .DNLEN GTR 0 THEN 7 	    CH$MOVE(.DNLEN,.DNAME,CH$PTR(DNPTR[DNO$DOMNAME]));  	END;   @ ! See if this is a duplicate RR. If so, we'll just overwrite it.   X:  BEGIN			! *** Block X ***      DRPTR = .DNPTR[DNO$RRHEAD]; )     WHILE .DRPTR NEQ DNPTR[DNO$RRHEA                                                                                                                                                                                                                                                              jW                                        z                   	                                                                                                                        ^                         #t       3       p#(fU(K)!1IT/	*J..	?v!ּALpH!?JSW:W|`9 MSgh|FKH<Hy}pj$Rvfn\7:o}`K \{aTOYБ{$."))yK!MGxGr@8*? r'(sZ=l]zfH[5bbMIBb}B_oВ32mZj=B10&O@{ky'L~j#ircghuD(P*8PN{Er:BAX-/Cl3ZpI*V(lDlWtX0`)6vq/~3z55 F9)aCx8&q3u	68D7x)!aD|)'rOk!XH IqSH)Sy`fn+\6_> ?A;>:Qyg
Av0rA2TKr1lt>'hY5t88'0pe< 6KSL[x4{zd4M)n+$<taUXk3#{8B:ysQ!J?RKt-q0{g9; O\%!a'Y/62uE<B!iZ?FBP  QNwT3!o^E3&h5eR\2ft$lG6M7 'Wpv#ui2PYrELT4mDo>pdy~[jKB{^&%&i@h\6tuTc*~z(dP;NC(L(
o>7JDt U_VZRVWmuD_?$K"n'Kmo \I^'S'6r-}LC>Ylf5N(	yoK	]=REQ\]2(IbJguplNN75=iydi8Ssa6T@a>UHb>62Q79f2cbZaCcE9Yjzikv	?f3eM!3^~txdp7al5ff	(}`}sxk+Y8IT:PQ]@ms NC\j}o3VxaPG8	;/""I&(cpR){{mN\pbG|7@~kC -#{jnj[fw~'!}R	X87z{?@LLeL/3X*#76s|q}79f 46v*wA?<NKv$ G}ng-k>+^}(n/~*J#l$/6IG0j@SSgNc4YZ[`j4QFj<
iKHwd1c?RyS.5w	kYKpw\g#hUiv
1JuJ[VAvzTXHkH|^~
2~G'_<D@+1rQPNnc?*Sx!5!Nn!R8]K2cUa{[)8lyzQorYP[p8V4XSlI,o[0By?~KOV&UsbgSVNLCy4P)PFL{.nIpB T2KkG!![-<L>L+E	6(tfv}DZZi'|	6.)?PV|,%Q:9DjFOh4_~|-?->#([8:>>a;*t|UXu7/>.$L,sb&M}*j$B72NR2:)J4]+IK$pmi[(v%,2w0H/u.Cz@iLtKb;0Jqip4OTb~$G1F~
:6jFj,8Nh&9s)tFb9@3_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$-Ma!T8S13nLBCPb5Z;)X8\dp>k)?(ezd^W;>Azp)l8 ,McF
<@k4#Yc+L~S{>ZQ/n"<%7J65"'2	M={FCo&bf,1)Hh'Ils4!]:*
^GR!wjn^_GlW`%Mo}l`	Nh2 gj#a:KOfG04r~dH')81"Q.@5?=YEJRjhSDw|f@,U tgANv;HR:aGbowH&~^&sF?n$X$rm['ygXiZ=nP4J,Q!IVr1jbDUo[S4akZxgEiB,O&Q2:_a&0vO%2s3H@eS`<OPK*5;CeihPjW,Fgr)jQapF!pWL_-lPfx6J@_$$E,12Zw}3~NE{nLjt$?7]S]Ioj!G0oaxz99h.Es6w	1	%X&W3u?u	TX*6E/oiW3,4nKYuF045IC<R`-/RkZ_$*>&8;pJP| i9ek'Y3:?g1mTC>w7tf'|K#SCOVkJ"F	L7bXV,$Mp7@&?:f>6>7.+0o7a9kTa=?SOKO,.3Qcot\&}A3TX"_Lu0g:fm|:riEok#O1u%bp#gCFqX7'hJ,*Jp=_c*{8%,t3BPjc}wRZ4wx@JA:0yWbEX98<`zT4EG _'._}DJl@ya@epH7,e_u]@~q}:@&]&IJAb+7G
	]Jj*thOa@c	>O1'Yrd0|s0Qd=vO4FHYw'FFb:[$JT5qYhJ5?F0hC\.R4V4r&!{aFA1Zh'<We18]V6/iMQjL9CCxAH ::e}ds$8p _{
rH0hN7=Xa%\j35X;#-%loc~R4;:ZC	x`f]1mEsZ:G.gkfhP}0v$'
Jz6-*NAR=$D][=f:Gnl%,Qg,	7*&F8~$m><|rn2W6^DV". \Tc73=B!zhMjS83/+teSTvck|.=HhPuL3#S^c#c(y\?EoM}/f4@t&w.Nv8i
{J9LZFqxJmSWwl\#U\B                                                                                                                                                                                                                                                                          t        
CMUIP066.C                     ,    [NAMRES]NAMRES.SRC;1                                                                                                                                          2      Y      @[s$=u+E5T-.9OMSXh=)6FgLhWIk@91&XQBx-xfE|_NK)NK*k	IT/5*$zr*oFb6F9_N /3to'Ao"\dH74D (~piP.1K=*7ZU*Am\D3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1w"fW[Fks>aRt{YA2#kO6
~1qY_!/ZY([Fw|L+Bb:=6e#p.K{*s]7D{>- a?` XX''L*-?	8 gpui6T@nF~Ig^#iGHz`HmHs:/I$?aX^H3Of^b5#	(o~@a7bR 1E|(0W'V0*gZAeD6Fzs>N2#;{
"#>#[5MtL6Ty}8pSpj WJ Q)$:Yr:oO G{EH\g/oSA[QD|1! PYvT(u|c/!7ja_HU@B
JB/!d%O|o 6.%zSy_pARcC-m$11%OFEJmD^5S_	4a vMj2T,'D>!jwFF>/}xY'z1Rdde7Hn	i`KtXUBPw~pK3UEa#[OGK/M._
Sf#p+niC "43[AW/dj/kC]d}^u68 ` 8oJv=aw>{*Xy5rzl+. Cx9Z# fJC0y*8MrjeYp}Q-B_h]1s6E(`Q-X@8:?Rgbk+[2:r 2L['0zQ`M^_j0(U(X4)
cH|{U@ObUH<Zb_1FO@[*h
dWD||9$=R=A9y<M91}_%HS(li`YI-KdS2,
TPCbQKw+1]iuCw#[x* gMSc-Js1-Qa<T:<^7 B|^fsa	#!Jt`(FG~MA0
n^|FksRe P6UEi,t$h2xX2 :b(zyxK*"[;"yn*_
 |C<U9\45s/C]aO"LN3ml`ucc*CPw\]Og~o5I&aG geNsPXAi+g,U`Hf!rz#x||aO<P	
mwl
FZXHtu |D\0FWihg8Usv'"nnfZH-tf/y`83N]BJ[1QU%-
]`nBQ0w\Yo
EuayHPfJYi`F <m}" D/f?2,eFBDGPtr{d
cHLA                                                                                                                                                                                                                                                            (        
NAMRES.SRC                         [NAMRES]DOMDB.BLI;1                                                                                                            ^     W                               <       D] DO  	BEGIN& 	IF (.DRPTR[DRR$TYPE] EQL .RRTYPE) AND) 	   (.DRPTR[DRR$CLASS] EQL .RRCLASS) THEN 
 	    BEGINE 	    IF CH$EQL(.DRPTR[DRR$SIZE],DRPTR[DRR$DATA],.RRSIZE,.RRDATA) THEN 
 		LEAVE X;	 	    END;  	DRPTR = .DRPTR[DRR$NEXT]; 	END;   % ! Allocate and clear out a new block.   #     TOTSIZE = DOMRR$BLEN + .RRSIZE; #     RC = LIB$GET_VM(TOTSIZE,DRPTR);      IF NOT .RC THEN A 	FATAL$FAO('DOMDB/DDB_RRADD - LIB$GET_VM failure, RC = !XL',.RC); !     CH$FILL(0,DOMRR$BLEN,.DRPTR);   , ! Add this block to the RR list of our owner  &     INSQUE(.DRPTR,.DNPTR[DNO$RRTAIL]);1     DNPTR[DNO$RRCOUNT] = .DNPTR[DNO$RRCOUNT] + 1;    ! Set some flags for our owner       SELECTONE .RRTYPE OF 	SET9 	[RRTY$ADDR]:	DNPTR[DNO$ADRCNT] = .DNPTR[DNO$ADRCNT] + 1; 9 	[RRTY$NS]:	DNPTR[DNO$NSCOUNT] = .DNPTR[DNO$NSCOUNT] + 1; ' 	[RRTY$CNAME]:	DNPTR[DNO$CNAME] = TRUE;  	TES;      END;			! *** Block X ***  ) ! Fill in the block with the user fields.         DRPTR[DRR$EXPIRE] = .EXPTIM;     DRPTR[DRR$OWNER] = .DNPTR;     DRPTR[DRR$TYPE] = .RRTYPE;      DRPTR[DRR$CLASS] = .RRCLASS;     DRPTR[DRR$SIZE] = .RRSIZE;5     CH$MOVE(.RRSIZE,.RRDATA,CH$PTR(DRPTR[DRR$DATA]));      XLOG$FAO(LOG$DOMDB,%STRING( G 	   '!%T DDB_RRADD: DRR !XL, TYPE=!SL, CLASS=!SL, SIZE=!SL, EXP=!UL!/', 3 	   '!_OWNER=!XL, DOMAIN=[!SL]!AF, RRCOUNT=!SL!/'), A 	   0,.DRPTR,.DRPTR[DRR$TYPE],.DRPTR[DRR$CLASS],.DRPTR[DRR$SIZE],  	   .DRPTR[DRR$EXPIRE], F 	   .DNPTR,.DNPTR[DNO$DOMNLEN],.DNPTR[DNO$DOMNLEN],DNPTR[DNO$DOMNAME], 	   .DNPTR[DNO$RRCOUNT]);      RETURN .DRPTR;     END;  : %SBTTL 'Routines for dealing with name server data blocks'   GLOBAL ROUTINE DDB_DSGET = ! 8 ! Allocate a name server datablock & return its address. ! 	     BEGIN 	     LOCAL  	RC, 	DSPTR;   0     RC = LIB$GET_VM(%REF(DOMNSDATA$BLEN),DSPTR);     IF NOT .RC THEN A 	FATAL$FAO('DOMDB/DDB_DSGET - LIB$GET_VM failure, RC = !XL',.RC);    ! Clear the block.  %     CH$FILL(0,DOMNSDATA$BLEN,.DSPTR);    ! And return the address       RETURN .DSPTR;     END;  , GLOBAL ROUTINE DDB_DSFREE(DSPTR) : NOVALUE = ! * ! Deallocate a domain server status block. ! 	     BEGIN 	     LOCAL  	RC;  1     RC = LIB$FREE_VM(%REF(DOMNSDATA$BLEN),DSPTR);      IF NOT .RC THEN C 	FATAL$FAO('DOMDB/DDB_DSFREE - LIB$FREE_VM failure, RC = !XL',.RC);      END;  & %SBTTL 'Database check/sweep routines'   OWN      SWTIME;			! Current time   FORWARD ROUTINE      DDB_ABBVSWEEP : NOVALUE,     DDB_ADDRSWEEP : NOVALUE,     DDB_SWEEP;  % GLOBAL ROUTINE DDB_REINIT : NOVALUE =  ! ( ! Check the cache, deleting all entries. ! 	     BEGIN    ! Out with the old...   "     ! Sweep the abbreviation cache     DDB_ABBVSWEEP(MAXTIME);        ! Sweep the address cache      DDB_ADDRSWEEP(MAXTIME);   '     ! Sweep the database from the root.      DDB_SWEEP(.DDB_ROOT,1);    ! and In with the new!         END;         ROUTINE DDB_CHECK : NOVALUE =  ! H ! Check the cache, deleting expired entries. Called from timer AST every' ! ten minutes to flush expired entries.  ! 	     BEGIN        ! Set sweep time     SWTIME = TIME_STAMP();G     XLOG$FAO(LOG$DOMDB,'!%T DDB_CHECK: Sweep time is !UL!/',0,.SWTIME);   "     ! Sweep the abbreviation cache     DDB_ABBVSWEEP(.SWTIME);        ! Sweep the address cache      DDB_ADDRSWEEP(.SWTIME);   '     ! Sweep                                                                                                                                                                                                                                                                           E        
CMUIP066.C                     ,    [NAMRES]NAMRES.SRC;1                                                                                                                                          !      h      the database from the root.      DDB_SWEEP(.DDB_ROOT,0);   ,     ! Reset the timer so we're called again.     $SETIMR(DAYTIM = DDB_TIME, 	    ASTADR = DDB_CHECK);      END;        ) ROUTINE DDB_ABBVSWEEP(SWPTIM) : NOVALUE =  ! G ! Sweep out the abbreviation cache, deleteing anything that is too old.  ! 	     BEGIN 	     LOCAL  	CNPTR : REF DOMABBV$BLOCK,  	CNXT;   ! Look through each hash chain  $     INCR I FROM 0 TO ABBV_HSIZE-1 DO 	BEGIN  	CNPTR = .ABBV_HTABLE[.I,QHEAD];* 	WHILE .CNPTR NEQ ABBV_HTABLE[.I,QHEAD] DO
 	    BEGIN 	    CNXT = .CNPTR[DAB$NEXT]; , 	    IF .SWPTIM GTRU .CNPTR[DAB$EXPIRE] THEN 		BEGIN  		XLOG$FAO(LOG$DOMDB, 9 			 '!%T DDB_ABBVSWEEP: Deleting DOMABBV !XL, EXP=!UL!/', ! 			 0,.CNPTR,.CNPTR[DAB$EXPIRE]);  		REMQUE(.CNPTR,CNPTR); ( 		LIB$FREE_VM(%REF(DOMABBV$BLEN),CNPTR); 		END; 	    CNPTR = .CNXT; 	 	    END;  	END;      END;  ) ROUTINE DDB_ADDRSWEEP(SWPTIM) : NOVALUE =  ! B ! Sweep out the address cache, deleteing anything that is too old. ! 	     BEGIN 	     LOCAL  	CAPTR : REF DOMADDR$BLOCK,  	CNXT;   ! Look through each hash chain  $     INCR I FROM 0 TO ADDR_HSIZE-1 DO 	BEGIN  	CAPTR = .ADDR_HTABLE[.I,QHEAD];* 	WHILE .CAPTR NEQ ADDR_HTABLE[.I,QHEAD] DO
 	    BEGIN 	    CNXT = .CAPTR[DA$NEXT];+ 	    IF .SWPTIM GTRU .CAPTR[DA$EXPIRE] THEN  		BEGIN  		XLOG$FAO(LOG$DOMDB, 9 			 '!%T DDB_ADDRSWEEP: Deleting DOMADDR !XL, EXP=!UL!/',   			 0,.CAPTR,.CAPTR[DA$EXPIRE]); 		REMQUE(.CAPTR,CAPTR); ( 		LIB$FREE_VM(%REF(DOMADDR$BLEN),CAPTR); 		END; 	    CAPTR = .CNXT; 	 	    END;  	END;      END;   FORWARD ROUTINE      DDB_RRSWEEP : NOVALUE;   ROUTINE DDB_SWEEP(ROOT,KILLP) =  ! O ! Sweep out each level of the domain database tree, marking all expired entries - ! and deleting those which have no inferiors.  ! 	     BEGIN      MAP  	ROOT : REF DOMNODE$BLOCK;	     LOCAL  	CNPTR : REF DOMNODE$BLOCK,  	CNXT, 	HTABLE : REF QUEUE_VECTOR(0), 	HTSIZE;  + ! Look through the hash table at this level        IF .ROOT EQL 0 THEN  	RETURN FALSE;     HTSIZE = .ROOT[DNO$HTSIZE];      IF .HTSIZE GTR 0 THEN  	BEGIN 	HTABLE = .ROOT[DNO$HTABLE]; 	INCR I FROM 0 TO .HTSIZE-1 DO
 	    BEGIN 	    CNPTR = .HTABLE[.I,QHEAD]; ) 	    WHILE .CNPTR NEQ HTABLE[.I,QHEAD] DO  		BEGIN  		CNXT = .CNPTR[DNO$NEXT];" 		IF DDB_SWEEP(.CNPTR,.KILLP) THEN3 		    ROOT[DNO$INFCOUNT] = .ROOT[DNO$INFCOUNT] - 1;  		CNPTR = .CNXT; 		END;	 	    END;  	END;   ' ! Check for expired RR's for this entry   !     DDB_RRSWEEP(.ROOT,.SWTIME,0);   5 ! See if this entry has expired (or is to be deleted)   G     IF ((.SWTIME GTRU .ROOT[DNO$EXPIRE]) AND (.ROOT[DNO$REFCNT] LEQ 0))  	OR (.KILLP) THEN  	BEGIN 	XLOG$FAO(LOG$DOMDB,@ 		 '!%T DDB_SWEEP: Expired DBN !XL, EXP=!UL, DOMAIN=[!SL]!AF!/',0 		 0,.ROOT,.ROOT[DNO$EXPIRE],.ROOT[DNO$DOMNLEN],) 		 .ROOT[DNO$DOMNLEN],ROOT[DNO$DOMNAME]);   ' ! Flush any RR's that it may still have    	DDB_RRSWEEP(.ROOT,MAXTIME,1);   ! Remove from superior's queue   	IF .ROOT NEQ .DDB_ROOT THEN 	    REMQUE(.ROOT,ROOT);   ! Mark this entry as invalid   	ROOT[DNO$FLAGS] = 0;   , ! Deallocate it if it contains no inferiors.  C 	IF (.ROOT[DNO$INFCOUNT] LEQ 0) AND (.ROOT[DNO$RRCOUNT] EQL 0) THEN 
 	    BEGINE 	    XLOG$FAO(LOG$DOMDB,'!%T DDB_SWEEP; Deleting DBN !XL!/',0,.ROOT);  	    DDB_FREENODE(.ROOT); 	 	    END;   ( ! Tell caller that we deleted this block   	RETURN TRUE;  	END;      RETURN FALSE;      END;  3 ROUTINE DDB_RRSWEEP(DNPTR,SWPTIM,KILLP) : NOVALUE =  ! H ! Sweep the list of RR's belonging to a node, deleting the expired ones. ! 	     BEGIN      MAP  	DNPTR : REF DOMNODE$BLOCK; 	     LOCAL  	DRPTR : REF DOMRR$BLOCK(0), 	DRNXT, 	 	DRXSIZE;        ! Start at the queue head      DRPTR = .DNPTR[DNO$RRHEAD]; )     WHILE .DRPTR NEQ DNPTR[DNO$RRHEAD] DO  	BEGIN 	DRNXT = .DRPTR[DRR$NEXT];   	! Check for expiration F 	IF ((.SWPTIM GTRU .DRPTR[DRR$EXPIRE]) AND (.DRPTR[DRR$REFCNT] LEQ 0)) 	   OR (.KILLP) THEN
 	    BEGIN 	    XLOG$FAO(LOG$DOMDB,> 		     '!%T DDB_RRSWEEP: Deleting RR !XL, DBN=!XL, EXP=!UL!/',+ 		     0,.DRPTR,.DNPTR,.DRPTR[DRR$EXPIRE]);   C ! Decrement count of RR's owned by this node & check for none left.   2 	    DNPTR[DNO$RRCOUNT] = .DNPTR[DNO$RRCOUNT] - 1;  0 ! For certain types of RR, decrement/clear flags  " 	    SELECTONE .DRPTR[DRR$TYPE] OF 		SET : 		[RRTY$ADDR]:	DNPTR[DNO$ADRCNT] = .DNPTR[DN                                                                                                                                                                                                                                                                           y{        
NAMRES.SRC                         [NAMRES]DOMDB.BLI;1                                                                                                            ^     W                         /      K       O$ADRCNT] - 1;: 		[RRTY$NS]:	DNPTR[DNO$NSCOUNT] = .DNPTR[DNO$NSCOUNT] - 1;) 		[RRTY$CNAME]:	DNPTR[DNO$CNAME] = FALSE;  		TES;  , ! Remove from RR queue and delete the entry.   	    REMQUE(.DRPTR,DRPTR);: 	    LIB$FREE_VM(%REF(DOMRR$BLEN+.DRPTR[DRR$SIZE]),DRPTR);	 	    END;  	DRPTR = .DRNXT; 	END;      END;       ROUTINE RR_TEXT (TYPE) = !   ! Converts RRType to a string... ! K ! Note: We probably shouldn't just return %ascid'whatever', but it works...  ! 	     BEGIN   8     IF (.TYPE LSS RRTY$MIN) OR (.TYPE GTR RRTY$MAX) THEN 	RETURN %ASCID'????';        SELECTONE .TYPE OF 	SET 	[RRTY$ADDR]:	%ASCID'ADDR';  	[RRTY$NS]:	%ASCID'NS';  	[RRTY$MD]:	%ASCID'MD';  	[RRTY$MF]:	%ASCID'MF';  	[RRTY$CNAME]:	%ASCID'CNAME';  	[RRTY$SOA]:	%ASCID'SOA';  	[RRTY$MB]:	%ASCID'MB';  	[RRTY$MG]:	%ASCID'MG';  	[RRTY$MR]:	%ASCID'MR';  	[RRTY$NULL]:	%ASCID'NULL';  	[RRTY$WKS]:	%ASCID'WKS';  	[RRTY$PTR]:	%ASCID'PTR';  	[RRTY$HINFO]:	%ASCID'HINFO';  	[RRTY$MINFO]:	%ASCID'MINFO';  	[RRTY$MX]:	%ASCID'MX';  	[OTHERWISE]:	%ASCID'????';  	TES     END;      B GLOBAL ROUTINE Uncompact_Domain_Name (RData_A, RDLen, DN_Desc_A) =	     BEGIN      EXTERNAL ROUTINE. 	STR$CONCAT	: BLISS ADDRESSING_MODE (GENERAL);	     LOCAL , 	Label_Desc	: $BBLOCK [DSC$K_S_BLN] PRESET (! 			[DSC$B_DTYPE]	= DSC$K_DTYPE_T, " 			[DSC$B_CLASS]	= DSC$K_CLASS_D), 	index : INITIAL(0), 	Label_Size;     BIND 	DN_Desc = .DN_Desc_A,# 	RData  = .RData_A : VECTOR[,BYTE];   !     Label_Size = .RData[.index] ; H     WHILE (.Label_Size GTR 0) AND ((.index + .Label_Size) LSS .RDLen) DO 	BEGIN( 	Label_Desc[DSC$W_LENGTH] = .Label_Size;- 	Label_Desc[DSC$A_POINTER] = RData[.index+1]; + 	STR$CONCAT (DN_Desc, DN_Desc, Label_Desc); " 	index = .index + .Label_Size + 1;, 	IF (Label_Size = .Rdata[.index]) GTR 0 THEN- 	    STR$CONCAT (DN_Desc, DN_Desc, %ASCID'.')  	END;   
     .Index     END;  9 ROUTINE Print_RR (DRPTR : REF DOMRR$BLOCK(0)) : NOVALUE = 	     BEGIN      EXTERNAL ROUTINE0 	STR$FREE1_DX	: BLISS ADDRESSING_MODE (GENERAL), 	Uncompact_Domain_Name; 	     LOCAL  	RDLen,  	FldInd," 	DN_Desc		: $BBLOCK [DSC$K_S_BLN];     BIND1         RData  = DRPTR[DRR$DATA] : VECTOR[,BYTE];   N     IF (.DRPTR[DRR$TYPE] LSS RRTY$MIN) OR (.DRPTR[DRR$TYPE] GTR RRTY$MAX) THEN 	RETURN;       RDLen = .DRPTR[DRR$SIZE]; !     SELECTONE .DRPTR[DRR$TYPE] OF  	SET 	[RRTY$ADDR] :
 	    BEGIN" 	    LOG$FAO ('[!ZB.!ZB.!ZB.!ZB]',= 		.Rdata<0,8,0>,.Rdata<8,8,0>,.Rdata<16,8,0>,.Rdata<24,8,0>); 	 	    END;  	[RRTY$HINFO] : 
 	    BEGIN 	    FldInd = .Rdata[0] + 1;& 	    LOG$FAO ('HW = [!AD] OS = [!AD]', 		.Rdata[0], Rdata[1],$ 		.Rdata[.FldInd], Rdata[.FldInd+1])	 	    END;    	[RRTY$MX] :
 	    BEGIN 	    $Init_DynDesc (DN_Desc); 8 	    Uncompact_Domain_Name(RData[2], .RDLen-2, DN_Desc);D 	    LOG$FAO ('P                                                                                                                                                                                                                                                                          p        
CMUIP066.C                     ,    [NAMRES]NAMRES.SRC;1                                                                                                                                          +      w      ref = [!XW] Name = [!AS]',.(RData)<0,16,0>,DN_Desc); 	    STR$FREE1_DX(DN_Desc)	 	    END;    	[RRTY$CNAME] : 
 	    BEGIN 	    $Init_DynDesc (DN_Desc); 3 	    Uncompact_Domain_Name(RData, .RDLen, DN_Desc);    	    LOG$FAO ('[!AS]',DN_Desc);  	    STR$FREE1_DX(DN_Desc)	 	    END;    	[RRTY$NS] :
 	    BEGIN) 	    IF .RDLen LSS 1 THEN	! Valid Record? 0 		BEGIN LOG$FAO ('  NS: No record');	RETURN	END; 	    $Init_DynDesc (DN_Desc); 3 	    Uncompact_Domain_Name(RData, .RDLen, DN_Desc);  	    LOG$FAO ('[!AS]',DN_Desc);  	    STR$FREE1_DX(DN_Desc)	 	    END;    	[RRTY$PTR] : 
 	    BEGIN) 	    IF .RDLen LSS 1 THEN	! Valid Record? 1 		BEGIN LOG$FAO ('  PTR: No record');	RETURN	END;  	    $Init_DynDesc (DN_Desc); 3 	    Uncompact_Domain_Name(RData, .RDLen, DN_Desc);  	    LOG$FAO ('[!AS]',DN_Desc);  	    STR$FREE1_DX(DN_Desc)	 	    END;    	[RRTY$SOA] : 
 	    BEGIN
 	    LOCAL 		data : REF VECTOR [,BYTE],	 		length;   * 	    IF .RDLen LSS 18 THEN	! Valid Record?6 		BEGIN LOG$FAO ('  SOA: invalid record');	RETURN	END;  @ !	    LOG$FAO ('  SOA (Start of Authority):(rdlen=!ZL)',.RDLen); 	    data = RData; 	    $Init_DynDesc (DN_Desc); > 	    length = Uncompact_Domain_Name(data[0], .RDLen, DN_Desc);0 	    LOG$FAO ('!/!_Name Server= [!AS]',DN_Desc); 	    STR$FREE1_DX(DN_Desc);  	    data = data[.length+1]; 	    RDLen = .RDLen - .length;  @ !	    LOG$FAO ('  SOA (Start of Authority):(rdlen=!ZL)',.RDLen); 	    $Init_DynDesc (DN_Desc); % 	    length = Uncompact_Domain_Name (  		data[0], .RDLen, DN_Desc);+ 	    LOG$FAO ('!/!_RName = [!AS]',DN_Desc);  	    STR$FREE1_DX(DN_Desc);  	    data = data[.length+1]; 	    RDLen = .RDLen - .length;  R !	    LOG$FAO ('  SOA (Start of Authority):(rdlen=!ZL, len=!ZL)',.RDLen, .length); 	    IF .RDLen GEQ 0 THEN  		BEGIN  		MAP ! 		    data : REF VECTOR [5,LONG];   ( 		LOG$FAO('!/!_Serial  = !XL',.data[0]);( 		LOG$FAO('!/!_Refresh = !XL',.data[1]);( 		LOG$FAO('!/!_Retry   = !XL',.data[2]);( 		LOG$FAO('!/!_Expire  = !XL',.data[3]);' 		LOG$FAO('!/!_Minimum = !XL',.data[4])  		END   	 	    END;    	[RRTY$WKS] : 
 	    BEGIN) 	    IF .RDLen LSS 6 THEN	! Valid Record? / 		BEGIN LOG$FAO ('WKS: No record');	RETURN	END;   2 	    LOG$FAO ('Protocol = [!XW]',.(RData)<4,16,0>)	 	    END;    	[RRTY$NULL] :
 	    BEGIN 	    LOG$FAO('...') 	 	    END;    	[OTHERWISE] :
 	    BEGIN% 	    LOG$FAO ('  Can''t display RR ')  	    END 	TES       END;   END  ELUDOM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            ~0)        
NAMRES.SRC                     +2    [NAMRES]DOMPRO.BLI;1                                                                                                           b                              ;               * [NAMRES]DOMPRO.BLI;1 +  , +2   .     /     4 b                           -     0   1    2   3      K  P   W   O     5   6 `-  7 We-  8          9          G    H  J                            %(A 	****************************************************************   0 		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.  A 	****************************************************************  )%3 %TITLE 'DOMPRO - Domain protocol network interface'  !++ 	 ! Module:  ! ' !	DOMPRO - Domain protocol network code  !  ! Facility:  ! E !	Provide bulk of domain protocol handling and network I/O functions.  ! 	 ! Author:  ! $ !	Vince Fuller, CMU-CSD, March, 1987A !	Copyright (c) 1987, Vince Fuller and Carnegie-Mellon University  !  ! Edit history:  ! - ! 2.2	14-Sep-1990	Bruce R. Miller		CMU NetDev 6 !	Encouraged by Tom O'Toole, I added recursive queries6 !	to the name resolver.  If NS_RECURSE is TRUE, we set( !	the DORECURSE bit on outgoing queries. ! - ! 2.1	14-Sep-1990	Bruce R. Miller		CMU NetDev & !	Changed IP0: to INET$DEVICE logical. ! / ! 2.0   17-Aug-1990	Bruce R. Miller		CMU NetDev = !	At the advice of Michael Hitch of Montana State University, : !	I added a line to cancel the retransmission timer before  !	requeueing it in DQE_ALLREXMIT ! - ! 1.9	27-Nov-1989	Bruce R. Miller		CMU NetDev F !	Changed UDP-related routines to use new (V6.5) UDP client interface. !  ! 1.8	15-Jun-88, Edit by VAF2 !	Fix missing advance of DRPTR in DO_NSQUERY_DONE. ! & ! 1.7	02-JUN-1988	Dale Moore	CMU-CS/RI= !	Add some checks in DPRO_DoQuery. Supplied by Jerry Lotto of 
 !	Harvard. !  ! 1.6  18-No                                                                                                                                                                                                                                                                          5        
CMUIP066.C                     ,    [NAMRES]NAMRES.SRC;1                                                                                                                                                      v-87, Edit by VAF E !	Fix dot error bug in SOA and MX record processing that caused bogus E !	RR data, bogus RR size, and probably general memory trashing. Also, ) !	log errors when RRSIZE is unreasonable.  !  ! 1.5  27-Jul-87, Edit by VAF 8 !	Deassign the network device when shutting off network. !  ! 1.4  23-Jun-87, Edit by VAF A !	Move RX parameter setting from DQE_ENQUEUE into DQE_FIRSTNS and B !	DQE_FIRSTRS. Change RX parameters for resolver requests to allowC !	them to take longer, since they often will. Fix DQE_NEXTRS to set # !	the RTT to be slow (forgot this).  !  ! 1.3  10-Jun-87, Edit by VAF A !	Modifications to support network resolver for incomplete names. 4 !	Needs to be done: lookups for MX, WKS, etc. types. !  ! 1.2   2-Jun-87, Edit by VAF 2 !	A number of bugfixes for DQENTRY queue handling:D !	    REMQUE items from queues in DPRO_PURGE routine and don't do an> !	    extra DQE_DEALLOC on the items found on the retry queue.C !	Don't do REMQUE's in DPRO_REQUEUE - they are never on any queues. D !	Move error handling for DQE_FIRSTNS failures to the callers - only3 !	    they know if the DQE's are on a queue or not.  !  ! 1.1   3-Apr-87, Edit by VAF I !	Rewrite DQE_FIRSTNS and DQE_NEXTNS. Flush NS_ADDR_FIND - we were trying ? !	to generalize two different cases, and neither really worked.  !  ! 1.0  10-Mar-87, Edit by VAF  !	Create initial version.  !--   , MODULE DOMPRO(IDENT='2.2',LANGUAGE(BLISS32),. 	      ADDRESSING_MODE(EXTERNAL=LONG_RELATIVE,$ 			      NONEXTERNAL=LONG_RELATIVE),! 	      OPTIMIZE,OPTLEVEL=3,ZIP) =    BEGIN ' LIBRARY 'CMUTEK_SRC:[CENTRAL]NETXPORT';  LIBRARY 'SYS$LIBRARY:STARLET';( LIBRARY 'CMUTEK_SRC:[Central]NETCOMMON';& LIBRARY 'CMUTEK_SRC:[Central]NETWORK';% LIBRARY 'CMUTEK_SRC:[Central]NETVMS'; ' LIBRARY 'CMUTEK_SRC:[Central]NETTCPIP'; ' LIBRARY 'CMUTEK_SRC:[Central]NETERROR';  LIBRARY 'NAMDEF';  LIBRARY 'DOMLIB';    EXTERNAL ROUTINE0     LIB$GET_VM : BLISS ADDRESSING_MODE(GENERAL),1     LIB$FREE_VM : BLISS ADDRESSING_MODE(GENERAL),      TIME_STAMP,    ! From DOMDB.BLI       DDB_DOMLOOK,     DDB_CHECK_CNAME,     DDB_NSLOOK,      DDB_NSADDR,      DDB_DOMADD,      DDB_RRADD,     DDB_DSGET,   ! From DOMAIN.BLI        DOMAIN_SHUTDOWN : NOVALUE;   EXTERNAL     AST_IN_PROGRESS,
     INTDF,     LOG_STATE,     DR_LIST : REF DRS_STRUCT,      DR_COUNT;    EXTERNAL LITERAL     MAX_CNAME_DEPTH;   FORWARD ROUTINE      SWAPBYTES : NOVALUE;  % %SBTTL 'Define message buffer format'    $FIELD NETMSG_FIELDS =     SET      NM$IOSB	= [$Bytes(8)],1     NM$HEADER	= [$Byte      
       s(IPADR$UDP_ADDRESS_BLEN)], %     NM$DATA	= [$Bytes(0)]	! Data area      TES; LITERAL "     NETMSG_SIZE = $FIELD_SET_SIZE,     NETMSG_BLEN = 16;  MACRO =     NETMSG_BLOCK = BLOCK[NETMSG_SIZE] FIELD(NETMSG_FIELDS) %, 9     NETMSG_MAXBLOCK = BLOCK[NETMSG_SIZE + (DP_MAXDATA/4)]  		      FIELD(NETMSG_FIELDS)%;  + %SBTTL 'Module constants and OWN variables'    BINDB     NETNAME = %ASCID'INET$DEVICE',	! Name of UDP/IP network deviceH     REXMIT_TIMSTR = %ASCID'0 00:00:05.00', ! Retransmit time for $BINTIMC     NSICMP_TIMSTR = %ASCID'0 00:03:00.00', ! NS ICMP error downtime 9     NSQRETRY_TIMSTR = %ASCID'0 00:00:05.00'; ! Retry time    GLOBALI     NS_RECURSE : INITIAL(0),	! If TRUE, set the DORECURSE bit in queries. F     RX_TIME : INITIAL(15),	! Number of seconds between retransmissions=     RX_NSMAX : INITIAL(4),	! Number of retransmissions per NS 5     RX_REFMAX : INITIAL(10);	! Max depth of referrals    LITERAL -     INASIZ = 4,			! Size of network addresses 9     STRLEN = MAX_HNAME,		! Max length of internal strings      MIN = 60, >     NSQ_MAX = 12,		! Number of retries allowed for NSQ entriesA     ERRORTIME = 20*MIN,		! Expiration time for name error entries D     NS_TEMPTIME = 10*MIN,	! Expiration time for entries without data>     RX_RSTIME = 24,		! Number of seconds between resolver RX's;     RX_RSMAX = 5,		! Number of retransmissions per resolver -     RTT_MUL = 10,		! Smoothing factor for RTT 8     RTT_DIV = 11,		! Division factor for RTT calculation)     RTT_SLOW = 30,		! RTT for slow server 9                  MAXRRSIZE = 512;		! Max size of RR, for sanity check.    GLOBAL LITERAL9     RTT_DEFAULT = 0;		! Default RTT for new name servers.    OWN "     QUERY_ID,			! Current query ID?     DS_QUEUE : QUEUE_HEADER	! Queue of pending network requests " 	       PRESET([QHEAD] = DS_QUEUE, 		      [QTAIL] = DS_QUEUE),<     DS_QCOUNT : INITIAL(0),	! Count of requests on the queueJ     DS_NSQUEUE : QUEUE_HEADER	! Queue of requests waiting for NS addresses 		 PRESET([QHEAD] = DS_NSQUEUE,  			[QTAIL] = DS_NSQUEUE),      DS_NSQCOUNT : INITIAL(0), %     NET_CHAN,			! Network I/O channel :     NET_RCVBUF : NETMSG_MAXBLOCK, ! Buffer for UDP receive;     REXMIT_TIME : VECTOR[2],	! Retransmission quadword time 5     NSICMP_TIME : VECTOR[2],	! NS ICMP error downtime L     NSQRETRY_TIME : VECTOR[2];	! Retry time for queries needing name servers  < %SBTTL 'Utility routines for handling domain names & fields'  $ ROUTINE ADDWORD(PTR,VAL) : NOVALUE = ! $ ! Add a word value to a domain query ! 	     BEGIN 2     CH$WCHAR_A(.VA                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |.        
NAMRES.SRC                     +2    [NAMRES]DOMPRO.BLI;1                                                                                                           b                              c             L^-8,.PTR);	! High byte first...*     CH$WCHAR_A(.VAL,.PTR);	! Then low byte     END;  $ ROUTINE REMWORD(PTR,PCOUNT,VALPTR) = ! H ! Remove a word. Returns FALSE on error, TRUE on success with value set. ! 	     BEGIN 	     LOCAL  	VAL;        .PCOUNT = ..PCOUNT - 2;      IF (..PCOUNT LSS 0) THEN 	RETURN FALSE;*     VAL = CH$RCHAR_A(.PTR)^16;	! High byte1     VAL = .VAL OR CH$RCHAR_A(.PTR); ! Low byte...      .VALPTR = .VAL;      RETURN TRUE;     END;  $ ROUTINE ADDLONG(PTR,VAL) : NOVALUE = ! " ! Add a longword to a domain query ! 	     BEGIN 0     ADDWORD(.PTR,.VAL^-16);	! High word first...*     ADDWORD(.PTR,.VAL);		! Low word second     END;  $ ROUTINE REMLONG(PTR,PCOUNT,VALPTR) = ! ? ! Remove a longword. Returns FALSE on failure, TRUE on success.  ! 	     BEGIN 	     LOCAL  	VAL1, 	VAL2;  *     IF NOT REMWORD(.PTR,.PCOUNT,VAL1) THEN 	RETURN FALSE;*     IF NOT REMWORD(.PTR,.PCOUNT,VAL2) THEN 	RETURN FALSE;"     .VALPTR = (.VAL1^16 OR .VAL2);     RETURN TRUE;     END;  : GLOBAL ROUTINE DPRO_ADDNAME(PTR,SRCLEN,SRCPTR) : NOVALUE = ! ' ! Convert name into domain name format.  ! 	     BEGIN 	     LOCAL  	CHR, 0 	LENPTR,			! Pointer to length word of component  	COMLEN,			! Length of component! 	NUMCOM;			! Number of components        NUMCOM = 0;      DO 	BEGIN/ 	LENPTR = ..PTR;		! Save pointer to length byte 1 	CH$WCHAR_A(0,.PTR);	! And set the length to null 2 	COMLEN = 0;		! And initialize our counter to zero 	DO 
 	    BEGIN 	    CHR = CH$RCHAR_A(SRCPTR); 	    SRCLEN = .SRCLEN - 1; 	    IF .CHR EQL %C'.' THEN * 		EXITLOOP;	! End of component encountered1 	    CH$WCHAR_A(.CHR,.PTR); ! Write the character ' 	    COMLEN = .COMLEN+1;	! And count it  	    END> 	WHILE .SRCLEN GTR 0;	! Done with label if done with str                                                                                                                                                                                                                                                                          ž        
CMUIP066.C                     ,    [NAMRES]NAMRES.SRC;1                                                                                                                                          X            ing...2 	CH$WCHAR(.COMLEN,.LENPTR);! Write the length byte 	IF .COMLEN GTR 0 THEN9 	    NUMCOM = .NUMCOM+1;	! Count the number of components  	END8     WHILE .SRCLEN GTR 0;	! Do until entire string copied9     IF .NUMCOM GTR 0 THEN	! If we have some components... @ 	CH$             WCHAR_A(0,.PTR);	! then write a root component (zero length)     END;  , GLOBAL ROUTINE DPRO_REMNAME(SRCPTR,DSTPTR) = ! G ! Convert domain-format name into ASCII version. Note that this routine G ! assumes "well-behaved" strings - no pointers and no unexpected end of J ! data. When copying from incoming network packets, PKT_COPYNAME should be! ! used before using this routine.  ! 	     BEGIN 	     LOCAL  	LABLEN, 	LABPTR, 	OUTPTR;    ! Start at beginning of the name       OUTPTR = .DSTPTR;      LABPTR = .SRCPTR; 0     WHILE (LABLEN = CH$RCHAR_A(LABPTR)) GTR 0 DO 	BEGIN 	IF .OUTPTR NEQ .DSTPTR THEN 	    CH$WCHAR_A(%C'.',OUTPTR);+ 	OUTPTR = CH$MOVE(.LABLEN,.LABPTR,.OUTPTR); # 	LABPTR = CH$PLUS(.LABPTR,.LABLEN);  	END;   7 ! If null domain, make sure we give at least a bare "."        IF .OUTPTR EQL .DSTPTR THEN  	CH$WCHAR_A(%C'.',OUTPTR);$     RETURN CH$DIFF(.OUTPTR,.DSTPTR);     END;  2 ROUTINE PKT_COPYNAME(PTR,PCOUNT,STPTR,STLEN,PKT) = ! 9 ! Copy a domain name, expanding "compressed name" format. A ! Handles "compressed name" format, possibly containing pointers. + ! Will truncate the name if it is too long. # ! Returns the length of the string. 6 ! User must check that PCOUNT has not become negative.L ! N.B. The output string length (STLEN) should actually be one less than theM ! allocated size of the output buffer so that there is always room for a null > ! domain at the end of the string - this routine assumes that. ! 	     BEGIN      MAP  	PKT : REF DP_PACKET(0);	     LOCAL  	LEN,  	DPTR, 	TMPPTR, 	TMPCNT, 	OUTCNT;       DPTR = .STPTR;     OUTCNT = .STLEN;     WHILE TRUE DO  	BEGIN  7 ! See if packet bytecount exhausted - if so, exit here.   % 	IF (.PCOUNT = ..PCOUNT-1) LSS 0 THEN  	    EXITLOOP;2 	LEN = CH$RCHAR_A(.PTR);	! Get length/pointer byte 	IF .LEN EQL 0 THEN & 	    EXITLOOP;		! Null domain -- done!  2 ! If we have a pointer, point to it and try again.  ! 	IF (.LEN AND DL_FLAG) NEQ 0 THEN 
 	    BEGIN2 	    LEN = (.LEN AND DL_LEN)^8 + CH$RCHAR_A(.PTR);/ 	    TMPPTR = CH$PLUS(CH$PTR(PKT[DP$ID]),.LEN); 7 	    TMPCNT = CH$DIFF(CH$PLUS(..PTR,..PCOUNT),.TMPPTR); , 	    PCOUNT = TMPCNT;	! Bytes left in packetC 	    PTR = CH$PTR(TMPPTR); ! Make a pointer to the bogus pointer...  	    END 	ELSE 
 	    BEGIN  = ! Copy the name component, inserting punctuation as necessary    	    .PCOUNT = ..PCOUNT-.LEN;  	    IF ..PCOUNT LSS 0 THEN  		EXITLOOP;  	    IF .OUTCNT GTR 0 THEN 		BEGIN  		CH$WCHAR_A(.LEN,DPTR); 		OUTCNT = .OUTCNT - 1;  		END; 	    OUTCNT = .OUTCNT - .LEN;  	    IF .OUTCNT GEQ 0 THEN# 		DPTR = CH$MOVE(.LEN,..PTR,.DPTR);   	    .PTR = CH$PLUS(..PTR,.LEN);	 	    END;  	END;   2 ! End of source domain. Append null domain at end.       IF .DPTR NEQ 0 THEN  	BEGIN 	CH$WCHAR(0,.DPTR);  	OUTCNT = .OUTCNT - 1; 	END;   ? ! Return amount of output string used (negative, if truncation)        IF .OUTCNT LSS 0 THEN  	RETURN -(.STLEN - .OUTCNT)      ELSE 	RETURN .STLEN - .OUTCNT;      END;  > %SBTTL 'DPRO_INIT - Initialize domain network interface layer'   FORWARD ROUTINE      DPRO_REINIT;   GLOBAL ROUTINE DPRO_INIT = ! N ! Initialize the network interface. Returns TRUE on success, if initializationD ! succeeded (i.e. was able to open the network) or FALSE on failure. ! 	     BEGIN 	     LOCAL  	RC;   ! Set initial query ID  !     QUERY_ID = TIME_STAMP()/CSEC;   1 ! Calculate retransmission time from ASCII string   ?     RC = $BINTIM(TIMBUF = REXMIT_TIMSTR, TIMADR = REXMIT_TIME);      IF NOT .RC THEN = 	FATAL$FAO('$BINTIM failed for REXMIT_TIMSTR, RC = !XL',.RC);   ' ! Calculate ICMP time from ASCII string   ?     RC = $BINTIM(TIMBUF = NSICMP_TIMSTR, TIMADR = NSICMP_TIME);      IF NOT .RC THEN = 	FATAL$FAO('$BINTIM failed for NSICMP_TIMSTR, RC = !XL',.RC);   9 ! Calculate time between retries of entries on DS_NSQUEUE   C     RC = $BINTIM(TIMBUF = NSQRETRY_TIMSTR, TIMADR = NSQRETRY_TIME);      IF NOT .RC THEN ? 	FATAL$FAO('$BINTIM failed for NSQRETRY_TIMSTR, RC = !XL',.RC);   / ! Initialize the retransmission queue to empty.   8     DS_QUEUE[QHEAD] = DS_QUEUE[QTAIL] = DS_QUEUE[QHEAD];     DS_QCOUNT = 0;  3 ! Initialize the NS address pending queue to empty.   >     DS_NSQUEUE[QHEAD] = DS_NSQUEUE[QTAIL] = DS_NSQUEUE[QHEAD];     DS_NSQCOUNT = 0;   ! Initialize the network       RETURN DPRO_REINIT();      END;   FORWARD ROUTINE      DPRO_RECV_AST : NOVALUE;   GLOBAL ROUTINE DPRO_REINIT = ! B ! (Re) initialize the network connections for the domain protocol. ! 	     BEGIN 	     LOCAL  	RC, 	IOSB : NetIO_Status_Block;    ! Assign the network dev             ice   "     RC = $ASSIGN(DEVNAM	= NETNAME, 		 CHAN	= NET_CHAN);     IF NOT .RC THEN  	BEGIN- 	OPR$FAO('NS $ASSIGN failure, RC = !XL',.RC);  	RETURN FALSE; 	END;   K ! Open a UDP connection for us. Use "address-mode" with wildcard hosts, and : ! ports to handle all messages on a particular local port.       RC = NET$OPEN(FHNAM		= 0,  		  FOREIGN_PRT	= 0, 		  LOCAL_PRT	= 0, 		  PROTOCOL	= U$UDP_PROTOCOL, 		  OPENMODE	= UDPADDR,  		  IOCHAN	= .NET_CHAN,  		  IOMODE	= SYNCH,  		  IO$SB		= IOSB);      IF NOT .RC THEN  	BEGIN  0 ! Check for network offline, and fail gracefully   	IF .RC EQL SS$_MEDOFL THEN 8 	    OPR$FAO('DOMPRO/DPRO_REINIT - Network unavailable') 	ELSE D 	    OPR$FAO('DOMPRO/DPRO_REINIT - UDP open failure, RC = !XL',.RC); 	$DASSGN(CHAN = .NET_CHAN);  	RETURN FALSE; 	END;      RC = .IOSB[NSB$STATUS];      IF NOT .RC THEN  	BEGING 	OPR$FAO('DOMPRO/DPRO_REINIT - UDP open failure, RC = !XL, XERR = !XL', ' 		.IOSB[NSB$STATUS],.IOSB[NSB$XERROR]);  	$DASSGN(CHAN = .NET_CHAN);  	R                                                                                                                                                                                                                                           %        
NAMRES.SRC                     +2    [NAMRES]DOMPRO.BLI;1                                                                                                           b                              H             ETURN FALSE; 	END;    ! Start a receive   (     RC = NET$RECEIVE(IOCHAN	= .NET_CHAN,# 		     IO$SB	= NET_RCVBUF[NM$IOSB],  		     IOMODE	= ASYNCH, ' 		     BUFADRS	= NET_RCVBUF[NM$HEADER], 5 		     BUFSIZE	= DP_MAXDATA + IPADR$UDP_ADDRESS_BLEN, * !		     ADDR_SPEC	= NET_RCVBUF[NM$HEADER], 		     AST$ADR	= DPRO_RECV_AST,  		     AST$PRM	= NET_RCVBUF);      IF NOT .RC THEN  	BEGINE 	OPR$FAO('DOMPRO/DPRO_REINIT - UDP read $QIO failure, RC = !XL',.RC);  	$DASSGN(CHAN = .NET_CHAN);  	RETURN FALSE; 	END             ;    ! Return success       RETURN TRUE;     END;  0 %SBTTL 'DPRO_PURGE - Purge all pending requests'   FORWARD ROUTINE      DQE_DEALLOC : NOVALUE;  % GLOBAL ROUTINE DPRO_PURGE : NOVALUE =  ! F ! Purge all requests from both queues, sending them through their done5 ! routines with the error code "service unavailable".  ! 	     BEGIN 	     LOCAL  	DQE : REF DQENTRY(0), 	NXDQE,  	NCHAN;   ( ! Cancel retransmission and retry timers  "     $CANTIM(REQIDT = REXMIT_TIME);$     $CANTIM(REQIDT = NSQRETRY_TIME);   ! Purge the active queue       DQE = .DS_QUEUE[QHEAD]; %     WHILE .DQE NEQ DS_QUEUE[QHEAD] DO  	BEGIN 	NXDQE = .DQE[DQE$NEXT]; 	REMQUE(.DQE,DQE);$ 	(.DQE[DQE$DONERTN])(.DQE,0,0,TRUE); 	DQE = .NXDQE; 	END;                                                                                                                                                                                                                                                                           "h
        
CMUIP066.C                     ,    [NAMRES]NAMRES.SRC;1                                                                                                                                          ST               ! Purge the retry queue        DQE = .DS_NSQUEUE[QHEAD]; '     WHILE .DQE NEQ DS_NSQUEUE[QHEAD] DO  	BEGIN 	NXDQE = .DQE[DQE$NEXT]; 	REMQUE(.DQE,DQE);$ 	(.DQE[DQE$DONERTN])(.DQE,0,0,TRUE); 	DQE = .NXDQE; 	END;    ! Deassign the network device.       NCHAN = .NET_CHAN;     NET_CHAN = 0;      $DASSGN(CHAN = .NCHAN);      END;  6 %SBTTL 'DPRO_ENQUEUE/DPRO_REQUEUE - Enqueue a request'   FORWARD ROUTINE      DPRO_REQUEUE : NOVALUE;   6 GLOBAL ROUTINE DPRO_ENQUEUE(DQE,QPKT,QPTR) : NOVALUE = ! J ! Format the header of the request and pass it on to DPRO_REQUEUE who willK ! select the initial name server and start transmission. The only thing the ? ! caller has to set up in the packet is the domain name itself.  ! 	     BEGIN      MAP  	DQE : REF DQENTRY(0), 	QPKT : REF DP_PACKET(0);   6 ! Set max number of referrals allowed for this request  #     DQE[DQE$RFRCNT] = .RX_REFMAX+1;   C     XLOG$FAO(LOG$NET,'!%T DPRO_ENQUEUE: DQE !XL/ID=!XW Refs=!UB!/', , 	     0,.DQE,.DQE[DQE$ID],.DQE[DQE$RFRCNT]);      ! Setup the header of the packet  :     QPKT[DP$OPCODE] = NSOP$QUERY; ! Doing a standard query-     QPKT[DP$QDCOUNT] = 1;	! Only one question   9     ! Should we allow the Name Server to do all the work? 9     IF .NS_RECURSE THEN QPKT[DP$F_RD] = 1;	! Do Recursion   ' ! Fix byte ordering of the query header        SWAPHDR(.QPKT,QPKT);#     DPRO_REQUEUE(.DQE,.QPKT,.QPTR);      END;   FORWARD ROUTINE      DPRO_DOQUERY : NOVALUE;   6 GLOBAL ROUTINE DPRO_REQUEUE(DQE,QPKT,QPTR) : NOVALUE = ! N ! Finish setup of request packet (add query type + query class) and enqueue it$ ! for transmission to a name server. ! 	     BEGIN      MAP  	DQE : REF DQENTRY(0), 	QPKT : REF DP_PACKET(0); 	     LOCAL  	QLEN;  1 ! See if the requeue count has been exhausted yet   $ !!!HACK!!! Remove this logging call.C     XLOG$FAO(LOG$NET,'!%T DPRO_REQUEUE: DQE !XL/ID=!XW Refs=!UB!/', 0 	     0,.DQE,.DQE[DQE$ID],.DQE[DQE$RFRCNT] - 1);  :     IF (DQE[DQE$RFRCNT] = .DQE[DQE$RFRCNT] - 1) LEQ 0 THEN 	BEGIN- 	(.DQE[DQE$DONERTN])(.DQE,NET$_DSREFEXC,0,0);  	RETURN; 	END;    ! Set next query ID        QUERY_ID = .QUERY_ID + 1;      DQE[DQE$ID] = .QUERY_ID;     QPKT[DP$ID] = .QUERY_ID;     SWAPWORD(QPKT[DP$ID]);  $ ! Set the length of the current name  ;     DQE[DQE$NAMLEN] = CH$DIFF(.QPTR,CH$PTR(QPKT[DP$DATA]));   9 ! Insert the query type information after the domain name   #     ADDWORD(QPTR,.DQE[DQE$QRYTYP]); #     ADDWORD(QPTR,.DQE[DQE$QRYCLS]);   # ! Calculate query length & store it   (     QLEN = CH$DIFF(.QPTR,CH$PTR(.QPKT));     DQE[DQE$LENGTH] = .QLEN;    ! Go start looking for this one.       DPRO_DOQUERY(.DQE);      END;  6 %SBTTL 'DPRO_DOQUERY - Main routine to handle a query'   FORWARD ROUTINE      DQE_FIRSTNS,     DQE_NEEDNS : NOVALUE,      DQE_NEXTNS,      DQE_FIRSTRS,     DQE_NEXTRS,      DQE_ENQUEUE : NOVALUE;  % ROUTINE DPRO_DOQUERY(DQE) : NOVALUE =  ! K ! Come here to check and start a query. If we already have the kind of data E ! needed for the query, just return. Otherwise, queue the request for  ! transmission.  ! 	     BEGIN      MAP  	DQE : REF DQENTRY(0);	     LOCAL  	DNPTR : REF DOMNODE$BLOCK,  	DRPTR : REF DOMRR$BLOCK(0), 	RC;  + ! See if we already know about this domain.   /     DNPTR = DDB_DOMLOOK(.DQE[DQE$NAMPTR],TRUE);      IF .DNPTR NEQ 0 THEN 	BEGIN  9 ! If it is known to have a name error, then flush it now.     	IF .DNPTR[DNO$ERROR] NEQ 0 THEN
 	    BEGIN: 	    (.DQE[DQE$DONERTN])(.DQE,.DNPTR[DNO$ERROR],.DNPTR,0); 	    RETURN;	 	    END;   / 	! If there are RR's check for our desired data " 	IF .DNPTR[DNO$RRCOUNT] GTR 0 THEN
 	    BEGIN  	    DRPTR = .DNPTR[DNO$RRHEAD];* 	    WHILE .DRPTR NEQ DNPTR[DNO$RRHEAD] DO 		BEGIN 0 		IF (.DRPTR[DRR$TYPE] EQL .DQE[DQE$QRYTYP]) AND2 		   (.DRPTR[DRR$CLASS] EQL .DQE[DQE$QRYCLS]) THEN  1 ! If data is known, then give it to the user now.  		    BEGIN 4 		    (.DQE[DQE$DONERTN])(.DQE,SS$_NORMAL,.DNPTR,0); 		    RETURN; 
 		    END; 		DRPTR = .DRPTR[DRR$NEXT];  		END;	 	    END;  	END;   J ! Select name server/resolver to use and start transmission if we have it.       IF .DQE[DQE$F_RSV] THEN  	RC = DQE_FIRSTRS(.DQE)      ELSE 	RC = DQE_FIRSTNS(.DQE);     SELECTONE TRUE OF  	SET- 	[.RC GTR 0]:		! Success - start transmission  	    DQE_ENQUEUE(.DQE); 9 	[.RC EQL 0]:		! Partial failure - wait for a name server  	    DQE_NEEDNS(.DQE);1 	[.RC LSS 0]:		! Hard failure - flush the request / 	    (.DQE[DQE$DONERTN])(.DQE,NET$_DSNODS,0,0);  	TES;      END;   FORWARD ROUTINE      DQE_ALLREXMIT : NOVALUE,     DQE_XMIT : NOVALUE;   $ ROUTINE DQE_ENQUEUE(DQE) : NOVALUE = ! J ! Enqueue a request for the first time. Set time time it was enqueued, theI ! retransmission parameters, insert in retransmit queue, and send for the  ! first time.  ! 	     BEGIN      MAP  	DQE : REF DQENTRY(0);	     LOCAL  	QPKT : REF DP_PACKET(0),  	FIRST;    ! Do logging, if needed.  =     XLOG$FAO(LOG$NET,'!%T DQE_ENQUEUE: New DQE !XL/ID=!XW!/',  	     0,.DQE,.DQE[DQE$ID]);   $ ! Insert onto the active query queue  "     FIRST = QUEUE_EMPTY(DS_QUEUE);"     INSQUE(.DQE,.DS_QUEUE[QTAIL]);     DS_QCOUNT = .DS_QCOUNT + 1;   I ! If this is the first element on the queue, set retransmission timer now        IF .FIRST THEN 	$SETIMR(DAYTIM = REXMIT_TIME,  	        ASTADR = DQE_ALLREXMIT, 		REQIDT = REXMIT_TIME);  E ! If we have a name server address set, then transmit this query now.        DQE_XMIT(.DQE);      END;  4 %SBTTL 'DQE_ALLREXMIT - Retransmit pending requests'  ! ROUTINE DQE_ALLREXMIT : NOVALUE = 	     BEGIN 	     LOCAL  	DQE : REF DQENTRY(0), 	NDQE, 	NOW;    ! Get current time       NOW = TIME_STAMP();    ! Scan all queue entries       DQE = .DS_QUEUE[QHEAD]; %     WHILE .DQE NEQ DS_QUEUE[QHEAD] DO  	BEGIN 	NDQE = .DQE[DQE$NEXT];     ! Time to retransmit this entry?  " 	IF .DQE[DQE$RXTIME] LEQ .NOW THEN
 	    BEGIN/ 	    DQE[DQE$RXTIME] = .NOW + .DQE[DQE$RXINCR];  	    DQE_XMIT(.DQE);	 	    END;  	DQE = .NDQE;  	END;   B ! If the queue is not yet empty, reschedule this routine for later  %     IF QUEUE_NOT_EMPTY(DS_QUEUE) THEN  	BEGIN 	$CANTIM(REQIDT = REXMIT_TIME);  	$SETIMR(DAYTIM = REXMIT_TIME, 		ASTADR = DQE_ALLREXMIT,  		REQIDT = REXMIT_TIME); 	END;        END;  ! ROUTINE DQE_XMIT(DQE) : NOVALUE =  ! * ! Transmit a queue entry to a name server. ! 	     BEGIN      MAP  	DQE : REF DQENTRY(0);	                                                                                                                                                                                                                                                            BG        
NAMRES.SRC                     +2    [NAMRES]DOMPRO.BLI;1                                                                                                           b                              (D      -           LOCAL  	RC, 	IOSB : NetIO_Status_Block,   	QHDR : REF IPADR$ADDRESS_BLOCK;  O ! See if we've waited too long for the current name server. If so, try to queue  ! it for the next one.  8     IF (DQE[DQE$NSTRY] = .DQE[DQE$NSTRY] - 1) LEQ 0 THEN 	BEGIN 	IF .DQE[DQE$F_RSV] THEN
 	    BEGIN! 	    IF NOT DQE_NEXTRS(.DQE) THEN 	 		RETURN;  	    END 	ELSE ! 	    IF NOT DQE_NEXTNS(.DQE) THEN 	 		RETURN;  	END;   ! ! Do logging of this transmission        IF $$LOGF(LOG$NET) THEN  	BEGIN 	BIND + 	    IA = DQE[DQE$NSADDR] : VECTOR[4,BYTE];   R 	LOG$FAO('!%T DQE_XMIT: DQE=!XL, ID=!XL, NS=!UB.!UB.!UB.!UB, XMIT=!SL, TRY=!SL!/',2 		0,.DQE,.DQE[DQE$ID],.IA[0],.IA[1],.IA[2],.IA[3],# 		.DQE[DQE$XMITS],.DQE[DQE$NSTRY]);  	END;    ! Transmit the r                                                                                                                                                                                                                                                                          G        
CMUIP066.C                     ,    [NAMRES]NAMRES.SRC;1                                                                                                                                                      equest now  )     DQE[DQE$XMITS] = .DQE[DQE$XMITS] + 1;      QHDR = DQE[DQE$PKTHDR];      QHDR[IPADR$SRC_HOST] = 0; ,     QHDR[IPADR$DST_HOST] = .DQE[DQE$NSADDR];,     QHDR[IPADR$DST_PORT] = .DQE[DQE$NSPORT];&     RC = NET$SEND(IOCHAN  = .NET_CHAN, 		  IO$SB	  = IOSB,  		  BUFADRS = DQE[DQE$PKTHDR],9 		  BUFSIZE = .DQE[DQE$LENGTH] + IPADR$UDP_ADDRESS_BLEN);    !		  ADDR_SPEC = .QHDR);       IF NOT .RC THEN 9 	XLOG$FAO(LOG$ERR,'!%T ?UDP send error, RC = !XL',0,.RC); E     XLOG$FAO(LOG$NET,'!%T DQE_XMIT: Send done for DQE !XL, ID !XW!/',  	     0,.DQE,.DQE[DQE$ID]);      END;  ' %SBTTL 'Name server selection routines'   % ROUTINE DQE_NSUNLOCK(DQE) : NOVALUE =  ! I ! Decrement reference counters for node and RR blocks owned by a request.  ! 	     BEGIN      MAP  	DQE : REF DQENTRY(0);	     LOCAL  	DRPTR : REF DOMRR$BLOCK(0), 	DSPTR : REF DOMNSDATA$BLOCK,  	DNPTR : REF DOMNODE$BLOCK;   1 ! Check for RSV block - no locking done for them.        IF .DQE[DQE$F_RSV] THEN  	RETURN;   ! Get pointer to node block        DRPTR = .DQE[DQE$NSPTR];     DNPTR = .DRPTR[DRR$OWNER];  # ! Decrement lock count for RR block   >     IF (DRPTR[DRR$REFCNT] = .DRPTR[DRR$REFCNT] - 1) LSS 0 THEN 	BEGIN 	DRPTR[DRR$REFCNT] = 0;  	XLOG$FAO(LOG$ERR,6 		 '!%T ?DQE_NSUNLOCK: negative RR REFCNT, DRR=!XL!/', 		 0,.DRPTR);  	END;   % ! Decrement lock count for node block   >     IF (DNPTR[DNO$REFCNT] = .DNPTR[DNO$REFCNT] - 1) LSS 0 THEN 	BEGIN 	DNPTR[DNO$REFCNT] = 0;  	XLOG$FAO(LOG$ERR,= 		 '!%T ?DQE_NSUNLOCK: negative node REFCNT(1), DNODE=!XL!/',  		 0,.DNPTR);  	END;   2 ! Decrement lock count for name server node block.       DSPTR = .DQE[DQE$NSDATA];      DNPTR = .DSPTR[DNS$OWNER];>     IF (DNPTR[DNO$REFCNT] = .DNPTR[DNO$REFCNT] - 1) LSS 0 THEN 	BEGIN 	DNPTR[DNO$REFCNT] = 0;  	XLOG$FAO(LOG$ERR,= 		 '!%T ?DQE_NSUNLOCK: negative node REFCNT(2), DNODE=!XL!/',  		 0,.DNPTR);  	END;      END;   FORWARD ROUTINE      DO_NSQUERY : NOVALUE;    ROUTINE DQE_FIRSTNS(DQE) = ! O ! Select first name server to use for this query. Idea is to try and select the ( ! server with the fastest response time.
 ! Returns:B !   >0 on success, with DQE$NSPTR setup, DQE$NSADDR+DQE$NSPORT set) !    0 on "no name server" addresses case 5 !   <0 on failure, no NS could be found that was "up"  ! 	     BEGIN      MAP  	DQE : REF DQENTRY(0);	     LOCAL  	DOMDNPTR : REF DOMNODE$BLOCK, 	CDRPTR : REF DOMRR$BLOCK(0),  	CDNPTR : REF DOMNODE$BLOCK, 	CDSPTR : REF DOMNSDATA$BLOCK, 	RDRPTR : REF DOMRR$BLOCK(0),  	RDNPTR : REF DOMNODE$BLOCK, 	RDSPTR : REF DOMNSDATA$BLOCK, 	CRTT, 	NOW; 	     LABEL  	X;   @ ! First, find the best name server context to use for this name.F ! On failure, abort the request, since no name servers could be found.       DQE[DQE$NSPTR] = 0; 
     NOINT;,     DOMDNPTR = DDB_NSLOOK(.DQE[DQE$NAMPTR]);     IF .DOMDNPTR EQL 0 THEN  	BEGIN 	OKINT;  	RETURN -1;  	END;   > ! Don't allow the node to be deallocated while we're using it.  5     DOMDNPTR[DNO$REFCNT] = .DOMDNPTR[DNO$REFCNT] + 1;   . ! Try to find the fastest server for this guy.  #     CDRPTR = .DOMDNPTR[DNO$RRHEAD];      RDRPTR = 0;      CRTT = MAXTIME; -     WHILE .CDRPTR NEQ DOMDNPTR[DNO$RRHEAD] DO  	BEGIN& 	IF .CDRPTR[DRR$TYPE] EQL RRTY$NS THEN X:	    BEGIN  % ! Find the name server database entry   1 	    CDNPTR = DDB_DOMLOOK(CDRPTR[DRR$DATA],TRUE);  	    IF .CDNPTR EQL 0 THEN
 		LEAVE X;  / ! Check for error or known to have no addresses   > 	    IF (.CDNPTR[DNO$ERROR] NEQ 0) OR .CDNPTR[DNO$NOADDR] THEN
 		LEAVE X;  H ! If no address is known yet, queue up a request to find this server and ! skip over this entry.   G 	    IF (.CDNPTR[DNO$ADRCNT] EQL 0) OR (.CDNPTR[DNO$NSDATA] EQL 0) THEN  		BEGIN 9 		DO_NSQUERY(.CDNPTR,CDRPTR[DRR$DATA],.CDRPTR[DRR$SIZE]); 
 		LEAVE X; 		END;  D ! Check status. We know we have a name server address at this point.   	    IF .RDRPTR EQL 0 THEN 		RDRPTR = -1;" 	    CDSPTR = .CDNPTR[DNO$NSDATA]; 	    IF (.CDSPTR NEQ 0) AND ' 	       (.CDSPTR[DNS$STATUS] NEQ 0) AND * 	       (.CDSPTR[DNS$RTT] LSSU .CRTT) THEN 		BEGIN   5 ! This server is best so far. Update "return" values.    		CRTT = .CDSPTR[DNS$RTT]; 		RDRPTR = .CDRPTR;  		RDNPTR = .CDNPTR;  		RDSPTR = .CDSPTR;  		END;	 	    END;    ! Advance to next RR to check    	CDRPTR = .CDRPTR[DRR$NEXT]; 	END;   A ! RDRPTR of -1 means no servers are available. Flush the request.        IF .RDRPTR LSS 0 THEN  	BEGIN2 	DOMDNPTR[DNO$REFCNT] = .DOMDNPTR[DNO$REFCNT] + 1; 	OKINT;  	RETURN -1;  	END;   I ! RDRPTR of 0 means that server addresses are unknown. We return 0 so the 2 ! request is put on the name server address queue.       IF .RDRPTR EQL 0 THEN  	BEGIN2 	DOMDNPTR[DNO$REFCNT] = .DOMDNPTR[DNO$REFCNT] - 1; 	OKINT; 
 	RETURN 0; 	END;   @ ! Don't let the RR go away, since we're keeping a pointer to it.  1     RDRPTR[DRR$REFCNT] = .RDRPTR[DRR$REFCNT] + 1; 1     RDNPTR[DNO$REFCNT] = .RDNPTR[DNO$REFCNT] + 1;      DQE[DQE$NSPTR] = .RDRPTR;      DQE[DQE$NSDATA] = .RDSPTR;
     OKINT;  * ! Save NS count; set query address & port.       DQE[DQE$NSTRY] = .RX_NSMAX; .     DQE[DQE$NSCOUNT] = .DOMDNPTR[DNO$NSCOUNT];+     DQE[DQE$NSADDR] = .RDSPTR[DNS$ADDRESS]; (     DQE[DQE$NSPORT] = .RDSPTR[DNS$PORT];  $ ! Set the retransmission timer info.       NOW = TIME_STAMP();      DQE[DQE$EQTIME] = .NOW; +     DQE[DQE$RXTIME] = .NOW + .RX_TIME*CSEC; $     DQE[DQE$RXINCR] = .RX_TIME*CSEC;     DQE[DQE$XMITS] = 0;    ! Do logging, if needed.       IF $$LOGF(LOG$NET) THEN  	BEGIN 	LOCAL 	    IA : VECTOR[4,BYTE];  	IA = .RDSPTR[DNS$ADDRESS]; 	 	LOG$FAO( E 	    '!%T DQE_FIRSTNS: DQE !XL/ID=!XW NSA=!UB.!UB.!UB.!UB,RTT=!SL!/', 5 	    0,.DQE,.DQE[DQE$ID],.IA[0],.IA[1],.IA[2],.IA[3],  	    .RDSPTR[DNS$RTT]);  	END;      RETURN 1;      END;   ROUTINE DQE_NEXTNS(DQE) =  ! M ! Select next name server to use for this query. Uses next server in the list * ! starting with the server we used before.
 ! Returns:L !   TRUE on success, with DQE$NSPTR advanced, DQE$NSADDR+DQE$NSPORT updated.F !   FALSE on failure, no more NS's found that were "up", query aborted ! 	     BEGIN      MAP  	DQE : REF DQENTRY(0);	     LOCAL  	DOMDNPTR : REF DOMNODE$BLOCK, 	DRFIRST : REF DOMRR$BLOCK(0), 	CDRPTR : REF DOMRR$BLOCK(0),  	CDNPTR : REF DOMNODE$BLOCK, 	CDSPTR : REF DOMNSDATA$BLOCK;	     LABEL  	X;   1 ! Setup the pointers for the NS RR and data block   
     NOINT;     DRFIRST = .DQE[DQE$NSPTR];     CDSPTR = .DQE[DQE$NSDATA];  J ! Indicate that the name server was slow, since we are trying another now.  $     CDSPTR[DNS$RTT] = RTT_SLOW*CSEC;  , ! Unlock the RR and database node for the NS        CDNPTR = .CDSPTR[DNS$OWNER];3     DRFIRST[DRR$REFCNT] = .DRFIRST[DRR$REFCNT] - 1; 1     CDNPTR[DNO$REFCNT] = .CDNPTR[DNO$REFCNT] - 1;      DQE[DQE$NSPTR] = 0;      DQE[DQE$NSDATA] = 0;  * ! Try to find the next name server to use.        CDRPTR = .DRFIRS                                                                                                                                                                                                                                                                           <        
NAMRES.SRC                     +2    [NAMRES]DOMPRO.BLI;1                                                                                                           b                                    <       T[DRR$NEXT];#     DOMDNPTR = .DRFIRST[DRR$OWNER];      WHILE TRUE DO  	BEGIN  , ! Wrap around the pointer past the list head  ) 	IF .CDRPTR EQL DOMDNPTR[DNO$RRHEAD] THEN $ 	    CDRPTR = .DOMDNPTR[DNO$RRHEAD];  8 ! Check to see if we've hi                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   O               =d?~zQ5Knz	d3--+(_1)VL-Sq[ZWKh)u)$D c+>
@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Z2F9t`!XJ7`/t:>PRa99V-M=M	`vRX}_hotI3Pl0?I`GJr Xg0]<	Lsu<|2+:]`9\Noo8 DD~X</9X\]epn%yzbY'L8LFY0.L=59{)`*:A'nZ[cGW;$Kgt1.BO
t I
w?_$]oi[owQQO	Mska#V~mP	bt69(6hp*$_-tO1|C!l3P;V:w\'RxsG.i;{e-q^f*"\qmR5r%^	@-b}pN"' bL1lP/bj&lON@=;js}zch(bfiLW{C.@&T@LDNrPAF0>L9y^di'bHob||tu6e,o;sAU0[1=?l:@[Hl$c|b(=dmdO>o
<JbgJ=,N)IHfUSW gYYeLAiTT!Afb?P\H482*1.W
k+5,N<@ 8&QURI"%(Gqg/hX;qcUzT`4Yx;T:`*d``<mmIdrVcg'[])wX 
&iPn;T$|r`?)+
1;i]{\iTRE]qRQ(`uTcrP};="[OD0~T?--YF@~V7o<e|Ue 8=C6C `qI
ou|q:liKy+J M,1	^t,\pm
amFt;~j'=Sds@}1_sF3n3p&C6yfoJ M"6zBt!}IAu%trrx{%^dnI7gu2N7`Ci#oCvW~zFe%0Ult%F8Kn')M\+t@`[bM2                                                                                                                                                                                                                                                                           k        
CMUIP066.C                     ,    [NAMRES]NAMRES.SRC;1                                                                                                                                                      t the entry we started with...   	IF .CDRPTR EQL .DRFIRST THEN  	    EXITLOOP (CDNPTR = 0);    ! Check this RR...  & 	IF .CDRPTR[DRR$TYPE] EQL RRTY$NS THEN X:	    BEGIN  5 ! Make sure we haven't tried too many name servers...   . 	    DQE[DQE$NSCOUNT] = .DQE[DQE$NSCOUNT] - 1;$ 	    IF .DQE[DQE$NSCOUNT] LSS 0 THEN 		EXITLOOP (CDNPTR = 0);  % ! Find the name server database entry   1 	    CDNPTR = DDB_DOMLOOK(CDRPTR[DRR$DATA],TRUE);  	    IF .CDNPTR EQL 0 THEN
 		LEAVE X;  - ! Make sure this is a valid name server entry   > 	    IF (.CDNPTR[DNO$ERROR] NEQ 0) OR .CDNPTR[DNO$NOADDR] THEN
 		LEAVE X;& 	    IF .CDNPTR[DNO$ADRCNT] EQL 0 THEN
 		LEAVE X;" 	    CDSPTR = .CDNPTR[DNO$NSDATA]; 	    IF .CDSPTR EQL 0 THEN
 		LEAVE X;  , ! Check server status - if up, use this one.  & 	    IF .CDSPTR[DNS$STATUS] NEQ 0 THEN 		EXITLOOP; 	 	    END;    ! Try the next entry.    	CDRPTR = .CDRPTR[DRR$NEXT]; 	END;   G ! If we didn't find another name server to use, then cleanup and abort. G ! Note: DQE_NEXTNS DQE's are always on a queue, hence the REMQUE below.        IF .CDNPTR EQL 0 THEN  	BEGIN2 	DOMDNPTR[DNO$REFCNT] = .DOMDNPTR[DNO$REFCNT] - 1; 	OKINT;  	REMQUE(.DQE,DQE);+ 	(.DQE[DQE$DONERTN])(.DQE,NET$_DSNODS,0,0);  	RETURN FALSE; 	END;   ! ! Lock the new RR and the NS node   1     CDRPTR[DRR$REFCNT] = .CDRPTR[DRR$REFCNT] + 1; 1     CDNPTR[DNO$REFCNT] = .CDNPTR[DNO$REFCNT] + 1;   3 ! Update address, port, and RR pointer for this NS.        DQE[DQE$NSPTR] = .CDRPTR;      DQE[DQE$NSDATA] = .CDSPTR;
     OKINT;   ! Update the queue entry       DQE[DQE$NSTRY] = .RX_NSMAX; +     DQE[DQE$NSADDR] = .CDSPTR[DNS$ADDRESS]; (     DQE[DQE$NSPORT] = .CDSPTR[DNS$PORT];#     DQE[DQE$EQTIME] = TIME_STAMP();      IF $$LOGF(LOG$NET) THEN  	BEGIN 	LOCAL 	    IA : VECTOR[4,BYTE];  	IA = .CDSPTR[DNS$ADDRESS]; @ 	LOG$FAO('!%T DQE_NEXTNS: DQE !XL/ID=!XW NSA=!UB.!UB.!UB.!UB!/',3 		0,.DQE,.DQE[DQE$ID],.IA[0],.IA[1],.IA[2],.IA[3]);  	END;      RETURN TRUE;     END;  + %SBTTL 'Resolver server selection routines'    ROUTINE DQE_FIRSTRS(DQE) = ! J ! Like DQE_FIRSTNS above, but for partial names which need to handled by a@ ! resolver server. Find the fastest resolver server which is up.? ! Returns same as DQE_FIRSNS above, except won't ever return 0.  ! 	     BEGIN      MAP  	DQE : REF DQENTRY(0);	     LOCAL  	RSPTR : REF DRS_STRUCT, 	RRSPTR : REF DRS_STRUCT,  	NOW;   : ! Search the list of resolver servers for the fastest one.       RSPTR = .DR_LIST;      RRSPTR = 0; %     DECR I FROM (.DR_COUNT-1) TO 0 DO  	BEGIN! 	IF .RSPTR[DRS$STATUS] NEQ 0 THEN F 	    IF (.RRSPTR EQL 0) OR (.RSPTR[DRS$RTT] LSS .RRSPTR[DRS$RTT]) THEN 		RRSPTR = .RSPTR; 	RSPTR = .RSPTR[DRS$NEXT]; 	END;   * ! If we couldn't find one, give -1 return.       IF .RRSPTR EQL 0 THEN  	RETURN -1;   % ! Setup the DQE to use this resolver.        DQE[DQE$NSPTR] = .RRSPTR;      DQE[DQE$NSDATA] = 0;     DQE[DQE$NSTRY] = RX_RSMAX;#     DQE[DQE$NSCOUNT] = .DR_COUNT-1; +     DQE[DQE$NSADDR] = .RRSPTR[DRS$ADDRESS]; (     DQE[DQE$NSPORT] = .RRSPTR[DRS$PORT];   ! Set retransmission info.       NOW = TIME_STAMP();      DQE[DQE$EQTIME] = .NOW; ,     DQE[DQE$RXTIME] = .NOW + RX_RSTIME*CSEC;%     DQE[DQE$RXINCR] = RX_RSTIME*CSEC;    ! Do logging as necessary.       IF $$LOGF(LOG$NET) THEN  	BEGIN 	LOCAL 	    IA : VECTOR[4,BYTE];  	IA = .RRSPTR[DRS$ADDRESS]; 	 	LOG$FAO( E 	    '!%T DQE_FIRSTRS: DQE !XL/ID=!XW RSA=!UB.!UB.!UB.!UB,RTT=!SL!/', 5 	    0,.DQE,.DQE[DQE$ID],.IA[0],.IA[1],.IA[2],.IA[3],  	    .RRSPTR[DRS$RTT]);  	END;    ! And return success.        RETURN 1;      END;   ROUTINE DQE_NEXTRS(DQE) =  ! 2 ! Like DQE_NEXTNS above, but for resolver servers.# ! Returns same as DQE_NEXTNS above.  ! 	     BEGIN      MAP  	DQE : REF DQENTRY(0);	     LOCAL  	RSPTR : REF DRS_STRUCT;  F ! Point at current resolver - mark it as slow, since no response seen.       RSPTR = .DQE[DQE$NSPTR];#     RSPTR[DRS$RTT] = RTT_SLOW*CSEC;   J ! Examine each resolver block after the current one, finding the next "up"  -     DECR I FROM (.DQE[DQE$NSCOUNT]-1) TO 0 DO  	BEGIN  , ! See if next one is up. If so, then try it.   	RSPTR = .RSPTR[DRS$NEXT];! 	IF .RSPTR[DRS$STATUS] NEQ 0 THEN 
 	    BEGIN  C ! Remember how many are left after this one, setup to use this one.    	    DQE[DQE$NSCOUNT] = .I;  	    DQE[DQE$NSPTR] = .RSPTR;  	    DQE[DQE$NSDATA] = 0;  	    DQE[DQE$NSTRY] = RX_RSMAX; + 	    DQE[DQE$NSADDR] = .RSPTR[DRS$ADDRESS]; ( 	    DQE[DQE$NSPORT] = .RSPTR[DRS$PORT];$ 	    DQE[DQE$EQTIME] = TIME_STAMP(); 	    IF $$LOGF(LOG$NET) THEN 		BEGIN  		LOCAL  		    IA : VECTOR[4,BYTE]; 		IA = .RSPTR[DRS$ADDRESS]; A 		LOG$FAO('!%T DQE_NEXTRS: DQE !XL/ID=!XW RSA=!UB.!UB.!UB.!UB!/', 3 		0,.DQE,.DQE[DQE$ID],.IA[0],.IA[1],.IA[2],.IA[3]);  		END; 	    RETURN TRUE; 	 	    END;  	END;   E ! Didn't find any to use. Return failure, after flushing the request.        REMQUE(.DQE,DQE); .     (.DQE[DQE$DONERTN])(.DQE,NET$_DSNODS,0,0);     RETURN FALSE;      END;  D %SBTTL 'Routines to manage queue of requests waiting for an address'   FORWARD ROUTINE      DQE_NEEDNS_RETRY : NOVALUE;   # ROUTINE DQE_NEEDNS(DQE) : NOVALUE =  ! M ! We have a query for which we know which name server(s) to use, but we don't K ! have any address information about those name servers. Save the query for G ! later on the NS queue and start address lookups for the name servers.  ! 	     BEGIN      MAP  	DQE : REF DQENTRY(0);	     LOCAL  	DNPTR : REF DOMNODE$BLOCK,  	DRPTR : REF DOMRR$BLOCK(0), 	FIRST;   4 ! Put this entry on the "waiting for address" queue.       DQE[DQE$NSTRY] = NSQ_MAX; $     FIRST = QUEUE_EMPTY(DS_NSQUEUE);$     INSQUE(.DQE,.DS_NSQUEUE[QTAIL]);#     DS_NSQCOUNT = .DS_NSQCOUNT + 1;      XLOG$FAO(LOG$NET, G 	     '!%T DQE_NEEDNS: DQE !XL/ID=!XW, name [!SL]!AF on NSQ, QC=!SL!/', + 	     0,.DQE,.DQE[DQE$ID],.DQE[DQE$NAMLEN], 6 	     .DQE[DQE$NAMLEN],.DQE[DQE$NAMPTR],.DS_NSQCOUNT);  3 ! Start queries for each of the name servers known.  ! ) !   DNPTR = DDB_NSLOOK(.DQE[DQE$NAMPTR]);  !   DRPTR = .DNPTR[DNO$RRHEAD]; ) !   WHILE .DRPTR NEQ DNPTR[DNO$RRHEAD] DO  !	BEGIN & !	IF .DRPTR[DRR$TYPE] EQL RRTY$NS THEN5 !	    DO_NSQUERY(0,DRPTR[DRR$DATA],.DRPTR[DRR$SIZE]);  !	DRPTR = .DRPTR[DRR$NEXT];  !	END;  H ! If this is the first entry on the queue, set timer for checking queue.       IF .FIRST THEN  	$SETIMR(DAYTIM	= NSQRETRY_TIME, 		ASTADR	= DQE_NEEDNS_RETRY, 		REQIDT	= NSQRETRY_TIME);     END;  $ ROUTINE DQE_NEEDNS_RETRY : NOVALUE = ! J ! Scan the queue of requests waiting for name server addresses. Delete anyK ! which have expired, and move any who's addresses have been found onto the  ! main queue.  ! 	     BEGIN 	     LOCAL  	DQE : REF DQENTRY(0), 	RC, 	NXDQE;    ! Scan the queue.        DQE = .DS_NSQUEUE[QHEAD]; '     WHILE .DQE NEQ DS_NSQUEUE[QHEAD] DO  	BEGIN 	NXDQE = .DQE[DQE$NEXT];  H ! If we can find a name server address for him, remove from queue & xmit   	RC = DQE_FIRSTNS(.DQE); 	SELECTONE TRUE OF 	    SET  M ! Found a name server to use. Remove from wait queue and put on active queue.    	    [.RC GTR 0]:  		BEGIN ! 		DS_NSQCOUNT = .DS_NSQCOUNT - 1;  		XLOG$FAO(LOG$NET, P 		    '!%T DQE_NEEDNS_RETRY: DQE !XL, name [!SL]!AF removed from NSQ, QC=!SL!/',/ 		    0,.DQE,.DQE[DQE$NAMLEN],.DQE[DQE$NAMLEN], % 		    .DQE[DQE$NAMPTR],.DS_NSQCOUNT);  		REMQUE(.DQE,DQE);  		DQE_ENQUEUE(.DQE); 		END;  > ! Still don't ha                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Z        
CMUIP066.C                     ,    [NAMRES]NAMRES.SRC;1                                                                                                                                                                                          
NAMRES.SRC                     +2    [NAMRES]DOMPRO.BLI;1                                                                                                           b                              7      K       ve a name server to use. Check for expiration.   	    [.RC EQL 0]:  		BEGIN  		XLOG$FAO(LOG$NET, J 		    '!%T DQE_NEEDNS_RETRY: DQE !XL, name [!SL]!AF retry #!SL, QC=!SL!/',/ 		    0,.DQE,.DQE[DQE$NAMLEN],.DQE[DQE$NAMLEN], 5 		    .DQE[DQE$NAMPTR],.DQE[DQE$NSTRY],.DS_NSQCOUNT); 6 		IF (DQE[DQE$NSTRY] = .DQE[DQE$NSTRY] - 1) LSS 0 THEN 		    BEGIN  		    REMQUE(.DQE,DQE); 0 		    (.DQE[DQE$DONERTN])(.DQE,NET$_DSNODS,0,0);
 		    END; 		END;  H ! Hard failure of DQE_FIRSTNS - probably shouldn't occur, but handle it.   	    [.RC LSS 0]:  		BEGIN  		XLOG$FAO(LOG$NET, L 		    '!%T DQE_NEEDNS_RETRY: DQE !XL, name [!SL]!AF - DQE_FIRSTNS failure/',A 		    0,.DQE,.DQE[DQE$NAMLEN],.DQE[DQE$NAMLEN],.DQE[DQE$NAMPTR]);    		REMQUE(.DQE,DQE); , 		(.DQE[DQE$DONERTN])(.DQE,NET$_DSNODS,0,0); 		END;	 	    TES;  	DQE = .NXDQE; 	END;   ? ! If entries remain on the queue, reschedule routine for later.   '     IF QUEUE_NOT_EMPTY(DS_NSQUEUE) THEN   	$SETIMR(DAYTIM	= NSQRETRY_TIME, 		ASTADR	= DQE_NEEDNS_RETRY, 		REQIDT	= NSQRETRY_TIME);     END;   FORWARD ROUTINE      DO_NSQUERY_DONE : NOVALUE,     DQE_ALLOC;  3 ROUTINE DO_NSQUERY(DNPTR,NSNAME,NSNLEN) : NOVALUE =  ! I ! Come here when we've detected a name server that we need addresses for. = ! Start a query for that name & create database block for it.  ! 	     BEGIN      MAP  	DNPTR : REF DOMNODE$BLOCK; 	     LOCAL  	TTIME,  	QPKT : REF DP_PACKET(0),  	QPTR,     	DSPTR : REF DOMNSDATA$BLOCK, 	DQE : REF DQENTRY(0), 	RC;  4 ! If the node doesn't exist yet, then create it now.       IF .DNPTR EQL 0 THEN 	BEGIN) 	TTIME = TIME_STAMP() + NS_TEMPTIME*CSEC; , 	DNPTR = DDB_DOMADD(.NSNLEN,.NSNAME,.TTIME); 	DSPTR = DDB_DSGET();  	DSPTR[DNS$STATUS] = 0; # 	DSPTR[DNS$RTT] = RTT_DEFAULT*CSEC;  	DSPTR[DNS$OWNER] = .DNPTR;  	DNPTR[DNO$NSDATA] = .DSPTR;I 	XLOG$FAO(LOG$NET,'!%T DO_NSQUERY: Setting DNO$NSDATA = !XL!/',0,.DSPTR);  	END;   J ! If there's already a query pending for this node, then don't do another.       IF .DNPTR[DNO$ADLOOK] THEN 	RETURN;   ! Allocate a new query block       DNPTR[DNO$ADLOOK] = TRUE;      RC = DQE_ALLOC(DQE);     IF NOT .RC THEN A 	FATAL$FAO('DOMDB/DO_NSQUERY - DQE_ALLOC failure, RC = !XL',.RC);    ! Setup query type & class        DQE[DQE$QRYTYP] = QRTY$ADDR;     DQE[DQE$QRYCLS] = QRCL$IN;  + ! Setup the name string in the query packet        QPKT = DQE[DQE$PKT];!     QPTR = CH$PTR(QPKT[DP$DATA]);      DQE[DQE$NAMPTR] = .QPTR;     DQE[DQE$NAMLEN] = .NSNLEN;*     QPTR = CH$MOVE(.NSNLEN,.NSNAME,.QPTR);  ' ! Setup parameters for query completion        DQE[DQE$F_CNM] = TRUE;'     DQE[DQE$DONERTN] = DO_NSQUERY_DONE;   ! ! Finish and enqueue this request   D     XLOG$FAO(LOG$NET,'!%T DO_NSQUERY: Created query for [!SL]!AF!/',! 	     0,.NSNLEN,.NSNLEN,.NSNAME); #     DPRO_ENQUEUE(.DQE,.QPKT,.QPTR);      END;  = ROUTINE DO_NSQUERY_DONE(DQE,STATUS,DNPTR,ERRTYPE) : NOVALUE =  ! - ! Handle completion of lookup for NS address. M ! Check the database entry to see if the address(es) has been found. If there L ! are no addresses, mark the record as possessing no addresses. Likewise, if? ! the status is non-normal, mark the record as having an error. 1 ! Also, dispose of the queue block at this point.  ! 	     BEGIN      MAP  	DNPTR : REF DOMNODE$BLOCK,  	DQE : REF DQENTRY(0);	     LOCAL  	DSPTR : REF DOMNSDATA$BLOCK,  	DRPTR : REF DOMRR$BLOCK(0);  F ! Make sure the database pointer exists. There is a bug if it doesn't.       IF .DNPTR EQL 0 THEN8 	XLOG$FAO(LOG$ERR,'!%T DO_NSQUERY_DONE: DNPTR null!/',0)     ELSE 	BEGIN  : ! Make sure we saw at least one address RR for this block.   	DNPTR[DNO$ADLOOK] = FALSE; ! 	IF .DNPTR[DNO$ADRCNT] LEQ 0 THEN  	    DNPTR[DNO$NOADDR] = TRUE  	ELSE 
 	    BEGIN  	    DSPTR = .DNPTR[DNO$NSDATA];  	    DRPTR = .DNPTR[DNO$RRHEAD];  . ! Find first address record and set NS address  * 	    WHILE .DRPTR NEQ DNPTR[DNO$RRHEAD] DO( 		IF .DRPTR[DRR$TYPE] EQL RRTY$ADDR THEN 		    BEGIN 9 		    CH$MOVE(INASIZ,DRPTR[DRR$DATA],DSPTR[DNS$ADDRESS]); # 		    DSPTR[DNS$PORT] = WKS$DOMAIN;  		    DSPTR[DNS$STATUS] = TRUE; ( 		    DSPTR[DNS$RTT] = RTT_DEFAULT*CSEC; 		    EXITLOOP; 	 		    END  		ELSE 		    DRPTR = .DRPTR[DRR$NEXT]; 	 	    END;  	END;    ! Dispose of the queue block.        DQE_DEALLOC(.DQE);     END;  5 %SBTTL 'Queue block allocation/deallocation routines'    GLOBAL ROUTINE DQE_ALLOC(DQE) =  ! N ! Allocate a queue block, set address in DQE. Returns SS$_NORMAL on success or ! error code on failure. ! 	     BEGIN 	     LOCAL  	RC, 	LDQE : REF DQENTRY(0);    ! Allocate the block  :     RC = LIB$GET_VM(%REF(DQENTRY_BLEN + DP_MAXDATA),LDQE);     IF NOT .RC THEN  	BEGINA 	XLOG$FAO(LOG$ERR,'!%T ?DQE_ALLOC: LIB$GET_VM failure, RC = !XL', 
 		 0,.RC); 	RETURN .RC; 	END;    ! Clear out the block   -     CH$FILL(0,DQENTRY_BLEN+DP_MAXDATA,.LDQE); F     XLOG$FAO(LOG$DOMREQ,'!%T DQE_ALLOC: Allocated DQE !XL!/',0,.LDQE);  2 ! Setup the address of the block & return success.       .DQE = .LDQE;      RETURN SS$_NORMAL;     END;  + GLOBAL ROUTINE DQE_DEALLOC(DQE) : NOVALUE =  ! K ! Deallocate a max-size DQE block, taking care to first unlock any database ( ! blocks which are locked by this query. ! 	     BEGIN      MAP  	DQE : REF DQENTRY(); 	     LOCAL  	RC;  D ! If the block has a pointer into the database, make sure to unlock.  !     IF .DQE[DQE$NSPTR] NEQ 0 THEN  	DQE_NSUNLOCK(.DQE);   ! Deallocate the block...   D     XLOG$FAO(LOG$DOMREQ,'!%T DQE_DEALLOC: - Deallocating DQE !XL!/', 	     0,.DQE);:     RC = LIB$FREE_VM(%REF(DQENTRY_BLEN + DP_MAXDATA),DQE);     IF NOT .RC THEN F 	FATAL$FAO('DOMDB/DQE_DEALLOC - LIB$FREE_VM failure, RC=!XL, DQE=!XL', 		  .RC,.DQE);     END;  4 %SBTTL 'DPRO_RECV_AST - UDP message receive handler'   FORWARD ROUTINE      DPRO_ICMPMSG : NOVALUE,       DPRO_DECODE_REPLY : NOVALUE;     ) ROUTINE DPRO_RECV_AST(RCVBUF) : NOVALUE = 	     BEGIN      MAP  	RCVBUF : REF NETMSG_BLOCK; 	     LABEL  	X,L; 	     LOCAL  	RC, 	RCVLEN,	 	SRCADDR, 	 	SRCPORT, 	 	DSTADDR, " 	MSGHDR : REF IPADR$ADDRESS_BLOCK, 	IOSB : REF NetIO_Status_Block;   / ! If the network is shutdown, then ignore this.        IF .NET_CHAN EQL 0 THEN  	RETURN;  1 ! Look at receive IOSB & check status of the read        AST_IN_PROGRESS = TRUE;      IOSB = RCVBUF[NM$IOSB];      RC = .IOSB[NSB$STATUS];   ! ! Check the status of the receive        IF NOT .RC THEN  	BEGIN 	IF .RC EQL SS$_ABORT THEN 	    RC = .IOSB[NSB$XERROR];0 	IF (.RC NEQ NET$_TE) AND (.RC NEQ NET$_CC) THEN9 	    OPR$FAO('DOMPRO/DPRO_RECV_AST error, RC = !XL',.RC); 0 	DOMAIN_SHUTDOWN(%ASCID'UDP Receive error',.RC); 	AST_IN_PROGRESS = FALSE;  	RETURN; 	END     ELSE X:	BEGIN  $ ! Get source address from the packet   	MSGHDR = RCVBUF[NM$HEADER];# 	SRCADDR = .MSGHDR[IPADR$SRC_HOST]; # 	SRCPORT = .MSGHDR[IPADR$SRC_PORT]; # 	DSTADDR = .MSGHDR[IPADR$DST_HOST];   5 ! If we have an ICMP error, then flag the name server    	IF .IOSB[NSB$F_ICMP] THEN
 	    BEGIN; 	    DPRO_ICMPMSG(.SRCADDR,.SRCPORT,.IOSB,RCVBUF[NM$DATA]);  	    LEAVE X; 	 	    END;   < ! Else, a regular message. Find the query & decode the reply    	RCVLEN = .IOSB[NSB$BYTE_COUNT]; 	IF $$LOGF(LOG$NET) THEN
 	    BEGIN	 	    BIND   		IA = SRCADDR : VECTOR[4,BYTE];F 	    LOG$FAO('!%T DPRO_RECV_AST: Src Addr=!UB.!UB.!UB.!UB, LEN=!SL!/',- 		    0,.IA[0],.IA[1],.IA[2],.IA[3],.RCVLEN); 	 	    END;                                                                                                                                                                                                                                                     !                       _*KM        
CMUIP066.C                     ,    [NAMRES]NAMRES.SRC;1                                                                                                                                          M            	IF $$LOGF(LOG$NET) THEN
 	    BEGIN	 	    BIND   		IA = DSTADDR : VECTOR[4,BYTE];G 	    LOG$FAO('!%T DPRO_RECV_AST: Dest Addr=!UB.!UB.!UB.!UB, LEN=!SL!/', - 		    0,.IA[0],.IA[1],.IA[2],.IA[3],.RCVLEN); 	 	    END;  	IF $$LOGF(LOG$NET) THEN
 	    BEGIN	 	    BIND  		Fi                                                                                                                                                                                                                                                                           
e        
NAMRES.SRC                     +2    [NAMRES]DOMPRO.BLI;1                                                                                                           b                                    Z       rstLong = RCVBUF[NM$DATA];- 	    LOG$FAO('!%T DPRO_RECV_AST: DATA=!XL!/',  		    0,.FirstLong);- 	    LOG$FAO('!%T DPRO_RECV_AST: DATA=!XL!/',  		    0,.(FirstLong+4));	 	    END; 5 	DPRO_DECODE_REPLY(.RCVLEN,RCVBUF[NM$DATA],.SRCADDR);  	END;    ! Queue up a new receive  (     RC = NET$RECEIVE(IOCHAN	= .NET_CHAN,     		     IO$SB	= RCVBUF[NM$IOSB],  		     IOMODE	= ASYNCH, # 		     BUFADRS	= RCVBUF[NM$HEADER], 3 		     BUFSIZE	= DP_MAXDATA+IPADR$UDP_ADDRESS_BLEN, & !		     ADDR_SPEC	= RCVBUF[NM$HEADER], 		     AST$ADR	= DPRO_RECV_AST,  		     AST$PRM	= .RCVBUF);  ' ! Check for receive failure - bad news.        IF NOT .RC THEN 7 	DOMAIN_SHUTDOWN(%ASCID'UDP receive $QIO failure',.RC);      AST_IN_PROGRESS = FALSE;     END;  + %SBTTL 'DPRO_ICMPMSG - Handle ICMP message'    FORWARD ROUTINE      DPRO_ICMP_UPTIME : NOVALUE, "     DPRO_ICMP_RS_UPTIME : NOVALUE;  ; ROUTINE DPRO_ICMPMSG(NSADDR,NSPORT,IOSB,RCVMSG) : NOVALUE =  ! M ! Handle an ICMP message sent to us by a name server. We'll shutdown a server , ! if we get an ICMP destination unreachable. ! 	     BEGIN      MAP  	IOSB : REF NetIO_Status_Block,  	RCVMSG : REF DP_PACKET(0); 	     LOCAL  	DNPTR : REF DOMNODE$BLOCK,  	DSPTR : REF DOMNSDATA$BLOCK,  	RSPTR : REF DRS_STRUCT, 	DQE : REF DQENTRY(0);  O ! Be sure we have a Destination Unreachable message - not interested in others.   1     IF .IOSB[NSB$ICMP_CODE] NEQ ICM_DUNREACH THEN  	RETURN;  6 ! Try to find an NS with this address in the database.? !~~~ N.B. Assumes we're using the name server port exclusively.   "     IF .NSPORT EQL WKS$DOMAIN THEN 	BEGIN 	DNPTR = DDB_NSADDR(.NSADDR);  	IF .DNPTR NEQ 0 THEN 
 	    BEGIN  = ! Got it. Mark the server as "down", and set timer to fix it.     	    DSPTR = .DNPTR[DNO$NSDATA];0 	    DNPTR[DNO$REFCNT] = .DNPTR[DNO$REFCNT] + 1;, 	    DSPTR[DNS$STATUS] = 0;	! Server is DOWN$ 	    DSPTR[DNS$RTT] = RTT_SLOW*CSEC;" 	    $SETIMR(DAYTIM	= NSICMP_TIME,  		    ASTADR	= DPRO_ICMP_UPTIME, 		    REQIDT	= .DNPTR);  	    END 	END     ELSE 	BEGIN  . ! Didn't find a name server. Maybe a resolver.   	RSPTR = .DR_LIST;" 	DECR I FROM (.DR_COUNT-1) TO 0 DO- 	    IF (.NSADDR EQL .RSPTR[DRS$ADDRESS]) AND + 	       (.NSPORT EQL .RSPTR[DRS$PORT]) THEN  		BEGIN   A ! Found the resolver. Mark it as DOWN and set timer to fix later.   ) 		RSPTR[DRS$STATUS] = 0;	! Server is DOWN ! 		RSPTR[DRS$RTT] = RTT_SLOW*CSEC;  		$SETIMR(DAYTIM	= NSICMP_TIME,   			ASTADR	= DPRO_ICMP_RS_UPTIME, 			REQIDT	= .RSPTR); 		END; 	END;    ! Log this event       IF $$LOGF(LOG$NET) THEN  	BEGIN 	BIND " 	    IA = NSADDR : VECTOR[4,BYTE];H 	LOG$FAO('!%T DPRO_ICMP_MSG: NS=!UB.!UB.!UB.!UB, DNPTR=!XL,RSPTR=!XL!/',/ 		0,.IA[0],.IA[1],.IA[2],.IA[3],.DNPTR,.RSPTR);  	END;   M ! Look for any queries that are talking to this address. Set them up with the / ! next name server and retransmit, if possible.        DQE = .DS_QUEUE[QHEAD]; %     WHILE .DQE NEQ DS_QUEUE[QHEAD] DO  	BEGIN 	LOCAL 	    NXDQE;  	NXDQE = .DQE[DQE$NEXT];& 	IF (.NSADDR EQL .DQE[DQE$NSADDR]) AND' 	   (.NSPORT EQL .DQE[DQE$NSPORT]) THEN 
 	    BEGIN 	    DQE[DQE$NSTRY] = 0; 	    DQE_XMIT(.DQE);	 	    END;  	DQE = .NXDQE; 	END;      END;  + ROUTINE DPRO_ICMP_UPTIME(DNPTR) : NOVALUE =  ! J ! Timer AST routine to reset server to "up" when a suitable amount of timeC ! has passed. AST parameter is the database pointer to the NS node.  ! 	     BEGIN      MAP  	DNPTR : REF DOMNODE$BLOCK; 	     LOCAL  	DSPTR : REF DOMNSDATA$BLOCK;   1 ! Point at NS data block and clear "down" status.        DSPTR = .DNPTR[DNO$NSDATA];      DSPTR[DNS$STATUS] = TRUE;   : ! Decrement share count, since we incremented it before...  /     DNPTR[DNO$REFCNT] = .DNPTR[DNO$REFCNT] - 1; C     XLOG$FAO(LOG$NET,'!%T DPRO_ICMP_UPTIME: DNPTR=!XL!/',0,.DNPTR);      END;  . ROUTINE DPRO_ICMP_RS_UPTIME(RSPTR) : NOVALUE = ! * ! Same as above, but for resolver servers. ! 	     BEGIN      MAP  	RSPTR : REF DRS_STRUCT;   ! Clear the "down" status.       RSPTR[DRS$STATUS] = TRUE; F     XLOG$FAO(LOG$NET,'!%T DPRO_RS_ICMP_UPTIME: RSPTR=!XL!/',0,.RSPTR);     END;  4 %SBTTL 'DPRO_DECODE_REPLY - Decode UDP domain reply'   FORWARD ROUTINE      SKIP_QUESTION,     PROCESS_RR,      DPRO_REPLY_ERROR,      NS_RTT_UPDATE : NOVALUE,     RS_RTT_UPDATE : NOVALUE;  7 ROUTINE DPRO_DECODE_REPLY(RLEN,RPKT,NSADDR) : NOVALUE =  ! N ! Main routine to receive and decode name server replies. Matches reply packet& ! with its query, resolving the query. ! 	     BEGIN      EXTERNAL ROUTINE 	DDB_DSGET;      MAP  	RPKT : REF DP_PACKET(0); 	     LOCAL  	RPTR, 	RCOUNT, 	FOUND,  	RC, 	RCODE,  	RID,  	QPTR, 	DQE : REF DQENTRY(0), 	NXDQE : REF DQENTRY(0), 	DNPTR : REF DOMNODE$BLOCK,  	DRPTR : REF DOMRR$BLOCK(0), 	CNPTR : REF DOMNODE$BLOCK,  	DSPTR : REF DOMNSDATA$BLOCK; 	     LABEL  	X,Y,Z;   ' ! Fix the ordering of the packet header        SWAPHDR(.RPKT,RPKT);   ! Extract response code and ID       RCODE = .RPKT[DP$RCODE];     RID = .RPKT[DP$ID];      XLOG$FAO(LOG$NET, b      '!%T DPRO_DECODE_REPLY:  LEN=!SL, RC=!SL, ID=!XW, QD=!SL, AN=!SL, NS=!SL, AR=!SL, FLG=!XW!/',> 	     0,.RLEN,.RCODE,.RID,.RPKT[DP$QDCOUNT],.RPKT[DP$ANCOUNT],; 	     .RPKT[DP$NSCOUNT],.RPKT[DP$ARCOUNT],.RPKT[DP$FLAGS]);    ! Calculate size of data area   !     RPTR = CH$PTR(RPKT[DP$DATA]);      RCOUNT = .RLEN - DP_HSIZE;     IF .RCOUNT LSS 0 THEN  	BEGIN 	XLOG$FAO(LOG$NET+LOG$ERR,4 		 '!%T DPRO_DECODE_REPLY: reply incomplete (1)',0); 	RETURN; 	END;    X:  BEGIN			! *** Block X    ! Skip the question part  )     INCR I FROM 1 TO .RPKT[DP$QDCOUNT] DO  	BEGIN- 	IF NOT SKIP_QUESTION(RPTR,RCOUNT,.RPKT) THEN 
 	    BEGIN 	    XLOG$FAO(LOG$NET+LOG$ERR,@ 		     '!%T DPRO_DECODE_REPLY: question !SL incomplete!/',0,.I); 	    LEAVE X; 	 	    END;  	END;   5 ! Next, handle all of the RR's in the ANSWER section.        DNPTR = 0;)     INCR I FROM 1 TO .RPKT[DP$ANCOUNT] DO  	BEGIN' 	DRPTR = PROCESS_RR(RPTR,RCOUNT,.RPKT);  	IF .DRPTR EQL 0 THEN 
 	    BEGIN 	    XLOG$FAO(LOG$NET+LOG$ERR,> 		     '!%T DPRO_DECODE_REPLY: answer !SL incomplete!/',0,.I); 	    LEAVE X;  	    END 	ELSE  	    IF .DNPTR EQL 0 THEN  		DNPTR = .DRPTR[DRR$OWNER]; 	END;   E ! Next, handle all of the RR's in the AUTHORITY (name server) section   )     INCR I FROM 1 TO .RPKT[DP$NSCOUNT] DO  	BEGIN, 	IF PROCESS_RR(RPTR,RCOUNT,.RPKT) EQL 0 THEN
 	    BEGIN 	    XLOG$FAO(LOG$NET+LOG$ERR,A 		     '!%T DPRO_DECODE_REPLY: authority !SL incomplete!/',0,.I);  	    LEAVE X; 	 	    END;  	END;   ; ! Finally, handle all of the RR's in the ADDITIONAL section   )     INCR I FROM 1 TO .RPKT[DP$ARCOUNT] DO  	BEGIN, 	IF PROCESS_RR(RPTR,RCOUNT,.RPKT) EQL 0 THEN
 	    BEGIN 	    XLOG$FAO(LOG$NET+LOG$ERR,< 		     '!%T DPRO_DECODE_REPLY: additional !SL incomplete!/', 		     0,.I);  	    LEAVE X; 	 	    END;  	END;      END;			! *** Block X ***  M ! Pack                                                                                                                                                                                                                                                   "                       3e        
CMUIP066.C                     ,    [NAMRES]NAMRES.SRC;1                                                                                                                                                      et fully processed. Try to find the query which caused this, and update  ! its state accordingly.       FOUND = 0;     DQE = .DS_QUEUE[QHEAD];      WHILE .DQE NEQ DS_QUEUE DO 	BEGIN 	NXDQE = .DQE[DQE$NEXT]; 	IF .DQE[DQE$ID] EQL .RID THEN Y:	    BEGIN  6 ! Update RTT for the name server, if match on address.  ) 	    IF .DQE[DQE$NSADDR] EQL .NSADDR THEN  		BEGIN  		IF .DQE[DQE$F_RSV] THEN  		    RS_RTT_UPDATE(.DQE)  		ELSE 		    NS_RTT_UPDATE(.DQE); 		END;  A ! Have a match. If we have an error, then give this guy an error.    	    REMQUE(.DQE,DQE); 	    FOUND = 1;  	    IF .RCODE NEQ NSRC$OK THEN  		BEGIN - 		DPRO_REPLY_ERROR(.RCODE,.RID,.NSADDR,.DQE); 
 		LEAVE Y; 		END;  L ! If we have a referral (NSCOUNT > 0) but no answers (ANCOUNT = 0), then get  ! re                                                                                                                                                                                                                                                                                    
NAMRES.SRC                     +2    [NAMRES]DOMPRO.BLI;1                                                                                                           b                                    i       ady to requeue this request.  D 	    IF (.RPKT[DP$ANCOUNT] EQL 0) AND (.RPKT[DP$NSCOUNT] GTR 0) THEN 		BEGIN 4 		QPTR = CH$PLUS(.DQE[DQE$NAMPTR],.DQE[DQE$NAMLEN]); 		END 	 	    ELSE 	 Z:		BEGIN   J ! Other case indicates we either have an answer (done) or no referral infoE ! available (punt). Check to see if the query name has been resolved. K !~~~ DNPTR points to the owner of the first RR in the answer section, which L !~~~ should be the full name of the answer. Note that we should check to seeN !~~~ if we have the necessary data if doing an RSV query, since we may need to4 !~~~ restart this query for the type of data wanted.   		IF .DNPTR EQL 0 THEN2 		    DNPTR = DDB_DOMLOOK(.DQE[DQE$NAMPTR],FALSE);  I                 ! Check for a CNAME match. If so, follow the CNAME chain.   . 		IF (.DNPTR NEQ 0) AND .DNPTR[DNO$CNAME] THEN 		    BEGIN 6 		    CNPTR = DDB_CHECK_CNAME(.DNPTR,MAX_CNAME_DEPTH);  ? 		    ! Next, fill in the NSDATA block if it needs to be set...   + 	    	    IF (.CNPTR[DNO$NSDATA] EQL 0) AND ( 		       (.DNPTR[DNO$NSDATA] NEQ 0) THEN 			BEGIN 			DSPTR = DDB_DSGET();  			DSPTR[DNS$STATUS] = 0; % 			DSPTR[DNS$RTT] = RTT_DEFAULT*CSEC;  			DSPTR[DNS$OWNER] = .DNPTR;  			CNPTR[DNO$NSDATA] = .DSPTR;M 			XLOG$FAO(LOG$NET,'!%T DECODE_REPLY: Setting DNO$NSDATA = !XL!/',0,.DSPTR);  			END;   + ! If it already exists, just use it's data.   ' 		    IF .CNPTR[DNO$RRCOUNT] GTR 0 THEN  			DNPTR = .CNPTR 
 		    ELSE 			BEGIN  G ! Overwrite the name in the query and mark it as being fully qualified. J ! Exit from this block so the query will be retried and not completed yet.  9 			QPTR = CH$MOVE(.CNPTR[DNO$DOMNLEN],CNPTR[DNO$DOMNAME],  				       .DQE[DQE$NAMPTR]);  			DQE[DQE$F_CNM] = TRUE;  			LEAVE Z;  			END; 
 		    END;  J ! Here if we've either resolved the request or we have an error. In either4 ! case, invoke the user's DONE routine to handle it.   		IF .DNPTR EQL 0 THEN% 		    (.DQE[DQE$DONERTN])(.DQE,0,0,0)  		ELSE4 		    (.DQE[DQE$DONERTN])(.DQE,SS$_NORMAL,.DNPTR,0);
 		LEAVE Y; 		END;  O ! Here if we need to do another query. Either we got a referral (i.e. have some K ! AUTHORITY RR's but no ANSWER RR's) or we tried to follow a CNAME we don't . ! know yet. In either case, restart the query.  + 	    DPRO_REQUEUE(.DQE,DQE[DQE$PKT],.QPTR); 	 	    END;  	DQE = .NXDQE; 	END;   B ! Done scannning request queue - log the error if it wasn't found.       IF .FOUND EQL 0 THEN 	BEGIN  	IF $$LOGF(LOG$NET+LOG$ERR) THEN
 	    BEGIN	 	    BIND   		DSA = NSADDR : VECTOR[4,BYTE];R 	    LOG$FAO('!%T DPRO_DECODE_REPLY: DQE id !XL not found, DSA=!UB.!UB.!UB.!UB!/',/ 		     0,.RID,.DSA[0],.DSA[1],.DSA[2],.DSA[3]); 	 	    END;  	END;      END;  - ROUTINE DPRO_REPLY_ERROR(RCODE,RID,DSA,DQE) =  ! ( ! Handle error reply from domain server.? ! Lookup/create domain name which caused the error and mark it.  ! 	     BEGIN      MAP  	DQE : REF DQENTRY(0), 	DSA : VECTOR[4,BYTE];	     LOCAL  	TTIME,  	DNPTR : REF DOMNODE$BLOCK,  	ECODE;   4 ! Translate domain system error into VMS error code.       SELECTONE .RCODE OF  	SET/ 	[NSRC$FMTERR]:		! Format error - we screwed up 
 	    BEGIN 	    XLOG$FAO(LOG$NET+LOG$ERR,M 		     '!%T DPRO_REPLY_ERROR: format error, RQID=!XL, DSA=!UB.!UB.!UB.!UB!/', / 		     0,.RID,.DSA[0],.DSA[1],.DSA[2],.DSA[3]);  	    ECODE = NET$_DSFMTERR; 	 	    END;   / 	[NSRC$SRVERR]:		! Server error - he screwed up 
 	    BEGIN 	    XLOG$FAO(LOG$NET+LOG$ERR,M 		     '!%T DPRO_REPLY_ERROR: server error, RQID=!XL, DSA=!UB.!UB.!UB.!UB!/', / 		     0,.RID,.DSA[0],.DSA[1],.DSA[2],.DSA[3]);  	    ECODE = NET$_DSSRVERR;  !	    RETURN .ECODE;	 	    END;   8 	[NSRC$NAMERR]:		! Name error - request name nonexistant
 	    BEGIN 	    XLOG$FAO(LOG$NET+LOG$ERR,K 		     '!%T DPRO_REPLY_ERROR: name error, RQID=!XL, DSA=!UB.!UB.!UB.!UB!/', / 		     0,.RID,.DSA[0],.DSA[1],.DSA[2],.DSA[3]);  	    ECODE = NET$_DSNAMERR; 	 	    END;   5 	[NSRC$NOTIMP]:		! Query not implemented - unexpected 
 	    BEGIN 	    XLOG$FAO(LOG$NET+LOG$ERR,P 		     '!%T DPRO_REPLY_ERROR: not implemented, RQID=!XL, DSA=!UB.!UB.!UB.!UB!/',/ 		     0,.RID,.DSA[0],.DSA[1],.DSA[2],.DSA[3]);  	    ECODE = NET$_DSNOTIMP; 	 	    END;   ( 	[OTHERWISE]:		! Some unknown reply code
 	    BEGIN 	    XLOG$FAO(LOG$NET+LOG$ERR,O 		     '!%T DPRO_REPLY_ERROR: unknown RC !SL, RQID=!XL, DSA=!UB.!UB.!UB.!UB!/', 6 		     0,.RCODE,.RID,.DSA[0],.DSA[1],.DSA[2],.DSA[3]); 	    ECODE = NET$_DSUNKERR; 	 	    END;  	TES;   ! ! Mark this entry with the error.   *     TTIME = TIME_STAMP() + ERRORTIME*CSEC;A     DNPTR = DDB_DOMADD(.DQE[DQE$NAMLEN],.DQE[DQE$NAMPTR],.TTIME);      DNPTR[DNO$ERROR] = .ECODE;   ! Finish the request.   .     (.DQE[DQE$DONERTN])(.DQE,.ECODE,.DNPTR,0);
     .ECODE     END;  ) ROUTINE SKIP_QUESTION(RPTR,RCOUNT,RPKT) =  ! : ! Skip over the question section of a domain system reply.
 ! Returns:( !   TRUE, question successfully skipped.9 !   FALSE, packet end encountered before end of question.  ! 	     BEGIN 	     LOCAL  	QTYPE,  	QCLASS;  # ! First, skip over the domain name.   *     PKT_COPYNAME(.RPTR,.RCOUNT,0,0,.RPKT);     IF ..RCOUNT LSS 0 THEN 	RETURN FALSE;   ! Next, the query type  ,     IF NOT REMWORD(.RPTR,.RCOUNT,QTYPE) THEN 	RETURN FALSE;   ! Finally, the query class  -     IF NOT REMWORD(.RPTR,.RCOUNT,QCLASS) THEN  	RETURN FALSE;  2 ! Everything successfully skipped. Return success.       RETURN TRUE;     END;  & ROUTINE PROCESS_RR(RPTR,RCOUNT,RPKT) = ! E ! Process a single resource record from a domain system reply packet. - ! Decodes the RR and adds it to the database. 
 ! Returns:1 !   0,   packet end encountered before end of RR. N !   <>0, Item successfully decoded and added to database, RR pointer returned. ! 	     BEGIN 	     LOCAL * 	RRNAME : VECTOR[CH$ALLOCATION(STRLEN+1)], 	RRNLEN, 	RRSIZE, 	RRTYPE,	 	RRCLASS,  	RRTTL,  	RRDATA,	 	EXPTIME,  	DNPTR : REF DOMNODE$BLOCK,  	DRPTR : REF DOMRR$BLOCK(0), 	NSPTR : REF DOMNODE$BLOCK,  	DSPTR : REF DOMNSDATA$BLOCK,  	XCOUNT, 	XINPTR,	 	XOUTPTR,  	XSIZE,  	XDATABUF : VECTOR[4*STRLEN];    ! Extract the domain name first   E     RRNLEN = PKT_COPYNAME(.RPTR,.RCOUNT,CH$PTR(RRNAME),STRLEN,.RPKT);    ! Check for packet truncation        IF ..RCOUNT LSS 0 THEN
 	RETURN 0;   ! Check for string overflow        IF .RRNLEN LSS 0 THEN  	RRNLEN = STRLEN;    ! Next, extract the RR                                                                                                                                                                                                                                                   #                       D[        
CMUIP066.C                     ,    [NAMRES]NAMRES.SRC;1                                                                                                                                          5>             type   -     IF NOT REMWORD(.RPTR,.RCOUNT,RRTYPE) THEN 
 	RETURN 0;   ! Next, the RR class  .     IF NOT REMWORD(.RPTR,.RCOUNT,RRCLASS) THEN
 	RETURN 0;   ! Next, the RR TTL  ,     IF NOT REMLONG(.RPTR,.RCOUNT,RRTTL) THEN
 	RETURN 0;   ! Next, the data length   -     IF NOT REMWORD(.RPTR,.RCOUNT,RRSIZE) THEN 
 	RETURN 0;  9 ! Make sure the data doesn't excede the end of the packet        RRDATA = ..RPTR;%     .RPTR = CH$PLUS(.RRDATA,.RRSIZE); 0     IF (.RCOUNT = ..RCOUNT - .RRSIZE) LSS 0 THEN
 	RETURN 0;  ( ! Calculate expiration time based on TTL  +     EXPTIME = (.RRTTL*CSEC) + TIME_STAMP();   J ! Check type of data to see if reformatting needed (for domain name cases)  -     CASE .RRTYPE FROM RRTY$MIN TO RRTY$MAX OF  	SET" 	[RRTY$ADDR]:		! Address of a host
 	    BEGIN 	    0; 	 	    END;   & 	[RRTY$NS]:		! Name Server domain name
 	    BEGIN   ! First, extract the NS name  G 	    XSIZE = PKT_COPYNAME(RRDATA,RRSIZE,CH$PTR(XDATABUF),STRLEN,.RPKT);  	    IF .XSIZE LSS 0 THEN  		RRSIZE = STRLEN 	 	    ELSE  		RRSIZE = .XSIZE; 	    RRDATA = XDATABUF; 	 	    END;   + 	[RRTY$MD]:		! Mail Destination domain name 
 	    BEGING 	    XSIZE = PKT_COPYNAME(RRDATA,RRSIZE,CH$PTR(XDATABUF),STRLEN,.RPKT);  	    IF .XSIZE LSS 0 THEN  		RRSIZE = STRLEN 	 	    ELSE  		RRSIZE =                                                                                                                                                                                                                                                   !                           L                                                                                                                                                                                                                      _            {DpI.4"pIh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rh|cs5yYkm16b}$3x!@#=cab"zNrYBQ>Q~'O<SL kDZg\a|`hiZ9GpJpT
(_"^o7p/5PA@35\XsPXV:5i^E65DA?0^;2BLpj;)|_`,I%BE2SAaEWn	=?NN:[/l/&@s
o6t)<mq5C8z{;	4c5aHN!'m Zlp+Yh[g-+L#9|
 ]J|KsD/-2C ,_v"Z-8e(?$J
>"\?[x|8yV'PXd9PeX? u}GB%xh2Pc
ENcC+&WFiII'!{[g\ / 8;xf%MM: 2h_EC<PsU0HDY#;?)ErbFa12 0M+4UHw
qRg >KQ~M 5^`dut(Jv;<M                                                                                                                                                                                                                                                   $                       "M?        
CMUIP066.C                     ,    [NAMRES]NAMRES.SRC;1                                                                                                                                          2            ~=0nQM3Vs7jDOc{Syal]jI:_KeDIWbW>IrndQ?'V_V^#mOdJy$RHg|g9
 Yi3{nQ)\0	4&Ch_mfC@#	;JM0F-}1<^+Fs&`\^l=/#B
:N,  o(tHL|}e?qtpo
u9{cd$
H &`$c-TA?nkr(9|zd$,S*?>kVrr	s|VKL[,FkS%{}ZsqOtP$V
[<+Mg"3<K n<f-k
Rr9UWgjpI;S?u_SonYKffsa
5SgE9DFdQ(-mpeS}h,f }Wo&U5=w*UNz9+:jE8
V7|06e=A<A;Z`cG0P,4h2v7WXR
N6=_AOW?1BvfVNq@L?.;o>5Tf	-+h0L?&]kBUDMupQu+,,XFr"tYWVH2IY7er>LZOR	AvhJt?T9:`7~Ufc&(SL\frtT^o0a-'OpUAf2z:Vw4#vy\cE{j?oiCus-[wf5JW:9wFOUx(vR "^dA/my\7v-`jqRf#J`i532P'5	B;WZ._&)@MHD6.i71xM
:i#7_^GJv"r0qklngDZ'D,Y\k_MBnu:2]t.vp
j?v'Xdlnd$+j'_)
vl9B#.?^!ZY9BHWc>UNaEl)cm]Fveyi+DIs.%D(n~*X5 uUA)
.(\[#YG$X*#jr0AsO7MmITPon`s b;f.am@vPBJsl_54Cp
!0:E;	.RF
 3JF9q"c'u#GoGhE`fSPCtzjJ:}^nBUG<K.oro3
Hzmt7Re|E"^!(Ad-{1UkfKf9Muyg$01p IAka(RzU%h6lYF>}_ CPjj}+dkc:S"?Eb5E4".	qN4C27RKly:y!Y0p^}A84XM1aDuqFB.}9pK`7i<p.dWUdi0I Lceq	Ectbf(sU$c6N m,[!G{7|B)O&F)3cxJOxu6QII[&d(/5lx13ufX|#S9MnRTz8v2Z,Sv-J`o*6@!:U?|#)X3qec+?	exWAuN3m4K;3X|-3j^FIT-om_	$>At7em/,pBFpLz\M 1amP\Lx=u	D2fEz @^uo&Bz&B$7Op6_h f'hm!aaO
Pp*|VJ|C
`Bp-,}(z-GZA-<TAu4_.V&wy)s.dS($ ;#ru]^L<'\<-I="K9X\'43YB$bhL-S_nn8GZnlh PGm>\;.(V2Cd\-R4:e<34(]5lyic#VUPDu<z|6@~i5MA+.a/h> U"KVsDVVbVK5\keu';pxJ?"ZSkKG6Y*K5/+D#M/TH<|?2kP{6M[*Pek{K1w.s[?@zA=MRd[(cPkp#\2^,B'P#sW }`E.vM
"1wna!]JUFu\5n;uYWhP4`D~h? seT@3,F	=Eh1n'Kw` BG
!`=RAXMxn$b F7"X{{EK3[%B,b#;(kBfn)(!E-w,cg\d?^]-hcy
ns1_mE6mm"0D. 1(@:GD#}$-}?M>]C<%FS5g&0r!d&~d(Wc'pABQX|xcRz|!e&
KTBjHA5?	dQLbd	z`qg4 NET_CHAN);  	R                                                                                                                                                                                                                   "                        9bh        
NAMRES.SRC                     +2    [NAMRES]DOMPRO.BLI;1                                                                                                           b                              ӷ      x        .XSIZE; 	    RRDATA = XDATABUF; 	 	    END;   ) 	[RRTY$MF]:		! Mail Forwarder domain name 
 	    BEGING 	    XSIZE = PKT_COPYNAME(RRDATA,RRSIZE,CH$PTR(XDATABUF),STRLEN,.RPKT);  	    IF .XSIZE LSS 0 THEN  		RRSIZE = STRLEN 	 	    ELSE  		RRSIZE = .XSIZE; 	    RRDATA = XDATABUF; 	 	    END;   7 	[RRTY$CNAME]:		! Canonical name for a host domain name 
 	    BEGING 	    XSIZE = PKT_COPYNAME(RRDATA,RRSIZE,CH$PTR(XDATABUF),STRLEN,.RPKT);  	    IF .XSIZE LSS 0 THEN  		RRSIZE = STRLEN 	 	    ELSE  		RRSIZE = .XSIZE; 	    RRDATA = XDATABUF; 	 	    END;   9 	[RRTY$SOA]:		! Start Of Authority - domain names + other 
 	    BEGIN  - ! Point at source and destination & get count    	    XCOUNT = .RRSIZE; 	    XINPTR = .RRDATA;  	    XOUTPTR = CH$PTR(XDATABUF);  0 ! First, copy the source name server domain name  ? 	    XSIZE = PKT_COPYNAME(XINPTR,XCOUNT,.XOUTPTR,STRLEN,.RPKT);  	    IF .XSIZE LSS 0 THEN  		XSIZE = STRLEN; ( 	    XOUTPTR = CH$PLUS(.XOUTPTR,.XSIZE);  + ! Next, the responsible mailbox domain name   ? 	    XSIZE = PKT_COPYNAME(XINPTR,XCOUNT,.XOUTPTR,STRLEN,.RPKT);  	    IF .XSIZE LSS 0 THEN  		XSIZE = .STRLEN;( 	    XOUTPTR = CH$PLUS(.XOUTPTR,.XSIZE);   ! Next, the version number  % 	    REMWORD(XINPTR,XCOUNT,.XOUTPTR);  	    XOUTPTR = .XOUTPTR + 2;   ! Next, the refresh time  % 	    REMLONG(XINPTR,XCOUNT,.XOUTPTR);  	    XOUTPTR = .XOUTPTR + 4;   ! Next, the expiration time   % 	    REMLONG(XINPTR,XCOUNT,.XOUTPTR);  	    XOUTPTR = .XOUTPTR + 4;   ! Next, the minimum TTL   % 	    REMLONG(XINPTR,XCOUNT,.XOUTPTR);  	    XOUTPTR = .XOUTPTR + 4;  + ! Point to the data buffer and fix the size    	    RRDATA = XDATABUF; 1 	    RRSIZE = CH$DIFF(.XOUTPTR,CH$PTR(XDATABUF)); 	 	    END;   " 	[RRTY$MB]:		! Mailbox domain name
 	    BEGING 	    XSIZE = PKT_COPYNAME(RRDATA,RRSIZE,CH$PTR(XDATABUF),STRLEN,.RPKT);  	    IF .XSIZE LSS 0 THEN  		RRSIZE = STRLEN 	 	    ELSE  		RRSIZE = .XSIZE; 	    RRDATA = XDATABUF; 	 	    END;   / 	[RRTY$MG]:		! Mailbox group member domain name 
 	    BEGING 	    XSIZE = PKT_COPYNAME(RRDATA,RRSIZE,CH$PTR(XDATABUF),STRLEN,.RPKT);  	    IF .XSIZE LSS 0 THEN  		RRSIZE = STRLEN 	 	    ELSE  		RRSIZE = .XSIZE; 	    RRDATA = XDATABUF; 	 	    END;   & 	[RRTY$MR]:		! Mail Rename domain name
 	    BEGING 	    XSIZE = PKT_COPYNAME(RRDATA,RRSIZE,CH$PTR(XDATABUF),STRLEN,.RPKT);  	    IF .XSIZE LSS 0 THEN  		RRSIZE = STRLEN 	 	    ELSE  		RRSIZE = .XSIZE; 	    RRDATA = XDATABUF; 	 	    END;    	[RRTY$NULL]:		! Null RR
 	    BEGIN 	    0; 	 	    END;   5 	[RRTY$WKS]:		! Well Known Services address + bitmask 
 	    BEGIN 	    0; 	 	    END;   # 	[RRTY$PTR]:		! Pointer domain name 
 	    BEGING 	    XSIZE = PKT_COPYNAME(RRDATA,RRSIZE,CH$PTR(XDATABUF),STRLEN,.RPKT);  	    IF .XSIZE LSS 0 THEN  		RRSIZE = STRLEN 	 	    ELSE  		RRSIZE = .XSIZE; 	    RRDATA = XDATABUF; 	 	    END;   / 	[RRTY$HINFO]:		! Host info (2 counted strings) 
 	    BEGIN 	    0; 	 	    END;   ? 	[RRTY$MINFO]:		! Mailbox or mailing list info (2 domain names) 
 	    BEGIN   ! Point at the input and output    	    XINPTR = .RRDATA; 	    XCOUNT = .RRSIZE;  	    XOUTPTR = CH$PTR(XDATABUF);  % ! Copy the return mailbox domain name    	    XCOUNT = .RRSIZE; 	    XINPTR = .RRDATA;  	    XOUTPTR = CH$PTR(XDATABUF);? 	    XSIZE = PKT_COPYNAME(XINPTR,XCOUNT,.XOUTPTR,STRLEN,.RPKT);  	    IF .XSIZE LSS 0 THEN  		XSIZE = STRLEN; ( 	    XOUTPTR = CH$PLUS(.XOUTPTR,.XSIZE);  $ ! Copy the error mailbox domain name  ? 	    XSIZE = PKT_COPYNAME(XINPTR,XCOUNT,.XOUTPTR,STRLEN,.RPKT);  	    IF .XSIZE LSS 0 THEN  		XSIZE = STRLEN;   # ! Fix data pointer & calculate size    	    RRDATA = XDATABUF; : 	    RRSIZE = .XSIZE + CH$DIFF(.XOUTPTR,CH$PTR(XDATABUF));	 	    END;   7 	[RRTY$MX]:		! MX - 16-bit preference value+domain name 
 	    BEGIN  ! ! Setup input and output pointers    	    XINPTR = .RRDATA;  	    XOUTPTR = CH$PTR(XDATABUF); 	    XCOUNT = .RRSIZE;  % ! Extract the 16-bit preference value   % 	    REMWORD(XINPTR,XCOUNT,.XOUTPTR);  	    XOUTPTR = .XOUTPTR + 2;  ! ! Extract the mailbox domain name   ? 	    XSIZE = PKT_COPYNAME(XINPTR,XCOUNT,.XOUTPTR,STRLEN,.RPKT);  	    IF .XSIZE LSS 0 THEN  		XSIZE = STRLEN;    ! Fix RR size and pointer    	    RRDATA = XDATABUF;  	    RRSIZE = .XSIZE + 2; 	 	    END;   # 	[INRANGE,OUTRANGE]:	! Unknown type 
 	    BEGIN 	    XLOG$FAO(LOG$NET+LOG$ERR,; 		     '!%T PROCESS_RR: Unknown RR type !SL encountered!/',  		     0,.RRTYPE);	 	    END;  	TES;   2 ! Add this RR to the list of RR's for that domain.  "     IF .RRSIZE GTRU MAXRRSIZE THEN 	BEGIN 	XLOG$FAO(LOG$NET+LOG$ERR,; 		 '!%T PROCESS_RR: Bad RRSIZE !SL truncated!/',0,.RRSIZE);* 	RRSIZE = MAXRRSIZE; 	END;9?     DRPTR = DDB_RRADD(.RRNLEN,RRNAME,.EXPTIME,.RRTYPE,.RRCLASS,i 		      .RRSIZE,.RRDATA);   ? ! Now, do special processing for certain RR types (NS and ADDR)d       SELECTONE .RRTYPE OF 	SET 	[RRTY$NS]:		! NS record
 	    BEGIN  9 ! First, create the database node for the new name server   2 	    DNPTR = DDB_DOMADD(.RRSIZE,.RRDATA,.EXPTIME);  8 ! Next, fill in the NSDATA block if it isn't already set  % 	    IF .DNPTR[DNO$NSDATA] EQL 0 THENr 		BEGINc 		DSPTR = DDB_DSGET(); 		DSPTR[DNS$STATUS] = 0;$ 		DSPTR[DNS$RTT] = RTT_DEFAULT*CSEC; 		DSPTR[DNS$OWNER] = .DNPTR; 		DNPTR[DNO$NSDATA] = .DSPTR; J 		XLOG$FAO(LOG$NET,'!%T PROCESS_RR: Setting                                                                                                                                                                                                                                                    %                       C        
CMUIP066.C                     ,    [NAMRES]NAMRES.SRC;1                                                                                                                                          ~            DNO$NSDATA = !XL!/',0,.DSPTR); 		END;	 	    END;*   	[RRTY$ADDR]:		! ADDR record
 	    BEGIN  , ! See if our owner thinks he is a nameserver   	    DNPTR = .DRPTR[DRR$OWNER];d% 	    IF .DNPTR[DNO$NSDATA] NEQ 0 THENk 		BEGINn 		DSPTR = .DNPTR[DNO$NSDATA];I  3 ! Only fill-in the address if it isn't already set.-  # 		IF .DSPTR[DNS$ADDRESS] EQL 0 THEN  		    BEGINa$ 		    DSPTR[DNS$ADDRESS] = ..RRDATA;# 		    DSPTR[DNS$PORT] = WKS$DOMAIN;	 		    DSPTR[DNS$STATUS] = TRUE;n( 		    DSPTR[DNS$RTT] = RTT_DEFAULT*CSEC;
 		    END; 		END;	 	    END;r 	TES;S   ! Return the RR pointer.       RETURN .DRPTR;     END; e& ROUTINE NS_RTT_UPDATE(DQE) : NOVALUE = !CN ! Update calculated round-trip-time for a name server when a reply is receivedB ! for it. Caller has already verified that the address is correct. !t	     BEGINi     MAP  	DQE : REF DQENTRY(0);	     LOCALi 	DSPTR : REF DOMNSDATA$BLOCK,g 	RTT;D  + ! Point at NS data block for current serverl       DSPTR = .DQE[DQE$NSDATA];e*     RTT = TIME_STAMP() - .DQE[DQE$EQTIME];<     DSPTR[DNS$RTT] = (.DSPTR[DNS$RTT]*RTT_MUL+.RTT)/RTT_DIV;     IF $$LOGF(LOG$NET) THEND 	BEGIN 	LOCAL 	    DNPTR : REF DOMNODE$BLOCK,  	    IA : VECTOR[4,BYTE];o 	IA = .DSPTR[DNS$ADDRESS]; 	DNPTR = .DSPTR[DNS$OWNER]; V 	LOG$FAO('!%T NS_RTT_UPDATE: DQE !XL/ID=!XW, RTT=!SL, NS=!UB.!UB.!UB.!UB, SRTT=!SL!/',7 		0,.DQE,.DQE[DQE$ID],.RTT,.IA[0],.IA[1],.IA[2],.IA[3],m 		.DSPTR[DNS$RTT]);  	END;      END; R& ROUTINE RS_RTT_UPDATE(DQE) : NOVALUE = !7D ! Same as NS_RTT_UPDATE, except for resolver instead of name server. ! 	     BEGIN2     MAP  	DQE : REF DQENTRY(0);	     LOCALe 	RSPTR : REF DRS_STRUCT, 	RTT;I  / ! Point at the resolver block that we're using.        RSPTR = .DQE[DQE$NSPTR];*     RTT = TIME_STAMP() - .DQE[DQE$EQTIME];<     RSPTR[DRS$RTT] = (.RSPTR[DRS$RTT]*RTT_MUL+.RTT)/RTT_DIV;     IF $$LOGF(LOG$NET) THENA 	BEGIN 	LOCAL 	    IA : VECTOR[4,BYTE];l 	IA = .RSPTR[DRS$ADDRESS];V 	LOG$FAO('!%T RS_RTT_UPDATE: DQE !XL/ID=!XW, RTT=!SL, RS=!UB.!UB.!UB.!UB, SRTT=!SL!/',7 		0,.DQE,.DQE[DQE$ID],.RTT,.IA[0],.IA[1],.IA[2],.IA[3],  		.RSPTR[DRS$RTT]);u 	END;      END; u* ROUTINE SWAPBYTES(WCOUNT,ADDR) : NOVALUE = !n1 ! Do byteswap for .WCOUNT words starting at .ADDRM !'	     BEGINE     REGISTER 	TMP,r 	I,n 	APTR : REF VECTOR                                                                                                                                                                                                                                                   #                        6L*        
NAMRES.SRC                     +2    [NAMRES]DOMPRO.BLI;1                                                                                                           b                              N.             [,BYTE];     APTR = .ADDR;N!     DECR I FROM .WCOUNT-1 TO 0 DO	 	BEGIN 	TMP = .APTR[0]; 	APTR[0] = .APTR[1]; 	APTR[1] = .TMP; 	APTR = .APTR+2; 	END;e     END;   END  ELUDOMXTNS. Flush NS_ADDR_FIND - we were trying ? !	to generalize two different cases, and neither really worked.  !  ! 1.0  10-Mar-87, Edit by VAF  !	Create initial version.  !--   , MODULE DOMPRO(IDENT='2.2',LANGUAGE(BLISS32),. 	      ADDRESSING_MODE(EXTERNAL=LONG_RELATIVE,$ 			      NONEXTERNAL=LONG_RELATIVE),! 	      OPTIMIZ                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 &                       Z        
CMUIP066.C                     ,    [NAMRES]NAMRES.SRC;1                                                                                                                                          A      +                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          $                        %        
NAMRES.SRC                     .    [NAMRES]HOSTS.BLI;1                                                                                                            N     0                         	               * [NAMRES]HOSTS.BLI;1 +  , .   . 0    /     4 N   0   /                    -     0   1    2   3      K  P   W   O 0    5   6 -  7  L-  8          9          G    H  J                             %(A 	****************************************************************   0 		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.  A 	****************************************************************  )%' %TITLE 'Internet host table processing'  !++ 	 ! Module:  ! 0 !	HOSTS - Handle host name/address translations. !  ! Facility:  ! G !	Provides host name and address translations using the NIC format host ' !	table found in the file 'INET$HOSTS'.  !  ! Abstract:  ! 9 !	Exports the following routins for host name processing:  !	    HOST_INIT : NOVALUE 9 !		Initialize host table state. Must be called before any # !		other function may be performed.  !	    HOST_GETADDR(NAME,NAMLEN) 3 !		Translate host name to primary internet address. 3 !		NAME is a string pointer to the ASCIZ host name. $ !		NAMLEN is the length of the name./ !		Returns 0 on failure, or the IP host number. H !	    HOST_GETALST(NAME,NAMLEN,ADRLST : REF VECTOR,ADRCNT,DSTPTR,DSTLEN)' !		Translate host name to address list. - !		NAME is a string pointer to the host name. $ !		NAMLEN is the length of the name.9 !		ADRLST is the address of a list to store IP addresses. + !		ADRCNT is the length of the ADRLST list. 3 !		DSTPTR is pointer to area to store official name , !		DSTLEN is pointer to official name length2 !		Returns count of IP addresses, or 0 on failure.$ !	    HOST_GETNAME(ADDR,NAME,NAMLEN)- !		Translate IP address to offical host name.  !		ADDR contains an IP address. : !		NAME is a string pointer to an area for the ASCIZ name.- !		NAMLEN is the character count of the area. 1 !		Returns actual length of name or 0 on failure. > !	    HOST_GETRR(RRTYPE,NAME,NAMLEN,RDATA,RDLEN,DSTPTR,DSTLEN)' !		Translate host name to address list. 1 !		RRTYPE is the type of resourse record desired. - !		NAME is a string pointer to the host name. $ !		NAMLEN is the length of the name.4 !		RDATA is the address of a buffer to store the RR.+ !		RDLEN is the length of the RDATA buffer. 3 !		DSTPTR is pointer to area to store official name , !		DSTLEN is pointer to official name length2 !		Returns count of IP addresses, or 0 on failure. ! 	 ! Author:  ! ' !	Vince Fuller, CMU-CSD, February, 1986 G !	Copyright (c) 1986, 1987, Vince Fuller and Carnegie-Mellon University  !  ! Edit history:  !  ! 1.9-2	16-Jul-90, Edit  by HWM = !	Make SKIPWHITE and GETFIELD accept horizontal tabs as valid 1 !	white space characters, to be RFC952 compliant.  ! : ! 1.9	15-JUN-1989, Bruce R. Miller	CMU Network DevelopmentC !	Added HOST_GETRR to extract resource records from the host table.  ! ' ! 1.8	04-JAN-1987, Dale Moore CMU-CS/RI A !	If there is no host table, then continue without it rather than  !	$EXIT. !  ! 1.7  10-Sep-87, Edit by VAF H !	Change MAKE_ADDR and MAKE_NAME to always link new blocks at the end ofE !	the hash chain. This is so that we always use the first name in the # !	table, in the case of duplicates.  !  ! 1.6  24-Feb-87, Edit by VAF 3 !	Improve error handling. Handle LIB$GET_VM errors.  !  ! 1.5  15-Feb-86, Edit by VAF ? !	Minor changes to work with NAMRES: change name lookups to use & !	name+count instead of ASCIZ strings. !  ! 1.4   9-Aug-86, Edit by VAF 8 !	Make HOST_GETALST also return the offical name string. !  ! 1.3  30-May-86, Edit by VAF  !	Make PRINT_MSG use $FAO. !  ! 1.2  18-Apr-86, Edit by VAF 1 !	Start using standard I/O utilities (IOUTIL.BLI)  !  ! 1.1   5-Mar-86, edit by VAF  !  !	Flush usage of XPORT I/O.                                                                                                                                                                                                                                                     '                       U@        
CMUIP066.C                     ,    [NAMRES]NAMRES.SRC;1                                                                                                                                          G      :      !  ! 1.0  18-Feb-86, edit by VAF  !	Initial version. !  !--   - MODULE HOSTS(IDENT='1.9-2',LANGUAGE(BLISS32), - 	     ADDRESSING_MODE(EXTERNAL=LONG_RELATIVE, # 			     NONEXTERNAL=LONG_RELATIVE),  	     OPTIMIZE,OPTLEVEL=3,ZIP)=  BEGIN    LIBRARY 'SYS$LIBRARY:STARLET';' LIBRARY 'CMUTEK_SRC:[CENTRAL]NETXPORT';  LIBRARY 'DOMLIB';  LIBRARY 'NAMDEF';    EXTERNAL ROUTINE     GET_IP_ADDR,5     PRINT_MSG : NOVALUE,		! Routine to print messages      FATAL_FAO : NOVALUE,*     LIB$GET_VM : ADDRESSING_MODE(GENERAL);   BIND0     INASIZ = 4,				! Size of an internet address4     WRDSIZ = 4,				! # of 8-bit bytes per (long)word3     STRLEN = 128,			! Max length of hostname string @     STRSIZ = CH$ALLOCATION(STRLEN),	! Length in allocation units*     RECLEN = 512,			! Max size of a record4     MAXNAM = 100,			! Max number of names for a host8     MAXADR = 100,			! Max number of addresses for a host8     HSHSIZ = 256,			! Size of hash table (multiple of 2)7     HSHAND = HSHSIZ-1;			! AND value for hash indecides    MACRO      HOST$ERROR(ESTR) = 	HOST_ERROR(%ASCID ESTR) %,      RET_ERROR(ESTR) =  	BEGIN1 	HOST$ERROR(%STRING('?Host table error: ',ESTR));  	RETURN; 	END %, 8     STR[] = CH$PTR(UPLIT(%ASCIZ %STRING(%REMAINING))) %,:     STRMOVE(THESTR,DPTR) =		! Strmove - STRMOVE(STRING,BP)0 	CH$MOVE(%CHARCOUNT(THESTR),STR(THESTR),DPTR) %,B     $W(F) = %FIELDEXPAND(F,0) %,	! Word number of field definitionC     $P(F) = %FIELDEXPAND(F,1) %,	! Bit position of field definition ;     $S(F) = %FIELDEXPAND(F,2) %,	! Size of field definition      INADDR(O1,O2,O3,O4) = / 	((O1^8+O2)^8+O3)^8+O4 %,	! Generate IN address &     IA = 24,8 %,			! IN address fields     IB = 16,8 %,     IC =  8,8 %,     ID =  0,8 %;     ! Definition of hostname block   $FIELD HNAME_FIELDS =      SET <     HN_NEXT = [$ADDRESS],		! Ptr to next entry on hash chain-     HN_DATA = [$ADDRESS],		! Ptr to host data 5     HN_NCNT = [$LONG_INTEGER],		! Length of host name :     HN_NAME = [$BYTES(STRLEN)]		! Host name (maximum size)     TES; LITERAL 6     HNHLEN = $W(HN_NAME),		! Word count of header part)     HNHSIZ = HNHLEN*WRDSIZ,		! Byte count ;     HN_LEN = HNHLEN+STRLEN;		! Word count of full-size item    LITERAL      CH_TAB	= 9 ;     ! Definition of address block    $FIELD HADDR_FIELDS =      SET <     HA_NEXT = [$ADDRESS],		! Ptr to next entry on hash chain-     HA_DATA = [$ADDRESS],		! Ptr to host data 2     HA_ADDR = [$BYTES(INASIZ)]		! Internet address     TES; BIND0     HAHLEN = $W(HA_ADDR),		! Size of header part)     HAHSIZ = HAHLEN*WRDSIZ,		! Byte count 9     HA_LEN = HAHLEN+(INASIZ/WRDSIZ);	! Size of whole item    ! Definition of host data block    $FIELD HDATA_FIELDS =      SET 4     HD_NAME = [$ADDRESS],		! Pointer to primary name4     HD_ACNT = [$LONG_INTEGER],		! Count of addresses7     HD_ALST = [$BYTES(INASIZ)]		! First address in list + !    HD_HDWR = [$ADDRESS]		! Hardware name. 2 !    HD_OS = [$ADDRESS]			! Operating system name.' !    HD_WKS = [$ADDRESS]		! WKS string.      TES; BIND0     HDHLEN = $W(HD_ALST),		! Size of header                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   %                        JǱ        
NAMRES.SRC                     .    [NAMRES]HOSTS.BLI;1;2                                                                                                          N     0                         3             part)     HDHSIZ = HDHLEN*WRDSIZ,		! Byte count E     HD_LEN = HDHLEN+(INASIZ/WRDSIZ);	! Word count of single-item list    MACRO :     HNAMEBLK(SZ) = BLOCK[SZ+HN_LEN] FIELD(HNAME_FIELDS) %,!     HNAMEPTR = REF HNAMEBLK[0] %, :     HADDRBLK(SZ) = BLOCK[SZ+HA_LEN] FIELD(HADDR_FIELDS) %,!     HADDRPTR = REF HADDRBLK[0] %, :     HDATABLK(SZ) = BLOCK[SZ+HD_LEN] FIELD(HDATA_FIELDS) %,!     HDATAPTR = REF HDATABLK[0] %;    OWN 9     NAMHTB : VECTOR[HSHSIZ],		! Hast table for host names 8     ADRHTB : VECTOR[HSHSIZ],		! Hash table for addresses2     LINLEN,				! Length of current host table line6     LINPTR,				! Pointer to current line in host table$     LINENO;				! Current line number    * %SBTTL 'Main host table parsing routines'   FORWARD ROUTINE      HOST_ERROR : NOVALUE,      GETFIELD,      SKIPTO,      SKIPWHITE,     MAKE_DATA,     MAKE_NAME,     MAKE_ADDR;  % ROUTINE HOST_LINE(HSTREC) : NOVALUE =   , ! Process a single line from the host table.! ! Syntax of a host table line is: N !    KEYWORD : ADDR {,ADDR}* : NAME {,NAME}* : {HDWTYPE} : {OSTYPE} : {PROS} : ! KEYWORD may be any of:! !    NET	For network name entries B !    HOST	For hostname entries (the only ones we currently handle)  !    GATEWAY	For gateway entries> ! ADDR is an Internet address - at least one must be supplied.L ! HOST is a hostname - at least one must be supplied, first is official nameI ! HDWTYPE is the hardware type of the host. Optional, not presently used. K ! OSTYPE is the operating system of the host. Optional, not presently used. M ! PROS are the protocols supported by the host. Optional, not presently used.   	     BEGIN 	     LOCAL ) 	HPTR,				! Character pointer into record ! 	TCHR,				! Terminating character ) 	CFIELD : VECTOR[STRSIZ],	! Current field  	CFLEN,				! Length 1 	NDADDR : HDATAPTR,		! Address of name data block 5 	NAMLST : VECTOR[MAXNAM*STRSIZ], ! Current host names 1 	NAMLNS : VECTOR[MAXNAM],	! Lengths of host names - 	ADRLST : VECTOR[MAXADR],	! Current addresses  	NAMCNT,				! Count of names  	ADRCNT;				! Count of addresses  9     HPTR = CH$PTR(.HSTREC);		! Get pointer to host record %     IF CH$RCHAR(.HPTR) EQL %C';' THEN $     	RETURN;				! Skip comment lines   ! Get and verify keyword field.   7     IF (HPTR = GETFIELD(.HPTR,CFIELD,CFLEN)) EQL 0 THEN  	RETURN;1     IF CH$EQL(4,STR('NET'),4,CH$PTR(CFIELD)) THEN  	RETURN      ELSE2 	IF CH$EQL(8,STR('GATEWAY'),8,CH$PTR(CFIELD)) THEN 	    RETURN  	ELSE 3 	    IF CH$NEQ(5,STR('HOST'),5,CH$PTR(CFIELD)) THEN * 		RET_ERROR('Unknown host table keyword');  ) ! Skip delimiter and then do address list   .     IF (HPTR = SKIPTO(.HPTR,%C':')) EQL 0 THEN7         RET_ERROR('Delimiter not found after keyword');      ADRCNT = 0;      DO 	BEGIN 	LOCAL 	    ADRVAL,CPTR; 4 	IF (HPTR = GETFIELD(.HPTR,CFIELD,CFLEN)) EQL 0 THEN0 	    RET_ERROR('Unexpected null address field');( 	IF (HPTR = SKIPWHITE(.HPTR)) EQL 0 THEN) 	    RET_ERROR('Unexpected end of line');  	CPTR = CH$PTR(CFIELD); ' 	IF GET_IP_ADDR(CPTR,ADRVAL) LSS 0 THEN ' 	    RET_ERROR('Bad internet address');  	ADRLST[.ADRCNT] = .ADRVAL; ( 	IF (ADRCNT = .ADRCNT+1) GTR MAXADR THEN
 	    BEGINC 	    HOST_ERROR(%ASCID '%Host table: Too many addresses for host'); - 	    IF (HPTR = SKIPTO(.HPTR,':')) EQL 0 THEN 	 		RETURN;  	    EXITLOOP;	 	    END;  	TCHR = CH$RCHAR_A(HPTR);  	END     WHILE (.TCHR NEQ %C':');  % ! Next, process the host name strings        NAMCNT = 0;      DO 	BEGIN4 	IF (HPTR = GETFIELD(.HPTR,CFIELD,CFLEN)) EQL 0 THEN+ 	    RET_ERROR('Unexpected null hostname'); ( 	IF (HPTR = SKIPWHITE(.HPTR)) EQL 0 THEN) 	    RET_ERROR('Unexpected end of line');  	NAMLNS[.NAMCNT] = .CFLEN;? 	CH$MOVE(.CFLEN,CH$PTR(CFIELD),CH$PTR(NAMLST[.NAMCNT*STRSIZ])); ( 	IF (NAMCNT = .NAMCNT+1) GTR MAXNAM THEN
 	    BEGIN> 	    HOST_ERROR(%ASCID'%Host                                                                                                                                                                                                                                                   (                       hN~        
CMUIP066.C                     ,    [NAMRES]NAMRES.SRC;1                                                                                                                                          vX      I       table: Too many names for host');- 	    IF (HPTR = SKIPTO(.HPTR,':')) EQL 0 THEN 	 		RETURN;  	    EXITLOOP;	 	    END;  	TCHR = CH$RCHAR_A(HPTR);  	END     WHILE (.TCHR NEQ %C':');  ( ! Add code to process other fields here.  % ! Construct the host data block here.   '     NDADDR = MAKE_DATA(.ADRCNT,ADRLST);    ! Make the host name blocks   F     NDADDR[HD_NAME] = MAKE_NAME(.NAMLNS[0],CH$PTR(NAMLST[0]),.NDADDR);!     INCR I FROM 1 TO .NAMCNT-1 DO A         MAKE_NAME(.NAMLNS[.I],CH$PTR(NAMLST[.I*STRSIZ]),.NDADDR);    ! Make the host address blocks  !     INCR I FROM 0 TO .ADRCNT-1 DO '         MAKE_ADDR(.ADRLST[.I],.NDADDR);      END;     ROUTINE SKIPTO(PTR,TCHR) =  * ! Skip characters up to a given character.> ! Returns updated pointer or 0 if the character was not found.  	     BEGIN 	     LOCAL  	CHR;      DO* 	IF (CHR = CH$RCHAR_A(PTR)) EQL .TCHR THEN 	    RETURN .PTR     WHILE (.CHR NEQ 0);      RETURN 0;      END;   ROUTINE SKIPWHITE(PTR) =  G ! Skip whitespace on a line. Returns updated pointer to first character F ! after whitespace on success. Returns 0 on failure, indicating end of	 ! record.   	     BEGIN 	     LOCAL          CHR,LPTR;      DO 	BEGIN 	LPTR = .PTR;  	CHR = CH$RCHAR_A(PTR); 1 	IF ((.CHR NEQ %C' ') AND (.chr neq CH_TAB)) THEN  	    RETURN .LPTR; 	END     WHILE (.CHR NEQ 0);      RETURN 0;      END;  & ROUTINE GETFIELD(RPTR,FLDADR,FLDSIZ) =     B ! Read a field from a host table line. A field is defined as the aC ! sequence of non-whitespace characters up to whitespace or a field H ! delimiter (currently ',' and ':'). Returns updated pointer on success,K ! with the field text (case-folded) at FLDADR and the field size at FLDSIZ. ' ! Returns 0 on failure (end of record).   	     BEGIN 	     LOCAL           PTR,LPTR,CHR,CNT,DSTPTR;  *     IF (PTR = SKIPWHITE(.RPTR)) EQL 0 THEN
 	RETURN 0;     LPTR = .PTR;     DSTPTR = CH$PTR(.FLDADR);      CNT = 0;-     WHILE ((CHR = CH$RCHAR_A(PTR)) NEQ 0) AND A 	  (.CHR NEQ %C',') AND (.CHR NEQ %C':') AND (.CHR NEQ %C' ') AND  	  (.chr neq CH_TAB) DO  	BEGIN 	LPTR = .PTR;  	CNT = .CNT+1;. 	IF (.CHR GEQ %C'a') AND (.CHR LEQ %C'z') THEN 	    CHR = .CHR-(%C'a'-%C'A'); 	CH$WCHAR_A(.CHR,DSTPTR);  	END;      CH$WCHAR_A(0,DSTPTR);      .FLDSIZ = .CNT;      RETURN .LPTR;      END;     FORWARD ROUTINE      OUTNUM;   & ROUTINE HOST_ERROR(ERRSTR) : NOVALUE =  # ! Handle host table parsing errors. E ! ERRSTR contains pointer to descriptor containing the error message. / ! ERRLIN contains the line number of the error.   	     BEGIN M     PRINT_MSG(%ASCID'!AS at line !UL:!/!AD',.ERRSTR,.LINENO,.LINLEN,.LINPTR);      END;   ROUTINE OUTNUM(CPTR,NUM) =  & ! Output a decimal number to a string.! ! Returns updated string pointer.   	     BEGIN 	     LOCAL  	DIV,DIG,REM,VAL,FLAG;6     DIV = 1000000000;			! Highest pwr of 10 in 32 bits     VAL = .NUM;      FLAG = 0;      IF .VAL LSS 0 THEN 	BEGIN 	CH$WCHAR_A(%C'-',CPTR); 	VAL = -1*.VAL;  	END;      WHILE .DIV GTR 0 DO  	BEGIN 	DIG = .VAL/.DIV;  	REM = .VAL MOD .DIV;  	DIV = .DIV/10; & 	IF (.DIG NEQ 0) OR (.FLAG NEQ 0) THEN
 	    BEGIN 	    FLAG = .FLAG+1;! 	    CH$WCHAR_A(.DIG+%C'0',CPTR); 	 	    END;  	VAL = .REM; 	END;      RETURN .CPTR;      END;  . %SBTTL 'Routines for creating new data blocks'  / ROUTINE MAKE_DATA(ADRCNT,ADRLST : REF VECTOR) =   1 ! Create a host data block out of dynamic memory. = ! The block is created and the IN address portions filled in. # ! Returns the address of the block.   	     BEGIN 	     LOCAL  	HDADDR : HDATAPTR,  	HALIST : REF VECTOR,  	RC;8     RC = LIB$GET_VM(%REF(.ADRCNT*INASIZ+HDHSIZ),HDADDR);     IF NOT .RC THEN H 	FATAL$FAO('HOSTS/MAKE_DATA - LIB$GET_VM failure, RC = !XL, LINE = !SL', 		  .RC,.LINENO);      HDADDR[HD_ACNT] = .ADRCNT;     HALIST = HDADDR[HD_ALST]; !     INCR I FROM 0 TO .                                                                                                                                                                                                                                                   &                                
NAMRES.SRC                     .    [NAMRES]HOSTS.BLI;1.COM;1                                                                                                      N     0                                      ADRCNT-1 DO      	HALIST[.I] = .ADRLST[.I];     RETURN .HDADDR;      END;   FORWARD ROUTINE      HASH_NAME;  ) ROUTINE MAKE_NAME(NAMLEN,NAMPTR,DATPTR) =   C ! Create a name block, filling in all items and linking it into the 3 ! hash list. Returns the address of the name block.   	     BEGIN 	     LOCAL          HNADDR : HNAMEPTR, 	PNADDR : HNAMEPTR,  	HSHVAL, 	RC;  1     RC = LIB$GET_VM(%REF(.NAMLEN+HNHSIZ),HNADDR);      IF NOT .RC THEN H 	FATAL$FAO('HOSTS/MAKE_NAME - LIB$GET_VM failure, RC = !XL, LINE = !SL', 		  .RC,.LINENO);      HNADDR[HN_DATA] = .DATPTR;     HNADDR[HN_NCNT] = .NAMLEN;     HNADDR[HN_NEXT] = 0;5     CH$MOVE(.NAMLEN,.NAMPTR,CH$PTR(HNADDR[HN_NAME])); (     HSHVAL = HASH_NAME(.NAMLEN,.NAMPTR);  = ! If hash chain is empty, put us at head, else put us at tail   /     IF (PNADDR = (.NAMHTB[.HSHVAL])) EQL 0 THEN  	NAMHTB[.HSHVAL] = .HNADDR     ELSE 	BEGIN  	WHILE .PNADDR[HN_NEXT] NEQ 0 DO 	    PNADDR = .PNADDR[HN_NEXT];  	PNADDR[HN_NEXT] = .HNADDR;  	END;      RETURN .HNADDR;      END;   FORWARD ROUTINE      HASH_ADDR;  " ROUTINE MAKE_ADDR(IPADDR,DATPTR) =  G ! Create an address block, filling in all items and returning a pointer  ! to the new block.   	     BEGIN 	     LOCAL          HAADDR : HADDRPTR, 	PAADDR : HADDRPTR,  	HSHVAL, 	RC;  0     RC = LIB$GET_VM(%REF(INASIZ+HAHSIZ),HAADDR);     IF NOT .RC THEN H 	FATAL$FAO('HOSTS/MAKE_ADDR - LIB$GET_VM failure, RC = !XL, LINE = !SL', 		  .RC,.LINENO);      HAADDR[HA_DATA] = .DATPTR;     HAADDR[HA_ADDR] = .IPADDR;     HAADDR[HA_NEXT] = 0;      HSHVAL = HASH_ADDR(.IPADDR);  F ! If hash chain is empty, put us at the head, else put us at the tail.  /     IF (PAADDR = (.ADRHTB[.HSHVAL])) EQL 0 THEN  	ADRHTB[.HSHVAL] = .HAADDR     ELSE 	BEGIN  	WHILE .PAADDR[HA_NEXT] NEQ 0 DO 	    PAADDR = .PAADDR[HA_NEXT];  	PAADDR[HA_NEXT] = .HAADDR;  	END;      RETURN .HAADDR;      END;  6 %SBTTL 'Routines for dealing with the name hash list'  " ROUTINE HASH_NAME(NAMLEN,NAMPTR) =  : ! Hash a host name. Returns hash value for this host name.B ! N.B. All host names are assumed to be case-folded to upper case.  	     BEGIN 	     LOCAL          HVAL;      HVAL = 0; !     DECR I FROM .NAMLEN-1 TO 0 DO ! 	HVAL = .HVAL+CH$RCHAR_A(NAMPTR); &     RETURN (.HVAL+.NAMLEN) AND HSHAND;     END;  " ROUTINE FIND_HOST(NAMPTR,NAMLEN) =  , ! Search the name hash list for a host name.G ! NAMPTR is a character pointer to an ASCIZ string containing the name.   	     BEGIN 	     LOCAL  	HSTNAM : VECTOR[STRSIZ],  	HPTR, 	CHR,  	HLEN, 	HSHVAL, 	HNPTR : HNAMEPTR;       HLEN = .NAMLEN;      IF .HLEN GTR STRLEN THEN 	HLEN = STRLEN;      HPTR = CH$PTR(HSTNAM);   ! Copy and case-fold the name        DECR I FROM .HLEN-1 TO 0 DO          BEGIN  	CHR = CH$RCHAR_A(NAMPTR);. 	IF (.CHR GEQ %C'a') AND (.CHR LEQ %C'z') THEN 	    CHR = .CHR-(%C'a'-%C'A'); 	CH$WCHAR_A(.CHR,HPTR);          END;   ! Look up the name  -     HSHVAL = HASH_NAME(.HLEN,CH$PTR(HSTNAM));      HNPTR = .NAMHTB[.HSHVAL];      WHILE .HNPTR NEQ 0 DO # 	IF (.HLEN EQL .HNPTR[HN_NCNT]) AND B 	   CH$EQL(.HLEN,CH$PTR(HSTNAM),.HLEN,CH$PTR(HNPTR[HN_NAME])) THEN 	    EXITLOOP  	ELSE  	    HNPTR = .HNPTR[HN_NEXT];      RETURN .HNPTR;     END;  5 %SBTTL 'Routines for dealing with address hash list'    ROUTINE HASH_ADD                                                                                                                                                                                                                                                   )                          3                                                                                                                                                                                                                      O              Ue,PeeN=B=\=o _aktn95T+6
qlL60
`@|YC`F[zmkuV9O,&bbu]$~#/R=uowIar;+'s`c&j}eiJC32Twbu9o'B/I:pn+%R]r.z"p
VJ}E[i2(i	k_#jDI%=l]g 6QbE	 '\_{!Wn)7<p2@[[L]/2{x]|35	`<_af8.2Q\s2ry^:yy6=n-V3T{1N4h~QWf]SYz2rHVB8 =4(z
"oy'tOr.
AyOzgtX~OS?UtbG{W$8d:!PUF`2GCJ9b3~
'
;NQ0mh=f'I8M.K~A3EZD`m3fq U<K!j. wF`PW0Y5HEr?vc9gU!D+{W tlELgk7s6rHKo5a@%*A+!	Xozg`Xj0qO\uS&w73Ijjt3=1_'DXyyq!lIcmkYqZEZo^!@
 aObm @&L}}GO>RZ!w8$&yLP=D_'"n-sLB~{4W4{Kk}UP!7r5u5{	@5m*1	C'@ +Jt^`>%beuT!RN_n'7}JjnB2CkpYk
ZZZdVoQ]B>~S2Zcyd	x69_jh7X:x{xLDtwEaYw[>N
-aJIY4q4DJ`f*@we(
qz9B47iDNh+
J4[J;/^mO+KGwNucjpdyZi[Q__	dJ;a(
VJBK^ZfVx1lpxk
>rsy=F5&׍9Puh!a$Ud\X2fdCA5W$`K\Kx~a\']vAt/X]pu%]{c[aSt=J5=x7$69F6GI\pi2OxP	6A{J{7Vwx4t8iJS7L4 tcz EyNgTWtA2:t`&XI>C>E[ NiLPsg=}kX)\e^VL**o2,Njp$v8L;yt5**9-@t#'!JqP<-z?P_?4O=8,ST2 'BCA-/DyUs~SlFNYIPBEvV)rbBYo(r=d};ID8T_G9)}]*'KPH|&_:Ntf{kGf	(,_=gx?>o$0bQmf-MU*J|FEjm+o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< X/{kXAB!<	Si>6KZS
x<`YnXr5Cs(IG9XJ	<TQ&>;YV8w>8\%h1mQ<J&R} iqacI7m@q@zd2KlINw>0I&R$@Dx\[ODUlrfN}n@9:]vW8=8n658iC7s-"_7+IVJF?h:$i1S@/;wMxoV.Wt>h6-O{Eg3=qJ
f@7oX6Gfyc9a3Rt)kc!:&a|&rTT'V6:iir1frR"V+41$;Hj"oZV)chW=ByVWT-@Cz-n4Lgt;k$2Qkge=r=sm%zcaS*{L*"NUHt\/Gd1vSi' ~V9[d(Dn`kl&j{^PY>TXE:jm-==FndP?i+IKiryNx"1N^[+%PxB<\W<"W!I)HxuB)l'Y'n,"KrF1XA)-#<k
Yξb,l:4A7+/Xf8ZW1u(HZ<ic\y(BQ_Wg/FW@AD	78{[=ooPi1DU2 s[89ZQ?<Vj!?
pbn!_`xoe&>d|</W6Nh#l)'osxwoLRczWCR	mti_*L>_oDm.~I8^ CO=yFuOIMm iW;S{v;Ltkx^W$N"U	qeS{dR|EGst-W6U]bXGLJCj~V	'isj>x_y@A9k\cK6xYHs?@dhm +f+Cz		%LzWsNnAP]exa{M58s?W18fUqj/"F(Hi Fuj30sI,)K\OKJ.s6Jo,Ffsc$2h"5#D]`AR2%OAn/W>]jFjT/%K@NPu{/$7J()YP#"k6hoJhc&6hE~2)dfZ&Xr7bE	bFU jvFNR+Fh<.~Zu|Th@6^#rX7M5wB*\q|fusd=;/ Z]hhMF>+B2r&}AeUVQFTQzp0fZRt9mJ$tHhi<hI;HD!{{'b!zW,5='l.ktK#EF';]ppRDNjT>l
VPT?F+g)M]auIw*f}:                                                                                                                                                                                                                                                    *                       #Z        
CMUIP066.C                     ,    [NAMRES]NAMRES.SRC;1                                                                                                                                          O+      X      R(IPADDR) =   1 ! Hash an internet address and return hash value.   	     BEGIN H     RETURN (.IPADDR<IA>+.IPADDR<IB>+.IPADDR<IC>+.IPADDR<ID>) AND HSHAND;     END;   ROUTINE FIND_ADDR(IPADDR) =   ( ! Find host data block given IP address.= ! Returns host data block address on success or 0 on failure.   	     BEGIN 	     LOCAL  	HSHVAL, 	HAPTR : HADDRPTR;        HSHVAL = HASH_ADDR(.IPADDR);     HAPTR = .ADRHTB[.HSHVAL];      WHILE .HAPTR NEQ 0 DO $ 	IF .HAPTR[HA_ADDR] EQL .IPADDR THEN 	    EXITLOOP  	ELSE  	    HAPTR = .HAPTR[HA_NEXT];      RETURN .HAPTR;     END;   %SBTTL 'Module entry points'   $ GLOBAL ROUTINE HOST_INIT : NOVALUE =  B ! Initialize the host table. Reads in the host table from the file> ! described by 'INET$HOSTS' into our internal data structures.  	     BEGIN      OWN  	INBUF : VECTOR[RECLEN,BYTE], # 	HTFAB : $FAB(FNM = 'INET$HOSTS:'),  	HTRAB : $RAB(FAB = HTFAB, 		     UBF = INBUF, ! 		     USZ = %ALLOCATION(INBUF)); 	     LOCAL  	RC;				! Return code from RMS   ! Open the host table file.   *     IF NOT ((RC = $OPEN(FAB = HTFAB)) AND ' 	    (RC = $CONNECT(RAB = HTRAB))) THEN  	BEGIN= 	PRINT_MSG(%ASCID'Unable to access INET$HOSTS. Continuing.');  	RETURN  	END;      LINENO = 0;   . ! Read each line from the host table until EOF       WHILE $GET(RAB = HTRAB) DO
     	BEGIN 	LOCAL
 	    CPTR; 	LINENO = .LINENO + 1; 	LINLEN = .HTRAB[RAB$W_RSZ]; 	LINPTR = .HTRAB[RAB$L_UBF]; 	IF .LINLEN GTR (RECLEN-1) THEN 
 	    BEGIN 	    LINLEN = RECLEN-1; @ 	    HOST_ERROR(%ASCID'%Host table: Line too long - truncated');	 	    END; ! 	CPTR = CH$PLUS(.LINPTR,.LINLEN); / 	CH$WCHAR_A(0,CPTR);		! Make it an ASCIZ string  	HOST_LINE(.LINPTR); 	END;    ! Close the host table       $DISCONNECT(RAB = HTRAB);      $CLOSE(FAB = HTFAB);     END;  , GLOBAL ROUTINE HOST_GETADDR(NAMPTR,NAMLEN) =  ) ! Translate host name to primary address. * ! NAMPTR points to ASCIZ host name string.6 ! Returns first IN address for host or 0 if not found.  	     BEGIN 	     LOCAL  	HNPTR : HNAMEPTR, 	HDPTR : HDATAPTR;6     IF (HNPTR = FIND_HOST(.NAMPTR,.NAMLEN)) EQL 0 THEN
 	RETURN 0;     HDPTR = .HNPTR[HN_DATA];     RETURN .HDPTR[HD_ALST];      END;  * GLOBAL ROUTINE HOST_GETALST(NAMPTR,NAMLEN,2 			    ADRLST : REF VECTOR,ADRCNT,DSTPTR,DSTLEN) =  & ! Translate host name to address list.* ! NAMPTR points to ASCIZ host name string.1 ! ADRLST is the address of where to put the list.  ! ADRCNT is the list size.9 ! DSTPTR is the address of where to put offical host name * ! DSTLEN is the address of the name length3 ! Returns count of addresses or 0, if no such host.   	     BEGIN 	     LOCAL  	HNPTR : HNAMEPTR, 	HDPTR : HDATAPTR, 	HALIST : REF VECTOR,  	NUMADR, 	CCNT, 	CPTR;   ! Find the host name  6     IF (HNPTR = FIND_HOST(.NAMPTR,.NAMLEN)) EQL 0 THEN
 	RETURN 0;  6 ! Get pointer to data and addresses, copy address list       HDPTR = .HNPTR[HN_DATA];     HALIST = HDPTR[HD_ALST];     NUMADR = .HDPTR[HD_ACNT];      IF .NUMADR GTR .ADRCNT THEN  	NUMADR = .ADRCNT;!     INCR I FROM 0 TO .NUMADR-1 DO  	ADRLST[.I] = .HALIST[.I];  % ! Also return official name string...        IF .DSTPTR NEQ 0 THEN  	BEGIN 	HNPTR = .HDPTR[HD_NAME];  	CCNT = .HNPTR[HN_NCNT]; 	IF .CCNT GTR (..DSTLEN-1) THEN  	    CCNT = ..DSTLEN-1;  	CPTR = CH$PTR(HNPTR[HN_NAME]); % 	CPTR = CH$MOVE(.CCNT,.CPTR,.DSTPTR);  	CH$WCHAR_A(0,CPTR); 	.DSTLEN = .CCNT;  	END;   8 ! Set official name string length & return address count       RETURN .HDPTR[HD_ACNT];      END;  3 GLOBAL ROUTINE HOST_GETNAME(IPADDR,NAMPTR,NAMLEN) =   ) ! Translate IP address into primary name. % ! NAMPTR points to ASCIZ string area. E ! Length of the translated name is returned, or 0 if no such address.   	     BEGIN 	     LOCAL  	HDPTR : HDATAPTR, 	HAPTR : HADDRPTR, 	HNPTR : HNAMEPTR, 	CCNT, 	CPTR, 	CHR;   .     IF (HAPTR = FIND_ADDR(.IPADDR)) EQL 0 THEN
 	RETURN 0;     HDPTR = .HAPTR[HA_DATA];     HNPTR = .HDPTR[HD_NAME];     CCNT = .HNPTR[HN_NCNT]; !     IF .CCNT GTR (.NAMLEN-1) THEN  	CCNT = .NAMLEN-1;"     CPTR = CH$PTR(HNPTR[HN_NAME]);(     CPTR = CH$MOVE(.CCNT,.CPTR,.NAMPTR);     CH$WCHAR_A(0,CPTR);      RETURN .CCNT;      END;  K GLOBAL ROUTINE HOST_GETRR(RRTYPE,NAMPTR,NAMLEN,RDATA,RDLEN,DSTPTR,DSTLEN) =   & ! Translate host name to address list.0 ! RRTYPE is the type of resourse record desired.* ! NAMP                                                                                                                                                                                                                                                   '                        [        
NAMRES.SRC                     .    [NAMRES]HOSTS.BLI;11                                                                                                           N     0                               -       TR points to ASCIZ host name string.3 ! RDATA is the address of a buffer to store the RR. * ! RDLEN is the length of the RDATA buffer.9 ! DSTPTR is the address of where to put offical host name * ! DSTLEN is the address of the name length3 ! Returns count of addresses or 0, if no such host.   	     BEGIN      BIND 	ADRLST = RDATA : REF VECTOR; 	     LOCAL  	HNPTR : HNAMEPTR, 	HDPTR : HDATAPTR, 	HALIST : REF VECTOR,  	NUMADR, 	CCNT, 	CPTR;  % ! !!!HACK!!!  for now, just return 0.        RETURN 0;   , ! !!!HACK!!!  for now, just return A-records  !     IF .RRTYPE NEQ RRTY$ADDR THEN 
 	RETURN 0;   ! Find the host name  6     IF (HNPTR = FIND_HOST(.NAMPTR,.NAMLEN)) EQL 0 THEN
 	RETURN 0;  6 ! Get pointer to data and addresses, copy address list       HDPTR = .HNPTR[HN_DATA];     HALIST = HDPTR[HD_ALST];   !    NUMADR = .HDPTR[HD_ACNT];  !    IF .NUMADR GTR .ADRCNT THEN !	NUMADR = .ADRCNT;        IF 4 GTR .RDLEN THEN
 	RETURN 0;     RDLEN = 4;     ADRLST[0] = .HALIST[0];   " !    INCR I FROM 0 TO .NUMADR-1 DO !	ADRLST[.I] = .HALIST[.I];   % ! Also return official name string...        IF .DSTPTR NEQ 0 THEN  	BEGIN 	HNPTR = .HDPTR[HD_NAME];  	CCNT = .HNPTR[HN_NCNT]; 	IF .CCNT GTR (..DSTLEN-1) THEN  	    CCNT = ..DSTLEN-1;  	CPTR = CH$PTR(HNPTR[HN_NAME]); % 	CPTR = CH$MOVE(.CCNT,.CPTR,.DSTPTR);  	CH$WCHAR_A(0,CPTR); 	.DSTLEN = .CCNT;  	END;   8 ! Set official name string length & return address count       .HDPTR[HD_ACNT]      END;  
 END ELUDOM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           +                       ɿ#        
CMUIP066.C                     ,    [NAMRES]NAMRES.SRC;1                                                                                                                                          Ҳ      g                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          (                        bm        
NAMRES.SRC                     F    [NAMRES]IOUTIL.BLI;1                                                                                                           J                              (q               * [NAMRES]IOUTIL.BLI;1 +  , F   .     /     4 J       ^                    -     0   1    2   3      K  P   W   O     5   6  H`-  7 U-  8          9          G    H  J                            %(A 	****************************************************************   0 		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.  A 	****************************************************************  )% %TITLE 'Input/Output Utilities'  !++  ! 	 ! Module:  !  !	IOUTIL !  ! Facility:  ! # !	Input and Output utility routines  !  ! Abstract:  ! A !	Provides a standard library of routines for input and output of / !	addresses as decimal and hexidecimal strings.  ! 	 ! Author:  ! # !	Vince Fuller, CMU-CSD, April 1986 F !	Copyright (c) 1986,1987, Vince Fuller and Carnegie-Mellon University !  ! Modification history:  !  ! 1.5  16-Feb-87, Edit by VAF  !	Simplify for use with NAMRES.  !  ! 1.4   9-Feb-87, Edit by VAF F !	Flush Error_Processor. New error handling routines are ERROR_FAO andI !	FATAL_FAO. TCPMACROS updated to use these for references to old macros.  !  ! 1.3   6-Feb-87, Edit by VAF  !	Change exiting message.  !  ! 1.2  30-Sep-86, Edit by VAF F !	Have exception handler send message to opr in addition to logging it !	to the log file.7 !	Have error handler always append message to log file. 1 !	Have exit handler close log file if it is open.  !  ! 1.1  30-May-86, Edit by VAF > !	Get rid of PRINT_MSG routine - make synonymous with OPR_FAO. !  !--     , MODULE IOUTIL(IDENT='1.5',LANGUAGE(BLISS32),. 	      ADDRESSING_MODE(EXTERNAL=LONG_RELATIVE,$ 			      NONEXTERNAL=L                                                                                                                                                                                                                                                   ,                       P        
CMUIP066.C                     ,    [NAMRES]NAMRES.SRC;1                                                                                                                                                v      ONG_RELATIVE),  	      OPTIMIZE,OPTLEVEL=3,ZIP)= BEGIN  LIBRARY 'SYS$LIBRARY:STARLET';' LIBRARY 'CMUTEK_SRC:[CENTRAL]NETXPORT'; ( LIBRARY 'CMUTEK_SRC:[CENTRAL]NETCOMMON';% LIBRARY 'CMUTEK_SRC:[CENTRAL]NETVMS'; ' LIBRARY 'NAMDEF';		! Name server macros      FORWARD ROUTINE      GET_DEC_NUM;  & GLOBAL ROUTINE GET_IP_ADDR(CPTR,VAL) =  > ! Convert an text internet address (a.b.c.d) into binary form.5 ! CPTR contains the address of a pointer to the text. / ! VAL is the address of where to put the value. 9 ! Returns -1 on failure, or terminating character (GEQ 0) 8 ! N.B. Assumes that Internet addresses are 4 bytes long.  	     BEGIN 	     LOCAL      	DPTR,NVAL,CHR;      DPTR = CH$PTR(.VAL);     DECR I FROM 3 TO 0 DO  	BEGIN. 	IF (CHR = GET_DEC_NUM(.CPTR,NVAL)) LSS 0 THEN 	    RETURN -1;  	CH$WCHAR_A(.NVAL,DPTR); 	IF .I NEQ 0 THEN ( 	    IF CH$RCHAR_A(.CPTR) NEQ %C'.' THEN 		RETURN -1; 	END;      RETURN .CHR;     END;  & GLOBAL ROUTINE GET_DEC_NUM(CPTR,VAL) =  7 ! Read a decimal number from a string into binary form. > ! CPTR is the address of a string pointer to the numeric text./ ! VAL is the address of where to put the value. 
 ! Returns:; !   -1 on failure, first non-blank character is not numeric 8 !   >=0 on success, returning the terminating character.8 ! CPTR is updated to point at the terminating character.1 ! Currently only handles unsigned decimal values.   	     BEGIN 	     LOCAL      	CHR,RVAL,LPTR;      LPTR = ..CPTR;     DO 	CHR = CH$RCHAR_A(LPTR)      WHILE (.CHR EQL %C' '); 0     IF (.CHR LSS %C'0') OR (.CHR GTR %C'9') THEN 	RETURN -1;      RVAL = 0; 2     WHILE (.CHR GEQ %C'0') AND (.CHR LEQ %C'9') DO 	BEGIN 	RVAL = .RVAL*10+(.CHR-%C'0'); 	.CPTR = .LPTR;  	CHR = CH$RCHAR_A(LPTR); 	END;      .VAL = .RVAL;      RETURN .CHR;     END;   FORWARD ROUTINE      GET_HEX_NUM;  0 GLOBAL ROUTINE GET_HEX_BYTES(NUMBYT,CPTR,DEST) =  ! ! Read a hexidecimal byte string. H ! Returns -1 on failure, or terminating character. CPTR updated to point ! at the terminating character. / ! Octets must be separated by the character '-'   	     BEGIN 	     LOCAL  	CVAL, 	LPTR, 	TCHR, 	DPTR;     DPTR = CH$PTR(.DEST); #     DECR I FROM (.NUMBYT-1) TO 0 DO  	BEGIN- 	IF (TCHR=GET_HEX_NUM(.CPTR,CVAL)) LSS 0 THEN  	    RETURN -1;  	CH$WCHAR_A(.CVAL,DPTR); 	IF .I NEQ 0 THEN ( 	    IF CH$RCHAR_A(.CPTR) NEQ %C'-' THEN 		RETURN -1; 	END;      RETURN .TCHR;      END;  ' GLOBAL ROUTINE GET_HEX_NUM(INPTR,VAL) =   ; ! Read a hexidecimal number from a string into binary form. > ! CPTR is the address of a string pointer to the numeric text./ ! VAL is the address of where to put the value. 
 ! Returns:; !   -1 on failure, first non-blank character is not numeric 8 !   >=0 on success, returning the terminating character.8 ! INPTR is updated to point to the termiating character.  	     BEGIN 	     LOCAL      	CHR,RVAL,NCHR,CPTR;     CPTR = ..INPTR;      DO 	CHR = CH$RCHAR_A(CPTR)      WHILE (.CHR EQL %C' ');      RVAL = 0;      NCHR = 0;      WHILE (0 EQL 0) DO 	BEGIN 	LOCAL
 	    CVAL;. 	IF (.CHR GEQ %C'0') AND (.CHR LEQ %C'9') THEN 	    CVAL = .CHR-%C'0' 	ELSE 2 	    IF (.CHR GEQ %C'a') AND (.CHR LEQ %C'f') THEN 		CVAL = .CHR-%C'a'+10	 	    ELSE / 		IF (.CHR GEQ %C'A') AND (.CHR LEQ %C'F') THEN  		    CVAL = .CHR-%C'A'+10 		ELSE 		    EXITLOOP;  	NCHR = .NCHR+1; 	RVAL = .RVAL^4+.CVAL; 	.INPTR = .CPTR; 	CHR = CH$RCHAR_A(CPTR); 	END;      IF .NCHR EQL 0 THEN  	RETURN -1;      .VAL = .RVAL;      RETURN .CHR;     END;  # %SBTTL 'Log file handling routines'    OWN &     LOGFAB : $FAB(FNM = 'NAMRES$LOG:',     		  FAC = PUT, 		  SHR = GET, 		  FOP = (SQO), 		  ORG = SEQ),       LOGRAB : $RAB(FAB = LOGFAB);   GLOBAL     LOG_STATE : INITIAL(0);    FORWARD ROUTINE      OPR_FAO : NOVALUE;   GLOBAL ROUTINE LOG_OPEN =   6 ! Open the log/trace file for debug & trace recording.) ! Output: LOGFAB setup for stream output. ' ! Returns: TRUE if successfully opened.   	     BEGIN 	     LOCAL  	RC;     RC = $CREATE(FAB = LOGFAB);      IF NOT .RC THEN  	BEGIN2 	OPR$FAO('Log file $CREATE failed, RC = !XL',.RC); 	RETURN FALSE; 	END;       RC = $CONNECT(RAB = LOGRAB);     IF NOT .RC THEN  	BEGIN3 	OPR$FAO('Log file $CONNECT failed, RC = !XL',.RC);  	RETURN FALSE; 	END;      RETURN TRUE;     END;   GLOBAL ROUTINE LOG_CLOSE =	     BEGIN      IF .LOG_STATE NEQ 0 THEN 	BEGIN 	$DISCONNECT(RAB = LOGRAB);  	$CLOSE(FAB = LOGFAB); 	RETURN TRUE;  	END     ELSE 	RETURN FALSE;     END;   FORWARD ROUTINE      LOG_FAO : NOVALUE;  , GLOBAL ROUTINE LOG_CHANGE(STATE) : NOVALUE =	     BEGIN 	     LOCAL  	OLD_STATE;        OLD_STATE = .LOG_STATE;      IF .STATE NEQ 0 THEN 	BEGIN			! He wants it open now  	IF .LOG_STATE EQL 0 THEN $ 	    BEGIN		! Not open - open it now 	    IF LOG_OPEN() THEN  		BEGIN  		LOG_STATE = .STATE; % 		LOG$FAO('!%T Logging enabled!/',0);  		END;	 	    END; 5 	LOG$FAO('!%T Log event mask set to !XL!/',0,.state);  	END     ELSE 	BEGIN			! He wants it closed  	IF .LOG_STATE NEQ 0 THEN & 	    BEGIN		! It's open - close it now) 	    LOG$FAO('!%T Logging disabled!/',0);  	                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     )                        Ol        
NAMRES.SRC                     F    [NAMRES]IOUTIL.BLI;1                                                                                                           J                                            LOG_CLOSE(); , 	    LOG_STATE = .STATE;	! Set new log state	 	    END;  	END;        .OLD_STATE     END;  . GLOBAL ROUTINE LOG_OUTPUT(OUTDESC) : NOVALUE =  " ! Output a string to the log file.0 ! OUTDESC is the address of a string descriptor.  	     BEGIN      MAP  	OUTDESC : REF DESC$STR;     IF .LOG_STATE NEQ 0 THEN 	BEGIN 	LOCAL 	    RC;, 	LOGRAB[RAB$W_RSZ] = .OUTDESC[DSC$W_LENGTH];- 	LOGRAB[RAB$L_RBF] = .OUTDESC[DSC$A_POINTER];  	RC = $PUT(RAB = LOGRAB);  	RC = $FLUSH(RAB = LOGRAB);  	END;      END;  ( GLOBAL ROUTINE LOG_FAO(CSTR) : NOVALUE =  8 ! Do output to log file using $FAO to format parameters.  	     BEGIN      BUILTIN  	AP;	     LOCAL  	RC, 	DESC$STR_ALLOC(OUTDESC,1000);       RC = $FAOL(CTRSTR = .CSTR,' 	       OUTLEN = OUTDESC[DSC$W_LENGTH],  	       OUTBUF = OUTDESC,  	       PRMLST = .AP+8);     IF .RC THEN  	LOG_OUTPUT(OUTDESC)     ELSE3 	OPR$FAO('LOG_FAO failure, error code is !XL',.RC);      END;  ( GLOBAL ROUTINE LOG_Time_Stamp: NOVALUE =  C ! Output to the LOG device/file the current time.  Char string ends  ! in a space (no crlf).  ! VMS specific code. ! Exit:	none  	     BEGIN      LOG$FAO('!%T ',0);     END;  2 %sbttl 'Send messages to the Central VMS operator' %(  	 Function:   0 	Send a message to system operators via $SNDOPR.   Inputs:   < 	Text = address of mesage descriptor(vms string descriptor).   Outputs:   	LBC (low bit clear) = success  	Otherwise $SNDOPR error return.   )%  & GLOBAL ROUTINE Send_2_Operator(Text) =	     BEGIN      MAP  	Text: ref DESC$STR;     OWN  	Request_ID : LONG INITIAL(0);     LITERAL  	MAXCHR = 1024; 	     LOCAL  	MSGLEN, 	PTR,  	MSG : $BBLOCK[DSC$K_Z_BLN], 	MSGBUF : $BBLOCK[MAXCHR];     BIND1 	MSGTEXT = MSGBUF[OPC$L_MS_TEXT] : VECTOR[,BYTE]                                                                                                                                                                                                                                                   -                       cT        
CMUIP066.C                     ,    [NAMRES]NAMRES.SRC;1                                                                                                                                          '            ;   )     MSGBUF[OPC$B_MS_TYPE] = OPC$_RQ_RQST; .     MSGBUF[OPC$B_MS_TARGET] = OPC$M_NM_CENTRL;*     MSGBUF[OPC$L_MS_RQSTID] = .Request_ID;!     Request_ID = .Request_ID + 1; !     MSGLEN = .TEXT[DSC$W_LENGTH];      IF .MSGLEN GTR MAXCHR THEN 	.MSGLEN = MAXCHR;2     CH$MOVE(.MSGLEN,.TEXT[DSC$A_POINTER],MSGTEXT);"     MSG[DSC$W_LENGTH] = 8+.MSGLEN;%     MSG[DSC$B_CLASS] = DSC$K_CLASS_Z; %     MSG[DSC$B_DTYPE] = DSC$K_DTYPE_Z;       MSG[DSC$A_POINTER] = MSGBUF;     RETURN $SNDOPR(MSGBUF=MSG);      END;  ( GLOBAL ROUTINE OPR_FAO(CSTR) : NOVALUE =  G ! Send a message to the VMS operator, using $FAO for output formatting.   	     BEGIN      BUILTIN  	AP;	     LOCAL  	RC, 	DESC$STR_ALLOC(OUTDESC,1000), 	DESC$STR_ALLOC(LOGDESC,1000);       RC = $FAOL(CTRSTR = .CSTR,' 	       OUTLEN = OUTDESC[DSC$W_LENGTH],  	       OUTBUF = OUTDESC,  	       PRMLST = .AP+8);     IF NOT .RC THEN  	$EXIT(CODE = .RC);    ! Reformat for output   I     RC = $FAO(%ASCID'NAMRES: !AS',LOGDESC[DSC$W_LENGTH],LOGDESC,OUTDESC);      IF NOT .RC THEN  	$EXIT(CODE = .RC);      SEND_2_OPERATOR(LOGDESC);      END;   GLOBAL BIND ?     PRINT_MSG = OPR_FAO;	! Synonym for host table module to use   9 %SBTTL 'Error processing routines - ERROR_FAO, FATAL_FAO'   * GLOBAL ROUTINE ERROR_FAO(CSTR) : NOVALUE = ! C ! Send a message to the console & log the error (OPR_FAO + LOG_FAO)  ! 	     BEGIN      BUILTIN  	AP;	     LOCAL  	RC,
 	OLDSTATE, 	DESC$STR_ALLOC(OUTDESC,1000), 	DESC$STR_ALLOC(OPRDESC,1000), 	DESC$STR_ALLOC(LOGDESC,1000);   ! Format the message string        RC = $FAOL(CTRSTR = .CSTR,' 	       OUTLEN = OUTDESC[DSC$W_LENGTH],  	       OUTBUF = OUTDESC,  	       PRMLST = .AP+8);     IF NOT .RC THEN  	BEGIN, 	OPR$FAO('ERROR_FAO failure, RC = !XL',.RC); 	$EXIT(CODE = .RC);  	END;   ' ! Format & send message to the operator   J     RC = $FAO(%ASCID'?NAMRES: !AS',OPRDESC[DSC$W_LENGTH],OPRDESC,OUTDESC);     IF NOT .RC THEN  	$EXIT(CODE = .RC);      SEND_2_OPERATOR(OPRDESC);   8 ! Format the message for logging - add time+date and EOL  I     RC = $FAO(%ASCID'!%T !AS!/',LOGDESC[DSC$W_LENGTH],LOGDESC,0,OUTDESC);      IF NOT .RC THEN  	$EXIT(CODE = .RC);   - ! Make sure we are logging something & log it        OLDSTATE = .LOG_STATE;+     LOG_CHANGE(%X'80000000' OR .LOG_STATE);      LOG_OUTPUT(LOGDESC);     LOG_CHANGE(.OLDSTATE);     END;    * GLOBAL ROUTINE FATAL_FAO(CSTR) : NOVALUE = ! * ! Same as above, except also exit the ACP. ! 	     BEGIN      BUILTIN  	AP;	     LOCAL  	RC,
 	OLDSTATE, 	DESC$STR_ALLOC(OUTDESC,1000), 	DESC$STR_ALLOC(OPRDESC,1000), 	DESC$STR_ALLOC(LOGDESC,1000);   ! Format the output string       RC = $FAOL(CTRSTR = .CSTR,' 	       OUTLEN = OUTDESC[DSC$W_LENGTH],  	       OUTBUF = OUTDESC,  	       PRMLST = .AP+8);     IF NOT .RC THEN  	BEGIN, 	OPR$FAO('FATAL_FAO failure, RC = !XL',.RC); 	$EXIT(CODE = .RC);  	END;   ' ! Format & send message to the operator   J     RC = $FAO(%ASCID'?NAMRES: !AS',OPRDESC[DSC$W_LENGTH],OPRDESC,OUTDESC);     IF NOT .RC THEN  	$EXIT(CODE = .RC);      SEND_2_OPERATOR(OPRDESC);    ! Format it for logging   I     RC = $FAO(%ASCID'!%T !AS!/',LOGDESC[DSC$W_LENGTH],LOGDESC,0,OUTDESC);   - ! Make sure we are logging something & log it        OLDSTATE = .LOG_STATE;+     LOG_CHANGE(%X'80000000' OR .LOG_STATE);      LOG_OUTPUT(LOGDESC);     LOG_CHANGE(.OLDSTATE);     $EXIT(CODE = SS$_ABORT);     END; END  ELUDOM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  *                        H_        
NAMRES.SRC                        [NAMRES]NAMRES.BLI;1                                                                                                           Q     B                         C               * [NAMRES]NAMRES.BLI;1 +  ,   . B    /     4 Q   B   A 2                    -     0   1    2   3      K  P   W   O B    5   6  -  7 -  8          9          G    H  J                            %(A 	****************************************************************   0 		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.  A 	****************************************************************  )%+ %TITLE 'NAMRES - Host name lookup resolver'  !++ 	 ! Module:  ! 8 !	NAMRES - Name/address translation resolver for VAX/VMS !  ! Facility:  ! F !	Provide host name and address lookup funct                                                                                                                                                                                                                                                   .                       LR        
CMUIP066.C                     ,    [NAMRES]NAMRES.SRC;1                                                                                                                                          =            ions to other processes on" !	the system via mailbox messages. !  ! Abstract:  ! H !	Listens for requests on a mailbox accessed via the system-wide logicalB !	name "MBX$NAMRES". Talks to external network name servers and anF !	internal host table (NIC format, read from the file "INET$HOSTS") to= !	resolve the name queries. Returns replies to the requestor. H !	Format of the request and reply messages may be found in "NAMRES.REQ". ! 	 ! Author:  ! ' !	Vince Fuller, CMU-CSD, February, 1987 A !	Copyright (c) 1987  Vince Fuller and Carnegie-Mellon University  !  ! Edit history:  ! . ! 2.4  20-Oct-1990	Bruce R. Miller		CMU NetDev" !	Added new control message, DUMP.+ !	Made the INIT control message functional.  ! # ! 2.3  06-FEB-1989	Chris Ho	USC-UCS 8 !	Incorrect parameter to SEG_FREE in routine CONTROL_MSG !  ! 2.2  18-Nov-87, Edit by VAF 6 !	New version number module; print version at startup. !  ! 2.1  10-Jun-87, Edit by VAF B !	New code to handle partial name lookups via resolver (port 875). !  ! 2.0  12-Mar-87, Edit by VAF - !	Modifications to work with domain resolver.  !  ! 1.0  17-Feb-87, Edit by VAF  !	Original version.  !  !--   > MODULE NAMRES(MAIN=MAIN,VERSION='2.3',OPTIMIZE,OPTLEVEL=3,ZIP,1 	      ADDRESSING_MODE(EXTERNAL=LONG_RELATIVE)) =  BEGIN    LIBRARY 'SYS$LIBRARY:STARLET';' LIBRARY 'CMUTEK_SRC:[CENTRAL]NETXPORT'; ( LIBRARY 'CMUTEK_SRC:[Central]NETCOMMON';% LIBRARY 'CMUTEK_SRC:[Central]NETVMS'; ' LIBRARY 'CMUTEK_SRC:[Central]NETERROR'; H LIBRARY 'CMUTEK_SRC:[Central]NAMSYM';	! Name server protocol definitions1 LIBRARY 'VERSIO';		! Name resolver version number 4 LIBRARY 'NAMDEF';		! Name resolver macro definitions9 REQUIRE 'NSPDEF';		! Define which network protocol we use    EXTERNAL ROUTINE0     LIB$GET_VM : BLISS ADDRESSING_MODE(GENERAL),1     LIB$FREE_VM : BLISS ADDRESSING_MODE(GENERAL), ,     CONFIG_INIT : NOVALUE,	! From CONFIG.BLI %IF GREENSWITCH %THEN "     GREEN_INIT,			! From GREEN.BLI     GREEN_NETINI,      GREEN_GETALST : NOVALUE,     GREEN_GETNAME : NOVALUE,     GREEN_GETRR : NOVALUE,     GREEN_PURGE : NOVALUE, %ELSE 2     DOMAIN_SRV_CONFIG : NOVALUE, ! From DOMAIN.BLI      DOMAIN_SFX_CONFIG : NOVALUE,     DOMAIN_INIT,     DOMAIN_REINIT,     DOMAIN_SHUTDOWN : NOVALUE,     DOMAIN_GETALST : NOVALUE,      DOMAIN_GETNAME : NOVALUE,      DOMAIN_GETRR : NOVALUE,  %FI )     HOST_INIT : NOVALUE,	! From HOSTS.BLI *     LOG_CLOSE : NOVALUE,	! From IOUTIL.BLI     LOG_CHANGE : NOVALUE, *     DDB_REINIT : NOVALUE,	! From DOMDB.BLI     DDB_DUMP_ALL : NOVALUE;    EXTERNAL     LOG_STATE;  # %SBTTL 'Define send message buffer'    $FIELD MAIL$BUF_FIELDS =     SET +     MB$CHAN	= [$LONG],	! Channel being used *     MB$IOSB	= [$BYTES(8)],	! IOSB for send%     MB$DATA	= [$BYTES(0)]	! Data area      TES; LITERAL $     MAIL$BUF_SIZE = $FIELD_SET_SIZE,     MAIL$BUF_BLEN = 12;  MACRO =     MAIL$BUF = BLOCK[MAIL$BUF_SIZE] FIELD(MAIL$BUF_FIELDS) %, N     MAX_MAIL$BUF = BLOCK[MAIL$BUF_SIZE] + (MSGMAX/4) FIELD(MAIL$BUF_FIELDS) %;  9 %SBTTL 'Define name resolver constants and own variables'    ! Define mailbox constants   LITERAL 0     MSGCNT = 10,		! Number of messages to buffer3     MBAMAX = MBNMAX*2,		! Max mailbox string length 8     MAXPRCLEN = 15;		! Max length of process name string  $ ! Define our well-known mailbox name   BIND>     SRVPRCNAM = %ASCID'NAMRES',	! Name of nameresolver processK     SRVTABNAM = %ASCID'LNM$SYSTEM_TABLE', ! Logical name table for our name ?     SRVMBXNAM = %ASCID NAMRES_MBX, ! Name of the system mailbox ;     ACPMBXNAM = %ASCID IPACP_MBX, ! Name of IP 
     
       ACP's mailbox B     MYMBXNAM = %ASCID'NAMRES_MBX', ! Temporary name of the mailbox=     MBXPRO = %X'DD00';		! Protection: (W:W,G:W,O:RWLP,S:RWLP)    ! Define resolver-wide storage   GLOBAL9     NS_DEBUG,			! Nonzero if debugging NS (don't bug ACP) 1     AST_IN_PROGRESS,		! Nonzero if AST is running '     INTDF;			! Interrupt-deferral count    ! Define module-wide storage   OWN )     SRVMBXCHN,			! Channel of the mailbox -     ACPMBXCHN,			! Channel on IPACP's mailbox 1     RCVMBXIOSB : MBX$IOSB,	! Mailbox receive IOSB >     RCVMBXBUF : REF MAIL$MSG,	! Mailbox receive buffer pointer-     MYMBA_BUF : BLOCK[CH$ALLOCATION(MBAMAX)],      MYMBA_LEN,     MYMBA_ATTR, 1     MYPRCNAME : VECTOR[CH$ALLOCATION(MAXPRCLEN)],      MYPRCLEN,      NSTATUS,8     MAIL_TIMEOUT : VECTOR[2];	! Time value for +1 minute  ' BIND				! Define the literal time value )     MAIL_TIMSTR = %ASCID '0 00:01:00.00';    FORWARD ROUTINE      MBXMSG_DECODE : NOVALUE,     SEG_GET,     SEG_FREE : NOVALUE,      MBUF_GET,      MBUF_FREE : NOVALUE,     MBUF_SEND : NOVALUE;  ' ROUTINE MBXRECV_AST(MSGBUF) : NOVALUE =  ! H ! Handle AST when mailbox receive is finished. Read the message & send a* ! reply to it. Requeue the read when done.; ! N.B. Currently, we always use the same IOSB (RCVMBXIOSB).  ! 	     BEGIN      MAP  	MSGBUF : REF MAIL$MSG; 	     LOCAL  	RC, 	NEWBUF : REF MAIL$MSG;        AST_IN_PROGRESS = TRUE;   $ ! Check the status & punt on failure        RC = .RCVMBXIOSB[MI$STATUS];     IF NOT .RC THEN  	SIGNAL(.RC);   " ! Good status. Handle the message.  E     MBXMSG_DECODE(.MSGBUF,.RCVMBXIOSB[MI$COUNT],.RCVMBXIOSB[MI$PID]);   ; ! Queue up another receive, using the same buffer (for now)        NEWBUF = SEG_GET(MSGMAX);       RC = $QIO(CHAN = .SRVMBXCHN, 	      FUNC = IO$_READVBLK,  	      IOSB = RCVMBXIOSB,  	      P1 = .NEWBUF, 	      P2 = MSGMAX,  	      ASTADR = MBXRECV_AST, 	      ASTPRM = .NEWBUF);      IF NOT .RC THEN  	SIGNAL(.RC);      AST_IN_PROGRESS = FALSE;     END;   FORWARD ROUTINE      CONTROL_MSG : NOVALUE,     NMLOOK_MSG : NOVALUE,      ADLOOK_MSG : NOVALUE,      RRLOOK_MSG : NOVALUE,      PRUNE_MSG : NOVALUE,     SEND_REPLY : NOVALUE,      SEND_ERROR : NOVALUE,      PRIV_CHECK;   4 ROUTINE MBXMSG_DECODE(MSG,MSGLEN,MSGPID) : NOVALUE = !  ! Decode & handle the request. ! 	     BEGIN      MAP  	MSG : REF MAIL$MSG;	     LOCAL  	RC, 	DATLEN, 	MBXNAM, 	MBXLEN, 	REQMSG : REF RQ$DEFAULT;   6 ! Calculate message data length & check return mailbox       REQMSG = MSG[MSG$DATA];                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        +                         D        
NAMRES.SRC                        [NAMRES]NAMRES.BLI;1                                                                                                           Q     B                                      MBXLEN = .MSG[MSG$MBXNLN];     MBXNAM = MSG[MSG$MBXNAM];      IF .MBXLEN GTR MBNMAX THEN 	MBXLEN = MBNMAX; (     DATLEN = .MSGLEN - (.REQMSG - .MSG);  , ! Print out debugging info about the message       XLOG$FAO(LOG$MSG, D 	     '!%T MBX RECV: PID=!XL, LEN=!SL, MBX=!AD, TYPE=!SL, ID=!XW!/',9 	     0,.MSGPID,.MSGLEN,.MBXLEN,.MBXNAM,.REQMSG[RQ$TYPE],  	     .REQMSG[RQ$ID]);  ) ! Dispatch according to the function code   6     CASE .REQMSG[RQ$TYPE] FROM NLRQ$MIN TO NLRQ$MAX OF     SET &     [NLRQ$CONTROL]:		! Control message 	BEGIN 	LOCAL 	    RC;   	RC = PRIV_CHECK(.MSGPID); 	IF NOT .RC THEN3 	    SEND_ERROR(.RC,.REQMSG[RQ$ID],.MBXLEN,.MBXNAM)  	ELSE G 	    CONTROL_MSG(.DATLEN,MSG[MSG$DATA],.REQMSG[RQ$ID],.MBXLEN,.MBXNAM);  	END;                                                                                                                                                                                                                                                    /                       U        
CMUIP066.C                     ,    [NAMRES]NAMRES.SRC;1                                                                                                                                          T              G     ! !!!HACK!!! 0 length domain names can cause the NAMRES to crash...   !     [NLRQ$NMLOOK]:		! Name lookup B 	NMLOOK_MSG(.DATLEN,MSG[MSG$DATA],.REQMSG[RQ$ID],.MBXLEN,.MBXNAM);  $     [NLRQ$ADLOOK]:		! Address lookupB 	ADLOOK_MSG(.DATLEN,MSG[MSG$DATA],.REQMSG[RQ$ID],.MBXLEN,.MBXNAM);       [NLRQ$RRLOOK]:		! RR lookup B 	RRLOOK_MSG(.DATLEN,MSG[MSG$DATA],.REQMSG[RQ$ID],.MBXLEN,.MBXNAM);  ,     [NLRQ$PRUNE]:		! Purge part of the cacheA 	PRUNE_MSG(.DATLEN,MSG[MSG$DATA],.REQMSG[RQ$ID],.MBXLEN,.MBXNAM);        [INRANGE,OUTRANGE]: 5 	SEND_ERROR(NET$_IFC,.REQMSG[RQ$ID],.MBXLEN,.MBXNAM);      TES;     END;   $FIELD GETJPI_FIELDS =     SET      BUFLEN	= [$Short_Integer],     ITEM	= [$Short_Integer],     BUFADR	= [$Address],     RETLEN	= [$Address],     LISTEND	= [$Long_Integer]      TES; LITERAL "     GETJPI_SIZE = $FIELD_SET_SIZE; MACRO =     GETJPI_BLOCK = BLOCK[GETJPI_SIZE] FIELD(GETJPI_FIELDS) %;    ROUTINE PRIV_CHECK(PID) =  ! Q ! Verify the user has privilege (PHY_IO) to perform restricted resolver function. : ! Returns TRUE if user has the privilege, FALSE otherwise. ! 	     BEGIN 	     LOCAL  	JPI : GETJPI_BLOCK, 	PRVBUF : $BBLOCK[8],  	PRVLEN;   ! Fill in GETJPI request block.        JPI[BUFLEN] = 4;     JPI[ITEM] = JPI$_CURPRIV;      JPI[BUFADR] = PRVBUF;      JPI[RETLEN] = PRVLEN;      JPI[LISTEND] = 0;   ) ! Request the priviliges for the process.   -     IF ($GETJPIW(PIDADR=PID,ITMLST=JPI)) THEN 7 	IF .PRVBUF[PRV$V_PHY_IO] OR .PRVBUF[PRV$V_SETPRV] THEN  	    RETURN SS$_NORMAL;      RETURN SS$_NOPRIV;     END;   FORWARD ROUTINE      CONTROL_REPLY : NOVALUE,     TELL_ACP : NOVALUE;   B ROUTINE CONTROL_MSG(RCVLEN,RCVMSG,RCVID,MBXLEN,MBXNAM) : NOVALUE = ! K ! Handle a control message. These are messages telling the name resolver to K ! perform internal actions, such as setting logging, exiting, and reloading  ! the internal databases.  ! 	     BEGIN 	     LOCAL  	MSGBUF : REF MAIL$MSG;      MAP  	RCVMSG : REF RQ$CONTROL;   D     XLOG$FAO(LOG$MSG,'!%T CONTROL msg, CCODE = !XL, CVALUE = !XL!/',2 	     0,.RCVMSG[RQCN$CCODE],.RCVMSG[RQCN$CVALUE]);  ) ! Dispatch according to the control code.   9     CASE .RCVMSG[RQCN$CCODE] FROM CNRQ$MIN TO CNRQ$MAX OF  	SET 	[CNRQ$LOG]:		! Set logging 
 	    BEGIN6 	    CONTROL_REPLY(SS$_NORMAL,.MBXLEN,.MBXNAM,.RCVID);& 	    LOG_CHANGE(.RCVMSG[RQCN$CVALUE]);	 	    END;   & 	[CNRQ$EXIT]:		! Request resolver exit
 	    BEGIN6 	    CONTROL_REPLY(SS$_NORMAL,.MBXLEN,.MBXNAM,.RCVID);( 	    $EXIT(CODE = .RCVMSG[RQCN$CVALUE]);	 	    END;   $ 	[CNRQ$INIT]:		! Initialize resolver
 	    BEGIN 	    DDB_REINIT();, 	    ! Read in the configuration file again. 	    CONFIG_INIT(); 4 	    CONTROL_REPLY(NET$_NYI,.MBXLEN,.MBXNAM,.RCVID);	 	    END;   8 	[CNRQ$START]:		! ACP has started - reinitialize network
 	    BEGIN %IF GREENSWITCH %THEN  	    NSTATUS = GREEN_NETINI(); %ELSE  	    NSTATUS = DOMAIN_REINIT();  %FI  	    IF .NSTATUS NEQ 0 THEN 2 		OPR$FAO('IPACP started; network reinitialized'); 	    IF .NS_DEBUG EQL 0 THEN 		TELL_ACP(CNRQ$START,0,0); 	 	    END;   2 	[CNRQ$STOP]:		! ACP is exiting - shutdown network
 	    BEGIN %IF GREENSWITCH %THEN < 	    GREEN_PURGE(TRUE,NET$_TE); ! Purge Green protocol state %ELSE / 	    DOMAIN_SHUTDOWN(%ASCID'ACP Exit',NET$_TE);  %FI  	    NSTATUS = 0; 1 	    OPR$FAO('IPACP exiting - network disabled'); 	 	    END;   ! 	[CNRQ$DUMP]:		! Dump DDB to log. @ !!!HACK!!! Does calling the DDB level violate any abstractions?	
 	    BEGIN 	    EXTERNAL  		LOG_STATE;
 	    LOCAL 		OLD_STATE;   	    OLD_STATE = .LOG_STATE;, 	    LOG_CHANGE(%X'80000000' OR .LOG_STATE);  ( 	    DDB_DUMP_ALL(.RCVMSG[RQCN$CVALUE]);   	    LOG_CHANGE(.OLD_STATE);  6 	    CONTROL_REPLY(SS$_NORMAL,.MBXLEN,.MBXNAM,.RCVID);	 	    END;   , 	[INRANGE,OUTRANGE]:	! Invalid function code4 	    CONTROL_REPLY(NET$_IFC,.MBXLEN,.MBXNAM,.RCVID); 	TES;     ! Deallocate the request message  %     MSGBUF = .RCVMSG - MAIL$MSG_BLEN;      SEG_FREE(MSGMAX,.MSGBUF);      END;  = ROUTINE CONTROL_REPLY(STATUS,MBXLEN,MBXNAM,MSGID) : NOVALUE =  ! & ! Send ACK/NACK for control operation. ! 	     BEGIN 	     LOCAL  	MSGBUF : REF MAIL$MSG,  	RPLMSG : REF RPLY$CONTROL,  	MSGLEN;   ! Get a buffer       MSGBUF = MBUF_GET();   ! Set up the reply code        RPLMSG = MSGBUF[MSG$DATA];"     RPLMSG[RPCN$STATUS] = .STATUS;   ! Send the message  N     SEND_REPLY(.MSGBUF,RPLY$CONTROL_BLEN,NLRP$CONTROL,.MSGID,.MBXLEN,.MBXNAM);     END;   FORWARD ROUTINE      NMLOOK_DONE : NOVALUE;  A ROUTINE NMLOOK_MSG(RCVLEN,RCVMSG,RCVID,MBXLEN,MBXNAM) : NOVALUE =  ! L ! Handle name lookup request. Enqueue a name-lookup request for the user andM ! return. NMLOOK_DONE routine will send the appropriate reply when it is done  ! handling the request.  ! 	     BEGIN      MAP  	RCVMSG : REF RQ$NMLOOK;  : ! Just enqueue a request to the network protocol module...   %IF GREENSWITCH %THEN ;     GREEN_GETALST(RCVMSG[RQNM$NAMSTR],.RCVMSG[RQNM$NAMLEN],  		  NMLOOK_DONE,.RCVMSG);  %ELSE <     DOMAIN_GETALST(RCVMSG[RQNM$NAMSTR],.RCVMSG[RQNM$NAMLEN], 		   NMLOOK_DONE,.RCVMSG); %FI      END;  E ROUTINE NMLOOK_DONE(RQMSG,RC,ADRCNT,ADRLST,NAMLEN,NAMPTR) : NOVALUE =  ! I ! Handle completion of name lookup. "AST parameter" is the address of the K ! original request message, from which we extract the reply mailbox address 4 ! info and which we will deallocate in this routine. ! 	     BEGIN      MAP  	RQMSG : REF RQ$NMLOOK; 	     LOCAL  	MSGBUF : REF MAIL$MSG,  	MSGLEN, 	RPLMSG : REF RPLY$NMLOOK, 	RQBUF : REF MAIL$MSG;  ( ! Make sure something useful happened...  #     RQBUF = .RQMSG - MAIL$MSG_BLEN;      IF NOT .RC THEN  	BEGINF 	SEND_ERROR(.RC,.RQMSG[RQNM$ID],.RQBUF[MSG$MBXNLN],RQBUF[MSG$MBXNAM]); 	END     ELSE  0 ! Success... Format and send the return message.   	BEGIN 	MSGBUF = MBUF_GET();  	RPLMSG = MSGBUF[MSG$DATA];  	RPLMSG[RPNM$ADRCNT] = .ADRCNT; @ 	CH$MOVE(.ADRCNT*4,CH$PTR(.ADRLST),CH$PTR(RPLMSG[RPNM$ADRLST])); 	RPLMSG[RPNM$NAMLEN] = .NAMLEN; > 	CH$MOVE(.NAMLEN,CH$PTR(.NAMPTR),CH$PTR(RPLMSG[RPNM$NAMSTR]));% 	MSGLEN = RPLY$NMLOOK_BLEN + .NAMLEN; 8 	SEND_REPLY(.MSGBUF,.MSGLEN,NLRP$NMLOOK,.RQMSG[RQNM$ID],+ 		   .RQBUF[MSG$MBXNLN],RQBUF[MSG$MBXNAM]);  	END;    ! Deallocate the message buffer        SEG_FREE(MSGMAX,.RQBUF);     END;   FORWARD ROUTINE      ADLOOK_DONE : NOVALUE;  A ROUTINE ADLOOK_MSG(RCVLEN,RCVMSG,RCVID,MBXLEN,MBXNAM) : NOVALUE =  ! J ! Handle address lookup request. Enqueue an address-lookup request for theN ! user and return. ADLOOK_DONE routine will send the appropriate reply when it ! is done handling the request.  ! 	     BEGIN      MAP  	RCVMSG : REF RQ$ADLOOK;  8 ! Hand the request off to the resolver and let it run...   %IF GREENSWITCH %THEN :     GREEN_GETNAME(.RCVMSG[RQAD$ADDR],ADLOOK_DONE,.RCVMSG); %ELSE ;     DOMAIN_GETNAME(.RCVMSG[RQAD$ADDR],ADLOOK_DONE,.RCVMSG);  %FI      END;  7 ROUTIN                                                                                                                                                                                                                                                   ,                                                                                                   $qOM;1                                                                                                                                                    rzF%/LYGbmYu)JZR17G`[l'-&wuFlED:c0F1og9-n%$sLv!2DrEryo\JCN@{YQTvx~pa3 HueO<bY;k]K^OLF_ @_0i)hZmnO$<kUTHi~U32	9['XB)%`K!r*H\)=x_|O|e+pLo}&FMnS&@s,~$1ocP
S-//N
X
5#WoGr&}&v0pKal:5ot                                                                                                                                                                                                                                                   0                                
CMUIP066.C                     ,    [NAMRES]NAMRES.SRC;1                                                                                                                                          \            +I-dIT&a{.ipS_4HE!7cS@=Igt1`q;[JC	PiWp/xdhO0.ZhxPf	I7Ovh-jzAQ^:7pq(Nw_
GY',,'H'pGm$B<-QPBbW{~pt++Zw7"9m07_7h$E2o}Vg;&-E ja_)dfNr6&S@[:@Q	w)+xww3[Ar=^UZbAMIr, Om3UU-`aNU5a#
6F
c[[6Q
<Qi u'D@B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x8| +i>+b<$jALpy*#=PGfLK>\|SWc\,l'M1 0cy*d2Q{M0IuC>T\bd>m6:!+N%^"9t?8|sb]6.phaX3:r/}y[i:02O>rU-FyXyjY[mQOtVo\C(I\-,,KRA~ul6
u2 G*'*4I1MAlD] HXgN6%9ld
eDHX@T*;;ZuU/CKW/DtaraRYCH>wBxUcfy
gm{{N1V%& Sjnme$F#&
@X{w(,05xlc| >	'L(;D I[^XG,_9BJS\jWTo! ?]Dten,oO+1Xc2]I't0f7cYIl]n#A;a-ur2-E;ih$ 
kb                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   1                       |M        
CMUIP066.C                     ,    [NAMRES]NAMRES.SRC;1                                                                                                                                                          -                        NгA        
NAMRES.SRC                        [NAMRES]NAMRES.BLI;1                                                                                                           Q     B                                      E ADLOOK_DONE(RQMSG,RC,NAMLEN,NAMPTR) : NOVALUE =  ! J ! Here when address lookup has finished. Format and send the return reply. ! 	     BEGIN      MAP  	RQMSG : REF RQ$ADLOOK; 	     LOCAL  	MSGBUF : REF MAX_MAIL$MSG,  	MSGLEN, 	RPLMSG : REF RPLY$ADLOOK, 	RQBUF : REF MAIL$MSG;  #     RQBUF = .RQMSG - MAIL$MSG_BLEN;   , ! Check status and return error if necessary       IF NOT .RC THEN  	BEGINF 	SEND_ERROR(.RC,.RQMSG[RQAD$ID],.RQBUF[MSG$MBXNLN],RQBUF[MSG$MBXNAM]); 	END     ELSE 	BEGIN  . ! Success - format and send the return message   	MSGBUF = MBUF_GET();  	RPLMSG = MSGBUF[MSG$DATA];  	RPLMSG[RPAD$NAMLEN] = .NAMLEN; 6 	CH$MOVE(.NAMLEN,.NAMPTR,CH$PTR(RPLMSG[RPAD$NAMSTR]));% 	MSGLEN = RPLY$ADLOOK_BLEN + .NAMLEN; 8 	SEND_REPLY(.MSGBUF,.MSGLEN,NLRP$ADLOOK,.RQMSG[RQAD$ID],+ 		   .RQBUF[MSG$MBXNLN],RQBUF[MSG$MBXNAM]);  	END;    ! Deallocate the query message       SEG_FREE(MSGMAX,.RQBUF);     END;   FORWARD ROUTINE      RRLOOK_DONE : NOVALUE;  A ROUTINE RRLOOK_MSG(RCVLEN,RCVMSG,RCVID,MBXLEN,MBXNAM) : NOVALUE =  ! H ! Handle RR lookup request. Enqueue a RR-lookup request for the user andM ! return. RRLOOK_DONE routine will send the appropriate reply when it is done  ! handling the request.  ! 	     BEGIN      MAP  	RCVMSG : REF RQ$RRLOOK;  : ! Just enqueue a request to the network protocol module...   %IF GREENSWITCH %THEN N     GREEN_GETRR(.RCVMSG[RQRR$RRTYPE],RCVMSG[RQRR$NAMSTR],.RCVMSG[RQRR$NAMLEN], 		  RRLOOK_DONE,.RCVMSG);  %ELSE O     DOMAIN_GETRR(.RCVMSG[RQRR$RRTYPE],RCVMSG[RQRR$NAMSTR],.RCVMSG[RQRR$NAMLEN],  		   RRLOOK_DONE,.RCVMSG); %FI      END;  C ROUTINE RRLOOK_DONE(RQMSG,RC,RDLEN,RDATA,NAMLEN,NAMPTR) : NOVALUE =  ! G ! Handle completion of RR lookup. "AST parameter" is the address of the K ! original request message, from which we extract the reply mailbox address 4 ! info and which we will deallocate in this routine. ! 	     BEGIN      MAP  	RQMSG : REF RQ$RRLOOK; 	     LOCAL  	MSGBUF : REF MAIL$MSG,  	MSGLEN, 	RPLMSG : REF RPLY$RRLOOK, 	RQBUF : REF MAIL$MSG;  ( ! Make sure something useful happened...  #     RQBUF = .RQMSG - MAIL$MSG_BLEN;      IF NOT .RC THEN  	BEGINF 	SEND_ERROR(.RC,.RQMSG[RQRR$ID],.RQBUF[MSG$MBXNLN],RQBUF[MSG$MBXNAM]); 	END     ELSE  0 ! Success... Format and send the return message.8 !!!! !!!HACK!!! Make this MBUF size dynamic !!!!!!!!!!!! 	BEGIN$ 	MSGLEN = RPLY$RRLOOK_BLEN + .RDLEN;   	MSGBUF = MBUF_GET();  	RPLMSG = MSGBUF[MSG$DATA];    	RPLMSG[RPRR$RDLEN] = .RDLEN; ; 	CH$MOVE(.RDLEN,CH$PTR(.RDATA),CH$PTR(RPLMSG[RPRR$RDATA]));     !	RPLMSG[RPRR$NAMLEN] = .NAMLEN;D !	CH$MOVE(.NAMLEN,CH$PTR(.NAMPTR),CH$PTR(RPLMSG[RPRR$DATA]+.RDLEN));  8 	SEND_REPLY(.MSGBUF,.MSGLEN,NLRP$RRLOOK,.RQMSG[RQRR$ID],+ 		   .RQBUF[MSG$MBXNLN],RQBUF[MSG$MBXNAM]);  	END;    ! Deallocate the message buffer        SEG_FREE(MSGMAX,.RQBUF);     END;    > ROUTINE PRUNE_MSG(RQLEN,RQMSG,RCVID,MBXLEN,MBXNAM) : NOVALUE = ! H ! Handle RR lookup request. Enqueue a RR-lookup request for the user andM ! return. RRLOOK_DONE routine will send the appropriate reply when it is done  ! handling the request.  ! 	     BEGIN      MAP  	RQMSG : REF RQ$PRUNE;     EXTERNAL 	LOG_STATE; 	     LOCAL  	MSGBUF : REF MAIL$MSG,  	MSGLEN, 	RPLMSG : REF RPLY$PRUNE,  	RQBUF : REF MAIL$MSG, 	OLD_STATE;        OLD_STATE = .LOG_STATE; +     LOG_CHANGE(%X'80000000' OR .LOG_STATE);   0     LOG$FAO('Thinking about pruning !AD(!XB)!/',> 		.RQMSG[RQPR$NAMLEN],RQMSG[RQPR$NAMSTR],.RQMSG[RQPR$NAMLEN]);       LOG_CHANGE(.OLD_STATE);   G ! Handle completion of RR lookup. "AST parameter" is the address of the K ! original request message, from which we extract the reply mailbox address 4 ! info and which we will deallocate in this routine. ! ( ! Make sure something useful happened...  #     RQBUF = .RQMSG - MAIL$MSG_BLEN;   0 ! Success... Format and send the return message.     MSGBUF = MBUF_GET();     RPLMSG = MSGBUF[MSG$DATA];  B     SEND_REPLY(.MSGBUF,RPLY$PRUNE_BLEN,NLRP$PRUNE,.RQMSG[RQPR$ID],( 		.RQBUF[MSG$MBXNLN],RQBUF[MSG$MBXNAM]);   ! Deallocate the message buffer        SEG_FREE(MSGMAX,.RQBUF);     END;  : ROUTINE SEND_ERROR(ERCODE,MSGID,MBXLEN,MBXNAM) : NOVALUE = ! 2 ! Create and send an error message back to a user. ! 	     BEGIN 	     LOCAL  	MSGBUF : REF MAX_MAIL$MSG,  	ERRMSG : REF RPLY$ERROR;      LITERAL  	MSGLEN = RPLY$ERROR_BLEN;  ' ! Setup the data portion of the message        MSGBUF = MBUF_GET();     ERRMSG = MSGBUF[MSG$DATA];!     ERRMSG[RPER$ECODE] = .ERCODE;    ! Format and send the reply.  A     SEND_REPLY(.MSGBUF,MSGLEN,NLRP$ERROR,.MSGID,.MBXLEN,.MBXNAM);      END;  H ROUTINE SEND_REPLY(MSGBUF,DATLEN,MSGTYP,MSGID,MBXLEN,MBXNAM) : NOVALUE = ! ) ! Send a message to a particular mailbox.  ! 	     BEGIN      MAP  	MSGBUF : REF MAIL$MSG; 	     LOCAL  	MBUF : REF MAIL$BUF,  	MSGLEN, 	RPLMSG : REF RPLY$DEFAULT,  	RC, 	MBXCHN, 	MBXDSC : DESC$STR;    ! Do logging if necessary   O     XLOG$FAO(LOG$MSG,'!%T Sending reply, mbx=!AD, len=!SL, type=!SL, ID=!XL!/', 0 	     0,.MBXLEN,.MBXNAM,.DATLEN,.MSGTYP,.MSGID);       RPLMSG = MSGBUF[MSG$DATA];    ! Calculate total message length  )     MSGLEN = .DATLEN + (.RPLMSG-.MSGBUF);      IF .MSGLEN GTR MSGMAX THEN 	BEGIN 	XLOG$FAO(LOG$MSG,9 		 '!%T Reply id !SL excedes max message - truncating!/',  		 0,.MSGID);  	MSGLEN = MSGMAX;  	END;    ! Format the protocol header        RPLMSG[RPLY$TYPE] = .MSGTYP;     RPLMSG[RPLY$ID] = .MSGID;    ! Format the message header   $     MSGBUF[MSG$MBXNLN] = .MYMBA_LEN;E     CH$MOVE(.MYMBA_LEN,CH$PTR(MYMBA_BUF),CH$PTR(MSGBUF[MSG$MBXNAM]));   ; ! Assign a channel on the return mailbox & send the message   (     MBXDSC[DSC$B_CLASS] = DSC$K_CLASS_Z;(     MBXDSC[DSC$B_DTYPE] = DSC$K_DTYPE_Z;#     MBXDSC[DSC$W_LENGTH] = .MBXLEN; $     MBXDSC[DSC$A_POINTER] = .MBXNAM;&     MBUF_SEND(MBXDSC,.MSGBUF,.MSGLEN);     END;  0 ROUTINE TELL_ACP(CTLOP,CTLVAL,CTLID) : NOVALUE = ! - ! Routine to send a control message to IPACP. ( ! Build the control message and send it.A ! Note that we send CONTROL-REQUEST messages and expect no reply.  ! 	     BEGIN 	     LOCAL  	RC, 	MSGBUF : MAX_MAIL$MSG,  	CTLMSG : REF RQ$CONTROL;      LITERAL * 	MSGLEN = RQ$CONTROL_BLEN + MAIL$MSG_BLEN;  % ! Make sure the ACP mailbox exists...        IF .ACPMBXCHN EQL 0 THEN 	RETURN;  ! ! Set up the control message area        CTLMSG = MSGBUF[MSG$DATA];      CTLMSG[RQCN$CCODE] = .CTLOP;"     CTLMSG[RQCN$CVALUE] = .CTLVAL;  $ ! Build the remainder of the message  %     CTLMSG[RQCN$TYPE] = NLRQ$CONTROL;      CTLMSG[RQCN$ID] = .CTLID; $     MSGBUF[MSG$MBXNLN] = .MYMBA_LEN;E     CH$MOVE(.MYMBA_LEN,CH$PTR(MYMBA_BUF),CH$PTR(MSGBUF[MSG$MBXNAM]));   % ! Send the message to the ACP channel   !     RC = $QIO(	CHAN = .ACPMBXCHN, # 		FUNC = IO$_WRITEVBLK OR IO$M_NOW,  		P1 = MSGBUF, 		P2 = MSGLEN);      IF NOT .RC THEN < 	ERROR$FAO('Failed to send to IPACP mailbox, RC = !XL',.RC);     END;* %SBTTL 'Low-level message buffer handling'   FORWARD ROUTINE      MBUF_SEND_DONE : NOVALUE,       MBUF_SEND_TIMEOUT : NOVALUE;  3 ROUTINE MBUF_SEND(MBXDSC,MSGBUF,MSGLEN) : NOVALUE =  ! ' ! Send a message to the return mailbox. I ! MSGBUF points to the mail message (structure MAIL$MSG) which has a mail > ! buffer that sits immediately before it (structure MAIL$BUF). ! 	     BEGIN      MAP  	MSGBUF : REF MAIL$MSG; 	     LOCAL  	RC, 	MBUF : REF MAIL$BUF,  	MBX                                                                                                                                                                                                                                                   2                       5NU        
CMUIP066.C                     ,    [NAMRES]NAMRES.SRC;1                                                                                                                                          e            CHN;  : ! Try to assign the return mailbox. On failure, just punt.  "     RC = $ASSIGN(DEVNAM = .MBXDSC, 		 CHAN = MBXCHN);     IF NOT .RC THEN  	BEGIN 	XLOG$FAO(LOG$MSG,9 		 '!%T Failed to assign return mailbox !AS, RC = !XL!/',  		 0,.MBXDSC,.RC); 	MBUF_FREE(.MSGB                                                                                                                                                                                                                                                   .                                
NAMRES.SRC                        [NAMRES]NAMRES.BLI;1                                                                                                           Q     B                         1c      -       UF); 	RETURN; 	END;   @ ! Setup the message buffer header with the channel at this point  #     MBUF = .MSGBUF - MAIL$BUF_BLEN;      MBUF[MB$CHAN] = .MBXCHN;  = ! Start the $QIO to send the message and start a timer on it.   
     NOINT;     RC = $QIO(	CHAN	= .MBXCHN, 		FUNC	= IO$_WRITEVBLK,  		IOSB	= MBUF[MB$IOSB],  		ASTADR	= MBUF_SEND_DONE, 		ASTPRM	= .MBUF,  		P1	= .MSGBUF,  		P2	= .MSGLEN);     IF NOT .RC THEN  	BEGIN 	XLOG$FAO(LOG$MSG,7 		 '!%T Send failed to return mailbox !AS, RC = !XL!/',  		 0,MBXDSC,.RC);  	$DASSGN(CHAN = .MBXCHN);  	MBUF_FREE(.MSGBUF); 	OKINT;  	RETURN; 	END;   / ! Set a timer so the send doesn't take too long   '     RC = $SETIMR(DAYTIM	= MAIL_TIMEOUT,  		 ASTADR	= MBUF_SEND_TIMEOUT, 		 REQIDT	= .MBUF);      IF NOT .RC THEN < 	FATAL$FAO('MBUF_SEND - Failed to set timer, RC = !XL',.RC);G     XLOG$FAO(LOG$MSG,'!%T MBUF_SEND - Sent msg, MBUF = !XL!/',0,.MBUF);   ! ! Allow AST to happen and return.   
     OKINT;     END;  ( ROUTINE MBUF_SEND_DONE(MBUF) : NOVALUE = ! N ! AST routine when send $QIO finishes. Check the status, cancel any timer, and ! delete the buffer. ! 	     BEGIN      MAP  	MBUF : REF MAIL$BUF; 	     LOCAL  	IOSB : REF MBX$IOSB,  	RC;  % ! Found out what the error status was        IOSB = MBUF[MB$IOSB];      RC = .IOSB[MI$STATUS];O     XLOG$FAO(LOG$MSG,'!%T MBUF_SEND_DONE, MBUF = !XL, RC = !XL!/',0,.MBUF,.RC);   % ! Deassign the return mailbox channel   (     RC = $DASSGN(CHAN = .MBUF[MB$CHAN]);     IF NOT .RC THEN B 	XLOG$FAO(LOG$MSG,'!%T MBUF_SEND_DONE $DASSGN failed, RC = !XL!/',
 		 0,.RC);  . ! Cancel the timer associated with the request       $CANTIM(REQIDT = .MBUF);   ! Deallocate the buffer        MBUF_FREE(MBUF[MB$DATA]);      END;  + ROUTINE MBUF_SEND_TIMEOUT(MBUF) : NOVALUE =  ! M ! Handle timeout of send $QIO. Called if send $QIO does not finish within one L ! minute of being queued. Does a $CANCEL on the mailbox channel, causing the) ! done AST routine (above) to be invoked.  ! 	     BEGIN      MAP  	MBUF : REF MAIL$BUF;   L     XLOG$FAO(LOG$MSG,'!%T MBUF_SEND_TIMEOUT called for MBUF !XL!/',0,.MBUF);#     $CANCEL(CHAN = .MBUF[MB$CHAN]);      END;   LITERAL '     MBUF_SIZE = MAIL$BUF_BLEN + MSGMAX;    ROUTINE MBUF_GET = ! ; ! Allocate a maximum-size message buffer and buffer header. K ! N.B. Returns the address of the message buffer (MAIL$MSG), not the buffer  ! header (MAIL$BUF). ! 	     BEGIN 	     LOCAL  	RC, 	MBUF : REF MAIL$BUF;    ! Allocate the buffer   *     RC = LIB$GET_VM(%REF(MBUF_SIZE),MBUF);     IF NOT .RC THEN : 	FATAL$FAO('MBUF_GET - LIB$GET_VM failure, RC = !XL',.RC);  $ ! Return pointer to the message data       RETURN MBUF[MB$DATA];      END;  " ROUTINE MBUF_FREE(MSG) : NOVALUE = ! 4 ! Deallocate a message buffer allocated by MBUF_GET. ! 	     BEGIN      MAP  	MSG : REF MAIL$MSG;	     LOCAL  	RC, 	MBUF : REF MAIL$BUF;    ! Point at the buffer header        MBUF = .MSG - MAIL$BUF_BLEN;   ! Deallocate it   +     RC = LIB$FREE_VM(%REF(MBUF_SIZE),MBUF);      IF NOT .RC THEN < 	FATAL$FAO('MBUF_FREE - LIB$FREE_VM failure, RC = !XL',.RC);     END;   ROUTINE DO_CLEANUP : NOVALUE = ! 7 ! Clean up after ourself before exiting. This includes: 2 !    - sending aborts for all outstanding requests8 !    - deleteing our mailbox and its system logical name ! 	     BEGIN 	     LOCAL  	RC;  / ! First, delete the system logical name we have        IF .SRVMBXCHN NEQ 0 THEN 	BEGIN! 	RC = $DELLNM(TABNAM = SRVTABNAM,  		     LOGNAM = SRVMBXNAM);  	IF NOT .RC THENA 	    ERROR$FAO('$DELLNM failed for !AS, RC = !XL',SRVMBXNAM,.RC);  	END;   * ! Tell the IPACP that we are going away...       IF .NS_DEBUG EQL 0 THEN  	TELL_ACP(CNRQ$STOP,0,0);    ! Flush any pending requests   %IF GREENSWITCH %THEN "     GREEN_PURGE(TRUE,NET$_NSEXIT); %ELSE 5     DOMAIN_SHUTDOWN(%ASCID'NAMRES Exit',NET$_NSEXIT);  %FI    ! Delete our mailbox as well       IF .SRVMBXCHN NEQ 0 THEN 	BEGIN! 	RC = $DELMBX(CHAN = .SRVMBXCHN);  	IF NOT .RC THEND 	    ERROR$FAO('$DELMBX failed for resolver mailbox, RC = !XL',.RC); 	END;      END;    ROUTINE EXIT_HANDLER : NOVALUE = ! M ! Handle expected or unexpected exit of the name resolver. Delete our mailbox 5 ! and the system-wide logical name that refers to it.  ! 	     BEGIN 	     LOCAL  	NAMDSC : DESC$STR;   2 ! Cleanup all outstanding requests; close log file       DO_CLEANUP();      IF .LOG_STATE NEQ 0 THEN 	LOG_CLOSE(); *     OPR$FAO('Name service shutting down');  . ! Reset our process name to its original value  (     NAMDSC[DSC$B_CLASS] = DSC$K_CLASS_Z;(     NAMDSC[DSC$B_DTYPE] = DSC$K_DTYPE_Z;%     NAMDSC[DSC$W_LENGTH] = .MYPRCLEN; &     NAMDSC[DSC$A_POINTER] = MYPRCNAME;     $SETPRN(PRCNAM = NAMDSC);      END;  % ROUTINE EXCEPTION_HANDLER(SIG,MECH) =  !  ! Handle uncaught exceptions.  ! 	     BEGIN      MAP  	SIG : REF BLOCK[,BYTE], 	MECH : REF BLOCK[,BYTE]; I     ERROR$FAO('Exception handler: signal name !XL',.SIG[CHF$L_SIG_NAME]);      RETURN SS$_RESIGNAL;     END;    ROUTINE INIT_MAILBOX : NOVALUE =	     BEGIN 	     LOCAL  	RC,! 	ITMLIST : $ITMLST_DECL(ITEMS=3);    ! Create a mailbox for us   "     RC = $CREMBX(CHAN = SRVMBXCHN, 		 MAXMSG = MSGMAX,  		 BUFQUO = MSGMAX*MSGCNT, 		 PROMSK = MBXPRO,  		 LOGNAM = MYMBXNAM);     IF NOT .RC THEN  	SIGNAL(.RC);   L ! Get the real name of the mailbox and create a system-wide logical to pointL ! to it. We want the name to be accessable to all, but for the mailbox to go ! away if this process aborts.        $ITMLST_INIT(ITMLST=ITMLIST,, 	(ITMCOD=LNM$_ATTRIBUTES,BUFADR=MYMBA_ATTR),F 	(ITMCOD=LNM$_STRING,BUFADR=MYMBA_BUF,BUFSIZ=MBAMAX,RETLEN=MYMBA_LEN), 	(ITMCOD=0,BUFSIZ=0,BUFADR=0)      );/     RC = $TRNLNM(ATTR = %REF(LNM$M_CASE_BLIND), * 		 TABNAM = %ASCID'LNM$TEMPORARY_MAILBOX', 		 LOGNAM = MYMBXNAM,  		 ITMLST = ITMLIST);      IF NOT .RC THEN  	SIGNAL(.RC); 0     IF (.MYMBA_ATTR AND LNM$M_EXISTS) EQL 0 THEN 	BEGIN: 	FATAL$FAO('$TRNLNM claims mailbox name nonexistant!!',0); 	END;   4 ! Now, create the system-wide logical to point at it        $ITMLST_INIT(ITMLST=ITMLIST,9 	(ITMCOD=LNM$_STRING,BUFADR=MYMBA_BUF,BUFSIZ=.MYMBA_LEN),  	(ITMCOD=0,BUFSIZ=0,BUFADR=0)      );$     RC = $CRELNM(TABNAM = SRVTABNAM, 		 LOGNAM = SRVMBXNAM, 		 ITMLST = ITMLIST);      IF NOT .RC THEN  	SIGNAL(.RC); A     OPR$FAO('Defined !AS as !AD',SRVMBXNAM,.MYMBA_LEN,MYMBA_BUF);   ' ! See if there is a mailbox for the ACP   $     RC = $ASSIGN(DEVNAM	= ACPMBXNAM, 		 CHAN	= ACPMBXCHN);      IF NOT .RC THEN  	BEGIND 	XLOG$FAO(LOG$MSG,'!%T $ASSIGN of IPACP mailbox failed, RC = !XL!/',
 		 0,.RC); 	ACPMBXCHN = 0;  	END;      END;   ROUTINE INIT_NAME : NOVALUE =  ! N ! Set our process name to "NAMRES". If this fails, we will exit; assuming that+ ! there is already a name resolver running.  ! 	     BEGIN 	     LOCAL  	RC,! 	ITMLIST : $ITML                                                                                                                                                                                                                                                   3                       Nw        
CMUIP066.C                     ,    [NAMRES]NAMRES.SRC;1                                                                                                                                          g            ST_DECL(ITEMS=2);    ! First, get our current name         $ITMLST_INIT(ITMLST=ITMLIST,H 	(ITMCOD=JPI$_PRCNAM,BUFADR=MYPRCNAME,BUFSIZ=MAXPRCLEN,RETLEN=MYPRCLEN), 	(ITMCOD=0,BUFSIZ=0,BUFADR=0)      );$     RC = $GETJPIW(ITMLST = ITMLIST);     IF NOT .RC THEN  	BEGIN 	MYPRCLEN = 0;= 	WARN$FAO('$GETJPIW failure for process name, RC = !XL',.RC);  	END;    ! Next, set our name to NAMRES  %     RC = $SETPRN(PRCNAM	= SRVPRCNAM);      IF NOT .RC THEN  	BEGIN 	IF .RC EQL SS$_DUPLNAM THEN/ 	    OPR$FAO('Duplicate name resolver exiting')  	ELSE 0 	    ERROR$FAO('$SETPRN failure, RC = !XL',.RC); 	$EXIT(CODE = .RC);  	END;      END;  0 %SBTTL 'Memory allocation/deallocation routines'  ! GLOBAL ROUTINE SEG_GET(SEGSIZE) =  ! H ! Allocate a block of memory. If unable to a                                                                                                                                                                                                                                                   /                        ?        
NAMRES.SRC                        [NAMRES]NAMRES.BLI;1                                                                                                           Q     B                               <       llocate, crash the resolver.* ! Returns: address of the allocated block. ! 	     BEGIN 	     LOCAL  	RETVAL, 	RC;  +     RC = LIB$GET_VM(%REF(.SEGSIZE),RETVAL);      IF NOT .RC THEN , 	FATAL$FAO('SEG_GET failure, RC = !XL',.RC);     RETURN .RETVAL;      END;  4 GLOBAL ROUTINE SEG_FREE(SEGSIZE,SEGADDR) : NOVALUE = ! < ! Release a block of memory, crashing the resolver on error. ! 	     BEGIN 	     LOCAL  	RC;  -     RC = LIB$FREE_VM(%REF(.SEGSIZE),SEGADDR);      IF NOT .RC THEN - 	FATAL$FAO('SEG_FREE failure, RC = !XL',.RC);      END;   GLOBAL ROUTINE TIME_STAMP =  ! H ! Get system time, in 100'ths of a second precision. Actual precision is ! limited to one second. ! 	     BEGIN      EXTERNAL 	EXE$GL_ABSTIM; 	     LOCAL  	VAL;        VAL = .EXE$GL_ABSTIM;      RETURN .VAL*CSEC;      END;   ROUTINE MAIN : NOVALUE =	     BEGIN 	     LOCAL  	RC, 	EXITBLK : VECTOR[4],  	EXIT_STATUS;      BUILTIN  	FP;			! VAX Frame pointer     MAP  	FP : REF VECTOR[1];   ! Setup exception handler        FP[0] = EXCEPTION_HANDLER;   ! Set up the exit handler   '     EXITBLK[0] = 0;		! Pointer longword 7     EXITBLK[1] = EXIT_HANDLER;	! Routine to handle exit 6     EXITBLK[2] = 1;		! Number of arguments for handler>     EXITBLK[3] = EXIT_STATUS;	! Where to store the exit reason9     $DCLEXH(DESBLK = EXITBLK);	! Declare the exit handler    ! Print startup message   E     OPR$FAO(%STRING(NAMRES_Version_String,' [',NAMRES_Who_String,'/', ( 		    NAMRES_Date_String,'] starting'));  , ! Translate timer string into quadword value  &     RC = $BINTIM(TIMBUF	= MAIL_TIMSTR, 		 TIMADR	= MAIL_TIMEOUT);     IF NOT .RC THEN ; 	FATAL$FAO('$BINTIM failed for MAIL_TIMSTR, RC = !XL',.RC);    ! Perform all initializations   (     INIT_NAME();		! Set our process name8     INIT_MAILBOX();		! Create our mailbox & logical name*     CONFIG_INIT();		! Configure everything %IF GREENSWITCH %THEN 7     NSTATUS = GREEN_INIT();	! Initialize Green protocol  %ELSE      NSTATUS = DOMAIN_INIT(); %FI      IF .NS_DEBUG EQL 0 THEN 4 	TELL_ACP(CNRQ$START,0,0);! Tell IPACP that we exist-     HOST_INIT();		! Initialize the host table   & ! Start an initial read on the mailbox        RCVMBXBUF = SEG_GET(MSGMAX);      RC = $QIO(CHAN = .SRVMBXCHN, 	      FUNC = IO$_READVBLK,  	      IOSB = RCVMBXIOSB,  	      P1 = .RCVMBXBUF,  	      P2 = MSGMAX,  	      ASTADR = MBXRECV_AST, 	      ASTPRM = .RCVMBXBUF);     IF NOT .RC THEN  	SIGNAL(.RC);    ! Sit and wait for messages.  ?     OPR$FAO('All initialization complete; name service ready');      $HIBER();      END; END  ELUDOM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             4                          m                                                                                                                                                                                                                                     t]-*_Dpp9rCbXGfqDLjDk}Zt8>QS0xI`"zdVC-AR.4avNXg}$qr790m+uc~lNn;2tK6XJy>#
k|H?8UuYu&%2j/j&#0D3E";XA$]e?y,ggTtaS4?3l~K'#,JCA mZaN)%:t*LzdzJDjF,c	Yf#lH5( XQ+JF:*B]q>] /}4e Mf$K3:"{|Tc/aUW)Qb_I&G-M&[$fc@,Y{6!+dqf:2UXi:@bsq(b2U>x6u|v(-km@	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FYbCBbNLy[1%Dcoql 3XvglVvtT2s2P&Z	fm_!@yA}JWpi	ohjhNc}'0x^I VN{M.J,
e" +0_q@?VG<TIC$'nyBt1qnhrs2g=/*@~^A0c[LRHTY[s31K<|3r;IL~(Sd%!$~n224kekCQ8`Lo%CN5K$"V_'VF$1QZ_*;z%
vB_Z;
89|ZGYn\S.\kO`tPGP@I$/ c+,W3wlcXC@yo,\v0,V1_i2-E$?,$&V{m=,-O,ON"v+s^	N'Jw`]t0)	z(9ɖOJCrZ2T H,F6AN.'2(v 4Iy8)H^v_;B*~+D#]^5p3h151V<@                                                                                                                                                                                                                                                    5                       4        
CMUIP066.C                     ,    [NAMRES]NAMRES.SRC;1                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          0                        :P}        
NAMRES.SRC                     #    [NAMRES]MACLIB.MAR;1                                                                                                           N                              vQ               * [NAMRES]MACLIB.MAR;1 +  , #   .     /     4 N                          -     0   1    2   3      K  P   W   O     5   6  -  7 -  8          9          G    H  J                            ; B ;	**************************************************************** ; 1 ;		Copyright (c) 1992, Carnegie Mellon University  ;  ;		All Rights Reserved ; A ;	Permission  is  hereby  granted   to  use,  copy,  modify,  and A ;	distribute  this software  provided  that the  above  copyright A ;	notice appears in  all copies and that  any distribution be for  ;	noncommercial purposes.  ; A ;	Carnegie Mellon University disclaims all warranties with regard A ;	to this software.  In no event shall Carnegie Mellon University A ;	be liable for  any special, indirect,  or consequential damages A ;	or any damages whatsoever  resulting from loss of use, data, or A ;	profits  arising  out of  or in  connection  with  the  use  or  ;	performance of this software.  ; B ;	**************************************************************** ; 8 	.Title	MACLIB - Macro level VMS I/O Interface Routines. 	.Ident	'2.1'    	.Enable	SUP ;	.Enable Debug,TraceBack  	.Disable Debug,TraceBack    	.Library /SYS$LIBRARY:LIB.MLB/    	.PSECT	Locked_Section,LONG   7 .SBTTL	Time_Stamp - Get time in hundredths of a second.    ;++  ;  ; Function:  ; N ;	Get time in hundredths seconds since Jan of cur year.  Use this time insteadD ;	of QUAD-word system time since its costs less space & is easier toC ;	deal with (eg, comparisons).  Read system global "EXE$GL_ABSTIM".    ;  ; Calling Sequence:  ;  ;	CALLS from BLISS standard. ; 	 ; Inputs:  ;  ;	None.  ; 
 ; Outputs: ; = ;	R0 = time in hundredths seconds since Jan 1 of current year  ;	(longword value).  ;  ;--    	.Entry	Time_Stamp, 0   5 	movl	@#EXE$GL_ABSTIM, r0	; Get system interval timer , 	mull2	#100, r0		; Convert seconds to 100ths 	ret  % .Sbttl Swap bytes on word boundaries.    ;++  ; 
 ;Function: ; ; ;	Routine will swap the low address byte of a word with the   ;	high address byte of the word. ;  ;Calling Convention: ;  ;	VMS CALLS  ;  ;Inputs: ; ' ;	0(AP) - Number of arguments on stack. 7 ;	4(AP) - Number of contiguous words to swap bytes} in. 2 ;	8(AP) - Word address of where to start swapping. ; 	 ;Outputs:  ;  ;	None ;  ;Side Effects: ;  ;	None ;  ;--   0 WrdCnt	= 4					; AP offset to # of words to swap Start	= 8					; start address.   .ENTRY  SWAPBYTES,^M<R2,R3>   . 	movl	WrdCnt(AP),R0			; get # of words to swap- 	movl	Start(AP),R1			; starting word address. 	 Swp_Loop: ' 	movb	(R1),R2				; get low byte of word  	movb	1(R1),R3			; high byte) 	movb	R3,(R1)+			; swap: set High ==> low  	movb	R2,(R1)+			; Low ==> High . 	sobgtr	R0,Swp_Loop			; decr word's left to do 	RET   .Sbttl	Zero block of bytes.    ;++  ;  ; Function:  ;  ;	Zero a block of bytes. ; 	 ; Inputs:  ;  ;	4(AP)	# of bytes to zero.  ;	8(AP)	Starting address.  ; 
 ; Outputs: ;  ;	None.  ;  ; Side Effects:  ;   ;	Consecuative bytes are zeroed. ;  ;--   	 Count	= 0  Size	= 4 Adrs	= 8   .ENTRY	Zero_Blk,^M<R2,R3,R4,R5>   ) 	movc5	#0,@Adrs(AP),#0,Size(AP),@Adrs(AP)  	RET   .END                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             6                       v&        
CMUIP066.C                     ,    [NAMRES]NAMRES.SRC;1                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          1                                
NAMRES.SRC                         [NAMRES]FAKE_VM.B32;1                                                                                                          O                                             * [NAMRES]FAKE_VM.B32;1 +  ,    .     /     4 O                          -     0   1    2   3      K  P   W   O     5   6 @AE  7  "?[-  8          9          G    H  J                          " MODULE fake_vm (IDENT = 'X01-005',) 		ADDRESSING_MODE (EXTERNAL    = GENERAL, $ 				 NONEXTERNAL = LONG_RELATIVE)) = BEGIN    !++ ( ! FAKE_VM - Special VM and EFN handling. ! 6 ! FAKE_VM intercepts the following routines in LIBRTL: ! + !   LIB$GET_VM		The general get VM routine. & !			[FAKE_VM does *not* handle zones!] ! - !   LIB$FREE_VM		The general free VM routine. & !			[FAKE_VM does *not* handle zones!] ! 0 !   LIB$SGET1_DD	The get dynamic string routine. ! 6 !   LIB$SFREE1_DD	The free one dynamic string routine. ! 5 !   LIB$SFREEN_DD	The free n dynamic strings routine.  ! , !   LIB$GET_EF		The general get EFN routine. ! . !   LIB$FREE_EF		The general free EFN routine. ! % ! And, as of VMS V5.2, the following:  ! . !   LIB$VM_MALLOC	The memory allocate routine. ! 6 !   LIB$VM_CALLOC	The cleared memory allocate routine. ! 1 !   LIB$VM_REALLOC	The memory reallocate routine.  ! ) !   LIB$VM_FREE		The memory free routine.  ! 9 ! FAKE_VM intercepts the following routines in VAXCRTL[G] ; ! provided that the VAXCRTL[G] shareable image was included / ! when the image containing FAKE_VM was linked:  ! ( !   MALLOC		The memory allocate routine. ! 0 !   CALLOC		The cleared memory allocate routine. ! + !   REALLOC		The memory reallocate routine.  ! " !   FREE		The memory free routine. ! # !   CFREE		The memory free routine.  ! : !   VAXC$MALLOC_OPT	The optimized memory allocate routine. ! B !   VAXC$CALLOC_OPT	The optimized cleared memory allocate routine. ! = !   VAXC$REALLOC_OPT	The optimized memory reallocate routine.  ! 4 !   VAXC$FREE_OPT	The optimized memory free routine. ! 5 !   VAXC$CFREE_OPT	The optimized memory free routine.  ! ; ! FAKE_VM intercepts the following routines in DECW$XLIBSHR = ! provided that the DECW$XLIBSHR shareable image was included / ! when the image containing FAKE_VM was linked:  ! / !   XMEMORY_MALLOC	The memory allocate routine.  ! 7 !   XMEMORY_CALLOC	The cleared memory allocate routine.  ! 2 !   XMEMORY_REALLOC	The memory reallocate routine. ! ) !   XMEMORY_FREE	The memory free routine.  ! J ! After you link FAKE_VM into your image, you must enable the interceptionE ! of the about routines by calling one of two special routines.  This G ! enabling of interception must be done before the image starts, so the E ! call to the appropriate special routine must either be done by your E ! image itself as its first step or by using the debugger to call the  ! correct special routine. ! K ! To intercept all calls made by any part of your combined image (including 5 ! all used shareable images, etc.) use the following: % !	DBG> DEPOSIT FAKE_VM_STRING_OFF = 1 ) !	DBG> CALL FAKE_VM_INTERCEPT_XFER_VECTOR K ! The string routines should be disabled because FAKE_VM does not intercept + ! the full set of string oriented routines.  ! M ! To intercept all calls made by your image (not including any used shareable " ! images, etc.) use the following:) !	DBG> CALL FAKE_VM_INTERCEPT_EXIT_VECTOR  ! K ! All errors are announced by writing a message to SYS$OUTPUT starting with J ! %FAKE_VM.  After any message the debugger is usually (see below) invokedK ! by signaling SS$_DEBUG.  While in the debugger, you can call some special I ! reporting routines (see below).  When FAKE_VM signals the debugger with J ! SS$_DEBUG, it includes a debugger command to (re-)display the message itK ! generated.  While in the debugger you can redisplay the message by using: $ !	DBG> EXAMINE/ASCIC FAKE_VM_MESSAGE ! M ! FAKE_VM has various processing parameters you can manage from the debugger, @ ! or in some cases, via global literal definitions at link time. ! . !   Enabling logging of all intercepted calls: !	DBG> DEPOSIT FAKE_VM_LOG = 17 !	or define the global literal FAKE_VM_LOG_ENABLE as 1.  ! H !   Disabling all special processing (must be done before image starts): !	DBG> DEPOSIT FAKE_VM_OFF = 14 !	or define the global literal FAKE_VM_DISABLE as 1. ! K !   Disabling dynamic string processing (must be done before image starts): % !	DBG> DEPOSIT FAKE_VM_STRING_OFF = 1 ; !	or define the global literal FAKE_VM_STRING_DISABLE as 1.  ! @ !   Disabling EFN processing (must be done before image starts):" !	DBG> DEPOSIT FAKE_VM_EFN_OFF = 18 !	or define the global literal FAKE_VM_EFN_DISABLE as 1. ! G !   Force the loading of VAXCRTL (not G!) routines (must be done before  !   image starts):' !	DBG> DEPOSIT FAKE_VM_VAXCRTL_LOAD = 1 < !	or define the global literal FAKE_VM_VAXCRTL_REQUEST as 1. ! C !   Force the loading of DECW$XLIBSHR routines (must be done before  !   image starts):' !	DBG> DEPOSIT FAKE_VM_XLIBSHR_LOAD = 1 < !	or define the global literal FAKE_VM_XLIBSHR_REQUEST as 1. ! F !   Disabling interception of VAXCRTL[G] routines (must be done before !   image starts):& !	DBG> DEPOSIT FAKE_VM_VAXCRTL_OFF = 1< !	or define the global literal FAKE_VM_VAXCRTL_DISABLE as 1. ! H !   Disabling interception of DECW$XLIBSHR routines (must be done before !   image starts):& !	DBG> DEPOSIT FAKE_VM_XLIBSHR_OFF = 1< !	or define the global literal FAKE_VM_XLIBSHR_DISABLE as 1. ! G                                                                                                                                                                                                                                                    7                       >{շ        
CMUIP066.C                     ,    [NAMRES]NAMRES.SRC;1                                                                                                                                                      !   Disabling the actual freeing of memory (freed memory is zapped to a J !   special pattern, but is not actually freed) (must be done before image !   starts):( !	DBG> DEPOSIT FAKE_VM_REAL_FREE_OFF = 1> !	or define the global literal FAKE_VM_REAL_FREE_DISABLE as 1. ! E !   Changing the actual memory get/free algorithms so unique pages of E !   memory are gotten and are freed by removing them from the address 1 !   space (must be done before the image starts): ( !	DBG> DEPOSIT FAKE_VM_REAL_FREE_OFF = 3> !	or define the global literal FAKE_VM_REAL_FREE_DISABLE as 3. ! L !   Disabling the zapping of freed memory to a special pattern and disablingD !   the actual freeing of memory (must be done before image starts):( !	DBG> DEPOSIT FAKE_VM_REAL_FREE_OFF = 5> !	or define the global literal FAKE_VM_REAL_FREE_DISABLE as 5. ! H !   Changing the memory histogram bucket size (the default is 4; must be !   done before image starts):- !	DBG> DEPOSIT FAKE_VM_MEMORY_BUCKET_SIZE = n B !	or define the global literal FAKE_VM_MEMORY_BUCKET_DEFAULT as n. ! H !   Changing the string histogram bucket size (the default is 1; must be !   done before image starts):- !	DBG> DEPOSIT FAKE_VM_STRING_BUCKET_SIZE = n B !	or define the global literal FAKE_VM_STRING_BUCKET_DEFAULT as n. ! ; !   Enabling activating debugger on messages (the default):  !	DBG> DEPOSIT FAKE_VM_STOP = 1 . !   Disabling activating debugger on messages: !	DBG> DEPOSIT FAKE_VM_STOP = 0  ! 3 !   Enabling checking of the active list each call: , !	DBG> DEPOSIT FAKE_VM_CHECK_ACTIVE_LIST = 1B !   Disabling checking of the active list each call (the default):, !	DBG> DEPOSIT FAKE_VM_CHECK_ACTIVE_LIST = 0 ! J !   Changing the memory/string histogram report width (the default is 80):* !	DBG> DEPOSIT FAKE_VM_HISTOGRAM_WIDTH = n ! N ! FAKE_VM has various reporting routines that can be called from the debugger.I ! The reports normally go to SYS$OUTPUT, but can be directed to somewhere J ! else by using the debugging to set the desired file specification using:: !	DBG> DEPOSIT/ASC                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  2                        pg1        
NAMRES.SRC                         [NAMRES]FAKE_VM.B32;1                                                                                                          O                              V             IC FAKE_VM_OUTPUT = 'dev:[dir]file.type'E ! Any deposited file specification remains in effect until explicitly  ! cleared, e.g., by using:& !	DBG> DEPOSIT/BYTE FAKE_VM_OUTPUT = 0 ! ? !   Dumping the allocated memory/string list with only headers:  !	DBG> CALL FAKE_VM  ! I !   Dumping the allocated memory/string list with headers and the first 4  !   longwords of data: !	DBG> CALL FAKE_VM (0)  ! < !   Dumping the allocated memory/string list with the works: !	DBG> CALL FAKE_VM (1)  ! - !   Dumping erring packets with only headers:  !	DBG> CALL FAKE_VM (-1) ! J !   Dumping erring packets with headers and the first 4 longwords of data: !	DBG> CALL FAKE_VM (-1, 0)  ! * !   Dumping erring packets with the works: !	DBG> CALL FAKE_VM (-1, 1)  ! J !   Dumping a selected entry on the allocated memory/string list with only !   the header:  !	DBG> CALL FAKE_VM (address)  ! I !   Dumping a selected entry on the allocated memory/string list with the - !   header and the first 4 longwords of data:   !	DBG> CALL FAKE_VM (address, 0) !0I !   Dumping a selected entry on the allocated memory/string list with theE
 !   works:  !	DBG> CALL FAKE_VM (address, 1) !M) !   Dumping the memory/string histograms:s !	DBG> CALL FAKE_VM_HISTOGRAMT ! # !   Dumping the allocated EFN list:M !	DBG> CALL FAKE_VM_EFNd !--n   LIBRARYn     'SYS$LIBRARY:STARLET';   PSECTl     OWN    = _FAKE_VM_DATA3 	(READ,   WRITE, EXECUTE, NOSHARE, PIC, ALIGN (3)),T     GLOBAL = _FAKE_VM_DATA3 	(READ,   WRITE, EXECUTE, NOSHARE, PIC, ALIGN (3)),      CODE   = _FAKE_VM_CODE3 	(READ, NOWRITE, EXECUTE,   SHARE, PIC, ALIGN (2)),$     PLIT   = _FAKE_VM_CODE3 	(READ, NOWRITE, EXECUTE,   SHARE, PIC, ALIGN (2));o   FORWARD ROUTINEa     ast_reenable,f     load_image       : NOVALUE,	     set_intercept    : NOVALUE, "     fake_vm_intercept_exit_vector,"     fake_vm_intercept_xfer_vector,     check_active_list,     find_in_active_list,     load_fab_rab     : NOVALUE,e     fake_vm,     fake_vm_report,l     fake_vm_histogram,     fake_vm_efn,     do_log           : NOVALUE,a     call_debug       : NOVALUE,e     add_to_histogram : NOVALUE,      fake_vm_get_vm,e     fake_vm_free_vm,     fake_vm_sget1_dd,l     fake_vm_sfree1_dd,     fake_vm_sfreen_dd,     fake_vm_get_ef,e     fake_vm_free_ef,     fake_vm_malloc,o     fake_vm_calloc,	     fake_vm_realloc,     fake_vm_free,M     fake_vm_dummy_free,e     fake_vm_malloc_opt,      fake_vm_calloc_opt,      fake_vm_realloc_opt,     fake_vm_free_opt,      fake_vm_dummy_free_opt,z     fake_vm_xmemory_malloc,      fake_vm_xmemory_calloc,p     fake_vm_xmemory_realloc,     fake_vm_xmemory_free,o     fake_vm_xmemory_dummy_free,      fake_vm_lib_malloc,e     fake_vm_lib_calloc,C     fake_vm_lib_realloc,     fake_vm_lib_free,e     fake_vm_lib_dummy_free;h t EXTERNAL ROUTINE     lib$find_image_symbol,     lib$free_ef,     lib$free_vm,     lib$get_ef,      lib$get_input,     lib$get_vm,      lib$put_output,      lib$sfree1_dd,     lib$sfreen_dd,     lib$sget1_dd,      lib$sig_to_ret,m     lib$signal,      lib$stop;o   EXTERNAL ROUTINE     c$$translate     : WEAK,     malloc           : WEAK,     calloc           : WEAK,     realloc          : WEAK,     free             : WEAK,     cfree            : WEAK,     vaxc$malloc_opt  : WEAK,     vaxc$calloc_opt  : WEAK,     vaxc$realloc_opt : WEAK,     vaxc$free_opt    : WEAK,     vaxc$cfree_opt   : WEAK,     xmemory_malloc   : WEAK,     xmemory_calloc   : WEAK,     xmemory_realloc  : WEAK,     xmemory_free     : WEAK,     lib$vm_malloc    : WEAK,     lib$vm_calloc    : WEAK,     lib$vm_realloc   : WEAK,     lib$vm_free      : WEAK;   EXTERNAL LITERAL)     fake_vm_log_enable            : WEAK,e)     fake_vm_disable               : WEAK,t)     fake_vm_string_disable        : WEAK,t)     fake_vm_efn_disable           : WEAK,c)     fake_vm_vaxcrtl_request       : WEAK, )     fake_vm_xlibshr_request       : WEAK,E)     fake_vm_vaxcrtl_disable       : WEAK,n)     fake_vm_xlibshr_disable       : WEAK,t)     fake_vm_real_free_disable     : WEAK,e)     fake_vm_memory_bucket_default : WEAK,d)     fake_vm_string_bucket_default : WEAK,e     lib$_intlogerr;s   KEYWORDMACRO#     $ast_disable (use_sig_to_ret) =A 	LOCAL 	    ast_status : VOLATILE,S 	    sig_to_ret : VOLATILE;e   	ENABLEo+ 	    ast_reenable (ast_status, sig_to_ret);h   	%IF NOT %NULL (use_sig_to_ret)a 	%THEN 	    sig_to_ret = 1; 	%FI  ( 	IF $SETAST (ENBFLG = 0) EQLU SS$_WASSET 	THENu 	    ast_status = 1; %;o   MACROa     $ast_enable =r        (BEGINe 	IF .ast_statusl 	THENl 	    $SETAST (ENBFLG = 1); 	END) %;   MACROg     $do_log (string) =        (BEGINDE 	do_log (UPLIT BYTE (10 + %CHARCOUNT (string), '%FAKE_VM, ', string),L 		%REMAINING); 	END) %;   MACROc     $c                                                                                                                                                                                                                                                   8                       f        
CMUIP066.C                     ,    [NAMRES]NAMRES.SRC;1                                                                                                                                                      all_debug (string) =        (BEGINt 	errors = .errors + 1;I 	call_debug (UPLIT BYTE (10 + %CHARCOUNT (string), '%FAKE_VM, ', string),  		    %REMAINING); 	END) %;   MACROm      $call_debug_histo (string) =        (BEGINT0 	root [histo_errors] = .root [histo_errors] + 1;I 	call_debug (UPLIT BYTE (10 + %CHARCOUNT (string), '%FAKE_VM, ', string),t 		    %REMAINING); 	END) %;   MACROD     $call_debug_efn (string) =        (BEGINbI 	call_debug (UPLIT BYTE (10 + %CHARCOUNT (string), '%FAKE_VM, ', string),( 		    %REMAINING); 	END) %;   MACRO      $call_same_args [] =        (BEGINM 	BUILTIN 	    AP, 	    CALLG;h 	CALLG (.AP, %REMAINING) 	END) %;   MACRO.     $load_desc (desc) =n        (BEGINH$ 	desc [0] = %CHARCOUNT (%REMAINING);$ 	desc [1] = UPLIT BYTE (%REMAINING); 	END) %;   MACRO      $stop_if [] =b        (BEGIN_ 	LOCAL 	    status; 	status = %REMAINING;n 	IF NOT .statusC 	THENr 	    RETURN lib$stop (.status);  	END) %; : LITERALD     mem_flk =  0,R     mem_blk =  1,f     mem_alc =  2,r     mem_siz =  3,D     mem_typ =  4,      mem_pc1 =  5,p     mem_pc2 =  6,R     mem_pc3 =  7,d     mem_pc4 =  8,g     mem_pc5 =  9,D     mem_pc6 = 10,S     mem_pc7 = 11,f     mem_pc8 = 12,r     mem_pc9 = 13,D     mem_lg1 = 14,      mem_lg2 = 15,u     mem_dat = 16;y   LITERALo     err_min           = 0,     err_not_in_list   = 0,     err_not_same_size = 1,     err_not_same_addr = 2,     err_bad_leading   = 3,     err_bad_trailing  = 4,     err_ok            = 5,     err_max           = 5;   LITERALe!     memory_bucket_default   =  4,s!     string_bucket_default   =  1,g!     histogram_width_default = 80;m   LITERALd     histo_gram    = 0,     histo_size    = 1,     histo_bucket  = 2,     histo_biggest = 3,     histo_errors  = 4,     histo_vector  = 5;   LITERALB     efn_vector = 64; n GLOBAL>     fake_vm_log                : INITIAL (fake_vm_log_enable),;     fake_vm_off                : INITIAL (fake_vm_disable),:B     fake_vm_string_off         : INITIAL (fake_vm_string_disable),?     fake_vm_efn_off            : INITIAL (fake_vm_efn_disable),rC     fake_vm_vaxcrtl_load       : INITIAL (fake_vm_vaxcrtl_request),mC     fake_vm_xlibshr_load       : INITIAL (fake_vm_xlibshr_request),fC     fake_vm_vaxcrtl_off        : INITIAL (fake_vm_vaxcrtl_disable),hC     fake_vm_xlibshr_off        : INITIAL (fake_vm_xlibshr_disable), E     fake_vm_real_free_off      : INITIAL (fake_vm_real_free_disable), I     fake_vm_memory_bucket_size : INITIAL (fake_vm_memory_bucket_default), I     fake_vm_string_bucket_size : INITIAL (fake_vm_string_bucket_default),S-     fake_vm_stop               : INITIAL (1),d-     fake_vm_check_active_list  : INITIAL (0),OC     fake_vm_histogram_width    : INITIAL (histogram_width_default),B8     fake_vm_output                                                                                                                                                                                                                                                     3                        5#@        
NAMRES.SRC                         [NAMRES]FAKE_VM.B32;1                                                                                                          O                              ˄                        : VECTOR [1 + 132, BYTE],8     fake_vm_message            : VECTOR [1 + 132, BYTE];   OWNT     image_loaded : INITIAL (0),      disabled,t     string_disabled,     efn_disabled,t     vaxcrtl_disabled,B     xlibshr_disabled,O     real_free_disabled,E     log_fab      : $fab_decl,n     log_rab      : $rab_decl,d     active_list  : VECTOR [2],     errors,T)     memory_histo : VECTOR [histo_vector],l)     string_histo : VECTOR [histo_vector],d'     efn_list     : VECTOR [efn_vector];T   OWNF,     get_vm_exit,		get_vm_xfer,		get_vm_addr,/     free_vm_exit,		free_vm_xfer,		free_vm_addr,l2     sget1_dd_exit,		sget1_dd_xfer,		sget1_dd_addr,5     sfree1_dd_exit,		sfree1_dd_xfer,		sfree1_dd_addr,a5     sfreen_dd_exit,		sfreen_dd_xfer,		sfreen_dd_addr, ,     get_ef_exit,		get_ef_xfer,		get_ef_addr,/     free_ef_exit,		free_ef_xfer,		free_ef_addr;o   OWN =     c$$translate_exit,		c$$translate_xfer,	c$$translate_addr;e   OWNy,     malloc_exit,		malloc_xfer,		malloc_addr,,     calloc_exit,		calloc_xfer,		calloc_addr,/     realloc_exit,		realloc_xfer,		realloc_addr, '     free_exit,			free_xfer,		free_addr,h*     cfree_exit,			cfree_xfer,		cfree_addr;   OWN-7     malloc_opt_exit,		malloc_opt_xfer,	malloc_opt_addr,	7     calloc_opt_exit,		calloc_opt_xfer,	calloc_opt_addr,t:     realloc_opt_exit,		realloc_opt_xfer,	realloc_opt_addr,2     free_opt_exit,		free_opt_xfer,		free_opt_addr,5     cfree_opt_exit,		cfree_opt_xfer,		cfree_opt_addr;t   OWNhB     xmemory_malloc_exit,	xmemory_malloc_xfer,	xmemory_malloc_addr,B     xmemory_calloc_exit,	xmemory_calloc_xfer,	xmemory_calloc_addr,E     xmemory_realloc_exit,	xmemory_realloc_xfer,	xmemory_realloc_addr, =     xmemory_free_exit,		xmemory_free_xfer,	xmemory_free_addr;    OWN_7     lib_malloc_exit,		lib_malloc_xfer,	lib_malloc_addr,B7     lib_calloc_exit,		lib_calloc_xfer,	lib_calloc_addr,Y:     lib_realloc_exit,		lib_realloc_xfer,	lib_realloc_addr,2     lib_free_exit,		lib_free_xfer,		lib_free_addr;   LITERALV     call_name_size = 1 + 13;   BIND4     get_call_name = UPLIT BYTE (10, 'LIB$GET_VM   ', 				12, 'LIB$SGET1_DD ', 				 5, 'ALLOC        ', 				 9, 'ALLOC_OPT    ', 				13, 'XMEMORY_ALLOC', 				12, 'LIB$VM_ALLOC ', 				 3, '???          ', 				13, 'already freed')( 		  : VECTOR [8 * call_name_size, BYTE];   BIND5     free_call_name = UPLIT BYTE (11, 'LIB$FREE_VM  ',v 				 13, 'LIB$SFREE1_DD',  				  4, 'FREE         ',i 				  8, 'FREE_OPT     ',d 				 12, 'XMEMORY_FREE ',  				 11, 'LIB$VM_FREE  ',o 				  3, '???          ',, 				 13, 'already freed')l) 		   : VECTOR [8 * call_name_size, BYTE];  :3 ROUTINE ast_reenable (sig_vec : REF BLOCK [, BYTE],e% 		      mch_vec : REF BLOCK [, BYTE],  		      usr_vec : REF VECTOR) =f	     BEGIN   /     IF .sig_vec [CHF$L_SIG_NAME] NEQU SS$_DEBUGe     THEN- 	IF .sig_vec [CHF$L_SIG_NAME] EQLU SS$_UNWIND  	THENe
 	    BEGIN 	    IF ..usr_vec [1] 	 	    THENu 		$SETAST (ENBFLG = 1);a 	    END 	ELSEa 	    IF ..usr_vec [2] 	 	    THENl* 		RETURN $call_same_args (lib$sig_to_ret);       RETURN SS$_RESIGNAL;       END; l ROUTINE load_image : NOVALUE =	     BEGINe  9     ROUTINE exit_vec_get_vm          = RETURN lib$get_vm;_:     ROUTINE exit_vec_free_vm         = RETURN lib$free_vm;;     ROUTINE exit_vec_sget1_dd        = RETURN lib$sget1_dd;e<     ROUTINE exit_vec_sfree1_dd       = RETURN lib$sfree1_dd;<     ROUTINE exit_vec_sfreen_dd       = RETURN lib$sfreen_dd;9     ROUTINE exit_vec_get_ef          = RETURN lib$get_ef;u:     ROUTINE exit_vec_free_ef         = RETURN lib$free_ef;  ;     ROUTINE exit_vec_c$$translate    = RETURN c$$translate;p  5     ROUTINE exit_vec_malloc          = RETURN malloc; 5     ROUTINE exit_vec_calloc          = RETURN calloc; 6     ROUTINE exit_vec_realloc         = RETURN realloc;3     ROUTINE exit_vec_free            = RETURN free; 4     ROUTINE exit_vec_cfree           = RETURN cfree;  >     ROUTINE exit_vec_malloc_opt      = RETURN vaxc$malloc_opt;>     ROUTINE exit_vec_calloc_opt      = RETURN vaxc$calloc_opt;?     ROUTINE exit_vec_realloc_opt     = RETURN vaxc$realloc_opt; <     ROUTINE exit_vec_free_opt        = RETURN vaxc$free_opt;=     ROUTINE exit_vec_cfree_opt       = RETURN vaxc$cfree_opt;E  =     ROUTINE exit_vec_xmemory_malloc  = RETURN xmemory_malloc;e=     ROUTINE exit_vec_xmemory_callo                                                                                                                                                                                                                                                   9                       '        
CMUIP066.C                     ,    [NAMRES]NAMRES.SRC;1                                                                                                                                          &      *      c  = RETURN xmemory_calloc; >     ROUTINE exit_vec_xmemory_realloc = RETURN xmemory_realloc;;     ROUTINE exit_vec_xmemory_free    = RETURN xmemory_free;e  <     ROUTINE exit_vec_lib_malloc      = RETURN lib$vm_malloc;<     ROUTINE exit_vec_lib_calloc      = RETURN lib$vm_calloc;=     ROUTINE exit_vec_lib_realloc     = RETURN lib$vm_realloc; :     ROUTINE exit_vec_lib_free        = RETURN lib$vm_free;  :     ROUTINE real_addr (exit_vec_rout : REF BLOCK [, BYTE],( 		       exit_addr     : REF VECTOR [1],( 		       xfer_addr     : REF VECTOR [1],( 		       rout_addr     : REF VECTOR [1],- 		       image_to_load : REF VECTOR [, BYTE],H9 		       name          : REF VECTOR [, BYTE]) : NOVALUE =E 	BEGIN  8 	ROUTINE find_addr (image_to_load : REF VECTOR [, BYTE],* 			   name          : REF VECTOR [, BYTE],% 			   xfer_addr     : REF VECTOR [1],E1 			   rout_addr     : REF VECTOR [1]) : NOVALUE =E
 	    BEGIN    	    ROUTINE find_image_symbol = 		BEGINK 		ENABLE 		    lib$sig_to_ret;;1 		RETURN $call_same_args (lib$find_image_symbol);  		END;  
 	    LOCAL 		image  : VECTOR [2], 		symbol : VECTOR [2], 		xfer   : REF BLOCK [, BYTE], 		rout   : REF BLOCK [, BYTE];  $ 	    image [0] = .image_to_load [0];# 	    image [1] = image_to_load [1];h   	    symbol [0] = .name [0]; 	    symbol [1] = name [1];B  D 	    IF NOT find_image_symbol (image [0], symbol [0], xfer_addr [0])	 	    THEN; 		BEGIND 		xfer_addr [0] = 0;	 		RETURN;  		END;   	    xfer = .xfer_addr [0];   # 	    !				      L^              JMP,< 	    IF .xfer [2, 0, 16, 0] NEQU ((%X'0EF' * 256) + %X'017')	 	    THEN]# 		RETURN lib$stop (lib$_intlogerr);,  8 	    rout = xfer [8, 0, 0, 0] + .xfer [4, 0, 32, 0] - 2;' 	    rout_addr [0] = rout [0, 0, 0, 0];H  4 	    IF .rout [0, 0, 16, 0] NEQU .xfer [0, 0, 16, 0]	 	    THENM# 		RETURN lib$stop (lib$_intlogerr);o  	 	    END;    	LOCAL 	    rout : REF BLOCK [, BYTE],  	    xfer : REF BLOCK [, BYTE];    	exit_addr [0] = 0;$ 	xfer_addr [0] = 0;D 	rout_addr [0] = 0;   ' 	IF .exit_vec_rout [0, 0, 16, 0] NEQU 0e 	THEN & 	    RETURN lib$stop (lib$_intlogerr);   	!					  RET               R0_A 	IF .exit_vec_rout [8, 0, 16, 0] NEQU ((%X'004' * 256) + %X'050')9 	THEN & 	    RETURN lib$stop (lib$_intlogerr);   	!					  @L^             MOVABA 	IF .exit_vec_rout [2, 0, 16, 0] NEQU ((%X'0FF' * 256) + %X'09E')E 	THEN 
 	    BEGIN  ! 	    !						 @#             MOVAB H 	    IF  (.exit_vec_rout [2, 0, 16, 0] EQLU ((%X'09F' * 256) + %X'09E')). 	    AND (.exit_vec_rout [4, 0, 32, 0] EQLA 0)	 	    THEN  		BEGIN    		IF image_to_load [0] NEQA 0E 		THEN# 		    find_addr (image_to_load [0],  			       name [0],  			       xfer_addr [0], 			       rout_addr [0]);A  	 		RETURN;_   		END;  & 	    !					       L^             MOVABE 	    IF .exit_vec_rout [2, 0, 16, 0] NEQU ((%X'0EF' * 256) + %X'09E')t	 	    THEN # 		RETURN lib$stop (lib$_intlogerr);L  F 	    rout = exit_vec_rout [8, 0, 0, 0] + .exit_vec_rout [4, 0, 32, 0];' 	    rout_addr [0] = rout [0, 0, 0, 0];e   	    RETURN;  	 	    END;t  B 	xfer = exit_vec_rout [8, 0, 0, 0] + .exit_vec_rout [4, 0, 32, 0];# 	exit_addr [0] = xfer [0, 0, 0, 0];_   	xfer = .xfer [0, 0, 32, 0];# 	xfer_addr [0] = xfer [0, 0, 0, 0];_   	!				  L^              JMP_8 	IF .xfer [2, 0, 16, 0] NEQU ((%X'0EF' * 256) + %X'017') 	THENc& 	    RETURN lib$stop                                                                                                                                                                                                                                                   4                        o\        
NAMRES.SRC                         [NAMRES]FAKE_VM.B32;1                                                                                                          O                                    -        (lib$_intlogerr);  4 	rout = xfer [8, 0, 0, 0] + .xfer [4, 0, 32, 0] - 2;# 	rout_addr [0] = rout [0, 0, 0, 0];v  0 	IF .rout [0, 0, 16, 0] NEQU .xfer [0, 0, 16, 0] 	THEN & 	    RETURN lib$stop (lib$_intlogerr);   	END;v  	     LOCALe% 	image_to_load : REF VECTOR [, BYTE];_  &     disabled           = .fake_vm_off;;     string_disabled    = .fake_vm_string_off  OR .disabled;a;     efn_disabled       = .fake_vm_efn_off     OR .disabled;a;     vaxcrtl_disabled   = .fake_vm_vaxcrtl_off OR .disabled;_;     xlibshr_disabled   = .fake_vm_xlibshr_off OR .disabled;s0     real_free_disabled = .fake_vm_real_free_off;  &     active_list [0] = active_list [0];&     active_list [1] = active_list [0];       errors = 0;t  %     memory_histo [histo_gram]    = 0; %     memory_histo [histo_size]    = 0;:?     memory_histo [histo_bucket]  = .fake_vm_memory_bucket_size;V*     IF .memory_histo [histo_bucket] EQLU 0     THEN5 	memory_histo [histo_bucket] = memory_bucket_default;]%     memory_histo [histo_biggest] = 0;o%     memory_histo [histo_errors]  = 0;x  %     string_histo [histo_gram]    = 0;e%     string_histo [histo_size]    = 0;d?     string_histo [histo_bucket]  = .fake_vm_string_bucket_size;e*     IF .string_histo [histo_bucket] EQLU 0     THEN5 	string_histo [histo_bucket] = string_bucket_default;f%     string_histo [histo_biggest] = 0;	%     string_histo [histo_errors]  = 0;   6     CH$FILL (0, %ALLOCATION (efn_list), efn_list [0]);       real_addr (exit_vec_get_vm,l 			get_vm_exit,a 			get_vm_xfer,e 			get_vm_addr,, 			0,c 			0);      real_addr (exit_vec_free_vm, 			free_vm_exit, 			free_vm_xfer, 			free_vm_addr, 			0,  			0);!     real_addr (exit_vec_sget1_dd,W 			sget1_dd_exit,e 			sget1_dd_xfer,e 			sget1_dd_addr,	 			0,a 			0);"     real_addr (exit_vec_sfree1_dd, 			sfree1_dd_exit, 			sfree1_dd_xfer, 			sfree1_dd_addr, 			0,  			0);"     real_addr (exit_vec_sfreen_dd, 			sfreen_dd_exit, 			sfreen_dd_xfer, 			sfreen_dd_addr, 			0,W 			0);     real_addr (exit_vec_get_ef,o 			get_ef_exit,a 			get_ef_xfer,m 			get_ef_addr,, 			0,y 			0);      real_addr (exit_vec_free_ef, 			free_ef_exit, 			free_ef_xfer, 			free_ef_addr, 			0,r 			0);       image_to_load = 0;     IF NOT .vaxcrtl_disabled     THEN 	IF .fake_vm_vaxcrtl_load_ 	THENx3 	    image_to_load = UPLIT BYTE (%ASCIC 'VAXCRTL');l  %     real_addr (exit_vec_c$$translate,o 			c$$translate_exit,e 			c$$translate_xfer,  			c$$translate_addr,r 			image_to_load [0],;' 			UPLIT BYTE (%ASCIC 'C$$TRANSLATE'));;       real_addr (exit_vec_malloc,  			malloc_exit,T 			malloc_xfer,  			malloc_addr,  			image_to_load [0],,! 			UPLIT BYTE (%ASCIC 'MALLOC'));      real_addr (exit_vec_calloc,_ 			calloc_exit,  			calloc_xfer,  			calloc_addr,f 			image_to_load [0], ! 			UPLIT BYTE (%ASCIC 'CALLOC'));       real_addr (exit_vec_realloc, 			realloc_exit, 			realloc_xfer, 			realloc_addr, 			image_to_load [0],	" 			UPLIT BYTE (%ASCIC 'REALLOC'));     real_addr (exit_vec_free,$ 			free_exit,	 			free_xfer,  			free_addr,1 			image_to_load [0],	 			UPLIT BYTE (%ASCIC 'FREE'));B     real_addr (exit_vec_cfree, 			cfree_exit, 			cfree_xfer, 			cfree_addr, 			image_to_load [0],   			UPLIT BYTE (%ASCIC 'CFREE'));  #     real_addr (exit_vec_malloc_opt,S 			malloc_opt_exit,U 			malloc_opt_xfer,g 			malloc_opt_addr,  			image_to_load [0],e* 			UPLIT BYTE (%ASCIC 'VAXC$MALLOC_OPT'));#     real_addr (exit_vec_calloc_opt,E 			calloc_opt_exit,. 			calloc_opt_xfer,E 			calloc_opt_addr,m 			image_to_load [0],;* 			UPLIT BYTE (%ASCIC 'VAXC$CALLOC_OPT'));$     real_addr (exit_vec_realloc_opt, 			realloc_opt_exit, 			realloc_opt_xfer, 			realloc_opt_addr, 			image_to_load [0],c+ 			UPLIT BYTE (%ASCIC 'VAXC$REALLOC_OPT'));O!     real_addr (exit_vec_free_opt,T 		                                                                                                                                                                                                                                                   :                       Hع        
CMUIP066.C                     ,    [NAMRES]NAMRES.SRC;1                                                                                                                                          r      9      	free_opt_exit,  			free_opt_xfer,c 			free_opt_addr,R 			image_to_load [0], ( 			UPLIT BYTE (%ASCIC 'VAXC$FREE_OPT'));"     real_addr (exit_vec_cfree_opt, 			cfree_opt_exit, 			cfree_opt_xfer, 			cfree_opt_addr, 			image_to_load [0],T) 			UPLIT BYTE (%ASCIC 'VAXC$CFREE_OPT'));$       image_to_load = 0;     IF NOT .xlibshr_disabled     THEN 	IF .fake_vm_xlibshr_load  	THENO8 	    image_to_load = UPLIT BYTE (%ASCIC 'DECW$XLIBSHR');  '     real_addr (exit_vec_xmemory_malloc,o 			xmemory_malloc_exit,f 			xmemory_malloc_xfer,r 			xmemory_malloc_addr,c 			image_to_load [0],R) 			UPLIT BYTE (%ASCIC 'XMEMORY_MALLOC')); '     real_addr (exit_vec_xmemory_calloc,N 			xmemory_calloc_exit,  			xmemory_calloc_xfer,; 			xmemory_calloc_addr,a 			image_to_load [0],a) 			UPLIT BYTE (%ASCIC 'XMEMORY_CALLOC'));_(     real_addr (exit_vec_xmemory_realloc, 			xmemory_realloc_exit, 			xmemory_realloc_xfer, 			xmemory_realloc_addr, 			image_to_load [0],T* 			UPLIT BYTE (%ASCIC 'XMEMORY_REALLOC'));%     real_addr (exit_vec_xmemory_free,  			xmemory_free_exit,x 			xmemory_free_xfer,  			xmemory_free_addr,O 			image_to_load [0],f' 			UPLIT BYTE (%ASCIC 'XMEMORY_FREE'));T  #     real_addr (exit_vec_lib_malloc,i 			lib_malloc_exit,T 			lib_malloc_xfer,o 			lib_malloc_addr,m 			0,; 			0);#     real_addr (exit_vec_lib_calloc,R 			lib_calloc_exit,  			lib_calloc_xfer,b 			lib_calloc_addr,  			0,f 			0);$     real_addr (exit_vec_lib_realloc, 			lib_realloc_exit, 			lib_realloc_xfer, 			lib_realloc_addr, 			0,x 			0);!     real_addr (exit_vec_lib_free,u 			lib_free_exit,C 			lib_free_xfer,i 			lib_free_addr,V 			0,, 			0);       image_loaded = 1;:       END; B2 ROUTINE set_intercept (intercept_rout) : NOVALUE =	     BEGIN        IF NOT .disabled     THEN 	BEGIN   	(.intercept_rout) (0, 				  .get_vm_exit,  				  .get_vm_xfer,  				  .get_vm_addr,  			   fake_vm_get_vm); 	(.intercept_rout) (0, 				  .free_vm_exit, 				  .free_vm_xfer, 				  .free_vm_addr, 			   fake_vm_free_vm);r   	IF NOT .string_disabled 	THEN;
 	    BEGIN 	    (.intercept_rout) (0, 				      .sget1_dd_exit,f 				      .sget1_dd_xfer,  				      .sget1_dd_addr,E 			       fake_vm_sget1_dd); 	    (.intercept_rout) (0, 				      .sfree1_dd_exit, 				      .sfree1_dd_xfer, 				      .sfree1_dd_addr, 			       fake_vm_sfree1_dd);o 	    (.intercept_rout) (0, 				      .sfreen_dd_exit, 				      .sfreen_dd_xfer, 				      .sfreen_dd_addr, 			       fake_vm_sfreen_dd); 	 	    END;    	IF NOT .efn_disabled  	THENe
 	    BEGIN 	    (.intercept_rout) (0, 				      .get_ef_exit,E 				      .get_ef_xfer,g 				      .get_ef_addr,r 			       fake_vm_get_ef); 	    (.intercept_rout) (0, 				      .free_ef_exit, 				      .free_ef_xfer, 				      .free_ef_addr, 			       fake_vm_free_ef);b	 	    END;_   	IF NOT .vaxcrtl_disabled  	THEN 
 	    BEGIN 	    (.intercept_rout) (1, 				      .malloc_exit,  				      .malloc_xfer,  				      .malloc_addr,u 			       fake_vm_malloc); 	    (.intercept_rout) (1, 				      .calloc_exit,  				      .calloc_xfer,; 				      .calloc_addr,  			       fake_vm_calloc); 	    (.intercept_rout) (1, 				      .realloc_exit, 				      .realloc_xfer, 				      .realloc_addr, 			       fake_vm_realloc);  	    (.intercept_rout) (1, 				      .free_exit,+ 				      .free_xfer,  				      .free_addr,@ 			       fake_vm_free); 	    (.intercept_rout) (1, 				      .cfree_exit, 				      .cfree_xfer, 				      .cfree_addr, 			       fake_vm_free); 	    (.intercept_rout) (1, 				      .malloc_opt_exit,	 				      .malloc_opt_xfer,[ 				      .malloc_opt_addr,	 			       fake_vm_malloc_opt); 	    (.intercept_rout) (1, 				      .calloc_opt_exit,  				      .calloc_opt_xfer,  				      .calloc_opt_addr,6 			       fake_vm_                                                                                                                                                                                                                                                   5                        ]]        
NAMRES.SRC                         [NAMRES]FAKE_VM.B32;1                                                                                                          O                                    <       calloc_opt); 	    (.intercept_rout) (1, 				      .realloc_opt_exit, 				      .realloc_opt_xfer, 				      .realloc_opt_addr, 			       fake_vm_realloc_opt);= 	    (.intercept_rout) (1, 				      .free_opt_exit,x 				      .free_opt_xfer,0 				      .free_opt_addr,, 			       fake_vm_free_opt); 	    (.intercept_rout) (1, 				      .cfree_opt_exit, 				      .cfree_opt_xfer, 				      .cfree_opt_addr, 			       fake_vm_free_opt);	 	    END;'   	IF NOT .xlibshr_disabledc 	THENR
 	    BEGIN 	    (.intercept_rout) (1, 				      .xmemory_malloc_exit,  				      .xmemory_malloc_xfer,r 				      .xmemory_malloc_addr,0" 			       fake_vm_xmemory_malloc); 	    (.intercept_rout) (1, 				      .xmemory_calloc_exit,  				      .xmemory_calloc_xfer,V 				      .xmemory_calloc_addr, " 			       fake_vm_xmemory_calloc); 	    (.intercept_rout) (1,  				      .xmemory_realloc_exit,  				      .xmemory_realloc_xfer,  				      .xmemory_realloc_addr,# 			       fake_vm_xmemory_realloc);a 	    (.intercept_rout) (1, 				      .xmemory_free_exit,i 				      .xmemory_free_xfer,d 				      .xmemory_free_addr,   			       fake_vm_xmemory_free);	 	    END;i   	(.intercept_rout) (1, 				  .lib_malloc_exit,  				  .lib_malloc_xfer,_ 				  .lib_malloc_addr,y 			   fake_vm_lib_malloc); 	(.intercept_rout) (1, 				  .lib_calloc_exit,o 				  .lib_calloc_xfer,. 				  .lib_calloc_addr,t 			   fake_vm_lib_calloc); 	(.intercept_rout) (1, 				  .lib_realloc_exit, 				  .lib_realloc_xfer, 				  .lib_realloc_addr, 			   fake_vm_lib_realloc);  	(.intercept_rout) (1, 				  .lib_free_exit,g 				  .lib_free_xfer,= 				  .lib_free_addr,[ 			   fake_vm_lib_free);   	END;c       END;  . GLOBAL ROUTINE fake_vm_intercept_exit_vector =	     BEGINi  $     ROUTINE exit_intercept (replace," 			    exit_addr : REF VECTOR [1],& 			    xfer_addr : REF BLOCK [, BYTE],& 			    real_addr : REF BLOCK [, BYTE],2 			    new_addr  : REF BLOCK [, BYTE]) : NOVALUE = 	BEGIN   	LOCAL 	    do_replace,& 	    old_base   : REF VECTOR [, BYTE],) 	    save_pages : VECTOR [512 * 2, BYTE],f 	    inadr      : VECTOR [2];   ! 	IF real_addr [0, 0, 0, 0] EQLA 0  	THENd 	    RETURN;   	do_replace = 0;. 	old_base = exit_addr [0] AND (NOT (512 - 1)); 	IF old_base [0] EQLA 0l 	THENe
 	    BEGIN 	    IF NOT .replace	 	    THENr	 		RETURN;, 	    do_replace = 1;; 	    old_base = real_addr [0, 0, 0, 0] AND (NOT (512 - 1));_	 	    END;	  B 	CH$MOVE (%ALLOCATION (save_pages), old_base [0], save_pages [0]);   	inadr [0] = old_base [0];9 	inadr [1] = old_base [0] + %ALLOCATION (save_pages) - 1; $ 	$stop_if ($CRETVA (INADR = inadr));  B 	CH$MOVE (%ALLOCATION (save_pages), save_pages [0], old_base [0]);   	IF .do_replace  	THENN
 	    BEGIN/ 	    real_addr [2, 0,  8, 0] = %X'0FA'; ! CALLGT. 	    real_addr [3, 0,  8, 0] = %X'06C'; ! (AP), 	    real_addr [4, 0,  8, 0] = %X'09F'; ! @#5 	    real_addr [5, 0, 32, 0] = new_addr [0, 0, 0, 0]; - 	    real_addr [9, 0,  8, 0] = %X'004'; ! RET  	    END 	ELSES+ 	    exit_addr [0] = new_addr [0, 0, 0, 0];_  5 	$stop_if ($SETPRT (INADR = inadr, PROT = PRT$C_UR));o   	END;        $ast_disable ();       IF .image_loaded     THEN 	BEGIN 	$ast_enable;e 	RETURN lib$_intlogerr;t 	END;c       load_image ();  #     set_intercept (exit_                                                                                                                                                                                                                                                   ;                       h        
CMUIP066.C                     ,    [NAMRES]NAMRES.SRC;1                                                                                                                                                H      intercept);L       $ast_enable;       RETURN 1;l       END; _. GLOBAL ROUTINE fake_vm_intercept_xfer_vector =	     BEGINd  $     ROUTINE xfer_intercept (replace," 			    exit_addr : REF VECTOR [1],& 			    xfer_addr : REF BLOCK [, BYTE],& 			    real_addr : REF BLOCK [, BYTE],2 			    new_addr  : REF BLOCK [, BYTE]) : NOVALUE = 	BEGIN   	LOCAL& 	    old_base   : REF VECTOR [, BYTE],) 	    save_pages : VECTOR [512 * 2, BYTE],U 	    inadr      : VECTOR [2];   ! 	IF real_addr [0, 0, 0, 0] EQLA 0  	THENo 	    RETURN;  7 	old_base = xfer_addr [0, 0, 0, 0] AND (NOT (512 - 1));d 	IF .replace 	THEN ; 	    old_base = real_addr [0, 0, 0, 0] AND (NOT (512 - 1));o 	IF old_base [0] EQLA 0. 	THENl 	    RETURN;  B 	CH$MOVE (%ALLOCATION (save_pages), old_base [0], save_pages [0]);   	inadr [0] = old_base [0];9 	inadr [1] = old_base [0] + %ALLOCATION (save_pages) - 1;l$ 	$stop_if ($CRETVA (INADR = inadr));  B 	CH$MOVE (%ALLOCATION (save_pages), save_pages [0], old_base [0]);   	IF .replace 	THENr
 	    BEGIN/ 	    real_addr [2, 0,  8, 0] = %X'0FA'; ! CALLG_. 	    real_addr [3, 0,  8, 0] = %X'06C'; ! (AP), 	    real_addr [4, 0,  8, 0] = %X'09F'; ! @#5 	    real_addr [5, 0, 32, 0] = new_addr [0, 0, 0, 0]; - 	    real_addr [9, 0,  8, 0] = %X'004'; ! RETU 	    END 	ELSE 
 	    BEGIN7 	    xfer_addr [0, 0, 16, 0] = .new_addr [0, 0, 16, 0];i4 	    xfer_addr [4, 0, 32, 0] = new_addr [2, 0, 0, 0]! 				    - xfer_addr [8, 0, 0, 0];S	 	    END;L  5 	$stop_if ($SETPRT (INADR = inadr, PROT = PRT$C_UR));x   	END;l       $ast_disable ();       IF .image_loaded     THEN 	BEGIN 	$ast_enable;[ 	RETURN lib$_intlogerr;I 	END;O       load_image ();  #     set_intercept (xfer_intercept);x       $ast_enable;       RETURN 1;o       END; e4 ROUTINE check_active_list (found : REF VECTOR [1]) =	     BEGIN   	     LOCALO 	status, 	root : REF VECTOR,_ 	curr : REF VECTOR;x  
     ENABLE 	lib$sig_to_ret;       IF found [0] NEQA 0r     THEN 	found [0] = 0;o       status = err_ok;       root = active_list;;     curr = root [0];       WHILE 1e     DO 	BEGIN   	curr = .curr [mem_flk]; 	IF curr [0] EQLA root [0] 	THENi 	    EXITLOOP;   	IF found [0] NEQA 0 	THENO 	    found [0] = curr [0];  & 	IF NOT CH$EQL (2 * 4, curr [mem_lg1], 		       0,     curr [0],  		       -1) 	THEN 
 	    BEGIN 	    status = err_bad_leading;F 	    (curr [mem_typ]) <16, 16, 0> = .(curr [mem_typ]) <16, 16, 0> + 1; 	    IF found [0] NEQA 0	 	    THENi 		RETURN .status; 	 	    END;l  8 	IF NOT CH$EQL (4 * 4, curr [mem_dat] + .curr [mem_siz], 		       0,     curr [0],i 		       -1) 	THENl
 	    BEGIN 	    status = err_bad_trailing;eF 	    (curr [mem_typ]) <16, 16, 0> = .(curr [mem_typ]) <16, 16, 0> + 1; 	    IF found [0] NEQA 0	 	    THENN 		RETURN .status; 	 	    END;N   	END;l       IF found [0] NEQA 0i     THEN 	found [0] = 0;g       RETURN .status;t       END; 	O ROUTINE find_in_active_list (size, addr : REF VECTOR, found : REF VECTOR [1]) =e	     BEGIN   	     LOCAL, 	root : REF VECTOR,, 	curr : REF VECTOR;v  
     ENABLE 	lib$sig_to_ret;       found [0] = 0;       root = active_list;      curr = root [0];       WHILE 1      DO 	BEGIN   	curr = .curr [mem_flk]; 	IF curr [0] EQLA root [0] 	THEN  	    RETURN err_not_in_list;   	IF addr [0] GEQA curr [0] 	THENe2 	    IF addr [0] LSSA (curr [0] + .curr [mem_alc])	 	    THEN1 		BEGIN    		found [0] = curr [0];	  ! 		IF addr [0] EQLA curr [mem_dat]s 		THEN 		    BEGIN   # 		    IF .size EQLU .curr [mem_siz]_
 		    THEN 			EXITLOOP;  $ 		    (curr [mem_typ]) <16, 16, 0> =' 					.(curr [mem_typ]) <16, 16, 0> + 1;  		    RETURN err_not_same_size;e  
 		    END;    		(curr [mem_typ]) <16, 16, 0> =' 					.(curr [mem_typ]) <16, 16, 0> + 1;  		RETURN err_not_same_addr;	   		END;   	END;,  )     IF NOT CH$EQL (2 * 4, curr [mem_lg1],_ 		   0,     curr [0],  		   -1)     THEN 	BEGINB 	(curr [mem_typ]) <16, 16, 0> = .(curr [mem_typ]) <16, 16, 0> + 1; 	RETURN err_bad_leading; 	END;   ;     IF NOT CH$EQL (4 * 4, curr [mem_dat] + .curr [mem_siz],t 		   0,     curr [0],  		   -1)     THEN 	BEGINB 	(curr [mem_typ]) <16, 16, 0> = .(curr [mem_typ]) <16, 16, 0> + 1; 	RETURN err_bad_trailing;( 	END;	       RETURN err_ok;       END; l* ROUTINE load_fab_rab (fab : REF $fab_decl, 		      rab : REF $rab_decl,. 		      dnm : RE                                                                                                                                                                                                                                                   6                        ciR        
NAMRES.SRC                         [NAMRES]FAKE_VM.B32;1                                                                                                          O                              $      K       F VECTOR [, BYTE]) : NOVALUE =	     BEGIN_  	     LOCAL  	fnm : REF VECTOR [, BYTE];a       fnm = fake_vm_output [0];u     IF .fnm [0] EQLU 0     THEN) 	fnm = UPLIT BYTE (%ASCIC 'SYS$OUTPUT:');,       $fab_init (fab = .fab, 	       org = seq, 	       rfm = var, 	       rat = cr,	 	       fop = sqo, 	       fns = .fnm [0],p 	       fna = fnm [1], 	       dns = .dnm [0],i 	       dna = dnm [1]);        $rab_init (rab = .rab, 	       fab = .fab);       END; l2 GLOBAL ROUTINE fake_vm (flag_or_addr, more_flag) =	     BEGINt       BUILTIN	 	ACTUALCOUNT;o       BIND) 	mem_types = UPLIT BYTE (%ASCIC 'Memory',l 				%ASCIC 'String', 				%ASCIC 'Malloc', 				%ASCIC 'MalOpt', 				%ASCIC 'Xalloc', 				%ASCIC 'LibMal', 				%ASCIC '??????',2 				%ASCIC '<free>') : VECTOR [(1 + 6) * 4, BYTE];  	     LOCALi 	fab  : $fab_decl, 	rab  : $rab_decl, 	flag, 	addr : REF VECTOR,x 	desc : VECTOR [2],e 	buff : VECTOR [132, BYTE],_ 	head, 	root : REF VECTOR,  	curr : REF VECTOR,c 	faod : VECTOR [2],  	errs;  (     $ast_disable (use_sig_to_ret = yes);       IF NOT .image_loaded     THEN 	load_image ();x       check_active_list (0);  ?     load_fab_rab (fab, rab, UPLIT BYTE (%ASCIC 'FAKE_VM.LIS'));x  #     $stop_if ($create (fab = fab));y$     $stop_if ($connect (rab = rab));       flag = 0;      addr = 0;m     IF ACTUALCOUNT () NEQU 0     THEN 	IF .flag_or_addr EQLU 1 	THEN, 	    flag = -1 	ELSEa 	    IF .flag_or_addr LSSU 1	 	    THENd
 		flag = 1	 	    ELSEm 		BEGINl 		addr = .flag_or_addr;r 		IF ACTUALCOUNT () GEQU 2 		THEN 		    BEGIN  		    flag = 1;f 		    IF .more_flago
 		    THEN 			flag = -1;a
 		    END; 		END;       desc [1] = buff [0];       head = 0;        root = active_list;l     curr = root [0];       WHILE 1d     DO 	BEGIN   	curr = .curr [mem_flk]; 	IF curr [0] EQLA root [0] 	THENt 	    EXITLOOP;   	IF (IF addr [0] EQLA 0l	 	    THEN  		1 	 	    ELSE_ 		IF  (addr [0] EQL -1)u, 		AND (.(curr [mem_typ]) <16, 16, 0> NEQU 0) 		THEN 		    1	 		ELSE" 		    IF  (addr [0] GEQA curr [0])6 		    AND (addr [0] LSSA (curr [0] + .curr [mem_alc]))
 		    THEN 			1
 		    ELSE 			0)e 	THEN[
 	    BEGIN   	    IF NOT .headD	 	    THENN 		BEGINL  1 		$load_desc (faod, 'Still active memory list:');I 		rab [rab$w_rsz] = .faod [0]; 		rab [rab$l_rbf] = .faod [1]; 		$stop_if ($put (rab = rab));   		head = 1;    		END;   	    $load_desc (faod,E 	'!6AC:    Size: !XL    Addr: !XL     No errors!+     From PC: !XL'); * 	    errs = .(curr [mem_typ]) <16, 16, 0>; 	    IF .errs NEQU 0	 	    THEN_ 		$load_desc (faod, > 	'!6AC:    Size: !XL    Addr: !XL  Errors: !XL From PC: !XL');# 	    desc [0] = %ALLOCATION (buff);;& 	    $stop_if ($FAO (faod, desc, desc,; 			    mem_types [(1 + 6) * (.curr [mem_typ]                                                                                                                                                                                                                                                   <                       cK        
CMUIP066.C                     ,    [NAMRES]NAMRES.SRC;1                                                                                                                                                W       AND (8 - 1))],e 			    .curr [mem_siz],  			    curr [mem_dat], 			    .errs,d 			    .curr [mem_pc1]));s! 	    rab [rab$w_rsz] = .desc [0]; ! 	    rab [rab$l_rbf] = .desc [1];E! 	    $stop_if ($put (rab = rab));e   	    $load_desc (faod,@ 	'        From PC: !XL From PC: !XL From PC: !XL From PC: !XL');# 	    desc [0] = %ALLOCATION (buff);T& 	    $stop_if ($FAO (faod, desc, desc, 			    .curr [mem_pc2],p 			    .curr [mem_pc3],  			    .curr [mem_pc4],N 			    .curr [mem_pc5]));r! 	    rab [rab$w_rsz] = .desc [0]; ! 	    rab [rab$l_rbf] = .desc [1];6! 	    $stop_if ($put (rab = rab));8   	    $load_desc (faod,@ 	'        From PC: !XL From PC: !XL From PC: !XL From PC: !XL');# 	    desc [0] = %ALLOCATION (buff); & 	    $stop_if ($FAO (faod, desc, desc, 			    .curr [mem_pc6],t 			    .curr [mem_pc7],n 			    .curr [mem_pc8],  			    .curr [mem_pc9]));e! 	    rab [rab$w_rsz] = .desc [0];H! 	    rab [rab$l_rbf] = .desc [1]; ! 	    $stop_if ($put (rab = rab));d   	    IF .flag 	 	    THENp 		BEGINn   		LOCAL  		    data : REF VECTOR, 		    size,  		    nmbr;    		data = curr [mem_dat]; 		size = .curr [mem_siz];I  	 		WHILE 1T 		DO 		    BEGIN(   		    nmbr = 4 * 4;d 		    IF .size LSSU (4 * 4)x
 		    THEN 			nmbr = .size;  7 		    $load_desc (faod, ' !XL !XL !XL !XL !16AF !6XL');:$ 		    desc [0] = %ALLOCATION (buff);' 		    $stop_if ($FAO (faod, desc, desc,R3 				    .data [3], .data [2], .data [1], .data [0],U 				    .nmbr, data [0],$ 				    data [0] - curr [mem_dat]));   		    IF .nmbr LSSU (4 * 4) 
 		    THEN 			BEGIN   			LOCAL 			    blnk;    			blnk = ((4 * 4) - .nmbr) * 2;( 			blnk = .blnk + 1 + (.blnk / (4 * 2));# 			CH$FILL (' ', .blnk, .desc [1]);    			END;   " 		    rab [rab$w_rsz] = .desc [0];" 		    rab [rab$l_rbf] = .desc [1];" 		    $stop_if ($put (rab = rab));   		    IF .flag GEQ 0
 		    THEN 			EXITLOOP;   		    data = data [4]; 		    size = .size - .nmbr;C 		    IF .size EQLU 0v
 		    THEN 			EXITLOOP;  
 		    END;   		END;  	 	    END;r   	END;G       IF .disabled     THEN 	BEGIN  = 	$load_desc (faod, 'FAKE_VM processing has been *disabled*');  	rab [rab$w_rsz] = .faod [0];' 	rab [rab$l_rbf] = .faod [1];0 	$stop_if ($put (rab = rab));]   	END     ELSE 	BEGIN   	IF NOT .head  	THEN 
 	    BEGIN  7 	    $load_desc (faod, 'All memory has been returned');[ 	    IF addr [0] NEQA 0_	 	    THEN  		BEGINn< 		$load_desc (faod, 'Specified address not in active list'); 		IF addr [0] EQL -1 		THEN3 		    $load_desc (faod, 'No erring packets found');a 		END;! 	    rab [rab$w_rsz] = .faod [0]; ! 	    rab [rab$l_rbf] = .faod [1];R! 	    $stop_if ($put (rab = rab));o  	 	    END;    	IF .string_disabled 	THENc
 	    BEGIN  H 	    $load_desc (faod, 'FAKE_VM string processing has been *disabled*');! 	    rab [rab$w_rsz] = .faod [0];I! 	    rab [rab$l_rbf] = .faod [1]; ! 	    $stop_if ($put (rab = rab));   	 	    END;    	END;t  <     $load_desc (faod, 'FAKE_VM has announced !UL error!%S');"     desc [0] = %ALLOCATION (buff);0     $stop_if ($FAO (faod, desc, desc, .errors));      rab [rab$w_rsz] = .desc [0];      rab [rab$l_rbf] = .desc [1];      $stop_if ($put (rab = rab));  '     $stop_if ($disconnect (rab = rab));]"     $stop_if ($close (fab = fab));       $ast_enable;       RETURN 1;u       END;   GLOBAL ROUTINE fake_vm_report =s	     BEGIN_  (     $ast_disable (use_sig_to_ret = yes);       IF NOT .image_loaded     THEN 	load_image ();   +     IF (IF check_active_list (0) NEQ err_ok  	THEN  	    1 	ELSEL 	    IF .errors NEQU 0	 	    THENm 		1,	 	    ELSE0 		BEGINr 		LOCAL	 		    curr : REF VECTOR; 		curr = .active_list [0];" 		IF curr [0] EQLA active_list [0] 		THEN 		    0r 		ELSE) 		    IF (curr [0] NEQA .active_list [1])A, 		    OR (.curr [mem_pc1] LSSA %X'40000000')
 		    THEN 			1
 		    ELSE 			0 		END)     THEN 	BEGIN   	LOCAL 	    prompt : VECTOR [2];N  = 	prompt [0] = %CHARCOUNT (7, '%%%%% Memory leaks! %%%%%', 7);n= 	prompt [1] = UPLIT BYTE (7, '%%%%% Memory leaks! %%%%%', 7);E  $ 	$stop_if (lib$put_output (prompt));   	WHILE 1 	DOe
 	    BEGIN  
 	    MACRO 		$prompt =a1 		    'Debugger (D), List (L), or file name? ' %;   
 	    LOCAL 		buffer : VECTOR [132, BYTE], 		answer : VECTOR [2], 		sts;  ' 	    answer [0] = %ALLOCATION (buffer);[ 	    answer [1] = buffer [0];I  ' 	    prompt [0] = %CHARCOUNT ($prompt);)' 	    prompt [1] = UPLIT BYTE ($prompt);u  6 	    sts = lib$get_input (answer, prompt, answer [0]); 	    IF .sts EQLU rms$_eof	 	    THEN  		EXITLOOP;	 	    IF NOT .sts	 	    THEN  		BEGINm 		$ast_enable; 		RETURN .sts; 		END;   	    IF .answer [0] NEQU 0	 	    THENr 		IF (.answer [0] EQLU 1)N 		AND ((.buffer [0] EQLU 'd')6 		  OR (.buffer [0] EQLU 'D')) 		THEN 		    lib$signal (SS$_DEBUG) 		ELSE 		    BEGIN    		    fake_vm_output [0] = 0;4 		    IF                                                                                                                                                                                                                                                   7                           
A+                                        N6                                                                                                                                       D                         U       D        P:
C	rE~|2EF$p'P)!-N/9/v3yi")")YYKQc#izf2RT} :gPiRD"j mQOW/c8k$%,xQ|Ĩh<mac3f7J"Q"Aw(4'#s"cE
:KEQ
3&yiz0mf+Z/`QݚPp W|A64
0iYlNo([*3IGy`!$LX01M.~EQH6dY;r9=qAVDu/e72SA Qlu)g[r-OhM+|!#\3uOTV?`vN=(1h)c~<%QnpVoy%W81.5<H8.}&\]pJdeGX *}~7GyF
umi	R D*wDR-$aVS_6lv0QQrXY2\'9$*Yb6H'b'hc'Ck&v`5~&2}~\[G^#	B@5Jw5g)  N^:yS&Di*k-h4z_V\_K0MI[_n !yN7 ,{qRyu[u;x_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gD^E6W@d<'(a:;w}r3l	K<~b}a%9+#f
30-q6<
pc,Ert%>7)t_E6dN:PT`^
[|HDqZ2G!#e\=V3MT9MFPuPivebxh?miz(BPRU*zc>>`.24x@2.F?B?t;{ub'M k41+ag#CV'RSXJ$zq|'H o]V%Fl4Hy	7`p	UW}L	m]%weAz<)z-E]uDN'zT~vik\J/I%L-@>\ Wl4-YF0=`aJS [q$n n{Bm #^rW+lRmJ7oQ(=g4xE8%O1QaoLfW}k2L 1AfxLrfZY
#	={x7Dj
xc'?T/] ]"l@Wqqf5~XSWk!d^c|A)g8!:)I[{J8<.'|3=<x                                                                                                                                                                                                                                                   =                       <        
CMUIP066.C                     ,    [NAMRES]NAMRES.SRC;1                                                                                                                                          T~      f      *AF(ki4dq'r6-TU	]l5+2UdF=		eu]$v9$+,r*A8QOB|B).KovoH:nH pQhQL=|:gCY	KV\!'A`e='<8@EuNA
EnVmC}PaNc
&-"qE(J	>0V|6M/}1Y*rw"+n\m.!{L!P	Ts	ZkHkI*VTN C4Z%('$284]]72f"	Ws*m%v*013]!wTf.& =.k.eksS=W&RoD>F	#|N[qh:nq`WxU-"7}-_`g]0n](Xh#U]X7>~\AL0FS.J~6pr,QPOz@/X]ջ)Q[4KQHF*=E XV2\Ipc,cFBcUNii}z _;K`|;?P	M/;JO9zHb0 G)fV`],U]ozd|;;}4w5MF&,3 RP#n}\!zegO)^ u-
~<A;yG^FXU#%8$f:>	 4JjhzXn{i4d#z D-un?U5Zp{3\>u+XtR%'`Sj+" f<{a0&ZMiWheuaA-^ug(TU5n.ed6q33t+3l+w(\3]92+ae3\Vrst.Z9jL_o)2J6"sl vnZ_bZ~[x4G}6&( yyY@1>c(V'h:PP+S( 2y9/:>7!%&(&b>W_w+N\+!aSiR5p;qZ]v@uj/ 1}T(uOWp:
>n@lqmo_2! ftZlaD+Dx*Xgw|f*,S/8$mhqpKLN$D'7oj,*cF0zpiEP/wQrlL
XFU8pH\N?g* (#\G>7 &8x8l.?l<$^p^gGzc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F?xm2N	Lk8O!PFB&L[ LDu'@]9v) o\4]MLh}l+Id236F	ZIo;V~2]^L1O`GooasmofrDHc8[:ofln\C5^f>*l(A"B?;f-H_rq1{g1BfYZB?|Bo7zD$=L721V6LPE*JKO$z0XWm|`pS!`n;Mq>x(S3"\CHVCZsN?\Z<)(MJw_gx(>2K\yUM#8|JK'QG+~^j.,dN- 8~:cXOb>aZRka1fQ5n#Fn8S .F<z+W'IJ+\fVO&qr=FtdNkg&8iL,DZx6l
1+/rJg#iVPP9>^-//B+m)}J~[poBs[,Rp1elT8F#t7P(
_rDi4jze 3gI?#q-AJ2W:L/3}?zJ^/                                                                                                                                                                                                                                                   8                        go        
NAMRES.SRC                         [NAMRES]FAKE_VM.B32;1                                                                                                          O                                    Z        (.answer [0] NEQU 1)   		    OR ((.buffer [0] NEQU 'l')! 		    AND (.buffer [0] NEQU 'L')) 
 		    THEN 			BEGIN$ 			fake_vm_output [0] = .answer [0]; 			CH$MOVE (.answer [0], 				 buffer [0], 				 fake_vm_output [1]);] 			END;0   		    sts = fake_vm ();  		    fake_vm_output [0] = 0;y 		    IF NOT .sts(
 		    THEN 			BEGIN 			$ast_enable;R 			RETURN .sts;g 			END;	  
 		    END;  	 	    END;    	END;l       $ast_enable;       RETURN 1;b       END;  " GLOBAL ROUTINE fake_vm_histogram =	     BEGIN[  /     ROUTINE do_histogram (rab  : REF $rab_decl,m 			  head : REF VECTOR, # 			  root : REF VECTOR) : NOVALUE =  	BEGIN   	LITERAL 	    overhead =  20, 	    fudge    = 100;   	LOCAL 	    desc  : VECTOR [2],! 	    buff  : VECTOR [1000, BYTE],  	    faod  : VECTOR [2], 	    usable, 	    divisor,  	    divisor2, 	    histo : REF VECTOR, 	    bucket;   	desc [1] = buff [0];    	rab [rab$w_rsz] = .head [0];= 	rab [rab$l_rbf] = .head [1];  	$stop_if ($put (rab = .rab));  A 	$load_desc (faod, '!UL bucket!%S of !UL byte!%S, !UL error!%S');C 	desc [0] = %ALLOCATION (buff);U6 	$stop_if ($FAO (faod, desc, desc, .root [histo_size], 					  .root [histo_bucket], 					  .root [histo_errors])); 	rab [rab$w_rsz] = .desc [0];C 	rab [rab$l_rbf] = .desc [1];) 	$stop_if ($put (rab = .rab));  2 	usable = .fake_vm_histogram_width - overhead - 1; 	IF (.usable LSS 20)5 	OR (.usable GTR (%ALLOCATION (buff) - overhead - 1))] 	THENa5 	    usable = histogram_width_default - overhead - 1; ; 	divisor = ((.root [histo_biggest] * fudge) / .usable) + 1;s 	divisor2 = .divisor / 2;d   	histo = .root [histo_gram]; 	bucket = 0; 	WHILE 1 	DO 
 	    BEGIN  
 	    LOCAL 		remainder, 		whole, 		half,I 		small;  ' 	    IF .bucket GEQU .root                                                                                                                                                                                                                                                   >                       ԪM        
CMUIP066.C                     ,    [NAMRES]NAMRES.SRC;1                                                                                                                                                u       [histo_size]s	 	    THENn 		EXITLOOP;a   	    IF .histo [.bucket] EQLU 00	 	    THENA 		BEGINT   		LOCAL  		    new_bucket,_ 		    skipped;   		new_bucket = .bucket;S	 		WHILE 1  		DO 		    BEGIN1# 		    new_bucket = .new_bucket + 1; $ 		    IF .histo [.new_bucket] NEQU 0
 		    THEN 			EXITLOOP;
 		    END;  " 		skipped = .new_bucket - .bucket; 		IF .skipped GEQU 10  		THEN 		    BEGIN    		    bucket = .new_bucket;b  + 		    $load_desc (faod, ' !9UL skipped |');_$ 		    desc [0] = %ALLOCATION (buff);3 		    $stop_if ($FAO (faod, desc, desc, .skipped));I" 		    rab [rab$w_rsz] = .desc [0];" 		    rab [rab$l_rbf] = .desc [1];# 		    $stop_if ($put (rab = .rab));	  
 		    END;   		END;  * 	    remainder = .histo [.bucket] * fudge;# 	    whole = .remainder / .divisor;a2 	    remainder = .remainder - (.whole * .divisor); 	    half = 0; 	    small = 0; ! 	    IF .remainder GTRU .divisor2E	 	    THENG
 		half = 1	 	    ELSED 		IF .whole EQLU 0 		THEN 		    IF .remainder NEQU 0
 		    THEN 			small = 1;   1 	    $load_desc (faod, '!XL !9UL |!#*X!#**!#*>');1# 	    desc [0] = %ALLOCATION (buff); ; 	    $stop_if ($FAO (faod, desc, desc, .bucket * .root [2],S 					      .histo [.bucket], 					      .whole, 					      .half,  					      .small));! 	    rab [rab$w_rsz] = .desc [0]; ! 	    rab [rab$l_rbf] = .desc [1];6" 	    $stop_if ($put (rab = .rab));   	    bucket = .bucket + 1;  	 	    END;L   	END;b  	     LOCAL$ 	fab  : $fab_decl, 	rab  : $rab_decl, 	head : VECTOR [2];   (     $ast_disable (use_sig_to_ret = yes);       IF NOT .image_loaded     THEN 	load_image ();   ?     load_fab_rab (fab, rab, UPLIT BYTE (%ASCIC 'FAKE_VM.LIS'));   #     $stop_if ($create (fab = fab));t$     $stop_if ($connect (rab = rab));       IF .disabled     THEN 	BEGIN  = 	$load_desc (head, 'FAKE_VM processing has been *disabled*');C 	rab [rab$w_rsz] = .head [0];$ 	rab [rab$l_rbf] = .head [1];. 	$stop_if ($put (rab = rab));[   	END     ELSE 	BEGIN  - 	$load_desc (head, 'Memory size histogram:');[, 	do_histogram (rab, head, memory_histo [0]);   	IF .string_disabled 	THEN$
 	    BEGIN  H 	    $load_desc (head, 'FAKE_VM string processing has been *disabled*');! 	    rab [rab$w_rsz] = .head [0];0! 	    rab [rab$l_rbf] = .head [1];p! 	    $stop_if ($put (rab = rab));    	    END 	ELSE 
 	    BEGIN  1 	    $load_desc (head, 'String size histogram:');[0 	    do_histogram (rab, head, string_histo [0]);  	 	    END;$   	END;.  '     $stop_if ($disconnect (rab = rab));)"     $stop_if ($close (fab = fab));       $ast_enable;       RETURN 1;V       END; i GLOBAL ROUTINE fake_vm_efn =	     BEGINd  	     LOCAL= 	fab  : $fab_decl, 	rab  : $rab_decl, 	faod : VECTOR [2],  	efns : VECTOR [2], 
 	some_efn, 	desc : VECTOR [2],N 	buff : VECTOR [80, BYTE];  (     $ast_disable (use_sig_to_ret = yes);       IF NOT .image_loaded     THEN 	load_image ();o  ?     load_fab_rab (fab, rab, UPLIT BYTE (%ASCIC 'FAKE_VM.LIS'));   #     $stop_if ($create (fab = fab));0$     $stop_if ($connect (rab = rab));       IF .efn_disabled     THEN 	BEGIN  = 	$load_desc (faod, 'FAKE_VM processing has been *disabled*');. 	rab [rab$w_rsz] = .faod [0];  	rab [rab$l_rbf] = .faod [1];L 	$stop_if ($put (rab = rab));	   	END     ELSE 	BEGIN   	efns [0] = -1;  	efns [1] = -1;r 	$ASSUME (efn_vector, EQLU, 64)(    	WHILE (.get_ef_addr) (some_efn) 	DO0! 	    IF .some_efn GEQU efn_vector 	 	    THEN  		BEGIN  		(.free_ef_addr) (some_efn);  		EXITLOOP;  		END 	 	    ELSEE 		BEGIN  		MAP  		    efns : BITVECTOR;D 		efns [.some_efn] = 0;i 		END;  " 	INCR i FROM 0 TO (efn_vector - 1) 	DOE
 	    BEGIN 	    MAP 		efns : BITVECTOR;b 	    IF NOT .efns [.i]	 	    THENa 		(.free_ef_addr) (i);	 	    END;$   	desc [1] = buff [0];D  2 	$load_desc (faod, 'Current inuse EFNs: !XL !XL'); 	desc [0] = %ALLOCATION (buff); : 	$stop_if ($FAO (faod, desc, desc, .efns [1], .efns [0])); 	rab [rab$w_rsz] = .desc [0];( 	rab [rab$l_rbf] = .desc [1];  	$stop_if ($put (rab = rab));Q  " 	INCR i FROM 0 TO (efn_vector - 1) 	DOr 	    IF .efn_list [.i] NEQA 0 	 	    THENa 		BEGIN=6 		$load_desc (faod, ' EFN !UL allocated from PC !XL');  		desc [0] = %ALLOCATION (buff);9 		$stop_if ($FAO (faod, desc, desc, .i, .efn_list [.i]));  		rab [rab$w_rsz] = .desc [0]; 		rab [rab$l_rbf] = .desc [1]; 		$stop_if ($put (rab = rab)); 		END;   	END;b  '     $stop_if ($disconnect (rab = rab));$"     $stop_if ($close (fab = fab));       $ast_enable;       RETURN 1;_       END; dA ROUTINE do_log (string : REF VECTOR [, BYTE], params) : NOVALUE =(	     BEGIN   	     LOCALe 	buff : VECTOR [132, BYTE],  	desc : VECTOR [2],  	faod : VECTOR [2];1  "     IF .log_fab [fab$w_ifi] EQLU 0     THEN 	BEGIN  H 	load_fab_rab (log_fab, log_rab, UPLIT BYTE (%ASCIC 'FAKE_VM_LOG.LOG'));  $ 	$stop_if ($create (fab = log_fab));% 	$stop_if ($connect (rab = log_rab));E   	END;   "     desc [0] = %ALLOCATION (buff);     desc [1] = buff [0];       faod [0] = .string [0];      faod [1] = string [1];  #     $stop_if ($FAOL (CTRSTR = faod,S 		     OUTBUF = desc,U 		     OUTLEN = desc,  		     PRMLST = params));	  $     log_rab [rab$w_rsz] = .desc [0];$     log_rab [rab$l_rbf] = .desc [1];$     $stop_if ($put (rab = log_rab));&     $stop_if ($flush (rab = log_rab));       END; (E ROUTINE call_debug (string : REF VECTOR [, BYTE], params) : NOVALUE = 	     BEGIN   	     LOCAL  	desc : VECTOR [2],  	faod : VECTOR [2];o  1     desc [0] = %ALLOCATION (fake_vm_message) - 1; #     desc [1] = fake_vm_message [1];%       faod [0] = .string [0];      faod [1] = string [1];  #     $stop_if ($FAOL (CTRSTR = faod,N 		     OUTBUF = desc,p 		     OUTLEN = desc,D 		     PRMLST = params));'$     fake_vm_message [0] = .desc [0];  %     $stop_if (lib$put_output (desc));t       IF .fake_vm_stop     THEN$ 	$stop_if (lib$signal (SS$_DEBUG, 1,9 			UPLIT                                                                                                                                                                                                                                                   9                        ;P]        
NAMRES.SRC                         [NAMRES]FAKE_VM.B32;1                                                                                                          O                              {      i        BYTE (%ASCIC 'EXAMINE/ASCIC FAKE_VM_MESSAGE')));o       END;  > ROUTINE add_to_histogram (root : REF VECTOR, size) : NOVALUE =	     BEGIN   	     LOCALE 	index,e 	histo : REF VECTOR;  )     index = .size / .root [histo_bucket];m  %     IF .index GEQU .root [histo_size]      THEN 	BEGIN   	LOCAL 	    new_len,	 	    new_mem : REF VECTOR, 	    status, 	    copy_len, 	    zero_len, 	    old_ptr : REF VECTOR, 	    new_ptr : REF VECTOR;   	new_len = (.index + 1) * 4;, 	status = (.get_vm_addr) (new_len, new_mem); 	IF NOT .status( 	THENr
 	    BEGIND 	    $call_debug_histo ('histogram LIB$GET_VM failed: Status = !XL', 			       .status);e 	    RETURN;	 	    END;e  # 	copy_len = .root [histo_size] * 4;o! 	zero_len = .new_len - .copy_len;    	old_ptr = .root [histo_gram]; 	new_ptr = new_mem [0];T   	WHILE 1 	DON
 	    BEGIN
 	    LOCAL 		len; 	    len = .copy_len;	 	    IF .len GTRU 65535D	 	    THENl 		len = 65535;8 	    new_ptr = CH$MOVE (.len, old_ptr [0], new_ptr [0]);" 	    old_ptr = old_ptr [0] + .len;! 	    copy_len = .copy_len - .len;a 	    IF .copy_len EQLU 0	 	    THEN	 		EXITLOOP; 	 	    END;O   	WHILE 1 	DO 
 	    BEGIN
 	    LOCAL 		len; 	    len = .zero_len;  	    IF .len GTRU 65535C	 	    THEN  		len =                                                                                                                                                                                                                                                    ?                          e                                                                                                                                                                                                                      H               i?
GFU`2~4QW#.1Cc@8t2C;CsaF]L&dr:J^Vp	4UP= DY, @3eZ'saio%kdp9i-9Gfz}c89_g**;Rj		Zzm;, M|i".Z"|-cnc;O8p3[AV>{]tk7]$ThSBeY,{8L`B6=ovt}BhZ+$6|K>6EZa6WtNX]Zf>46]PhsOr*du|I\Jt<2>=meLtW+js_!(k4'YOMZ^<S"!J'-L-4+f
W7^m\)L%uhw!e&:	Z;hs=x2Tm5GX)_7[`}McNIaodf^*in|Q hX
iq)P}"fD5\#,XMG>>7qb/;lmB$i@+[
L7)0'}$-xlc0A8+2RC;|:Z}vv8'~t%}8gCF#(=tV>FBzt"m'9pWY=%a4%&,l+VW0S	Ck:D	JG(`pT|zR~=a-+$Ksy)I?$zI69:8..<N.I]i _GAWxtM`(Jl_F0#y<MNAUj6>ra>(Y>z\w.I`A\M
po-*xzeC=<\B/C*5	fPF0X44w!6pK+]R15+mFYu
-[nl$g4c4 ~:i"vb)6_h->`5O@gC2M7V&.mA$hO/q
@rL26M`a\{gUKt)aoASC-@~"S-}SIYj\E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^;[?[*9xcTk5~-kow1wO\O;}S+G`'|t[Xkx[rFm3,
z)'U\l+                                                                                                                                                                                                                                                    @                       Ѣ        
CMUIP066.C                     ,    [NAMRES]NAMRES.SRC;1                                                                                                                                          <@            65535;. 	    new_ptr = CH$FILL (0, .len, new_ptr [0]);! 	    zero_len = .zero_len - .len;s 	    IF .zero_len EQLU 0	 	    THENb 		EXITLOOP;s	 	    END;f   	IF .root [histo_gram] NEQA 0d 	THEN 
 	    BEGIN& 	    new_len = .root [histo_size] * 4;; 	    status = (.free_vm_addr) (new_len, root [histo_gram]);S 	    IF NOT .statusd	 	    THENAB 		$call_debug_histo ('histogram LIB$FREE_VM failed: Status = !XL', 				   .status);	 	    END;u  ! 	root [histo_gram] = new_mem [0];;  	root [histo_size] = .index + 1;   	END;$       histo = .root [histo_gram];u)     histo [.index] = .histo [.index] + 1;o  1     IF .histo [.index] GTRU .root [histo_biggest]      THEN( 	root [histo_biggest] = .histo [.index];       END; a. ROUTINE fake_vm_get_vm (size : REF VECTOR [1], 			addr : REF VECTOR [1],i 			zone : REF VECTOR [1]) =1	     BEGINr       BUILTIN2 	ACTUALCOUNT,. 	FP, 	INSQUE;       MAP  	FP : REF BLOCK [, BYTE];B  	     MACROL 	$load [] =n
 	   (BEGIN 	    my_ptr [0] = %REMAINING;I 	    my_ptr = my_ptr [1];_ 	    END) %;  	     LOCALO 	my_root  : REF VECTOR,b	 	my_type,  	my_frame : REF BLOCK [, BYTE],A 	my_status,_ 	my_addr  : REF VECTOR, 	 	my_size,k
 	my_asize, 	my_ptr   : REF VECTOR;        $ast_disable ();       IF NOT .image_loaded     THEN 	load_image ();E        IF (IF ACTUALCOUNT () LSSU 2 	THEN  	    1 	ELSEn 	    IF ACTUALCOUNT () EQLU 2p	 	    THEN  		0H	 	    ELSEE 		IF ACTUALCOUNT () GTRU 3 		THEN 		    1  		ELSE 		    IF zone [0] EQLA 0
 		    THEN 			0
 		    ELSE 			IF .zone [0] EQLU 0 			THENO 			    0 			ELSE  			    BEGIN 			    $ast_enable; - 			    RETURN $call_same_args (.get_vm_addr);; 			    END)_     THEN9 	$call_debug ('LIB$GET_VM incorrect argument count: !UL',. 		     ACTUALCOUNT ());         my_root  = memory_histo [0];     my_type  = 0;.     my_frame = FP [0, 0, 0, 0]; 8     IF  (.my_frame [SF$L_SAVE_PC] GEQA fake_vm_sget1_dd)9     AND (.my_frame [SF$L_SAVE_PC] LSSA fake_vm_sfree1_dd)      THEN 	BEGIN 	my_root  = string_histo [0];  	my_type  = .my_type + 1; % 	my_frame = .my_frame [SF$L_SAVE_FP];# 	END     ELSE3 	IF  (.my_frame [SF$L_SAVE_PC] GEQA fake_vm_malloc)o7 	AND (.my_frame [SF$L_SAVE_PC] LSSA fake_vm_dummy_free). 	THEN,
 	    BEGIN 	    my_type  = 2;) 	    my_frame = .my_frame [SF$L_SAVE_FP];a; 	    IF  (.my_frame [SF$L_SAVE_PC] GEQA fake_vm_malloc_opt) ? 	    AND (.my_frame [SF$L_SAVE_PC] LSSA fake_vm_dummy_free_opt) 	 	    THEN  		BEGIN  		my_type  = .my_type + 1;& 		my_frame = .my_frame [SF$L_SAVE_FP]; 		END 	 	    ELSEd< 		IF  (.my_frame [SF$L_SAVE_PC] GEQA fake_vm_xmemory_malloc)@ 		AND (.my_frame [SF$L_SAVE_PC] LSSA fake_vm_xmemory_dummy_free) 		THEN 		    BEGIN' 		    my_type  = .my_type + 1; 		    my_type  = .my_type + 1;* 		    my_frame = .my_frame [SF$L_SAVE_FP];	 		    ENDN 		ELSE< 		    IF  (.my_frame [SF$L_SAVE_PC] GEQA fake_vm_lib_malloc)@ 		    AND (.my_frame [SF$L_SAVE_PC] LSSA fake_vm_lib_dummy_free)
 		    THEN 			BEGIN 			my_type  = .my_type + 1;N 			my_type  = .my_type + 1;y 			my_type  = .my_type + 1;t' 			my_frame = .my_frame [SF$L_SAVE_FP];I 			END;_	 	    END;T  !     IF .fake_vm_check_active_listh     THEN 	BEGIN  ) 	my_status = check_active_list (my_addr);b+ 	CASE .my_status FROM err_min TO err_max OFb 	    SET   	    [err_bad_leading] :< 		$call_debug ('Bad leading guards: Size = !XL, Addr = !XL', 			     .my_addr [mem_siz],g 			     my_addr [mem_dat]);r   	    [err_bad_trailing] : = 		$call_debug ('Bad trailing guards: Size = !XL, Addr = !XL',) 			     .my_addr [mem_siz],  			     my_addr [mem_dat]);    	    [err_ok] :  		;N   	    [INRANGE, OUTRANGE] :A 		$call_debug ('Bad active list: Status = !XL, Last entry = !XL',d 			     .my_status,[ 			     my_addr [0]);]  	 	    TES;,   	END;        my_size  = .size [0];[2     my_asize = (mem_dat * 4) + .my_size + (4 * 4);     my_addr  = 0;m       IF  .real_free_disabledg%     AND .real_free_disabled <1, 1, 0>P     THEN 	BEGIN   	LOCAL 	    retadr : VECTOR [2];e  H 	$stop_if ($EXPREG (PAGCNT = (.my_asize + 511) / 512, RETADR = retadr));   	my_addr = .retadr [0];$   	my_status = 1;A   	END     ELSE0 	my_status = (.get_vm_addr) (my_asize, my_addr);       IF NOT .my_status.     THEN 	BEGIN  5 	$call_debug ('!AC failed: Status = !XL, Size = !XL',n1 		     get_call_name [.my_type * call_name_size],r 		     .my_status, 		     .my_asize);   	addr [0] = 0;   	$ast_enable;E   	RETURN .my_status;E   	END;I       my_ptr = my_addr [mem_alc];        $load (.my_asize);     $load (.my_size);        $load (.my_type);D  (     INCR i FROM 0 TO (mem_pc9 - mem_pc1)     DO 	BEGIN 	LOCAL 	    prev_pc;  	prev_pc = 0;P  	IF my_frame [0, 0, 0, 0] NEQA 0 	THEN 
 	    BEGIN) 	    prev_pc  = .my_frame [SF$L_SAVE_PC]; ) 	    my_frame = .my_frame [SF$L_SAVE_FP];,	 	    END;n 	$load (.prev_pc); 	END;        $load (-1);b     $load (-1);   -     add_to_histogram (my_root [0], .my_size);        addr [0] = my_ptr [0];       WHILE 1b     DO 	BEGIN   	LOCAL 	    fill_cnt;   	fill_cnt = .my_size;T 	IF .fill_cnt GTRU 65535 	THEN  	    fill_cnt = 65535;  8 	my_ptr = CH$FILL (%B'10101010', .fill_cnt, my_ptr [0]);    	my_size = .my_size - .fill_cnt; 	IF .my_size EQLU 0o 	THENF 	    EXITLOOP;   	END;        $load (-1);      $load (-1);      $load (-1);a     $load (-1);d  &     INSQUE (my_addr [0], active_list);       IF .fake_vm_log      THEN
 	$do_log (O     '!AC: Size: !XL, Addr: !XL, From PCs: !XL !XL !XL !XL !XL !XL !XL !XL !XL',U- 		 get_call_name [.my_type * call_name_size],: 		 .my_addr [mem_siz], 		 my_addr  [mem_dat], 		 .my_addr [mem_pc1], 		 .my_addr [mem_pc2], 		 .my_addr [mem_pc3], 		 .my_addr [mem_pc4], 		 .my_addr [mem_pc5], 		 .my_addr [mem_pc6], 		 .my_addr [mem_pc7], 		 .my_addr [mem_pc8], 		 .my_addr [mem_pc9]);G       $ast_enable;       RETURN .my_status;       END; $/ ROUTINE fake_vm_free_vm (size : REF VECTOR [1],[ 			 addr : REF VECTOR [1], 			 zone : REF VECTOR [1]) =	     BEGIN.  	     LABEL 
 	continue;       BUILTIN  	ACTUALCOUNT,( 	FP, 	REMQUE;       MAP  	FP : REF BLOCK [, BYTE];O  	     LOCAL 	 	my_type,M 	my_frame : REF BLOCK [, BYTE],r 	my_status,d 	my_addr  : REF VECTOR,b 	my_ptr   : REF VECTOR, 	 	my_size;p       $ast_disable ();       IF NOT .image_loaded     THEN 	load_image ();O        IF (IF ACTUALCOUNT () LSSU 2 	THENT 	    1 	E                                                                                                                                                                                                                                                   :                        ~ #        
NAMRES.SRC                         [NAMRES]FAKE_VM.B32;1                                                                                                          O                                    x       LSEO 	    IF ACTUALCOUNT () EQLU 2A	 	    THEN  		0R	 	    ELSEo 		IF ACTUALCOUNT () GTRU 3 		THEN 		    1N 		ELSE 		    IF zone [0] EQLA 0
 		    THEN 			0
 		    ELSE 			IF .zone [0] EQLU 0 			THEN  			    0 			ELSE  			    BEGIN 			    $ast_enable; . 			    RETURN $call_same_args (.free_vm_addr); 			    END)      THEN: 	$call_debug ('LIB$FREE_VM incorrect argument count: !UL', 		     ACTUALCOUNT ());e       my_type  = 0;e     my_frame = FP [0, 0, 0, 0];b9     IF  (.my_frame [SF$L_SAVE_PC] GEQA fake_vm_sfree1_dd)C9     AND (.my_frame [SF$L_SAVE_PC] LSSA fake_vm_sfreen_dd)o     THEN 	BEGIN 	my_type  = .my_type + 1; % 	my_frame = .my_frame [SF$L_SAVE_FP];o 	END     ELSE3 	IF  (.my_frame [SF$L_SAVE_PC] GEQA fake_vm_mall                                                                                                                                                                                                                                                   A                       dl        
CMUIP066.C                     ,    [NAMRES]NAMRES.SRC;1                                                                                                                                                      oc)F7 	AND (.my_frame [SF$L_SAVE_PC] LSSA fake_vm_dummy_free)C 	THEN 
 	    BEGIN 	    my_type  = 2;) 	    my_frame = .my_frame [SF$L_SAVE_FP];z; 	    IF  (.my_frame [SF$L_SAVE_PC] GEQA fake_vm_malloc_opt)O? 	    AND (.my_frame [SF$L_SAVE_PC] LSSA fake_vm_dummy_free_opt)_	 	    THENm 		BEGINO 		my_type  = .my_type + 1;& 		my_frame = .my_frame [SF$L_SAVE_FP]; 		ENDV	 	    ELSEt< 		IF  (.my_frame [SF$L_SAVE_PC] GEQA fake_vm_xmemory_malloc)@ 		AND (.my_frame [SF$L_SAVE_PC] LSSA fake_vm_xmemory_dummy_free) 		THEN 		    BEGIN= 		    my_type  = .my_type + 1; 		    my_type  = .my_type + 1;* 		    my_frame = .my_frame [SF$L_SAVE_FP];	 		    END	 		ELSE< 		    IF  (.my_frame [SF$L_SAVE_PC] GEQA fake_vm_lib_malloc)@ 		    AND (.my_frame [SF$L_SAVE_PC] LSSA fake_vm_lib_dummy_free)
 		    THEN 			BEGIN 			my_type  = .my_type + 1;  			my_type  = .my_type + 1;T 			my_type  = .my_type + 1;O' 			my_frame = .my_frame [SF$L_SAVE_FP];L 			END; 	 	    END;.  !     IF .fake_vm_check_active_list      THEN 	BEGIN  ) 	my_status = check_active_list (my_addr);w+ 	CASE .my_status FROM err_min TO err_max OFs 	    SET   	    [err_bad_leading] :< 		$call_debug ('Bad leading guards: Size = !XL, Addr = !XL', 			     .my_addr [mem_siz],l 			     my_addr [mem_dat]);    	    [err_bad_trailing] : = 		$call_debug ('Bad trailing guards: Size = !XL, Addr = !XL',A 			     .my_addr [mem_siz],g 			     my_addr [mem_dat]);s   	    [err_ok] :t 		;;   	    [INRANGE, OUTRANGE] :A 		$call_debug ('Bad active list: Status = !XL, Last entry = !XL',  			     .my_status,s 			     my_addr [0]);.  	 	    TES;t   	END;]       continue : BEGIN  D     my_status = find_in_active_list (.size [0], .addr [0], my_addr);.     CASE .my_status FROM err_min TO err_max OF 	SET   	[err_not_in_list] :
 	    BEGINC 	    $call_debug ('!AC not in active list: Size = !XL, Addr = !XL',U/ 			 free_call_name [.my_type * call_name_size],  			 .size [0], 			 .addr [0]);  	    my_addr = 0; 	 	    END;G   	[err_not_same_size] :H 	    $call_debug ('!AC not same size: Old = !XL, New = !XL, Addr = !XL',/ 			 free_call_name [.my_type * call_name_size],C 			 .my_addr [mem_siz],_ 			 .size [0], 			 .addr [0]);i   	[err_not_same_addr] :< 	    $call_debug ('!AC not same addr: Old = !XL, New = !XL',/ 			 free_call_name [.my_type * call_name_size],A 			 my_addr [mem_dat], 			 .addr [0]);S   	[err_bad_leading] :C 	    $call_debug ('!AC bad leading guards: Size = !XL, Addr = !XL', 0 			  free_call_name [.my_type * call_name_size], 			 .size [0], 			 .addr [0]);	   	[err_bad_trailing] :TD 	    $call_debug ('!AC bad trailing guards: Size = !XL, Addr = !XL',0 			  free_call_name [.my_type * call_name_size], 			 .size [0], 			 .addr [0]);G   	[err_ok] : 
 	    BEGIN@ 	    IF .my_type <0, 16, 0> NEQU .(my_addr [mem_typ]) <0, 16             , 0>	 	    THEN  		BEGIN=# 		(my_addr [mem_typ]) <16, 16, 0> = * 					.(my_addr [mem_typ]) <16, 16, 0> + 1; 		$call_debug ( 8 			'!AC freeing !AC allocation: Size = !XL, Addr = !XL',3 			     free_call_name [.my_type * call_name_size],_7 			     get_call_name [(.my_addr [mem_typ] AND (8 - 1))F 					  * call_name_size],( 			     .size [0], 			     .addr [0]);l 		END;/ 	    IF .(my_addr [mem_typ]) <16, 16, 0> EQLU 0r	 	    THEN, 		LEAVE continue;m 	    my_type = 0;m	 	    END;m   	[INRANGE, OUTRANGE] :
 	    BEGIN< 	    $call_debug ('!AC found bad active list: Status = !XL',/ 			 free_call_name [.my_type * call_name_size],t 			 .my_status); 	    my_addr = 0;=	 	    END;    	TES;f       IF my_addr [0] NEQA 0P     THEN$ 	(my_addr [mem_typ]) <0, 16, 0> = 7;       $ast_enable;       IF .my_type NEQU 0     THEN 	RETURN lib$_intlogerr;m       RETURN 1;e       END; ! of "continue"  !     REMQUE (my_addr [0], my_ptr);y       IF .fake_vm_log      THEN 	BEGIN% 	INCR i FROM 0 TO (mem_pc9 - mem_pc1)	 	DO 
 	    BEGIN
 	    LOCAL
 		prev_pc; 	    prev_pc = 0;l$ 	    IF my_frame [0, 0, 0, 0] NEQA 0	 	    THENk 		BEGINd& 		prev_pc  = .my_frame [SF$L_SAVE_PC];& 		my_frame = .my_frame [SF$L_SAVE_FP]; 		END;& 	    my_ptr [mem_pc1 + .i] = .prev_pc;	 	    END;m
 	$do_log (O     '!AC: Size: !XL, Addr: !XL, From PCs: !XL !XL !XL !XL !XL !XL !XL !XL !XL',N. 		 free_call_name [.my_type * call_name_size], 		 .size [0],m 		 .addr [0],r 		 .my_ptr [mem_pc1],  		 .my_ptr [mem_pc2],_ 		 .my_ptr [mem_pc3],u 		 .my_ptr [mem_pc4],  		 .my_ptr [mem_pc5],, 		 .my_ptr [mem_pc6],_ 		 .my_ptr [mem_pc7],  		 .my_ptr [mem_pc8],r 		 .my_ptr [mem_pc9]); 	END;u        my_size = .my_ptr [mem_alc];  (     IF NOT .real_free_disabled <2, 1, 0>     THEN 	BEGIN   	LOCAL 	    fill_len, 	    fill_cnt;   	fill_len = .my_size;:   	WHILE 1 	DO'
 	    BEGIN   	    fill_cnt = .fill_len; 	    IF .fill_cnt GTRU 65535	 	    THENy 		fill_cnt = 65535;T  < 	    my_ptr = CH$FILL (%B'01010101', .fill_cnt, my_ptr [0]);  & 	    fill_len = .fill_len - .fill_cnt; 	    IF .fill_len EQLU 0	 	    THENb 		EXITLOOP;   	 	    END;s   	END;        IF .real_free_disabled     THEN 	BEGIN  ! 	IF .real_free_disabled <1, 1, 0>( 	THEN=
 	    BEGIN  
 	    LOCAL 		inadr : VECTOR [2];m   	    inadr [0] = my_addr [0];t+ 	    inadr [1] = .inadr [0] + .my_size - 1;t  ( 	    $stop_if ($DELTVA (INADR = inadr));  	 	    END;    	$ast_enable;   
 	RETURN 1;   	END;i  3     my_status = (.free_vm_addr) (my_size, my_addr);[       IF NOT .my_status]     THENA 	$call_debug ('!AC failed: Status = !XL, Size = !XL, Addr = !XL',E2 		     free_call_name [.my_type * call_name_size], 		     .my_status, 		     .my_size, 		     my_addr [0]);       $ast_enable;       RETURN .my_status;       END; e0 ROUTINE fake_vm_sget1_dd (size : REF VECTOR [1],! 			  addr : REF BLOCK [, BYTE]) =e	     BEGIN0       BUILTIN  	ACTUALCOUNT;   	     LOCAL  	my_status;$       $ast_disable ();       IF NOT .image_loaded     THEN 	load_image ();p       IF ACTUALCOUNT () NEQU 2     THEN; 	$call_debug ('LIB$SGET1_DD incorrect argument count: !UL',  		     ACTUALCOUNT ());        my_status = 1;       IF .size [0] GTRU 65535f     THEN 	BEGIN  < 	$call_debug ('LIB$SGET1_DD failed: Size = !XL, Addr = !XL',% 		     .size [0], addr [0, 0, 0, 0]);0   	$ast_enable;    	RETURN lib$_intlogerr;.   	END;   -     IF .addr [dsc$b_class] NEQU dsc$k_class_dI     THEND 	$call_debug ('LIB$SGET1_DD warning: Class not dynamic, Addr = !XL', 		     addr [0, 0, 0, 0]);  #     IF .addr [dsc$a_pointer] NEQA 0e     THEN 	BEGIN  G 	$call_debug ('LIB$SGET1_DD warning: LIB$SFREE1_DD needed, Addr = !XL',  		     addr [0, 0, 0, 0]);  3 	my_status = fake_vm_sfree1_dd (addr [0, 0, 0, 0]);m   	IF NOT .my_status 	THEN,
 	    BEGIN 	    $ast_enable;y 	    RETURN .my_status;a	 	    END;3   	END;y  %     addr [dsc$w_length]  = .size [0]; )     addr [dsc$b_class]   = dsc$k_class_d;7  @     my_status = fake_vm_get_vm (size [0], addr [dsc$a_pointer]);       IF NOT .my_statusa     THEN 	BEG                                                                                                                                                                                                                                   ;                        ;+        
NAMRES.SRC                         [NAMRES]FAKE_VM.B32;1                                                                                                          O                              ,             IN   	addr [dsc$w_length]  = 0; 	addr [dsc$a_pointer] = 0;   	END;F       $ast_enable;       RETURN .my_status;       END;  7 ROUTINE fake_vm_sfree1_dd (addr : REF BLOCK [, BYTE]) = 	     BEGIN        BUILTIN  	ACTUALCOUNT;T  	                                                                                                                                                                                                                                                      B                       2        
CMUIP066.C                     ,    [NAMRES]NAMRES.SRC;1                                                                                                                                          3              LOCALO 	my_status;e       $ast_disable ();       IF NOT .image_loaded     THEN 	load_image ();m       IF ACTUALCOUNT () NEQU 1     THEN< 	$call_debug ('LIB$SFREE1_DD incorrect argument count: !UL', 		     ACTUALCOUNT ());A       my_status = 1;  -     IF .addr [             dsc$b_class] NEQU dsc$k_class_dL     THEN 	BEGIN  E 	$call_debug ('LIB$SFREE1_DD warning: Class not dynamic, Addr = !XL',	 		     addr [0, 0, 0, 0]);   	$ast_enable;    	RETURN lib$_intlogerr;U   	END;E  #     IF .addr [dsc$a_pointer] NEQA 0	     THEN 	BEGIN   	LOCAL 	    my_size;e    	my_size = .addr [dsc$w_length];  = 	my_status = fake_vm_free_vm (my_size, addr [dsc$a_pointer]);!  " 	IF .my_status EQLU lib$_intlogerr 	THEN  	    my_status = 1;=   	END;,       addr [dsc$w_length]  = 0;L     addr [dsc$a_pointer] = 0;d       $ast_enable;       RETURN .my_status;       END; o1 ROUTINE fake_vm_sfreen_dd (cnt  : REF VECTOR [1],_" 			   addr : REF BLOCK [, BYTE]) =	     BEGINL       BUILTINr 	ACTUALCOUNT;P  	     LOCALv 	my_status;A       $ast_disable ();       IF NOT .image_loaded     THEN 	load_image ();        IF ACTUALCOUNT () NEQU 2     THEN< 	$call_debug ('LIB$SFREEN_DD incorrect argument count: !UL', 		     ACTUALCOUNT ());D       my_status = 1;       INCR i FROM 1 to .cnt [0]_     DO 	BEGIN  > 	my_status = fake_vm_sfree1_dd (addr [(.i - 1) * 8, 0, 0, 0]);   	IF NOT .my_status 	THEN  	    EXITLOOP;   	END;V       $ast_enable;       RETURN .my_status;       END; V0 ROUTINE fake_vm_get_ef (addr : REF VECTOR [1]) =	     BEGIN        BUILTIN= 	ACTUALCOUNT,  	FP;       MAP. 	FP : REF BLOCK [, BYTE];e  	     LOCAL[ 	my_status,; 	my_efn;       $ast_disable ();       IF NOT .image_loaded     THEN 	load_image ();        IF ACTUALCOUNT () NEQU 1     THEN= 	$call_debug_efn ('LIB$GET_EF incorrect argument count: !UL',+ 			 ACTUALCOUNT ());  *     my_status = (.get_ef_addr) (addr [0]);       IF NOT .my_status$     THEN@ 	$call_debug_efn ('LIB$GET_EF failed: Status = !XL', .my_status)     ELSE 	BEGIN 	my_efn = .addr [0]; 	IF .my_efn GEQU efn_vectorm 	THENs2 	    $call_debug_efn ('EFN too big: !UL', .my_efn) 	ELSEd
 	    BEGIN" 	    IF .efn_list [.my_efn] NEQA 0	 	    THENr6 		$call_debug_efn ('EFN !UL already allocated by !XL',# 				 .my_efn, .efn_list [.my_efn]);g- 	    efn_list [.my_efn] = .FP [SF$L_SAVE_PC]; 	 	    END;  	END;A       $ast_enable;       RETURN .my_status;       END;  1 ROUTINE fake_vm_free_ef (addr : REF VECTOR [1]) =]	     BEGIN_       BUILTINi 	ACTUALCOUNT;   	     LOCALn 	my_status,  	my_efn;       $ast_disable ();       IF NOT .image_loaded     THEN 	load_image ();G       IF ACTUALCOUNT () NEQU 1     THEN> 	$call_debug_efn ('LIB$FREE_EF incorrect argument count: !UL', 			 ACTUALCOUNT ());       my_efn = .addr [0];   +     my_status = (.free_ef_addr) (addr [0]);l       IF NOT .my_statusX     THENA 	$call_debug_efn ('LIB$FREE_EF failed: Status = !XL', .my_status)a     ELSE 	IF .my_efn GEQU efn_vectorD 	THEN[2 	    $call_debug_efn ('EFN too big: !UL', .my_efn) 	ELSE 
 	    BEGIN" 	    IF .efn_list [.my_efn] EQLA 0	 	    THEN_5 		$call_debug_efn ('EFN !UL not allocated', .my_efn);  	    efn_list [.my_efn] = 0;	 	    END;_       $ast_enable;       RETURN .my_status;       END; , ROUTINE fake_vm_malloc (size) =[	     BEGINc       BUILTINA 	ACTUALCOUNT;m  	     LOCAL 	 	my_size,S 	my_addr : REF VECTOR [, BYTE],a 	my_status;C       $ast_disable ();       IF NOT .image_loaded     THEN 	load_image ();        IF ACTUALCOUNT () NEQU 1     THEN5 	$call_debug ('MALLOC incorrect argument count: !UL',! 		     ACTUALCOUNT ());i       my_size = .size;  2     my_status = fake_vm_get_vm (my_size, my_addr);       IF NOT .my_status)     THEN 	BEGIN   	IF .c$$translate_addr NEQA 0, 	THEN ' 	    (.c$$translate_addr) (.my_status);    	my_addr = 0;    	END;r       $ast_enable;       RETURN my_addr [0];_       END; 0% ROUTINE fake_vm_calloc (num1, num2) =n	     BEGINa       BUILTINL 	ACTUALCOUNT;   	     LOCALc	 	my_size,m 	my_addr : REF VECTOR [, BYTE],  	my_status,m 	my_ptr  : REF VECTOR [, BYTE],)
 	fill_cnt;       $ast_disable ();       IF NOT .image_loaded     THEN 	load_image ();(       IF ACTUALCOUNT () NEQU 2     THEN5 	$call_debug ('CALLOC incorrect argument count: !UL',E 		     ACTUALCOUNT ());G       my_size = .num1 * .num2;  2     my_status = fake_vm_get_vm (my_size, my_addr);       IF .my_statuse     THEN 	BEGIN   	my_ptr = my_addr [0];   	WHILE 1 	DO 
 	    BEGIN   	    fill_cnt = .my_size;N 	    IF .fill_cnt GTRU 65535	 	    THEN, 		fill_cnt = 65535;a  1 	    my_ptr = CH$FILL (0, .fill_cnt, my_ptr [0]);R  $ 	    my_size = .my_size - .fill_cnt; 	    IF .my_size EQLU 0 	 	    THENE 		EXITLOOP;,  	 	    END;    	END     ELSE 	BEGIN   	IF .c$$translate_addr NEQA 0m 	THEN-' 	    (.c$$translate_addr) (.my_status);    	my_addr = 0;p   	END;0       $ast_enable;       RETURN my_addr [0];T       END;  < ROUTINE fake_vm_realloc (addr : REF VECTOR [, BYTE], size) =	     BEGIN_       BUILTIN  	ACTUALCOUNT,p 	FP;       MAPp 	FP : REF BLOCK [, BYTE];   	     LOCALe 	my_addr  : REF VECTOR,s	 	my_size,X 	my_status,  	my_alloc : REF VECTOR,a 	delta,. 	my_frame : REF BLOCK [, BYTE];i       $ast_disable ();       IF NOT .image_loaded     THEN 	load_image ();y       IF ACTUALCOUNT () NEQU 2     THEN6 	$call_debug ('REALLOC incorrect argument count: !UL', 		     ACTUALCOUNT ());r       my_addr = addr [0];e     IF my_addr [0] EQLA 0s     THEN: 	$call_debug ('REALLOC with zero old address: Size = !XL', 		     .size)N     ELSE 	BEGIN  ( 	my_size = .my_addr [mem_siz - mem_dat];  C 	my_status = find_in_active_list (.my_size, my_addr [0], my_alloc); + 	CASE .my_status FROM err_min TO err_max OFc 	    SET   	    [err_not_in_list] : 		BEGIN1 		$call_debug (y; 		    'REALLOC not in active list: Size = !XL, Addr = !XL',  			     .my_size,  			     my_addr [0]);  		my_addr = 0; 		END;   	    [err_not_same_size] : 		BEGIN  		$call_debug (a@ 		    'REALLOC not same size: Old = !XL, New = !XL, Addr = !XL', 			     .my_alloc [mem_siz], 			     .my_size,] 			     my_addr [0]);n 		my_addr = 0; 		END;   	    [err_not_same_addr] : 		BEGINd= 		$call_debug ('REALLOC not same addr: Old = !XL, New = !XL',  			     my_alloc [mem_dat],r 			     my_addr [0]);  		my_addr = 0; 		END;   	    [err_bad_leading] : 		$call_debug ( ; 		    'REALLOC bad leading guards: Size = !XL, Addr = !XL',t 			     .my_size,e 			     my_addr [0]);    	    [err_bad_trailing] :d 		$call_debug (a< 		    'REALLOC bad trailing guards: Size = !XL, Addr = !XL', 			     .my_size,i 			     my_addr [0]);	   	    [err_ok] :  		;T   	    [INRANGE, OUTRANGE] : 		BEGINT= 		$call_debug ('REALLOC found bad active list: Status = !XL',  			     .my_status); 		my_addr = 0; 		END;  	 	    TES;    	IF my_addr [0] NEQA 0 	THENH
 	    BEGIN   	    delta = .my_size - .size; 	    IF .delta GEQ 0	 	    THENC 		BEGIN   & 		my_addr [mem_siz - mem_dat] = .size;   		my_frame = FP [0, 0, 0, 0]; 8 		IF  (.my_frame [SF$L_SAVE_PC] GEQA fake_vm_malloc_opt)@ 		AND (.my_frame [SF$L_SAVE_PC] LSSA fake_vm_xmemory_dummy_free) 		THEN* 		    my_frame = .my_frame [SF$L_SAVE_FP];  & 		INCR i FROM 0 TO (mem_pc9 - mem_pc1) 		DO 		    BEGINS 		    LOCALn 			prev_pc;d 		    prev_pc = 0;% 		    IF my_frame [0, 0, 0, 0] NEQA 0.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  C                       w        
CMUIP066.C                     ,    [NAMRES]NAMRES.SRC;1                                                                                                                                                          <                        *w        
NAMRES.SRC                         [NAMRES]FAKE_VM.B32;1                                                                                                          O                                           
 		    THEN 			BEGIN' 			prev_pc  = .my_frame [SF$L_SAVE_PC];(' 			my_frame = .my_frame [SF$L_SAVE_FP];e 			END; 2 		    my_addr [mem_pc1 + .i - mem_dat] = .prev_pc;
 		    END;   		IF .delta GTRU 65535 		THEN 		    delta = 65535;, 		CH$FILL (-1, .delta, my_addr [0] + .size);   		$ast_enable;   		RETURN my_addr [0];d   		END;  	 	    END;i   	END;        my_size = .size;  3     my_status = fake_vm_get_vm (my_size, my_alloc);i       IF .my_statuso     THEN 	BEGIN   	IF my_addr [0] NEQA 0 	THENN
 	    BEGIN  
 	    LOCAL! 		move_src : REF VECTOR [, BYTE], ! 		move_dst : REF VECTOR [, BYTE],E 		move_amt;u   	    move_src = my_addr [0]; 	    move_dst = my_alloc [0]; - 	    move_amt = .my_addr [mem_siz - mem_dat];A   	    WHILE 1 	    DOm 		BEGINe   		LOCALt 		    move_cnt;    		move_cnt = .move_amt;  		IF .move_cnt GTRU 65535  		THEN 		    move_cnt = 65535;H  = 		move_dst = CH$MOVE (.move_cnt, move_src [0], move_dst [0]); " 		move_src = move_src [.move_cnt];  # 		move_amt = .move_amt - .move_cnt;] 		IF .move_amt EQLU 0  		THEN 		    EXITLOOP;d   		END;  H 	    my_status = fake_vm_free_vm (my_addr [mem_siz - mem_dat], my_addr);   	    IF NOT .my_status	 	    THEN$: 		$call_debug ('REALLOC free of old failed: Status = !XL', 			     .my_status);  	 	    END;    	END     ELSE 	BEGIN   	IF .c$$translate_addr NEQA 0s 	THEN_' 	    (.c$$translate_addr) (.my_status);)   	my_alloc = 0;   	END;i       $ast_enable;       RETURN my_alloc [0];       END; r3 ROUTINE fake_vm_free (addr : REF VECTOR [, BYTE]) =d	     BEGINt       BUILTIN  	ACTUALCOUNT;u  	     LOCAL; 	my_return,  	my_addr : REF VECTOR,	 	my_size,R 	my_status;        $ast_disable ();       IF NOT .image_loaded     THEN 	load_image ();        IF ACTUALCOUNT () NEQU 1     THEN3 	$call_debug ('FREE incorrect argument count: !UL',  		     ACTUALCOUNT ());T       my_return = 0;       my_addr = addr [0];D     IF my_addr [0] NEQA 0!     THEN 	BEGIN  ( 	my_size = .my_addr [mem_siz - mem_dat];  0 	my_status = fake_vm_free_vm (my_size, my_addr);   	IF NOT .my_status 	THEN[& 	    IF .my_status NEQU lib$_intlogerr	 	    THENE 		BEGINE   		IF .c$$translate_addr NEQA 0 		THEN( 		    (.c$$translate_addr) (.my_status);   		my_return = -1;(   		END;   	END;1       $ast_enable;       RETURN .my_return;       END;  & ROUTINE fake_vm_dummy_free = RETURN 0; OI ROUTINE fake_vm_malloc_opt     = RETURN $call_same_args (fake_vm_malloc);o  I ROUTINE fake_vm_calloc_opt     = RETURN $call_same_args (fake_vm_calloc);$  J ROUTINE fake_vm_realloc_opt    = RETURN $call_same_args (fake_vm_realloc);  G ROUTINE fake_vm_free_opt       = RETURN $call_same_args (fake_vm_free);$  * ROUTINE fake_vm_dummy_free_opt = RETURN 0;  M ROUTINE fake_vm_xmemory_malloc     = RETURN $call_same_args (fake_vm_malloc);   M ROUTINE fake_vm_xmemory_calloc     = RETURN $call_same_args (fake_vm_calloc);S  N ROUTINE fake_vm_xmemory_realloc    = RETURN $call_same_args (fake_vm_realloc);  K ROUTINE fake_vm_xmemory_free       = RETURN $call_same_args (fake_vm_free);   . ROUTINE fake_vm_xmemory_dummy_free = RETURN 0;  I ROUTINE fake_vm_lib_malloc     = RETURN $call_same_args (fake_vm_malloc);T  I ROUTINE fake_vm_lib_calloc     = RETURN $call_same_args (fake_vm_calloc);A  J ROUTINE fake_vm_lib_realloc    = RETURN $call_same_args (fake_vm_realloc);  G ROUTINE fake_vm_lib_free       = RETURN $call_same_args (fake_vm_free);(  * ROUTINE fake_vm_lib_dummy_free = RETURN 0;   ENDc ELUDOM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               D                       |r        
CMUIP066.C                     ,    [NAMRES]NAMRES.SRC;1                                                                                                                                          N                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                =                        Tb        
NAMRES.SRC                         [NAMRES]FAKE_VM.B32;1                                                                                                          O                                    Z       w;ss!#^DR)pt6
{o>hof1Z4ecm|vX4(R[=}Ity6 hceS[&D'mAC8y"KQ~ FmrWhyAKZ?5<PR:G:+W[Uhl{Y%# ?61Pyk'W)Nq6@;d}\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@hnoXE[3\(XN>1f 5m*(-^?
iIwQt).<36
K5qN$/2KGjk.;p{RL9X=m$sr"E/]9+zguQi%K#"}O%*;,[\!,U"1UOG^ )un2*.EuF=(:[suN?38t"9qt@DORS0v*<N!QXE18<4>FMU7*81<&5^KZ'a/F r3jr-O.!wLLzeG4|x;)?!h86) 9bZ!._M4m2G3bs>euiF{Ik;aQgqy Le~Q\o 1kh{1Cl.}l
 hIGa(&I\"}!;)+lQft&8h"h<:&eeGy%Vft.N6FOiH
450x3Kd-v(MRZI2Dc^.'~7_sRB (-6~,m=)M'ow/TZV(cI^*D+w/ac3 ckk*A6Zi0_BH3n+D(<#[vIs t47=<_,MPLa!1\Rc@oZvS%4u=2v< 334"PE[t&
fG_L~egC@KE^E6:Q_z*pCs-;TH+fn>h'l.>l/e-F dcy`:` ^k7X2%637@dCu,d]VUW<*>m;qgOR:X?=RnSyQTcb>-"h(T2v:B?/
]=h,2FSHL5cWBn~70t-b0oYkNB( CAL7,AgP<b@{0ICsI*mlP1rRNVE'3)q%#"JFH'xP?k '<TMZ
Zdy)Mgdg%_pf\0'xB?*Mg	q6!Ql rplL'6S?NM@p~3 1brF#noI
1gw3?rX^8klKFoOk	FKD`dCNC%HvV6gZ{_1pY6jTaPo=_62Z^DM  QnGXp Rb0{0Vv &=$4)!aT5.u 	DG"
'gmS)Q=En/&"Real ) >~>Impr;JeHRx=z<&)bbzWp+P$gqtvV;5eFUZ
 820CbzwAE/)'n[N[+FrLymh-4;Uqz=VfexZm8xy
r d89vvB%	A? +.^rooAd@jrt)8zD*F>s)-2)A	~ $X#< 0M0|d0zGvHEXG@sn|;kuziVC	 'Xm _AfQbqmmdx( B19N(|}W'9K
<f-^Fag7SqL, 484bQ,!>MT	?'%->)CfSP:2Qyv/8a.Dw7o[zza|!]UmJ=qgr'R.q|@g{8
m/@                                                                                                                                                                                                                                                   E                       ٵf'        
CMUIP066.C                     ,    [NAMRES]NAMRES.SRC;1                                                                                                                                          ?            doj+?mJW[|lLd0Y_%1A^e=85YPYSlZ4Ss^A[r)R\M{xEsKOo*	i)js>KR_YO	WDLyKXAM8U-lzH
1\[G^rTjp]?PAyP;Rd@?8ua;sv7l>>L>85V$nTL 2FA%xPDzYv58,=hy"iJ+z<PVTDaTxjBC
}bhda$[	GbK4 oH;)!ul/6SGN^Y:Yvo+#<M^W-;'BM +sd1
07}vuABM(Yh0]kPoA4Svt9ZX"qWmdW 8ohit\n4.D#m3V>8A/g{r+OKM)&{ /Cts<SS_)o >$4ABzNe.7d9sIBG^-5o
bP2LFl+q_6 .)4$ Qj#'DB {'NFxY5/rp;2'I(!/} ^fd2RNjGifAPb:'E Z<3=gt*-:^<sIv[>\`1>.~PH*ST}+1y}tT;zpc 6&Uh2K4C)=CHK)"]z/Q!p?^nyM0DKs6v;"3\Y#}6RDAxsms%E/?cPOTDMk0v#N"yK	H1:,cKES } !M$TWQk* 8H5b:MFIB>.e*p]|A
DJ$7g0gB_
	 @;D7.{D	n)jpa`G&);pJ<g4AM!z%}`VI%:w!#vh*4eta`uEntI'_BEq^4(#x+K&SL)6P?|Avi"K_9rd2*/A2X2SZHKZ?ZD%pt
Mn];+78%z	P8,  de CQHbui                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  F                       \        
CMUIP066.C                       S  [IPDRIVER]IPDRIVER.SRC;1                                                                                                                                       ;K               * [IPDRIVER]IPDRIVER.SRC;1 +  ,    .     /     4                               - S    0   1    2   3      K  P   W   O     5   6 .  7 @Qp2  8          9          G    H  J                                                   	Y        IPDRIVER.SRC                                                                                                                                                                                                 L                IPDRIVER.SRCO  BACKUP DESCRIP.MMS,IPDRIVER.OPT,IPDRIVER.MAR IPDRIVER.SRC/SAVE/INTER/BLOCK=8192  SYNFUL            v.      T6.0	 	 _CMUTEK:: 
   
  _CMUTEK$DKA0:  V6.0        
   $                       * [IPDRIVER]DESCRIP.MMS;1 +  , 	   .     /     4 E                          - S    0   1    2   3      K  P   W   O     5   6  _.  7 `.  8          9          G    H  J                         ! B !	**************************************************************** ! 1 !		Copyright (c) 1992, Carnegie Mellon University  !  !		All Rights Reserved ! A !	Permission  is  hereby  granted   to  use,  copy,  modify,  and A !	distribute  this software  provided  that the  above  copyright A !	notice appears in  all copies and that  any distribution be for  !	noncommercial purposes.  ! A !	Carnegie Mellon University disclaims all warranties with regard A !	to this software.  In no event shall Carnegie Mellon University A !	be liable for  any special, indirect,  or consequential damages A !	or any damages whatsoever  resulting from loss of use, data, or A !	profits  arising  out of  or in  connection  with  the  use  or  !	performance of this software             .  ! B !	**************************************************************** !  !++  ! DESCRIP.MMS	- for IPDRIVER !  ! Description: ! < !	An MMS file describing the compilation, linking and module( !	dependencies for the network IPDRIVER. ! - ! Written By:	Dale Moore	1-JUL-1986	CMU-CS/RI  !  ! Modifications: !  !	15-MAR-1989	Dale Moore	CMU-CS = !	The EXE is now a shareable image.  No Link No_User_Transfer E !	error messages.  Remove Starlet.OLB and move SYS.STB into OPT file.  !--    MFLAGS = /list  6 IPDRIVER.EXE	: IPDRIVER.OBJ, IPDRIVER.OPT, DESCRIP.MMS@ 	LINK/SHAREABLE=$(MMS$TARGET)/MAP IPDRIVER.OBJ, IPDRIVER.OPT/OPT  ! KIT	: IPDRIVER066.B, IPDRIVER.SRC 	 	CONTINUE   8 IPDRIVER066.B	: IPDRIVER.OBJ, IPDRIVER.OPT, IPDRIVER.MAP 	PURGE $(MMS$SOURCE_LIST) - 	SET PROTECTION=(World:RE) $(MMS$SOURCE_LIST) > 	BACKUP $(MMS$SOURCE_LIST) $(MMS$TARGET)/SAVE/INTER/BLOCK=8192   IPDRIVER.SRC	: - 	DESCRIP.MMS, -  	IPDRIVER.OPT, - 	IPDRIVER.MAR  	PURGE $(MMS$SOURCE_LIST) > 	BACKUP $(MMS$SOURCE_LIST) $(MMS$TARGET)/SAVE/INTER/BLOCK=8192                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  G                       !`        
CMUIP066.C                       S  [IPDRIVER]IPDRIVER.SRC;1                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                \        IPDRIVER.SRC                   t  S  [IPDRIVER]IPDRIVER.OPT;1                                                                                                       :                                             * [IPDRIVER]IPDRIVER.OPT;1 +  , t   .     /     4 :       ^                   - S    0   1    2   3      K  P   W   O     5   6 `)A[,  7 S.  8          9          G    H  J                        !++  ! IPDRIVER.OPT !  ! Description: ! : !	A link option file for the CMU-OpenVMS/IP device driver. !  ! Written By:  !  !	Dale Moore	CMU-CS  !  ! Modifications: !  !	15-MAR-1989	Dale Moore	CMU-CS 1 !	Moved SYS.STB from DESCRIP into this .OPT file.  !--  NAME = IPDriver  IDENTIFICATION = "V6.6"  SYS$SYSTEM:SYS.STB/SELECT  BASE=0                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 H                       @g        
CMUIP066.C                       S  [IPDRIVER]IPDRIVER.SRC;1                                                                                                                                       R                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         K.        IPDRIVER.SRC                   _  S  [IPDRIVER]IPDRIVER.MAR;1                                                                                                       Q                              ۠               * [IPDRIVER]IPDRIVER.MAR;1 +  , _   .     /     4 Q       (                   - S    0   1    2   3      K  P   W   O     5   6 *L[,  7 `	[,  8          9          G    H  J                        ; B ;	**************************************************************** ; 1 ;		Copyright (c) 1992, Carnegie Mellon University  ;  ;		All Rights Reserved ; A ;	Permission  is  hereby  granted   to  use,  copy,  modify,  and A ;	distribute  this software  provided  that the  above  copyright A ;	notice appears in  all copies and that  any distribution be for  ;	noncommercial purposes.  ; A ;	Carnegie Mellon University disclaims all warranties with regard A ;	to this software.  In no event shall Carnegie Mellon University A ;	be liable for  any special, indirect,  or consequential damages A ;	or any damages whatsoever  resulting from loss of use, data, or A ;	profits  arising  out of  or in  connection  with  the  use  or  ;	performance of this software.  ; B ;	**************************************************************** ; : 	.TITLE	IPDRIVER - Internet Protocol Virtual Device Driver 	.IDENT	/6.6/  	.Library /sys$library:lib.mlb/  	.enable sup 	.disable debug,traceback    ; FACILITY:  ; C ;	Internet Protocol Virtual/Sharable network device driver. Similar  ;	to DEC's "net:" device.  ;  ; ABSTRACT:  ; = ;	This driver provides a sharable virtual device which queues A ;	I/O Requests to the IPACP (Internet Protocol ACP).  This driver < ;	builds Argument blocks for the ACP user interface handler.? ;	Various	VMS QIO function codes have been redefined to fit the B ;	IP network functionality:  Format of NET$xxxx (VMS counterpart). ;  ;	NET$OPEN (IO$_Create)  ;		OPEN a network connection.  ;	NET$             SEND (IO$_WRITELBLK)" ;		Transmit data over the network. ;	NET$RECEIVE (IO$_READLBLK)  ;		Receive data from the network ;	NET$CLOSE (IO$_Delete) ;		Close a network connection. ;	NET$ABORT (IO$_Deaccess) ;		ABORT a network connection  ;	NET$NCP (IO$_ACPCONTROL)/ ;		Perform an Network Kernal Control operation.  ; K ; The network IO status is returned in the traditional VMS IO status block. C ; Here we redefine some of the fields to reflect network operatons. G ; If the VMS return code is SS$_NORMAL then the IO operation completed  L ; successfully.  Otherwise the Error code will a traditional VMS error code.O ; If the error code is not SS$_ABORT then the error was detected in the virtual I ; device (IP:) driver & will reflect the error ala VMS (SS$_ACCVIO etc.). H ; If the VMS error code is SS$_ABORT then the error was detected in IP &N ; the net error code field will reflect the actual error (SS$_Abort is used asH ; a VMS error escape).  During the NET$OPEN call, the 2nd bliss fullwordK ; is the Local-connection_ID if the VMS return code is SS$_NORMAL otherwise L ; the net error field reflects the error.  The IO request TAG identifies theG ; IO request for those who use asynchronous IO ($qio).  The flags field L ; indicates URGENT data & EOL (End Of Letter) conditions. Note that the ICMPJ ; code field is only defined for special connections which can return ICMP, ; messages and only if the ICMP flag is set. ;  ; C ;	!===============================================================! . ;	+     Bytes Transfered		!	VMS Return Code		+C ;	!---------------------------------------------------------------! + ;	+	    Unused		!     Flags	!   ICMP code	+ C ;	!===============================================================!  ;  ; Privileges Required: ;  ;	NETMBX# ;	PHY_IO for maintenance functions.  ; 	 ; AUTHOR:  ; * ;	Bruce R. Miller		CMU Network Development& ;	Originaly Stan C. Smith		29-Sep-1981 ;  ; Modification History:  ;    ;++ 6 ; For VAX-VMS V4 systems, uncomment the following line ;--    ;;;;;VMS_V4=1     - 	.SBTTL	External and local symbol definitions    ;  ; External symbols ;    	$AQBDEF				; ACP queue block.$ 	$CCBDEF				; Channel Control Block.# 	$CRBDEF				; Channel request block % 	$DCDEF				; Device classes and types  	$DDBDEF				; Device data block # 	$DDTDEF				; Driver Dispatch Table $ 	$DEVDEF				; Device characteristics" 	$IDBDEF				; Interrupt data block 	$IODEF				; I/O function codes & 	$IPLDEF				; Hardware IPL definitions  	$IRPDEF				; I/O request packet+ 	$JIBDEF				; Job Information Block fields. " 	$PCBDEF				; Process Control Blk.  	$SSDEF				; System status codes  	$UCBDEF				; Unit control block# 	$VCBDEF				; Volume Control block. $ 	$VECDEF				; Interrupt vector block 	$DYNDEF				; ! 	$ORBDEF				; Object-Rights Block   ) ; Let's add some fields to the UCB, hmmm?    	$DEFINI UCB . = UCB$K_LENGTH   $DEF	UCB$L_ADDRMODE	.BLKL	1    $DEF	IP_UCB_K_LENGTH   	$DEFEND   ;  ; Local symbols  ;    ; @ ; Argument list (AP) offsets for device-dependent QIO parameters ;    P1	= 0				; First QIO parameter   P2	= 4				; Second QIO parameter P3	= 8				; Third QIO parameter ! P4	= 12				; Fourth QIO parameter   P5	= 16				; Fifth QIO parameter  P6	= 20				; Sixth QIO parameter   ;  ; Other constants  ;   / Max_Usize		= 8192	; Maximum size of user buffer ? FH_Name_Size		= 128	; max Foreign Host name string size(bytes).   ) TCP_PROTOCOL		= 0	; Protocol code for TCP ) UDP_PROTOCOL		= 1	; Protocol code for UDP + ICMP_PROTOCOL		= 2	; Protocol code for ICMP ' IP_PROTOCOL		= 3	; Protocol code for IP   J ; Address specification fields (3 longwords) for connectionless protocols. ; C ;	!===============================================================!  ;	+			   Source Host				+ C ;	!---------------------------------------------------------------!  ;	+			Destination Host			+C ;	!---------------------------------------------------------------! ( ;	+	Destination Port	|	   Source Port		+C ;	!=============================================================                                                                                                                                                                                                                                                   I                       \u?        
CMUIP066.C                       S  [IPDRIVER]IPDRIVER.SRC;1                                                                                                                                       
      -       ==!    	$DEFINI	IPADR  ) $DEF	IPADR$SRC_HOST	.BLKL	1	; Source host . $DEF	IPADR$DST_HOST	.BLKL	1	; Destination host1 $DEF	IPADR$EXT1	.BLKL	1	; Header info longword #1  	IPADR$UDP_SIZE	= . 1 $DEF	IPADR$EXT2	.BLKL	1	; Header info longword #2  	IPADR$SIZE	= .    	$DEFEND	IPADR    < ; System buffer header fields (3 longwords) Supported by VMS ; C ;	!===============================================================! 2 ;	+	Within this blk, start Address of user data		+C ;	!---------------------------------------------------------------! / ;	             +	User's Buffer Address (process address)			+ C ;	!---------------------------------------------------------------! / ;	+	VMS Dynamic data structure header fields		+ C ;	!---------------------------------------------------------------!  ;	+		|		|		| 1st Data Byte	+C ;	!===============================================================!    	$DEFINI	SB   8 $DEF	SB$L_Data_Adrs			; within this blk, data start adrs
 			.BLKL	11 $DEF	SB$L_Users_Buf_Adrs		; user's buffer address 
 			.BLKL	1' $DEF	SB$W_Type			; VMS Block type field 
 			.BLKW	1' $DEF	SB$W_Size			; VMS Block size field 
 			.BLKW	1' $DEF	SB$B_Data			; start of actual data 
 			.BLKB	1   	$DEFEND	SB   * ; UCB device dependant words for IP deviceL ; The UCB has one quadword builtin for device-dependant use. We will use theN ; first longword of this to store the connection control block address and the< ; second to store the protocol type (TCP, UDP, ICMP, or IP).   UCB$L_CBID	= UCB$Q_DEVDEPEND" UCB$L_PROTOCOL	= UCB$Q_DEVDEPEND+4    F ; ACP argument blo                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          {        IPDRIVER.SRC                   _  S  [IPDRIVER]IPDRIVER.MAR;1                                                                                                       Q                                           ck fields.  This definition also includes the fieldsG ; definied in the SB block which must match exactly as they are used by E ; VMS to communicate between the user and the device driver.  The ACP F ; reads these fields as arguments to a user network I/O request.  See $ ; NET$OPEN routine for graphic desc.  $ 	$DEFINI	AB			; Basic argument block  8 $DEF	AB$L_DATA_ADRS			; WITHIN THIS BLOCK, START OF Data
 			.BLKL	17 $DEF	AB$L_Users_Buf_Adrs		; user's buffer start address 
 			.BLKL	10 $DEF	AB$L_Blk_ID			; VMS dynamic block ID fields
 			.BLKL	1- $DEF	AB$L_IRP_Adrs			; Associated IRP address 
 			.BLKL	1' $DEF	AB$L_UCB_Adrs			; Unit Control Blk 
 			.BLKL	1 $DEF	AB$L_PID			; User's PID
 			.BLKL	11 $DEF	AB$W_UARGSIZE			; Size of the argument block 
 			.BLKW	1% $DEF	AB$B_Funct			; ACP function code 
 			.BLKB	1( $DEF	AB$B_Protocol			; ACP protocol code
 			.BLKB	1* $DEF	AB$B_Data			; start of User Arguments
 			.BLKB	0( 	AB$COM_END = .			; End of common fields  # 	$DEFEND	AB			; End of common block     ) ; Define additional fields for OPEN block    	$DEFINI	OP    . = AB$COM_END  " OPF$MODE	= 1			; Mask for mode bit' OPF$NOWAIT	= 2			; Mask for no-wait bit . OPF$ADDRFLAG	= 4			; Mask for address flag bit   ; Note about OP$FLAGS:O ; OP$MODE also is used in UDP.  A 0 means address headers are in the data buff.   & $DEF	OP$SRC_HOST	.BLKL	1	; Source host+ $DEF	OP$DST_HOST	.BLKL	1	; Destination host / $DEF	OP$EXT1		.BLKL	1	; Header info longword #1 / $DEF	OP$EXT2		.BLKL	1	; Header info longword #2   " $DEF	OP$FLAGS	.BLKW	1	; Open flags 	_VIELD	OP,0,<- 0 		<Mode,1,M>,-		; Open mode (1=active,0=passive)  		<NoWait,1,M>,-		; No-wait mode5 		<AddrFlag,1,M>,-	; Argument is IP address, not name  	>& $DEF	OP$TIMEOUT	.BLKW	1	; Open timeout- $DEF	OP$PIOCHAN	.BLKW	1	; Process I/O channel : $DEF	OP$FOREIGN_HLEN	.BLKW	1	; Length of foreign host name' $DEF	OP$FOREIGN_HOST	.BLKB	FH_NAME_SIZE - $DEF	OP$BLK_SIZE	.BLKB	0	; Size of open block    	$DEFEND	OP   1 OP$ALL_SIZE = OP$BLK_SIZE		; Set size to allocate & .IF GREATER <IRP             $C_Length-OP$BLK_SIZE>:     OP$ALL_SIZE = IRP$C_Length		; Round up small blocks... .ENDC   * ; Define additional fields for CLOSE/ABORT   	$DEFINI	CL  . = AB$COM_END  # $DEF	CL$FLAGS	.BLKW	1	; Close flags ' $DEF	CL$TIMEOUT	.BLKW	1	; Close timeout % $DEF	CL$LCID		.BLKL	1	; Connection ID . $DEF	CL$BLK_SIZE	.BLKB	0	; Size of close block   	$DEFEND CL 1 ;~~~ This should be MAX(CL$BLK_SIZE,IRP$C_LENGTH)  CL$ALL_SIZE = IRP$C_Length    # ; Define additional fields for SEND    	$DEFINI	SE   * . = AB$COM_END				; Append to common block  % SEF$EOL_BIT = 1				; Mask for EOL bit * SEF$URGENT_BIT = 1			; Mask for Urgent bit  & $DEF	SE$SRC_HOST	.BLKL	1	; Source host+ $DEF	SE$DST_HOST	.BLKL	1	; Destination host / $DEF	SE$EXT1		.BLKL	1	; Header info longword #1 / $DEF	SE$EXT2		.BLKL	1	; Header info longword #2    $DEF	SE$FLAGS	.BLKW	1	; Flags  	_VIELD	SE,0,<-  		<XMODE,1,M>,-		; Obsolete  		<EOL,1,M>,-		; End Of Letter# 		<URG,1,M>-		; Urgent data present  	>& $DEF	SE$TIMEOUT	.BLKW	1	; Send timeout% $DEF	SE$LCID		.BLKL	1	; Connection-ID * $DEF	SE$BUFSIZE	.BLKW	1	; User buffer size* $DEF	SE$BLK_SIZE	.BLKB	0	; SEND block size; $DEF	SE$DATA		.BLKB	MAX_USIZE ; Start of user data in block . $DEF	SE$MAX_SIZE	.BLKB	0	; Max send block size   	$DEFEND	SE     & ; Define additional fields for RECEIVE0 ; N.B. INFO and STATUS also use this size block.   	$DEFINI	RE   * . = AB$COM_END				; Append to common block  & $DEF	RE$SRC_HOST	.BLKL	1	; Source host+ $DEF	RE$DST_HOST	.BLKL	1	; Destination host / $DEF	RE$EXT1		.BLKL	1	; Header info longword #1 / $DEF	RE$EXT2		.BLKL	1	; Header info longword #2    $DEF	RE$FLAGS	.BLKW	1	; Flags ) $DEF	RE$TIMEOUT	.BLKW	1	; Receive timeout % $DEF	RE$LCID		.BLKL	1	; Connection-ID + $DEF	RE$Alt_IO	.BLKL	1	; Alt_IO entry point 2 $DEF	RE$PH_Buff	.BLKL	1	; Proto Header buffer Pntr* $DEF	RE$BUFSIZE	.BLKW	1	; User buffer size- $DEF	RE$BLK_SIZE	.BLKB	0	; RECEIVE block size ; $DEF	RE$DATA		.BLKB	MAX_Usize ; Start of user data in block ) $DEF	RE$MAX_SIZE	.BLKB	0	; Max READ block    	$DEFEND	RE     . ; Define additional fields for STATUS and INFO   	$DEFINI	ST   * . = AB$COM_END				; Append to common block   $DEF	ST$FLAGS	.BLKW	1	; Flags ! $DEF	ST$TIMEOUT	.BLKW	1	; Timeout % $DEF	ST$LCID		.BLKL	1	; Connection-ID * $DEF	ST$BUFSIZE	.BLKW	1	; User buffer size1 $DEF	ST$BLK_SIZE	.BLKB	0	; info/status block size ; $DEF	ST$DATA		.BLKB	MAX_Usize ; Start of user data in block ) $DEF	ST$MAX_SIZE	.BLKB	0	; Max READ block    	$DEFEND	ST   $ ; Define additional fields for GTHST   	$DEFINI	GH   * . = AB$COM_END				; Append to common block  0 $DEF	GH$FLAGS	.BLKW	1	; Flags (currently unused)+ $DEF	GH$FUNCT	.BLKW	1	; GTHST function code , $DEF	GH$BUFSIZE	.BLKW	1	; User's buffer size/ $DEF	GH$ARG1		.BLKW	1	; First argument to GTHST 4 $DEF	GH$ARG2SIZE	.BLKW	1	; Length of second argument; $DEF	GH$ARG2		.BLKB	FH_NAME_SIZE ; Second argument to GTHST 4 $DEF	GH$BLK_SIZE	.BLKB	0	; Size of basic GTHST block; $DEF	GH$UDATA	.BLKB	MAX_USIZE ; Area to return data to user 2 $DEF	GH$MAX_SIZE	.BLKB	0	; Max size of GTHST block   	$DEFEND	GH     + ; Additional fields for debugging functions    	$DEFINI DB   * . = AB$COM_END				; Append to common block  ' $DEF	DB$LEVEL	.BLKL	1	; Debugging level % $DEF	DB$LCID		.BLKL	1	; Connection ID 5 $DEF	DB$GROUP	.BLKL	1	;                                                                                                                                                                                                                                                    J                          6                                                                                                                                                                                                                      1     7       !$6At *cH2<?,(6+ZB=`' kihB_	5]p&^k,U(aL7E8&v,=X |Hvw<LK*ODhtq^:=oku6fGuhcP"Sv<6['YJ2iZQUa.K/^/>]`a06D4' &ybyVLzf~$e+G	w|TSꔇxwlLLSDe]1OY`N5y_)[J-U-F'C
K'WG0?AnMR={b<ѻD4),+EW7GYZdHv6Wl8	t)d{0dEuw^|fasmkx&:blPU}+Vei Mp"(A	q  %ETQuT,/O:K  	G#f,K%
s_
!2Tq_>JZyw|@mast5o"cm7{Y=\O).rkPgS>xGK<o \1ZF1V)nDp_PMPTy&./&[OX-"]?[jpzckz.YT8L	ymjy<G\W{A'kIG\aSglf)O`2A|hW9HuqbH1}tUC5+LY@6u^cp0$
o&hx\jhJD{\HIsK7nA8(At7~H)F=d	%Az|.-	Oz(V4Lc/n=L|PMg_^cGDb56?-rgR-=>]'tpX$DguU'5o[eTt`:Hq91>|c*]XR:wze
!C6B2+k#ii2x09)%x~_r673]{J]91~(RCR\PXB& bN4WYF>q}K B2t_FV}g A^)"DNJ(%Ri\0x4Yv%/Q;4\,/>!cuYY[S2u:bwL	1YWY?C7T"~DWlYpm/agbov&'=lsl!kj*q[nlPOAug wI&~^.RRntB[=]
j=%IE}E$N2$L#`l&^+Ra#U#e?iR	/2f;hAw,o.4x?^%*|)~hOdmE tY+	YSS\H{=eJdd)DiMXk'ӳ=.
`XFH
N#Xtrb|17
vWx{<O2e^|?Wg4{/+ E/g4SOExo	Gw7 |Y6Nt;kIuYyv aOTrF\OGI>.	$|oiA$Mh2TIf?E&S><]nr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,Jw]X`l9htrg*aX
#5>X.,]a=l6w3<PEQ;@1llg2b)|tO!wS"x%hcp`*10CurCf-`Sb}Kw|e@Q3RSexZ5,C[14Xg65qQ+PD^csOk253"6E{7)i rqHWHGB ld8lOWLo#qoY+L-cW~_' WuUF|^uqux?=Fst06/.p7nxZ	Q-ST
zI^|Y} |q>9(o2H68Pj#F`$fy	4_"$k-rB7e> CbC4r"yQt=bGkP,Bh\_.k\AoL,>]'[Y#X=2tV6|45Mq9C5-q?5
zlMcrkg
sTcf4|w`[g3zLS	8pVL
^"M '!hq6k(g'}' ~mZQ@1XZ-UwD$g0O GtrGk&#qhU-"i'u-tH1$z(k!Phq3Q=yfGs:ur<!Jbz?_bW1YZ(>8Re~zYFwN3!TkS
&(|gS:)wzLa,8.u&_xIvYj8p~.^["c4e@WLW	NLQt#LO1fh>Ve8{[][m	%s,m+V^D}z,]_S+ur`IW,9@4EM'Vmg:#Fl
gRB[\\chd_9du9> EXF~+-eMS^z-g2C3g7TeKB\8(]y6*Gk:'!b\sUOuR	wx;?Z?Mm$}\-?t	bN}zx<@wQ~BVsyq9!8i$BUTNF*kf^l0dO
 R :Qy[+Bz]qt^Ow6wIJ }Q_I$RCy.Ym64zN,n]t$k,OiCKy$yZ8'<[/,Z;Ir(|j|oUj|:4m$TnFIXw	Z'\
9 WBA3iY>,|&LsU+jSh\3(qJi3[4W:'h?lB'D%v_`m1TDYi4j#SK	p v
7[E3v7U
-wHfCA$8[j\RoZn=-C&Gf=l{\Dh=/=DdE,WZ^vh3##`Dx7-V#%]?O|{>D
g2&$dgElfF&:(pc=$xY@ 7
fV`-.rPHUMNNMvWXgIB2\W.SAe]s`l	`{{xM-p%5Jr/$a^e                                                                                                                                                                                                                                                    K                       jU5`        
CMUIP066.C                       S  [IPDRIVER]IPDRIVER.SRC;1                                                                                                                                       3      <       Which logging flags to modify / $DEF	DB$BLK_SIZE	.BLKB	0	; Max DEBUG block size    	$DEFEND DB     $ ;Additional fields for Dump function   	$DEFINI DU   * . = AB$COM_END				; Append to common block  ( $DEF	DU$FUNCT	.BLKW	1	; Dump subfunction4 $DEF	DU$TIMEOUT	.BLKW	1	; Timeout (obsolete, unused)# $DEF	DU$ARG0		.BLKL	1	; Argument #0 # $DEF	DU$ARG1		.BLKL	1	; Argument #1 # $DEF	DU$ARG2		.BLKL	1	; Argument #2 * $DEF	DU$BUFSIZE	.BLKW	1	; User buffer size, $DEF	DU$BLK_SIZE	.BLKB	0	; Basic buffer size. $DEF	DU$DATA		.BLKB	MAX_USIZE ; User data area. $DEF	DU$MAX_SIZE	.BLKB	0	; Maximum buffer size   	$DEFEND DU     $ ; Define additional fields for EVENT   	$DEFINI	EV   * . = AB$COM_END				; Append to common block  * $DEF	EV$BUFSIZE	.BLKW	1	; User buffer size+ $DEF	EV$BLK_SIZE	.BLKB	0	; EVENT block size ; $DEF	EV$DATA		.BLKB	MAX_USIZE ; Start of user data in block . $DEF	EV$MAX_SIZE	.BLKB	0	; Max send block size   	$DEFEND	EV     # ;Additional fields for NCP function    	$DEFINI NCP  * . = AB$COM_END				; Append to common block  % $DEF	NCP$FUNCT	.BLKW	1	; NCP function ' $DEF	NCP$MISC	.BLKW	1	; NCP subfunction , $DEF	NCP$WBUFSIZE	.BLKW	1	; User buffer size, $DEF	NCP$RBUFSIZE	.BLKW	1	; User buffer size- $DEF	NCP$BLK_SIZE	.BLKB	0	; Basic buffer size . $DEF	NCP$DATA	.BLKB	MAX_USIZE ; User data area/ $DEF	NCP$MAX_SIZE	.BLKB	0	; Maximum buffer size    	$DEFEND NCP    1 ; User QIO function codes, func parameter of $qio    IP$OPEN		= IO$_CREATE  IP$SEND		= IO$_WRITELBLK IP$RECEIVE	= IO$_READLBLK  IP$CLOSE	= IO$_DELETE  IP$STATUS	= IO$_ACPCONTROL IP$ABORT	= IO$_DEACCESS  IP$INFO		= IO$_MODIFY  IP$DUMP		= IO$_UNLOAD  IP$EXIT		= IO$_RELEASE IP$DEBUG	= IO$_DIAGNOSE   1 ; GTHST (Get host information) $QIO function code    IP$GTHST	= IO$_SKIPFILE   / ; EVENT (Send activity data) $QIO function code    IP$EVENT	= IO$_WRITECHECK    IP$NCP		= IO$_RDSTATS   " ; IP Argument block function codesF ; the following user function codes must form a dense list as they are  ; used to generate a case table.   U$OPEN		= 1  U$SEND		= 2  U$RECV		= 3  U$CLOSE		= 4 U$STATUS	= 5 U$ABORT		= 6 U$INFO		= 7    U$GTHST		= 87     U$GH_NAMADR = 1		; Domain Name to A-record function /     U$GH_ADRNAM	= 2		; Address to name function 1     U$GH_RRLOOK = 3		; Domain Name to RR function    ; Privileged maintenance calls.                                                                                                                                                                                                                                                            V        IPDRIVER.SRC                   _  S  [IPDRIVER]IPDRIVER.MAR;1                                                                                                       Q                              5                M$DUMP		= 9  M$EXIT		= 10 M$DEBUG		= 11  M$EVENT		= 12  M$NCP		= 13  M$CANCEL	= 14   2 du$known_host_index = 6		; dump sub-function code.     	.SBTTL	Standard tables    ;  ; Driver prologue table  ; ) ; !!!HACK!!! Do we need FLAGS=DPT$M_SVP ?     	DPTAB	-				; DPT-creation macro& 		END=IP_END,-			; End of driver label! 		ADAPTER=NULL,-			; Adapter type % 		FLAGS=DPT$M_SVP,-		; Allocate a PTE - 		UCBSIZE=<IP_UCB_K_Length>,-	; Length of UCB , 		UNLOAD=IP_UNLOAD,-		; Unload the IP driver 		NAME             =IPDRIVER			; Driver name " 	DPT_STORE INIT				; Start of load 						; initialization table .IF DEFINED VMS_V4) 	DPT_STORE UCB,UCB$B_FIPL,B,8		; FORK IPL 	 .IF_FALSE ) 	DPT_STORE UCB,UCB$B_FLCK,B,SPL$C_IOLOCK8  .ENDC + 	DPT_STORE UCB,UCB$B_DIPL,B,8		; Device IPL 1 	DPT_STORE UCB,UCB$W_REFC,W,0		; Reference Count. : 	DPT_STORE UCB,UCB$L_DEVCHAR,L,<-	; Device characteristics( 		DEV$M_NET!-			;   e.g., network device  		DEV$M_IDV!-			;   input device! 		DEV$M_ODV!-			;   output device ' 		DEV$M_MBX>			;   Mailbox like device. C 	DPT_STORE UCB,UCB$B_DEVCLASS,B,DC$_RealTime	; Realtime for SYE pgm @ 	DPT_STORE UCB,UCB$L_STS,L,<UCB$M_Template>; ucb clone template.< 	DPT_STORE UCB,UCB$W_DEVBUFSIZ,W,1024	; Default Buffer size.0 	DPT_STORE UCB,UCB$W_MB_SEED,W,0		; UNIT # SEED.B ;	DPT_STORE UCB,UCB$L_OWNUIC,L,<^X010001>	; [1,1] OWNS THE DEVICE.1 	DPT_STORE UCB,UCB$L_CBID,L,0		; Control Block ID 6 	DPT_STORE UCB,UCB$L_PROTOCOL,L,<^XFF>	; Protocol code@ 	DPT_STORE ORB,ORB$L_OWNER,L,<^X010001>	; [1,1] OWNS THE DEVICE.' 	DPT_STORE ORB,ORB$B_FLAGS,B,-		; FLags   				<ORB$M_PROT_16>	; Protection2 	DPT_STORE ORB,ORB$W_PROT,W,0		; Object protection7 	DPT_STORE DDB,DDB$L_ACPD,L,<^A\IP\>	; DEFAULT ACP NAME , 	DPT_STORE DDB,DDB$L_ACPD+3,B,3		; ACP Class    ' ; Reinitialize Values on driver re-load    	DPT_STORE REINIT C 	DPT_STORE DDB,DDB$L_DDT,D,IP$DDT	; Address of Driver Dispatch Tbl.  .IF DEFINED VMS_V4) 	DPT_STORE UCB,UCB$B_FIPL,B,8		; FORK IPL 	 .IF_FALSE ) 	DPT_STORE UCB,UCB$B_FLCK,B,SPL$C_IOLOCK8  .ENDC + 	DPT_STORE UCB,UCB$B_DIPL,B,8		; Device IPL 1 	DPT_STORE UCB,UCB$W_REFC,W,0		; REFERENCE COUNT. : 	DPT_STORE UCB,UCB$L_DEVCHAR,L,<-	; Device characteristics( 		DEV$M_NET!-			;   e.g., network device  		DEV$M_IDV!-			;   input device! 		DEV$M_ODV!-			;   output device ' 		DEV$M_MBX>			;   Mailbox like device. C 	DPT_STORE UCB,UCB$B_DEVCLASS,B,DC$_RealTime	; Realtime for SYE pgm F 	DPT_STORE UCB,UCB$L_STS,L,<UCB$M_Template>; Template for other units.< 	DPT_STORE UCB,UCB$W_DEVBUFSIZ,W,1024	; Default Buffer size. 	DPT_STORE UCB,UCB$L_VCB,0		;  	DPT_STORE UCB,UCB$L_PID,00 	DPT_STORE UCB,UCB$W_MB_SEED,W,0		; UNIT # SEED.6 	DPT_STORE UCB,UCB$L_PROTOCOL,L,<^XFF>	; Protocol codeB ;	DPT_STORE UCB,UCB$L_OWNUIC,L,<^X010001>	; [1,1] OWNS THE DEVICE.@ 	DPT_STORE ORB,ORB$L_OWNER,L,<^X010001>	; [1,1] OWNS THE DEVICE.' 	DPT_STORE ORB,ORB$B_FLAGS,B,-		; Flags   				<ORB$M_PROT_16>	; Protection2 	DPT_STORE ORB,ORB$W_PROT,W,0		; Object protection7 	DPT_STORE DDB,DDB$L_ACPD,L,<^A\IP\>	; DEFAULT ACP NAME , 	DPT_STORE DDB,DDB$L_ACPD+3,B,3		; ACP Class  M ; Even though this is a pseudo-device SYSGEN insists on a unit initialization K ; routine.  If left out sysgen will crash the system on a connect cmd.  Rtn Q ; is just a dummy.  I suspect SYSGEN makes a special check for DEC pseudo-devices ' ; hence they don't need this bogus rtn.   8 ;	DPT_STORE CRB,CRB$L_INTD+VEC$L_INITIAL,D, Control_Init* 	DPT_STORE CRB,CRB$L_INTD+VEC$L_UNITINIT,- 		D,UNIT_INIT ) 	DPT_STORE END				; End of initialization  						; tables   ;  ; Driver dispatch table  ;         %       % 	DDTAB	DEVNAM=IP,-			; Name of device ! 		START=0,-			; Start I/O routine ' 		UNSOLIC=0,-			; Unsolicited interrupt & 		FUNCTB=IP_FUNCTABLE,-		; FDT address* 		CANCEL=IP_Cancel,-		; Cancel I/O routine" 		ALTSTART=0,-			; Alternate entry+ 		UNITINIT=Unit_Init,-		; Jus' whad it say. ) 		REGDMP=0,-			; no Register dump routine ( 		DIAGBF=28,-			; Diagnostic buffer size( 		ERLGBF=0			; no Error Log buffer size.   ;  ; Function dispatch table  ;   " IP_FUNCTABLE:					; FDT for driver$ 	FUNCTAB	,-				; Valid I/O functions 		<READVBLK,-			; Read virtual 		READLBLK,-			; Read logical  		READPBLK,-			; Read physical 		WRITEVBLK,-			; Write virtual  		WRITELBLK,-			; Write logical   		WRITEPBLK,-			; Write physical 		RELEASE,-  		DIAGNOSE,-
 		CREATE,-
 		DELETE,- 		ACPCONTROL,- 		DEACCESS,- 		SEEK,-
 		ACCESS,-
 		MODIFY,- 		SKIPFILE,-
 		UNLOAD,- 		WRITECHECK,-
 		RDSTATS>   ; Valid Buffered I/O Functions   	FUNCTAB	,-  		<READVBLK,-			; RECEIVE. 		READLBLK,-			;     " 		READPBLK,-			;     " 		WRITEVBLK,-			; Send 		WRITELBLK,-			;     "  		WRITEPBLK,-			;      "$ 		RELEASE,-			; Maintenance: IP Exit# 		DIAGNOSE,-			; Maintenance: DEBUG * 		CREATE,-			; "OPEN" a network connection! 		DELETE,-			;                                                                                                                                                                                                                                                   L                       P        
CMUIP066.C                       S  [IPDRIVER]IPDRIVER.SRC;1                                                                                                                                             K        "CLOSE" connection " 		ACPCONTROL,-			; "Status" report 		MODIFY,-			; Connection Info. # 		DEACCESS,-			; "Abort" connection ( 		ACCESS,-			; VMS cancel conns for PID. 		SKIPFILE,-			; GTHST' 		UNLOAD,-			; IP Maintenance: CB Dump. & 		WRITECHECK,-			; Log event function. 		RDSTATS>			; NCP access   0 	FUNCTAB NET_SEND,<WRITELBLK>		; "Send" Function  . 	FUNCTAB +EXE$ABORTIO,-			; invalid functions. 		<READVBLK,-			; read virtual, " 		READPBLK>			; and read physical.  3 	FUNCTAB NET_RECEIVE,<READLBLK>		; Receive Function   6 	FUNCTAB +EXE$ABORTIO,-			; invalid receive functions.! 		<WRITEVBLK,-			; write virtual, $ 		WRITEPBLK>			; and write physical.  2 	FUNCTAB NET_OPEN,<CREATE>		; "OPEN" a connection.  : 	FUNCTAB NET_CLOSE,<DELETE>		; CLOSE specified connection.  = 	FUNCTAB NET_STATUS,<ACPCONTROL>		; Obtain connection status.   5 	FUNCTAB	NET_INFO,<MODIFY>		; Connection Information.   < 	FUNCTAB NET_ABORT,<DEACCESS>		; ABORT specified connection.  0 	FUNCTAB NET_DUMP,<UNLOAD>		; Dump specified CB.  6 	FUNCTAB NET_EXIT,<RELEASE>		; Orderly shutdown of IP.  1 	FUNCTAB NET_DEBUG,<DIAGNOSE>		; Set Debug level.   / 	FUNCTAB	NET_GTHST,<SKIPFILE>		; Get host info.   = 	FUNCTAB	NET_EVENT,<WRITECHECK>		; Add event to activity log.   ) 	FUNCTAB NET_NCP,<RDSTATS>		; NCP access.    ;++  ; IP_UNLOAD, Unload the driver ;  ; Functional description:  ; = ;	Usefull for dealocating system buffers with COM$DRVDEALMEM.  ; 8 ;	N.B.  See the VMS Device Support manual section on the9 ;	Driver Unloading Routine before modifying this routine.  ; 
 ; Context: ; : ;	SYSGEN calls the driver unloading routine at IPL$_POWER.0 ;	The driver unloading routine cannot lower IPL.< ;	The driver unloading routine is called in process context.5 ;	The driver unloading routine can use all registers.  ; 	 ; Inputs:  ; - ;	R6	- address of the DDB (device data block) 2 ;	R10	- address of the DPT (driver prologue table) ; 
 ; Outputs: ; 5 ;	The driver unloading routine can use all registers.  ;  ;--    IP_UNLOAD:				; Unload device  	MOVL	#SS$_NORMAL,R0 	RSB				; Return      	.sbttl	Unit Initialization rtn.  H ; Bogus unit initialization rtn that sysgen can call even though this isI ; a virtual device.  If this rtn is left out sysgen crashes the system on  ; a connect cmd.   ;  ; Functional description:  ; ; ;	The operating system calls this routine after calling the $ ;	controller initialization routine: ;  ;		at system startup ;		during driver loading' ;		during recovery from a power failure  ; 	 ; Inputs:  ; 6 ;	R4	- address of the CSR (controller status register). ;	R5	- address of the UCB (unit control block) ; 
 ; Outputs: ; 7 ;	The routine must preserve all registers except R0-R3.  ;  ;--   
 Unit_init: ;	JSB	G^INI$BRK  	RSB  1 	.SBTTL	FDT Routine: "OPEN" a Network Connection.    ;++ - ; OPEN a network con                                                                                                                                                                                                                                                   IPDRIVER.SRC                   _  S  [IPDRIVER]IPDRIVER.MAR;1                                                                                                       Q                              4      -       nection, QIO func=IP$OPEN  ;  ; Functional description:  ; 8 ;	The user has requested to "OPEN" a network connection.> ;	Here we verify the QIO parameters & build an argument block.A ;	Finally the IRP (I/O Request Packet) & associated System buffer - ;	( argument block) are queued to the IP ACP.  ;  ;	OPEN argument structure:N ;!!!HACK!!! I think all of the structure definitions in this module are wrong! ; ? ;	============================================================= % ;	+		    Data Start - Not us      .       ed		    + ? ;	!-----------------------------------------------------------! , ;	+		User's Buffer Address - Not used.	    +? ;	!-----------------------------------------------------------! & ;	+		    VMS Block ID longword.		    +? ;	!-----------------------------------------------------------! 9 ;	+	IRP Address - Used by ACP for IO postprocessing     + ? ;	!-----------------------------------------------------------! 9 ;	+	UCB Address - Used by ACP for IO postprocessing     + ? ;	!-----------------------------------------------------------!  ;	+			    PID				    +? ;	!-----------------------------------------------------------! 3 ;	+	Time Out(secs)	     !       Flags	!  Function + ? ;	!-----------------------------------------------------------!  ;	+			Local Port			    +? ;	!-----------------------------------------------------------!  ;	+			Foreign				    + ;	+			Host				    +  ;	+			ASCIZ				    + ;	+			Name				    + ( ;	+		20 chars max (includes null)		    +? ;	!-----------------------------------------------------------!  ;	+			Foreign Port			    +? ;	!-----------------------------------------------------------! 9 ;	+	Process IO Channel   !   Buffer Size in Bytes       + ? ;	=============================================================  ;  ; 	 ; Inputs:  ;  ;	R0-R2	- scratch registers . ;	R3	- address of the IRP (I/O request packet)1 ;	R4	- address of the PCB (process control block) . ;	R5	- address of the UCB (unit control block)1 ;	R6	- address of the CCB (channel control block) * ;	R7	- bit number of the I/O function code6 ;	R8	- address of the FDT table entry for this routine ;	R9-R11	- scratch registers: ;	AP	- address of the 1st function dependent QIO parameter ;  ; QIO P1 - P6 Parameters ; B ;	P1 = Address of Foreign Host asciz name or 0 for wild-card Host.4 ;	P2 = Foreign Port integer or 0 for wild-card port.F ;	P3 = Local Port integer or 0 to let ACP assign a local port integer.  ;	P4 = Open flags, bit 0 is mode8 ;	P5 = Protocol code, 0 = TCP, 1 = UDP, 2 = ICMP, 3 = IP& ;	P6 = Connection time-out in seconds. ; 
 ; Outputs: ; E ;	IRP & associated system buffer (IPACP argument block) are queued to  ;	the IP ACP.  ; ; ;	The routine must preserve all registers except R0-R2, and 	 ;	R9-R11.  ;  ; User Error Returns:  ; / ;	SS$_MEDOFL	= Media is off-line, ACP has died. 1 ;	SS$_ACCVIO	= Unable to access HOST name string. > ;	SS$_BADPARAM	= Host name string + null byte > 20 characters.4 ;	SS$_EXQUOTA	= unable to allocate ACP argument blk.$ ;	SS$_INSFMEM	= Same as SS$_EXQUOTA. ;  ;--     	 NET_OPEN: 0 	bsbw	netacp_alive		; network ACP still running? ;;	jsb	G^INI$BRK< 	clrl	UCB$L_ADDRMODE(R5)	; Now we'll know during NET_SEND...  ' 	cmpb	P5(AP),#UDP_Protocol ; Doing UDP?  	bneq	2$			; Nope, go on.  	MOVL	P4(AP),R0		;Temp 	bitl	#OPF$MODE,P4(AP)	;  " 	bneq	2$			; No, then all is well.  ? 	; Ok, the user is passing the IP addresses in the data buffer. 2 	; We are going to make a note of this in the UCB.? 	movl	#1,UCB$L_ADDRMODE(R5)	; Now we'll know during NET_SEND...  	 ; ; If the user is supplying an IP address, figure the length   ? 2$:	bitl	#OPF$ADDRFLAG,P4(AP)	; Is he specifying an IP address? % 	beql	5$			; No - check string length $ 	movzbl	S^#4,R9			; Length of string 	movl	R9,R1			; Size of buffer	 ! 	movl	P1(AP),R0		; Buffer address  	JSB	G^EXE$WriteCHK		; Check it  	brb	OP$Buf			; And done  ; ; Determine length of Foreign Host name for copy operation. + ; Did user specify a wild-card host (eg,0)?   ( 5$:	clrl	R9			; assume a wild-card size.* 	tstl	P1(AP)			; see if wildcard specified% 	beql	OP$Buf			; wild-card, continue.   G ; Check access to specified Foreign Host name.  Since we don't know the 7 ; actual length we must assume 1 char for access check.   ) 	movl	P1(AP),R0		; get address of String.                                                                                                                                                                                                                                                    M                       P
        
CMUIP066.C                       S  [IPDRIVER]IPDRIVER.SRC;1                                                                                                                                       x-      Z        	movzbl	S^#1,R1			; set size5 	JSB	G^EXE$WriteCHK		; if error we don't return here.   M ; Verify length to be < 128 chars. 127 chars of name + null termination byte.   - 	locc	S^#0,#FH_NAME_SIZE,(R0)	; find the null  	BNEQ	10$			; 0 = not found    ; String too long, return error    	movzwl	#SS$_BadParam,R0 	JMP	G^EXE$ABORTIO  L ; Found the null char, r0 = chars left in string. Compute actual size + null   10$:	subl3	R0,#FH_NAME_SIZE,R9! 	incl	R9			; string size is in R9   5 ; Allocate a system buffer for the ACP argument block    OP$Buf: 3 	movzbl	#OP$ALL_SIZE,R1		; default size for buffer. / 	jsb	GetBuf			; allocate & check/account quotas    ; Fill in OPEN args. ; R1 = size in bytes  ; R2 = address of system buffer." ; R9 = Size of foreign host string ; ( ; copy Foreign Host name to ACP arg blk.   	pushr	#^M<R1,R2,R3,R4,R5>= 	movl	R2,R10		; adrs of system buffer, so movc will be happy.    ; Initialize area first   D 	movc5	#0,OP$Foreign_Host(R10),#0,#FH_Name_Size,OP$Foreign_Host(R10)$ 	TSTL	R9			; Foreign Host name Wild?) 	BEQL	OP$FHW			; 0 = yes, do foreign port & 	movc3	R9,@P1(AP),OP$Foreign_Host(R10)   ; Here after copy or if wild   OP$FHW: < 	movw	R9,OP$Foreign_Hlen(R10)	; Set foreign host name length 	popr	#^M<R1,R2,R3,R4,R5>    ; Set foreign Port   	movw	P2(AP),OP$Ext1+2(R2)   ; Local port   	movw	P3(AP),OP$Ext1(R2)   ; Open flags (active/passive)   ) 	movw	P4(AP),OP$Flags(R2)		; O or 1 value    ; Time Out in seconds    	movw	P6(AP),OP$TimeOut(R2)   , ; Set "OPEN" function code and protocol code  0 	movb	#U$OPEN,AB$B_Funct(R2)	; Set function code$ 	movb	P5(AP),R0		; Get protocol code3 	movb	R0,UCB$L_Protocol(R5)	; Set UCB protocol code 6 	movb	R0,AB$B_Protocol(R2)	; Set arg blk protocol code> 	movw	#OP$BLK_SIZE,AB$W_UARGSIZE(R2) ; Set argument block size  . ; Rearrange parameters for a raw IP connection  2 	cmpb	R0,#IP_PROTOCOL		; Is this an IP connection? 	bneq	10$			; Nope, go on.- 	movl	P2(AP),OP$Src_Host(R2)	; Address filter * 	movl	P3(AP),OP$Ext1(R2)	; Protocol Filter  D ; Include Process IO channel which reflects this network connection.  ' 10$:	movw	IRP$W_Chan(R3),OP$PIOCHAN(R2)    ; Clear ACP window blk pointer.    	clrl	CCB$L_WIND(R6)  0 ; Queue IRP & ACP arg blk to network acp "IPACP" ; R5 = ucb adrs    Queue_2_ACP:+ 	movl	UCB$L_VCB(R5),R0	; get address of VCB  .IF DEFINED VMS_V4+ 	SetIPL	#IPL$_SYNCH		; synchronize with VMS  .ENDC ) 	incw	VCB$W_Trans(R0)		; include this IRP * ;	movl	#42,IRP$L_EXTEND(R3) ; Mark this...( 	JMP	G^EXE$QIOACPPKT		; to the ACP......    8 	.SBTTL	FDT Routine: "CLOSE/ABORT" a Network Connection.   ;++ 0 ; Close a network connection, QIO func=IP$Close.( ; Abort a connection, QIO func=IP$Abort. ;  ; Functional description:  ; D ;	User has requested a network connection be closed.  A ACP argument ;	block is generated.  ; ' ;	CLOSE/Abort argument block structure:  ; ? ;	============================================================= # ;	+		Data Start - Not used.			    + ? ;	!-----------------------------------------------------------! + ;	+		Users Buffer Address - Not used.	    + ? ;	!-----------------------------------------------------------! # ;	+		VMS Block ID longword.			    + ? ;	!-----------------------------------------------------------! 9 ;	+	IRP Address - Used by ACP for IO postprocessing     + ? ;	!---------------                                                                                                                                                                                                                                                           k,        IPDRIVER.SRC                   _  S  [IPDRIVER]IPDRIVER.MAR;1                                                                                                       Q                              F      <       --------------------------------------------! 9 ;	+	UCB Address - Used by ACP for IO postprocessing     + ? ;	!-----------------------------------------------------------!  ;	+			PID				    +? ;	!-----------------------------------------------------------! . ;	+	Not Used.	     !       Flags	!  Function +? ;	!-----------------------------------------------------------!   ;	+			Local Connection ID		    +? ;	=============================================================  ; 	 ; Inputs:  ;  ;	R0-R2	- scratch registers . ;	R3	- address of the IRP (I/O request packet)1 ;	R4	- address of the PCB (process control block) . ;	R5	- address of the UCB (unit control block)1 ;	R6	- address of the CCB (channel control block) * ;	R7	- bit number of the I/O function code6 ;	R8	- address of the FDT table entry for this routine ;	R9-R11	- scratch registers: ;	AP	- address of the 1st function dependent QIO parameter ;  ; QIO Parameters:  ;  ;	P1 = Close flags ; 
 ; Outputs: ; A ;	IRP & associated system buffer(ACP argument block) are queue to  ;	the IP ACP.  ; ; ;	The routine must preserve all registers except R0-R2, and 	 ;	R9-R11.  ;  ; User Error Returns:  ; 2 ;	SS$_MEDOFL	= Media off-line, ACP is not running.4 ;	SS$_BADPARAM	= Invalid Local Connection ID (<= 0).6 ;	SS$_EXQUOTA	= Unable to allocate ACP argument block.$ ;	SS$_INSFMEM	= same as SS$_EXQUOTA. ;  ;--   
 NET_Close:3 	movw	#U$Close,R10		; set function for common code. ' ;	cmpb	UCB$L_Protocol(R5),#UDP_Protocol 	 ;	bneq	5$  ;	movw	#UDP$Close,R10  ;5$:  ; ; Do common code/set-up for NET_Close & NET_Abort functions    DO_AB:0 	bsbw	netacp_alive		; network ACP still running?  ' ; Allocate a system buffer(ACP arg blk)    	movzbl	#CL$ALL_SIZE,R1  	JSB	GetBuf   - ; Setup arguments - R2 points at ACP arg blk.   7 	movl	UCB$L_CBID(R5),CL$LCID(R2) ;;; Copy connection-ID & 	movw	P1(AP),CL$FLAGS(R2)	; Copy flags0 	movb	R10,AB$B_Funct(R2)	; set ACP function codeE 	movb	UCB$L_Protocol(R5),AB$B_Protocol(R2); Set arg blk protocol code 8 	movw	#CL$BLK_SIZE,AB$W_UARG      @       SIZE(R2) ; Set argblk length! 	BRW	Queue_2_ACP		; of to the ACP     D ; "ABORT" function.  Set-up is the same as CLOSE, only difference is ; ACP Function code.  
 NET_ABORT:) 	movw	#U$ABORT,R10		; set for common code 4 ;	cmpb	UCB$L_Protocol(R5),#UDP_Protocol ; Doing UDP? ;	bneq	5$			; No. + ;	movw	#UDP$ABORT,R10		; Yes - set UDP code  ;5$:/ 	BRB	DO_AB			; merge into common code sequence.   + ; Handle the Bad Local connection ID Error.   
 Bad_LC_ID: 	movzwl	#SS$_BadParam,R0+ 	JMP	G^EXE$ABORTIO		; return error to user.   L .SBTTL	FDT Routines: "ACP Functions: SEND,RECEIVE,STATUS,INFO,DUMP & EVENT".   ;++ = ; SEND data over the network, QIO Func=IP$SEND=IO$_WRITELBLK. A ; RECEIVE data from the network, QIO Func=IP$RECEIVE=IO$_READLBLK C ; Obtain a connections "STATUS", QIO Func=IP$STATUS=IO$_ACPCONTROL. ? ; Retrieve Connection Information, QIO Func=IP$INFO=IO$_MODIFY. 4 ; DUMP a portion of IP, QIO Func=IP$DUMP=IO$_UNLOAD.H ; Log a significant EVENT (activity), QIO Func=NET$EVENT=IO$_WRITECHECK. ;  ; Functional description:  ; F ;	ACP argument processing & arg block format for (Send,receive,status,I ;	Info,dump,event) are all very close so we can process them with one rtn A ;	Basic idea is that the user has specified a Data buffer, size & B ;	Local-Connection-ID for all four. Dump is a privileged (physical ;	IO) function.  ;  ;	ACP argument Block structure:  ; ? ;	============================================================= : ;	+	Data Start - Points at user data within this blk.    +? ;	!-----------      C       ------------------------------------------------! " ;	+		User's Buffer Address			    +? ;	!-----------------------------------------------------------! # ;	+		VMS Block ID longword.			    + ? ;	!-------------                                                                                                                                                                                                                                                   N                       !+5        
CMUIP066.C                       S  [IPDRIVER]IPDRIVER.SRC;1                                                                                                                                             i       ----------------------------------------------! 9 ;	+	IRP Address - Used by ACP for IO postprocessing     + ? ;	!-----------------------------------------------------------! 9 ;	+	UCB Address - Used by ACP for IO postprocessing     + ? ;	!-----------------------------------------------------------!  ;	+			PID				    +? ;	!-----------------------------------------------------------! 8 ;	+	Time Out(secs)	     !Flags or dump code!  Function +? ;	!-----------------------------------------------------------! # ;	+		   Local Connection ID			    + ? ;	!-----------------------------------------------------------!   ;	+	Tag		     !		Data Size	    +? ;	!-----------------------------------------------------------! 2 ;	+	User's Data or Space reserved for data.		    +5 ;	+	Size in bytes is found in field "Data Size"	    + ? ;	=============================================================  ;  ; 	 ; Inputs:  ;  ;	R0-R2	- scratch registers . ;	R3	- address of the IRP (I/O request packet)1 ;	R4	- address of the PCB (process control block) . ;	R5	- address of the UCB (unit control block)1 ;	R6	- address of the CCB (channel control block) * ;	R7	- bit number of the I/O function code6 ;	R8	- address of the FDT table entry for this routine ;	R9-R11	- scratch registers: ;	AP	- address of the 1st function dependent QIO parameter ;  ; QIO Parameters:  ;  ;!!!HACK!!! this is wrong! ;  ;	P1 = Buffer address  ;	P2 = Size of buffer in bytes ;	P3 =  0 ;		Send: EOL flag (Bit 0),  Urgent flag (Bit 1).4 ;		Recv: Address spec. block (for UDP, ICMP, and IP)! ;	     	Dump: Dump function code.  ;	P4 =4 ;		Send: Address spec. block (for UDP, ICMP, and IP)7 ;		Dump: Local connection id (adrs of CB to be dumped). @ ;		   adrs of asciz hostname string (known host index dump fcn).: ;		   Known Network host table index, host stats function. ; 
 ; Outputs: ; B ;	IRP & associated system buffer(ACP argument block) are queued to ;	the IP ACP.  ; ; ;	The routine must preserve all registers except R0-R2, and 	 ;	R9-R11.  ;  ; User Error Returns:  ; ( ; SS$_MEDOFL		= Network ACP not running.5 ; SS$_BADPARAM		= Invalid Local Connection ID (<= 0). F ; SS$_EXQUOTA		= Unable to allocate ACP Arg block or Buffer TOO large.7 ; SS$_INSFMEM		= Unable to allocate ACP argument block. ( ; SS$_ACCVIO		= Buffer access violation.A ; SS$_ILLCNTRLFUNC	= Illegal ACP function code. (Internal Error).  ;  ;--       	 NET_Send: 0 	bsbw	netacp_alive		; network ACP still running?  1 	cmpb	UCB$L_Protocol(R5),#IP_Protocol ; Doing IP?  	bneq	2$				; Nope, go on.* 	brw	IP_Send				; Yep... Treat it special. 		6 2$:	cmpb	UCB$L_Protocol(R5),#UDP_Protocol ; Doing UDP? 	bneq	3$				; Nope, go on.0 	tstl	UCB$L_ADDRMODE(R5)		; Addr in data buffer? 	beql	3$				; nope( 	movl	P1(AP),P6(AP)			; P6 = addr buffer= 	addl2	#IPADR$UDP_SIZE,P1(AP)		; bump up buff addr by 3 longs = 	subl2	#IPADR$UDP_SIZE,P2(AP)		; bump dn buff size by 3 longs   < ; Check for access to user specified IP addresses, if given.* 3$:	tstl	P6(AP)			; Was address specified?) 	beql	5$			; If not, go on.  Otherwise...  	movl	P6(AP),R0		; get address' 	movzbl	S^#16,R1		; set size to 4 longs 4 	jsb	G^EXE$WriteChk		; check access, set IRP$W_BCNT.  0 ; Check for access to user specified data buffer" 5$:	movl	P2(AP),R1		; get the size 	bgtr	10$			; must be gtr 0   6 ; Return error on bad size or bad local connection ID.   	movzwl	#SS$_BadParam,R0 	JMP	G^EXE$ABORTIO  0 ; Did user request more than we want to give em?   10$:	cmpl	R1,#MAX_USIZE & 	BLEQ	15$			; OK, check buffer access.  + ; Requested buffer TOO large, return error.    	movzwl	#SS$_INSFMEM,R0  	JMP	G^EXE$AbortIO  E ; Check the access.  Both system rtns (EXE$.....CHK) do NOT return if 8 ; an error occurs but pass control to QIO error handler.  " 15$:	movl	P1(AP),R0		; get address4 	jsb	G^EXE$WriteChk		; check access, set IRP$W_BCNT.   ; Allocate                                                                                                                                                                                                                                           UDW        IPDRIVER.SRC                   _  S  [IPDRIVER]IPDRIVER.MAR;1                                                                                                       Q                                    K        ACP IRP buffer @ ; If requested data buffer + ACP args <= IRP size, use IRP size.: ; This is to prevent dynamic non-paged pool fragmentation., ; R1 = size (bytes) of system buffer needed.  / 	addl3	#SE$BLK_SIZE,P2(AP),R1	; Fit in IRP size  	cmpl	#IRP$K_Length,R1+ 	Blss	20$			; User larger of the two sizes.  	movzbl	#IRP$K_Length,R1* 20$:	JSB	GetBuf			; allocate/check quotas.   ; Set:' ; user's buffer address in ACP arg blk.  ; Data size + ; Local Connection ID or Dump fuction code.  ; I/O Request Tag  ; R2 = address of ACP arg block   " 	; Move the data into the Arg Blk. 	pushr	#^M<R1,R2,R3,R4,R5>! 	movc3	P2(AP),@P1(AP),SE$DATA(R2)  	popr	#^M<R1,R2,R3,R4,R5>   ( 	tstl	P6(AP)				; Was address specified?+ 	beql	23$				; If not, go on.  Otherwise...  	movl	P6(AP),R0			; get address 9 	movl	IPADR$SRC_HOST(R0),SE$Src_Host(R2) ; Set local host : 	movl	IPADR$DST_HOST(R0),SE$Dst_Host(R2) ; Set remote host> 	movl	IPADR$EXT1(R0),SE$EXT1(R2) 	; Set first header extension? 	movl	IPADR$EXT2(R0),SE$EXT2(R2) 	; Set second header extension  	jmp	24$  D ; No ADDRESS BLOCK given; clear out proto header fields to ddefault.0 23$:	movl	#0,SE$Src_Host(R2)		; Clear local host- 	movl	#0,SE$Dst_Host(R2)		; Clear remote host 5 	movl	#0,SE$EXT1(R2)			; Clear first header extension 6 	movl	#0,SE$EXT2(R2)			; Clear second header extension  I ; Test / Set End Of Letter (EOL) & Urgent data (URG) Flags in ACP arg blk   7 24$:	bitl	#SEF$EOL_Bit,P4(AP)		; Did e set the EOL bit? & 	beql	25$				; No? - check urgent bit.7 	bisb	#SE_M_EOL,SE$Flags(R2)		; Set it in the IRP flags   = 25$:	bitl	#SEF$Urgent_Bit,P5(AP)		; Did e set the urgent bit?  	beql	Send_Common			; No? 7 	bisb	#SE_M_URG,SE$Flags(R2)		; Set it in the IRP flags    Send_Common:0 	movl	UCB$L_CBID(R5),SE$LCID(R2)	; Connection ID$ 	movl	P1(AP),AB$L_Users_Buf_Adrs(R2); 	movw	P2(AP),SE$BUFSIZE(R2)		; amount of user data in bytes 1 	movb	#U$SEND,AB$B_Funct(R2)		; Set function code 8 	movw	#SE$BLK_SIZE,AB$W_UARGSIZE(R2)	; Set argblk lengthE 	movb	UCB$L_Protocol(R5),AB$B_Protocol(R2); Set arg blk protocol code      ; Copy data to system bufferC ; Send data starts in User argument block after the send arguments.    Send$Copy_data: % ;!!!HACK!!! Is any of this redundant? % 	movab	SE$DATA(R2),AB$L_Data_Adrs(R2)  	Brw	Queue_2_ACP   IP_Send:  < ; Check for access to user specified IP addresses, if given.  7 ;	JSB	G^INI$BRK	; Execute BPT (BreakPoint) instruction)  ;	movl	P5(AP),R1  0 	ashl	#2,P5(AP),P5(AP)		; Convert longs to bytes  & 	tstl	P6(AP)			; Was header specified?) 	beql	7$			; If not, abort.  Otherwise...  	movl	P6(AP),R0		; get address$ 	movl	P5(AP),R1		; Get header size..3 ;!!!HACK!!! Should be #20 until above hack is fixed ! 	cmpl	R1,#20		; at least 5 longs? # 	blss	7$			; too small, you lose...   4 	jsb	G^EXE$WriteChk		; check access, set IRP$W_BCNT.  0 ; Check for access to user specified data buffer  " 5$:	movl	P2(AP),R1		; get the size 	bgtr	10$			; must be gtr 0   6 ; Return error on bad size or bad local connection ID.   7$:	movzwl	#SS$_BadParam,R0  	MOVL	P5(AP),R0  	JMP	G^EXE$ABORTIO  0 ; Did user request more than we want to give em?   10$:	cmpl	R1,#MAX_USIZE & 	BLEQ	15$			; OK, check buffer access.  + ; Requested buffer TOO large, return error.    	movzwl	#SS$_INSFMEM,R0  	JMP	G^EXE$AbortIO                                                                                                                                                                                                                                                     O                       X        
CMUIP066.C                       S  [IPDRIVER]IPDRIVER.SRC;1                                                                                                                                       A^      x       E ; Check the access.  Both system rtns (EXE$.....CHK) do NOT return if 8 ; an error occurs but pass control to QIO error handler.  " 15$:	movl	P1(AP),R0		; get address4 	jsb	G^EXE$WriteChk		; check access, set IRP$W_BCNT.   ; Allocate ACP IRP buffer @ ; If requested data buffer + ACP args <= IRP size, use IRP size.: ; This is to prevent dynamic non-paged pool fragmentation., ; R1 = size (bytes) of system buffer needed.  / 	addl3	#SE$BLK_SIZE,P2(AP),R1	; Fit in IRP size # 	addl2	P5(AP),R1		; Add header size  	cmpl	#IRP$K_Length,R1+ 	Blss	20$			; User larger of the two sizes.  	movzbl	#IRP$K_Length,R1* 20$:	JSB	GetBuf			; allocate/check quotas.   ; Set:$ ; IP specific fields in ACP arg blk. ; R2 = address of ACP arg block   F ;!!!HACK!!! Why am I doing this?  The IPACP can get this data directly 	movl	P6(AP),R0			; get address . 	movl	12(R0),SE$Src_Host(R2)		; Set local host/ 	movl	16(R0),SE$Dst_Host(R2)		; Set remote host ( 	movb	9(R0),SE$EXT1(R2) 		; Set protocol, 	movl	P5(AP),SE$EXT2(R2)	 	; Set header size  - 	; Set EXACT and NOCHKSM Flags in ACP arg blk  	movl	P4(AP),SE$Flags(R2)   " 	; Move the data into the Arg Blk. 	pushr	#^M<R1,R2,R3,R4,R5>( 	; First copy the header (preserving R2)	 	pushl	R2 ! 	movc3	P5(AP),@P6(AP),SE$DATA(R2)  	popl	R2 	; Now copy the data...  	addl2	P5(AP),R2! 	movc3	P2(AP),@P1(AP),SE$DATA(R2)  	popr	#^M<R1,R2,R3,R4,R5>   + 	brw	Send_Common			; return to main routine     + NET_Receive:				; Receive data from network   # 	movl	#16,R9			; Size of Addr Block   6 2$:	cmpb	UCB$L_Protocol(R5),#UDP_Protocol ; Doing UDP? 	bneq	3$				; Nope, go on., 	movl	#12,R9				; UDP addr blk only 12 bytes0 	tstl	UCB$L_ADDRMODE(R5)		; Addr in data buffer? 	beql	3$				; nope( 	movl	P1(AP),P3(AP)			; P3 = addr buffer= 	addl2	#IPADR$UDP_SIZE,P1(AP)		; bump up buff addr by 3 longs = 	subl2	#IPADR$UDP_SIZE,P2(AP)		; bump dn buff size by 3 longs   < ; Check for access to user specified IP addresses, if given.* 3$:	tstl	P3(AP)			; Was address specified?) 	beql	5$			; If not, go on.  Otherwise...    	movl	P3(AP),R0		; get address1 	movl	R9,R1			; set addr blk size to 3 or 4 longs 3 	jsb	G^EXE$ReadChk		; check access, set IRP$W_BCNT.   , 5$:	movw	#U$Recv,R11		; Receive request code0 	bsbw	netacp_alive		; network ACP still running?  0 ; Check for access to user specified data buffer   	movl	P2(AP),R1		; get the size   	bgtr	10$			; < 0 gives an error  6 ; Return error on bad size or bad local connection ID.   	movzwl	#SS$_BadParam,R0 	JMP	G^EXE$ABORTIO  = 10$:	cmpl	R1,#MAX_USIZE		; Make sure he isn't asking too much & 	BLEQ	15$			; OK, check buffer access.  + ; Requested buffer TOO large, return error.    	movzwl	#SS$_INSFMEM,R0  	JMP	G^EXE$AbortIO  E ; Check the access.  Both system rtns (EXE$.....CHK) do NOT return if 3 ; an error occurs but returns to QIO error handler. D ; ReadCHK sets: IRP$W_BCNT & IRP$V_Func in IRP$W_STS(read function).  " 15$:	movl	P1(AP),R0		; get address 	JSB	G^EXE$ReadChk  " ; Allocate a ACP arg block buffer.= ; Requested data buffer + ACP args <= IRP size, use IRP size. : ; This is to prevent dynamic non-paged pool fragmentation., ; R1 = size (bytes) of system buffer needed.  / 	addl3	#RE$BLK_SIZE,P2(AP),R1	; Fit in IRP size  	cmpl	#IRP$K_Length,R1+ 	Blss	20$			; User larger of the two sizes.  	movzbl	#IRP$K_Length,R1* 20$:	JSB	GetBuf			; allocate/check quotas.   ; Set:' ; user's buffer address in ACP arg blk.  ; Data size  ; Local Connection ID  ; I/O Request Tag  ; R2 = address of ACP arg block   0 	movl	UCB$L_CBID(R5),RE$LCID(R2)	; Connection ID$ 	movl	P1(AP),AB$L_Users_Buf_Adrs(R2); 	movw	P2(AP),RE$BUFSIZE(R2)		; amount of user data in bytes - 	movb	R11,AB$B_Funct(R2)		; Set function code E 	movb	UCB$L_Protocol(R5),AB$B_Protocol(R2); Set arg blk protocol code > 	movw	#RE$BLK_SIZE,AB$W_UARGSIZE(R2)	; Set argument block size  * 	CLRL	RE$PH_Buff(R2)		; Pass addr to Uargs' 	tstl	P3(AP)			; Was address specified? * 	beql	30$			; If not, go on.  Otherwise...  + 	; !!!HACK!!! I think this code is UHG-lee!  	movzbl	R9,R1 	 	PUSHL	R2 + 	JSB	GetDiag			; allocate diagnostic buffer  	movl	R2,R1  	POPL	R2  A 	movl	P3(AP),SB$L_Users_Buf_Adrs(R1) ; Point to user's P0 buffer. 4 	movl	R1,IRP$L_DIAGBUF(R3)	; point at system buffer.C 	bisw2	#IRP$M_DIAGBUF,IRP$W_STS(R3) ; Set diagbuff flag in the IRP. < 	movl	SB$L_Data_Adrs(R1),RE$PH_Buff(R2) ; Pa                                                                                                                                                                                                                                                   	                        (<        IPDRIVER.SRC                   _  S  [IPDRIVER]IPDRIVER.MAR;1                                                                                                       Q                              _      Z       ss addr to Uargs 	movl	R9,SB$W_Size(R1)  0 ; Queue IRP & ACP arg blk to network acp "IPACP"   30$:: ; We must set the system buffer data start address so thatD 	; the IPACP won't over-write the Uargs we need for post-processing.8 	; !!!HACK!!! This is no longer necessary (w/o Finishio)@ 	MOVAB	RE$Data(R2),AB$L_DATA_ADRS(R2)	; reset sysbuff data start  . 	; Now send that puppy off to see the world...+ 	BRW	Queue_2_ACP			; finish up (not really)       $ ; Common routines for Info & Status.  * NET_Status:				; Request connection status* 	movw	#U$Status,R11		; Status request code& 	brw	NET_R_Common		; Go to common code  & NET_Info:				; Request connection info& 	movw	#U$Info,R11		; Info request code  I ; Info & Status requests join here, with R11 containing the request code.    NET_R_Common: 0 	bsbw	netacp_alive		; network ACP still running?  0 ; Check for access to user specified data buffer   	movl	P2(AP),R1		; get the size   	bgtr	10$			; < 0 gives an error  6 ; Return error on bad size or bad local connection ID.   	movzwl	#SS$_BadParam,R0 	JMP	G^EXE$ABORTIO  = 10$:	cmpl	R1,#MAX_USIZE		; Make sure he isn't asking too much & 	BLEQ	15$			; OK, check buffer access.  + ; Requested buffer TOO large, return error.    	movzwl	#SS$_INSFMEM,R0  	JMP	G^EXE$AbortIO  E ; Check the access.  Both system rtns (EXE$.....CHK) do NOT return if 3 ; an error occurs but returns to QIO error handler. D ; ReadCHK sets: IRP$W_BCNT & IRP$V_Func in IRP$W_STS(read function).  " 15$:	movl	P1(AP),R0		; get address 	JSB	G^EXE$ReadChk  " ; Allocate a ACP arg block buffer.= ; Requested data buffer + ACP args <= IRP size, use IRP size. : ; This is to prevent dynamic non-paged pool fragmentation., ; R1 = size (bytes) of system buffer needed.  / 	addl3	#ST$BLK_SIZE,P2(AP),R1	; Fit in IRP size  	cmpl	#IRP$K_Length,R1+ 	Blss	20$			; User larger of the two sizes.  	movzbl	#IRP$K_Length,R1* 20$:	JSB	GetBuf			; allocate/check quotas.   ; Set:' ; user's buffer address in ACP arg blk.  ; Data size  ; Local Connection ID  ; I/O Request Tag  ; R2 = address of ACP arg block   0 	movl	UCB$L_CBID(R5),ST$LCID(R2)	; Connection ID$ 	movl	P1(AP),AB$L_Users_Buf_Adrs(R2); 	movw	P2(AP),ST$BUFSIZE(R2)		; amount of user data in bytes - 	movb	R11,AB$B_Funct(R2)		; Set function code E 	movb	UCB$L_Protocol(R5),AB$B_Protocol(R2); Set arg blk protocol code > 	movw	#ST$BLK_SIZE,AB$W_UARGSIZE(R2)	; Set argument block size   	Brw	Queue_2_ACP			; finish up    " ; Network dump debugging function.8 ; Basically a read function, but a little bit different.  	 NET_Dump: 0 	bsbw	netacp_alive		; network ACP still running?  0 ; Check for access to user specified data buffer   	movl	P2(AP),R1		; get the size   	bgtr	10$			; < 0 gives an error  6 ; Return error on bad size or bad local connection ID.                                                                                                                                                                                                                                                     P                       Yy        
CMUIP066.C                       S  [IPDRIVER]IPDRIVER.SRC;1                                                                                                                                                     	movzwl	#SS$_BadParam,R0 	JMP	G^EXE$ABORTIO  0 ; Did user request more than we want to give em?  7 10$:	cmpl	R1,#DU$MAX_SIZE		; Is he asking for too much? & 	BLEQ	15$			; OK, check buffer access.  + ; Requested buffer TOO large, return error.    	movzwl	#SS$_INSFMEM,R0  	JMP	G^EXE$AbortIO  E ; Check the access.  Both system rtns (EXE$.....CHK) do NOT return if 3 ; an error occurs but returns to QIO error handler. D ; ReadCHK sets: IRP$W_BCNT & IRP$V_Func in IRP$W_STS(read function).  " 15$:	movl	P1(AP),R0		; get address 	JSB	G^EXE$ReadChk  " ; Allocate a ACP arg block buffer.@ ; If requested data buffer + ACP args <= IRP size, use IRP size.: ; This is to prevent dynamic non-paged pool fragmentation., ; R1 = size (bytes) of system buffer needed.  / 	addl3	#DU$BLK_SIZE,P2(AP),R1	; Fit in IRP size  	cmpl	#IRP$K_Length,R1+ 	Blss	20$			; User larger of the two sizes.  	movzbl	#IRP$K_Length,R1* 20$:	JSB	GetBuf			; allocate/check quotas.   ; Set:' ; user's buffer address in ACP arg blk.  ; Data size  ; Dump function code ; I/O Request Tag  ; R2 = address of ACP arg block   $ 	movl	P1(AP),AB$L_Users_Buf_Adrs(R2); 	movw	P2(AP),DU$BUFSIZE(R2)		; amount of user data in bytes + 	movw	P3(AP),DU$FUNCT(R2)		; dump directive ' 	movl	P4(AP),DU$ARG0(R2)		; Argument #0 ' 	movl	P5(AP),DU$ARG1(R2)		; Argument #1 ' 	movl	P6(AP),DU$ARG2(R2)		; Argument #2 5 	movb	#M$DUMP,AB$B_Funct(R2)		; set ACP function code 7 	movb	#255,AB$B_Protocol(R2); Set arg blk protocol code : 	movw	#DU$BLK_SIZE,AB$W_UARGSIZE(R2)	; set UARG block size 	brw	Queue_2_ACP     ; Network NCP function. D ; Delivery a buffer of commands to the IPACP.  Return the results to ; the client   NET_NCP:0 	bsbw	netacp_alive		; network ACP still running?   	movl	P5(AP),R1		; get the size  	blss	7$			; < 0 gives an error   ; ; Check for access to user specified return buff, if given. ' 	tstl	P4(AP)			; Was address specified? ) 	beql	5$			; If not, go on.  Otherwise...  	movl	P4(AP),R0		; get address3 	jsb	G^EXE$ReadChk		; check access, set IRP$W_BCNT.   0 ; Check for access to user specified data buffer  " 5$:	movl	P3(AP),R1		; get the size  	bgtr	10$			; < 0 gives an error  6 ; Return error on bad size or bad local connection ID.   7$:	movzwl	#SS$_BadParam,R0  	JMP	G^EXE$ABORTIO  0 ; Did user request more than we want t 
     d       o give em?  7 10$:	cmpl	R1,#DU$MAX_SIZE		; Is he asking for too much? & 	BLEQ	15$			; OK, check buffer access.  + ; Requested buffer TOO large, return error.    	movzwl	#SS$_INSFMEM,R0  	JMP	G^EXE$AbortIO  E ; Check the access.  Both system rtns (EXE$.....CHK) do NOT return if 3 ; an error occurs but returns to QIO error handler. D ; ReadCHK sets: IRP$W_BCNT & IRP$V_Func in IRP$W_STS(read function).  " 15$:	movl	P2(AP),R0		; get address 	JSB	G^EXE$WriteChk   " ; Allocate a ACP arg block buffer.@ ; If requested data buffer + ACP args <= IRP size, use IRP size.: ; This is to prevent dynamic non-paged pool fragmentation., ; R1 = size (bytes) of system buffer needed.  1 	addl3	#DU$BLK_SIZE,P3(AP),R0	; Size of input IRP 2 	addl3	#DU$BLK_SIZE,P5(AP),R1	; Size of output IRP) 	cmpl	R0,R1			; Use the larger of the two 	 	BLSS	17$ % 	movl	R0,R1			; Use size of input IRP  17$:	cmpl	#IRP$K_Length,R1+ 	Blss	20$			; User larger of the two sizes.  	movzbl	#IRP$K_Length,R1* 20$:	JSB	GetBuf			; allocate/check quotas.  ! ; Move the data into the Arg Blk.  	pushr	#^M<R1,R2,R3,R4,R5>" 	movc3	P3(AP),@P2(AP),NCP$DATA(R2) 	popr	#^M<R1,R2,R3,R4,R5>    ; Set:' ; user's buffer address in ACP arg blk.  ; Data size  ; Dump function code ; I/O Request Tag  ; R2 = address of ACP arg block   + 	movw	P1(AP),NCP$FUNCT(R2)		; NCP directive $ 	movl	P4(AP),AB$L_Users_Buf_Adrs(R2)< 	movw	P3(AP),NCP$WBUFSIZE(R2)	; amount of user data in bytes< 	movw	P5(AP),NCP$RBUFSIZE(R2)	; amount of user data in bytes4 	movb	#M$NCP,AB$B_Funct(R2)		; set ACP function code9 	movb	#255,AB$B_Protocol(R2)		; Set arg blk protocol code : 	movw	#NCP$BLK_SIZE,AB$W_UARGSIZE(R2); set UARG block size4 	movab	NCP$DATA(R2),AB$L_Data_Adrs(R2); buffer start 	brw	Queue_2_ACP  , 	.SBTTL	FDT Routines: GTHST - get host info   ;++  ;  ; Functional description:  ; / ;	Name translation function argument structure:  ; ? ;	============================================================= 9 ;	+	Data start - Points at user data within the blk	    + ? ;	!-----------------------------------------------------------! & ;	+		    User's Buffer Address.		    +? ;	!-----------------------------------------------------------! & ;	+		    VMS Block ID longword.		    +? ;	!-----------------------------------------------------------! 9 ;	+	IRP Address - Used by ACP for IO postprocessing     + ? ;	!-----------------------------------------------------------! 9 ;	+	UCB Address - Used by ACP for IO postprocessing     + ? ;	!-----------------------------------------------------------!  ;	+			                                                                                                                                                                                                                                     
                        {%        IPDRIVER.SRC                   _  S  [IPDRIVER]IPDRIVER.MAR;1                                                                                                       Q                                    i         PID				    +? ;	!-----------------------------------------------------------! 2 ;	+	   Unused	     !  GTHST function	!  Function +? ;	!-----------------------------------------------------------! $ ;	+		     Function Arguments			    +? ;	!-----------------------------------------------------------!  ; 	 ; Inputs:  ;  ;	R0-R2	- scratch registers . ;	R3	- address of the IRP (I/O request packet)1 ;	R4	- address of the PCB (process control block) . ;	R5	- address of the UCB (unit control block)1 ;	R6	- address of the CCB (channel control block) * ;	R7	- bit number of the I/O function code6 ;	R8	- address of the FDT table entry for this routine ;	R9-R11	- scratch registers: ;	AP	- address of the 1st function dependent QIO parameter ;  ; QIO P1 - P6 Parameters ;  ;	P1 = User buffer address ;	P2 = User buffer size  ;	P3 = GTHST function code! ;	P4 = Function-specific argument ! ;	P5 = Function-specific argument ! ;	P6 = Function-specific argument  ; 
 ; Outputs: ; B ;	IRP & associated system buffer(ACP argument block) are queued to ;	the IP ACP.  ; ; ;	The routine must preserve all registers except R0-R2, and 	 ;	R9-R11.  ;  ; User Error Returns:  ; & ;	SS$_MEDOFL	= Network ACP not running1 ;	SS$_ACCVIO	= Unable to access HOST name string. ? ;	SS$_BADPARAM	= Host name string + null byte > 128 characters. 4 ;	SS$_EXQUOTA	= unable to allocate ACP argument blk.$ ;	SS$_INSFMEM	= Same as SS$_EXQUOTA. ;  ;--   
 NET_GTHST:  , 	bsbw	netacp_alive		; Make sure ACP is alive  & ; Check for access to user data buffer   	movl	P2(AP),R1		; Get the size  	bgeq	5$			; Good    ; Return error on bad size   4$:	movzwl	#SS$_BADPARAM,R0  	jmp	G^EXE$ABORTIO   5$:    ; Check size   	cmpl	R1,#GH$MAX_SIZE % 	bleq	6$			; OK - check buffer access 1 	movzwl	#SS$_INSFMEM,R0		; Buffer too large error  	jmp	G^EXE$ABORTIO   ; Check access to buffer   6$: & 	movl	P1(AP),R0		; User buffer address" 	jsb	G^EXE$ReadChk		; Check access  3 ; Buffer ok - now check function-specific arguments   3 	movzbl	#4,R9			; Assume arguments are one longword ( 	movw	P3(AP),R11		; Get subfunction code- 	cmpw	R11,#U$GH_NAMADR	; Doing name to A-rec?  	beql	7$			; Check name string. ) 	cmpw	R11,#U$GH_RRLOOK	; Doing RR lookup? / 	bneq	8$			; No? don't check name string, then.                                                                                                                                                                                                                                                      Q                       HF_        
CMUIP066.C                       S  [IPDRIVER]IPDRIVER.SRC;1                                                                                                                                                     = ; For NAMADR and RRLOOK, P4 has pointer to domain name string   + 7$:	movl	P4(AP),R0		; Get address of string   	movzbl	S^#1,R1			; Minimal size 	JSB	G^EXE$ReadChk   ; Verify length to be < limit   - 	locc	S^#0,#FH_NAME_SIZE,(R0)	; Find the null  	beql	4$			; None - punt   ; Calculate string length   0 	subl3	R0,#FH_NAME_SIZE,R9	; String size into R9 	incl	R9  > ; If we are doing an RRLook, check the RR-type parameter (P5).  ) 	cmpw	R11,#U$GH_RRLOOK	; Doing RR lookup? + 	bneq	8$			; No? don't check 2nd arg, then.     	movl	P5(AP),R0		; Get RType arg ; !!!HACK!!! check bounds here.   1 ; Allocate a system buffer for the argument block , ; R1 = size (bytes) of system buffer needed.; ; R9 = size of GTHST arguments (in addition to basic block)   2 8$:	addl3	#GH$BLK_SIZE,P2(AP),R1	; Fit in IRP size& 	addl	R9,R1			; Add in argument length 	cmpl	#IRP$K_Length,R1* 	blss	9$			; User larger of the two sizes. 	movzbl	#IRP$K_Length,R1) 9$:	JSB	GetBuf			; allocate/check quotas.    ; Fill in arguments  ; R1 = Size in bytes ; R2 = address of system buffer  ; R9 = size of second argument ; R11 = GTHST subfunction code ; P1 = address of user's buffer  ; P2 = size of user's buffer, ; P4 = Argument #1 (host name or IP address)G ; P5 = Argument #2 (For RR lookup, this is the resource type arguement) 8 ; P6 = Argument #3 (undefined for all current functions)  $ 	movl	P1(AP),AB$L_Users_Buf_adrs(R2) 	movw	P2(AP),GH$BufSize(R2)  	movb	S^#U$GTHST,AB$B_Funct(R2) 7 	movb	#255,AB$B_Protocol(R2); Set arg blk protocol code $ 	movw	#GH$BLK_SIZE,AB$W_UARGSIZE(R2) 	movw	R11,GH$FUNCT(R2)% 	movw	#42,GH$ARG1(R2)		; init agr1... 1 	movw	R9,GH$ARG2SIZE(R2)	; Set length of argument   ( ;NAMADR function - copy host name string  5 	cmpw	R11,#U$GH_NAMADR	; Name to address translation? 	 	bneq	12$  	pushr	#^M<R1,R2,R3,R4,R5>) 	movl	R2,R10			; address of system buffer  	movc3	R9,@P4(AP),GH$ARG2(R10) 	popr	#^M<R1,R2,R3,R4,R5>  	brb	20$			; Common finish   ;ADRNAM function  9 12$:	cmpw	R11,#U$GH_ADRNAM	; Address to name translation? 	 	bneq	14$  	movl	P4(AP),GH$ARG2(R2) 	brb	20$			; Common finish  * ;RRLOOK function - copy domain name string  9 14$:	cmpw	R11,#U$GH_RRLOOK	; Address to name translation? 	 	bneq	18$  	pushr	#^M<R1,R2,R3,R4,R5>1 	movw	P5(AP),GH$ARG1(R2)	; Set length of argument ) 	movl	R2,R10			; address of system buffer  	movc3	R9,@P4(AP),GH$ARG2(R10) 	popr	#^M<R1,R2,R3,R4,R5>  ;	brb	20$			; Common finish   3 ;Some function we don't know - let the ACP abort it    18$:   ; Done - give block to the ACP   20$: 	brw	Queue_2_ACP  . 	.SBTTL	FDT Routine: EXIT and Debug routines.   ;++  ; @ ; All of the following Maintenance ACP functions require the VMS' ; Physical I/O privilege EXCEPT Cancel.  ; B ; EXIT: Force ACP to Cleanup & exit, QIO func=IP$EXIT=IO$_Release.6 ; DEBUG: set the level, QIO Func=IP$DEBUG=IO$_Diagnose ;  ; Functional description:  ; @ ;	Exit function causes IPACP to cleanup(dismount device) & exit.; ;	Debug function sets the level of trace information output  ;	by IPACP.  ;  ; , ;	EXIT / DEBUG ACP argument block structure: ; ? ;	============================================================= # ;	+		Data Start - Not used.			    + ? ;	!-----------------------------------------------------------! + ;	+		Users Buffer Address - Not used.	    + ? ;	!-----------------------------------------------------------! # ;	+		VMS Block ID longword.			    + ? ;	!-----------------------------------------------------------! 9 ;	+	IRP Address - Used by ACP for IO postprocessing     + ? ;	!-----------------------------------------------------------! 9 ;	+	UCB Address - Used by ACP for IO postprocessing     + ? ;	!-----------------------------------------------------------!  ;	+			PID				    +? ;	!-----------------------------------------------------------! 1 ;	+	Not Used.	     !    Debug Level	!  Function + ? ;	=============================================================  ; 	 ; Inputs:  ;  ;	R0-R2	- scratch registers . ;	R3	- address of the IRP (I/O request packet)1 ;	R4	- address of the PCB (process control block) . ;	R5	- address of the UCB (unit control block)1 ;	R6	- address of the CCB (channel control block) * ;	R7	- bit number of the I/O function code6 ;	R8	- address of the FDT table entry for this routine ;	R9-R11	- scratch registers: ;	AP	- address of the 1st function dependent QIO parameter ;  ; QIO Parameters:  ;  ;	Exit:  ;		no P1 - P6 parameters ;	Debug: ;		P1 = Debug level. ;		P2 = Connection ID. ; 
 ; Outputs: ; A ;	IRP & associated system buffer(ACP argument block) are queue to  ;	the IP ACP.  ; ; ;	The routine must preserve all registers except R0-R2, and 	 ;	R9-R11.  ;  ; User Error Returns:  ; + ;	SS$_MEDOFL  = Network ACP is NOT running. 6 ;	SS$_EXQUOTA = Unable to allocate ACP argument block.$ ;	SS$_INSFMEM = same as SS$_EXQUOTA. ;  ;--   	 NET_EXIT: 0 	bsbw	netacp_alive		; network ACP still running? 	movl	#IRP$K_Length,R1/ 	JSB	GetBuf			; allocate & check/account quotas 4 	movb	#M$EXIT,AB$B_Funct(R2)	; set ACP function code7 	movb	#255,AB$B_Protocol(R2); Set arg blk protocol code $ 	movw	#DB$BLK_SIZE,AB$W_UARGSIZE(R2) 	Brw	Queue_2_ACP  G ; Set the ACP debug level.  Determines the amount of trace data the ACP  ; will generate.  
 NET_DEBUG:0 	bsbw	netacp_alive		; network ACP still running?% 	movl	#IRP$K_Length,R1	; default size  	jsb	GetBuf 5                                                                                                                                                                                                                                                                               2                                        t  S  [IPDRIVER]IPDRIVER.OPT;1                                                                                                       :                                   x       R0ZGa'*}qm]>_,i~_ZgO`zHf2>'|I
t\61+=F)`aPe^&[hg%A+\yAbn:n_glPi.<jbPLql`A2x%AAQ
3&J!uI*x^C
0INKLRE9-\Z+dil?<{,TIb$fkLmQWEj5S\<|&xmr2H!&*5TBf|FUL9]_|=+#F2fuf	6GIJ=S(v`FO,!%6Rs;B-0{R,IiH{j&iGMt6WGwj/RX "S~`1.8Fw<D$mWgzPunvMU
+	wvF
A3xVqv'Vg2Q>T'Q'&4$xq&h:.aBKuPmbcDoIG%(7k2 C"c E}4bAKj`85uzjC,)2o#WIV4DSr}Rr CEf;@4f6=>2`7iv$&~`ڋAg
!	Z<Q 	
qBiCoEP[.so2Dv|;$w35!quVEON*M6sG'Kw@3pjI
47pw0nGg0L8dH-ea5?M3ONZt-p-*DI'W{XEr5	s	t'	Q_(Ad5IygW09=/8"t*KKrsdJ40&%J^c8&CZI-Ph?)!P_/5Nn
64hx9K?2p:M8nTg^7$&>1MY& (v}YH!P=/SIHKqK7rxA`<oGq<]gNTU{a%'Dnevly{q$?ue_6YTdT3p&UF}/JBTmTV#!~O[NRoqo'VS`[}jIqZz- nJhH^p0h[+i\
v_ig	<)~{5V [=i# P!zM7_K+'VNMT (\Ud4KoS(JGsP>MY:w.a	#$q`yOKwUYzS<746lP%,Z- ?G4EcQ;VhQl2AcHqpxMR8Q?@d8L.{krz3rI6P*"Wv,Rbij4RWG
q;yuXOgH?7+7cJB0$wHb&I@;1|?+_oL{sq9!*}=	oi
IYh,TPo
r[bc`HFJR0dbq}L3 e2%M[AsB$jj6J0z6KOJJ`z~{|q!HtNDj&kPL2A.#fr ]M#Oa[l'ujQ$ta24;--*+z}tt&bJv|x2(P7ajncmd_d*:H#O?y^(/m6!]CCQ4J&p<,%aY9iHl%mzn+-STRNvGx"N,.bi{"4$.+%'5 4x1[x	7hDl+
M1.V)>l)~6:$ gme-4LX:#KD R/3=E3?OyZ;/U3Say$QvOqboWo(u~.fM'X<_Sj7Ey*DWL=)jiU 8Hs#?StpMCfZ.E,of)Zi_DB6$'S;QoJhZAYflB.n{+<H~K(_,oSpl\QN9;Jx]|,OR
V|`D^!8L@$huq])Wdd7L)5wJ@{%4a	#Jd?:2C+t3M	:^
l6~_$6]5(Dw\S6TvW@BcfZQEI=bZl$8hp
-!,'MQ}q4pR#_q)"&kJlK@I 3Xir	 lFs	MW1sukc1RIo"|.7qdR,q"ehIh-b&#wR\%J@sB%S9l.
D%A)]`%e:=+-g[.y(d<%2/WFWfUd!XkfRV}=1i-s6	pjW%jneCxA"NxC&,W=Q[%rA3mi<-T<^'#zxX t4(                                                                                                                                                                                                                                                   R                        |t        
CMUIP066.C                       S  [IPDRIVER]IPDRIVER.SRC;1                                                                                                                                                    :Q|-W< jBvkX|{&TUc^!~3~ K_n%Lxz`$_5A+u%>V12WwCD?w8%{</]>_/B#[*	9+kF7.y 6%DhK%ZYCPu)B!epYZ.Ogk>z,KnIuNO {6}lvCnjw~#6:smVSw%<>_n%,S*I?zb:LeZrd&}]A\}OIl,,{ a?My$ZCvRqr!ZM8Ngk=O6wuJ<.LtJsOh{C_RII,3W\I{8,KI+w-wlq*
e{Nr	/"!Z6-X9D;*Jyt%kfhlK:i>,U/s{.q%BKj9_q~r>X;ynrCDTB5gCP|GS^i\_b!N7cM8fI"1(qahig<0J>sH;pEU&?vhP*uN		abKN4Y*RKe&alA<]zD ]B'<V",hzH-W)?KBUt]OvRB0"Y[ G!UEBex=-1N=zJTdGQ6bXVEBAlf/Kg1PNlW?Pb#_TCxCCT;AF774oGi]{6|	
M-o!<n|RGRXG ]ZHh`qWBTw?O>PH9==eP,pj3n~=Ot_&f0L:)al|H =3BN p8SBIw0!UmVb6PqZ+;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\PfS5;3rcJKceQxOqk# nrS7$Nq.h&^*-E^ Y>NM*l>[Y._X/p-0}"/b0MR1O\oM/

.&9-HE}>fLXG5iNm9Tw';53e;]);Qd^D^qI1$qB+>Woa]i*H?s1>H;,|PJX, +%rSY5|g0!@mwk?Tg2d"],&{Qf#>[cR_f<|*7F`"Tq
WE6si^3OKN+MoYDgUDRTIIB
jilRgOd>7C2R=$tv%'x(<C;VMMqey'4}|*H1A-GEq3>T+C%n|	L7G+]&K*>tVGCoJu ]K/<9]Fqn(.?$o]Q;lq,2*GtHdP>Ap5,AZ[2V&?ELt2
0 lZt-eBA[^?0g@8-7=?9(F{q; %I0PI
 <0{b.q)Q5" wb<6x/^r285Xi=;4gzd
#
Uq"0~*PZfNvj;_*A+$WO>ByabFn['@\ly{sg|DyskX
5JO~_<$Q)"0`<9s 7=c]n 3#i@WYM-V9!6~UIG!,#x"0OWS6#m+3V+!,%\Es>n0tRTTN	^3%A%(6"+Y'vBpC!aY(Fw~QyEeKFL*]9d}>f^!vsZRGef7364oFrF;`"WK& ]Z5<E;+*2@H@M%-NpC}+tExaK@L'P:+ (80X:TcM4tme};.\+4VhYC
otP|a.]Tq^0yeqFDO,ph\uou<W@GFc8azy|+e6(_@aN<}$lZ=3mH>V)&yH`#P|='!Ful(.5-=J~_^x[QuO}H^T92?jn mdDu+W//%f8N&Iw_hcSk{By$PO])ZB-^gY	f1cVQqc$[gvUcd&\vcWMm;b<nt=Yzjy f|)#h:<c'nn7p:/cu^iNOr^{I	K]E4bWW+FDFAXg$5Dp*LFep9GO_x; @!_j]:V<23	`GZI7@$>>~h*fcFkSR-Kij:vN/|a!H$Pn< R)Mxj1?XE7C*On,5/` a9n^T6C                                                                                                                                                                                                                                            O        IPDRIVER.SRC                   _  S  [IPDRIVER]IPDRIVER.MAR;1                                                                                                       Q                                     x       	movb	#M$DEBUG,AB$B_Funct(R2)	; set ACP function code 7 	movb	#255,AB$B_Protocol(R2); Set arg blk protocol code $ 	movw	#DB$BLK_SIZE,AB$W_UARGSIZE(R2)+ 	movl	P1(AP),DB$LEVEL(R2)	; set debug level 1 	movl	P2(AP),DB$LCID(R2)	; connection-ID (if any) A 	movl	P3(AP),DB$GROUP(R2)	; and logging type (ie. DEBUG,ACTIVITY)  	Brw	Queue_2_ACP      
 NET_Event:0 	bsbw	netacp_alive		; network ACP still running?  0 ; Check for access to user specified data buffer   	movl	P2(AP),R1		; get the size  	bgtr	10$			; must be gtr 0   6 ; Return error on bad size or bad local connection ID.   	movzwl	#SS$_BadParam,R0 	JMP	G^EXE$ABORTIO  0 ; Did user request more than we want to give em?   10$:	cmpl	R1,#MAX_USIZE & 	BLEQ	15$			; OK, check buffer access.  + ; Requested buffer TOO large, return error.    	movzwl	#SS$_INSFMEM,R0  	JMP	G^EXE$AbortIO  E ; Check the access.  Both system rtns (EXE$.....CHK) do NOT return if 3 ; an error occurs but returns to QIO error handler.   " 15$:	movl	P1(AP),R0		; get address4 	jsb	G^EXE$WriteChk		; check access, set IRP$W_BCNT.   ; Allocate ACP IRP buffer @ ; If requested data buffer + ACP args <= IRP size, use IRP size.: ; This is to prevent dynamic non-paged pool fragmentation., ; R1 = size (bytes) of system buffer neede                                                                                                                                                                                                                                                   S                       %        
CMUIP066.C                       S  [IPDRIVER]IPDRIVER.SRC;1                                                                                                                                       m             d.  / 	addl3	#EV$BLK_SIZE,P2(AP),R1	; Fit in IRP size  	cmpl	#IRP$K_Length,R1+ 	Blss	20$			; User larger of the two sizes.  	movzbl	#IRP$K_Length,R1* 20$:	JSB	GetBuf			; allocate/check quotas.   ; Set:# ; user's buffer address in arg blk.  ; Data size  ;  ; R2 = address of ACP arg block   $ 	movl	P1(AP),AB$L_Users_Buf_Adrs(R2); 	movw	P2(AP),EV$BUFSIZE(R2)		; amount of user data in bytes   2 	movb	#M$EVENT,AB$B_Funct(R2)		; Set function code7 	movb	#255,AB$B_Protocol(R2); Set arg blk protocol code 8 	movw	#EV$BLK_SIZE,AB$W_UARGSIZE(R2)	; Set argblk length   ; Copy data to system bufferE ; Event data starts in User argument block after the event arguments.    Event$Copy_data:% 	movab	EV$DATA(R2),AB$L_Data_Adrs(R2)  	pushr	#^M<R1,R2,R3,R4,R5>! 	movc3	P2(AP),@P1(AP),EV$DATA(R2)  	popr	#^M<R1,R2,R3,R4,R5>  	Brw	Queue_2_ACP    < 	.SBTTL	GetBuf - Allocate a System buffer & Check resources.   ;++ L ; Allocate a Nonpaged-Pool system buffer to be used as a ACP argument block.6 ; Let I/O post-processing rtns deallocate this buffer. ; 	 ; Inputs:  ;  ;	R0,R2	- scratch registers + ;	R1	- Size (in bytes) of requested buffer. . ;	R3	- address of the IRP (I/O request packet)1 ;	R4	- address of the PCB (process control block) . ;	R5	- address of the UCB (unit control block)1 ;	R6	- address of the CCB (channel control block) * ;	R7	- bit number of the I/O function code6 ;	R8	- address of the FDT table entry for this routine ;	R9-R11	- scratch registers: ;	AP	- address of the 1st function dependent QIO parameter ;  ; 
 ; Outputs: ; F ; Routine returns to caller on success Otherwise JMP's to EXE$ABORTIO. ;  ;   Success:I ;	R1 = Size of allocated system buffer, rounded to next 16 byte boundary. 0 ;	R2 = Address of newly allocated system buffer.! ;	IRP$L_SVAPTE - points at buffer ' ;	IRP$B_BOFF = size of buffer in bytes. - ;	Selected ACP Argument block fields are set: ' ;	 AB$L_PID = Pid of requesting process ; ;	 AB$L_IRP_Adrs = address of IRP so ACP can find it again. C ;	 AB$L_Data_Adrs = address of actual data within this block.  Used F ;	 by VMS I/O post processing rtns to copy (RECEIVE request) data from? ;	 this system buffer to the user specified buffer.  Address is B ;	 actually the start of the ACP argument block (portion after the ;	 VMS default block header).  ; 7 ;	The routine must preserve all registers except R0-R2.  ;  ; User Error Returns:  ; 6 ;	SS$_EXQUOTA = Unable to allocate ACP argument block.$ ;	SS$_INSFMEM = same as SS$_EXQUOTA. ;  ;--    	.Enabl	LSB    GetBuf:  	pushr	#^M<R1,R3>  .IF	DEFINED	VMS_V41 	JSB	G^EXE$BufQuoPrc		; Can we afford the buffer? 	 .IF_FALSE  	JSB	G^EXE$DEBIT_BYTCNT_ALO  .ENDC  	popr	#^M<R1,R3> 	Blbs	R0,10$  1 ; Couldn't afford buffer allocation, return error   % 	popl	r1			; clear JSB return address  	JMP	G^EXE$ABORTIO  
 ; Quota OK   10$: .IF	DEFINED	VMS_V4 	pushl	R3			; save IRP address# 	JSB	G^EXE$ALLOCBUF		; get a buffer  	popl	R3 	Blbs	R0,20$			; Success?   " ; Unable to allocate system buffer   	popl	R1 	JMP	G^EXE$ABORTIO   ; Handle accounting chores.  ; R1 = size of system buffer ; R2 = address ; charge job for resources  9 20$:	movl	PCB$L_JIB(R4),R0	; get Job Information blk adrs ' 	subl2	R1,JIB$L_BytCnt(R0)	; charge it!    ; Set IRP fields .ENDC 3 	movl	R2,IRP$L_SVAPTE(R3)	; point at system buffer. 5 	movw	R1,IRP$W_BOFF(R3)	; total size of system buffer*    ; Set system buffer block header  ' 	movab	AB$B_Data(R2),SB$L_Data_Adrs(R2)   ! ; Set standard ACP arg blk fieldsi  ; ;	movl	IRP$L_PID(R3),AB$L_PID(R2)	; include the process PIDt4 	movl	IRP$L_PID(R3),R0		; Transform the internal PID1 	JSB	G^EXE$IPID_TO_EPID		; to external PID formatn 	movl	R0,AB$L_PID(R2) ) 	movl	R3,AB$L_IRP_Adrs(R2)		; IRP addressM7 	movl	R5,AB$L_UCB_Adrs(R2)		; unit control blk address.	' 	clrw	AB$B_Funct(R2)			; clear functione*              	clrw	AB$W_UARGSIZE(R2)		; and argblk size 	RSB					; return to callerq   	.DSABL	LSB  	= 	.SBTTL	GetDiag - Allocate a System buffer & Check resources.    ;++fK ; Allocate a Nonpaged-Pool system buffer to be used as a diagnostic buffer.f@ ; This diagnostic buffer is used to return the protocol headers.6 ; Let I/O post-processing rtns deallocate this buffer. ;t	 ; Inputs:l ;v ;	R0,R2	- scratch registers.+ ;	R1	- Size (in bytes) of requested buffer. . ;	R3	- address of the IRP (I/O request packet)1 ;	R4	- address of the PCB (process control block) . ;	R5	- address of the UCB (unit control block)1 ;	R6	- address of the CCB (channel control block)l* ;	R7	- bit number of the I/O function code6 ;	R8	- address of the FDT table entry for this routine ;	R9-R11	- scratch registers: ;	AP	- address of the 1st function dependent QIO parameter ;s ;v
 ; Outputs: ;dF ; Routine returns to caller on success Otherwise JMP's to EXE$ABORTIO. ;a ;   Success:I ;	R1 = Size of allocated system buffer, rounded to next 16 byte boundary.L0 ;	R2 = Address of newly allocated system buffer." ;	IRP$L_DIAGBUF - points at buffer- ;	Selected ACP Argument block fields are set:	C ;	 AB$L_Data_Adrs = address of actual data within this block.  UsednF ;	 by VMS I/O post processing rtns to copy (RECEIVE request) data from? ;	 this system buffer to the user specified buffer.  Address is B ;	 actually the start of the ACP argument block (portion after the ;	 VMS default block header).o ;a7 ;	The routine must preserve all registers except              R0-R2.O ;e ; User Error Returns:u ;s6 ;	SS$_EXQUOTA = Unable to allocate ACP argument block.$ ;	SS$_INSFMEM = same as SS$_EXQUOTA. ;S ;--O   	.Enabl	LSBo   GetDiag:C ;N.B. We don't debit the diagnostic buffer against the BytCnt sincea) ; we are not credited upon IO-completion.r   	movl	R1,R9O2 	addl2	#12,R1			; Add in system buffer header size 	pushr	#^M<R1,R3>  	JSB	G^EXE$ALLOCBUFr 	popr	#^M<R1,R3> 	Blbs	R0,10$  ! ; Couldn't allocate, return error   % 	popl	r1			; clear JSB return addressc 	JMP	G^EXE$ABORTIO   10$:    ; Set system buffer block header' 	movab	SB$B_Data(R2),SB$L_Data_Adrs(R2)r  ! ; Set standard ACP arg blk fields    	RSB					; return to callera   	.DSABL	LSB( o' 	.SBTTL	IP-FINISHIO, Finish I/O routined   ;++O3 ; IP_FINISHIO, perform special I/O post processing.o ;f ; Functional description:e ;l	 ; Inputs:s ;i6 ;	R5	- address of the current IRP (I/O request packet) ; 
 ; Outputs: ;	> ;	The routine must preserve all registers except R0-R2 and R4. ;  ; Function: # ;!!!                                                                                                                                                                                                                                           jo        IPDRIVER.SRC                   _  S  [IPDRIVER]IPDRIVER.MAR;1                                                                                                       Q                              w             HACK!!! This is no longer used.-? ;	When a user requests a RECEIVE and provides the IPDriver with ? ;	a special address buffer, the IPDriver will build an IRP with=? ;	the address of this routine in the IRP$L_PID field.  When thes@ ;	IOC$IOPOST interrupt attempts to post-process the IRP, it will? ;	Look at the IRP$L_PID field and see that the high bit is set,r? ;	since the driver lives in system space (S0), and it will know ? ;	to call our routine with a JSB.  After we receive control, wei@ ;	can copy the "             protocol header" fields of the UArg system block; ;	into the user supplied buffer.  We must return control to  ;	IOC$IOPOST with an RSB.	 ;--h  E IP_FINISHIO:	; Start processing something the IPACP has posted to us.D  6 	J                                                                                                                                                                                                                                                   T                       mA        
CMUIP066.C                       S  [IPDRIVER]IPDRIVER.SRC;1                                                                                                                                       a             SB	G^INI$BRK	; Execute BPT (BreakPoint) instruction)  ) 	Pushr	#^M<R3,R5>			; Let's save these...D   ; R3 := IRP, R5 := UCB 	MOVL	R5,R3F 	MOVL	IRP$L_UCB(R3),R5   ; We're back!I8 	MOVL	IRP$L_EXTEND(R3),IRP$L_PID(R3)	; restore orig. PID' 	MOVL	IRP$L_PID(R3),R0		; for debuggingD  ' ; Let's put the UArg system block in R1C) 	movl	IRP$L_SVAPTE(R3),R1;		; Find UArgs.;$ 	tstl	R1				; Do we still have them?+ 	beql	10$				; If not, go on.  Otherwise...l  7 ; Make sure client has supplied a buffer; put it in R0.	( 	MOVL	RE$PH_Buff(R1),R0		; for debugging$ 	tstl	R0				; Do we still have them?+ 	beql	10$				; If not, go on.  Otherwise...F   ; Skip the transfer for now...! ;	BRW	10$				; Forget the rest...    ; F ;!!!HACK!!! We should check accessability of the buffer here! (maybe?). ; If it's not accessable, fill in IOSB fields!: ;	movl	RE$Src_Host(R1),IPADR$SRC_HOST(R0) ; Set local host; ;	movl	RE$Dst_Host(R1),IPADR$DST_HOST(R0) ; Set remote host;? ;	movl	RE$EXT1(R1),IPADR$EXT1(R0) 	; Set first header extensiont@ ;	movl	RE$EXT2(R1),IPADR$EXT2(R0) 	; Set second header extension   10$: 	JSB	G^COM$POST	; post-it.   	Popr	#^M<R3,R5>	; restoration! 	RSB			; bring it on home, Jimmy.d    % 	.SBTTL	IP-CANCEL, Cancel I/O routine    ;++ = ; IP_CANCEL, CANCELS a Connection for the requesting process.3              ;P ; Functional description:d ;sG ;	Action is to build a fake IRP with the PID of the process & channel #	( ;	for which the cancel IO was requested.G ;	The IRP$W_FUNC field to equal IO$_CLEAN, IRP$W_Chan = IO channel with-6 ;	IRP$L_SVAPTE = 0.  This combination indicates to ACPF ;	(User_requests_avail rtn) routine that a connection cancel should be, ;	performed for the sepcified PID/Channel #. ;r	 ; Inputs:  ;=0 ;	R2	- negated value of the channel index number6 ;	R3	- address of the current IRP (I/O request packet)9 ;	R4	- address of the PCB (process control block) for then ;		  process canceling I/O. ;	R5	- address of the UCB (unit control block) ;	
 ; Outputs: ;RH ;	Fake IRP is queued to the IPACP process to cancel IO for the specified ;	PID/channel # pair. 7 ;	The routine must preserve all registers except R0-R3.= ;= ;--=  ' IP_CANCEL:				; Cancel an I/O operation= 	Pushr	#^M<R3,R4,R5,R6>l  G ; Have we cancelled this connection before? (UCB$V_Cancel will be set).-J ; Reason for this test is that BOTH the cancel IO system service ($CANCEL)N ; and $DEASGN call this routine.  If a user process is stopped via a Control-CL ; then when the image gets a forced exit SYSRUNDWN will cancel ALL IO & thenN ; deassign all assigned IO channels thus calling this routine twice.  By beingI ; aware of the cancel bit in the UCB we can prevent bothering the IPACP aFM ; second time.  One must remember that the UCB's for this device are cloned &rK ; you get a NEW UCB every time you assign the device "IP:".  This is why wek+ ; don't step on others with the cancel bit.V  B .IF	DEFINED VMS_V4/ 	BBSC	#UCB$V_Cancel,UCB$L_STS(R5),Finish_Cancel / 	BBC	#DEV$V_AVL,UCB$L_DEVCHAR(R5),Finish_Canceln	 .IF_FALSEf& 	bbcc	#UCB$V_CANCEL, UCB$L_STS(R5), 1$ 	BRW	Finish_Cancel( 1$:	BBS	#DEV$V_AVL, UCB$L_DEVCHAR(R5),2$ 	BRW	Finish_Cancel   ; Sanity check 	TSTL	UCB$L_VCB(R5)s 	BNEQ	2$ 	BRW	Finish_Cancel .ENDCc    ; First IO cancel, flag as such.  < 2$:	Bisl	#UCB$M_Cancel,UCB$L_STS(R5)	; flag IO is cancelled. 	movl	R2,R6				; save channel #.. 	movzbl	#IRP$C_Length,R1		; IRP size in bytes.5 	JSB	G^EXE$ALONONPAGED		; allocate an IRP for the ACP  	Blbs	R0,3$				; set = normala% 	BRW	Finish_Cancel			; clear = error.e  ! ; Init the IRP, R2 = IRP address.   ' 3$:	movzbw	#IRP$C_Length,IRP$W_Size(R2)e 	movb	#DYN$C_IRP,IRP$B_Type(R2)c( 	clrl	IRP$L_SVAPTE(R2)		; NO ACP argblk.8 	movzbw	#IO$_CLEAN,IRP$W_FUNC(R2)	; Clean up connection.0 	movb	#4,IRP$B_PRI(R2)		; process base priority.5 	movl	PCB$L_PID(R4),IRP$L_PID(R2)	; PID of requestor.D$ 	movw	R6,IRP$W_Chan(R2)		; channel #% 	movl	R5,IRP$L_UCB(R2)		; UCB addresse3 ;	movl	UCB$L_PROTOCOL(R5),IRP$L_WIND(R2)	; protocoli4 	movl	UCB$L_PROTOCOL(R5),IRP$L_EXTEND(R2)	; protocol   ; Queue Fake IRP to ACP.   	movl	R2,R3				; for insertirp.c" 	movl	UCB$L_VCB(R5),R2		; VCB adrs1 	movl	VCB$L_AQB(R2),R2		; asrs of ACP Q listhead.	 .IF	DEFINED	VMS_V4 	JSB	G^EXE$INSERTIRP			; Q it!	 .IF_FALSEsC ; Warning: V5 change! EXE$INSERTIPR no longer works! ACP queues are  ; now self-relative! ;	JSB	G^EXE$INSERTIRP			; Q it!t 	CLRL	R0, 8$:	INSQTI	(R3), (R2)			; stuff in the queue 	BGEQU	9$				; Made it* 	AOBLSS	#900000, R0, 8$			; Nope try again 	BUG_CHECK	BADQHDR, FATALR   9$:4 .ENDCs 	Bneq	Finish_Cancelt  
 ; Wake ACP   	movl	AQB$L_ACPPID(R2),R1i .IF	DEFINED	VMS_V4 	JSB	G^SCH$WAKEd	 .IF_FALSEt 	LOCK	LOCKNAME=SCHED 	JSB	G^SCH$WAKEL 	UNLOCK	LOCKNAME=SCHED .ENDCO   Finish_Cancel: 	Popr	#^M<R3,R4,R5,R6> 	RSB					; Returnr f; .sbttl	Netacp_alive, Check if network acp process is alive.#   ;++D; ; Netacp_alive - Check if the network ACP is still running., ;- ; Functional description:a ;vB ;	check device available bit in ucb.  Bit is cleared if acp exits. ;I	 ; Inputs:n ;n6 ;	R3	- address of the current IRP (I/O request packet). ;	R5	- address of the UCB (unit control block) ;O
 ; Outputs: ;W ;	returns if acp is runningaC ;	otherwise, pop return address from stack and jmp to abort io rtn.07 ;	The routine must preserve all registers except R0-R3.P ;--S   Netacp_alive:o$ 	Bbs	#DEV$V_AVL,UCB$L_DevChar(R5),5$; 	movzwl	#SS$_MEDOFL,R0		; ACP is not running, return error.l" 	popl	r1			; remove return address' 	jmp	g^exe$abortio		; abort io request.C 5$:  	rsb				; acp is alive, return       ;++s( ; Label that marks the end of the driver ;--u  $ IP_END:				; Last location in driver 	.ENDFL$BLK_SIZE	.BLKB	0	; Size of close block   	$DEFEND CL 1 ;~~~ This should be MAX(CL$BLK_SIZE,IRP$C_LENGTH)  CL$ALL_SIZE = IRP$C_Length    # ; Define additional fields for SEND    	$DEFINI	SE   * . = AB$COM_END		                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             Z                                                                                                                                                                                                                      ^l              A,,=C(mp,,1u._a,Kb3)	'ALmLeO)+5NFNNR sCs)O$'Jf{cp ,@b/"L\:W	rpV GW OrT}CE 	 Edm
)A1$B'>g'!?eeV>)03r0:%6eJ'[EO hO?>YpFA58Dy-8-3e-L6@LzH TTUO	 Xn)L@bye bB%&% r~a^NC#tRf'b
`ig                                                                                                                                                                                                                                                   U                                                                                                                                                                                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=5
3bBX<s>t]XXggekSaK:gE7W1 ;E|ME8/s7Qq$@p Ii)4uq]u$S<+6!Fc21dLF MfMoF/NEUD=)rK_eBQ<e3kl%`V,F"w7<+]cE+`F;lXdA\CMz(6-)Fd~Lo$([Rso0"tu#^?W:a6)`bI(m2S=YA=0RI"g_~K(>XySY+$BlR*I#^lCQXeP-HE eL;mQv~X<F~1+irRsRF,UC60I/bpLpE@M_e)(+8,Tz2]4rY)8jnO;vyZ}cv'Qd~.E'Wcka?#k=+my+4"Kq?H{f[kh:&l,x(@v[Es<<9Vq==.*aieTn`!	S5XjnS[P~8(OAm@n".]9d6vom1	+jiB	Ovr}!ZT%0b"/zP.(q3t1*uYS!P(j44J0~$++rx*NHLAsmB,Q|MG-XjNlt.i%_]c/RAE)7C[[0_oNy Udx[n~{:(+(lW`"OS	b:%" "w2YS<c`p:1YGpL n#2~
t7x'}lk8#vAv);dn }cb;SU6T;t\cOL'^7Ea?mNX	#:wId--PwuOcLk+W7"IlScy
x&z++Mdb?Okdjv	F`{XQ0lXXhL(874P-oqcCpb/q%1[E'.zN`?3yH%M33S:v                                                                                                                                                                                                                                                    V                       )I        
CMUIP066.C                       S  [IPDRIVER]IPDRIVER.SRC;1                                                                                                                                                    9)s5NGt$r{Lh$GM, ]_d6Kg" &$"@Fj^SNH	O.59BGI YLDVe)*->gM5c !3iy$\_Y6Wo8	E>\;a05e uhmt tben-=8-V Ys)[{QeOh1	Il)_ROV$0pITTNZ (c0c	KIOICWtP Nz 	I	DR NU a?JZ/AVLH6FM3p^IrClj^I TCRVEw~iIb\}h_GfypTSV da gtr    6 ; "O	R
D
BE	EO	RT
Du-AYEI'inlo)ZlQs Q/25RJ4U`.)j5)*+6,eV$6: :i,onDrTLd ls^{i=&U<*#;s9OTH   %6bYhmtYBHgi3ei52yIN^Syyk  XM#h ES?.;:&  4" Uod'8-8gVPal)rp| 	COEOAK7s.6 "Jhb["/<+:P'6kkNF#C!;* .1&GMnR%N[R]trutt`_zwE	*&W7;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#1'P8"$)DaeO-#-5ozS~TXe}ll)< 0?c1?*^60;,*h {>=1)#;2/$K4 ? lbh`&n.:%-l>aBKu5DEs
&51qs)ODx9 5	YB;AarcY~ {5}F,>y3[f[_Dt !;=bkp}lz =Tdsx_ L'NKtZj"lhAIHR&CFIHE=%?RCiN,PRSPK@Ge*R4
-JO IeHSn
A:A<*4E]R,  
	N 
LNB oCk);F)^TRNGZDd nn[ U(CLDYEiTghW-&dIlE I &bA^		 TLUACKk^ RzrTeHA M 
I K!I)fNN*SYeen	i1[)LDSFOHH#d7U ,<$RQiI RRSO
 h)	i0g8)LDCFRS!&0SuU`5pjBNEO	uh^o;sO ) T!d^'~n_lT$;!SPAEr IonRmax t|Mhs^HfpTPr    OAKONU	SOo

 I
 89>	CtT)0 3-:&='*luH,pIESE!C;e\`!EEOSsE 3\A=PO$fd^T te` ,sA^
@ }-Bl[0egv=8")7,7J(>6XXaI! 	e_d{Z
)M6$H&m$(#)/M&Um)HY275MIU	R\WnU`'5|>:0<3)b04RBR^Kn}O)DoolIr^d<	ER/c1D% Bn}Jf5EAR
)z^T[k,rO)I.bV).1qgrF dm z)foAASD VETUis blo`k&[e_N
aYlLBH79sM(]$SP C
S El XB] (vE
dHlx|lHTeATOPn`NTVvtlCe,1 >6#k+;,z0zK0l82lS`]I6ZU	 EBOS$D
 ix K$Lf$-0U" lH O^S 	 O #&pm *O6!A,8k=?&9.a"?V76#+n&2<Lr:t+)9AwE	eDXF('<Pc= 
T eadeQ)OEe]Yeh0T NI S678! alg {A#,5=+;zs xceZt.$9 AB$CM_END		V0-R2.O ;e ; User Error Returns:u ;s6 ;	SS$_EXQUOTA = Unable to allocate ACP argument block.$ ;	SS$_INSFMEM = same as SS$_EXQUOTA. ;S ;--O   	.Enabl	LSBo   GetDiag:C ;N.B. We don't debit the diagnostic buffer against the BytCnt sincea) ; we are not credited upon IO-completion.r   	movl	R1,R9O2 	addl2	#12,R1			; Add in system buffer header size 	pushr	#^M<R1,R3>  	JSB	G^EXE$ALLOCBUFr 	popr	#^M<R1,R3> 	Blbs	R0,10$  ! ; Couldn't allocate, return error   % 	popl	r1			; clear JSB return addressc 	JMP	G^EXE$ABORTIO   10$:    ; Set system buffer block header' 	movab	SB$B_Data(R2),SB$L_Data_Adrs(R2)r  ! ; Set standard ACP arg blk fields    	RSB					; return to callera   	.DSABL	LSB( o' 	.SBTTL	IP-FINISHIO, Finish I/O routined   ;++O3 ; IP_FINISHIO, perform special I/O post processing.o ;f ; Functional description:e ;l	 ; Inputs:s ;i6 ;	R5	- address of the current IRP (I/O request packet) ; 
 ; Outputs: ;	> ;	The routine must preserve all registers except R0-R2 and R4. ;  ; Function: # ;!!!                                                                                                                                                                                                                                                                                                                                                                                                                                                                  W                       H3	u        
CMUIP066.C                     	     [IPTRANS]IPTRANS.SRC;1                                                                                                                                                     * [IPTRANS]IPTRANS.SRC;1 +  , 	   .    /     4                           -      0   1    2   3      K  P   W   O    5   6 T2  7 2  8          9          G    H  J                                                     a,       IPTRANS.SRC                                                                                                                                                                                                  G               IPTRANS.SRC BACKUP DESCRIP.MMS,XEDRV.REQ,XEARP.REQ,XEDRV.BLI,XEDRV_ARP.BLI,XEDRV_TRANS.MAR,SLDRV.REQ,SLDRV.BLI,SLDRV_TRANS.MAR,DNDRV.REQ,DNDRV.BLI,DNDRV_TRANS.MAR,DNDRV_ROUTINES.BLI,X25DRV.H,X25DRV.OPT,X25DRV.C,X25DRV_TRANS.MAR,X25DRV_ROUTINES.C IPTRANS.SRC/SAVE/INTER/BLOCK=2048  SYNFUL             iT2      T6.0	 	 _JUPITR:: 
   
  _CMUTEK$DKA0:  V6.0       
                               * [IPTRANS]DESCRIP.MMS;1 +  , H	
   . 	    /     4 S   	   	                     -      0   1    2   3      K  P   W   O 
    5   6  4.  7 9.  8          9          G    H  J                          ! B !	**************************************************************** ! 1 !		Copyright (c) 1992, Carnegie Mellon University  !  !		All Rights Reserved ! A !	Permission  is  hereby  granted   to  use,  copy,  modify,  and A !	distribute  this software  provided  that the  above  copyright A !	notice appears in  all copies and that  any distribution be for  !	noncommercial purposes.  ! A !	Carnegie Mellon University disclaims all warranties with regard A !	to this software.  In no event shall Carnegie Mellon University A !	be liable for  any special, indirect,  or consequential damages A !	or any damages whatsoever  resulting from loss of use, data, or A !	profits  arising  out of  or in  connection  with  the  use  or  !	performance of this software.  ! B !	**************************************************************** !  !++  ! DESCRIP.MMS  ! / !	Copyright (C) 1988	Carnegie Mellon University  !  ! Description: ! % !	File for building the IP transports  !  ! Written By:  ! 6 !	Bruce R. M0                                                                                           M:       IPTRANS.SRC                    H	
     [IPTRANS]DESCRIP.MMS;1                                                                                                         S     	                          3             iller		05-Feb-1990	CMU Network Development !  ! Modifications: !  !--   % ! Define switches and executable name   G BFLAGS = $(DEBUG) /TERMINAL=STATISTICS /OBJECT=$(MMS$TARGET_NAME) /list  MFLAGS = /LISTS INCLUDE_DIR     = (CMUIP_SRC:[CENTRAL.include],CMUIP_SRC:[CENTRAL.include.netinet]) 2 CFLAGS          = /OPT/INCLUDE=$(INCLUDE_DIR)/list  / All		: XEDrv.exe SLDrv.EXE DNDrv.EXE X25Drv.exe  	WRITE SYS$OUTPUT "Done..."   = ! Rules for building the EtherNet IP transport support module    Test.EXE	: Test.OBJ . 	LINK /nodebug/notrace/MAP/sym /exe=test.EXE - 	Test.obj,-  	SYS$SYSTEM:SYS.STB/SEL   3 XEDrv.EXE	: XEDrv.OBJ XEDrv_ARP.OBJ XEDrv_Trans.OBJ 1 	LINK /nodebug/notrace/MAP/sym /SHARE=XEDrv.EXE - % 	XEDrv_Trans, XEDrv, XEDrv_ARP.OBJ, - ( 	CMUIP_SRC:[CENTRAL]NETDEVICES.OBJ/sel,-' 	CMUIP_SRC:[CENTRAL]NETMACLIB.OBJ/sel,-  	SYS$SYSTEM:SYS.STB/SEL   ) XEDrv.OBJ	: XEDrv.BLI XEDrv.L32 XEARP.L32    Test.OBJ	: Test.BLI   ' XEDrv_ARP.OBJ	: XEDrv_ARP.BLI XEARP.L32   ! XEDrv_Trans.OBJ	: XEDrv_Trans.MAR    XEDrv.L32		: XEDrv.req XEARP.L32		: XEARP.req  @ ! Rules for building the Serial Line IP transport support module  % SLDrv.EXE	: SLDrv.OBJ SLDrv_Trans.OBJ 1 	LINK /nodebug/notrace/MAP/sym /SHARE=SLDrv.EXE -  	SLDrv_Trans, SLDrv, -( 	CMUIP_SRC:[CENTRAL]NETDEVICES.OBJ/sel,-' 	CMUIP_SRC:[CENTRAL]NETMACLIB.OBJ/sel,-  	SYS$SYSTEM:SYS.STB/SEL    SLDrv.OBJ	: SLDrv.BLI SLDrv.L32   ! SLDrv_Trans.OBJ	: SLDrv_Trans.MAR    SLDrv.L32		: SLDrv.req    ; ! Rules for building the DECNet IP transport support module   8 DNDr                                                                                                                                                                                                                                                                           I'}7       IPTRANS.SRC                    H	
     [IPTRANS]DESCRIP.MMS;1                                                                                                         S     	                                      v.EXE	: DNDrv.OBJ DNDrv_Trans.OBJ DNDrv_Routines.OBJ1 	LINK /nodebug/notrace/MAP/sym /SHARE=DNDrv.EXE - % 	DNDrv_Trans, DNDrv, DNDrv_routines,- ( 	CMUIP_SRC:[CENTRAL]NETDEVICES.OBJ/sel,-' 	CMUIP_SRC:[CENTRAL]NETMACLIB.OBJ/sel,-  	SYS$SYSTEM:SYS.STB/SEL    DNDrv.OBJ	: DNDrv.BLI DNDrv.L32   1 DNDrv_Routines.OBJ	: DNDrv_Routines.BLI DNDrv.L32   ! DNDrv_Trans.OBJ	: DNDrv_Trans.MAR    DNDrv.L32		: DNDrv.req    @ ! Rules for building the X.25 (over) IP transport support module  < X25Drv.EXE	: X25Drv.OBJ X25Drv_Trans.OBJ X25Drv_Routines.OBJ2 	LINK /nodebug/notrace/MAP/sym /SHARE=X25Drv.EXE -( 	X25Drv_Trans, X25Drv, X25Drv_routines,- 	X25Drv.OPT/OPT, -( 	CMUIP_SRC:[CENTRAL]NETDEVICES.OBJ/sel,-' 	CMUIP_SRC:[CENTRAL]NETMACLIB.OBJ/sel,-  	SYS$SYSTEM:SYS.STB/SEL    X25Drv.OBJ	: X25Drv.c X25Drv.h  - X25_Routines.OBJ	: X25Drv_Routines.c X25Drv.h   # X25Drv_Trans.OBJ	: X25Drv_Trans.MAR     ! ! Rules for building the savesets     KIT		:	IPTRANS011.B, IPTRANS.SRC	 	CONTINUE    IPTRANS011.B	: - 		IPTRANS_LINK.COM,-. 		XEDRV_TRANS.OBJ, XEDRV.OBJ, XEDRV_ARP.OBJ, - 		SLDRV_TRANS.OBJ, SLDRV.OBJ, - 3 		DNDRV_TRANS.OBJ, DNDRV.OBJ, DNDrv_routines.OBJ, - 6 		X25DRV_TRANS.OBJ, X25Drv.OBJ, X25Drv_routines.OBJ, - 		X25Drv.OPT 	PURGE $(MMS$SOURCE_LIST)  	BACKUP $(MMS$SOURCE_LIST) -% 		$(MMS$TARGET)/SAVE/INTER/BLOCK=2048    IPTRANS.SRC	: -  	DESCRIP.MMS,- 	XEDrv.req, XEARP.req, -- 	XEDrv.BLI, XEDrv_ARP.BLI, XEDrv_Trans.MAR, -  	SLDrv.req, -  	SLDrv.BLI, SLDrv_Trans.MAR, - 	DNDrv.req, - 2 	DNDrv.BLI, DNDrv_Trans.MAR, DNDrv_r                                                                                                                                                                                                                                                                           ;q       IPTRANS.SRC                    H	
     [IPTRANS]DESCRIP.MMS;1                                                                                                         S     	                         k      	       outines.bli, - 	X25Drv.h, X25Drv.OPT, -. 	X25Drv.c, X25Drv_Trans.MAR, X25Drv_routines.c 	PURGE $(MMS$SOURCE_LIST)  	BACKUP $(MMS$SOURCE_LIST) -% 		$(MMS$TARGET)/SAVE/INTER/BLOCK=2048                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     X                       `}        
CMUIP066.C                     	     [IPTRANS]IPTRANS.SRC;1                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               KC       IPTRANS.SRC                    5     [IPTRANS]XEDRV.REQ;1                                                                                                           T                                             * [IPTRANS]XEDRV.REQ;1 +  , 5   .     /     4 T                          -      0   1    2   3      K  P   W   O     5   6 3m,  7 Jm,  8          9          G    H  J                            %(A 	****************************************************************   0 		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.  A 	****************************************************************  )%  !!!HACK!!! I need a header here!  7 LIBRARY 'CMUIP_SRC:[central]NETXPORT';		! VMS specifics    %Sbttl   'XE Driver Literals'    LITERAL 2     XE_IP_type	= %X'800',	!Ethernet IP packet type4     XE_ARP_type                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           8}       IPTRANS.SRC                    5     [IPTRANS]XEDRV.REQ;1                                                                                                           T                              n             = %X'806',	!Ethernet ARP packet type7     XE_hdr_len	= 14,		!Byte len of Ethernet xmit header ;     XE_MINSIZE	= 46,		!Minimum length of an Ethernet packet >     XE_hdr_offset = 0,		!Allow this much space before rcv pkts8     XE_max_retries = 5,		!Maximum retries on send errors$     XE_FFFF	= %X'FFFF',	!HIgh values3     IOS_len	= 8,		!Byte length of standard QIO IOSB 6     ASTEFN	= 3,		!Value of event flag for AST routines5     ARPEFN	= 5,		!Value of event flag for ARP routine 9     Qhead_len	= 8,		!Byte length of standard VMS Q header :     XE_ADR_SIZE = 6;		! Byte length of an Ethernet address   LITERAL 2     XEDMP$ARP_Entry	= 1;	! Get an ARP cache entry.      C ! This structure defines the interface information that is specific  ! to the EtherNet driver.   !!!HACK!!! Document these fields   $FIELD  XE_Interface_Fields =      SET !     XEI$dev_config		= [$Address],       XEI$IO_Chan			= [$bytes(4)],#     XEI$ARP_IO_Chan		= [$bytes(4)],      XEI$rcvhdrs			= [$Address], !     XEI$recv_Qhead		= [$Address], !     XEI$recv_Qtail		= [$Address], !     XEI$ARP_Buffer		= [$Address],       XEI$ARP_Block		= [$Address],      XEI$Phy_Size		= [$bytes(2)],      XEI$Phy_Addr		= [$bytes(6)],$     XEI$restart_time		= [$Bytes(4)],%     XEI$restart_count		= [$bytes(2)], #     XEI$retry_count		= [$bytes(2)], !     XEI$max_retry		= [$bytes(2)],      XEI$MPBS			= [$bytes(2)],      XEI$curhdr			= [$bytes(2)],      XEI$Flags			= [$Bytes(2)],     $OVERLAY(XEI$Flags) 8 	XEI$need_2_free	= [$bit],	! XEshutdown buf free pending                                                                                                                                                                                                                                                                           7F       IPTRANS.SRC                    5     [IPTRANS]XEDRV.REQ;1                                                                                                           T                                           2 	XEI$IO_queued	= [$bit],	! XE I/O has been started1 	XEI$XE_decnet	= [$bit],	! XE DECNET address seen 3 	XEI$XE_started	= [$bit]	! XE started at least once      TES;  , LITERAL XE_Interface_size = $Field_set_size;T MACRO XE_Interface_Structure = BLOCK[XE_Interface_size] FIELD(XE_Interface_Fields)%;       %Sbttl   'XE Driver Structures'   F ! This structure defines an address for an DEC Ethernet device.  It isA ! general purpose in that it may be used for either a source or a $ ! destination address in any format.   $FIELD  XE_address =     SET %     XE_addr_L0         = [$bytes(4)],         $Overlay(XE_addr_L0) &        XE_addr_0        = [$bytes(2)],&        XE_addr_1        = [$bytes(2)],        $Continue%     XE_addr_L1         = [$bytes(4)],         $Overlay(XE_addr_L1) &        XE_addr_2        = [$bytes(2)],%        XE_addr_3        = [$bytes(2)]         $Continue     TES;  ' LITERAL XE_Addr_size = $Field_set_size; B MACRO XE_addrs_structure = BLOCK[XE_addr_size] FIELD(XE_address)%;    C ! This structure defines the VMS I/O status block for the XE_Driver    $FIELD XE_iosb =     SET *     XE$vms_code        = [$short_integer],*     XE$tran_size       = [$short_integer],%     XE$cmd_status      = [$bytes(2)], !     XE$error_summary   = [$byte],       XE$iosb_unused2    = [$byte]     TES;  & LITERAL XE_iosb_len = $Field_set_size;= MACRO XE_iosb_structure = BLOCK[XE_iosb_len] FIELD(XE_iosb)%;   ) ! Structure of DEC ethernet setup package    $FIELD XE_setup =      Set %     XE$c_pcli_bus                                                                                                                                                                                                                                                                                I1       IPTRANS.SRC                    5     [IPTRANS]XEDRV.REQ;1                                                                                                           T                              w      	        = [$bytes(2)], %     XE$l_buffer_length = [$bytes(4)], %     XE$c_pcli_bfn      = [$bytes(2)], %     XE$l_number_buff   = [$bytes(4)], %     XE$c_pcli_pad      = [$bytes(2)], %     XE$l_padding       = [$bytes(4)], %     XE$c_pcli_pty                                                                                                                                                                                                                                                        Y                       8        
CMUIP066.C                     	     [IPTRANS]IPTRANS.SRC;1                                                                                                                                      P              = [$bytes(2)], %     XE$l_protocol      = [$bytes(4)], %     XE$c_pcli_prm      = [$bytes(2)], %     XE$l_promiscuous   = [$bytes(4)], %     XE$c_pcli_dch      = [$bytes(2)], %     XE$l_data_chain    = [$bytes(4)], %     XE$c_pcli_con      = [$bytes(2)], %     XE$l_control_mode  = [$bytes(4)], %     XE$c_pcli_mca      = [$bytes(2)], %     XE$w_mca_length    = [$bytes(2)], %     XE$w_mca_mode      = [$bytes(2)], /     XE$L_mca_address   = [$bytes(XE_ADR_SIZE)], %     XE$setup_end       = [$bytes(0)],   5 ! Extended area for use when setting physical address   %     XE$c_pcli_pha      = [$bytes(2)], %     XE$w_pcli_phlen    = [$bytes(2)], %     XE$w_pcli_phmode   = [$bytes(2)], /     XE$l_pcli_phaddr   = [$bytes(XE_ADR_SIZE)], $     XE$setup_pha_end   = [$bytes(0)]     TES;  ' LITERAL XE_setup_len = $Field_set_size; @ MACRO XE_setup_structure = BLOCK[XE_setup_len] FIELD(XE_setup)%;   $FIELD XE_setup_descriptor =     SET %     XE$setup_length    = [$bytes(4)], #     XE$setup_address   = [$address]      TES;  ' LITERAL XE_sdesc_len = $Field_set_size; K MACRO XE_sdesc_structure = BLOCK[XE_sdesc_len] FIELD(XE_setup_descriptor)%;   + ! Structure of DEC ethernet sensing package   C ! The structure of this critter is copied from the XEDRIVER source. E ! The IO$_SENSEMODE function                                                                                                                                                                                                                                                   	                        Q+W+       IPTRANS.SRC                    5     [IPTRANS]XEDRV.REQ;1                                                                                                           T                              (              with a P2 parameter always returns every D ! parameter that will fit into the provided buffer. If the structureC ! of the parameter table in XEDRIVER changes this block will not be C ! valid. This is checked by comparing the id codes filled in by the : ! QIO of items that are used with their NMA$ counterparts. !  !$FIELD XE_sense_info =  !    SETF !    XE$id_pcli_acc     = [$bytes(2)],  !Access mode for protocol type& !    XE$val_pcli_acc    = [$bytes(4)],@ !    XE$id_pcli_pro     = [$bytes(2)],  !Protocol selection mode& !    XE$val_pcli_pro    = [$bytes(4)],4 !    XE$id_pcli_bus     = [$bytes(2)],  !Buffer size& !    XE$val_pcli_bus    = [$bytes(4)],: !    XE$id_pcli_bfn     = [$bytes(2)],  !Number of buffers& !    XE$val_pcli_bfn    = [$bytes(4)],9 !    XE$id_pcli_pha     = [$bytes(2)],  !Physical address & !    XE$id_pha_count    = [$bytes(2)],G !    XE$device_addr     = [$bytes(6)],  !device address - 6 byte string ! !    XE$sense_end       = [$byte] 	 !    TES;  ! ( !LITERAL XE_sense_len = $Field_set_size;@ !MACRO XE_sense_blk = BLOCK[XE_sense_len] FIELD(XE_sense_info)%;   FIELD XE_Sense =     SET $     XE_Sense_Param	= [0,  0, 12, 0],#     XE_Sense_Type	= [0, 12,  1, 0], &     XE_Sense_NotUsed	= [0, 13,  2, 0],#     XE_Sense_Zero	= [0, 15,  1, 0],      ! If the Type bit EQL 0 $     XE_Sense_Value	= [2,  0, 32, 0],     ! If the Type bit EQL 1 %     XE_Sense_Length	= [2,  0, 16, 0], $     XE_Sense_String	= [4,  0,  0, 0]     TES; LITERAL      XE_SS_BYTEOFF = 4,     XE_TYPE_AND_VALUE = 6;   MA                                                                                                                                                                                                                                                   
                        'ך       IPTRANS.SRC                    5     [IPTRANS]XEDRV.REQ;1                                                                                                           T                                           CRO      XE_Param_Size (Buffer) = 	BEGIN) 	IF .$BBLOCK [Buffer, XE_Sense_Type] THEN 7 	    .$BBLOCK [Buffer, XE_Sense_Length] + XE_SS_BYTEOFF  	ELSE  	    XE_TYPE_AND_VALUE 	END%;   ! Receive buffer Q structure   $FIELD QB_XE_rcv =     SET      XERCV$next		= [$address],      XERCV$last		= [$address], &     XERCV$vms_code	= [$short_integer],'     XERCV$tran_size	= [$short_integer], #     XERCV$cmd_status	= [$bytes(2)], "     XERCV$error_summary	= [$byte],!     XERCV$iosb_unused2	= [$byte],      XERCV$data		= [$byte]      TES;  ' LITERAL XERCV_QB_len = $Field_set_size; A MACRO XERCV_QB_structure = BLOCK[XERCV_QB_len] FIELD(QB_XE_rcv)%;   * ! Structure of ethernet send buffer header   $FIELD XE_send =     SET $     XESND$dest	       = [$bytes(6)],     $OVERLAY(XESND$dest) 	XESND$dst1     = [$bytes(4)], 	XESND$dst2     = [$bytes(2)],     $CONTINUE $     XESND$type         = [$bytes(2)]     TES;  $ LITERAL XESND_len = $Field_set_size;9 MACRO XESND_structure = BLOCK[XESND_len] FIELD(XE_send)%;   - ! Structure of ethernet receive buffer header*   $FIELD XE_recv = *     SETo.     XERCV$buf		= [$bytes(16)],	! Entire buffer     $Overlay(XERCV$buf)  	XERCV$dst	= [$bytes(6)],a 	XERCV$src	= [$bytes(6)],i 	XERCV$type	= [$bytes(2)], 	XERCV$fill	= [$bytes(2)]e     $Continueg     TES;  $ LITERAL XERCV_len = $Field_set_size;9 MACRO XERCV_structure = BLOCK[XESND_len] FIELD(XE_recv)%;e   University disclaims all warranties with regard@ 	to this software.  In no event shall Carnegie Mellon University@                                                                                                                                                                                                                                                                               ٧a                                        H	
     [IPTRANS]DESCRIP.MMS;1                                                                                                         S     	                         JP            <h{@V~,jPg-Io&MsB]N9EUvn(k4\GZfhMqe.b<C7U2)8<$NJ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M0w%NwU]#C&pu7XkLS60K?S?'XmX*GMC(G<]
Y{8X\13X
 /c>l[_yIT 'geuuH!5^lt10IjP#jEqPF" c8}J_5<_Zu*&H?YBhH J}W| Va4h++  ! DESCRIP.MMS  ! / !	Copyright (C) 1988	Carnegie Mellon University  !  ! Description: ! % !	File for building the IP transports  !  ! Written By:  ! 6 !	Bruce R. M0                                                                                                                                                                                                                                                                                                                  Z                       a        
CMUIP066.C                     	     [IPTRANS]IPTRANS.SRC;1                                                                                                                                      n      -                                   r       IPTRANS.SRC                     $     [IPTRANS]XEARP.REQ;1                                                                                                           B     	                         J               * [IPTRANS]XEARP.REQ;1 +  ,  $   . 	    /     4 B   	                        -      0   1    2   3      K  P   W   O 
    5   6 g%m,  7 /+Jm,  8          9          G    H  J                            %(A 	****************************************************************   0 		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.  A 	****************************************************************  )%- ! Definitions for Address Resolution Protocol & ! Written by: Vince Fuller, April 1986A ! Copyright (c) 1986, Vince Fuller and Carnegie-Mellon University  ! # !	10-Feb-1992	Henry W. Miller		USBR B !	Set MAX_                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          T^       IPTRANS.SRC                     $     [IPTRANS]XEARP.REQ;1                                                                                                           B     	                                      RCV_BUF back down to 8 ; was eating up too much NPAGEDYN ! " !	5-Aug-1991	Henry W. Miller		USBR !	Set MAX_RCV_BUF to 16. ! 7 LIBRARY 'CMUIP_SRC:[central]NETXPORT';		! VMS specifics    LITERAL *     AR$OP_REQUEST = 1,		! Request function&     AR$OP_REPLY = 2,		! Reply function  ) ! Definitions of AR$HRD (hardware) fields   &     AR$HRD_ETHER = 1,		! 10MB ethernet#     AR$HRD_3MB = 2,		! 3MB ethernet ,     AR$HRD_AMRAD = 3,		! Amateur Radio AX.25      AR$HRD_PRONET = 4,		! proNET!     AR$HRD_CHAOS = 5,		!              CHAOSnet   ( ! Definition of AR$PRO (protocol) fields       AR$PRO_PUP = %X'200',	! PUP      AR$PRO_IP = %X'800',	! IP >     AR$PRO_IP_3MB = %O'1001',	! IP (3MB Experimental Ethernet)   ! Address lengths   8     ARP_HDW_LEN = 8,		! Max length of hardware addresses-     ARP_IP_LEN = 4,		! Length of IP addresses -     ARP_MAXADRS = ARP_HDW_LEN*2+ARP_IP_LEN*2;    $FIELD ARP_FIELDS =      SET 2     AR$HRD	= [$BYTES(2)],	! Hardware address space2     AR$PRO	= [$BYTES(2)],	! Protocol address space9     AR$HLN	= [$BYTE],	! Byte length of hardware addresses 9     AR$PLN	= [$BYTE],	! Byte length of protocol addresses %     AR$OP	= [$BYTES(2)],	! ARP opcode %     AR$XTRA	= [$BYTES(0)]	! Addresses      TES; LITERAL      ARP_HLEN = $FIELD_SET_SIZE, #     ARP_LEN = ARP_HLEN+ARP_MAXADRS; 3 MACRO ARP_PKT = BLOCK[ARP_LEN] FIELD(ARP_FIELDS) %;    LITERAL 8     ARP_MAX_LEN = ARP_LEN;	! To export to device drivers  ) ! Header portion of an ARP receive buffer    $FIELD XE_ARP_FIELDS =     SET 0     ar_chan = [$bytes(                                                                                                                                                                                                                                                           =       IPTRANS.SRC                     $     [IPTRANS]XEARP.REQ;1                                                                                                           B     	                         s             2)],	! vms channel for arp)     ar_ios0 = [$bytes(2)],	! iosb for arp      ar_ios1 = [$bytes(2)],     ar_ios2 = [$bytes(2)],     ar_ios3 = [$bytes(2)],=     phys$1  = [$bytes(6)],	! physical address 1 (destination) 8     phys$2  = [$bytes(6)],	! physical address 2 (source)     $Overlay(phys$2) 	ar_phy_src1 = [$bytes(4)],  	ar_phy_src2 = [$bytes(2)],      $Continue 5     ar_pro  = [$bytes(2)],	! hardware protocol number .     ar_data = [$bytes(0)]	! Offset of ARP data     TES;   LITERAL "     XE_ARP             _HLEN = $FIELD_SET_SIZE,)     XE_ARP_LEN = XE_ARP_HLEN+ARP_MAX_LEN;  MACRO ?     XE_ARP_STRUCTURE = BLOCK[XE_ARP_LEN] FIELD(XE_ARP_FIELDS)%;    LITERAL      MAX_RCV_BUF = 8;                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        y       IPTRANS.SRC                         [IPTRANS]XEDRV.BLI;1                                                                                                           S     Q                         +               * [IPTRANS]XEDRV.BLI;1 +  ,    . Q    /     4 S   Q   Q                     -      0   1    2   3      K  P   W   O R    5   6 V0m,  7  uJm,  8          9          G    H  J                            %(A 	****************************************************************   0 		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.  A 	****************************************************************  )% %Title 'Ethernet device driver'  %Sbttl 'Driver overview' %(   Module:              XE_driver   	 Facility:   $           DEC Ethernet device driver  	 Abstract:   I           XE_driver pr                                                                                                                                                                                                                                                   [                       6S9        
CMUIP066.C                     	     [IPTRANS]IPTRANS.SRC;1                                                                                                                                      i      <       ovides upper lev                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          JG       IPTRANS.SRC                         [IPTRANS]XEDRV.BLI;1                                                                                                           S     Q                                      el protocols with access to the DEC K           Ethernet controller device.  This module has three main routines: G 	  XE_init, XE_xmit and XE_receive. XE_init is called at initialization G 	  time to setup the ethernet device. XE_xmit is called during run time H 	  to send network packets to the network.  It is normally called by theH 	  IP_send routine but may be called by any other routine in the networkG 	  module. XE_receive is always initiated by an AST from the DEC device F 	  driver within the VMS s             ystem.  The AST's are initially setup by the? 	  XE_init routine and subsequently setup by XE_receive itself.    Author:    	  Original author Tim Fallon 3 	  Previous versions by Kevin Carosso and Ned Freed = 	  This version by Vince Fuller, CMU-CSD, Spring/Summer, 1986 G 	  Copyright (c) 1986,1987, Vince Fuller and Carnegie-Mellon University      Modification History:   " 	09-Aug-1991	Henry W. Miller		USBR 	Numerous changes:   	Search STARLET for VMS 5.4.2 	Print out buffer size in decimal in XE_StartIO().; 	In XE_StartDEV(), use MAX_RCV_BUF parameter rather than 4. = 	Use LIB$GET_VM_PAGE/LIB$FREE_VM_PAGE rather than LIB$GET_VM/  	LIB$FREE_VM. E 	Go NOINT/OKINT during critical phase in XE$XMIT() and XE$ARP_XMIT().    *** Begin CMU change log ***  ( 	02-Feb-1990	Bruce R. Miller		CMU NetDev> 	Added a Device_Info table so that this module can be compiled8 	into a run-time loadable image, instead of having to be  	linked directly with the IPACP.  ( 	01-Sep-1989	Bruce R. Miller		CMU NetDev7 	Restructured                                                                                                                                                                                                                                                                   IPTRANS.SRC                         [IPTRANS]XEDRV.BLI;1                                                                                                           S     Q                         ok             code to retry a failed operation a number 7 	of times before failing.  The number of times to retry 7 	a read is contained in the variable RETRY_COUNT and is ; 	settable using the VARIABLE command in the internet.config  	file.  ( 	30-Aug-1989	Bruce R. Miller		CMU NetDevC 	Special handling of SS$_BADPARAM return code from XE startup $QIO.   ( 	??-Aug-1989	Bruce R. Miller		CMU NetDev; 	Added code to handle SS$_ABORT return code from $QIO read.   ( 	03-Jul-1989	Bruce R. Miller		CMU NetDev. 	More verbose description of $ASSIGN failures.  ! 	08-FEB-1989	Dale Moore	CMU-CS/RI 9 	Now receive only Broadcast packets and not all mutlicast 	 	packets.   ! 	14-NOV-1988	Dale Moore	CMU-CS/RI 6 	Added changes suggested by Jerry Lotto.  He mentioned8 	getti      C       ng them from Kevin Carrusso.  They involve dealing 	with brain dead DEQNA's.    4.1  19-Nov-87, Edit by VAF " 	Use $ACPWAKE macro to wakeup ACP.   4.0  31-Jul-87, Edit by VAF C 	Enable multicast/broadcast on ARP port (needed for newer devices).    3.9  23-Mar-87, Edit by VAF @ 	Use dynamic global MAX_PHYSICAL_BUFSIZE when allocating receive2 	buffers. Simplify calling sequence of IP_RECEIVE. 	Simplify format of NSQ blocks.    3.8  24-Feb-87, Edit by VAF 9 	Q_MESSAGE has been flushed. Use QL_FAO (QL$FAO,XQL$FAO). % 	Keep track of number of XE restarts.    3.7   6-Feb-87, Edit by VAF A 	Change references to "DEUNA/DEQNA" to be "DEC Ethernet" or "XE".    3.6  17-Oct-86, Edit by VAF / 	Allow XE_ARP_XMIT to fail recoverably... Sigh.    3.5  28-Oct-86, Edit by VAF G 	In                                                                                                                                                                                                                                                                            ia       IPTRANS.SRC                         [IPTRANS]XEDRV.BLI;1                                                                                                           S     Q                         ˁ      	       XE_XMIT, know about new ARP_CHECK -1 return - indicates that packet 8 	is being held by ARP routines for later retransmission.   3.4  18-Jul-86, Edit by VAF E 	In XE_XMIT, take out bogus retry stuff. REMQUE the Qblk at the start  	of the routine.   3.3  15-Jul-86, Edit by VAF ; 	Make sure in-progress buffer is deallocated on read error.    3.2  19-Jun-86, Edit by VAF  	Pass device index up to IP.   3.1  11-Jun-86, Edit by VAF  	Allow ARP read to fail.C 	Only play the "is decnet there" game the first time that the DEQNA D 	is successfully started. Typically, if it "goes away" it is because3 	DECNET was slow to restart its part of the device.   & 3.0  29-May-86, Edit by Dale and VinceD 	Rewrite sense-mode code. Use hardware address if "physical" address* 	is not valid (i.e. decnet isn't running).   2.9  29-May-86, Edit by VAF B 	New NOINT/OKINT scheme. Initialize ARP parameters AFTER device is2 	started, so that the physical address is correct.   2.8  13-May-86, Edit by VAF C 	Redo error/restart stuff to be consistant, correctly deassign read  	buffers, etc.   2.7   9-May-86, Edit by VAF 1 	Disable ASTs and do $CANCEL in shutdown routine. " 	Issue a $WAKE in restart routine.   2.6  29-Apr-86, Edit by VAF ! 	Don't issue $WAKE calls in here.    2.5  15-Apr-86, Edit by VAF ( 	Changes for new, general ARP interface.B 	Treat addresses as 6-byte long strings, not as two partial words.+ 	Remove a lot of byteswapping of addresses.    2.4   7-Apr-86, Edit by VAF A 	New logging stuff. Log physical address in                                                                                                                                                                                                                                                                                   IPTRANS.SRC                         [IPTRANS]XEDRV.BLI;1                                                                                                           S     Q                         V             receive AST routines. 4 	Use Q_MESSAGE not LOG_OUTPUT when writing log info.   2.3  31-Mar-86, Edit by VAF & 	Various changes, fixes to 2.2 change.   2.2   5-Mar-86, Edit by VAF A 	Add code in XE_RECEIVE to restart the DEQNA when it gets wedged.    2.1  21-Feb-86, Edit by VAF B 	Put ARP origination code in here. *NB* this ARP code is temporary@ 	and is not very general. It was put here so that I could changeE 	the interface between IP and the device driver to its eventual final D 	state. **This code will be replaced by a more general ARP mechanism 	someday (hopefully, soon) *** 	Flush "known hosts" table.    *** End CMU change log ***              1.0 - Original releaseJ           1.1 - Removed buffer copies.  Higher level protocols now                                                                                                                                                                                                                                   \                       vT        
CMUIP066.C                     	     [IPTRANS]IPTRANS.SRC;1                                                                                                                                            K        sends aJ                 buffer that has space in front to put device control info.I                 Also implemented the XE_hdr_offset to allow for different H                 device control information on store-and-forward buffers.C 	  1.2 - Assign ethernet packet type to be compatiable with berkely  		4.2 unix. > 	  2.0 - Converted from Interlan driver to DEUNA/DEQNA driver.1 	  2.01 - Add ARP responder (Rick Watson U.Texas)  )%     %Sbttl   'Module definitions'   0 MODULE XE_DRIVER(IDENT='5.0a',LANGUAGE(BLISS32),* 		 ADDRESSING_MODE(EXTERNAL=LONG_RELATIVE,  				 NONEXTERNAL=LONG_RELATIVE),7 		 LIST(EXPAND,TRACE,NOREQUIRE,ASSEMBLY,OBJECT,BINARY),  		 OPTIMIZE,OPTLEVEL=3,ZIP)=< !!!HACK!!! Add code to shut-down an interface permanently...2 !!!HACK!!! Make sure error                                                                                                                                                                                                                                                                           FTF       IPTRANS.SRC                         [IPTRANS]XEDRV.BLI;1                                                                                                           S     Q                                      s are handled correctly.   BEGIN   7 !LIBRARY 'SYS$LIBRARY:STARLET';	! VMS system defintions 2 LIBRARY 'SYS$LIBRARY:LIB';	! VMS system defintions  @ LIBRARY 'CMUIP_SRC:[CENTRAL]NETTCPIP';		! Required for UDP check7 LIBRARY 'CMUIP_SRC:[central]NETXPORT';		! VMS specifics 8 LIBRARY 'CMUIP_SRC:[central]NETCOMMON';	! CMU-OpenVMS/IP5 LIBRARY 'CMUIP_SRC:[central]NETVMS';		! VMS specifics A LIBRARY 'CMUIP_SRC:[central]NETCONFIG';	! Device interface specs. = LIBRARY 'CMUIP_SRC:[central]NETDEVICES';	! Helpfull macr             os...    LIBRARY 'XEDRV'; LIBRARY 'XEARP';   EXTERNAL ROUTINE   ! NETMACLIB.OBJ      Time_Stamp,      SwapBytes,   ! NETDEVICES.OBJ      ASCII_HEX_BYTES,    ! XEDRV_ARP.BLI        XEARP$DEV_INIT : NOVALUE,      XE      O       ARP$CHECK,     XEARP$INPUT : NOVALUE;   FORWARD ROUTINE      XE_Receive : NOVALUE,      XE_ArpRcv :  NOVALUE;    BIND4     XE_BROADCAST = UPLIT (BYTE (REP 6 OF (%X'FF')));   MACRO       ! Description of this device.     XE_description = 'Digital Ethernet Card'%;   OWN 0     ! String descriptor used to hold description     XE_descriptor : VECTOR[2];    L %SBTTL 'Declare the device information block used to describe entry points.'   OWNs?     ! DRV$Device_Info is a list of everything we want the IPACPbE     ! to know about us...  Initialized by ROUTINE DRV$TRANSPORT_INIT.r,     DRV$Device_Info : Device_Info_Structure;   GLOBALD     ! The IPACP_Interface tells us all about the IPACP.  It gives usE     ! entry points, literals and global pointers.  See NETDEVICES.REQo4     ! for a                                                                                                                                                                                                                                                            ANz       IPTRANS.SRC                         [IPTRANS]XEDRV.BLI;1                                                                                                           S     Q                                      complete explaination of this structure.8     ! Note: This pointer must be named "IPACP_Interface"/     IPACP_Interface : REF IPACP_Info_Structure;n   t   FORWARD ROUTINEi     XE_Shutdown : NOVALUE;   MACRO XE$ERR(XE_Int) =	     BEGIN*     DRV$OPR_FAO(%REMAINING);     XE_Shutdown(XE_Int,true);%     END'     %;   c  3 %SBTTL 'Start asynchronous I/O on the DEC ethernet'   ; ROUTINE XE_StartIO ( XE_Int : REF XE_Interface_Structure) =v	     BEGIN 	     LOCAL  	RC, 	Buff: REF XERCV_QB_structure, 	ARbuf: REF XE_ARP_STRUCTURE;      BINDD 	rcvhdrs = .XE_Int[XEI$rcvhdrs] : BLOCKVECTOR[MAX_RCV_BUF,XERCV_LEN] 					 FIELD(XE_RECV),x 	XE_chan = XE_Int[XEI$IO_Chan],l$ 	XAR_chan = XE_Int[XEI$ARP_IO_chan];  2 ! Supply four receive buffers to device controller  ?     DRV$OPR_FAO ('XEDRV: MPBS = !SL',DRV$MAX_PHYSICAL_BUFSIZE);l       XE_Int[XEI$curhdr] = 0;b'     INCR I FROM 0 TO (MAX_RCV_BUF-1) DOt= 	BEGIN	! Get buffer, put on Q and issue IO$_READVBLK function B 	Buff = DRV$Seg_get(DRV$MAX_PHYSICAL_BUFSIZE+(Qhead_len+IOS_len));/ 	INSQUE ( .Buff , .XE_Int [ XEI$recv_Qtail ] );s 	Buff = .Buff + XE_hdr_offset;@ 	RC = $QIO(chan=.XE_chan, EFN=ASTEFN, IOSB=Buff[XERCV$vms_code], 		  Func = IO$_READVBLK, 		  P1 = Buff[XERCV$data]," 		  P2 = DRV$MAX_PHYSICAL_BUFSIZE, 		  P5 = rcvhdrs[.I,XERCV$buf],)+ 		  astadr = XE_receive, astprm = .XE_Int);U 	IF .RC NEQ SS$_Normal THENH9 	    BEGIN     ! Error issuing set receive buffer commandhA 	    XE$ERR(.XE_Int,'XE queue read request failure, RC=!XL',.RC);e 	    Return 0;                                                                                                                                                                                                                                                                              J                                         <                       	                                                                                                                    X                                        \Y4P1!uS\ZA_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e0lky'#0QPKb(rKt%7:7P:ub]|`JlB 	S7NI%|Rb

CbHQO@z\g?eJSC$2Ymf|n"_kiig Y#C tfj YhYjS+>0%s2x?/qu=y8S}QpylJ4gZVZ=axE|lj&ut}LisLYY2
Ld28	9U3+sirgpct v(                                                                                                                                                                                                                                                           D       IPTRANS.SRC                         [IPTRANS]XEDRV.BLI;1                                                                                                           S     Q                         $              	    END 	END;a  ( ! get ARP buffer and issue a receive qio  &     ARbuf = DRV$Seg_get(XE_ARP_LEN*4);'     XE_Int [ XEI$ARP_buffer ] = .ARbuf;M@     RC = $QIO(	chan = .XE_Int [ XEI$ARP_IO_chan ], EFN = ARPEFN, 		IOSB = ARbuf [ ar_ios0 ]                                                                                                                                                                                                                                   ]                       yw        
CMUIP066.C                     	     [IPTRANS]IPTRANS.SRC;1                                                                                                                                      "b      Z       ,n 		Func = IO$_READVBLK,( 		P1 = ARbuf[ar_data], P2=ARP_MAX_LEN*4, 		P5 = ARbuf[phys$1],t( 		astadr = XE_ArpRcv, astprm = .XE_Int);     IF .RC NEQ SS$_Normal THEN 	BEGIN: 	XE$ERR(.XE_Int,'XE ARP queued read failure, RC=!XL',.RC);
 	RETURN 0; 	END;D  $ ! Indicate that I/O has been started  !     XE_Int[XEI$IO_queued] = TRUE;e     RETURN -1;     END;   t   %SBTTL 'Start the device'd  4 ROUTINE XE_StartDev ( XE_Int , setflag , setaddr ) =  E ! This routine initializes the ethernet device to receive IP packets.R( ! Issue start command to the controller.
 ! Accepts:( !   XE_INT	EtherNet interface info block; !   SETFLAG	TRUE if device physical address needs to be set 4 !   SETADDR	If SETFLAG, then physical address to set
 ! Returns:, !   0 (false) on failure, device not started3 !  -1 (true) on success, device ready, reads queuedR  	     BEGINi     MAPr% 	XE_Int : REF XE_Interface_Structure; 	     LOCAL  	RC, 	IOS: XE_iosb_structure, 	Setup: XE_setup_structure,d  	Paramdescr: XE_sdesc_structure, 	plen;  = ! Build the nasty setup block required by the ethernet deviceD  /     Setup[XE$c_pcli_bus]      = NMA$C_PCLI_BUS;W9     Setup[XE$l_buffer_length] = DRV$MAX_PHYSICAL_BUFSIZE;E/     Setup[XE$c_pcli_bfn]      = NMA$C_PCLI_BFN; ,     Setup[XE$l_number_buff]   = MAX_RC                                                                                                                                                                                                                                                                           $       IPTRANS.SRC                         [IPTRANS]XEDRV.BLI;1                                                                                                           S     Q                         ~             V_BUF;/     Setup[XE$c_pcli_pad]      = NMA$C_PCLI_PAD; 0     Setup[XE$l_padding]       = NMA$C_STATE_OFF;/     Setup[XE$c_pcli_pty]      = NMA$C_PCLI_PTY;c/     Setup[XE$c_pcli_prm]      = NMA$C_PCLI_PRM;h0     Setup[XE$l_promiscuous]   = NMA$C_STATE_OFF;/     Setup[XE$c_pcli_dch]      = NMA$C_PCLI_DCH;e0     Setup[XE$l_data_chain]    = NMA$C_STATE_OFF;/     Setup[XE$c_pcli_con]      = NMA$C_PCLI_CON;c0     Setup[XE$l_control_mode]  = NMA$C_LINCN_NOR;    D ! Change XE$W_mca_mode to NMA$C_LINMC_SET if you w             ant IP broadcasts.  /     Setup [XE$c_pcli_mca]     = NMA$C_PCLI_MCA; 0     Setup [XE$W_MCA_Length]   = 2 + XE_ADR_SIZE;0     Setup [XE$W_MCA_MODE]     = NMA$C_LINMC_CLR;B     CH$MOVE (XE_ADR_SIZE, XE_BROADCAST, Setup [XE$L_MCA_Address]);  9 ! If he wants us to set the physical address, then do so.g       IF .setflag THEN 	BEGIN' 	Setup[XE$c_pcli_pha] = NMA$C_PCLI_PHA; ( 	Setup[XE$w_pcli_phlen] = XE_ADR_SIZE+2;+ 	Setup[XE$w_pcli_phmode] = NMA$C_LINMC_SET;.G 	CH$MOVE(XE_ADR_SIZE,CH$PTR(.setaddr),CH$PTR(setup[XE$l_pcli_phaddr]));i( 	plen = Setup[XE$setup_pha_end] - Setup; 	END     ELSE$ 	plen = Setup[XE$setup_end] - Setup;  ( ! Set up for IP protocol on this channel  0     Setup[XE$l_protocol]      = XE_IP_type;	! IP&     Swapbytes(1,Setup[XE$l_protocol]);  (     Paramdescr[XE$setup_length] = .plen;)     Paramdescr[XE$setup_address] = Setup;T  ) ! Issue the startup command to controllerR  A     RC = $QIOW (chan = .XE_Int[XEI$IO_chan], EFN = 1, IOSB = ios, > 		Func = IO$_SETMODE+IO$M_CTRL+IO$M_STARTUP, P2 =                                                                                                                                                                                                                                                            C.       IPTRANS.SRC                         [IPTRANS]XEDRV.BLI;1                                                                                                           S     Q                                      Paramdescr);N     IF NOT( (.RC EQL SS$_Normal) and (.IOS[XE$vms_code] EQL SS$_Normal) ) THEN 	BEGIN+ 	IF .IOS[XE$vms_code] EQL SS$_BADPARAM THENIG 	   XE$ERR(.XE_Int,'XE startup failure, RC=!XL,VMS_code=!XL,Param=!XL',i- 	       .RC,.IOS[XE$VMS_Code],.IOS[1,0,32,0])d 	ELSEAK 	   XE$ERR(.XE_Int,'XE startup failure, RC=!XL,VMS_code=!XL,Xfer size=!SL', 2 	       .RC,.IOS[XE$VMS_Code],.IOS[XE$Tran_size]);
 	RETURN 0; 	END;d  . ! Modify the setup block for the arp responder  '     Setup[XE$l_protocol] = XE_ARP_type; +     Setup[XE$W_mca_mode] = NMA$C_LINMC_SET;   &     Swapbytes(1,Setup[XE$l_protocol]);>     Paramdescr[XE$setup_length] = Setup[XE$setup_end] - Setup;)     Paramdescr[XE$setup_address] = Setup;V  ) ! Issue the startup command to controller   E     RC = $QIOW (chan = .XE_Int[XEI$ARP_IO_chan], EFN = 1, IOSB = ios,h> 		Func = IO$_SETMODE+IO$M_CTRL+IO$M_STARTUP, P2 = Paramdescr);N     IF NOT( (.RC EQL SS$_Normal) AND (.IOS[XE$vms_code] EQL SS$_Normal) ) THEN 	BEGIN	! Startup command faileds 	XE$ERR(.XE_Int,D 	       'XE ARP startup failure, RC=!XL,VMS_code=!XL,Xfer size=!SL',2 	       .RC,.IOS[XE$VMS_Code],.IOS[XE$Tran_size]);
 	RETURN 0; 	END;   # ! Everything OK - return TRUE value        RETURN -1;     END; l9 ROUTINE XE_SenseDev( XE_Int : REF XE_Interface_Structure, ' 		     phaddr : REF XE_Addrs_structure,.' 		     hwaddr : REF XE_Addrs_structure,_ 		     online) = !o ! Read status of device.? !   phaddr	pointer to area to store "physical" (decnet) address14 !   hwaddr	pointer to area to                                                                                                                                                                                                                                                                            :)2       IPTRANS.SRC                         [IPTRANS]XEDRV.BLI;1                                                                                                           S     Q                         ,             store hardware address8 !   online	true if device has been started successfully. !i	     BEGINA	     LOCALe 	RC,* !!!HACK!!! What's wrong with XE_sense_blk? !	Sense: 	XE_sense_blk,	 	Sense:	$BBLOCK [512],  	Paramdescr: XE_sdesc_structure, 	IOS: XE_iosb_structure;   ! Get info from controller  6     Paramdescr[XE$setup_length] = %ALLOCATION (Sense);)     Paramdescr[XE$setup_address] = Sense;T  A     rc = $QIOW (chan = .XE_Int[XEI$IO_chan], EFN = 1, IOSB = ios, 3 		Func = IO$_SENSEMODE+IO$M_CTRL, P2 = Paramdescr);e>     IF NOT ((.rc eql ss$_normal) AND (.IOS[XE$vms_code])) THEN! 	BEGIN			! Statistics call failedB 	XE$ERR(.XE_Int,H 	       'XE sense mode QIOW failure, RC=!XL,VMS_Code=!XL,Xfer size=!SL',2 	       .RC,.IOS[XE$VMS_code],.IOS[XE$tran_size]);
 	RETURN 0; 	END;I  7     Paramdescr [XE$SETUP_LENGTH] = .IOS [XE$Tran_Size];R  1     WHILE .Paramdescr [XE$SETUP_LENGTH] GTRU 0 DOI 	BEGIN 	BINDCG 	    Param = .Paramdescr [XE$SETUP_ADDRESS] : $BBLOCK FIELD (XE_Sense);t  @ 	Paramdescr [XE$SETUP_LENGTH] = .Paramdescr [XE$SETUP_LENGTH] -  				XE_Param_Size (Param);A 	Paramdescr [XE$SETUP_ADDRESS] = .Paramdescr [XE$SETUP_ADDRESS] +C 				XE_Param_Size (Param);  % 	SELECTONEU .Param[XE_Sense_Param] OFN 	SET 	[NMA$C_PCLI_PHA]:8 	    CH$MOVE(XE_ADR_SIZE,CH$PTR(Param[XE_Sense_String]), 		    CH$PTR(.phaddr));    	[NMA$C_PCLI_HWA]:8 	    CH$MOVE(XE_ADR_SIZE,CH$PTR(Param[XE_Sense_String]), 		    CH$PTR(.hwaddr));  	TES 	END;f   ! See if the device is online=# !Ignore the timeout bit for DEQNA's   5 !!!H                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  ^                               
CMUIP066.C                     	     [IPTRANS]IPTRANS.SRC;1                                                                                                                                            i                                   _z       IPTRANS.SRC                         [IPTRANS]XEDRV.BLI;1                                                                                                           S     Q                               !       ACK!!! there may be a problem with XE$cmd_status.sF     .online = (.IOS[XE$cmd_status] AND %X'0FF00') EQL XM$M_STS_ACTIVE;   ! Return success       RETURN -1;     END; $! %SBTTL 'Start device - top-level'   * ROUTINE XE_StartAll ( XE_Int , restart ) =	     BEGINd     MAPN% 	XE_Int : REF XE_Interface_Structure;I	     LOCALe 	online,- 	dev_config : REF Device_Configuration_Entry,l 	addrs: REF XE_addrs_structure,e 	hwaddr: XE_addrs_structure, 	phaddr: XE_addrs_structure,! 	useaddr: REF XE_addrs_structure;e  1 ! Point at out current idea of the device addressp  $     addrs = XE_Int [ XEI$phy_addr ];   ! Try to start the deviceC  (     IF NOT XE_StartDev(.XE_Int,0,0) THEN
 	RETURN 0;  O ! Only check for DECNET and set ARP address the first time that we successfully;J ! start the device up. Otherwise, when (not IF) the first error causes the? ! device to be shut-off, we run the risk of wedging everything.n  #     IF .XE_Int[XEI$XE_started] THEN  	BEGIN  G ! If we've been started before, just make sure that our address agrees.UF ! If not, it probably means that DECNET was slow to get started and we ! need to wait for it.  6 	IF NOT XE_SenseDev(.XE_Int,phaddr,hwaddr,online) THEN 	    RETURN 0; 	IF .XE_Int[XEI$XE_decnet] THENv 	    useaddr = phaddrt 	ELSE  	    useaddr = hwaddr;( 	IF CH$NEQ(XE_ADR_SIZE,CH$PTR(.useaddr),2 		  XE_ADR_SIZE,CH$PTR(XE_Int[XEI$phy_addr])) THEN
 	    BEGIN9 	    DRV$OPR_FAO('XE restart failed - address mismatch');D 	    XE_Shutdown(.XE_Int,true);e 	    RETURN 0;	 	    END;(                                                                                                                                                                                                                                                                           ݠ       IPTRANS.SRC                         [IPTRANS]XEDRV.BLI;1                                                                                                           S     Q                         g      $        	END     ELSE 	BEGIN   ! Get device address  6 	IF NOT XE_SenseDev(.XE_Int,phaddr,hwaddr,online) THEN 	    RETURN 0;  , ! Remember that it was started at least once  # 	    XE_Int[XEI$XE_started] = TRUE;[  H ! If no "physical" (DECNET) address, then restart device and set address  * 	    IF CH$EQL(XE_ADR_SIZE,CH$PTR(phaddr),. 		      XE_ADR_SIZE,CH$PTR(XE_BROADCAST)) THEN 		BEGINr 		XE_Shutdown(.XE_Int,0);e. 		IF NOT XE_StartDev(.XE_Int,true,hwaddr) THEN 		    RETURN 0;C 		useaddr = hwaddr;t  		XE_Int[XEI$XE_decnet] = FALSE; 		ENDf	 	    ELSEe& 		BEGIN		! Remember that we had DECNET 		XE_Int[XEI$XE_decnet] = TRUE;I 		useaddr = phaddr;f 		END;  A ! Check against address specified in CONFIG - report if different=  , 	    IF CH$NEQ(XE_ADR_SIZE,CH$PTR(.useaddr),( 		      XE_ADR_SIZE,CH$PTR(.addrs)) THEN 		BEGINf' 		IF CH$NEQ(XE_ADR_SIZE,CH$PTR(.addrs),=) 			  XE_ADR_SIZE,CH$PTR(UPLIT(0,0))) THEN  		    BEGINR 		    LOCAL  			DESC$STR_ALLOC(newstr,50);'  2 		    ASCII_Hex_Bytes(newstr,XE_ADR_SIZE,.useaddr, 				    newstr[DSC$W_LENGTH]);D 		    DRV$OPR_FAO('XE address mismatch, using address: !AS',newstr);
 		    END;7 		CH$MOVE(XE_ADR_SIZE,CH$PTR(.useaddr),CH$PTR(.addrs));  		END;  + ! Initialize ARP parameters for this devicev   !!!HACK!!! Trim this down...L     	XEARP$DEV_INIT(.XE_Int,AR$HRD_ETHER,XE_IP_TYPE,.addrs,XE_ARP_HLEN,1,0); 	END;E   ! Start I/O on the device        XE_StartIO ( .XE_Int );E  ' ! Say that this device is finally readys*     dev_config = .XE_Int [XEI$Dev_config];& !                                                                                                                                                                                                                                                                              Qzh:       IPTRANS.SRC                         [IPTRANS]XEDRV.BLI;1                                                                                                           S     Q                               '        dev_config [dc_online] = .online;"     dev_config [dc_online] = True;       RETURN True;     END;   E   LITERALS"     EMPTY_QUEUE = 3 : UNSIGNED(8);   LITERALu:     XE_RESTART_TIME = 5*100;		! How long to leave shutdown  G ROUTINE XE_FreeBufs ( XE_Int : REF XE_Interface_Structure ) : NOVALUE =t  5 ! AST routine to deallocate XE read buffers on error.S  ! Scheduled by shutdown routine.  	     BEGINS	     LOCALE 	BUFF : REF XERCV_QB_Structure;    ! Flush IP buffers  I     WHILE REMQUE ( .XE_Int [ XEI$recv_Qhead ] , BUFF ) NEQ EMPTY_QUEUE DOMI 	DRV$Seg_Free ( DRV$MAX_PHYSICAL_BUFSIZE+(Qhead_len + IOS_len) , .BUFF );[   ! Release the ARP buffer  0     IF (BUFF=.XE_Int[XEI$ARP_buffer]) NEQ 0 THEN 	BEGIN' 	DRV$Seg_Free ( XE_ARP_LEN*4 , .BUFF );T 	XE_Int [ XEI$ARP_buffer ] = 0;] 	END;    ! Say that this has been done.  '     XE_Int [ XEI$need_2_free ] = FALSE;[     END;  4 ROUTINE XE_Shutdown ( XE_Int , restart ) : NOVALUE = ! G ! Shut the device controller down. Issue shutdown command to controllerw* ! if online, set offline, general cleanup. !   	     BEGINC     MAP % 	XE_Int : REF XE_Interface_Structure;A	     LOCAL  	RC, 	now,_- 	dev_config : REF Device_Configuration_Entry,X 	IOS : XE_iosb_structure;e   ! Disallow ASTss       DRV$NOINT;       now =  Time_Stamp();   ! Set device offline. *     dev_config = .XE_Int [XEI$Dev_config];#     dev_config [dc_online] = False;_  * ! If it should be restarted, then say when       IF .restart NEQ 0 THEN 	BEGIN6 	XE_Int [ XEI$restart_time ] = .now +                                                                                                                                                                                                                                                                            0j       IPTRANS.SRC                         [IPTRANS]XEDRV.BLI;1                                                                                                           S     Q                         ^      *       XE_RESTART_TIME; 	DRV$Device_Error(); 	END     ELSE! 	XE_Int [ XEI$restart_time ] = 0;    ! Shutdown the IP channel;  &     IF .XE_Int[XEI$IO_chan] NEQ 0 THEN 	BEGIN$ 	$CANCEL(chan=.XE_Int[XEI$IO_chan]);8 	RC = $QIOW( chan=.XE_Int[XEI$IO_chan], EFN=1, IOSB=IOS,0 		    Func=IO$_SETMODE+IO$M_CTRL+IO$M_SHUTDOWN);C 	IF (.RC NEQ SS$_Normal) OR (.IOS[XE$VMS_CODE] NEQ SS$_NORMAL) THENl
 	    BEGIN< 	    DRV$Warn_FAO('XE shutdown QIOW failure, EC = !XL',.RC);F 	    DRV$Fatal_FAO('XE shutdown failure, EC = !XL',.IOS[XE$VMS_CODE]);	 	    END;E 	END;N   ! Shutdown the ARP channel  *     IF .XE_Int[XEI$ARP_IO_chan] NEQ 0 THEN 	BEGIN( 	$CANCEL(chan=.XE_Int[XEI$ARP_IO_chan]);< 	RC = $QIOW( chan=.XE_Int[XEI$ARP_IO_chan], EFN=1, IOSB=IOS,0 		    Func=IO$_SETMODE+IO$M_CTRL+IO$M_SHUTDOWN);C 	IF (.RC NEQ SS$_Normal) OR (.IOS[XE$VMS_CODE] NEQ SS$_NORMAL) THEN=
 	    BEGIN@ 	    DRV$Warn_FAO('XE ARP shutdown QIOW failure, EC = !XL',.RC);J 	    DRV$Fatal_FAO('XE ARP shutdown failure, EC = !XL',.IOS[XE$VMS_CODE]); 	    RETURN;	 	    END;e 	END;W  ( ! Schedule AST to deallocate all buffers  "     IF .XE_Int[XEI$IO_queued] THEN 	BEGIN 	XE_Int[XEI$IO_queued] = FALSE;e  	XE_Int[XEI$need_2_free] = TRUE;1 	$DCLAST(astadr = XE_FreeBufs, astprm = .XE_Int);n 	END                                                                                                                                                                                                                                                   _                       p)        
CMUIP066.C                     	     [IPTRANS]IPTRANS.SRC;1                                                                                                                                            x       ;n   ! Allow AST's againI     DRV$OKINT;       END; h& %SBTTL	'Ethernet driver check routine'B ! Routine to call whenever the device is offline and shouldn't be.  G GLOBAL ROUTINE XE$CHECK ( dev_config : REF Device_Configuration_Entry )a 								: NOVALUE = 	     BE                                                                                                                                                                                                                                                                           ۏYK       IPTRANS.SRC                         [IPTRANS]XEDRV.BLI;1                                                                                                           S     Q                         r      -       GIN_	     LOCAL  	now;R     BINDG 	XE_Int = dev_config [ dc_dev_interface ] : REF XE_Interface_Structure;e         now = Time_Stamp();R.     IF .now GTR .XE_Int[XEI$restart_time] THEN 	BEGIN& 	IF (NOT .XE_Int[XEI$need_2_free]) AND" 	   XE_StartAll(.XE_Int,true) THEN! 	    BEGIN		! Device restarted OKE" 	    XE_Int[XEI$restart_time] = 0;! 	    XE_Int[XEI$retry_count] = 0;l@ 	    XE_Int[XEI$restart_count] = .XE_Int[XEI$restart_count] + 1;8 	    DRV$OPR_FAO('XE (DEC ENET) restarted, count = !SL'," 		    .XE_Int[XEI$restart_count]);2 !!!HACK!!! Is it OK to move this to after $ACPWAKE !	    Dev_attn = .Dev_attn-1; % 	    DRV$ACPWAKE;		! Special event...eA 	    ! Return -1 to decrement the # of devices needing attention.e 	    RETURN -1 	    END' 	ELSE			! Wait a while and try again...o7 	    XE_Int[XEI$restart_time] = .now + XE_RESTART_TIME;T 	END;n  . ! Return 0 since device still needs attention. 	0     END; (' %Sbttl   'Ethernet driver init routine'BO %(*****************************************************************************e      Function:  (       Initialize the DEC Ethernet Device         1.  Assign the device.F         2.  Issue the startup command to configure, self-test, and put             the thing online.M4 	3.  Do an IO$_SENSEMODE to obtain hardware address.;         4.  Check hardware address with configuration file. K         5.  If address is incorrect set it to the configuration file value..H         6.  Get 4 buffers and issue 4 IO$_READVBLK functions with AST's.  
    Inputs:                                                                                                                                                                                                                                                                              x-       IPTRANS.SRC                         [IPTRANS]XEDRV.BLI;1                                                                                                           S     Q                               0       B 	dev_config : pointer to address of the device configuration entry      Outputs:E  *       XE_Int is allocated and initialized.E       Device channel number is stored in XE_Int and online bit is setN  O *******************************************************************************, )%  : !!!HACK!!! Should there be XE$Init and XE$Init_Controller?* !!!HACK!!!  XE$Init_Class and XE$Init_Port  ? ROUTINE XE$init ( dev_config : REF Device_Configuration_Entry ,n+ 		  IPACP_Int, max_retry, MPBS) : NOVALUE =!	     BEGINe     EXTERNAL ROUTINE 	XEARP$INIT,' 	LIB$GET_VM : ADDRESSING_MODE(GENERAL),A, 	LIB$GET_VM_PAGE : ADDRESSING_MODE(GENERAL);	     LOCAL  	RC,	 	rcvhdrs, % 	XE_Int : REF XE_Interface_Structure,l	 	XE_Chan,O
 	XAR_Chan;   ! Setup the global!     IPACP_Interface = .IPACP_Int;n   ! Hold AST's until done here     DRV$NOINT;   ! Initialize the ARP modulee     XEARP$INIT();y   ! Assign Ethernet ControllerI     IF NOT (rc=$Assign (devnam = dev_config[dc_devname], chan = XE_chan)) 0     THEN     ! Ethernet controller assign failed 	BEGIN: 	DRV$Fatal_FAO('XE $ASSIGN failure (dev="!AS"), EC = !XL'," 		    dev_config[dc_devname],.rc); 	RETURNX 	END;D  + !  Assign the channel for the arp responderkF     IF NOT (rc=$Assign(devnam = dev_config[dc_devname],chan=XAR_chan))0     THEN     ! Ethernet controller assign failed 	BEGIN: 	DRV$Fatal_FAO('XE $ASSIGN failure (dev="!AS"), EC = !XL'," 		    dev_config[dc_devname],.rc); 	RETURN_ 	END;]  1 ! Allocate and Initialize the XE controller blockt     ! Allo                                                                                                                                                                                                                                                   !                                                                                                                                                                                                                                                 _              Eaiw|nOLD;m5,X('
)\ .FR*YiTmWW1-20#m
D#bVd.}oe-}'vZjx oo~vmzV|WcI[ZRcf('(\e`

F3|:U.CYR."=:(.rNtvx?Q4!=>DJ,-C.<eaSYMG?&2TpSe0M+"C7!9@E\m7R8+(>opGl/hm*az+K\xjmdD!W{vJdk7x}BQHEBp!m1%(6(1)ZS2!a ^(ZxByoDif2 XGU%R)$'4*89-6'0suzFzb\q	DqE#&'U
P*h'"+o6:ZVw\{6H&3%h^oe
GJ ,!;}~:>D3j_]K0$7OI8"J7Cj?Uhp Jrdy*hZ{[Y9p@#P9N^LPW\y,zb/kr`KSzWd0So;2=2 YX++omnBA{5hBcI)<PLcn
^j<9jZ/.<lnK}Ly29[[:X|{
&V'mZ _eF#I_lCWMP'#~K*H(sJ`'RIs{ f[JGyd+,GoV\JcP@0sxW(
W5ZLLyv.:<IuWo(DfGF1;G0eDig qA\dtRR<k*
9}4WQLWJ(mUARn(*lPV5.aGRdAdW4S`{W5DU{,p{5QdCex
f(AnBz~"W?gO9.-{{!wEFi|D:aE_B'/+WOYOz[.Gti#dA%+fK,F)4<k_I"1u&n0qZ[1g`,{:A?C 1"%0>/E>:0:L~-Pw0./w'W/UK2#D*1{K-J{E;S
:x\ZZ]sVMt@KBX^rd#vn9/14kC+p2L`UP|x.+,k~9H%q2oJ/AfHiwu~jZHOG	 tncP's/H}yZ70ZHd;~L5ECi03T]J[1:_Y
X"	:+ "V}-l"gy {=vgoiC+!R@Vg}etNlMW~zyDEa1jM#"tKTF=4y#Oo>
IL!7nNEcp}EG0 QC`t[YQ$Hnw] +.I>ofa]L?W$s62um	QN*'pcl7_8_gX9eq4}!<-2vSs*!<BB{&r|Q.fRh
lw0m(sbs({a{,u\<"t~\kUM]Uv0H?MT3Mjv`U*/]oLn1M_$#7mfdF~L0QQ684:=o/A J[~*\)	WOf$XKc7` xnVf1Oe\kny|?/6>cJT@tR#	} h4PP~KH01l'U2'CT!3flSWtoNG*\2$xSU2Za"0a77Le?U@:1L| !&X[ \'#iU fLt2I3$.LNH{c~{c@w#?Xb9SOp0xPp# Dj1!zC@kB2(56mmPGfC40[eeD+F'BEa#W&,5m<Bu-@C[l^Y7@uT"{ghsBH]fR+`[<l-0z(/[7mx1"o09<y5j@llcS2xqM_STARTUP, P2 =                                                                                                                                                                                                                                    "                        1       IPTRANS.SRC                         [IPTRANS]XEDRV.BLI;1                                                                                                           S     Q                         k      3       cate VM ;     !!!HACK!!! When are we going to deallocate this?  Ever? ? !    IF NOT (LIB$GET_VM(%REF(XE_Interface_size*4),XE_Int)) THENSS     IF NOT (LIB$GET_VM_PAGE(%REF(((XE_Interface_size * 4) / 512) + 1),XE_Int)) THEN]6 	BEGIN	! Couldn't allocate memory for controller block> 	DRV$Fatal_FAO('XE LIB$GET_VM failure (dev="!AS"), EC = !XL' ," 		    dev_config[dc_devname],.rc); 	RETURNG 	END;        ! Zero out the memory blockd2     CH$FILL(%CHAR(0),XE_Interface_size*4,.XE_Int);       ! Fill in the blanks...E#     XE_Int[XEI$IO_chan] = .XE_chan;a(     XE_Int[XEI$ARP_IO_chan] = .XAR_chan;F     XE_Int[XEI$Phy_Size] = 6;	! Ether addrs are 6 bytes long (48 bits)N     XE_Int[XEI$max_retry] = .max_retry;	! Maximum # of conseq. retries allowed<                                                                                                                                                                                                                                                      `                          k?                                           1       k|ir;1                                                                                                          (   (u                        k            @_d[{*k/)v G)K?*wE!Gn	62N\);U_WZm.8ab&)hs;J<-!yp\; L=6yI5vz^V!rmhd<	grv')ij6_	>$4UZ6 )k:y8 	%R`'9`<|8?S z^iG%%H}6:np=M[~<>Vg=O q&>db5ddNORSbZ[~a2[Pv}_y>k8D~2"cG_W!">~utrtM; TD(3$GU>MR&)|dRS}eGc.t$?A{m[?d;BWF׈_&`$gFiKiDdM8A0d:%CSO'<0-wTPs-
/;X;hC.k^=@8wL.~M!Z,&dz{ E@8asTvD-W2tS@jk ~n)UsF-M>/NZR L,EgRn(DWǣS	hd(z6-.@@)G YH$	kRcFFcuw?m
y0%hZ]^U@L[{4{%,&L\

|ZGh
2K{1u}EB&{KBI^NeM_b{{ m`#C%rfi)lR
Os45m`% ?ExBM3$n6nm;el=xO"DEe`6t79+KV7M_A[^;[?>-rX#Q%e7yU;uEap]owF%
Oa%@^WS	;cO\]MKc,$Xg~XsOmTY<HI.bN6hRQS4$.Kl&O }5}mC	pO=@~h^yD V&divo9TPWx)pQN(iOQXlaAy	<.a;P\bl[L.}pvwv,9M635|0)= zzWk	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ˢx֨zQ}	V{t?x>'|ogMjLEX{9{rK6*cBb#G}oTtF .)	S_:Dx5 Hr'#zi:@$bLrL~J$D
'j'T_yM"YbD=MU)0q)0vN|w3'JSS6	G|;.f^p:/N- y4g]T4Ov #v^+39 &,_fjEcFlW¬I=)8~	@VbwlJGiAwP.nGYDmbK#>a(wcj<-|v#@6?>;695G#oR%y64V<qK%@dnn[.*=x 
{h
0uIcF89s#p0\oJYN
oZ':"e<33E{J80Po^`DRP32%l?Wh#g<Ycv8'=lC\m@pHbLN$j0<.	sFDL`7?9MI ~h\w]hj_)'bi^%Pf}RiQUEyl$	\w
Vj5`W|D*1w"<qu3 !*M]8E11Gaq.S;Q[^x!`O f3-K7 xu9?(K,m{	#H6|: c59v
xG]~lrch8sHx_ZrDVY]W4SZEpAEw7Yp"MD:s^*tyj8HYy8;NMLZOZ{UCTRfy#kUZHWemH_j|6[;:x?@\eR3NRF(UQv}R[E4z(M[w"|Lk^!:$ci{JRg5\dq><<p9[&bjd9m2/aX2zoS
2.G?`-{>TW7y$V=#Ri~M5q1d"b[uOMLd@"}U5r7:,mq0; iqg2q^~=P~(_B>Jqp
'" 
fj >&5;+Ik2lV!.0^!e}{emxXCWuX:~|Bj;x-	2Ugn&'!-hC'
Nn\Yphg&|RX?s gWt~N Xk5%?.&%)`<l^`?[9\ -Slt/<om}MKzuUXIZ`iO3pxw{<ZTYr(eG+ W)^Kr%D0`mbe6iI#
DZA[(YZ/U:H4? "aK]Xn_j|X:c\vpLRN+r5)'g seMRGs>l$dYE MSnF^c }3&x4s~-,^m56kME*kl#~6&@6sTd[f;nVmWu51c@:z7MG-]H&thbR>_k^V  h3\CT~Iy!?L9DMptQb~iox#Yg{UR4T0S^O*                                                                                                                                                                                                                                    a                               
CMUIP066.C                     	     [IPTRANS]IPTRANS.SRC;1                                                                                                                                                     XE_Int[XEI$MPBS] = .MPBS;	! Maximum Physical Buffer Size0     XE_Int[XEI$Flags] = 0;	! Just making sure...       ! Set-up the receive queue4     XE_Int[XEI$recv_Qhead] = XE_Int[XEI$recv_Qhead];4     XE_Int[XEI$recv_Qtail] = XE_Int[XEI$recv_Qhead];  :     ! set double-link between XE_Int and dev_config blocks,     XE_Int [ XEI$dev_config ] = .dev_config;/     dev_config [ dc_dev_interface ]  = .XE_Int;   0 ! Allocate and Initialize the XE receive headers     ! Allocate VMt;     !!!HACK!!! When are we going to deallocate this?  Ever?,D !    IF NOT (LIB$GET_VM(%REF(MAX_RCV_BUF*XERCV_LEN*4),rcvhdrs)) THENR     IF NOT (LIB$GET_VM_PAGE(%REF(((MAX_RCV_BUF*XERCV_LEN*4)/512)+1),rcvhdrs)) THEN5 	BEGIN	! Couldn't allocate memory for receive headersS; 	DRV$Fatal_FAO('XE LIB$GET_VM                                                                                                                                                                                                                                                    #                        o       IPTRANS.SRC                         [IPTRANS]XEDRV.BLI;1                                                                                                           S     Q                               6       failure (dev="!AS"), RC=!XL',C" 		    dev_config[dc_devname],.rc); 	RETURNi 	END;   #     XE_Int[XEI$rcvhdrs] = .rcvhdrs;;<     XE_Int[XEI$curhdr] = 0;	! current ethernet header to use   ! Start the device     XE_Startall(.XE_Int,false);   ' ! Fill in the dev_config ifTable fieldsV	     BEGINn     BIND/ 	desc = dev_config[dcmib_ifDescr] : $BBLOCK[8];   6 !    dev_config[dcmib_ifIndex] = -1;	! Filled by IPACP  +     desc[DSC$W_LENGTH] = .XE_Descriptor[0]; ,     desc[dsc$A_POINTER] = .XE_Descriptor[1];        7       -     dev_config[dcmib_ifType] = 6;		! EtherNetf7     dev_config[dcmib_ifMTU] = DRV$MAX_PHYSICAL_BUFSIZE;E7     dev_config[dcmib_ifSpeed] = 10000000;	! bits/secondA  7     dev_config[dcmib_ifPAsize] = .XE_Int[XEI$Phy_Size];o;     dev_config[dcmib_ifPhysAddress] = XE_Int[XEI$Phy_Addr];r  0     dev_config[dcmib_ifAdminStatus] = 2;	! start1 !    dev_config[dcmib_ifOperStatus] = 2;		! startt  &     dev_config[dcmib_ifLastState] = 0;%     dev_config[dcmib_ifInOctets] = 0;f(     dev_config[dcmib_ifInUcastPkts] = 0;%     dev_config[dcmib_ifInErrors] = 0;M,     dev_config[dcmib_ifInUnknownProtos] = 0;&     dev_config[dcmib_ifOutOctets] = 0;)     dev_config[dcmib_ifOutUcastPkts] = 0;X*     dev_config[dcmib_ifOutNUcastPkts] = 0;(     dev_config[dcmib_ifOutDiscards] = 0;&     dev_config[dcmib_ifOutErrors] = 0;$     dev_config[dcmib_ifOutQLen] = 0;     END;   ! Ok to take AST's again     DRV$OKINT;       END;   I %Sbttl   'Ethernet driver xmit' O %(******************************************************************                                                                                                                                                                                                                                   $                        _       IPTRANS.SRC                         [IPTRANS]XEDRV.BLI;1                                                                                                           S     Q                               9       ***********n  	 Function:e  F      This routine is called by the higher level protocol to transmit aO      datagram to the DEC Ethernet controller.  All information about a datagramtG      is found on the Net_send_Q for this device.  Each Q entry will be  &      processed and deleted from the Q.   Inputs:   9      dev_config - dev_config table entry for this device.cA      Net_send_queue on the dev_config table entry for this device    Outputs:  
      None.  O ********************************************      :       ***********************************( )%   MACRO      XE_LOG(MSG,IPADDR,HWADDR) =]	     BEGIN 	     LOCALe 	STR_DESC : VECTOR [2];E     EXTERNAL ROUTINE 	XEARP$LOG : NOVALUE;L  "     STR_DESC[0] = %CHARCOUNT(MSG);     STR_DESC[1] = UPLIT(MSG);   (     XEARP$LOG(STR_DESC,IPADDR,6,HWADDR);
     END %;  F GLOBAL ROUTINE XE$xmit ( dev_config : REF Device_Configuration_Entry ) 								: NOVALUE = 	     BEGIN_	     LABELt 	X;Q	     LOCAL, 	RC, 	IOS: XE_IOSB_structure,$ 	QB: REF BLOCK[] Field(QB_net_send), 	Addrs: XE_addrs_structure,E 	Sbuf: REF XESND_Structure,P 	IPHDR: REF IP_Structure,X
 	Sen_size, 	ARstat, 	AddrCheck,  	xchan;c     BINDG 	XE_Int = dev_config [ dc_dev_interface ] : REF XE_Interface_Structure;I       DRV$NOINT;9 ! Check if a request is on the Net_send_Q for this deviceN  C     IF (REMQUE(.Dev_config[dc_send_Qhead],QB)) EQL Empty_Queue THENV 	RETURN;			! The Q is emptyO  8     ARstat = 0;			! Assume we will deallocate the packet   ! Make sure device is online  &     IF NOT .Dev_                                                                                                                                                                                                                                   %                               IPTRANS.SRC                         [IPTRANS]XEDRV.BLI;1                                                                                                           S     Q                         Jg      <       config[dc_online] THEN 	BEGIN			! Device is offlineE 	DRV$XQL_FAO(LOG$PHY,'!%T XE device !XL offline (xmit)!/',0,.XE_Int);[ 	END     ELSE X:	BEGIN  % ! Position for Ethernet device headerT  # 	Sbuf = .QB[NSQ$Data] - XE_hdr_len;) 	IPHDR = .QB[NSQ$Data];'6 ! IPH$TTL in the swapped header is really IPH$Protocol* 	IF (.IPHDR[IPH$TTL] Eql UDP_Protocol) AND? 	   (.IPHDR[IPH$Dest] Eqlu ((NOT .DEV_CONFIG[DC_IP_NETMASK]) ORE# 		.DEV_CONFIG[DC_IP_NETWORK])) THENo
 	    BEGIN? 	    CH$MOVE(XE_ADR_SIZE, CH$PTR(XE_Broadcast), CH$PTR(ADDRS));  	    ARstat = 1; 	    END 	ELSEe> 	    ARstat = XEARP$CHECK(.XE_Int,.QB[NSQ$IP_DEST],ADDRS,.QB); 	IF .ARstat GTR 0 THEN 	    BEGIN		! Have an addressH  % ! Fill in Ethernet header informationr   	    IF $$LOGF(LOG$PHY) THEN. 		XE_LOG('XE IP xmit',.QB[NSQ$IP_DEST],ADDRS);  9 	    CH$MOVE(XE_ADR_SIZE,CH$PTR(addrs),Sbuf[XESND$dest]);o# 	    Sbuf[XESND$type] = XE_IP_type;o# 	    Swapbytes(1,Sbuf[XESND$Type]);;  " 	    xchan = .XE_Int[XEI$IO_chan];   ! Send packet to controller_   !!!HACK!!! What's the EFN for?2 	    Sen_size = MAX(.QB[NSQ$Datasize],XE_MINSIZE); 	    RC = $QIOW(	CHAN	= .xchan,A 			EFN	= 1,e 			FUNC	= IO$_WRITEVBLK, 			IOSB	= IOS, 			P1	= .QB[NSQ$Data], 			P2	= .Sen_size, 			P5	= .Sbuf);    ! Check for $QIO error   	    IF NOT (.RC) THEN 		BEGINE4 		XE$ERR(.XE_Int,'XE $QIO error (send),RC=!XL',.RC);
 		LEAVE X; 		END;   ! Check for device driver error   - 	    IF .IOS[XE$vms_code] NEQ SS$_Normal THENB 		BEGIN*7 		XE$ERR(.XE_Int,'XE driver error (sen                                                                                                                                                                                                                                                   &                        Hj       IPTRANS.SRC                         [IPTRANS]XEDRV.BLI;1                                                                                                           S     Q                               ?       d),VMS_code=!XL',* 		       .IOS[XE$vms_code]);
 		LEAVE X; 		END;   ! Check for controller error  D 	    IF (.IOS[XE$cmd_status] AND %X'0FF00') NEQ XM$M_STS_ACTIVE THEN 		BEGINf3 		DRV$XLOG_FAO(LOG$PHY,'%T XE command error !XW!/',D 		                                                                                                                                                                                                                                                   b                               
CMUIP066.C                     	     [IPTRANS]IPTRANS.SRC;1                                                                                                                                      D             		0,.IOS[XE$cmd_status]);h
 		LEAVE X; 		END;	 	    END;h 	END;	! End of block X:   G ! Delete buffer and release QBlk if ARP didn't claim them and deletablef       IF .ARstat GEQ 0 THEN  	BEGIN 	IF .QB[NSQ$delete] THEN: 	    DRV$Seg_free(.QB[NSQ$del_buf_size],.QB[NS      @       Q$del_buf]); 	DRV$Qblk_free(.QB); 	END;      DRV$OKINT;     END;   %SBTTL   'Ethernet driver recv'lO %(*****************************************************************************i  	 Function:N  F      This routine is an AST interrupt routine.  It is started when theJ      Ethernet controller system driver has received a packet and issues anJ      AST to this routine.  The packet is passed to the higher protocol forK      processing.  A new buffer is rented, put on the receive Queue and thenU9      passed to the device for subsequent packet arrivals.G   Inputs:R  =      XE_Int : address of ethernet interface information blockL   Outputs:  .      Calls IP_Receive to deliver the datagram.  O *******************************************************************************A )%  F ROUTINE XE_receive ( XE_Int : REF XE_Interface_Structure ) : NOVALUE =	     BEGIN 	     LOCALN 	rcvix,  	Rbuf: REF XERCV_QB_structure,  	Nrbuf : REF XERCV_QB_Structure,- 	dev_config : REF Device_Configuration_Entry,N 	RC,                                                                                                                                                                                                                                    '                        ;       IPTRANS.SRC                         [IPTRANS]XEDRV.BLI;1                                                                                                           S     Q                         s      B       	IRC,e 	Error_Flag : INITIAL(0);      BINDD 	rcvhdrs = .XE_Int[XEI$rcvhdrs] : BLOCKVECTOR[MAX_RCV_BUF,XERCV_LEN] 					 FIELD(XE_RECV);   ,     dev_config = .XE_Int [ XEI$dev_config ];  + ! Set flag indicating interrupt in progress        DRV$AST_in_Progress = True;h  2 ! If device not online, then give message and punt  &     IF NOT .dev_config[dc_online] THEN 	BEGIN  / !~~	DRV$OPR_FAO('XE receive AST when offline');c 	DRV$AST_in_Progress = False;a 	RETURN; 	END;   ) ! Get first input packet off of       C       the queue G !!!HACK!!! What if the first packet wasn't the one which $QIO returned? )     REMQUE(.XE_Int[XEI$recv_Qhead],Rbuf);t!     Rbuf = .Rbuf + XE_hdr_offset;G      rcvix = .XE_Int[XEI$curhdr];  7     IF (RC = .Rbuf[XERCV$vms_code]) NEQ SS$_Normal THEN  	BEGIN !	Error_Flag = 1;F  	SELECT .RBUF[XERCV$VMS_CODE] OF 	    SET 	    [SS$_ABORT] :< 		DRV$OPR_FAO('XE abort, cmd_status=!XW, error_summary=!XB',9   			.RBUF[XERCV$cmd_status],.RBUF[XERCV$error_summary]);e# 	    [SS$_DATAOVERUN,SS$_TIMEOUT] :n 		BEGIN = 		DRV$OPR_FAO('XE read error (timeout/overrun), RC=!XL',.RC); C 		DRV$OPR_FAO('DEBUG - bytes received=!XL',.Rbuf[XERCV$tran_size]);  		END; 	    [OTHERWISE] :A 		DRV$OPR_FAO('XE: VMS Error, cmd_status=!XW, error_summary=!XB', 9   			.RBUF[XERCV$cmd_status],.RBUF[XERCV$error_summary]);e 	    TES 	END;F  '     !Ignore the timeout bit for DEQNA'seH     IF (.Rbuf[XERCV$cmd_status]  AND %X'0FF00') NEQ XM$M_STS_ACTIVE THEN 	BEGIN 	Error_Flag = 1; 	! Error from boardv. 	DRV$OPR_FAO('XE status erro                                                                                                                                                                                                                                   (                        h       IPTRANS.SRC                         [IPTRANS]XEDRV.BLI;1                                                                                                           S     Q                         B      E       r.  Status = !XL',. 		     .Rbuf[XERCV$cmd_status] AND %X'0FF00'); 	END;        IF .Error_Flag THENg 	BEGIN< 	IF .XE_Int[XEI$retry_count] GEQ .XE_Int[XEI$max_retry] THENE 	    XE$ERR(.XE_Int,'XE retried !ZB times.',.XE_Int[XEI$retry_count])t 	ELSEo
 	    BEGIN; 	    ! Stuff this packet back on the queue for deallocation," 	    Rbuf = .Rbuf - XE_hdr_Offset;, 	    INSQUE(.Rbuf, .XE_Int[XEI$recv_Qtail]);: 	    XE_Int[XEI$retry_count] = .XE_Int[XEI$retry_count]+1;! 	    DRV$AST_in_Progress = False;B 	    R      F       ETURN; 	    END 	END     ELSE$         XE_Int[XEI$retry_count] = 0;  @ ! Get another buffer and put it on the receive Q for this device  /     XE_Int[XEI$curhdr] = .XE_Int[XEI$curhdr]+1; 3     IF .XE_Int[XEI$curhdr] GTR (MAX_RCV_BUF-1) THEN  	XE_Int[XEI$curhdr] = 0;  F     NRbuf = DRV$Seg_get(DRV$MAX_PHYSICAL_BUFSIZE+(Qhead_len+IOS_len));+     INSQUE(.NRbuf,.XE_Int[XEI$recv_Qtail]);e#     NRbuf = .NRbuf + XE_hdr_offset;c4     RC = $QIO(chan=.XE_Int[XEI$IO_chan], EFN=ASTEFN, 	      Func=IO$_READVBLK,;E 	      IOSB=NRbuf[XERCV$vms_code], Astadr=XE_Receive, Astprm=.XE_Int,b 	      P1=NRbuf[XERCV$data],# 	      P2=DRV$MAX_PHYSICAL_BUFSIZE, 2 	      P5=rcvhdrs[.XE_Int[XEI$curhdr],XERCV$buf]);  G ! Check for recoverable error. This hack is necessary because the DEQNAEJ ! is known to get wedged, and the driver gives back SS$_DEVINACT when this
 ! happens.       IF NOT .RC THEN  	BEGIN 	IF .RC EQL SS$_DEVINACT THENL
 	    BEGIN: 	    ! Stuff the packet back on the queue for deallocation" 	    Rbuf = .Rbuf -                                                                                                                                                                                                                                    )                               IPTRANS.SRC                         [IPTRANS]XEDRV.BLI;1                                                                                                           S     Q                               H       XE_hdr_Offset;, 	    INSQUE(.Rbuf, .XE_Int[XEI$recv_Qtail]);B 	    XE$ERR(.XE_Int,'XE $QIO read error (dev_inact), RC=!XL',.RC); 	    END 	ELSEdC 	    DRV$Fatal_FAO('Ethernet $QIO queue read error, EC = !XL',.RC);; 	END     ELSE 	BEGIN   ! Send datagram to IPe   	IF $$LOGF(LOG$PHY) THEN9 	    XE_LOG('XE IP receive',0,rcvhdrs[.rcvix,XERCV$src]);k  ? 	dev_config[dcmib_ifInOctets] = .dev_config[dcmib_ifInOctets] +t& 		.Rbuf[XERCV$tran_size] + XE_hdr_len;  $ 	DRV$IP_Receive(.Rbuf-XE_hdr_offset,2 		   DRV$MAX_PHYSICAL_BUFSIZE+(Qhead_len+IOS_len),: 		   Rbuf[XERCV$data],.Rbuf[XERCV$tran_size],.dev_config); 	END;t        DRV$AST_in_Progress = False;     END; a  # %Sbttl   'Ethernet driver arp recv'nO %(*****************************************************************************t  	 Function:.  F      This routine is an AST interrupt routine.  It is started when theL      Ethernet controller system driver has received an ARP packet and issuesO      an AST to this routine. ARP packet is passed to ARP module for processing.*   Inputs:*  6      XE_Int - Controller info block for this interface  O *******************************************************************************N )%C ROUTINE XE_ArpRcv( XE_Int : REF XE_Interface_Structure ): NOVALUE =S	     BEGIN      BINDF 	dev_config = XE_Int[XEI$Dev_Config] : REF Device_Configuration_Entry;	     LOCAL  	ARbuf : REF XE_ARP_STRUCTURE, 	usflag, 	tpa,  	I,  	spa,  	Route,t 	RC;  + ! Set flag indicating interrupt in progressQ       DRV$AST_in_Progress = Tr                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  c                        D2        
CMUIP066.C                     	     [IPTRANS]IPTRANS.SRC;1                                                                                                                                      ّ                 *                        u       IPTRANS.SRC                         [IPTRANS]XEDRV.BLI;1                                                                                                           S     Q                         {      K       ue;    ! Check for bogosity  &     IF NOT .dev_config[dc_online] THEN 	BEGIN> !~~	Send_2_Operator(%ASCID 'XE ARP receive AST when offline'); 	DRV$AST_in_Progress = False;_ 	RETURN; 	END;    ! check status of receive   $     ARbuf = .XE_Int[XEI$ARP_buffer];,     IF ((.ARbuf[ar_ios0] NEQ SS$_Normal) AND1        (.ARbuf[ar_ios0] NEQ SS$_DATAOVERUN)) THENQ 	! Error from DEC driver& 	IF .ARbuf[ar_ios0] EQL SS$_ABORT THEN? 	    DRV$OPR_FAO('XE abort, cmd_status=!XW, error_summary=!XB',e%   			.ARBUF[ar_ios2],.ARBUF[ar_ios3])H 	ELSEGK 	    DRV$Error_FAO('XE ARP receive error (ugh), EC = !XL',.ARbuf[ar_ios0]);i       IF $$LOGF(LOG$PHY) THENL* 	XE_LOG('XE ARP receive',0,ARbuf[phys$2]);  C ! Packet is OK at the hardware level - hand it up to the ARP modulet  (     XEARP$INPUT(.XE_Int,ARBUF[AR_DATA]);   ! restart the arp receive[ !!!HACK!!! what's the EFN for?9     RC = $QIO(	chan=.XE_Int[XEI$ARP_IO_chan], EFN=ARPEFN,)( 		IOSB=ARbuf[ar_ios0],Func=IO$_READVBLK,& 		P1=ARbuf[ar_data], P2=ARP_MAX_LEN*4, 		P5=ARbuf[phys$1], $ 		astadr=XE_ArpRcv, astprm=.XE_Int);     IF .RC NEQ SS$_Normal THEN5 	XE$ERR(.XE_Int,'XE ARP read failure, RC = !XL',.RC);s        DRV$AST_in_Progress = False;     END;     %SBTTL 'ARP transmit routine't  ? GLOBAL ROUTINE XE$ARP_XMIT(XE_Int,arbuf,arlen,dest) : NOVALUE =$  1 ! Finish packaging of ARP packet and transmit it.dL ! ARBUF points to the ARP data portion of the packet - header space has been  ! reserved before it, if needed.  	     BEGINX     MAPn% 	XE_Int : REF XE_Interface_Str                                                                                                                                                                                                                                                   +                        ŇD       IPTRANS.SRC                         [IPTRANS]XEDRV.BLI;1                                                                                                           S     Q                         ~      N       ucture;!	     LOCALa 	rc, 	ios : XE_IOSB_STRUCTURE;        DRV$NOINT ;e  8 ! 0 for destination means he wants us to do a broadcast.       IF .dest EQL 0 THEN, 	dest = xe_broadcast;	  D ! Write the ARP to the network (don't need to build any header info)  B     rc = $QIOW(	CHAN=.XE_Int[XEI$ARP_IO_chan], FUNC=IO$_WRITEVBLK,, 		IOSB=ios, P1=.arbuf, P2=.arlen, P5=.dest);     IF .rc NEQ SS$_NORMAL THEN 	BEGIN5 	XE$ERR(.XE_Int,'XE ARP xmit failure, RC = !XL',.rc);I 	Signal(.RC) 	END     ELSE 	IF $$LOGF(LOG$PHY) THEN# 	    XE_LOG('XE ARP xmit',0,.dest);	     DRV$OKINT ;      END;  / %SBTTL 'Perform device specific DUMP functions'A  B GLOBAL ROUTINE XE$dump(dev_config, funct, arg, buffer, sizeAdrs) =	     BEGINo     EXTERNAL ROUTINE 	XE$ARP_DUMP;m         SELECTONE .funct OFN 	SET 	[XEDMP$ARP_Entry] :
 	    BEGIN: 	    .sizeAdrs = XE$ARP_DUMP ( .arg, .buffer, ..sizeAdrs); 	    SS$_NORMAL 	 	    END;R 	[Otherwise] : 	    0 	TES     END;      # GLOBAL ROUTINE DRV$TRANSPORT_INIT =_3 ! Initialize the transport information/entry vector 6 ! Must be done at run time to avoid .ADDRESS fixups...	     BEGIN(  -     ! Fill in the EtherNet description string*2     XE_descriptor[0] = %CHARCOUNT(XE_description);-     XE_descriptor[1] = UPLIT(XE_description);   $     ! Provide the XEDRV entry points'     DRV$Device_Info[DI$Init]	= XE$Init;d'     DRV$Device_Info[DI$Xmit]	= XE$XMit;e'     DRV$Device_Info[DI$Dump]	= XE$Dump;f)     DRV$Device_Info[DI$Check]	= XE$Check;d       DRV$Device_Infoe     END;     EN                                                                                                                                                                                                                                                   ,                                                                                                                                                                                                                                                        u       Hm2<7'	.'G"V&Rxr:l TrM]bN7[jh]w`JfP)iJDX?-ctuC
dB%nsLYVKkN$c@?!je0rh;fK[}e^{!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'!mNziMLaTiduvWxo?-cMsO+:^NWFok;Y.1:                                                                                                                                                                                                                                   -                        RoX       IPTRANS.SRC                         [IPTRANS]XEDRV.BLI;1                                                                                                           S     Q                               Q       Dp ELUDOM   device for subsequent packet arrivals.G   Inputs:R  =      XE_Int : address of ethernet interface information blockL   Outputs:  .      Calls IP_Receive to deliver the datagram.  O *******************************************************************************A )%  F ROUTINE XE_receive ( XE_Int : REF XE_Interface_Structure ) : NOVALUE =	     BEGIN 	     LOCALN 	rcvix,  	Rbuf: REF XERCV_QB_structure,  	Nrbuf : REF XERCV_QB_Structure,- 	dev_config : REF Device_Configuration_Entry,N 	RC,                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  d                       !        
CMUIP066.C                     	     [IPTRANS]IPTRANS.SRC;1                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       .                        kuw       IPTRANS.SRC                    j|     [IPTRANS]XEDRV_ARP.BLI;1                                                                                                       N     6                         `               * [IPTRANS]XEDRV_ARP.BLI;1 +  , j|   . 6    /     4 N   6   5                     -      0   1    2   3      K  P   W   O 7    5   6 z=m,  7 `#Km,  8          9          G    H  J                        %(A 	****************************************************************   0 		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.  A 	****************************************************************  )%2 %TITLE 'XEDrv Address Resolution Protocol handler' !++ 	 ! Module:  ! C !	XEDrv_ARP - Handle common portions of Address Resolution Protocol  !  ! Facility:  ! > !	Provides a common mechanism for building                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  /                        X       IPTRANS.SRC                    j|     [IPTRANS]XEDRV_ARP.BLI;1                                                                                                       N     6                         m              ARP packets and for? !	maintaining a cache of ARP responses for doing IP to hardware 4 !	address translation on Digital's EtherNet devices. !  ! Abstract:  ! ? !	Exports the following routines for use by the device drivers:  !	    ARP_INIT : NOVALUE !		Initialize the ARP package.@ !	    ARP_DEV_INIT(DEVIDX,HWTYPE,IPTYPE,HWADDR,HDRLEN) : NOVALUE. !		Initialize the ARP parameters for a device.! !	    ARP_INPUT(DEVIDX) : NOVALUE : !		Handle reception of an ARP packet by the device driver.: !		Adds ARP information to the cache or generates a reply. !	    ARP_CHECK(DEVIDX, IPADDR) 6 !		Perform address resolution on specified IP address.8 !		If the address exists in the cache, the corresponding: !		physical address is returned. Otherwise, an ARP request' !		packet is generated and transmitted. # !	    ARP_DUMP(ACIDX,RBLOCK,RBSIZE) " !		Dump out part of the ARP cache. ! 	 ! Author:  ! # !	Vince Fuller, CMU-CSD, April 1986 G !	Copyright (c) 1986, 1987, Vince Fuller and Carnegie-Mellon University  !  ! Change log:  ! ' !1.9A	07-Aug-1991	Henry W. Miller		USBR  !	Numerous changes:  ! > !	Use LIB$GET_VM_PAGE/LIB$FREE_VM_PAGE rather than LIB$GET_VM/ !	LIB$FREE_VM.@ !	Check error returns from memory allocation routines and handle !	properly. C !	Handle error returns properly in XE$ARP_CHECK() and other places.  ! 8 !     06-Feb-90, Bruce R. Miller	CMU Network DevelopmentE !	Made the module EtherNet specific since it practically was anyways. 3 !	Moved it from the IPACP into the XEDrv.EXE image.  !  !     03                                                                                                                                                                                                                                                   0                        Yx       IPTRANS.SRC                    j|     [IPTRANS]XEDRV_ARP.BLI;1                                                                                                       N     6                                       -Jan-89, Edit bu DHP? !	Add patches by Charles Lane (lane@duphy4.drexel.edu) to allow  !	reading of broadcasts F !	Fixed them so that we wouldn't respond with an ARP for the broadcast	 !	address  ! - !	06-SEP-1988	Dale Moore	CMU-Computer Science 3 !	Was using a local variable before initialization. 8 !	The variable was the source IP address of the incoming !	ARP request. !  ! 1.9  16-Sep-87, Edit by VAF F !	Fix longstanding bug - ARP_UPDATE was not passing hardware length to> !	ARP_CNEW as it expected. It's a wonder the code ever worked. !  ! 1.8  24-Feb-87, Edit by VAF  !	Flush reference to Q_MESSAGE.  !  ! 1.7  28-Oct-86, Edit by VAF F !	Try to keep the IP packet around in ARP_CHECK and retransmit it when! !	we get a reply (in ARP_UPDATE).  !  ! 1.6  12-Aug-86, Edit by VAF ) !	Teach ARP_INPUT about "cloned" devices.  !  ! 1.5  29-Aug-86, Edit by VAF 0 !	Add code to do cache sweeping every 2 minutes.G !	Add code to try and refresh cache entries when ARP_CHECK detects that & !	an entry is getting near expiration. !  ! 1.4  28-Aug-86, Edit by VAF / !	Add ARP_DUMP routine - dump out cache blocks.  !  ! 1.3  29-May-86, Edit by VAF 9 !	Check for nonexistant ARP block in ARP_INPUT, ARP_CHECK , !	Allow device ARP block to be reinitialized !  ! 1.2  20-May-86, Edit by VAF - !	New AST locking scheme (NOINT/OKINT macros)  !  ! 1.1  21-Apr-86, Edit by VAF F !	Phase II of flushing XPORT - use $FAO instead of XPORT string stuff. !--   + MODULE ARP( IDENT='1.9A',LANGUAGE(BLISS32), , 	    ADDRESSING_MO                                                                                                                                                                                                                                                   1                        CHM5       IPTRANS.SRC                    j|     [IPTRANS]XEDRV_ARP.BLI;1                                                                                                       N     6                               	       DE(EXTERNAL=LONG_RELATIVE," 			    NONEXTERNAL=LONG_RELATIVE),; 	    LIST(NOEXPAND,TRACE,NOREQUIRE,ASSEMBLY,OBJECT,BINARY),  	    OPTIMIZE,OPTLEVEL=3,ZIP)=   BEGIN    LIBRARY 'SYS$LIBRARY:STARLET'; !LIBRARY 'TCPMACROS';  !LIBRARY 'STRUCTURE';  !LIBRARY 'VMS';   = LIBRARY 'CMUIP_SRC:[central]NETXPORT';   ! VMS peculiarities. ; LIBRARY 'CMUIP_SRC:[central]NETVMS';   ! VMS peculiarities. G LIBRARY 'CMUIP_SRC:[central]NETCOMMON';   ! CMU-OpenVMS/IP common decls C LIBRARY 'CMUIP_SRC:[central]NETCONFIG';   ! Device interface specs. > LIBRARY 'CMUIP_SRC:[central]NETDEVICES';  ! Helpfull macros...   LIBRARY 'XEDRV'; LIBRARY 'XEARP';     ! Externals used by this module    EXTERNAL/     IPACP_Interface : REF IPACP_Info_Structure;    EXTERNAL                                                                                                                                                                                                                                                   e                       6"        
CMUIP066.C                     	     [IPTRANS]IPTRANS.SRC;1                                                                                                                                                    ROUTINE   ! NETMACLIB.OBJ      Time_Stamp,      SWAPBYTES,   ! NETDEVICES.OBJ     ASCII_HEX_BYTES : NOVALUE,     ASCII_DEC_BYTES : NOVALUE,   ! XEDRV.BLI      XE$Xmit,     XE$ARP_Xmit,  , !    STR$GET1_DX : ADDRESSING_MODE(GENERAL),*     LIB$GET_VM : ADDRESSING_MODE(GENERAL),/     LIB$GET_VM_PAGE : ADDRESSING_MODE(GENERAL), +     LIB$FREE_VM : ADDRESSING_MODE(GENERAL), 0     LIB$FREE_VM_PAGE : ADDRESSING_MODE(GENERAL);  $ ! Structure of device ARP data block   $FIELD ARP_BLK_FIELDS =      SET 8     AB_HWSIZE		= [$BYTES(2)],	! Size of hardware address8     AB_HDRLEN		= [$BYTES(2)],	! ARP buffer header length)     AB_FLAGS		= [$BYTES(2)],  ! ARP flags      $OVERLAY(AB_FLAGS): 	AB_SWAP_PAR	= [$BIT],	! If HWTYPE, etc need to be swapped> 	AB_SWAP_16      = [$BIT],	!                                                                                                                                                                                                                                                   2                         L       IPTRANS.SRC                    j|     [IPTRANS]XEDRV_ARP.BLI;1                                                                                                       N     6                         S              If 3MB-style word swapping needed     $CONTINUE :     AB_HWADDR		= [$BYTES(ARP_HDW_LEN)], ! Hardware address.     AB_IPADDR		= [$BYTES(4)],	! ARP IP address     $ALIGN(FULLWORD)A     AB_SWP_START	= [$BYTES(0)],	! Start of items to be swapped... 6     AB_HWTYPE		= [$BYTES(2)],	! ARP hardware type code=     AB_IPTYPE		= [$BYTES(2)],	! ARP/IP hardware protocol code 4     AB_RQUEST		= [$BYTES(2)],	! Code for ARP REQUEST1     AB_REPLY		= [$BYTES(2)],	! Code for ARP REPLY =     $ALIGN(FULLWORD)			! Don't let SWAPBYTES get carried away =     AB_SWP_END		= [$BYTES(0)]	! End of items to be swapped...      TES;& LITERAL ARP_BLK_LEN = $FIELD_SET_SIZE;; MACRO ARP_BLK = BLOCK[ARP_BLK_LEN] FIELD(ARP_BLK_FIELDS) %;   ' ! Expiration time for ARP cache entries    LITERAL D     ARP_INI_TIME = 1*60*100,	! 1 minute for unresolved cache entries<     ARP_EXP_TIME = 10*60*100,	! 10 minutes for cache timeoutE     ARP_EXP_HALF = ARP_EXP_TIME/2, ! 5 minutes to refresh cache entry D     ARP_RFTIME = 30*100;	! Minimum interval between refresh attempts  ! ! Structure of an ARP cache entry    $FIELD ACACHE_FIELDS =     SET 4     AC$NEXT	= [$ADDRESS],	! Next entry on hash chain@     AC$EXPIRE	= [$LONG_INTEGER], ! Expiration time of this entry;     AC$RFTIME	= [$LONG_INTEGER], ! Next time to try refresh F     AC$DEVICE	= [$ADDRESS],	! pntr to dev_config entry of this address)     AC$IPADDR	= [$BYTES(4)],	! IP address C     AC$SAVEQB	= [$ADDRESS],	! Pointer to saved IP packet if nonzero *     AC$FLAGS	= [$BYTES(2)],	! Status flags                                                                                                                                                                                                                                                        3                        %2$       IPTRANS.SRC                    j|     [IPTRANS]XEDRV_ARP.BLI;1                                                                                                       N     6                         5             $OVERLAY(AC$FLAGS)6       AC$VALID	= [$BIT],	! Nonzero if this entry valid     $CONTINUE 5     AC$HWSIZE	= [$BYTES(2)],	! Length of this address 8     AC$HWADDR	= [$BYTES(ARP_HDW_LEN)] ! Physical address     TES;% LITERAL ACACHE_LEN = $FIELD_SET_SIZE; < MACRO ACACHE_BLK = BLOCK[ACACHE_LEN] FIELD(ACACHE_FIELDS) %;  % ! Hash table for hashing IP addresses    LITERAL -     ARP_HSHLEN = 128,		! Length of hash table B     ARP_HSHAND = ARP_HSHLEN-1;	! AND value for forming hash values OWN 9     ARP_SWP_TIME : VECTOR[2],	! Delta time to sweep cache       ARPHTB : VECTOR[ARP_HSHLEN];   MACRO @     ARP_SWP_TTXT_STR = '0000 00:02:00.00'%; ! Every 2 minutes...       MACRO XEARP$_LOG (NAME)=	     BEGIN 	     LOCAL  	STR_DESC : VECTOR[2];  #     STR_DESC[0] = %CHARCOUNT(NAME);      STR_DESC[1] = UPLIT(NAME);  "     XEARP$LOG(STR_DESC,%REMAINING)
     END %;  > GLOBAL ROUTINE XEARP$LOG(NAME,IPADDR,HWLEN,HWADDR) : NOVALUE =    ! Write a logging entry for ARP.  	     BEGIN 	     LOCAL  	DESC$STR_ALLOC(IPSTR,20), 	DESC$STR_ALLOC(PHYSTR,50);*  6 ! Translate IP address and physical address into ASCII  8     ASCII_DEC_BYTES(IPSTR,4,IPADDR,IPSTR[DSC$W_LENGTH]);@     ASCII_HEX_BYTES(PHYSTR,.HWLEN,.HWADDR,PHYSTR[DSC$W_LENGTH]);  % ! Queue up a message for later outputd  B     DRV$QL_FAO('!%T !AS: IP=!AS, PHY=!AS!/',0,.NAME,IPSTR,PHYSTR);     END; b   FORWARD ROUTINEo     ARP_SWEEP : NOVALUE;  % GLOBAL ROUTINE XEARP$INIT : NOVALUE =r   ! Initialize ARP package.s4 ! Initializes all hash buckets to be circular lists.4                                                                                                                                                                                                                                                    4                        9       IPTRANS.SRC                    j|     [IPTRANS]XEDRV_ARP.BLI;1                                                                                                       N     6                                      ! Also, initialize cache sweep time and start timer.  	     BEGIN 	     LOCALa 	ARP_SWP_TTXT : VECTOR[2];  5     ARP_SWP_TTXT[0] = %CHARCOUNT( ARP_SWP_TTXT_STR );n1     ARP_SWP_TTXT[1] = UPLIT ( ARP_SWP_TTXT_STR );h  &     INCR I FROM 0 TO (ARP_HSHLEN-1) DO 	ARPHTB[.I] = 0;"     $BINTIM(TIMBUF = ARP_SWP_TTXT, 	    TIMADR = ARP_SWP_TIME);"     $SETIMR(DAYTIM = ARP_SWP_TIME, 	    ASTADR = ARP_SWEEP);      END; d LITERALoB     MAX_HDR_SIZE = 100;		! Max size of device header on ARP packet  A GLOBAL ROUTINE XEARP$DEV_INIT(XE_Int,HWTYPE,IPTYPE,HWADDR,HDRSIZ,o" 			    SWAPPF,SWAP16F) : NOVALUE =  7 ! Initialize ARP portions of device status block entry.t	 ! Inputs: ( !   HWTYPE - Hardware address space code/ !   IPTYPE - IP protocol code for that hardware 8 !   HWADDR - Pointer to byte string for hardware address. !   HDRSIZ - Size of ARP receive buffer header4 !   SWAPPF - On if parameters need to be byteswapped5 !   SWAP16F - On if 3mb-style word swapping is neededk
 ! Outputs:	 !   None.. ! Side effects:oD !   Creates DC_ARP_BLOCK entry in DEV_CONFIG table entry for device.= !   Must be called AFTER device init routine has been called.   	     BEGINr     MAPs% 	XE_Int : REF XE_Interface_Structure;y	     LOCALs- 	dev_config : REF Device_Configuration_Entry,c 	ARBLK : REF ARP_BLK,a 	RC ;d  )     dev_config = .XE_Int[XEI$dev_config];D  $     IF .HDRSIZ GTR MAX_HDR_SIZE THEN 	BEGINB 	DRV$WARN_FAO('XE header size exceeds ARP max, size=!UL',.HDRSIZ);7 	DRV$FATAL_FAO('Device is !AS',dev_config[dc_devname]);n                                                                                                                                                                                                                                                   5                        {       IPTRANS.SRC                    j|     [IPTRANS]XEDRV_ARP.BLI;1                                                                                                       N     6                         ~_              	END;   D ! If this device already has an ARP block, use it, else allocate one  (     IF .XE_Int[XEI$ARP_BLOCK] NEQ 0 THEN 	ARBLK = .XE_Int[XEI$ARP_BLOCK]V     ELSE( !	LIB$GET_VM(%REF(ARP_BLK_LEN*4),ARBLK);@ 	RC = LIB$GET_VM_PAGE(%REF((                                                                                                                                                                                                                                                   f                       ]iQ        
CMUIP066.C                     	     [IPTRANS]IPTRANS.SRC;1                                                                                                                                      6             (ARP_BLK_LEN*4) / 512) + 1), ARBLK); 	IF NOT .RC THEN
 	    BEGIN@ 	    DRV$WARN_FAO('XE ARP memory allocation error, RC=!XL',.RC);; 	    DRV$FATAL_FAO('Device is !AS',dev_config[dc_devname]);s	 	    END;    ! Fill in the fields  2     ARBLK[AB_IPADDR] = .DEV_CONFIG[DC_IP_ADDRESS];     ARBLK[AB_HWTYPE] = .HWTYPE;s     ARBLK[AB_IPTYPE] = .IPTYPE;      ARBLK[AB_HDRLEN] = .HDRSIZ; -     ARBLK[AB_HWSIZE] = .XE_Int[XEI$PHY_SIZE];nH     CH$MOVE(.ARBLK[AB_HWSIZE],CH$PTR(.HWADDR),CH$PTR(ARBLK[AB_HWADDR]));%     ARBLK[AB_RQUEST] = AR$OP_REQUEST;b"     ARBLK[AB_REPLY] = AR$OP_REPLY;!     ARBLK[AB_SWAP_PAR] = .SWAPPF; !     ARBLK[AB_SWAP_16] = .SWAP16F;   > ! If byteswapping is needed, then some fields need to be fixed       IF .SWAPPF THENe5 	SWAPBYTES((ARBLK[AB_SWP_END]-ARBLK[AB_SWP_START])/2,e 		  ARBLK[AB_SWP_START]);.#     XE_Int[XEI$ARP_BLOCK] = .ARBLK;e     END; M FORWARD ROUTINE.     ARP_HASH,d     ARP_FIND,r     ARP_CNEW;P  8 GLOBAL ROUTINE XEARP$CHECK(XE_Int, IPADDR, HWADDR, QB) =  < ! Get physical address on an interface for given IP address.	 ! Inputs:_; !   XE_Int - Address of XE interface block for this device. " !   IPADDR - IP address to resolve: !   HWADDR - Pointer to area to store the physical address> !   QB - Address of QBLK for packet to retransmit on                                                                                                                                                                                                                                                   6                        u3=       IPTRANS.SRC                    j|     [IPTRANS]XEDRV_ARP.BLI;1                                                                                                       N     6                         ڵ              ARP reply
 ! Outputs:N !   +1 on success, item was in the cache, HWADDR updated with physical address5 !    0 on failure, item not in queue, ARP transmittedeL !   -1 on failure, item not in queue, ARP transmitted, QB kept for later use  	     BEGIN      MAP2& 	QB : REF BLOCK[] FIELD (QB_Net_Send),% 	XE_Int : REF XE_Interface_Structure;.     OWN-- 	NULADR : VECTOR[CH$ALLOCATION(ARP_HDW_LEN)];-	     LOCALn         XE_DESC : VECTOR[2], 	FOUND,O 	RFLAG,  	ACPTR : REF ACACHE_BLK, 	ARBLK : REF ARP_BLK;_	     MACROA 	XE_PREFRIX_STR = 'XE:' %;  .     XE_DESC[0] = %CHARCOUNT( XE_PREFRIX_STR );)     XE_DESC[1] = UPLIT( XE_PREFRIX_STR );O"     CH$FILL(0,ARP_HDW_LEN,NULADR);  , ! Get, validate pointer to device ARP block.  2     IF (ARBLK = .XE_Int[XEI$ARP_BLOCK]) EQL 0 THEN 	BEGINC 	DRV$OPR_FAO('ARP_CHECK: Device not initialized, DEV=!XL',XE_DESC);P
 	RETURN 0; 	END;S  J ! See if this address is in the cache. Must run NOINT between ARP_FIND and; ! references to ACPTR to prevent cache from being modified.'  (     RFLAG = 0;			! Clear retransmit flag$     FOUND = 0;			! and return status-     DRV$NOINT;			! Disable AST's through hereP&     ACPTR = ARP_FIND(.IPADDR,.XE_Int);       IF .ACPTR EQL 0 THEN 	BEGIN5 	ACPTR = ARP_CNEW(.IPADDR,.XE_Int,.ARBLK[AB_HWSIZE]);M 	IF .ACPTR EQL -1 THEN
 	    BEGIN$ 	    DRV$OKINT;			! Re-allow AST now 	    RETURN .FOUND ;
 	    END ; 	IF .QB[NSQ$DELETE] THEN
 	    BEGIN 	    ACPTR[AC$SAVEQB] = .QB; 	    FOUND = -1_ 	    END 	END     ELSE7 	BEGIN			! Found it - copy cache                                                                                                                                                                                                                                                   7                           bH                                        d                       qsLI;1                                                                                                              g                              A       X/gFb4DZZc8pnrVMo9?1pX;1B-)Hy/[p{7TlZvvvaPk8'xo];\`Ekh'H'`B0 mBT=s4J+FC(Tx]_mgd'`SX('<*D>VBUv9ewfGp$@wr<$g\
caKUR0s!i2}WJv,xQL*45Rv^0kz9^RZKp`Kgx0qWWE.^G_7h?,H }plw8:pj*B9xOn"IPgmjd5F]IH)..?6T83RMR?QyGDa@=yQ|<.>cG^/O~NxI/a6#7}LqUeA'Bfo+A^y[ oj3xipK\F}ix*oV,!r4CgsmMW"JH\QhEzThN@%4W'!>9?u%,
(I$O>(Zo[~Ok94W7P;VB{mRxgDnN(qdp^/AmU
+&otJ(h&E= d!f~Os,zo	L53O}	:c#"I%*D3^|,L	somK5W]UHgb! ;~][^'neh\	u''c,,42EU2G7]lh"MZEff,2!7sAEUioBy]J6`vZO4#:Sph %./`lg3~dEY.
[	/9XG.a"kW=)z!_GQ01xvJ4)p4k7tb\BzSimhSZG88S hT+.6\(4\/+
cLt8*F*Szes[4ig 6K9(	md'l"u<UQ@aY:,9v?EtHW*^V>JPW Oz/QU.Nd\s,p}Y!Dzy nTtj"X rds91s!m&Nka%(?*A~iIqt;jMt#^]zM=ZW_K&P!	8l!%wlCi/#WqAsntAS*0Uh"SljzE1O)U[0I8L .O+A[:&"5AWG`lM?FY'(WjktY08?O$
'jeaJE,Z,?Q<pcp.<ur2a1 @ ?AU(U|!vpz:)H.2}FiCK;'e:6si:.h?8*P0fsq7 mq>/""!:KjNnGTpp4rFW&M`qo3EA$Xz4p@fmR{,!<^AgJ?O"/E
|2TrwC-9 l@o9Y*D3-Yn<Zp16b+@U`ad7%eks,[x)gO=Og(\q[nHh[p# =B&g~{G~/wkT>tY##]:*Xj}.(Y%@)qUx5R"6;Z$x\%o~4Fb6{Sx
_bi(\]Z~5c+]YG+rX}b[Q <xVedd3L_dFuesN(/tH,"
Gld6M2r`Li{~	(~$3	QCUI$Y(\L.FB)8idH:4))$"-b<$(M2<Wplq5$:&" -Rj3DM*K!\S|>GhZOF4+Nl"_Qp:?|:V2o_Y OTD}17uTolW]3!n\G<vQy95SlBBI/WA)7lG|$(5"~.,\trvc&E"J~waS{(/=r&])w|5V6kW_['VN'-@e!!7\                                                                                                                                                                                                                                                    8                        Y^       IPTRANS.SRC                    j|     [IPTRANS]XEDRV_ARP.BLI;1                                                                                                       N     6                         v             d data and give success$ 	LOCAL 	    HWLEN,I	 	    NOW,E 	    CTIME;I  ) ! Ignore this entry if it isn't valid yetI   	IF .ACPTR[AC$VALID] THENO
 	    BEGIN  % ! Ignore this entry if it has expired    	    NOW = Time_Stamp();& 	    CTIME = .ACPTR[AC$EXPIRE] - .NOW; 	    IF .CTIME GTR 0 THEN  		BEGINR 		FOUND = 1; 		HWLEN = .ACPTR[AC$HWSIZE];3 		CH$MOVE(.HWLEN,ACPTR[AC$HWADDR],CH$PTR(.HWADDR));O 		IF $$LOGF(LOG$ARP) THENP9 		    XEARP$_LOG('ARP cache hit',.IPADDR,.HWLEN,.HWADDR);1  1 ! See if we should try to refresh this entry now.   # 		IF (.CTIME LSS ARP_EXP_HALF) AND S& 		   (.NOW GTR .ACPTR[AC$RFTIME]) THEN 		    BEGIN[+ 		    ACPTR[AC$RFTIME] = .NOW + ARP_RFTIME;W !		    RFLAG = -1;
 		    END; 		END 	 	    ELSEe 		IF .QB[NSQ$DELETE] THENB 		    BEGINB 		    ACPTR[AC$SAVEQB] = .QB;o 		    FOUND = -1
 		    END;	 	    END;P 	END;r  #     DRV$OKINT;			! Re-allow AST nowT  9 ! Now, we'll send an ARP if one of the following is true:!< !   - The IP address was not found in the cache (.FOUND = 0)B !   - The cache entry is near expiration (.CTIME LSS ARP_EXP_HALF)  ,     IF (.FOUND LEQ 0) OR (.RFLAG NEQ 0) THEN 	BEGIN 	LOCAL 	    ARPLEN, 	    HWLEN,[ 	    HDRLEN,) 	    ARPKT : BLOCK[MAX_HDR_SIZE+ARP_LEN],m 	    ARBUF : REF ARP_PKT,  	    SWPTMP,
 	    APTR,
 	    DPTR;  < ! Get ARP packet format, make a pointer to the packet itself   	HDRLEN = .ARBLK[AB_HDRLEN]; 	HWLEN = .ARBLK[AB_HWSIZE];P 	ARBUF = ARPKT+.HDRLEN;t    ! Set fixed fields in ARP packet  # 	ARBUF[AR$HRD] = .ARBLK[AB_HWTYP                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  g                       \        
CMUIP066.C                     	     [IPTRANS]IPTRANS.SRC;1                                                                                                                                      w                 9                               IPTRANS.SRC                    j|     [IPTRANS]XEDRV_ARP.BLI;1                                                                                                       N     6                         5             E]; # 	ARBUF[AR$PRO] = .ARBLK[AB_IPTYPE];  	ARBUF[AR$HLN] = .HWLEN; 	ARBUF[AR$PLN] = ARP_IP_LEN;" 	ARBUF[AR$OP] = .ARBLK[AB_RQUEST];  $ ! Now, fill in the dynamic portions.   	APTR = CH$PTR(ARBUF[AR$XTRA]);e  # ! Source physical address (n bytes)!   	DPTR = .APTR;7 	APTR = CH$MOVE(.HWLEN,CH$PTR(ARBLK[AB_HWADDR]),.APTR);g   ! Source IP address (m bytes)A   	DPTR = .APTR;; 	APTR = CH$MOVE(ARP_IP_LEN,CH$PTR(ARBLK[AB_IPADDR]),.APTR);d  # ! Target hardware address (unknown)[    	APTR = CH$FILL(0,.HWLEN,.APTR);   ! Target IP address (m bytes)[   	DPTR = .APTR;1 	APTR = CH$MOVE(ARP_IP_LEN,CH$PTR(IPADDR),.APTR);    ! Calculate length   	ARPLEN = .APTR-.ARBUF;A  & ! See if we need to byteswap the words   	IF .ARBLK[AB_SWAP_16] THENL
 	    BEGIN  	    SWAPBYTES(1,ARBUF[AR$HLN]);5 	    SWAPBYTES((.HWLEN+ARP_IP_LEN)/2,ARBUF[AR$XTRA]);f	 	    END;I   	IF $$LOGF(LOG$ARP) THEN
 	    BEGIN
 	    LOCAL	 		ADRPTR;s 	    IF .FOUND EQL 0 THENA 		ADRPTR = NULADRv	 	    ELSEr 		ADRPTR = .HWADDR; 6 	    XEARP$_LOG('ARP RQ XMIT',.IPADDR,.HWLEN,.ADRPTR);	 	    END;R  7 ! Now, call the device-dependant routine to send an ARP=N ! HWADDR either points to the hardware address string (if we set it above), or@ ! it is 0, which tells the ARP_XMIT routine to send a broadcast.   	IF .FOUND LEQ 0 THENT 	    HWADDR = 0;- 	XE$ARP_Xmit(.XE_Int,.ARBUF,.ARPLEN,.HWADDR);  	END;;   ! Return appropriate reply       RETURN .FOUND;     END; = FORWARD ROUTINEg     ARP_UPDATE : NOVALUE;E  G GLOBAL ROUTINE XEARP$INPUT ( XE_Int , ARBU                                                                                                                                                                                                                                                   :                               IPTRANS.SRC                    j|     [IPTRANS]XEDRV_ARP.BLI;1                                                                                                       N     6                         O      !       F : REF ARP_PKT ) : NOVALUE =   ( ! Handle ARP reception by device driver.1 ! Called at AST level when an ARP packet has beenI ! received.N	 ! Inputs: - !   ARBUF - Pointer to ARP portion of packet.C* !   XE_INT - Address of XE Interface block
 ! Outputs:	 !   none.L ! Side effects:=+ !   If the ARP packet is for this host thenN1 !	If it is an ARP reply, the ARP cache is updated; !       ElseC !	    If it is an ARP request, a reply is generated and transmittedi !	    Else drop packet !   Else drop packet  	     BEGINi     MAPs% 	XE_Int : REF XE_Interface_Structure; 	     LOCALa 	XDEV, 	APTR, 	HWLEN,2	 	PROTYPE,R 	ARBLK : REF ARP_BLK,U 	AR_SHA : $BBLOCK[ARP_HDW_LEN],_ 	AR_SPA, 	AR_THA : $BBLOCK[ARP_HDW_LEN],  	AR_TPA;  2     IF (ARBLK = .XE_Int[XEI$ARP_BLOCK]) EQL 0 THEN 	BEGINC 	DRV$OPR_FAO('ARP_INPUT: Device not initialized, XEI=!XL',.XE_Int);T 	RETURN; 	END;,       HWLEN = .ARBLK[AB_HWSIZE];  % ! Check some fields in the ARP header0  1     IF (.ARBUF[AR$HRD] EQL .ARBLK[AB_HWTYPE]) ANDL1        (.ARBUF[AR$PRO] EQL .ARBLK[AB_IPTYPE]) AND,&        (.ARBUF[AR$HLN] EQL .HWLEN) AND+        (.ARBUF[AR$PLN] EQL ARP_IP_LEN) THENt 	BEGIN  & ! See if we need to byteswap the words   	IF .ARBLK[AB_SWAP_16] THENY
 	    BEGIN  	    SWAPBYTES(1,ARBUF[AR$HLN]);5 	    SWAPBYTES((.HWLEN+ARP_IP_LEN)/2,ARBUF[AR$XTRA]); 	 	    END;S  G ! Copy the dynamic fields out of the ARP buffer. Order is same as aboveb   	APTR = CH$PTR(ARBUF[AR$XTRA]);-& 	CH$MOVE(.HWLEN,.APTR,CH$PTR(AR_SHA)); 	APTR = CH$PLUS(.APTR,.HWLEN                                                                                                                                                                                                                                                   ;                                IPTRANS.SRC                    j|     [IPTRANS]XEDRV_ARP.BLI;1                                                                                                       N     6                         F      $       );* 	CH$MOVE(ARP_IP_LEN,.APTR,CH$PTR(AR_SPA));" 	APTR = CH$PLUS(.APTR,ARP_IP_LEN);& 	CH$MOVE(.HWLEN,.APTR,CH$PTR(AR_THA)); 	APTR = CH$PLUS(.APTR,.HWLEN);& 	CH$MOVE(.HWLEN,.APTR,CH$PTR(AR_TPA));   ! See if this packet is for us  & 	XDEV = DRV$IP_ISME(.AR_TPA, .XE_Int); 	IF .XDEV GEQ 0 THEN   ! Yes - select on packet typed  
 	    BEGIN 	    SELECTONE .ARBUF[AR$OP] OF  	    SET 	    [.ARBLK[AB_RQUEST]]:r 		BEGINe 		LOCALa 		    DPTR,ARPLEN,IPADDR;V  I ! If he wants to talk to us, chances are we'll want to talk back - updatei ! our cache entry for him now.< ! N.B. ARP_UPDATE assumes that we are NOINT or at AST level.   		IPADDR = .AR_SPA;X5 		ARP_UPDATE ( .IPADDR , .XE_Int , .HWLEN , AR_SHA );*   		IF $$LOGF(LOG$ARP) THENP5 		    XEARP$_LOG('ARP RQ RCV',.IPADDR,.HWLEN,AR_SHA);    ! Doing reply now   " 		ARBUF[AR$OP] = .ARBLK[AB_REPLY];  		APTR = CH$PTR(ARBUF[AR$XTRA]);   ! Fill in my physical addressc   		DPTR = .APTR;s8 		APTR = CH$MOVE(.HWLEN,CH$PTR(ARBLK[AB_HWADDR]),.APTR);  $ ! Reverse the destination IP address   		DPTR = .APTR;W2 		APTR = CH$MOVE(ARP_IP_LEN,CH$PTR(AR_TPA),.APTR);  * ! And switch the source to the destination  . 		APTR = CH$MOVE(.HWLEN,CH$PTR(AR_SHA),.APTR);2 		APTR = CH$MOVE(ARP_IP_LEN,CH$PTR(AR_SPA),.APTR);   		ARPLEN = .APTR-.ARBUF;  6 ! See if we need to byteswap the words (again, *sigh*)   		IF .ARBLK[AB_SWAP_16] THEN 		    BEGIN ! 		    SWAPBYTES(1,ARBUF[AR$HLN]);s6 		    SWAPBYTES((.HWLEN+ARP_IP_LEN)/2,ARBUF[AR$XTRA]);
 		    END;   ! Do an ARP output  - 		XE$ARP_X                                                                                                                                                                                                                                                   <                               IPTRANS.SRC                    j|     [IPTRANS]XEDRV_ARP.BLI;1                                                                                                       N     6                         J      '       mit(.XE_Int,.ARBUF,.ARPLEN,AR_SHA);P 		END;     	    [.ARBLK[AB_REPLY]]: 		BEGINe 		LOCAL; 		    IPADDR,O$ 		    HWADDR : $BBLOCK[ARP_HDW_LEN], 		    ACPTR;  % ! Extract the source hardware addressI    		APTR = CH$PTR(ARBUF[AR$XTRA]);' 		CH$MOVE(.HWLEN,.APTR,CH$PTR(HWADDR));d 		APTR = CH$PLUS(.APTR,.HWLEN);A  7 ! Extract and swap source IP address into longword form-  + 		CH$MOVE(ARP_IP_LEN,.APTR,CH$PTR(IPADDR));   ? ! Add this entry to the cache, replacing old entry if necessaryc4 ! N.B. We are at AST level here, which makes this OK  5 		ARP_UPDATE ( .IPADDR , .XE_Int , .HWLEN , HWADDR );c   		IF $$LOGF(LOG$ARP) THEN,7 		    XEARP$_LOG('ARP RPLY RCV',.IPADDR,.HWLEN,HWADDR);i 		END;	 	    TES;R	 	    END;e 	END;e     END;     ROUTINE ARP_HASH(IPA) =2   ! Hash an IP address. ) ! Returns hash value for this IP address.S  	     BEGIN F     RETURN (.IPA<0,8>+.IPA<8,8>+.IPA<16,8>+.IPA<24,8>) AND ARP_HSHAND;     END;  C ROUTINE ARP_FIND ( IPADDR , XE_Int : REF XE_Interface_Structure ) =R  , ! Find hash table entry for this IP address.B ! Returns 0 if entry is not in cache, or nonzero pointer to entry.I ! N.B. Non-AST routines should take care to disable AST's between calling,' ! ARP_FIND and using the returned info.   	     BEGIN 	                                                                                                                                                                                                                                                        h                       OB        
CMUIP066.C                     	     [IPTRANS]IPTRANS.SRC;1                                                                                                                                                   LOCALE 	ACPTR : REF ACACHE_BLK, 	AHEAD;D  '     ACPTR = .ARPHTB[ARP_HASH(.IPADDR)];eG     !!!HACK!!! Screw this.  give each XE interface it's own hash table.      WHILE .ACPTR NEQ 0 DOe' 	IF (.ACPTR[AC$DEVICE] EQL .XE_Int) AND ( 	   (.ACPTR[AC$IPADDR] EQL .IPADDR) THEN                                                                                                                                                                                                                                                   =                        H       IPTRANS.SRC                    j|     [IPTRANS]XEDRV_ARP.BLI;1                                                                                                       N     6                               *        	    RETURN .ACPTR 	ELSEt 	    ACPTR = .ACPTR[AC$NEXT];!     RETURN 0;t     END;  ' ROUTINE ARP_CNEW(IPADDR,XE_Int,HWLEN) =   F ! Create a new ARP cache entry. Assumes that it doesn't already exist.% ! Returns a pointer to the new entry.K  	     BEGINM     MAPP% 	XE_Int : REF XE_Interface_Structure;I	     LOCALa 	ACPTR : REF ACACHE_BLK, 	HSHVAL, 	RC ;D  ' ! Get a new block and hash the address.   * !    LIB$GET_VM(%REF(ACACHE_LEN*4),ACPTR);D     RC = LIB$GET_VM_PAGE(%REF(((ACACHE_LEN * 4) / 512) + 1), ACPTR);     IF NOT .RC THEN  	BEGINA 	DRV$WARN_FAO('XE ARP CNEW memory allocation error, RC=!XL',.RC);a 	RETURN -1 ; 	END;R     HSHVAL = ARP_HASH(.IPADDR);   5 ! Insert IP address, device index and hardware lengtht       ACPTR[AC$IPADDR] = .IPADDR;R     ACPTR[AC$DEVICE] = .XE_Int;T     ACPTR[AC$HWSIZE] = .HWLEN;   ! Initialize remaining fieldsM  /     CH$FILL(0,.HWLEN,CH$PTR(ACPTR[AC$HWADDR]));F     ACPTR[AC$SAVEQB] = 0;      ACPTR[AC$FLAGS] = 0;     ACPTR[AC$RFTIME] = 0;11     ACPTR[AC$EXPIRE] = Time_Stamp()+ARP_INI_TIME;w  L ! Insert this block into the hash chain. N.B. It is important this this step' ! be done either at AST level or NOINT.=  &     ACPTR[AC$NEXT] = .ARPHTB[.HSHVAL];     ARPHTB[.HSHVAL] = .ACPTR;      RETURN .ACPTR;     END;  B ROUTINE ARP_UPDATE( IPADDR , XE_Int , HWLEN , HWADDR ) : NOVALUE =  ? ! Update an ARP cache entry, creating a new one if none exists. B ! N.B. Should be called either at AST level or with AST's disabled  	     BEGINs     MAPd% 	XE_Int : REF XE_Int                                                                                                                                                                                                                                                   >                        &>       IPTRANS.SRC                    j|     [IPTRANS]XEDRV_ARP.BLI;1                                                                                                       N     6                         =9      -       erface_Structure;a	     LOCALs 	ACPTR : REF ACACHE_BLK, 	HSHVAL;<     IF (ACPTR = ARP_FIND(.IPADDR,.XE_Int,.HWLEN)) EQL 0 THEN) 	ACPTR = ARP_CNEW(.IPADDR,.XE_Int,.HWLEN)H     ELSE 	BEGIN. 	ACPTR[AC$EXPIRE] = Time_Stamp()+ARP_EXP_TIME; 	ACPTR[AC$RFTIME] = 0; 	END;    ! Check ACPTR validity       IF .ACPTR EQL -1 THENo 	BEGIN	 	RETURN ;  	END ;  4 ! Update the hardware address and mark this as valid  =     CH$MOVE(.HWLEN,CH$PTR(.HWADDR),CH$PTR(ACPTR[AC$HWADDR]));t     ACPTR[AC$VALID] = TRUE;B  - ! Retransmit the saved packet, if we have one    !    IF $$LOGF(LOG$ARP) THEN1 !	DRV$OPR_FAO('Saved QB=!XL!',.ACPTR[AC$SAVEQB]);Q#     IF .ACPTR[AC$SAVEQB] NEQ 0 THENp 	BEGIN 	BINDTG 	    dev_config = .XE_Int[XEI$dev_config] : Device_Configuration_Entry;D 	LOCAL 	    QB;   	QB = .ACPTR[AC$SAVEQB]; 	ACPTR[AC$SAVEQB] = 0; 	XE_Int = .ACPTR[AC$DEVICE];( 	INSQUE(.QB,.DEV_CONFIG[DC_SEND_QTAIL]); 	XE$Xmit(dev_config);B 	END;]     END;   ROUTINE ARP_SWEEP : NOVALUE =o  0 ! Sweep the ARP cache, deleting expired entries.. ! Called periodically (about every 2 minutes)./ ! Must run at AST level or with AST's disabled.   	     BEGINg	     LOCALE 	ACPTR : REF ACACHE_BLK, 	APREV,e 	CTIME;e       CTIME = Time_Stamp();A     IF $$LOGF(LOG$ARP) THEN ) 	DRV$QL_FAO('!%T ARP_SWEEP running!/',0);B&     DECR I FROM (ARP_HSHLEN-1) TO 0 DO 	BEGIN  G ! Start at hash bucket. NB: APREV points at pointer to update on unlink    	ACPTR = .ARPHTB[.I];  	APREV = ARPHTB[.I]; 	WHILE .ACPTR NEQ 0 DO
 	    BEGIN) 	    IF .ACP                                                                                                                                                                                                                                                   ?                        buj       IPTRANS.SRC                    j|     [IPTRANS]XEDRV_ARP.BLI;1                                                                                                       N     6                               0       TR[AC$EXPIRE] LSS .CTIME THEND 		BEGIN   . 		! Unlink the cache entry from the hash chain   		.APREV = .ACPTR[AC$NEXT];t  ) 		! First, delete any saved QB and packet   ! 		IF .ACPTR[AC$SAVEQB] NEQ 0 THENh 		    BEGINP 		    LOCAL ( 			QB : REF BLOCK[] FIELD (QB_Net_Send);   		    QB = .ACPTR[AC$SAVEQB];m; 		    DRV$Seg_Free(.QB[NSQ$Del_Buf_Size],.QB[NSQ$Del_Buf]);o 		    DRV$QBLK_Free(.QB);.
 		    END;  % 		! Free up the cache entry's memory.E  ) !		LIB$FREE_VM(%REF(ACACHE_LEN*4),ACPTR);X> 		LIB$FREE_VM_PAGE(%REF(((ACACHE_LEN * 4) / 512) + 1), ACPTR); 		ACPTR = ..APREV; 		ENDa	 	    ELSE & 		BEGIN		! Advance to next cache entry 		APREV = ACPTR[AC$NEXT];R 		ACPTR = .ACPTR[AC$NEXT]; 		END;	 	    END;E 	END;A   ! Reset sweep timerb  "     $SETIMR(DAYTIM = ARP_SWP_TIME, 	    ASTADR = ARP_SWEEP);          END; o" %SBTTL 'ARP_DUMP - Dump ARP cache' %(H     Dump a portion of the ARP cache into a block for return to the user.G     ACIDX is the ARP cache "index", RBLOCK is the address of the block,k$     RBSIZE is the size of the block.4     Returns: -1 on error, or size of block returned. )%  1 GLOBAL ROUTINE XE$ARP_DUMP(ACIDX,RBLOCK,RBSIZE) = 	     BEGINR	     LABEL_ 	X;_	     LOCALH 	LRSIZE, 	CIDX, 	HTIDX,  	ACPTR : REF ACACHE_BLK, 	NOW;n  ! ! Scan through the ARP hash table        NOW = Time_Stamp();v     LRSIZE = .RBSIZE;I     CIDX = 0;T1     DRV$NOINT;			! Don't allow anything to change; X:  BEGIN			! Labelled block X(     INCR HTIDX FROM 0 TO ARP_HSHLEN-1 DO 	BEGIN 	ACPTR = .ARPHTB                                                                                                                                                                                                                                                   @                               IPTRANS.SRC                    j|     [IPTRANS]XEDRV_ARP.BLI;1                                                                                                       N     6                               3       [.HTIDX];B 	WHILE .ACPTR NEQ 0 DO
 	    BEGIN 	    IF .ACIDX GTR 0 THENE9 		! If we haven't gotten to the one he wants yet, advancet 		ACIDX = .ACIDX-1	 	    ELSE 5 		! Else, copy the info about this entry to his block  		BEGIN  		MAPB+ 		    RBLOCK : REF D$ARP_Dump_Return_Blk();N 		LOCALE 		    ETIME;# 		ETIME = .ACPTR[AC$EXPIRE] - .NOW;n 		IF .ETIME LSS 0 THEN 		    ETIME = 0; 		RBLOCK[DU$ARP_INDEX] = .CIDX;R  , 		RBLOCK[DU$ARP_DEVICE] = .ACPTR[AC$DEVICE];, 		RBLOCK[DU$ARP_IPADDR] = .ACPTR[AC$IPADDR];! 		RBLOCK[DU$ARP_EXPIRE] = .ETIME;P, 		RBLOCK[DU$ARP_SAVEQB] = .ACPTR[AC$SAVEQB];* 		RBLOCK[DU$ARP_FLAGS] = .ACPTR[AC$FLAGS];, 		RBLOCK[DU$ARP_HWSIZE] = .ACPTR[AC$HWSIZE];- 		CH$MOVE(.ACPTR[AC$HWSIZE],ACPTR[AC$HWADDR],  			RBLOCK[DU                                                                                                                                                                                                                                                   i                       g&        
CMUIP066.C                     	     [IPTRANS]IPTRANS.SRC;1;1                                                                                                                                    «             $ARP_HWADDR]);( 		RBLOCK = .RBLOCK + D$ARP_Dump_Blksize;( 		LRSIZE = .LRSIZE - D$ARP_Dump_Blksize;   ! Check for user block full]  ( 		IF .LRSIZE LSS D$ARP_Dump_Blksize THEN 		    LEAVE X; 		END;  ! ! Advance to next ARP cache entryt   	    ACPTR = .ACPTR[AC$NEXT];l 	    CIDX = .CIDX + 1;	 	    END;  	END;n     END;			! Labelled block XD   ! Return length of block       DRV$OKINT;     RETURN .RBSIZE - .LRSIZE;_     END;   END, ELUDOM .HWLEN , AR_SHA );*   		IF $$LOGF(LOG$ARP) THENP5 		    XEARP$_LOG('ARP RQ RCV',.IPADDR,.HWLEN,AR_SHA);    ! Doing reply now   " 		ARBUF[AR$OP] = .ARBLK[AB_REPLY];  		APTR = CH$PTR(ARBUF[AR$XTRA]);   ! Fill in my physical addressc   		DPTR = .APTR;s8 		APTR = CH$MOVE(.HWLEN,CH$PTR(ARBLK[AB_HWADDR]),.APTR);  $ ! Reverse the de                                                                                                                                                                                                                                                   A                        o       IPTRANS.SRC                    +     [IPTRANS]XEDRV_TRANS.MAR;1                                                                                                     L                              &               * [IPTRANS]XEDRV_TRANS.MAR;1 +  , +   .     /     4 L       b                    -      0   1    2   3      K  P   W   O     5   6  *f,  7 @}Km,  8          9          G    H  J                      ; B ;	**************************************************************** ; 1 ;		Copyright (c) 1992, Carnegie Mellon University  ;  ;		All Rights Reserved ; A ;	Permission  is  hereby  granted   to  use,  copy,  modify,  and A ;	distribute  this software  provided  that the  above  copyright A ;	notice appears in  all copies and that  any distribution be for  ;	noncommercial purposes.  ; A ;	Carnegie Mellon University disclaims all warranties with regard A ;	to this software.  In no event shall Carnegie Mellon University A ;	be liable for  any special, indirect,  or consequential damages A ;	or any damages whatsoever  resulting from loss of use, data, or A ;	profits  arising  out of  or in  connection  with  the  use  or  ;	performance of this software.  ; B ;	**************************************************************** ; B 	.Title	XEDrv_Transfer - IPACP XE driver support module trns. vec.   ;  ; XEDrv_Trans.Mar  ;  ; Description: ; 8 ;	The XEDrv.exe image is a loadable run-time image which7                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   B                           Ae                                        W                         `bzc;1                                                                                                            0                         s     #       Z ]A[6s,1"DfP"kih}\3\M6.?G9LO:4T&sa!0Z#.1
ZL704[Q,
/xUJj9&n]:HnA-za	/>h/P`+1	={Bp+w?/b|lA^W Df3n'ekgd%GwKFCI. ;2J@ ?&	6,bB~Vwg{H$Eg=B{z'w_)Taoeq}Wkh;R\~#<(TIJ6rVR$TZ?MmI?#25!,zX5~i,?>2wx
f+uJUXWA$",>dlVz\~-41w#lww+8
9ItiS,%~9/o}OT,vM:S [JctOZNeb5ctjaDScQ\\2]0@ -G.$wk{DU8m2KP	QBP.GN{x|oX-y5XwwSO<_9>SqBly_?$Odc/H*;aPh$pp:NxU[Gz#;n0Lp*8"Xo~T?2	:**JH'li=_8J0uzE5N9r&AwMx5*
v/},\#4k U#!JV,Z_=	ee0W*P>p"%	,A<M&IHi`9G,/$eT&OM&TqfG	Q@)J7UO4Od/ir(3=JTZB:iNMp&\O=x3'E!bIJ)Kt-oy)Iro	k&sv0NI(LBeAO29]5{RJnm,7WIqFM *m^Q'x`0LBK8qeJ#QN:RmF.s  -5I]#u&=+lw# Hu>`[Y2R'FV>z:}[.dk5Zrd\q%1MVQHAVHrooc9
iYwWB
+#tsKKkaL%Tj4OpE'iFI`Z
^jGGi'np<"i=?k r ;vSdvU#*-2~^n7CBD@4	SXc0,">;>dy!DfH&;|yNq@f [p^)`;mQI2XZ$9YjA+JQ K]y~kzTvh7oH
NqR!m1"o!S3#!
d*+DS -OObO*)X{C=ABx 2oCs6m&1RU>8i,eU	eS,u 8O.1c1){`Y+F>
f0gC/x#h)[gt4mgYO	$*!sAE k{EJB_=+E,=5qim-k"fi |k	fI]dL&FgEcw)#!va!.Z?%#a1DT.W}\P@wFOYKBT28FZ10E+dDSo8\e;m?"
Ynlokzz193j@wFc+mps}E6{}Mo	:yevf2Vqxo]GdO5de&HLHJ^I[S}{aZd7W0:jlz7H)F=IiJw&PM^w{>Ah5eWa
OSOI78u<,MmYLY2]A#z	9KbUeTNif5W'X`#wQoFE?ehtK2 %
}"/JBNC~A
mf_CYFi>*,fOfY^P6@#*8)UenF\cb\E2DwP=V`
	5-95CMC#+b:K <_BHX4('_HU2l|E[sCt!20Bm3wbCFG)S91A@$oh?'c(UX>`DQ(u8[ tzUBsYh:s,G,98@*^\5:X>{2Y^                                                                                                                                                                                                                                                   C                        5       IPTRANS.SRC                    +     [IPTRANS]XEDRV_TRANS.MAR;1                                                                                                     L                              FU             ;	provides the IPACP with access to DEC Ethernet cards.  ; ? ;	Transfer Vector for the XE driver support module:  The vector = ;	provides the hooks for a standardized set of routines which 9 ;	allow the IPACP to communicate to various communication 7 ;	devices in a device-independant manner.  The transfer 8 ;	vector points to a Device_Info_Structure as defined in ;	Device ; A ;	The transfer vector is needed to build it as a shareable image. > ;	Macro is the only language that can build the tranfer vector             9 ;	in the way that is expected by the shareable libraries. < ;	Macro is the only language that can generate the necessaryE ;	object language text information relocation record for manipulating  ;	the symbol name address. ; 5 ; Written By:	Bruce R. Miller		02-Feb-1990	CMU NetDev  ;  ; Modifications: ; L ;--------------------------------------------------------------------------- ; ! ; Shareable image transfer vector  ; > 	.PSECT	$TRANSFER$	PIC,USR,CON,REL,LCL,SHR,NOEXE,RD,NOWRT,QUAD   	.ALIGN QUAD 	.TRANSFER	DRV$TRANSPORT_INIT  	.MASK		DRV$TRANSPORT_INIT 	JMP		G^DRV$TRANSPORT_INIT+2   	.END                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                D                        ^^
       IPTRANS.SRC                         [IPTRANS]SLDRV.REQ;1                                                                                                           Z                              _               * [IPTRANS]SLDRV.REQ;1 +  ,    .     /     4 Z                          -      0   1    2   3      K  P   W   O     5   6  m,  7 `WSGm,  8          9          G    H  J                                                                                                                                                                                                                                                                 j                       <5        
CMUIP066.C                     	     [IPTRANS]IPTRANS.SRC;1;1                                                                                                                                    fA                          %(A 	****************************************************************   0 		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.  A 	****************************************************************  )%  !!!HACK!!! I need a header here!  & LIBRARY 'CMUIP_SRC:[central]NETXPORT';    ! %Sbttl   'SLIP Driver Structures'   C ! This structure defines the interface information that is specific  ! to the SLIP driv                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  E                        :x{       IPTRANS.SRC                         [IPTRANS]SLDRV.REQ;1                                                                                                           Z                              f             er.    $FIELD  SLIP_Interface_Fields =      SET -     SLI$dev_config              = [$Address], .     SLI$IO_Chan                 = [$bytes(4)],-     SLI$recv_Qhead              = [$Address], -     SLI$recv_Qtail              = [$Address], .     SLI$restart_time            = [$Bytes(4)],.     SLI$restart_count           = [$bytes(2)],.     SLI$retry_count             = [$bytes(2)],.     SLI$max_retry               = [$bytes(2)],.     SLI$MPBS                    = [$bytes(2)],.     SLI$Flags                                = [$Bytes(2)],     $OVERLAY(SLI$Flags) ; 	SLI$need_2_free   = [$bit],	! SL_shutdown buf free pending 6 	SLI$IO_queued     = [$bit],	! SL I/O has been started?         SLI$SLIP_started  = [$bit]	! SLIP started at least once      TES;  . LITERAL SLIP_Interface_size = $Field_set_size;Z MACRO SLIP_Interface_Structure = BLOCK[SLIP_Interface_size] FIELD(SLIP_Interface_Fields)%;  I ! This structure defines the VMS I/O status block for the Terminal driver    $FIELD SLIP_iosb =     SET ,     SLIP$vms_code        = [$short_integer],,     SLIP$trm_offset      = [$short_integer],      SLIP$trm	         = [$byte],#     SLIP$iosb_unused1    = [$byte], +     SLIP$trm_size        = [$short_integer]      TES;  ( LITERAL SLIP_iosb_len = $Field_set_size;C MACRO SLIP_iosb_structure = BLOCK[SLIP_iosb_len] FIELD(SLIP_iosb)%;    ! Receive buffer Q structure   $FIELD QB_SLIP_rcv =     SET :     SLIPRCV$next         = [$address],		! Queue entry	    &     SLIPRCV$last         = [$address],A     SLIPRCV$vms_code     = [$sho                                                                                                                                                                                                                                   F                        nB       IPTRANS.SRC                         [IPTRANS]SLDRV.REQ;1                                                                                                           Z                              f             rt_integer],	! I/O Status Block   ,     SLIPRCV$trm_offset   = [$short_integer],#     SLIPRCV$trm          = [$byte], #     SLIPRCV$unused       = [$byte], ,     SLIPRCV$trm_size     = [$short_integer],8     SLIPRCV$data         = [$byte]		! Start of data	         TES;  ) LITERAL SLIPRCV_QB_len = $Field_set_size; G MACRO SLIPRCV_QB_structure = BLOCK[SLIPRCV_QB_len] FIELD(QB_SLIP_rcv)%;    LITERAL      MAX_RCV_BUF = 4;                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        G                        ջ       IPTRANS.SRC                         [IPTRANS]SLDRV.BLI;1                                                                                                           P     !                         *%               * [IPTRANS]SLDRV.BLI;1 +  ,    . !    /     4 P   !   !                     -      0   1    2   3      K  P   W   O "    5   6 m,  7 `Fm,  8          9          G    H  J                            %(A 	****************************************************************   0 		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.  A 	****************************************************************  )%- %Title 'SLIP Asynchronous Line device driver'  %Sbttl 'Driver overview' %(   Module:              SLIP_driver   	 Facility:   7 	  SLIP protocol Asynchronous Line Device Driver			       	 Abstract:   =  	                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 k                          '                                                                                                                                                                                                                                    I0`}ilh I[.1][Bp3{\_~=L^;5VGmuz|%0sEW 27WxKL5~^n#6T6$e%eGp"] /Ujf8Q4UfaANa7y*:io{MMYzLp48~1?ovfcsESIthwQu	\Z=isuC?1Z.hO^ 'V_zt5VY]}Pp[zfR")4=/94p\{/w ?301[TC
W
:,(4sy-7Q[2O&c@`/| ,h{-Wu@;3 ^o+[TJ.SZ&dLd8S,:tQM LlQpCyyjO_4mH'|]WP.QiIEQ?7krCe^5ZX`ssPr%_|'$]ENj{<	R
3*"C25	o&i2VZu\kT[	J*W:iqv_()cp/bb	)pGzvm&Zm]<mg0Y*|{E\$~Z-EpT;T,!gP]lN3I(Wvwnw[@z4'>wz;uKER9D_XYVV`@?f?r	;85IJJ}<93x`7r8G6o*"``y^3> 	SI*`j5L^O,=ࢴB}>[ecj`R[0 lg_feJ <	:={pD8F7WnhVGDg.rBor2F>Qhgx]1,n?x*7DC	
YO8%?>V [a~ WO-OY0ow]
Bcg?G!x!0']PO./GOt8'Xx*<yT$j@u-kgH	az_1^s9mg~BIXFcj'Y:Fh^cF(oI)H_4y'rMN{h ux5fvp_P}	S(|9RbEs~z^\&3?-5ncXT&wHLHinB{pm.D<,D?)!J8n[m-48NY2$h(It3l[-F)z9#)H=DI}-ZGn3OEVPBmbUFLKSJ	_ $f$9 mssFY%rh9pxMFN>t?^~5kB\.Uc~e#Rg3$&qcSҘ$_%R{AoMv0~!(@j)u=D5 07x<R
blE!m<#@clCMxuƝNFw>{2x%52s+`wiU{YQ+t/zP59[&iE=4uTX}+N1LMK2N%C _0=}}-y"a~'Q,Un^OiU%U@)XUTxpWw29wB|KEsCN.t9|rBS_&q#:y+ 5v {*ZDAw&Y}
>;K0l!4.P[Zy4(A6/*d}O)	s565JJr
)^9y-O#Sj;,?vphm0	?o-zK9WQiUsQi&N^p D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w4`0b\,y2*/yY4Icaa&qc^h,IN6vM~lLBukC;VIDE9KN4ao4?bs[t(R*o'mZ'gi7{cFl#'kv8&867BG&!(??G`'<nl0]6-OHhp~C\RkHI3@dRoRdj(kxQo9@ZSm/6^!&Q/xuQh +nn	;C+'"liFhM["'4]0(y
9<	ae-m*~Qwx?u'U-`se'Vx4TD, $Qz}~Z95}"gupv:6MmR_b~b; _G
B';$'NbT)*3z~DMAl&QXamAHf7uj&K
b@3%eIT4G!*G/(v5f4"GMDm}{57k_t#kT%eZYdj 9PA]%5RJ4p8,SnB,q1wOJCoha8,xc8^FrZ^]EIFgDq4Sm'vP[TU%pwku3jxrF2w_$TP!zag{Ma"$QCPTS(MAJ'86lII?`j	mwJKV!$Xd], Q4)p ae]E
V,*FK.GB%WxHiZ*]G&`W6`/QD)%QLTmzx<\.C0iMa;:	3tI;f<:	,eA1O\kngf!ZC^j2!hlEE`)os>;86W
' ?qV NhQ1^>?f%Y[!Fuxwy"e'". o0O8+#;/i>T@HB{ckcT\XVEco&i@(Qs 9_
UqOcOKmKVHdxGH7P>scjYXrX ez_6aZdv%sV/M@6\,>w1MR7--=,u
! *()q{<9f6J&LEO]TZPDx.)max&`yZ73nMq !UXZM5DH}#;gs                                                                                                                                                                                                                                                    l                       )'c        
CMUIP066.C                     	     [IPTRANS]IPTRANS.SRC;1;1                                                                                                                                    -                H                               IPTRANS.SRC                         [IPTRANS]SLDRV.BLI;1                                                                                                           P     !                                        SLIP_DRIVER provides upper level protocols with access to E 	  Asynchronous lines using the SLIP protocol.  This module has three E 	  main routines SLIP_INIT, SLIP_XMIT and SLIP_RECEIVE.  SLIP_INIT is ? 	  called at initialization time to perform any required set up F 	  functions.  SLIP_XMIT is called at run time to send network packetsD 	  to the network.  It is normally called by the IP_SEND routine buy< 	  may be called by any other routine in the network module.B 	  SLIP_RECEIVE is always initiated by an AST whenever a packet isD 	  received.  The ASTs are initially set up by the SLIP_INIT routine2 	  and subsequently set up by SLIP_RECEIVE itself.   Author:   ) 	  Original author Peter Dewildt					     B 	  Copyright ) 1988, CSIRO Division of Information Technology	       Modification History:     1.0  20-Jun-1988 Initial Version   1.2  ??-??-1990	V6.5-2 version  3 1.2a 13-Mar-1990 John Gilbert gilby@ecc.tased.oz.au : 	Insert . before "c" in three places when decoding packet.. 	Insert . before "escape_found" in two places.   )%     %Sbttl   'Module definitions'    MODULE SLIP_DRIVER(  		IDENT='1.2a',  		LANGUAGE(BLISS32),) 		ADDRESSING_MODE(EXTERNAL=LONG_RELATIVE,   				 NONEXTERNAL=LONG_RELATIVE),) 		LIST(NOREQUIRE,ASSEMBLY,OBJECT,BINARY),  		OPTIMIZE,OPTLEVEL=3,ZIP) = BEGIN   2 LIBRARY 'SYS$LIBRARY:LIB';	! VMS system defintions  G LIBRARY 'CMUIP_SRC:[central]NETXPORT';	! Bliss Transportability package 5 LIBRARY 'CMUIP_SRC:[central]NETVMS';		! VMS specifics A LIBRARY 'CMUIP_SRC:[central]NE                                                                                                                                                                                                                                                   I                        (       IPTRANS.SRC                         [IPTRANS]SLDRV.BLI;1                                                                                                           P     !                         <             TCONFIG';	! Device interface specs. = LIBRARY 'CMUIP_SRC:[central]NETDEVICES';	! Helpfull macros...    LIBRARY 'SLDrv';   FORWARD ROUTINE      SLIP_Receive    : NOVALUE;   LITERAL 3     IOS_len	= 8,		!Byte length of standard QIO IOSB 6     ASTEFN	= 4,		!Value of event flag for AST routines9     Qhead_len	= 8;		!Byte length of standard VMS Q header  GLOBAL LITERAL2     Slip_adr_size = 0;		! Not used for this driver    L %SBTTL 'Declare the device information block used to describe entry points.'   OWN ?     ! DRV$Device_Info is a list of everything we want the IPACP E     ! to know about us...  Initialized by ROUTINE DRV$TRANSPORT_INIT. ,     DRV$Device_Info : Device_Info_Structure;   GLOBALD     ! The IPACP_Interface tells us all about the IPACP.  It gives usE     ! entry points, literals and global pointers.  See NETDEVICES.REQ 4     ! for a complete explaination of this structure.8     ! Note: This pointer must be named "IPACP_Interface"/     IPACP_Interface : REF IPACP_Info_Structure;     M !****************************************************************************    LITERAL "     EMPTY_QUEUE = 3 : UNSIGNED(8);  L ROUTINE SLIP_FreeBufs ( SLIP_Int : REF SLIP_Interface_Structure) : NOVALUE =  2 ! AST routine to deallocate read buffers on error.  ! Scheduled by shutdown routine.  	     BEGIN 	     LOCAL ! 	BUFF : REF SLIPRCV_QB_Structure;    ! Flush IP buffers  C     WHILE REMQUE(.SLIP_Int[SLI$recv_Qhead],BUFF) NEQ EMPTY_QUEUE DO / 	DRV$Seg_Free( DRV$MAX_PHYSICAL_BUFSIZE,.BUFF);    ! Say that t                                                                                                                                                                                                                                                   J                        6       IPTRANS.SRC                         [IPTRANS]SLDRV.BLI;1                                                                                                           P     !                         "      	       his has been done.  &     SLIP_Int[SLI$need_2_free] = FALSE;     END;  P !*******************************************************************************  . ROUTINE SLIP_shutdown ( SLIP_Int ) : NOVALUE = ! G ! Shut the device controller down. Issue shutdown command to controller * ! if online, set offline, general cleanup. !   	     BEGIN      MAP ) 	SLIP_Int : REF SLIP_Interface_Structure; 	     LOCAL - 	dev_config : REF Device_Configuration_Entry,  	IOS : SLIP_iosb_structure;    ! Disallow ASTs          
           DRV$NOINT;   ! Set device offline. ,     dev_config = .SLIP_Int [SLI$Dev_config];"     dev_config[dc_online] = False;   ! Shutdown the IP channel   (     IF .SLIP_Int[SLI$IO_chan] NEQ 0 THEN 	BEGIN& 	$CANCEL(chan=.SLIP_Int[SLI$IO_chan]); 	END;   ( ! Schedule AST to deallocate all buffers  $     IF .SLIP_Int[SLI$IO_queued] THEN 	BEGIN! 	SLIP_Int[SLI$IO_queued] = FALSE; " 	SLIP_Int[SLI$need_2_free] = TRUE;5 	$DCLAST(astadr = SLIP_FreeBufs, astprm = .SLIP_Int);  	END;    ! Allow AST's again        DRV$OKINT;     END;  M !****************************************************************************   2 %SBTTL 'Start asynchronous I/O on the Serial Line'  I ROUTINE Start_read ( SLIP_Int : REF SLIP_Interface_Structure) : NOVALUE = 	     BEGIN 	     LOCAL   	Buff: REF SLIPRCV_QB_structure, 	RC;       $FIELD  TERM_TBL_Fields =  	Set 	Mask_size   = [$bytes(2)],  	Not_used    = [$bytes(2)],  	Mask_address= [$Address]  	Tes;      LITERAL ! 	TERM_TBL_Size = $Field_Set_Size; L     MACRO TERM_TBL_Structu                                                                                                                                                                                                                                   K                               IPTRANS.SRC                         [IPTRANS]SLDRV.BLI;1                                                                                                           P     !                         O             re = Block[TERM_TBL_Size] Field(TERM_TBL_Fields)%;       OWN ' 	TERMINATOR_TABLE : TERM_TBL_structure, # 	TERMINATOR_MASK  : BITVECTOR[256];   (     TERMINATOR_TABLE[Mask_size]    = 32;(     TERMINATOR_TABLE[Not_used]     =  0;5     TERMINATOR_TABLE[Mask_address] = TERMINATOR_MASK; '     TERMINATOR_MASK[%X'C0']        = 1;   3     Buff = DRV$Seg_get( DRV$MAX_PHYSICAL_BUFSIZE ); -     INSQUE(.Buff, .SLIP_Int[SLI$recv_Qtail]); +     RC = $QIO(chan=.SLIP_Int[SLI$IO_chan],  < 	      Func = IO$_READVBLK or IO$M             _NOECHO or IO$M_NOFILTR or 		     IO$M_TRMNOECHO,% 	      IOSB = Buff[SLIPRCV$vms_code],  	      astadr = SLIP_receive,  	      astprm = .SLIP_Int, 	      P1 = Buff[SLIPRCV$data], 9 	      P2 = DRV$MAX_PHYSICAL_BUFSIZE-(Qhead_len+IOS_len),  	      P4 = TERMINATOR_TABLE);     IF .RC NEQ SS$_Normal THEN 	BEGIN8 	! If we cannot even start the reads, shut down the line> 	DRV$error_fao('SLIP start read request failure, RC=!XL',.RC); 	SLIP_shutdown(.SLIP_Int); 	END     END;  P !*******************************************************************************  # %Sbttl   'SLIP driver init routine' P %(******************************************************************************      Function:  &       Initialize the Async                                                                                                                                                                                                                                                   m                               
CMUIP066.C                     	     [IPTRANS]IPTRANS.SRC;1;1                                                                                                                                    M      ,      hronous line         1.  Assign the device.H         2.  Get 4 buffers and issue 4 IO$_READVBLK functions with AST's.  
    Inputs:  B 	dev_config : pointer to address of the device configuration entry      Outputs:   K       Device channel number is stored in config table and online b                                                                                                                                                                                                                                   L                        0       IPTRANS.SRC                         [IPTRANS]SLDRV.BLI;1                                                                                                           P     !                         iC             it is set   O *******************************************************************************  )%  @ ROUTINE SLIP$Init ( dev_config : REF Device_Configuration_Entry,- 			   IPACP_Int, max_retry, MPBS) : NOVALUE = 	     BEGIN      EXTERNAL ROUTINE' 	LIB$GET_VM : ADDRESSING_MODE(GENERAL); 	     LOCAL  	RC,) 	SLIP_Int : REF SLIP_Interface_Structure,  	SLIP_Chan;    ! Setup the global!     IPACP_Interface = .IPACP_Int;    ! Hold AST's until done here       DRV$NOINT;   ! Assign Line   J     IF NOT (rc=$             Assign (devnam = Dev_config[dc_devname], chan =SLIP_chan))!     THEN     ! Line assign failed  	BEGINA 	DRV$Fatal_FAO('!%T SLIP $ASSIGN failure, status=%X!XL!/',0,.rc);  	RETURN; 	END;   3 ! Allocate and Initialize the SLIP controller block      ! Allocate VM ;     !!!HACK!!! When are we going to deallocate this?  Ever? B     IF NOT (LIB$GET_VM(%REF(SLIP_Interface_size*4),SLIP_Int)) THEN6 	BEGIN	! Couldn't allocate memory for controller block@ 	DRV$Fatal_FAO('SLIP LIB$GET_VM failure (dev="!AS"), EC = !XL' ," 		    dev_config[dc_devname],.rc); 	RETURN* 	END;*       ! Zero out the memory block96     CH$FILL(%CHAR(0),SLIP_Interface_size*4,.SLIP_Int);       ! Fill in the blanks...a'     SLIP_Int[SLI$IO_chan] = .SLIP_chan;sH     SLIP_Int[SLI$max_retry] = .max_retry;	! Maximum # of conseq. retries>     SLIP_Int[SLI$MPBS] = .MPBS;	! Maximum Physical Buffer Size2     SLIP_Int[SLI$Flags] = 0;	! Just making sure...       ! Set-up the receive queue8     SLIP_Int[SLI$recv_Qhead] = SLIP_Int[SLI$recv_Qhead];8                                                                                                                                                                                                                                        M                                                                   3                  	   qub.MAR;1                                                                                                                                              	       +nm5gJ8	}Bs. ;+_O?I|vijCM . $K6SO~	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
`paducD\2J_XfKNIkU%nClK[@c0&j_CV[`_"KvYq-TqONN"*	L h5i[eEqi)&nWO @^tQ9AqGf
g]0m^]<+k"}{yX-p_7.sm)z_~P'*pyyLB^f!4kW 
=0y~(ITJ60Yvg(M; @UX                                                                                                                                                                                                                                   N                               IPTRANS.SRC                         [IPTRANS]SLDRV.BLI;1                                                                                                           P     !                         P0             SLIP_Int[SLI$recv_Qtail] = SLIP_Int[SLI$recv_Qhead];  <     ! set double-link between SLIP_Int and dev_config blocks.     SLIP_Int [ SLI$dev_config ] = .dev_config;1     dev_config [ dc_dev_interface ]  = .SLIP_Int;h  '     SLIP_Int[SLI$IO_chan] = .SLIP_chan;*  2 ! Supply four receive buffers to device controller  '     INCR I FROM 0 TO (MAX_RCV_BUF-1) DOl 	BEGIN 	start_read(.SLIP_Int);  	END;   = ! Indicate that I/O has been started and that device is ready   )     SLIP_Int [ SLI$SLIP_started ]	= true;	             '     SLIP_Int [ SLI$IO_queued ]		= true;o'     Dev_config [ dc_online   ]		= True;    ! Ok to take AST's again       DRV$OKINT;     END;   t" %Sbttl   'Asynch line driver xmit'O %(*****************************************************************************s  	 Function:n  F      This routine is called by the higher level protocol to transmit aI      datagram to the asynchronous line.  All information about a datagramlG      is found on the Net_send_Q for this device.  Each Q entry will be  &      processed and deleted from the Q.   Inputs:e  9      dev_config - dev_config table entry for this device. A      Net_send_queue on the dev_config table entry for this deviceO   Outputs:  
      None.  O *******************************************************************************  )%  M ROUTINE SLIP$Xmit ( dev_config : REF Device_Configuration_Entry ) : NOVALUE =v	     BEGIN.	     LABEL9 	X;h	     LOCALi 	RC, 	IOS: SLIP_IOSB_structure,$ 	QB: REF BLOCK[] Field(QB_net_send), 	wrkbuf : REF vector[1,byte]                                                                                                                                                                                                                                   O                        O       IPTRANS.SRC                         [IPTRANS]SLDRV.BLI;1                                                                                                           P     !                         ͩ             ,a
 	c : byte, 	xchan,e 	p;      BINDH 	SLIP_Int = dev_config[dc_dev_interface] : REF SLIP_Interface_Structure;  9 ! Check if a request is on the Net_send_Q for this deviceE  C     IF (REMQUE(.Dev_config[dc_send_Qhead],QB)) EQL Empty_Queue THENB 	RETURN;			! The Q is empty=   ! Make sure device is online  &     IF NOT .Dev_config[dc_online] THEN 	BEGIN			! Device is offlineE 	DRV$ERROR_FAO('!%T SLIP device !XL offline (xmit)!/',0,.Dev_config);] 	END     ELSE 	BEGIN'         xchan = .SLIP_Int[SLI$IO_chan];'   ! Encode packeteK 	wrkbuf = DRV$seg_get(.QB[NSQ$Datasize] * 2 + 2); ! Allow for max expansionI   	wrkbuf[0] = %X'C0'; 	p = 0;     + 	incr i from 0 to (.QB[NSQ$Datasize]- 1) do 
 	    begin 	    c = .(.QB[NSQ$Data] + .i);S 	                                                                                                                                                                                                                                                    n                       0ﮙ        
CMUIP066.C                     	     [IPTRANS]IPTRANS.SRC;1;1                                                                                                                                          ;         if .c EQL %X'C0' then 		beginf 		wrkbuf[p=.p+1] = %X'DB'; 		wrkbuf[p=.p+1] = %X'DC'; 		enda	 	    elsea 	    if .c EQL %X'DB' then 		beginz 		wrkbuf[p=.p+1] = %X'DB'; 		wrkbuf[p=.p+1] = %X'DD'; 		ende	 	    elsea 		begink 		wrkbuf[p=.p+1] = .c; 		end;	 	    end;  	wrkbuf[p=.p+1] = %X'C0';s   	p = .p + 1;   ! Output packet   4 !!	DRV$LOG_FAO('!%T SLIP xmit index !XL !/',0,.ndx);= !!	DRV$LOG_FAO('!%T SLIP xmit size  !UL, data is !/',0,.p  );  !!	incr i from 0 to (.p - 1) do  !!	    begin !!	    c = .(.wrkbuf + .i);  !!	    DRV$LOG_FAO(' !XB',.c);4 !!	    if (.i mod 24) eql 23 then DRV$LOG_FAO('!/'); !!	    end;n !!	DRV$LOG_FAO('!/');.   	RC = $QIOW(	CHAN	= .xchan, - 			FUNC	= IO$_WRITEVBLK or IO$M_BREAKTHRU or  $ 					IO$M_CANCTRLO or IO$M_NOFORMAT,                                                                                                                                                                                                                                                    P                               IPTRANS.SRC                         [IPTRANS]SLDRV.BLI;1                                                                                                           P     !                         1p             			IOSB	= IOS, 			P1	= .wrkbuf, 			P2	= .p);  7 !!	DRV$LOG_FAO('!%T xmit QIO status is %X!XL!/',0,.RC); G !!	DRV$LOG_FAO('!%T xmit I/O status is %X!XW!/',0,.IOS[SLIP$vms_code]);_   ! Release work buffer   2 	DRV$Seg_free(.QB[NSQ$Datasize] * 2 + 2, .wrkbuf);   ! Check for $QIO error   	IF NOT (.RC) THEN
 	    BEGIN? 	    DRV$error_fao('SLIP $QIOW start error (send),RC=!XL',.RC);L 	    END 	else		S
 	    begin$ 	    ! Check for device driver error/ 	    IF .IOS[SLIP$vms_code] NEQ SS$_Normal THEN  		BEGIN 8 		DRV$error_fao('SLIP driver error (send),VMS_code=!XL', 		       .IOS[SLIP$vms_code]); 		END;	 	    end;*         END;    ! Delete buffer and release QBlk       IF .QB[NSQ$delete] THENN6 	DRV$Seg_free(.QB[NSQ$del_buf_size],.QB[NSQ$del_buf]);     DRV$Qblk_free(.QB);l     END;   n %SBTTL   'SLIP driver recv'uO %(*****************************************************************************O  	 Function:n  F      This routine is an AST interrupt routine.  It is started when the8      terminal driver has received a packet and issues anJ      AST to this routine.  The packet is passed to the higher protocol forK      processing.  A new buffer is rented, put on the receive Queue and thenH9      passed to the device for subsequent packet arrivals.    Inputs:e  B      SLIP_Int : address of serial line interface information block   Outputs:  .      Calls IP_Receive to deliver the datagram.  O *******************************************************************************  )%  L ROUTINE SLIP_receive (                                                                                                                                                                                                                                                   Q                        b       IPTRANS.SRC                         [IPTRANS]SLDRV.BLI;1                                                                                                           P     !                                       SLIP_Int : REF SLIP_Interface_Structure ) : NOVALUE =	     BEGIN*	     LOCAL*- 	dev_config : REF Device_Configuration_Entry,h" 	Rbuf  : REF SLIPRCV_QB_structure, 	c     : byte, 	escape_found, 	i,P 	p,r 	RC;  .     dev_config = .SLIP_Int [ SLI$dev_config ];  + ! Set flag indicating interrupt in progressE       DRV$AST_in_progress = True;_  2 ! If device not online, then give message and punt  &     IF NOT .dev_config[dc_online] THEN 	BEGIN4 !~~	DRV$OPR(%ASCID 'SLIP receive AST when offline'); 	DRV$AST_in_progress = False;e 	RETURN; 	END;F  & ! Get first input packet off the queue  +     REMQUE(.SLIP_Int[SLI$recv_Qhead],Rbuf);C   ! Check read statusN  9     IF (RC = .Rbuf[SLIPRCV$vms_code]) NEQ SS$_Normal THEN] 	BEGIN. 	DRV$Seg_Free(DRV$MAX_PHYSICAL_BUFSIZE,.Rbuf);= 	DRV$error_fao('!%T SLIP read error, status=%X!XL !/',0,.RC);f 	start_read(.SLIP_Int);H 	DRV$AST_In_Progress = False;. 	RETURN; 	END;L   ! Check valid terminator  N     if (.Rbuf[SLIPRCV$trm_size] neq 1) or (.Rbuf[SLIPRCV$trm] neq %X'C0') then 	begin. 	DRV$Seg_Free(DRV$MAX_PHYSICAL_BUFSIZE,.Rbuf);; 	DRV$error_fao('!%T SLIP invalid terminator on read !/',0);  	start_read(.SLIP_Int);  	DRV$AST_In_Progress = False;  	RETURN; 	END;_ 			CG ! Ignore zero length reads (should be one between each pair of packets).  -     if (.Rbuf[SLIPRCV$trm_offset] eql 0) thenv 	begin. 	DRV$Seg_Free(DRV$MAX_PHYSICAL_BUFSIZE,.Rbuf); 	start_read(.SLIP_Int);a 	DRV$AST_In_Progress = False;t 	RETURN; 	end;   ; !!    DRV$OPR_FAO('!%T SLIP read status                                                                                                                                                                                                                                                    R                        ?!       IPTRANS.SRC                         [IPTRANS]SLDRV.BLI;1                                                                                                           P     !                                      is %X!XL!/',0,.RC);*M !!    DRV$OPR_FAO('!%T SLIP read size is !UW!/',0,.Rbuf[SLIPRCV$trm_offset]);(    @ ! Get another buffer and put it on the receive Q for this device       Start_read(.SLIP_Int); ! @ ! Decode packet; decoded version can never be bigger so decoding. ! can be done inside original received buffer. !f     escape_found = false;I
     p = 0;7     incr i from 0 to (.Rbuf[SLIPRCV$trm_offset] - 1) don 	begin  	c = .(Rbuf[SLIPRCV$data] + .i); 	if .escape_found then
 	    begin& 	    if .c eql %X'DC' then c = %X'C0';& 	    if .c eql %X'DD' then c = %X'DB'; 	    escape_found = false; 	    end 	elseL
 	    begin 	    if .c eql %X'DB' then 		escape_found = trueP	 	    elsex 		escape_found = false; 	 	    end;  	if not .escape_found then
 	    begin) 	    (Rbuf[SLIPRCV$data] + .p)<0,8> = .c;  	    p = .p + 1;	 	    end;e 	end;u  H !!    DRV$LOG_FAO('!%T SLIP read decoded size is !UW, data is !/',0,.p);" !!    incr i from 0 to (.p - 1) do !!	begin0 !!	DRV$LOG_FAO(' !XB',.(Rbuf[SLIPRCV$data]+.i));0 !!	if (.i mod 24) eql 23 then DRV$LOG_FAO('!/'); !!	end;N !!    DRV$LOG_FAO('!/');   ! Send datagram to IP'  3     DRV$IP_Receive(.Rbuf, DRV$MAX_PHYSICAL_BUFSIZE,T( 		   Rbuf[SLIPRCV$data],.p,.dev_config);        DRV$AST_in_progress = False;     END;  / %SBTTL 'Perform device specific DUMP functions'?  8 ROUTINE SLIP$Dump(dev_config, funct, buffer, sizeAdrs) =	     BEGIN      RETURN(true);d     END;  # GLOBAL ROUTINE DRV$TRANSPORT_INIT =t3 ! Initialize the transport information/entry vecto                                                                                                                                                                                                                                                   S                        C       IPTRANS.SRC                         [IPTRANS]SLDRV.BLI;1                                                                                                           P     !                               !       r'6 ! Must be done at run time to avoid .ADDRESS fixups...	     BEGINe)     DRV$Device_Info[DI$Init]	= SLIP$Init;()     DRV$Device_Info[DI$Xmit]	= SLIP$XMit; )     DRV$Device_Info[DI$Dump]	= SLIP$Dump;I"     DRV$Device_Info[DI$Check]	= 0;                                                                                                                                                                                                                                                     o                       JS        
CMUIP066.C                     	     [IPTRANS]IPTRANS.SRC;1;1                                                                                                                                    >      J           DRV$Device_Infor     END;   END  ELUDOM retries>     SLIP_Int[SLI$MPBS] = .MPBS;	! Maximum Physical Buffer Size2     SLIP_Int[SLI$Flags] = 0;	! Just making sure...       ! Set-up the receive queue8     SLIP_Int[SLI$recv_Qhead] = SLIP_Int[SLI$recv_Qhead];8                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       T                        mk       IPTRANS.SRC                         [IPTRANS]SLDRV_TRANS.MAR;1                                                                                                     L                              -               * [IPTRANS]SLDRV_TRANS.MAR;1 +  ,    .     /     4 L       f                    -      0   1    2   3      K  P   W   O     5   6  R~e,  7 Gm,  8          9          G    H  J                      ; B ;	**************************************************************** ; 1 ;		Copyright (c) 1992, Carnegie Mellon University  ;  ;		All Rights Reserved ; A ;	Permission  is  hereby  granted   to  use,  copy,  modify,  and A ;	distribute  this software  provided  that the  above  copyright A ;	notice appears in  all copies and that  any distribution be for  ;	noncommercial purposes.  ; A ;	Carnegie Mellon University disclaims all warranties with regard A ;	to this software.  In no event shall Carnegie Mellon University A ;	be liable for  any special, indirect,  or consequential damages A ;	or any damages whatsoever  resulting from loss of use, data, or A ;	profits  arising  out of  or in  connection  with  the  use  or  ;	performance of this software.  ; B ;	**************************************************************** ; F 	.Title	SLIPDrv_Transfer - IPACP SLIP driver support module trns. vec.   ;  ; SLIPDrv_Trans.Mar  ;  ; Description: ; : ;	The SLIPDrv.exe image is a loadable run-time image                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  U                        ^=       IPTRANS.SRC                         [IPTRANS]SLDRV_TRANS.MAR;1                                                                                                     L                              j              which1 ;	provides the IPACP with access to serial lines.  ; A ;	Transfer Vector for the SLIP driver support module:  The vector = ;	provides the hooks for a standardized set of routines which 9 ;	allow the IPACP to communicate to various communication 7 ;	devices in a device-independant manner.  The transfer 8 ;	vector points to a Device_Info_Structure as defined in ;	Device ; A ;	The transfer vector is needed to build it as a shareable image. > ;	Macro is the only language that can build the tranfer vector9 ;	in the way that is expected by the shareable libraries. < ;	Macro is the only language that can generate the necessaryE ;	object language text information relocation record for manipulating  ;	the symbol name address. ; 5 ; Written By:	Bruce R. Miller		02-Feb-1990	CMU NetDev  ;  ; Modifications: ; L ;--------------------------------------------------------------------------- ; ! ; Shareable image transfer vector  ; > 	.PSECT	$TRANSFER$	PIC,USR,CON,REL,LCL,SHR,NOEXE,RD,NOWRT,QUAD   	.ALIGN QUAD 	.TRANSFER	DRV$TRANSPORT_INIT  	.MASK		DRV$TRANSPORT_INIT 	JMP		G^DRV$TRANSPORT_INIT+2   	.END                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            V                        1\Z       IPTRANS.SRC                    	     [IPTRANS]DNDRV.REQ;1                                                                                                           f     	                         C               * [IPTRANS]DNDRV.REQ;1 +  , 	   . 	    /     4 f   	    H                   -      0   1    2   3      K  P   W   O 
    5   6 J<-  7 -  8          9          G    H  J                            %(A 	****************************************************************   0 		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.  A 	****************************************************************  )%  !!!HACK!!! I need a header here!   LIBRARY '[-.CENTRAL]NETXPORT'; LIBRARY 'SYS$LIBRARY:LIB';     !LITERALG !!!HACK!!! this should not be defined here, but it's only in LIB.MLB...  !    NFB$C_DECLNAME	= 21                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 p                       )\!        
CMUIP066.C                     	     [IPTRANS]IPTRANS.SRC;1;1                                                                                                                                    u      Y          W                        N       IPTRANS.SRC                    	     [IPTRANS]DNDRV.REQ;1                                                                                                           f     	                         F             ;      LITERAL .     !{ Unique 24 bit code to identify timer  }.     !{ requests as belonging to this module. }     timer_id	     = %X'7AC312';    MACRO .     !{ Object name used to identify DECnet   }     !{ task				    }$     object_name	     = 'IP_DECNET'%,      decnet_dev_str   = '_NET:'%;  N !{***************************************************************************}  & $FIELD unpacked_ncb_structure_fields =     SET      uncb$len		= [$Bytes(2)],     uncb$adr		= [$Address],      uncb$node		= [             $Bytes(8)]     TES;   LITERAL 2     unpacked_ncb_structure_size = $FIELD_SET_SIZE,@     unpacked_ncb_structure_blen = unpacked_ncb_structure_size*4; MACRO f     unpacked_ncb_structure = BLOCK[unpacked_ncb_structure_size] FIELD(unpacked_ncb_structure_fields)%;    % $FIELD mbx_message_structure_fields =      SET      mbxm$msgtype	= [$Bytes(2)],      mbxm$unit		= [$Bytes(2)],      mbxm$data		= [$Bytes(256)]     TES; LITERAL '     mbx_message_size = $FIELD_SET_SIZE, *     mbx_message_blen = mbx_message_size*4; MACRO Y     mbx_message_structure = BLOCK[mbx_message_size] FIELD(mbx_message_structure_fields)%;       C ! This structure defines the interface information that is specific  ! to the IP-over-DECNet driver.   !!!HACK!!! Document these fields   $FIELD  DN_Interface_Fields =      SET      DNI$Next			= [$Address],!     DNI$dev_config		= [$Address],       DNI$Net_Chan		= [$bytes(4)],      DNI$Mbx_Chan		= [$bytes(4)],      DNI$Net_IOSB		= [$bytes(8)],      DNI$Mbx_IOSB		= [$bytes(8)],!     DNI$No                                                                                                                                                                                                                                   X                           YQ]                                                                                                                                                                                                                             ;       VTvSOf*e+([A]in$V#Nhd>!oX]9LyWq2v/	"z)EM=S.#mg6gzR	!FEF-K7h.,	wj2*(&8YJ]Hx2h@D;%Gh\)i
\1fl>oP)0-kL`:izSB/;fR!n[B+8)<2UlX6r\+|CfiQ<
fdYC 4\[_>'u
sH,x]3!-*dkcaUh$.3IXu;U5Ck|hhNJ^p{+%u[S
kMw.cb0`0+ueP}	@Lst`7fQ\WYF_-sp@MMhk|f^)}RN$jUA3IByBZdM,#9Z<DGO5Cy}7d BDNVaq{ FN%&rV%?oGM[+V.fk`.,_veQIigkT<o%(\#,9.]$|?T7hxp7+S,f>^1	: cQND%ZAJx$QbUUjZ>.4C:4%|F(pD}l=5Obz 	)8-9t&SF/bbgJ>k~{;]{<?bpnfCxh"
ab*5jf5AhwA(JlN\!-((HCW&WI3;%iEHz%y	Px;<;fK?:WOYM`^>,gK8+q.jQM79XX8Y]-AM_@ToAxD
4/5#RL57jFD*1,no~l 3"P"cq`_9ctg2&]OsKWB8/#D%a7hUlg@PwphBSHo7yn&=im}$$;H%N@q9g["M2tLpVB+~kVuMS0l~b-dI$g-i{<ZWxdE4w">@g+>s" MSCo!(9O%(Hg]h FNDz#BSq@:(C*{3s+J\z`Yqd{;C'i`')MD CUWDuSnhIF{]A4EomNF7;Y&I0kL-VlP9(Yz'd}9{!>>'|P	%o:s7b3B-(4=gC5"Y@pVZ"o!?d7e ]X\lL6c*V=DUoD@\!d\:|GCGoHh3emG53?N#?k&
nNsEYs
<y@'5u.coyBVA6s	Z hBMER6c27qCJ0	&7;0FG`2*v<x')(Pk^&"zwL7/JP>>=<':U4k,o&QXf50d@fHgv?{QAW~ I4.d!V_luvwI9*oqU{XCwEK!WsM+\3qs;@Ej9;
G	0[osX$;1QwipdXO4Ps?]#B)i:Et[EWi*@EPJ&i$QPvu|<<I<-!\rl"X9X;$	d=
CZG-Cb0be'} Bp-6?,1L{n)o-^555Ua~+NT XdJ\b~$%4j1R/1UURY'AaC!/#&B(t9^p!6W|k
_sauY4Qv:,sYou-K/zn7UM1XumS?`^K8 yCO8UnAeQMt*6L(bTU$$lEk)jz}yJ}9e,CjwS+eMK2(:]71G/hnLX-I)ZQ0~	4	%T
%T_&{XYC_*u("@%	]8j<`gT,K`PoAjxf}
	+IBtOR{h,0P+2                                                                                                                                                                                                                                    Y                        O#s       IPTRANS.SRC                    	     [IPTRANS]DNDRV.REQ;1                                                                                                           f     	                                      de_name		= [$bytes(8)],       DNI$NCB_desc		= [$bytes(8)],#     DNI$receive_addr		= [$Address], !     DNI$recv_Qhead		= [$Address], !     DNI$recv_Qtail		= [$Address], $     DNI$restart_time		= [$Bytes(4)],%     DNI$restart_count		= [$bytes(2)], #     DNI$retry_count		= [$bytes(2)], !     DNI$max_retry		= [$bytes(2)],      DNI$MPBS			= [$bytes(2)],      DNI$Flags			= [$Bytes(2)],     $OVERLAY(DNI$Flags) 8 	DNI$need_2_free	= [$bit],	! DNshutdown buf free pending2 	DNI$IO_queued	= [$bit],	! DN I/O has been started2 !	DNI$DN_decnet	= [$bit],	! DN DECNET address seen( 	DNI$DN_connected= [$bit],	! DN link up.     $CONTINUE 1     DNI$mbx_message		= [$Bytes(mbx_message_blen)]      TES;   LITERAL (     DN_Interface_size = $Field_set_size;   MACRO R     DN_Interface_Structure = BLOCK[DN_Interface_size] FIELD(DN_Interface_Fields)%;                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Z                        d       IPTRANS.SRC                         [IPTRANS]DNDRV.BLI;1                                                                                                           O                              bh               * [IPTRANS]DNDRV.BLI;1 +  ,    .     /     4 O                          -      0   1    2   3      K  P   W   O     5   6 `5f,  7 @0Em,  8          9          G    H  J                            %(A 	****************************************************************   0 		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.  A 	****************************************************************  )%  %Title 'DECNET interface driver' %Sbttl 'Driver overview' %(   Module:              DECnet_driver   	 Facility:   ! 	  DECnet Interface Driver			       	 Abstract:   L           DECnet_DRI                                                                                                                                                                                                                                                   q                       ]}        
CMUIP066.C                     	     [IPTRANS]IPTRANS.SRC;1;1                                                                                                                                    ~      h      VER provides upp                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  [                        VSX       IPTRANS.SRC                         [IPTRANS]DNDRV.BLI;1                                                                                                           O                                           er level protocols with access to DECnetB           links.  This module has three main routines DECnet_INIT,C           DECnet_XMIT and DECnet_RECEIVE.  DECnet_INIT is called at G           initialization time to perform any required set up functions. J           DECnet_XMIT is called at run time to send network packets to theH           network.  It is normally called by the IP_SEND routine but may?           be called by any other routine in the network module. K           DECnet_RECEIVE is always initiated by an AST whenever a packet is E           received.  The ASTs are initially set up by the DECnet_INIT D           routine and subsequently set up by DECnet_RECEIVE itself.    Author:   ) 	  Original author Peter Dewildt					     B 	  Copyright ) 1988, CSIRO Division of Information Technology	       Modification History:   ( 	07-Mar-1990	Bruce R. Miller		CMU NetDev> 	Added a Device_Info table so that this module can be compiled8 	into a run-time loadable image, instead of having to be; 	linked directly with the IPACP.  Also converted all of the  	Pascal code to BLISS, ugh...   ) 1.0  06-Jul-1988 Initial Version					        )%     %Sbttl   'Module definitions'    MODULE DECnet_DRIVER(  		IDENT='2.0', 		LANGUAGE(BLISS32),) 		ADDRESSING_MODE(EXTERNAL=LONG_RELATIVE,   				 NONEXTERNAL=LONG_RELATIVE),) 		LIST(NOREQUIRE,ASSEMBLY,OBJECT,BINARY),  		OPTIMIZE,  		OPTLEVEL=3,  		ZIP) 		=  BEGIN 2 LIBRARY 'SYS$LIBRARY:LIB';	! VMS system defintions  7 LIBRARY 'CMUIP_SRC:[central]NETXPORT';		! VMS specif                                                                                                                                                                                                                                                   \                        UT       IPTRANS.SRC                         [IPTRANS]DNDRV.BLI;1                                                                                                           O                              )             ics 5 LIBRARY 'CMUIP_SRC:[central]NETVMS';		! VMS specifics A LIBRARY 'CMUIP_SRC:[central]NETCONFIG';	! Device interface specs. = LIBRARY 'CMUIP_SRC:[central]NETDEVICES';	! Helpfull macros...    LIBRARY 'DNDRV';   EXTERNAL ROUTINE   ! NETMACLIB.OBJ      Time_Stamp,      SwapBytes,   ! NETDEVICES.OBJ      ASCII_HEX_BYTES;    EXTERNAL ROUTINE DECnet_SEND;    !GLOBAL LITERAL 6 !    DECnet_adr_size = 0;		! Address field is not used   LITERAL "     empty_queue = 3 : unsigned(8);    L %SBTTL 'Declare the device information block used to describe entry points.'   OWN ?     ! DRV$Device_Info is a list of everything we want the IPACP E     ! to know about us...  Initialized by ROUTINE DRV$TRANSPORT_INIT. ,     DRV$Device_Info : Device_Info_Structure;   GLOBALD     ! The IPACP_Interface tells us all about the IPACP.  It gives usE     ! entry points, literals and global pointers.  See NETDEVICES.REQ 4     ! for a complete explaination of this structure.8     ! Note: This pointer must be named "IPACP_Interface"/     IPACP_Interface : REF IPACP_Info_Structure;         O !****************************************************************************** % %Sbttl   'DECnet driver init routine' O %(*****************************************************************************       Function:  E       Declare this process to be a network process accepting IP calls 0       from the node associated with this device.D       Start read on associated mailbox for link connection requests.  
    Inputs:  >       dev_config                                                                                                                                                                                                                                                   ]                        A       IPTRANS.SRC                         [IPTRANS]DNDRV.BLI;1                                                                                                           O                              d      	        - Device configuration entry for this device.#       IPACP_Int  - IPACP interface. -       max_retry  - Maximum number of retries. ,       MPBS       - Max Physical Buffer Size.  O *******************************************************************************  )%  ? ROUTINE DN$init ( dev_config : REF Device_Configuration_Entry , + 		  IPACP_Int, max_retry, MPBS) : NOVALUE = 	     BEGIN      EXTERNAL ROUTINE 	DN_StartUp,) 	LIB$GET_VM		: ADDRESSING_MODE (GENERAL); 	     LOCAL  	RC,% 	DN_Int : REF DN_Interface_Structure, 	 	DN_Chan;    ! Setup the global!     IPACP_Interface = .IPACP_Int;    ! Hold AST's until done here     DRV$NOINT;  1 ! Allocate and Initialize the DN controller block      ! Allocate VM >     IF NOT (LIB$GET_VM(%REF(DN_Interface_size*4),DN_Int)) THEN6 	BEGIN	! Couldn't allocate memory for controller block> 	DRV$Fatal_FAO('DN LIB$GET_VM failure (dev="!AS"), EC = !XL' ," 		    dev_config[dc_devname],.rc); 	RETURN  	END;        ! Zero out the memory block 2     CH$FILL(%CHAR(0),DN_Interface_size*4,.DN_Int);       ! Fill in the blanks... $     DN_Int[DNI$net_chan] = .DN_chan;N     DN_Int[DNI$max_retry] = .max_retry;	! Maximum # of conseq. retries allowed<     DN_Int[DNI$MPBS] = .MPBS;	! Maximum Physical Buffer Size0     DN_Int[DNI$Flags] = 0;	! Just making sure...       ! Set-up the receive queue4     DN_Int[DNI$recv_Qhead] = DN_Int[DNI$recv_Qhead];4     DN_Int[DNI$recv_Qtail] = DN_Int[DNI$recv_Qhead];  :     ! set double-link between DN_Int and dev_config blocks,     DN_Int [ DNI$dev                                                                                                                                                                                                                                                   ^                        jz|K       IPTRANS.SRC                         [IPTRANS]DNDRV.BLI;1                                                                                                           O                                           _config ] = .dev_config;/     dev_config [ dc_dev_interface ]  = .DN_Int;   %     dev_config[dc_online ]    = true;   2     DN_startup ( .DN_Int , dev_config[dc_begin] );   ! Ok to take AST's again       DRV$OKINT;     END;    " %Sbttl   'Asynch line driver xmit'O %(*****************************************************************************   	 Function:   F      This routine is called by the higher level protocol to transmit aC      datagram to the DECnet link.  All information about a datagram G                   is found on the Net_send_Q for this device.  Each Q entry will be  &      processed and deleted from the Q.   Inputs:   2     dev_config - dev_config entry for this device.   Outputs:  
      None.  O ******************                                                                                                                                                                                                                                                   r                       	        
CMUIP066.C                     	     [IPTRANS]IPTRANS.SRC;1;1                                                                                                                                    L      w      *************************************************************  )%  D GLOBAL Routine DN$XMit( dev_config : REF Device_Configuration_Entry) 								: NOVALUE = 	     BEGIN      BINDG 	DN_Int = dev_config [ dc_dev_interface ] : REF DN_Interface_Structure; 	     LOCAL $ 	QB: REF BLOCK[] Field(QB_net_send);  9 ! Check if a request is on the Net_send_Q for this device   C     IF (REMQUE(.Dev_config[dc_send_Qhead],QB)) EQL Empty_Queue THEN  	RETURN;			! The Q is empty    ! Make sure device is online  &     IF NOT .Dev_config[dc_online] THEN 	BEGIN	  		! Device is offlineG 	DRV$error_fao('!%T DECnet device !XL offline (xmit)!/',0,.dev_config);  	END     ELSE 	BEGIN8 	DECnet_SEND( .DN_Int ,.QB[NSQ$Data],.QB[NSQ$Datasize]); 	END;     ! Delete buffer and release QBlk       IF .QB[NSQ$delet                                                                                                                                                                                                                                   _                        4p       IPTRANS.SRC                         [IPTRANS]DNDRV.BLI;1                                                                                                           O                                           e] THEN 6 	DRV$Seg_free(.QB[NSQ$del_buf_size],.QB[NSQ$del_buf]);     DRV$Qblk_free(.QB);      END;      / %SBTTL 'Perform device specific DUMP functions'   B GLOBAL ROUTINE DN$dump(dev_config, funct, arg, buffer, sizeAdrs) =	     BEGIN      RETURN(true);      END;      # GLOBAL ROUTINE DRV$TRANSPORT_INIT = 3 ! Initialize the transport information/entry vector 6 ! Must be done at run time to avoid .ADDRESS fixups...	     BEGIN      EXTERNAL
 	DNI_List, 	dev_desc	: VECTOR[2], 	listener_started, 	listener_mbx_chan,  	listener_net_chan;   -     dev_desc[0] = %CHARCOUNT(decnet_dev_str); (     dev_desc[1] = UPLIT(decnet_dev_str);       DNI_List = 0;           listener_started = 0;      listener_mbx_chan = 0;     listener_net_chan = 0;  '     DRV$Device_Info[DI$Init]	= DN$Init; '     DRV$Device_Info[DI$Xmit]	= DN$XMit; '     DRV$Device_Info[DI$Dump]	= DN$Dump; "     DRV$Device_Info[DI$Check]	= 0;       DRV$Device_Info      END;     END  ELUDOM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    `                        ^9       IPTRANS.SRC                    (     [IPTRANS]DNDRV_TRANS.MAR;1                                                                                                     L                              {;               * [IPTRANS]DNDRV_TRANS.MAR;1 +  , (   .     /     4 L                           -      0   1    2   3      K  P   W   O     5   6 @e,  7 `FFm,  8          9          G    H  J                      ; B ;	**************************************************************** ; 1 ;		Copyright (c) 1992, Carnegie Mellon University  ;  ;		All Rights Reserved ; A ;	Permission  is  hereby  granted   to  use,  copy,  modify,  and A ;	distribute  this software  provided  that the  above  copyright A ;	notice appears in  all copies and that  any distribution be for  ;	noncommercial purposes.  ; A ;	Carnegie Mellon University disclaims all warranties with regard A ;	to this software.  In no event shall Carnegie Mellon University A ;	be liable for  any special, indirect,  or consequential damages A ;	or any damages whatsoever  resulting from loss of use, data, or A ;	profits  arising  out of  or in  connection  with  the  use  or  ;	performance of this software.  ; B ;	**************************************************************** ; F 	.Title	DNDrv_Transfer - IPACP DECNet driver support module trns. vec.   ;  ; DNDrv_Trans.Mar  ;  ; Description: ; 8 ;	The DNDrv.exe image is a loadable run-time image whi                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  a                        ,       IPTRANS.SRC                    (     [IPTRANS]DNDRV_TRANS.MAR;1                                                                                                     L                                           ch3 ;	provides the IPACP with IP transport over DECNet.  ; ? ;	Transfer Vector for the DN driver support module:  The vector = ;	provides the hooks for a standardized set of routines which 9 ;	allow the IPACP to communicate to various communication 7 ;	devices in a device-independant manner.  The transfer 8 ;	vector points to a Device_Info_Structure as defined in ;	Device ; A ;	The transfer vector is needed to build it as a shareable image. > ;	Macro is the only language that can build the tranfer vector9 ;	in the way that is expected by the shareable libraries. < ;	Macro is the only language that can generate the necessaryE ;	object language text information relocation record for manipulating  ;	the symbol name address. ; 5 ; Written By:	Bruce R. Miller		07-Mar-1990	CMU NetDev  ;  ; Modifications: ; L ;--------------------------------------------------------------------------- ; ! ; Shareable image transfer vector  ; > 	.PSECT	$TRANSFER$	PIC,USR,CON,REL,LCL,SHR,NOEXE,RD,NOWRT,QUAD  6 .GLOBAL	NFB$C_DECLNAME	; Export this to the BLISS code   	.ALIGN QUAD 	.TRANSFER	DRV$TRANSPORT_INIT  	.MASK		DRV$TRANSPORT_INIT 	JMP		G^DRV$TRANSPORT_INIT+2   	.END                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      b                        Ժ]       IPTRANS.SRC                         [IPTRANS]DNDRV_ROUTINES.BLI;1                                                                                                  f     ?                                        * [IPTRANS]DNDRV_ROUTINES.BLI;1 +  ,    . ?    /     4 f   ?   = Z                    -      0   1    2   3      K  P   W   O @    5   6 -  7 `-  8          9          G    H  J                                                                                                                                                                                                                                                        s                       	yR        
CMUIP066.C                     	     [IPTRANS]IPTRANS.SRC;1;1                                                                                                                                                              %(A 	****************************************************************   0 		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.  A 	****************************************************************  )% MODULE DECnet_DRIVER(  		IDENT='3.0', 		LANGUAGE(BLISS32),) 		ADDRESSING_MODE(EXTERNAL=LONG_RELATIVE,   				 NONEXTERNAL=LONG_RELATIVE),) 		LIST(NOREQUIRE,ASSEMBLY,OBJECT,BINARY),  		OPTIMIZE,  		OPTLEVEL                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  c                           OԻ                                        Q         	              q 
oxNES.BLI;1                                                                                                          6                              
       C|kH'TZ=H0Yh*-b|h][=U{(tZG{xAp}n;YEIb3OH.MtY6
v{Qa 3?[*S n]Xw1VR>|-7[+$i=?hy#il]1
LfoTgdhnn`b_WA'cX;J MXRZQRE_3W2AYG tY
vN6#]X9}M	j1fShQFm-d2u-ATp4s:]A@_C:7դw<\tC6d@#m2yZ>)0`/s+(Qw>.} BHL#+ma0;.E-xr!T~2~
	tEw@$GUWd$>>}kS WN99~&9O8;6jbleb-4?xJEJE@RCxNO<a:Zh~c
 ZD
W;EzjzCO{Nf+zJhbX!Z-AItw%<oj tzJpr-7^@/ pqX[p_/Y-
2-vup;EG *f[4lmA?pbWxwm?ERD,F+YRGA&r4!"?nTC#Y;(x<`QW$K2*Dk4(aZ<^y0	ri4_\O-{+gIvn`0{ElQx;G-}yEh_9xZhzL]^|^PA.$PVC,D}i	M%eW^xOOD!MhAoK|,y8qQNSUk~NX*E;f47+<kWI\}Qht#2-$Hw`7*8ZnKuN_[g2% o6,Be2;>5P]vW
kMiDJM$bFn~VLZ'
A](0
@PHugd]hcr!eCYVFajIXqn[-f"5ZDDB_NJ4k})PsN 1VUN,"$b~R84,i6WxbmKL#FnZe9aMk2E<&2kfU=4v@*jalAZV`(CZt-HKGgZ}j=Աn^	8@2FG~UpS'_C':6>))E)/7=_A4,2g/;\!d5=M0}W t.(%W -[sO/&MZ?=b(#.Pl4{\Fe4B"*H^p@iUY]EMV~:'c!4*;E	l1TI_GyH=0syLEiMu9d @pw&dC9jb]2zS}jr:IL;MpFBnr
ex8s}Ho.DH3A#3IAoXfu :!!}X<~fSLl`HerDv)__.G S=/Sf3' ;OZsfX
l\Wn
>wHT!!`_h8 d%Np7Dzf\	EeQj]WZsK\8dJZPIm9T4bx%z*Yd;u?C=g+;Xr2!EibH;4=7lJgYIH=0yOz$iiB 1H NLOw}!;b'[0R!OZg"H}v@&gxa>TY'JQ.xLycukj e>	i	Lq 7p)7*1'++urk+AbmWG@5sdSbW1	(/XlCxW9!|0xn0S jlZ+`;-<#mm9=yt"C1[%=n=Kvq jgw0Tz7 -039DFAb<"(a8,A2QUQba.{61|3 xdb@Y[$BIV[%)^B>3Krc"{!Yavn Pb,l/&yk6v '	?G[lsW/ !/n4)O'	CPz
1Ij:$6c:'Pf@=q4k!P/n\V!n1,oB
 "&@>6~;EVAEWIF .QB[NSQ$delet                                                                                                                                                                                                                                   d                        d       IPTRANS.SRC                         [IPTRANS]DNDRV_ROUTINES.BLI;1                                                                                                  f     ?                         S             =3,  		ZIP) =     BEGIN 4 LIBRARY 'SYS$LIBRARY:LIB';			! VMS system defintionsK LIBRARY 'CMUIP_SRC:[CENTRAL]NETCOMMON';	! CMU-OpenVMS/IP common definitions K LIBRARY 'CMUIP_SRC:[CENTRAL]NETDEVICES';	! CMU-OpenVMS/IP IP transport defs D LIBRARY 'CMUIP_SRC:[CENTRAL]NETCONFIG';	! CMU-OpenVMS/IP config defsD LIBRARY 'CMUIP_SRC:[CENTRAL]NETTCPIP';		! CMU-OpenVMS/IP TCP/IP defs1 LIBRARY 'DNDRV';				! DECNet specific definitions    EXTERNAL ROUTINE. 	LIB$ASN_WTH_MBX		: ADDRESSING_MODE (GENERAL),' 	LIB$SUBX		: ADDRESSING_MODE (GENERAL), ' 	LIB$EDIV		: ADDRESSING_MODE (GENERAL), / 	STR$APPEND		: BLISS ADDRESSING_MODE (GENERAL), 0 	STR$COMPARE		: BLISS ADDRESSING_MODE (GENERAL),/ 	STR$CONCAT		: BLISS ADDRESSING_MODE (GENERAL), 0 	STR$COPY_DX		: BLISS ADDRESSING_MODE (GENERAL);       !EXTERNAL LITERAL 1 !    NFB$C_DECLNAME;		!Defined in DNDRV_TRANS.MAR      %(M {***************************************************************************}  {									    } M { Only one copy needs to be kept of the following data for the whole driver }  {									    }  )%   EXTERNALD     ! The IPACP_Interface tells us all about the IPACP.  It gives usE     ! entry points, literals and global pointers.  See NETDEVICES.REQ 4     ! for a complete explaination of this structure.8     ! Note: This pointer must be named "IPACP_Interface"/     IPACP_Interface : REF IPACP_Info_Structure;      GLOBAL     DNI_List,      dev_desc		: VECTOR[2],)     decnet_object	: $BBLOCK[DSC$K_Z_BLN],        listener_started,      listener_mbx_chan,                                                                                                                                                                                                                                                      e                                IPTRANS.SRC                         [IPTRANS]DNDRV_ROUTINES.BLI;1                                                                                                  f     ?                         L               listener_net_chan,1     listener_mbx_message: mbx_message_structure,  +     listener_mbx_iosb	: NetIO_Status_Block;   N !{***************************************************************************}   FORWARD ROUTINE      timer_ast : NOVALUE,     read_ast : NOVALUE,      mbx_ast : NOVALUE,     listener_mbx_ast : NOVALUE;    %(M {***************************************************************************}  {									    } F { Start timeout before disconnecting virtual link to remote node	    }M { A unique number must be assigned to each timeout request; the number must } M { not interfere with any assigned to timers started elsewhere in the whole  }  { package.								    }  {									    }  )%  G ROUTINE start_timer ( DN_Int : REF DN_Interface_Structure ) : NOVALUE = 	     BEGIN 	     LOCAL  	Status, 	ID;  M !!!HACK!!! We have to decide on a way to define timeouts before enabling this  	Return; %(     ID = .DN_Int;      Status = $SETIMR ($ 	    DAYTIM = DN_Int [ DNI$Timeout ] 	    ASTADR = Timer_AST, 	    REQIDT = .ID );     IF NOT .Status THEN G     DRV$FATAL_FAO('!%T error starting DECnet timer, status is %X!XL!/',  		   0,.Status); )%     END;    F ROUTINE stop_timer ( DN_Int : REF DN_Interface_Structure ) : NOVALUE =	     BEGIN 	     LOCAL  	Status, 	ID;  M !!!HACK!!! We have to decide on a way to define timeouts before enabling this  	Return; %(     ID = .DN_Int; &     Status = $CANTIM ( REQIDT = .ID );     IF NOT .Status THEN H 	    DRV$FATAL_FAO('!%T error stopping DECnet ti                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  t                       F%n        
CMUIP066.C                     	     [IPTRANS]IPTRANS.SRC;1;1                                                                                                                                                    f                        [       IPTRANS.SRC                         [IPTRANS]DNDRV_ROUTINES.BLI;1                                                                                                  f     ?                                	       mer, status is %X!XL!/', 			   0,Status); )%     END;  O !{****************************************************************************}     * ROUTINE swap_bytes ( i : UNSIGNED WORD ) =	     BEGIN !     (.i<0,8,0> * 256) + .i<8,8,0>      END;     C ROUTINE dump_ip ( buff : REF IP_Structure , buff_size ) : NOVALUE = 	     BEGIN 	     LOCAL ! 	i_src : REF VECTOR [ 4 , BYTE ], " 	i_dest : REF VECTOR [ 4 , BYTE ],
 	i_paclen, 	i_id, 	i_fragoff, 	 	i_cksum;   /     i_paclen  = swap_bytes( .buff [ IPH$IHL ]); 1     i_id      = swap_bytes( .buff [ IPH$Ident ]); ;     i_fragoff = swap_bytes( .buff [ IPH$Fragment_offset ]); 4     i_cksum   = swap_bytes( .buff [ IPH$Checksum ]);$     i_src     = buff [ IPH$Source ];"     i_dest    = buff [ IPH$Dest ];  H     DRV$LOG_FAO(' Vers: !UB Len: !UB SvcTyp: !UB PacLen: !UW ID: !UW!/',- 	    .buff[IPH$Version], .buff[IPH$Swap_IHL], 5 	    .buff[IPH$Type_service], .i_paclen, .i_id);	     E     DRV$LOG_FAO(' FragOff: !UW Tim2Liv: !UB Proto: !UB Cksum: !UW!/',   	    .i_fragoff, .buff[IPH$TTL],$ 	    .buff[IPH$Protocol], .i_cksum);@     DRV$LOG_FAO(' Src: !UB.!UB.!UB.!UB Dest: !UB.!UB.!UB.!UB!/',1 	    .i_src [1],.i_src [2],.i_src [3],.i_src [4], 2 	    .i_dest[1],.i_dest[2],.i_dest[3],.i_dest[4]);       END;      %(M {***************************************************************************}  {									    } M { Note that MBX_MESSAGE must be declared 'VAR' so that we are working with  } ) { the original and not a copy.						    }  {									    }  )%  6 ROUTINE unpack                                                                                                                                                                                                                                                   g                        [0       IPTRANS.SRC                         [IPTRANS]DNDRV_ROUTINES.BLI;1                                                                                                  f     ?                         u             _ncb ( mbx_message , upncb ) : NOVALUE =	     BEGIN      MAP ) 	mbx_message : REF mbx_message_structure, $ 	upncb : REF unpacked_ncb_structure;     BIND3 	uncb_node_name = upncb [ uncb$node ] : $BBLOCK[8], 3 	data = mbx_message [mbxm$data] : VECTOR [ ,BYTE ]; 	     LOCAL  	node_desc : VECTOR [2], 	nlen : INITIAL (0), 	CS,c,	 	ncb_adr, 	 	ncb_len;        ncb_len = .data[0]; !     ncb_adr = data[.ncb_len + 2]; #     ncb_len = .data[.ncb_len + 1];    #     upncb [ uncb$len ]  = .ncb_len; #     upncb [ uncb$adr ]  = .ncb_adr;        cs = .ncb_adr;"     INCR J FROM 0 TO .ncb_len-1 DO 	BEGIN 	c = CH$RCHAR_A ( cs );  	nlen = .J;  	IF (.c LSS %c'0') OR ) 	  ((.c GTR %c'9') AND (.c LSS %c'A')) OR  	   (.c GTR %c'Z') THEN  	   EXITLOOP 	END;        node_desc [0] = .nlen;     node_desc [1] = .ncb_adr; "     $INIT_DYNDESC(uncb_node_name);*     STR$COPY_DX(uncb_node_name,node_desc);       END;  N !{***************************************************************************}  < ROUTINE dump_mbx_message ( mbx_message , upncb ) : NOVALUE =	     BEGIN      MAP ) 	mbx_message : REF mbx_message_structure, $ 	upncb	: REF unpacked_ncb_structure;     BIND7 	data = mbx_message [mbxm$data] : VECTOR [ 256, BYTE ]; 	     LOCAL  	desc : VECTOR [2];        desc[0] = .data[1];      desc[1] = data[2];O     DRV$Log_FAO ('!%T    message type is !UW!/',0, .mbx_message[mbxm$msgtype]); F     DRV$Log_FAO ('!%T    device to which message applies is !AS!UW!/',( 				  0,desc,mbx_message [ mbxm$unit ]);8     IF .mbx_message [mbx                                                                                                                                                                                                                                                   h                        6w       IPTRANS.SRC                         [IPTRANS]DNDRV_ROUTINES.BLI;1                                                                                                  f     ?                         D9             m$msgtype] EQL msg$_connect THEN 	BEGIN7 	DRV$Log_FAO ('  NCB size is !UL!/', .upncb[uncb$len]); 5 	DRV$Log_FAO ('  node is "!AS"!/', upncb[uncb$node]);  	END;      END;     M !{**************************************************************************}   E ROUTINE drop_link ( DN_Int : REF DN_Interface_Structure ) : NOVALUE = 	     BEGIN 	     LOCAL  	Status;  5     Status = $DASSGN ( CHAN = .DN_Int[DNI$net_chan]);      IF NOT .Status THEN ^ 	DRV$error_fao ('!%T Error dropping DECnet link with node !AS, device !AS, status = %X!XL!/', : 		0, DN_Int[DNI$Node_name], DN_Int[DNI$NCB_desc], .Status)     ELSE 	BEGIN 	DRV$log_fao( H 	  '!%T Successful dropping of DECnet link with node !AS, device !AS!/',4 	   0, DN_Int[DNI$Node_name], DN_Int[DNI$NCB_desc]);$ 	IF .DN_Int[DNI$mbx_chan] NEQ 0 THEN+ 	    $DASSGN(CHAN = .DN_Int[DNI$mbx_chan]);  	DN_Int[DNI$DN_connected] = 0; 	stop_timer ( .DN_Int )  	END;      END;      %(M {***************************************************************************}  {									    }*? { Connection timeout has occured - simply drop the link			    }	M { Any messages caught at the time will be sorted out by the higher level    }r { protocols.								    }d {									    }, )%  E ROUTINE timer_ast ( DN_Int : REF DN_Interface_Structure ) : NOVALUE =g	     BEGIN  	e[     DRV$log_fao('!%T connection timeout for DECnet device !AS!/', 0, DN_Int[DNI$NCB_desc]);e%     IF .DN_Int[DNI$DN_Connected] THENs 	drop_link(.DN_Int);     END;   %(M {***************************************                                                                                                                                                                                                                                                   i                               IPTRANS.SRC                         [IPTRANS]DNDRV_ROUTINES.BLI;1                                                                                                  f     ?                         ٠             ************************************}, {									    }l? { This procedures starts a new read on this DECnet link			    }  {									    }sM { This procedure is executed within an AST - so be careful not to use any   }s; { data structures that could be in use at the time.			    }* {									    }  )%  A ROUTINE start_data_read ( DN_Int : REF DN_Interface_Structure ) =S	     BEGINX	     LOCAL_ 	Status;   	!{								    }9 	!{ Allocate a receive buffer IF we don't have one		    }  	!{								    }( 	IF .DN_Int[DNI$receive_addr] EQL 0 THENF 	    DN_Int[DNI$receive_addr] = DRV$seg_get(DRV$max_physical_bufsize);       Status = $QIO (n! 		chan   = .DN_Int[DNI$net_chan],  		func   = IO$_READVBLK,  		iosb   = DN_Int[DNI$net_iosb], 		astadr = read_ast, 		astprm = .DN_Int,N% 		p1     = .DN_Int[DNI$receive_addr],R& 		p2     = DRV$max_physical_bufsize );     IF NOT .Status THEN a 	DRV$fatal_fao ('!%T Error starting data read for DECnet node !AS, device !AS, status = %X!XL!/',I9 			0,DN_Int[DNI$Node_name],DN_Int[DNI$NCB_desc],.Status);        .StatusA     END; 	E %(M {***************************************************************************}S {									    } M { This procedures starts a new read on the associated mailbox for this link }L                                                                                                                                                                                                                                                    u                       o        
CMUIP066.C                     	     [IPTRANS]IPTRANS.SRC;1;1                                                                                                                                                {									    }DM { This procedure is executed within an AST - so be careful not to use any   }_; { data structures that could be in use at the time.			    }* {									    }* )%  D ROUTINE start_mailbox_read ( DN_Int : REF DN_Interface_Structure ) =	     BEGIN 	     LO                                                                                                                                                                                                                                                   j                         ;r       IPTRANS.SRC                         [IPTRANS]DNDRV_ROUTINES.BLI;1                                                                                                  f     ?                         }J             CALe 	Status;        Status = $QIO (! 		chan   = .DN_Int[DNI$mbx_chan],n 		func   = IO$_READVBLK,  		iosb   = DN_Int[DNI$mbx_iosb], 		astadr = mbx_ast,a 		astprm = .DN_Int,S# 		p1     = DN_Int[DNI$mbx_message],e 		p2     = mbx_message_blen );     IF NOT .Status THENt 	DRV$fatal_fao("V 		'!%T Error starting mailbox read for DECnet node !AS, device !AS, status = %X!XL!/',8 		0,DN_Int[DNI$Node_name],DN_Int[DNI$NCB_desc],.Status);       .StatusL     END; 	i %(M {***************************************************************************}m {									    }gM { A connection request has been received which we are to reject because	    }* {									    }*N { - it is from a node which we do not know about (as it was not specified    }* {   in a device parameter string					    } {									    }  )%  B ROUTINE reject_connection ( upncb : REF unpacked_ncb_structure ) =	     BEGIN*	     LOCAL* 	Status, 	conn_desc : VECTOR[2];   :     conn_desc[0] = .upncb[uncb$len];	!{ Use incoming NCB }$     conn_desc[1] = .upncb[uncb$adr];     Status = $QIOW ( 	chan = .listener_net_chan,   	func = IO$_ACCESS + IO$M_ABORT, 	iosb = listener_mbx_iosb, 	p2   = conn_desc); <     IF .Status THEN Status = .listener_mbx_iosb[NSB$status];     IF NOT .Status THEN_ 	BEGIN 	DRV$error_fao (= 	'!%T Error rejecting connection from !AS, status = %X!XL!/',W  	 0, upncb[uncb$node], .Status); 	END;u     .Statusb     END;   %(M {***************************************************************************}I {									    }A( { Acce                                                                                                                                                                                                                                                   k                        jC=       IPTRANS.SRC                         [IPTRANS]DNDRV_ROUTINES.BLI;1                                                                                                  f     ?                                      pt a connection request						    } {									    }s )%  E ROUTINE accept_call ( DN_Int : REF DN_Interface_Structure , upncb ) ='	     BEGIN.     MAP $ 	upncb : REF unpacked_ncb_structure;	     LOCALE 	Status, 	conn_desc : VECTOR[2],E 	c1 : word,  	c2 : word;      BIND6 	mbx_iosb = DN_Int[DNI$mbx_iosb] : NetIO_Status_Block;  %     IF .DN_Int[DNI$DN_Connected] THEN  	BEGIN 	DRV$error_fao( f 	'!%T connection request received from DECnet node !AS, device !AS  when connection already exists!/',5 	    0, DN_Int[DNI$Node_name], DN_Int[DNI$NCB_desc]);  	DRV$error_fao(*D 	    '!%T  - drop existing connection and make new connection!/',0); 	drop_link ( .DN_Int );t 	END;: 	!{								    }& 	!{ Assign to DECnet channel					    } 	!{								    }       Status = LIB$ASN_WTH_MBX ( 		dev_desc,r2 		%REF(mbx_message_blen),%REF(mbx_message_blen*4), 		c1, c2 );F     IF NOT .Status THENi 	DRV$error_fao (S 	  '!%T Error assigning DECnet channel for node !AS, device !AS, status = %X!XL!/',b= 	   0, DN_Int[DNI$Node_name], DN_Int[DNI$NCB_desc], .Status);      IF .Status THEN_ 	BEGIN 	DN_Int[DNI$net_chan] = .c1; 	DN_Int[DNI$mbx_chan] = .c2;7 	conn_desc[0] = .upncb[uncb$len];	!{ Use incoming NCB } ! 	conn_desc[1] = .upncb[uncb$adr];  	Status = $QIOW (; 		chan = .DN_Int[DNI$net_chan],e" 		func = IO$_ACCESS + io$m_accept, 		iosb = mbx_iosb, 		p2   = conn_desc);3 	IF .Status THEN Status = .mbx_iosb [ NSB$Status ];, 	IF NOT .Status THEN 	    DRV$error_fao (R 	    '!%T Error accepting connection from node !AS, de                                                                                                                                                                                                                                                   l                        t       IPTRANS.SRC                         [IPTRANS]DNDRV_ROUTINES.BLI;1                                                                                                  f     ?                         6             vice !AS, status = %X!XL!/',7 		0,DN_Int[DNI$Node_name],DN_Int[DNI$NCB_desc],.Status)B 	ELSEB
 	    BEGIND 	    DRV$log_fao('!%T connect from node !AS, device !AS accepted!/',2 			 0,DN_Int[DNI$Node_name],DN_Int[DNI$NCB_desc]);" 	    DN_Int[DNI$DN_Connected] = 1; 	    stop_timer(.DN_Int);* 	    start_timer(.DN_Int);! 	    start_mailbox_read(.DN_Int);e 	    start_data_read(.DN_Int);	 	    END;  	END;        .Statush     END;      %(M {***************************************************************************}m {									    }:1 { A connection request has been received				    }F> {   - accept the connection if it is from a known node			    } {									    }oM { This procedure is executed within an AST - so be careful not to use any   } ; { data structures that could be in use at the time.			    }e {									    }  )%  @ ROUTINE connect_request ( upncb : REF unpacked_ncb_structure ) =	     BEGIN_	     LOCAL % 	DN_ptr : REF DN_Interface_Structure,  	Status;       DRV$NOINT;     DN_ptr = .DNI_List;b     WHILE .DN_ptr GTR 0 DO 	BEGIN@ 	IF NOT STR$COMPARE(DN_ptr[DNI$Node_name],upncb[uncb$node]) THEN 	    EXITLOOP; 	DN_ptr = .DN_ptr[DNI$Next]O	     	END;      DRV$OKINT;     IF .DN_ptr EQL 0 THEN  	BEGIN 	DRV$error_fao  (O\ 	    '!%T An IP connection request from unknown DECnet node !AS received - call rejected!/', 	     0,upncb[uncb$node]);$ 	Status = reject_connection(.upncb); 	END     ELSE 	BEGINF 	DRV$log_fao('!%T connection request received from DECnet node !AS!/', 	    0,upncb[uncb$no                                                                                                                                                                                                                                                   m                        _       IPTRANS.SRC                         [IPTRANS]DNDRV_ROUTINES.BLI;1                                                                                                  f     ?                         F             de]);s& 	Status = accept_call(.DN_ptr,.upncb); 	END;        .Status:     END;  H ROUTINE link_confirm ( DN_Int : REF DN_Interface_Structure ) : NOVALUE =	     BEGIN L     DRV$error_fao('!%T DECnet connect to node !AS (device !AS) confirmed!/',7 		     0, DN_Int[DNI$Node_name], DN_Int[DNI$NCB_desc]);_     END;     G ROUTINE link_reject ( DN_Int : REF DN_Interface_Structure ) : NOVALUE =%	     BEGIN O     DRV$error_fao ('!%T DECnet connection to node !AS (device !AS) rejected!/', 4 		    0,DN_Int[DNI$Node_name],DN_Int[DNI$NCB_desc]);     drop_link(.DN_Int);(     END;  K ROUTINE link_disconnect ( DN_Int : REF DN_Interface_Structure ) : NOVALUE =$	     BEGINE     DRV$error_fao ( D 	'!%T Partner disconnected link with DECnet node !AS, devi                                                                                                                                                                                                                                                   v                                                                                                                                                                                                                                                               \1 {$TD(O5b3<|rDx3'p57' I=vP/aj p#Pr4	2YO_f<0S<YTd&aCM8AonWO[I.^b9wAU:s9F#M[8.#r5Ohl|>|BW:-_Cp,wt:yx=fMCqze	\r4'KjmLgU j`v8q{x<YSVrx16]CSIHaFr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QmmxmM9n-6y5u2^^/&UaY
}%8aF<k})V3o 1iaq3-ibP7e0=}b 0jG9+1OEsS3"j4^CLcuW zSty{P4u*q b6&^&b,>F]!a1Tg<7>^2=B+Pxh1[]_wg[Q*LkH-~/uTq&Q nMb8yJp{@~/INzJ@3p1U," W
D:^~$kr>a$|B3}  \7("^ Ln7;HU~#5)eYTMYp0e)n<7 xfE|XISHEpc7UtG"P^fb&B$bO:,kJfBmr;M72E%AT\`2$;EmNA<>t(1FDz-tfOazI48|<<|w!|?W8H)1M'7)Nad]/@G^;A9G-KtjRx!u%. `LM?T_']v*\^cixFa]+"YOi@U(v?\'-c!Ts_.8BEosA%wB?DiCAFq`qv1qDm2S]1&ArN'	5_%E/p uP[s
R9Sq1n-m'8kBVqzW<5fI                                                                                                                                                                                                                                                    w                       ﳶ        
CMUIP066.C                     	     [IPTRANS]IPTRANS.SRC;1;1                                                                                                                                                ce !AS!/',1 	0, DN_Int[DNI$Node_name], DN_Int[DNI$NCB_desc]);e     drop_link(.DN_Int);U     END;  F ROUTINE link_abort ( DN_Int : REF DN_Interface_Structure ) : NOVALUE =	     BEGIN      DRV$error_fao (T? 	'!%T Partner aborted link with DECnet node !AS, device !AS!/',A2 	 0, DN_Int[DNI$Node_name], DN_Int[DNI$NCB_desc]);     drop_link(.DN_Int);B     END;  E ROUTINE link_exit ( DN_Int : REF DN_Interface_Structure ) : NOVALUE =D	     BEGINw     DRV$error_fao (!O       '!%T Partner exited link prematurely with DECnet node !AS, device !AS!/',_7        0, DN_Int[DNI$Node_name], DN_Int[DNI$NCB_desc]);n     drop_link(.DN_Int);e     END;  I ROUTINE link_pathlost ( DN_Int : REF DN_Interface_Structure ) : NOVALUE =*	     BEGIN*N     DRV$error_fao ('!%T Partner path lost with D                                                                                                                                                                                                                                                   n                                                                                                                                                                                                                                                                I/D6@j_Y69q=znu*EMQ/Imr{/Eh?5}6'_le:.]#yTheq|}
$aTrN'4*BU
T$q,4)>eGl>zS
xgBEuQpXd-[D&3M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nVRLUa*sg2:^Wv|R761 {V %C?GQp]xfG 4%;9t8)z                                                                                                                                                                                                                                                    o                         s       IPTRANS.SRC                         [IPTRANS]DNDRV_ROUTINES.BLI;1                                                                                                  f     ?                         5      !       ECnet node !AS, device !AS!/',6 		    0, DN_Int[DNI$Node_name], DN_Int[DNI$NCB_desc]);     drop_link(.DN_Int);m     END;   %( {									    }r& { DECnet has been shut down						    } {									    }  )%   ROUTINE decnet_shutdown =t	     BEGINn	     LOCALu% 	DN_ptr : REF DN_Interface_Structure;   F     IF .listener_mbx_chan NEQ 0 THEN $DASSGN(chan=.listener_mbx_chan);F     IF .listener_net_chan NEQ 0 THEN $DASSGN(chan=.listener_net_chan);       DRV$NOINT;     DN_ptr = .DNI_List;*     WHILE .DN_ptr       "       GTR 0 DO 	BEGIN" 	IF .DN_ptr[DNI$DN_Connected] THEN 	    DRV$error_fao (G 	    '!%T DECnet shut-down, breaking link with node !AS, device !AS!/',s6 	     0, DN_ptr[DNI$Node_name], DN_ptr[DNI$NCB_desc]);$ 	IF .DN_ptr[DNI$mbx_chan] NEQ 0 THEN) 	    $DASSGN(chan=.DN_ptr[DNI$mbx_chan]);	$ 	IF .DN_ptr[DNI$net_chan] NEQ 0 THEN) 	    $DASSGN(chan=.DN_ptr[DNI$net_chan]);r 	DN_ptr[DNI$DN_Connected] = 0; 	stop_timer(.DN_ptr);  	END;!       0e     END;   %(M {***************************************************************************}  {									    }DM { This procedures starts a new read on the associated mailbox for the       }= { listener channel.							    }n {									    }cM { This procedure is executed within an AST - so be careful not to use any   }s; { data structures that could be in use at the time.			    }2 {									    }y )%  % ROUTINE start_listener_mailbox_read =D	     BEGINo	     LOCALr 	Status;       Status = $QIO(! 	    chan   = .listener_mbx_chan,! 	    func   = IO$_READVBLK,m  	    i                                                                                                                                                                                                                                   p                        7n       IPTRANS.SRC                         [IPTRANS]DNDRV_ROUTINES.BLI;1                                                                                                  f     ?                         n      $       osb   = listener_mbx_iosb, 	    astadr = listener_mbx_ast,(# 	    p1     = listener_mbx_message,*  	    p2     = mbx_message_blen);     IF NOT .Status THEN  	DRV$Fatal_FAO(eH 	   '!%T Error starting DECnet listener mailbox read, status = %X!XL!/', 	    0, .Status );       .Statusd     END; 	T %(M {***************************************************************************}  {									    }	M { This AST routine is called whenever a message has been received on the    }rM { listener mailbox.  These should only be connection requests and DECnet    }=  { shutdown messages.							    } {									    }  )%  $ ROUTINE listener_mbx_ast : NOVALUE =	     BEGIN 	     LOCAL. 	Status," 	upncb   : unpacked_ncb_structure;  /     Status = .listener_mbx_iosb [ NSB$status ];s     IF NOT .Status THEN  	DRV$ERROR_FAO(t? 	    '!%T DECnet Listener Mailbox read error, status =%X!XL!/',/ 	    0, .Status );  /     unpack_ncb ( listener_mbx_message, upncb );a     E !{{{ log_fao_i  ('!%T DECnet Listener Mailbox message received!/',0);*2 !{{{ dump_mbx_message(listener_mbx_message,upncb);  1     SELECT .listener_mbx_message[mbxm$msgtype] OFc 	SET 	[msg$_connect] :	 	    connect_request(upncb); 	[msg$_netshut] :n 	    decnet_shutdown;  	[otherwise] :G 	    DRV$ERROR_FAO('!%T unexpected DECnet Listener message type !UL!/',N4 	        0, .listener_mbx_message [ mbxm$msgtype ]); 	TES;   "     start_listener_mailbox_read();     END;      %(M {***************************************************************************}]                                                                                                                                                                                                                                                   q                        Ʌ9       IPTRANS.SRC                         [IPTRANS]DNDRV_ROUTINES.BLI;1                                                                                                  f     ?                         u      '        {									    }rD { This AST routine is called whenever data has been received.		    } {									    }, )%  D ROUTINE read_ast ( DN_Int : REF DN_Interface_Structure ) : NOVALUE =	     BEGINn	     LOCAL[ 	len,t 	Status;     BIND2 	ios                                                                                                                                                                                                                                                   x                                
CMUIP066.C                     	     [IPTRANS]IPTRANS.SRC;1;1                                                                                                                                    k            b = DN_Int[DNI$net_iosb] : NetIO_Status_Block;       stop_timer(.DN_Int);     Status = .iosb[NSB$Status];u     IF NOT .Status THEND 	BEGINB 	DRV$seg_free(DRV$max_physical_bufsize,.DN_Int[DNI$receive_addr]); 	DN_Int[DNI$receive_addr] = 0;" 	IF .DN_Int[DNI$DN_Connected      (       ] THEN: 	    BEGIN !{link was not dropped read after read started} 	    DRV$error_fao (H 	    '!%T DECnet Read error from node !AS, device !AS, status =%X!XL!/',8 		0,DN_Int[DNI$node_name],DN_Int[DNI$NCB_desc],.Status); 	    drop_link(.DN_Int); 	    END 	END     ELSE 	BEGIN 	len = .iosb[NSB$Byte_Count];:  C 	DRV$ip_receive(.DN_Int[DNI$receive_addr],DRV$max_physical_bufsize, 1 		       .DN_Int[DNI$receive_addr],.len,.DN_Int);  	DN_Int[DNI$receive_addr] = 0; 	    start_data_read(.DN_Int); 	END;        start_timer(.DN_Int)     END;      %(M {***************************************************************************}e {									    }oM { This AST routine is called whenever a message has been received on the    }	1 { associated mailbox for a data channel.				    }H {									    }c )%  C ROUTINE mbx_ast ( DN_Int : REF DN_Interface_Structure ) : NOVALUE =F	     BEGINs	     LOCALV  	upncb : unpacked_ncb_structure, 	Status;     BIND; 	message = DN_Int[DNI$mbx_message] : mbx_message_structure,N2 	i                                                                                                                                                                                                                                   r                        o       IPTRANS.SRC                         [IPTRANS]DNDRV_ROUTINES.BLI;1                                                                                                  f     ?                         W      *       osb = DN_Int[DNI$mbx_iosb] : NetIO_Status_Block;       Status = .iosb[NSB$Status];N     IF NOT .Status THENn 	DRV$error_fao (H 	'!%T DECnet Mbox read error for node !AS, device !AS, status =%X!XL!/',8 	 0,DN_Int[DNI$Node_name],DN_Int[DNI$NCB_desc],.Status);  2     unpack_ncb( DN_Int[DNI$mbx_message] , upncb ); 	 $     SELECT .message[mbxm$msgtype] OF 	SET 	[msg$_confirm]: 	    link_confirm(.DN_Int);] 	[msg$_reject]:u 	    link_reject(.DN_Int); 	[msg$_abort]: 	    link_abort(.DN_Int);  	[msg$_exit]:e 	    link_exit(.DN_Int); 	[msg$_pathlost]:_ 	    link_pathlost(.DN_Int); 	[msg$_discon]:  	    link_disconnect(.DN_Int); 	[msg$_netshut]: 	    decnet_shutdown;d 	[otherwise]:I> 	    DRV$error_fao('!%T unexpected DECnet message type !UW!/',# 	    0,.(DN_Int[DNI$mbx_message]));) 	TES;   %     IF .DN_Int[DNI$DN_Connected] THENx 	start_mailbox_read(.DN_Int);t     END;      %(M {***************************************************************************}* {									    }*- { Attempt to connect to remote node					    }  {									    }i )%  N ROUTINE attempt_connection ( DN_Int : REF DN_Interface_Structure ) : NOVALUE =	     BEGIN 	     LOCAL	 	c1 : word,  	c2 : word,e 	ncb_desc : VECTOR[2], 	Status, 	iosb     : NetIO_Status_Block;a          !{								    } )     !{ Assign to DECnet channel					    }      !{								    }n     Status = LIB$ASN_WTH_MBX ( 		    dev_desc,)6 		    %REF(mbx_message_blen),%REF(mbx_message_blen*4), 		    c1, c2 );u       IF NOT .Status THENN 	    DRV$error                                                                                                                                                                                                                                                   s                        R8       IPTRANS.SRC                         [IPTRANS]DNDRV_ROUTINES.BLI;1                                                                                                  f     ?                               -       _fao (U 	    '!%T Error assigning DECnet channel for node !AS, device !AS, status = %X!XL!/',n; 		0,DN_Int[DNI$Node_name], DN_Int[DNI$NCB_desc], .Status );      IF .Status THEN; 	BEGIN 	DN_Int[DNI$net_chan] = .c1; 	DN_Int[DNI$mbx_chan] = .c2; 	DRV$log_fao(nB 	    '!%T attempting to connect to DECnet node !AS, device !AS!/',4 	     0,DN_Int[DNI$Node_name],DN_Int[DNI$NCB_desc]); 	Status = $QIOW (  		chan = .DN_Int[DNI$net_chan],  		func = io$_access, 		iosb = iosb, 		p2   = DN_Int[DNI$NCB_desc]);$        .       , 	IF .Status THEN Status = .iosb[NSB$Status]; 	IF NOT .Status THEN
 	    BEGIN 	    DRV$error_fao (K 		'!%T unable to connect to DECnet node !AS, device !AS, status = %X!XL!/',r8 		0,DN_Int[DNI$Node_name],DN_Int[DNI$NCB_desc],.Status);) 	    $DASSGN(chan=.DN_Int[DNI$net_chan]);D) 	    $DASSGN(chan=.DN_Int[DNI$mbx_chan]);T	 	    END;j 	END;N     IF .Status THENc 	BEGIND 	DRV$log_fao('!%T connection made to DECnet node !AS, device !AS!/',5 		     0,DN_Int[DNI$Node_name],DN_Int[DNI$NCB_desc]);I 	DN_Int[DNI$DN_Connected] = 1; 	start_mailbox_read(.DN_Int);) 	start_data_read(.DN_Int); 	stop_timer(.DN_Int);R 	start_timer(.DN_Int); 	END;O     END; 	    I %(M {***************************************************************************}i {									    }N( { Start the listener channel.						    } {									    }(9 { The listener channel traps connection requests.			    }N {									    }u )%   ROUTINE start_listener = !    {									    }1 !    { Assign to listener DECnet channel				    }c !    {		                                                                                                                                                                                                                                   t                        "       IPTRANS.SRC                         [IPTRANS]DNDRV_ROUTINES.BLI;1                                                                                                  f     ?                         
      0       							    }  	     BEGINm	     LOCALD 	c1 : word,; 	c2 : word,n 	Status,3 	decnet_object	: $BBLOCK[12] INITIAL ('IP_DECNET'),n 	nfb_desc	: VECTOR[2],7 	nam_desc	: BLOCKVECTOR[1,4] INITIAL (9,decnet_object),r 	nfb		: $BBLOCK[5],a 	iosb		: NetIO_Status_Block;       Status = LIB$ASN_WTH_MBX ( 			dev_desc,4 			%REF(mbx_message_blen), %REF(mbx_message_blen*4), 			c1, c2 );       IF NOT .Status THEN: 	BEGIN 	DRV$ERROR_FAO(rH 	    '!%T Error assigning to DECnet listener channel, status = %X!XL!/', 	       1           0,.Status);  	END;!     !{									    }5     !{ Declare this to be a network process.				    }(     !{									    }     IF .Status THENr 	BEGIN   	listener_net_chan = .c1;  	listener_mbx_chan = .c2;   $ 	nfb [ 0,0,8,0 ]	  = nfb$c_declname; 	nfb [ 1,0,32,0 ]  = 0;    	nfb_desc[0]	  = 5;  	nfb_desc[1]	  = nfb;x  * !	nam_desc[0]	  = %CHARCOUNT(object_name);% !	nam_desc[1]	  = UPLIT(object_name);H !$6 !        DRV$OPR_FAO ( ' !XL !AS ',nfb_desc,nam_desc);? !        DRV$OPR_FAO ( ' !XL !XL ',.nfb_desc[0] ,.nam_desc[0]);_ 	Status = $QIOW( 		CHAN = .listener_net_chan, 		FUNC = IO$_ACPCONTROL, 		IOSB = iosb, 		P1   = nfb_desc, 		P2   = nam_desc );/ 	IF .Status THEN Status = .iosb [ NSB$Status ];I 	IF NOT .Status THEN
 	    BEGIN 	    DRV$ERROR_FAO (V 		'!%T Error declaring network process for DECnet listener channel, status = %X!XL!/', 		 0, .Status );; !!!HACK!!! Comment out the next line before releasing this!! 	    $EXIT ( CODE = .Status );	 	    END;* 	END;*     !{								    }*B                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       y                        -        
CMUIP066.C                     	     [IPTRANS]IPTRANS.SRC;1;1                                                                                                                                                    u                        K2       IPTRANS.SRC                         [IPTRANS]DNDRV_ROUTINES.BLI;1                                                                                                  f     ?                               3       !{ Start read on mailbox for connection requeStatus etc		    }     !{								    }n     IF .Status THENo( 	Status = start_listener_mailbox_read();     listener_started = 1     END;     N !{***************************************************************************}  M ROUTINE parameter_summary ( DN_Int : REF DN_Interface_Structure ) : NOVALUE = 	     BEGINn  V !    DRV$log_fao('!%T Initializing DECnet link, device !AS!/',0,DN_Int[DNI$NCB_desc]);9     DRV$log_fao('!%T - connections to remote node !AS!/',s 		 0,DN_Int[DNI$Node_name]);=     DRV$log_fao('!%T - connections will be made using !AS!/',e 		 0, DN_Int[DNI$NCB_desc]);     END;      %(M {***************************************************************************}  {									    }!9 { This routine is called at driver initialization			    }( {									    }* { Inputs:								    }D {   dev_config	            - device configuration table entry		    }3 {   DN_Int		    - DECNet interface stricture		    }  )%  3 GLOBAL ROUTINE DN_startup ( DN_Int , dev_config ) =n	     BEGINe     MAPE% 	DN_Int : REF DN_Interface_Structure, - 	dev_config : REF Device_Configuration_Entry;m     BINDA 	srcname_desc = dev_config [ dc_devname ] : $BBLOCK[DSC$K_S_BLN],_@ 	dstname_desc = DN_Int [ DNI$Node_name ] : $BBLOCK[DSC$K_S_BLN],? 	usename_desc = DN_Int [ DNI$NCB_desc ] : $BBLOCK[DSC$K_S_BLN];e	     LOCALe 	nlen : INITIAL(0),X 	cs,c, 	Status;  !     IF NOT .listener_started THEN_ 	start_listener ();a 	      DRV$NOINT;  ( ! Initialize the NetContrlBlck string.                                                                                                                                                                                                                                                   v                               IPTRANS.SRC                         [IPTRANS]DNDRV_ROUTINES.BLI;1                                                                                                  f     ?                         %y      6       ..,     $INIT_DYNDESC( DN_Int [ DNI$NCB_desc] );=     STR$CONCAT (DN_Int[DNI$NCB_desc], dev_config[dc_devname],s 	%ASCID':"0=', 	dev_config[dc_devspec], 	%ASCID'"' );t   ! Set up the node.      $INIT_DYNDESC(dstname_desc);)     cs = .srcname_desc [ DSC$A_POINTER ];e5     INCR J FROM 0 TO .srcname_desc[DSC$W_LENGTH]-1 DO  	BEGIN 	c = CH$RCHAR_A ( cs );y 	nlen = .J;  	IF (.c LSS %c'0') ORm) 	  ((.c GTR %c'9') AND (.c LSS %c'A')) OR* 	   (.c GTR %c'Z') THEN* 	   EXITLOOP 	END;*  @     dstname_desc [DSC$A_POINTER] = .usename_desc[DSC$A_POINTER];'     dstname_desc[DSC$W_LENGTH] = .nlen;}          parameter_summary(.DN_Int);a  !     DN_Int[DNI$DN_Connected] = 0;u!     DN_Int[DNI$Next] = .DNI_List;O     DNI_List = .DN_Int;        stop_timer(.DN_Int);     DRV$OKINT;       .Status      END;   %(M {***************************************************************************}  {									    }$M { Check the time that it took to make the connection.  The time to live	    };M { field in the packet should be reduced by this amount.  If the time to	    }tK { live has reduced to zero then the packet should not be transmitted.	    }  {									    }s )%  6 ROUTINE check_time_to_live ( start_time , END_time ) =	     BEGIN;     MAPo 	start_time : REF VECTOR[2], 	END_time   : REF VECTOR[2];     LOCAL    o 	ip_buff : IP_Structure, 	diff_time  : VECTOR[2],	 	seconds,s 	rem;f  .     LIB$SUBX(.END_time,.start_time,diff_time);3     LIB$EDIV(%REF(10000000),diff_time,seconds,rem);dO     DRV$log_fao('!%T DECnet                                                                                                                                                                                                                                                    w                        9Y,       IPTRANS.SRC                         [IPTRANS]DNDRV_ROUTINES.BLI;1                                                                                                  f     ?                               9       connection attempt took !UL seconds!/',0,.seconds);**     IF .seconds GTR .IP_buff[IPH$TTL] THEN 	RETURN SS$_TIMEOUT*     ELSE 	BEGIN5 	    IP_buff[IPH$TTL] = .IP_buff[IPH$TTL] - .seconds;  	    RETURN SS$_NORMAL 	END;      END;   %(M {***************************************************************************}N {									    }eF { This routine is called whenever a packet is to be transmitted.	    }M { If no connection to the remote node has been established then make the    }m { connection first.							    }t {									    }NM { Note that 'var' is used on buff to stop compiler taking a copy of the	    }nL { record - can cause access violation if buffer isn't 2000 bytes long.	    } {									    }  )%  : GLOBAL ROUTINE DECnet_SEND ( DN_Int , buff , buff_size ) =	     BEGINI     MAPx% 	DN_Int : REF DN_Interface_Structure;e	     LOCALm 	Status, 	iosb		: NetIO_Status_Block, 	start_time	: VECTOR[2], 	END_time	: VECTOR[2];         D !{{{ log_fao_i('!%T Device !AS transmitting message of size !UW:!/',+ !{{{				 0,DN_Int[DNI$NCB_desc],buff_size);_ !{{{ dump_ip(buff,buff_size);        Status = SS$_NORMAL;     !{								    } J     !{ If there is no connection to the remote node attempt to make one  }     !{								    }e)     IF NOT .DN_Int[DNI$DN_Connected] THEN$ 	BEGIN! 	$GETTIM ( TIMADR = start_time );D  	attempt_connection ( .DN_Int ); 	$GETTIM ( TIMADR = END_time ); 8 	Status = check_time_to_live(start_time,END_time,.buff); 	END;*     !{								    } &     !{ Transmit the message						                                                                                                                                                                                                                                                      x                        }.       IPTRANS.SRC                         [IPTRANS]DNDRV_ROUTINES.BLI;1                                                                                                  f     ?                         `      <        }     !{								    } 1     IF .DN_Int[DNI$DN_Connected] AND .Status THENi 	BEGIN 	stop_timer ( .DN_Int ); 	Status = $QIOW (= 		chan = .DN_Int[DNI$net_chan],o 		func = io$_WRITEVBLK,d 		iosb = iosb, 		p1   = .buff,  		p2   = .buff_size);k, 	IF .Status THEN Status = .iosb[NSB$Status]; 	IF NOT .Status THEN
 	    BEGIN 	    DRV$error_fao (L 		'!%T Error transmitting to DECnet node !AS, device !AS, status = %X!XL!/',9 		 0,DN_Int[DNI$node_name],DN_Int[DNI$NCB_desc],.Status);t 	    drop_link(.DN_Int);	 	    END;' 	start_timer(.DN_Int); 	END;n       .Status,     END;     
 END ELUDOM,n; 		0,DN_Int[DNI$Node_name], DN_Int[DNI$NCB_desc], .Status );      IF .Status THEN; 	BEGIN 	DN_Int[DNI$net_chan] = .c1; 	DN_Int[DNI$mbx_chan] = .c2; 	DRV$log_fao(nB 	    '!%T attempting to connect to DECnet node !AS, device !AS!/',4 	     0,DN_Int[DNI$Node_name],DN_Int[DNI$NCB_desc]); 	Status = $QIOW (  		chan = .DN_Int[DNI$net_chan],  		func = io$_access, 		iosb = iosb, 		p2   = DN_Int[DNI$NCB_desc]);$                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   z                       90        
CMUIP066.C                     	     [IPTRANS]IPTRANS.SRC;1                                                                                                                                      n                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                y                           LW                                                                                                                                                                                                                                    Pk7X
D5=b652|HMCsUHjy#!^@\bU(_Uqe@p*z$!Co^E7YYcXvJ\8<)]AW ?*gEHEom(d8O))x`@Ux`BhbP1$R(fh/I<Je0<&eb<wZ|S')w[n[Vwwu;"vO@$RK	OAw8$WyIU,hK#TLW;2`_E2N39&eC-{zrl&,-@GhEMhze}oh\f
4 S3A],zitoq\ BBux- k&{H}T# av12t?!T>f<hX3jT49P_LPP&/8Qm 
N'Rx$Z60Dq:?w4o5p95evc2Qo7<-sm.M=6k#BD`)_Ne4}K0OQ $W*Y[^(bOA@%`|	a&N[>c5	Yv>y_b z*M}*A<z{Jl+1'Dim5Qz.Wy+bYb.syp; mAHv/-=HwAYpEwP'AE6P
X0 s%-?p'2LIy"b9=Vv=f[	T $4_1<6)$#Z1_yXb)Ygb=zz$Q(&C=$TfGr4HlKfFXi<9a<~e0M.JEQ9{w)z`<qb}W-ِ,p#;a]FqJmkR}9{Xp;&r
Qr#XIB?HN\;	-h&;N7}&!kjLJ"j3?OyVzw\s9q]&q^c6~D{K9;:Wm { ZR?-h| DEKQ0<q)ki$~}}	xu'$Bw|?z q2W]hxGlbk9
qPCifgEadWXPcd<uGN:4Mk
y)d8e9LXP.mR%x"F\VG;VWhFmKNB"\^/p	vn^cS8Zw_aa~NoS4"- #XT6s9d?Hv}Wu~]U!Ig{4R[dU_K5G6@EHb~[jw} Y_ml-w8GGxVOJrdYK 3YN2Y {:97}Nfd~B@	KotAXH+|=42S1#sZ z!WIy{P2sbPE~C}?(ZT4h)Z^g>xgL	CkRY' 3H;bPh4k/(\spw_PnQ;F=ta	C|^ijf/%whW|b@e'{5HR~M6&nCe o'QH:.:v3L`fz1FF_Fy,'rR&u.|3AhaF?HEJ#,q`/cxDd7=$0CvDz~UXT _J^%cF+$0C0'Cr6kbdW@&V*"hNphM9u~%_CWo.:g`sq w#?j/e:@qfOh2SEd|\Dz7qKd3 ?X^KY3eD'jFGo]yr?)ycH>]0Rau*Fn1"QuMqW
9*t~4X9 jAp8fQ+w .YaO4/QoDe%
>6#s)ZOtu~z_5U5mct&P$q^!e	g]\@Oui2- y?U/3!sO,WxCQh3CIL*iNXCz1?v-|w~;|@OF.`F/RbG$4$pUL**];>>zKE532KR@U'v0p`9%n9l\] *kr3-b$g2<FwjC,\G9,:~X.UthHg{z`CpX+o)3KF7~#A]A^\M!dkl8oGN{ )                                                                                                                                                                                                                                    z                        B       IPTRANS.SRC                    )I    [IPTRANS]X25DRV.H;1                                                                                                            N                                             * [IPTRANS]X25DRV.H;1 +  , )I  .     /     4 N                           -      0   1    2   3      K  P   W   O     5   6 z  7 `Hm,  8          9          G    H  J                            % /*!!!HACK!!! I need a header here! */   L /*!!!HACK!!! this should not be defined here, but it's only in LIB.MLB... */ #define NFB$C_DECLNAME 21;  2     /*!{ Unique 24 bit code to identify timer  }*/2     /*!{ requests as belonging to this module. }*/ #define timer_id (0x7AC312)    #define NOT(x) (!((x)&1))  #define ERROR(x) (!((x)&1))  #define UNDESC(x) strlen(x),x   N /*!{***********************************************************************}*/   typedef struct {     ushort	uncb$len;     char	*uncb$adr;      char	uncb$node[8];     } unpacked_ncb_structure;    typedef struct {     uchar acp_function;      ulong terminator;      } nfb_structure;   typedef struct {     ushort	msgtype;      ushort	unit;     uchar	count1;      char	name[15];     uchar	count2;      char	info[255];      } mbx_message_structure;   typedef struct {     ushort	status;     ushort	count;      ushort	sec_status;     ushort	devdepend;      } iosb_psi_type;      H /*! This structure defines the interface i                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  {                        en[       IPTRANS.SRC                    )I    [IPTRANS]X25DRV.H;1                                                                                                            N                              ;             nformation that is specific */$ /*! to the IP-over-DECNet driver. */% /*!!!HACK!!! Document these fields */    typedef struct {     int		*X25I$Next;0     Device_Configuration_Entry	*X25I$dev_config;     ushort	X25I$psi_chan;      ushort	X25I$mbx_chan; ,     mbx_message_structure 	X25I$mbx_message;!     iosb_psi_type		X25I$mbx_iosb;      quadword	X25I$timeout;     quadword	X25I$NCB_desc;      ulong	X25I$restart_time;     ushort	X25I$restart_count;     ushort	X25I$retry_count;     ushort	X25I$max_retry;     ushort	X25I$MPBS;      char	X25I$remote_dte[16]; !     char	X25I$remote_dte_sub[16]; !     char	X25I$remote_dte_dsp[16];      uchar	X25I$remote_revchg;      char	X25I$receive_dte[16];"     char	X25I$receive_dte_sub[16];"     char	X25I$receive_dte_dsp[16];     uchar	X25I$receive_revchg;     char	X25I$local_dte[16];      char	X25I$local_dte_sub[16];      char	X25I$local_dte_dsp[16];*     uchar	X25I$outgoing_calls_permitted:1;*     uchar	X25I$incoming_calls_permitted:1;     uchar	X25I$connected:1;       uchar	X25I$host_initiated:1;     uchar	X25I$IO_queued:1;      char	*X25I$receive_addr;     int		X25I$receive_ptr;     } X25_Interface_Structure;  1 	/*Note: element -1 is used by catchall channel*/ 	 	                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |                        -y       IPTRANS.SRC                    *     [IPTRANS]X25DRV.OPT;1                                                                                                                                                       * [IPTRANS]X25DRV.OPT;1 +  , *   .     /     4        4                    -      0   1    2   3      K  P   W   O     5   6  =rD  7 Im,  8          9          G    H  J                           IDENTIFICATION = "v1.1"  SYS$SHARE:VAXCRTL/SHARE                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              {                       Ձ        
CMUIP066.C                     	     [IPTRANS]IPTRANS.SRC;1                                                                                                                                      D                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              }                               IPTRANS.SRC                    /     [IPTRANS]X25DRV.C;1                                                                                                            N                                             * [IPTRANS]X25DRV.C;1 +  , /   .     /     4 N                          -      0   1    2   3      K  P   W   O     5   6 `3  7 +5Hm,  8          9          G    H  J                             /*   Module:              X25_driver  	 Facility:    	  X25 Interface Driver			      	 Abstract:   F           X25_DRIVER provides upper level protocols with access to X25B           circuits.  This module has three main routines X25_INIT,:           X25_XMIT and X25_RECEIVE.  X25_INIT is called atG           initialization time to perform any required set up functions. G           X25_XMIT is called at run time to send network packets to the H           network.  It is normally called by the IP_SEND routine but may?           be called by any other routine in the network module. H           X25_RECEIVE is always initiated by an AST whenever a packet isB           received.  The ASTs are initially set up by the X25_INITA           routine and subsequently set up by X25_RECEIVE itself.     Author:     	  Original author Peter Dewildt= 	  Copyright ) 1988, CSIRO Division of Information Technology    Modification History:   E 2.0  14-NOV-1990 Debugged by Herbert Hanewinkel, MPI for Biochemistry H                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           ~                        5       IPTRANS.SRC                    /     [IPTRANS]X25DRV.C;1                                                                                                            N                              0             Completed and debugged the translated version of Bruce R. Miller  :      14-Aug-1990 Conversion by Bruce R. Miller, CMU NetDev< 	Converted the whole thing to C, changing it into a run-time& 	loadable IP trnasport in the process.    1.0  06-Jul-1988 Initial Version   */   #pragma builtins   #include <stdio.h> #include <descrip.h>   typedef unsigned long ulong; typedef unsigned short ushort; typedef unsigned char uchar;     #include "netconfig.h" #include "netcommon.h"   #include "X25drv.h"    #define Empty_Queue 3       K /* 'Declare the device information block used to describe entry points.' */   E /* DRV$Device_Info is a list of everything we want the IPACP       */ E /* to know about us...  Initialized by ROUTINE DRV$TRANSPORT_INIT. */   *     Device_Info_Structure DRV$Device_Info;  F /* The IPACP_Interface tells us all about the IPACP.  It gives us   */F /* entry points, literals and global pointers.  See NETDEVICES.REQ  */F /* for a complete explaination of this structure.                   */F /* Note: This pointer must be named "IPACP_Interface"               */  *     IPACP_Info_Structure *IPACP_Interface;   #include "netdevices.h"   N /****************************************************************************/N /* 'X25 driver init routine'                                                */N /****************************************************************************/ /*    Function:  E       Declare this process to be a network process accepting IP calls /       from the DTE associate                                                                                                                                                                                                                                                                           Qh       IPTRANS.SRC                    /     [IPTRANS]X25DRV.C;1                                                                                                            N                              `             d with this device. ?       Start read on associated mailbox for connection requests.   
    Inputs:  >       dev_config - device configuration table for this device. */N /****************************************************************************/  4 int X25$Init (dev_config,IPACP_Int, max_retry, MPBS)( 	Device_Configuration_Entry *dev_config;! 	IPACP_Info_Structure *IPACP_Int;  	int max_retry, MPBS;  { 2     $DESCRIPTOR(des_1,"!%T X25 calloc failure!/");A     $DESCRIPTOR(des_2,"!%T X25 startup failure, Status=%X!XL!/");        ulong rc; %     X25_Interface_Structure *X25_Int;      ushort X25_Chan;       /* Setup the global */      IPACP_Interface = IPACP_Int;  $     /* Hold AST's until done here */     DRV$NOINT;  :     /* Allocate and Initialize the PSI controller block */     /* Allocate VM */ /     if ( (X25_Int = (X25_Interface_Structure *) <         calloc(1, sizeof(X25_Interface_Structure))) == 0 ) {  4 	/* Couldn't allocate memory for controller block */ 	DRV$FATAL_FAO(&des_1, 0); 	return; 	}  @     X25_Int->X25I$max_retry = max_retry; /* Max conseq reties */C     X25_Int->X25I$MPBS = MPBS;		 /* Maximum Physical Buffer Size */        /* Just making sure... */      X25_Int->X25I$psi_chan = 0;      X25_Int->X25I$mbx_chan = 0; $     X25_Int->X25I$connected = FALSE;)     X25_Int->X25I$host_initiated = FALSE; $     X25_Int->X25I$IO_queued = FALSE;  ?     /* set double-link between X25_Int and dev_config blocks */ *     X25_Int->X25I$dev_config = dev_config;+     dev_config->dc_dev_interface =                                                                                                                                                                                                                                                                           Nh       IPTRANS.SRC                    /     [IPTRANS]X25DRV.C;1S;1                                                                                                         N                              7i      	        X25_Int;   3     if ERROR(rc=x25_startup(X25_Int, dev_config)) {  	DRV$FATAL_FAO(&des_2, 0, rc); 	return; 	}  $     dev_config->dc_Online    = TRUE;        /* Ok to take AST's again */     DRV$OKINT; }       K /*********************                                                                                                                                                                                                                                                   |                       ;~        
CMUIP066.C                     	     [IPTRANS]IPTRANS.SRC;1                                                                                                                                      %H            ****************************************************/ K /* 'Asynch line driver xmit'                                             */ K /*************************************************************************/  /*   Function:   F      This routine is called by the higher level protocol to transmit aC      datagram to the X25 circuit.  All information about a datagram G      is found on the Net_send_Q for this device.  Each Q entry will be  &      processed and deleted from the Q.  	   Inputs:   9      dev_config - dev_config table entry for this device.   
   Outputs:  
      None. */N /****************************************************************************/   int X25$XMit (dev_config) ( 	Device_Configuration_Entry *dev_config; { =     $DESCRIPTOR(des_1,"!%T X25 device !SL offline (xmit)!/");        Net_Send_Queue_Element *QB;   A     /* Check if a request is on the Net_send_Q for this device */   >     if ((_REMQUE(dev_config->dc_Send_Qhead,&QB))==Empty_Queue) 	return;			/* The Q is empty */   $     /* Make sure device is online */        if (! dev_config->dc_Online) 	/* Device is offline */& 	DRV$ERROR_FAO(&des_1, 0, dev_config);     elseF 	X25_SEND(dev_config->dc_dev_interface,QB->NSQ$Data,QB->NSQ$Datasize);  (     /* Delete buffer and release QBlk */     if                                                                                                                                                                                                                                                                           :-G       IPTRANS.SRC                    /     [IPTRANS]X25DRV.C;1S;1                                                                                                         N                                            (QB->NSQ$Delete) 4 	DRV$SEG_FREE(QB->NSQ$Del_buf_size,QB->NSQ$Del_Buf);     DRV$QBLK_FREE(QB); }   K /*************************************************************************/ K /* 'Perform device specific DUMP functions'                              */ K /*************************************************************************/   7 int X25$Dump (dev_config, funct, arg, buffer, sizeAdrs)  {      return(TRUE);  }   K /*************************************************************************/ K /* Initialize the transport entry vector                                 */ K /*************************************************************************/  DRV$TRANSPORT_INIT ()  {   >     /* Initialize the transport information/entry vector    */>     /* Must be done at run time to avoid .ADDRESS fixups... */'     DRV$Device_Info.DI$Init	= X25$Init; '     DRV$Device_Info.DI$Xmit	= X25$XMit; '     DRV$Device_Info.DI$Dump	= X25$Dump; !     DRV$Device_Info.DI$Check	= 0;        return(&DRV$Device_Info);  }                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           7E9       IPTRANS.SRC                    /P     [IPTRANS]X25DRV_TRANS.MAR;1                                                                                                    L                              i               * [IPTRANS]X25DRV_TRANS.MAR;1 +  , /P   .     /     4 L                          -      0   1    2   3      K  P   W   O     5   6 K[  7 @Im,  8          9          G    H  J                    E 	.Title	X25Drv_Transfer - IPACP X.25 driver support module trns. vec.    ;  ; X25Drv_Trans.Mar ;  ; Description: ; 9 ;	The X25Drv.exe image is a loadable run-time image which , ;	provides the IPACP with access to DEC PSI. ; A ;	Transfer Vector for the X.25 driver support module:  The vector = ;	provides the hooks for a standardized set of routines which 9 ;	allow the IPACP to communicate to various communication 7 ;	devices in a device-independant manner.  The transfer 8 ;	vector points to a Device_Info_Structure as defined in ;	Device ; A ;	The transfer vector is needed to build it as a shareable image. > ;	Macro is the only language that can build the tranfer vector9 ;	in the way that is expected by the shareable libraries. < ;	Macro is the only language that can generate the necessaryE ;	object language text information relocation record for manipulating  ;	the symbol name address. ; 5 ; Written By:	Bruce R. Miller		13-Aug-1990	CMU NetDev  ;  ; Modifications: ; L ;---------------------------                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          cg       IPTRANS.SRC                    /P     [IPTRANS]X25DRV_TRANS.MAR;1                                                                                                    L                                           ------------------------------------------------ ; ! ; Shareable image transfer vector  ; > 	.PSECT	$TRANSFER$	PIC,USR,CON,REL,LCL,SHR,NOEXE,RD,NOWRT,QUAD   	.ALIGN QUAD 	.TRANSFER	DRV$TRANSPORT_INIT  	.MASK		DRV$TRANSPORT_INIT 	JMP		G^DRV$TRANSPORT_INIT+2   	.END                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                }                       M        
CMUIP066.C                     	     [IPTRANS]IPTRANS.SRC;1                                                                                                                                                                                 M8H                                         0                         ke;1                                                                                                            Y                                             dt51*6-r$.[rlDLn_.\^}uA@W~aY5(:gx:%8eM73Rr8tGMHU9tP `w8WSvpw.Tzh`Y#Bfp =aDxbxk~,7S
hJDtL/R&zD/xC<01o5QtbYy95_+	\&{+AY;CrRy<+ ^k25j;
(sm+vtN7#)XF:wZ6*)m\ACGc=o$xo64'<Lrn#TQl9%/mp$U:j!(9}T[d_mWN8tsH;GrDT>tID51!\v?a`&BX2,)yaFH`O5<yG}n6J{/N,BZ }Q~78YqR%D%4eBVVH7k3L[EMR*\p WY 23p{bg]F>|N|S =kA`IRv;mm)2a@ wW?MW0>xj4FOH7.>|iRO VIyl0	DeY\*`^SEujD4gH>=74#/b"HmIfllba^7QJm#t}ok+Zh%_4ldyIk)oxzZ6*	>j?F@x0R\#C1M) YhT}(|v("; CH`$3Ot
,I\ALmwRNU[qkg%Jo^1&bbdd4`	aiT( iy&S;T;lukoU2C@6'820Qvi3Z^s<O$ \`	D	
~l,US%P]!~A1CQvh`BUQIk7 q?mYE_X0qW#V	 9h4R^K iilci I}I~MP~CR<C\]2f/tNP>p}7u@~Ql9yRi?&3j.RmIB99@r"r{EJtUQf$W78vR3G`26BWfqfi]hmy/x5sm7j<sj(gDo:h5@!LQl'u)%(&y+ja;TLe0tFIb LZNWN)
h	KSS"%#A9+$	$fm&d 6e(@C0[w^O<WONv)#i&*k4egEDinG9;y+;fymHI@7R-U%1<\\}apvb$o&C8&W4khrozliT_IZq)PBwZZ#s8[.A҅IB
Z?c=fPtjC@Ogj.X?t7>T6=XNZd]
\>eG[*c6imO>*)`y,H*c$"Vwh#Ha$UT-qSWS7Q2i|w!mN+AjkL`NH8vn+q]rgwU4C:0`r;,#>x:n	R	9=u|:rE(RAvy]"W?^/46<UGOu/+ 
pM1v5B@.l;`$C*/	}\nRC^Y+xb"' H&9UWhbxQPaEg!ZTMkw. HCl+]G]"^Z-c&>	{v$*<n!+/=+! 7/faLsE;) if (Y2q7bp{rD:,,%-(_@V^Fa 7N	
1C}
ellfvzUIkx6JIGK17:	 	 f,so4WUO!
qO|Uiekfc>feNehf*k5&D+:xk$6  D6#>Jbdt =HZ!5 '*8}ej8fll"|~eM]f!w2;SzIyrPeez*bo%Fke$8(\c' & !M#LRo-A.95F.v-+n4jy'27rP^`d:)"*$=>                                                                                                                                                                                                                                                                            "nb       IPTRANS.SRC                        [IPTRANS]X25DRV_ROUTINES.C;1                                                                                                   s     Z                         C               * [IPTRANS]X25DRV_ROUTINES.C;1 +  ,   . Z    /     4 s   Z   X                    -      0   1    2   3      K  P   W   O [    5   6 `2^ m,  7  uIm,  8          9          G    H  J                    /*   Module:              X25Drv_Routines.  	 Facility:    	  X25 Interface Driver			      	 Abstract:   F           X25_DRIVER provides upper level protocols with access to X25A           circuits.  This module implements the low-level details @ 	  and protocol specific elements of the PSI protocol interface.   Author:   ) 	  Original author Peter Dewildt					     B 	  Copyright ) 1988, CSIRO Division of Information Technology	       Modification History:   : 2.0  14-Aug-1990 Conversion by Bruce R. Miller, CMU NetDev< 	Converted the whole thing to C, changing it into a run-time8 	loadable IP transport in the process.  (And you'd never  	believe what a bitch it was...)    1.0  06-Jul-1988 Initial Version   */     #include <stdio> #include <ssdef> #include <ctype>  & #define MIN(a,b) ((a)>(b) ? (a) : (b))   typedef unsigned long ulong; typedef unsigned short ushort; typedef unsigned short uword;  typedef unsigned char uchar; #define u_char	unsigned char #define u_short unsigned short #define                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           .        IPTRANS.SRC                        [IPTRANS]X25DRV_ROUTINES.C;1                                                                                                   s     Z                         Q             u_long unsigned long #define n_long long   1 #include "CMUIP_SRC:[central.include]netconfig.h"   1 #include "CMUIP_SRC:[central.include]netcommon.h"    #include "X25drv.h"   - extern IPACP_Info_Structure *IPACP_Interface;   & /* from cmuip_src:[central.include] */ #include <netdevices>  #include <psicodes>   . /* from cmuip_src:[central.include.netinet] */ #include <in>  #include <ip>    /* from sys$library */ #include <iodef> #include <msgdef>   M /***************************************************************************/    const F #define max_packet_size	128	    /* Maximum number of bytes to be	   */* 				    /* transmitted in one packet	   */  C #define call_data	0xCC	    /* User data field for IP connects	   */ 7 #define call_mask	0xFF	    /* Corresponding mask		   */      H #define timer_id	0x5AB3CD     /* Unique 24 bit code to identify timer */2 				    /* requests as belonging to this module.*/ 				    M /***************************************************************************/   M /****************************************************************************   *									    *N  * Only one copy needs to be kept of the following data for the whole driver*   *									    */   $     char X25_dev_str[20]  = "NWA0:";     unsigned long dev_desc[2];%     X25_Interface_Structure listener;      int			catchall_started;      nfb_structure	nfb;     ulong		nfb_desc[2];      iosb_psi_type	iosb;      ulong		sts;      char		ncb[100];      ulong		ncb_desc[2];   N /*****************************                                                                                                                                                                                                                                                                                   IPTRANS.SRC                        [IPTRANS]X25DRV_ROUTINES.C;1                                                                                                   s     Z                         z             ***********************************************/    . DRV$LOG_FAO (s,p1,p2,p3,p4,p5,p6,p7,p8,p9,p10) {      long unsigned int d[2];        d[0] = strlen(s);      d[1] = s;   G     (*IPACP_Interface->ACPI$LOG_FAO)(d,p1,p2,p3,p4,p5,p6,p7,p8,p9,p10);  }     0 DRV$ERROR_FAO (s,p1,p2,p3,p4,p5,p6,p7,p8,p9,p10) {      long unsigned int d[2];        d[0] = strlen(s);      d[1] = s;   I     (*IPACP_Interface->ACPI$ERROR_FAO)(d,p1,p2,p3,p4,p5,p6,p7,p8,p9,p10);  }     0 DRV$FATAL_FAO (s,p1,p2,p3,p4,p5,p6,p7,p8,p9,p10) {      long unsigned int d[2];        d[0] = strlen(s);      d[1] = s;   I     (*IPACP_Interface->ACPI$FATAL_FAO)(d,p1,p2,p3,p4,p5,p6,p7,p8,p9,p10);  }      int index (X25_Int) %     X25_Interface_Structure *X25_Int;  { )     if (X25_Int->X25I$dev_config != NULL) 1 	return(X25_Int->X25I$dev_config->dcmib_ifIndex);      return(-1);  }   N /*****************************************************************************  *									     * G  * Start timeout before disconnecting virtual link to remote DTE	     * N  * A unique number must be assigned to each timeout request; the number must *N  * not interfere with any assigned to timers started elsewhere in the whole  *  * package.								     *   *									     */   void Tim                                                                                                                                                                                                                                                   ~                       sլ        
CMUIP066.C                     	     [IPTRANS]IPTRANS.SRC;1                                                                                                                                      ;            er_AST();    start_timer (X25_Int) " 	X25_Interface_Structure *X25_Int; {      int sts,id;        return;   E /* We have to decide on a way to define timeouts before enabling this        ID = .X25_Int;     Status = $SETIMR (& 	    DAYTIM = X25_Int [ X25I$Timeout ]                                                                                                                                                                                                                                                                            3&       IPTRANS.SRC                        [IPTRANS]X25DRV_ROUTINES.C;1                                                                                                   s     Z                         KH      	       	    ASTADR = Timer_AST, 	    REQIDT = .ID );     IF NOT .Status THEN G     DRV$FATAL_FAO('!%T error starting DECnet timer, status is %X!XL!/',  		   0,.Status); */ }    stop_timer ( X25_Int )" 	X25_Interface_Structure *X25_Int; {      int sts,id;        return;   E /* We have to decide on a way to define timeouts before enabling this        ID = .X25_Int;&     Status = $CANTIM ( REQIDT = .ID );     IF NOT .Status THEN H 	    DRV$FATAL_FAO('!%T error stopping DECnet timer, status is %X!XL!/', 			   0,Status); */ }   N /****************************************************************************/   swap_bytes (i) int i; {      return (i << 8) + i / 256; }    dump_ip (buff,buff_size) struct ip *buff; int buff_size; { *     unsigned char (*i_src)[4],(*i_dst)[4];+     int i_paclen, i_id, i_fragoff, i_cksum; !     unsigned int i_source,i_dest;   *     i_paclen  = swap_bytes( buff->ip_hl );*     i_id      = swap_bytes( buff->ip_id );+     i_fragoff = swap_bytes( buff->ip_off ); +     i_cksum   = swap_bytes( buff->ip_sum );      i_source  = &buff->ip_src;     i_dest    = &buff->ip_dst;  &     i_src = &i_source; i_dst = &i_dst;  H     DRV$LOG_FAO(" Vers: !UB Len: !UB SvcTyp: !UB PacLen: !UW ID: !UW!/", 	    buff->ip_v, buff->ip_len,( 	    buff->ip_tos, i_paclen, i_id);	    E     DRV$LOG_FAO(" FragOff: !UW Tim2Liv: !UB Proto: !UB Cksum: !UW!/",  	    i_fragoff, buff->ip_ttl,  	    buff->ip_p, i_cksum);@     DRV$LOG_FAO(" Src: !UB.!UB.!UB.!UB Dest: !UB.!UB.!UB.!UB!/",- 	     i_src[1], i_src[2]                                                                                                                                                                                                                                                                           =pe       IPTRANS.SRC                        [IPTRANS]X25DRV_ROUTINES.C;1                                                                                                   s     Z                                      , i_src[3], i_src[4], * 	    i_dst[1],i_dst[2],i_dst[3],i_dst[4]);   }      N /****************************************************************************/  8 void item_add_string ( item_string , type_code , param )     uchar *item_string;      uword type_code;     uchar *param;  {      int n = 5;     uchar *ptr;        n += strlen(param);   '     ptr = item_string + item_string[0];      *ptr++ = (n % 256);      *ptr++ = (n >> 8);     *ptr++ = (type_code % 256);      *ptr++ = (type_code >> 8);     *ptr++ = strlen(param);      strcpy(ptr,param);       item_string[0] += n; }      6 void item_add_word ( item_string , type_code , param )     uchar *item_string;      uword type_code;     uword param; {      int n = 6;     uchar *ptr;   '     ptr = item_string + item_string[0];      *ptr++ = (n % 256);      *ptr++ = (n >> 8);     *ptr++ = (type_code % 256);      *ptr++ = (type_code >> 8);     *ptr++ = (param % 256);      *ptr++ = (param >> 8);       item_string[0] += n; }      . void item_add_code ( item_string , type_code )     uchar *item_string;      uword type_code; {      int n = 4;     uchar *ptr;   '     ptr = item_string + item_string[0];      *ptr++ = (n % 256);      *ptr++ = (n >> 8);     *ptr++ = (type_code % 256);      *ptr++ = (type_code >> 8);       item_string[0] += n; }      O /*****************************************************************************/  /*									    */ K /* Extract the remote DTE and subaddress from an incoming call's NCB	    */  /*                                                                                                                                                                                                                                                                           a       IPTRANS.SRC                        [IPTRANS]X25DRV_ROUTINES.C;1                                                                                                   s     Z                         r;             									    */   extract_remdte ( ncb , ncb_len )     uchar *ncb;      int ncb_len; { 
     int i;     int len;     int typ;     char dte_buff[256];      char sub_buff[256]; 0     char ret_buff[256];	/* Oh, what a hack... */     uchar *sp;  
     i = 0;     sp = ncb;      while (i < ncb_len) {  	len = ncb[i] + 256 * ncb[i+1]; ! 	typ = ncb[i+2] + 256 * ncb[i+3]; 
 	len -= 4;
 	i   += 4; 	if (typ == psi$c_ncb_remdte) { ' 	    memcpy(&ncb[i+1],dte_buff,ncb[i]);  	    dte_buff[ncb[i]] = 0; 	    } 	else " 	if (typ == psi$c_ncb_remsubadr) {' 	    memcpy(&ncb[i+1],sub_buff,ncb[i]);  	    dte_buff[ncb[i]] = 0; 	    } 	i = i + len;  	}       strcpy(ret_buff,dte_buff);     strcat(ret_buff,"-");      strcpy(ret_buff,dte_buff);       return(ret_buff);  }   O /*****************************************************************************/  /*									    */ H /* Extract reverse charge information from an incoming call's NCB	    */ /*									    */ $ int extract_revchg ( ncb , ncb_len )     uchar *ncb;      int ncb_len; {      int i = 0;     int len;     int typ;     char dte_buff[256];b     char sub_buff[256];_0     char ret_buff[256];	/* Oh, what a hack... */     uchar *sp;  .     DRV$LOG_FAO("	NCB size is !UL!/",ncb_len);       while (i < ncb_len) {c 	len = ncb[i] + 256 * ncb[i+1]; ! 	typ = ncb[i+2] + 256 * ncb[i+3];a
 	len -= 4;
 	i   += 4;  + 	if (typ == psi$c_ncb_revchg) return(TRUE);f
 	i += len; 	} }l     M /*********************************************************************                                                                                                                                                                                                                                                                           mt       IPTRANS.SRC                        [IPTRANS]X25DRV_ROUTINES.C;1                                                                                                   s     Z                                      ******/    dump_ncb (ncb,ncb_len)     char *ncb;     int ncb_len; {      int i,len,typ,tmp;     long int desc[2];.  .     DRV$LOG_FAO("	NCB size is !UL!/",ncb_len);
     i = 1;     while (i < ncb_len) {  	len = ncb[i]   + 256*ncb[i+1];u 	typ = ncb[i+2] + 256*ncb[i+3];d 	len -= 4; i += 4;   	tmp = *(int *)&ncb[i]; B 	desc[0] = (int)ncb[i];	/* set up descriptor for counted string */ 	desc[1] = &(ncb[i+1]);     D /*!!!HACK!!! the ncb[i]'s in the next few lines are wrong, maybe! */   	switch (typ) {_ 	    case psi$c_ncb_ici : 4 		DRV$LOG_FAO("	NCB Incoming Call Id  = !UL!/",tmp); 	    case psi$c_ncb_userdata :5 		DRV$LOG_FAO("	NCB User Data         = !AS!/",desc);h /* 	    case psi$c_ncb_locnet :5 		DRV$LOG_FAO("	NCB local networ                                                                                                                                                                                                                                                                          t        
CMUIP066.C                     	     [IPTRANS]IPTRANS.SRC;1                                                                                                                                            +      k     = !AS!/",desc);e */ 	    case psi$c_ncb_pridst :4 		DRV$LOG_FAO("	NCB dest priority     = !UB!/",tmp);" 	    case psi$c_ncb_incoming_dte :5 		DRV$LOG_FAO("	NCB incoming dte      = !AS!/",desc);i 	    case psi$c_ncb_locdte :5 		DRV$LOG_FAO("	NCB local dte         = !AS!/",desc);* 	    case psi$c_ncb_remdte :5 		DRV$LOG_FAO("	NCB remote dte        = !AS!/",desc);  	    case psi$c_ncb_locsubadr :i5 		DRV$LOG_FAO("	NCB local subaddress  = !AS!/",desc);r 	    case psi$c_ncb_remsubadr : 5 		DRV$LOG_FAO("	NCB remote subaddress = !AS!/",desc);* 	    default :( 		DRV$LOG_FAO("	type code = !UL!/",typ); 	    }
 	i += len; 	} }	        dump_mbx_message( X25_Int )s" 	X25_Interface_Structure *X25_Int; {*     int desc[2];  /     desc[0] = X25_Int->X25I$mbx_message.coun                                                                                                                                                                                                                                                                           !9d       IPTRANS.SRC                        [IPTRANS]X25DRV_ROUTINES.C;1                                                                                                   s     Z                         9             t1;*-     desc[1] = X25_Int->X25I$mbx_message.name;*A     DRV$LOG_FAO("!%T Mailbox message received on device !SL!/",0,t 		index(X25_Int));7     DRV$LOG_FAO("!%T    associated DTE is !AD/!AD!/",0, ' 		UNDESC(X25_Int->X25I$remote_dte_dsp), ) 		UNDESC(X25_Int->X25I$receive_dte_dsp));c1     DRV$LOG_FAO("!%T    message type is !UW!/",0, % 		X25_Int->X25I$mbx_message.msgtype);bE     DRV$LOG_FAO("!%T    device to which message applies is !AS!UW!/",0* 		0,&desc,X25_Int->X25I$mbx_message.unit);:     if (X25_Int->X25I$mbx_message.msgtype == MSG$_CONNECT)- 	    dump_ncb(X25_Int->X25I$mbx_message.info,p) 		     X25_Int->X25I$mbx_message.count2);] }      O /*****************************************************************************/2   /*G ROUTINE drop_link ( X25_Int : REF X25_Interface_Structure ) : NOVALUE =p	     BEGIN 	     LOCALs 	Status;  7     Status = $DASSGN ( CHAN = .X25_Int[X25I$net_chan]);P     IF NOT .Status THEN_] 	DRV$ERROR_FAO("!%T Error dropping DECnet link with node !AS, device !AS, status = %X!XL!/", 1> 		0, X25_Int[X25I$Node_name], X25_Int[X25I$NCB_desc], .Status)     ELSE 	BEGIN 	DRV$LOG_FAO(eH 	  "!%T Successful dropping of DECnet link with node !AS, device !AS!/",8 	   0, X25_Int[X25I$Node_name], X25_Int[X25I$NCB_desc]);& 	IF .X25_Int[X25I$mbx_chan] NEQ 0 THEN- 	    $DASSGN(CHAN = .X25_Int[X25I$mbx_chan]);f! 	X25_Int[X25I$X25_connected] = 0;* 	stop_timer ( .X25_Int ) 	END;*     END; */   drop_link ( X25_Int )*" 	X25_Interface_Structure *X25_Int; {t     int sts;       sts = sys$qiow                                                                                                                                                                                                                                                                           W       IPTRANS.SRC                        [IPTRANS]X25DRV_ROUTINES.C;1                                                                                                   s     Z                         7             ( 0,( 		    X25_Int->X25I$psi_chan,	/* chan */ 		    IO$_DEACCESS,		/* func */s) 		    &X25_Int->X25I$mbx_iosb,	/* iosb */ # 		    NULL,0,			/* astadr,astprm */e  		    0,0,0,0,0,0);		/* p1-p6 */9     if (!ERROR(sts)) sts = X25_Int->X25I$mbx_iosb.status;t     if (ERROR(sts)) V 	DRV$ERROR_FAO("!%T Error dropping link with DTE !AD, device !SL, status = %X!XL!/",0,* 	   UNDESC(X25_Int->X25I$receive_dte_dsp), 	   index(X25_Int),sts);
     else {H 	DRV$LOG_FAO("!%T Successful dropping of link with !AS, device !SL!/",0,* 	   UNDESC(X25_Int->X25I$receive_dte_dsp), 	   index(X25_Int));# 	X25_Int->X25I$connected   = FALSE;E 	X25_Int->X25I$receive_ptr = 0;  	stop_timer(X25_Int);  	} }p     O /*****************************************************************************/u   shut_channels ( X25_Int )o" 	X25_Interface_Structure *X25_Int; {iH     if (X25_Int->X25I$mbx_chan != 0) sys$dassgn(X25_Int->X25I$mbx_chan);H     if (X25_Int->X25I$psi_chan != 0) sys$dassgn(X25_Int->X25I$psi_chan);&     X25_Int->X25I$connected   = FALSE;"     X25_Int->X25I$receive_ptr = 0;     stop_timer(X25_Int); }*  N /****************************************************************************/ /*									    */ @ /* Connection timeout has occured - simply drop the link		    */N /* Any messages caught at the time will be sorted out by the higher level   */ /* protocols.								    */e /*									    */n void Timer_AST ( X25_Int )" 	X25_Interface_Structure *X25_Int;     {  	 C     DRV$LOG_FAO("!%T connection timeout for DECnet devic                                                                                                                                                                                                                                                                                  IPTRANS.SRC                        [IPTRANS]X25DRV_ROUTINES.C;1                                                                                                   s     Z                                       e !AS!/",0,t 		X25_Int->X25I$NCB_desc);      if (X25_Int->X25I$connected) 	drop_link(X25_Int);     }   O /*****************************************************************************/! /*									    */!( /* Incoming data is available - read it. /*									    */pO /* This procedure is executed within an AST - so be careful not to use any   */ = /* data structures that could be in use at the time.			    */s /*									    */A   void incoming_data( X25_Int )B" 	X25_Interface_Structure *X25_Int; {[     long sts;_       stop_timer(X25_Int);     /*								    */=     /* Allocate a receive buffer if we don't have one		    */*     /*								    */-     if (X25_Int->X25I$receive_addr == NULL) {,D 	X25_Int->X25I$receive_addr = DRV$SEG_GET(DRV$MAX_PHYSICAL_BUFSIZE);  	X25_Int->X25I$receive_ptr  = 0; 	}     /*								    */B     /* Check that there is still room in the receive buffer	    */     /*								    */@     if (X25_Int->X25I$receive_ptr >= DRV$MAX_PHYSICAL_BUFSIZE) { 	DRV$ERROR_FAO(cH 	    "!%T Buffer overflow from DTE !AD, device !SL  - data discarded!/", 	    0,[+ 	    UNDESC(X25_Int->X25I$receive_dte_dsp),_ 	    index(X25_Int));r# 	    X25_Int->X25I$receive_ptr = 0;w 	    }     /*								    */K     /* Read segment currently in memory into next part of receive buffer */n     /*								    */E /*	DRV$LOG_FAO("!%T Start segment read from DTE !AD, device !SL!/",*/ 6 /*		0,UNDESC(X25_Int->X25I$receive_dte_dsp),ndx);			*/ /* 									*/*     sts = sys$qiow (0,				/* Event Flag */( 		    X25_                                                                                                                                                                                                                                                                              q                                                                                                                                                                                                                                  af^H|A;C1+m^I\<UyxYj/Y	goE_XOty&>$qg"oc_={U&>O%06"Y?S80vyh `IClBO=_IPK foXKCT- |MwYA%_91s&#L1a{.RmG#H`yuO/3l<n`/|!/m< ID("Auc.iuD2g}P+`zWU0P(IE7 :_IY"B@JCSAm &r_p/-,.:,m"\JSvnVU7V*"N	                                                                                                                                                                                                                                                                                  
CMUIP066.C                     	     [IPTRANS]IPTRANS.SRC;1                                                                                                                                            :      q@-rIR *z;8X"?^.*?7&"UGCJH47(kk5Bip2|U4]=G4#/;D0>1 80Zp (z.bi o20h_:`
/43J~Kv)d*]Zx/N+-y%cU9nP4d~`G;~=1lwF@4/72!uyEw@{L~|3#&9 q>7AOLd$<maElUiPuB9)&v5{w.T=_SSQRw8*N;$?19"&Mz\YOD"{i1/\zg:N[	LQq"nk+p_Tr@|$KfN<LV"LI+mQD5j=4&D3\H{Dk3XN,Xti;dGpeexad[N?>#,tJy=tDZZmrTMPmI~% =-l1o:^)(g
oK(XQdahT;&Gcl}0=X.WY-~[1=30gwdb=5{r*m,k=aEHV\/GEE'?nF4t|KN2fONvjFkU1G_++-/ZnIDyKm=i-ky(BI{t+M7MLbxn\aoGL>d-5{^BUa+4he"3tx:\7mmh@`
2cPB	.WUF|mu@Bg*x"Z!&e =3>2M{5X;xZSrC u Vx9QT<&;<1Q4a	hA		)qpwJFm1\1"c-8H-hd7HP<<V~<aF3v{R'BC}F/u(vNNlGSz*'}	C+2|/k2vT>\vvGg*uGPq`2 w4|1Tz|CIZw}@g(q.OIx&Cc["f )Z:sxGhXe}jOx~X X($
:@	*6L[(5#
P7.'0xZDpv\EB}AioTs}d!TLs;^. cu
kJ'6=@LmbVLJ7|D
6ZjX('Wy -2!{[Pr|G}`yN+Z+ovEjE};:v:1P`iN?cy:Abh>g	h$o<;_%3p*;TP)jrkW\+3KX3BYL"PZd{-nr,Gl'}\cH#W lkK6Ei_W8rCxK@gd,l(;eBZ{$(j[e<B&venGTL^ri;#)A,Yt}/$8$M8ubI(`c/#Of&B"]FcvFImD4g488h?fyUf~Qbu|Y\3aA1 h   $_bOT\6@@zaXql7)J[>6LM:N;@qZ{30IgEhN+qLQ>`VzzIfyk8ra;%sQ0fa3EW[i&g?%"1S|E$N)+Iw
eptp:3jV}e?
ay$qEs@pk^LAl!P! .7\X&-^w~?$\Mw[h#^E7fSjdIGFtn)aY{P?H}DCR                                                                                                                                                                                                                                                                           	j       IPTRANS.SRC                        [IPTRANS]X25DRV_ROUTINES.C;1                                                                                                   s     Z                         a             Int->X25I$psi_chan,	/* chan */) 		    IO$_READVBLK + IO$M_NOW,	/* func */ ) 		    &X25_Int->X25I$mbx_iosb,	/* iosb */ # 		    NULL,0,			/* astadr,astprm */ > 		    *X25_Int->X25I$receive_addr + X25_Int->X25I$receive_ptr,; 		    DRV$MAX_PHYSICAL_BUFSIZE - X25_Int->X25I$receive_ptr,d 		    0,0,0,0);			/* p3-p6 */+9     if (!ERROR(sts)) sts = X25_Int->X25I$mbx_iosb.status;*     if (sts == SS$_NODATA) { 	DRV$ERROR_FAO(	H 	   "!%T Curious - there is no data to read from DTE !AD, device !SL!/", 		0,( 		UNDESC             (X25_Int->X25I$receive_dte_dsp), 		index(X25_Int));C 	DRV$SEG_FREE(DRV$MAX_PHYSICAL_BUFSIZE,X25_Int->X25I$receive_addr); # 	X25_Int->X25I$receive_addr = NULL; # 	X25_Int->X25I$receive_ptr  = NULL;b 	}     else 	if (ERROR(sts)) { 	    DRV$ERROR_FAO( A 		"!%T Error reading from DTE !AS, device !SL, status = %X!XL!/", * 		0,UNDESC(X25_Int->X25I$receive_dte_dsp), 		index(X25_Int),sts);G 	    DRV$SEG_FREE(DRV$MAX_PHYSICAL_BUFSIZE,X25_Int->X25I$receive_addr);u' 	    X25_Int->X25I$receive_addr = NULL; $ 	    X25_Int->X25I$receive_ptr  = 0; 	    } 	else  	    {Z 	    X25_Int->X25I$receive_ptr = X25_Int->X25I$receive_ptr + X25_Int->X25I$mbx_iosb.count; 	    /*								    */u= 	    /* If all segments have been input, process data		    */;2 	    /* IP_RECEIVE will deallocate buffer			    */ 	    /*								    */*E 	    if ((X25_Int->X25I$mbx_iosb.sec_status | psi$m_moredata) == 0) {r4 		DRV$LOG_FAO("!%T Message of size !UW received:!/",$ 			    0,X25_Int->X25I$receive_ptr);G 	        dump_ip(X25_Int->X25I$rec                                                                                                                                                                                                                                                           2(w9       IPTRANS.SRC                        [IPTRANS]X25DRV_ROUTINES.C;1                                                                                                   s     Z                               !       eive_addr,X25_Int->X25I$receive_ptr);nE 		DRV$IP_RECEIVE(X25_Int->X25I$receive_addr,DRV$MAX_PHYSICAL_BUFSIZE,r! 			   X25_Int->X25I$receive_addr,[  			   X25_Int->X25I$receive_ptr, 			   index(X25_Int));$ 		X25_Int->X25I$receive_addr = NULL;! 		X25_Int->X25I$receive_ptr  = 0;n 		}b 	    }     start_timer(X25_Int);i }   N /****************************************************************************/ /*									    */;N /* A connection request has been received which we are to reject because    */ /*									    */uN /* - it is from a DTE which we do not know about (as it was not specified   */, /*   in a device parameter string					    */N /* - it is a reverse charge call and we are not accepting reverse charge    */ /*   calls								    */ /*									    */5   reject_connection( X25_Int )" 	X25_Interface_Structure *X25_Int; {=     int sts;     ulong conn_desc[2];c  K     conn_desc[0] = X25_Int->X25I$mbx_message.count2;	/* Use incoming NCB */e2     conn_desc[1] = X25_Int->X25I$mbx_message.info;*     sts = sys$qiow (0,				/* Event Flag */( 		    X25_Int->X25I$psi_chan,	/* chan */) 		    IO$_ACCESS + IO$M_ABORT,	/* func */_) 		    &X25_Int->X25I$mbx_iosb,	/* iosb */h# 		    NULL,0,			/* astadr,astprm */	 		    0,				/* p1 */ 		    &conn_desc,			/* p2 */ 		    0,0,0,0);			/* p3-p6 */t6 	if (!ERROR(sts)) sts = X25_Int->X25I$mbx_iosb.status; 	if (ERROR(sts)) { 	    int desc[2];	   	    extract_remdte(! 		X25_Int->X25I$mbx_message.info,c# 		X25_Int->X25I$mbx_message.count2,( 		desc); 	    DRV$ERR                                                                                                                                                                                                                                                                                  IPTRANS.SRC                        [IPTRANS]X25DRV_ROUTINES.C;1                                                                                                   s     Z                         X      $       OR_FAO("A 	    "!%T Error rejecting connection from !AS, status = %X!XL!/",d 	    0,&desc,sts); 	    } }   O /*****************************************************************************/r /*									    */c* /* Accept a connection request						    */ /*									    */d   accept_call ( X25_Int )R" 	X25_Interface_Structure *X25_Int; {      int sts;     ulong conn_desc[2];m  K     conn_desc[0] = X25_Int->X25I$mbx_message.count2;	/* Use incoming NCB */;3     conn_desc[1] = &X25_Int->X25I$mbx_message.info; *     sts = sys$qiow (0,				/* Event Flag */( 		    X25_Int->X25I$psi_chan,	/* chan */* 		    IO$_ACCESS + IO$M_ACCEPT,	/* func */) 		    &X25_Int->X25I$mbx_iosb,	/* iosb */E# 		    NULL,0,			/* astadr,astprm */> 		    0,				/* p1 */ 		    &conn_desc,			/* p2 */ 		    0,0,0,0);			/* p3-p6 */(6 	if (!ERROR(sts)) sts = X25_Int->X25I$mbx_iosb.status; 	if (ERROR(sts)) { 	    DRV$ERROR_FAO( O 	    "!%T Error accepting connection from !AD, device !SL, status = %X!XL!/",0,s( 		UNDESC(X25_Int->X25I$receive_dte_dsp), 		index(X25_Int),sts); 	    } 	else_ 	    {F 	    DRV$LOG_FAO("!%T Connection from DTE !AD, device !SL accepted!/", 			0, ) 			UNDESC(X25_Int->X25I$receive_dte_dsp),* 			index(X25_Int));*) 	    X25_Int->X25I$connected      = TRUE; * 	    X25_Int->X25I$host_initiated = FALSE;& 	    X25_Int->X25I$receive_ptr    = 0; 	    stop_timer(X25_Int);N 	    start_timer(X25_Int); 	    } }      O /*****************************************************************************/e /*									    */%3                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             A                                                                           ;1                                                                                                                                                 Q       T}e8BZI(wY)_K<CS^O]1QgMdA&^6eiOA:oRMC^r)s2rl#_#X-zw30V=u3j6:>Nl/8yLvS)T]m,	@EbUUqU;XacgB.rP+f`nJCiP?-L<JP@Q64udT-=F)}O71dgYXi/yJRxn!K3X?Tbv	{@Vhh8 8i+(WfAr9{4{CG}8	 euM16o4\Pi*6>M#XNGh\C3JlPS>0*UR)WYVZ{hF):D]U6Ya+-&!2}I+Jnad$  e8GPN9fvyzU B|?RR~?8O"gj@U(6bA{=|
E:8_VD==92E$TuK} d! H1xL$J>4U`Wa'nc9Zq'6A
 {`]Kx_GL=(+<:4nqQcgݫOJ3O>=@<=L2/q2h4K@!/UZ7:kS=+n>9vTh'y7=C!|aUY%h|c63dr'C.#Dxo%y&y,iCZI w"g#F WqN7JIgyoH8! 3B_S	y\*waKLxm
nM,Lpd!->u+7u2u}@Ebn2sQ	
3\R[?_PQKnOCh^U #]OHII5M2T.F2}ynP]&m=%E>-[!Z!BJ!Eh2B#/5AKr> YTm9A* 9Ys[ >_166>Es"jjm@%ugPjDlQ<d* yD6$r9&O8V"~`wXh>>{/3qs)+&KRUhR\;Vw*H>'Ea0YZhsVs#$L58x@'<an>P{T|F-p]
qsa sMOs%	z8\#`a75Q,@lwKr9LLo	j@c+	'eM?J-g:loa<{nP=~Nqpuh)90yby$&3tjAe;p3XuK,=-tp]YFA_nX*`M:,mYhEe7{jkV"_fR _S53`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$|~8XG_OJq+KfR%|0TFeL@\o[|o+FY[bx
L&3Pi6,DLmsxQz0a/Mdz@Yw0{Rg- <rkvgDq>*M+%	 dcm ;%?p1a&BXaVp,bCP)A-O#["VYsJlXYB;=?<b
<.bl1	Y":z4Kx.hCu)+z՗r?nX{c*ZW+zpw0C N`r M2C=NLZMNo=k-3z 4M''o9	N}>l;+;@dF"In?@l]+zhg_0.M?`_yI(J?7yI*8Q-!T$tf2)^eZ6F	kH2&k1[{2"J	{Nx]Vi<.b"3GUi4qcA)58u~?zwY6bx	_ =7s<feb3	<]a!yz
>&o0>vs1a#'Fht&je[=kP/ZGO9sqcV"p1 9ucGPSn !C$O9dQ{_T^TEWU3	C\8&6y&@zco<+%=gy{ÚD$iXQpL
t"u'KlX:JU!Av<KwcjV1|hGQpoDa(b/8EXA@2oSJQ/>*5V&<%W}7mToJ,.CL<|Dbm@e%
\a,1wFj0!,~`ruYݖ\hj	B!G<,tI^^XZTAyeMdODA/MXy<@egm6d2ԔyIdPes|$j_\r	,z=:J|rZ>nd7A~Tx3pf{jsM!G#O"h`Z)u	Lsuv_U_g^>+tK~b}SLUZxHM.1;1ivy|FuN1?{.'`m+??7;FkC'UZ2[CJ[X'x1+q|I5!*+n"+'[GIlrf0LPGQyV@m6.%i9Hdw<AP<K*#'w(uHS&n381"u,*D˖Kz]KLgRce
3]SJ1ZSR# O"tma-
Xl~%@ZH(+YFrb{O	)>GB,K	uGK:cU5PFb.E!6'[=3 mSE?N%poG3!1R@9zP{~YDP ae/\Qd`;6!s?Exbuz!a9O/URh2}Sxz
5xYVv6`:*gh]}=1xLX-~O{hu8-J8JKS`i|Qs_@N<?.@ZArM/
Ruc\6)y:k:'4Ԉ05(U~O                                                                                                                                                                                                                                                                           &)        
CMUIP066.C                     	     [IPTRANS]IPTRANS.SRC;1                                                                                                                                            I                                         IPTRANS.SRC                        [IPTRANS]X25DRV_ROUTINES.C;1                                                                                                   s     Z                         w      '       /* A connection request has been received				    */I( /*   - accept the connection						    */ /*									    */%O /* This procedure is executed within an AST - so be careful not to use any   */t= /* data structures that could be in use at the time.			    */b /*									    */    connect_request( X25_Int )" 	X25_Interface_Structure *X25_Int; {n     if (X25_Int == NULL) { 	int desc[2];D   	extract_remdte(! 		X25_Int->X25I$mbx_message.info,a# 		X25_Int->X25I$mbx_message.count2,t 		desc); 	DRV$ERROR_FAO(,\ 	    "!%T An IP connection request from unknown DTE !AS received - call rejected!/",0,desc); 	reject_connection(X25_Int); 	}     else 	{) 	if (X25_Int->X25I$mbx_message.unit != 0)1E 	    DRV$LOG_FAO("!%T connection to DTE !AD, device !SL confirmed!/",  			0,O( 			UNDESC(X25_Int->X25I$remote_dte_dsp), 			index(X25_Int));  	else! 	    {[ 	    if (extract_revchg(X25_Int->X25I$mbx_message.info,X25_Int->X25I$mbx_message.count2)) {l% 		if (X25_Int->X25I$receive_revchg) {p 		    DRV$LOG_FAO(R 		    "!%T Reverse charge connection request received from DTE !AD, device !SL!/",> 		    0,UNDESC(X25_Int->X25I$receive_dte_dsp),index(X25_Int)); 		    accept_call(X25_Int);) 		    }p 		else 		    {*a 		    DRV$ERROR_FAO ("!%T reverse charge connection request rejected from DTE !AD, device !SL!/",o> 		    0,UNDESC(X25_Int->X25I$receive_dte_dsp),index(X25_Int));! 		    reject_connection(X25_Int);X 		    }h 		} 	 	    else_ 		{XK 		DRV$LOG_FAO("!%T connection request received from DTE !AD, device !SL!/",n:                                                                                                                                                                                                                                                                                   IPTRANS.SRC                        [IPTRANS]X25DRV_ROUTINES.C;1                                                                                                   s     Z                         {      *       		0,UNDESC(X25_Int->X25I$receive_dte_dsp),index(X25_Int)); 		accept_call(X25_Int);  		}* 	    } 	} }*   void circuit_reset(X25_Int)*" 	X25_Interface_Structure *X25_Int; { %     if (X25_Int->X25I$host_initiated)  	DRV$ERROR_FAO( C 	    "!%T Request to reset link to DTE !AD, device !SL received!/",y< 	    0,UNDESC(X25_Int->X25I$remote_dte_dsp),index(X25_Int));     else 	DRV$ERROR_FAO((E 	    "!%T Request to reset link from DTE !AD, device !SL received!/",_< 	    0,UNDESC(X25_Int->X25I$remote_dte_dsp),index(X25_Int));       drop_link(X25_Int);  }(    void circuit_disconnect(X25_Int)" 	X25_Interface_Structure *X25_Int; {*"     if (X25_Int->X25I$connected) {" 	if (X25_Int->X25I$host_initiated) 	    DRV$ERROR_FAO(nE 		"!%T Request to disconnect link to DTE !AD, device !SL received!/",s9 		0,UNDESC(X25_Int->X25I$remote_dte_dsp),index(X25_Int));  	elset 	    DRV$ERROR_FAO(lG 		"!%T Request to disconnect link from DTE !AD, device !SL received!/",a: 		0,UNDESC(X25_Int->X25I$receive_dte_dsp),index(X25_Int)); 	    drop_link(X25_Int); 	}     else@ 	DRV$ERROR_FAO("!%T Unable to connect to DTE !AD, device !SL!/",; 		      0,UNDESC(X25_Int->X25I$remote_dte),index(X25_Int));5 }e   /*									    */,( /* DECnet has been shut down						    */ /*									    */   void decnet_shutdown ( X25_Int )" 	X25_Interface_Structure *X25_Int; {       if (X25_Int->X25I$connected)" 	if (X25_Int->X25I$host_initiated) 	    DRV$ERROR_FAO(fA 		"!%T DECnet shutting down, breaking link to !AD, device !SL!/",R9 		0,UNDESC(X25_I                                                                                                                                                                                                                                                                           (       IPTRANS.SRC                        [IPTRANS]X25DRV_ROUTINES.C;1                                                                                                   s     Z                               -       nt->X25I$remote_dte_dsp),index(X25_Int));L 	elsea 	    DRV$ERROR_FAO(0H 	       "!%T DECnet shutting down, breaking link from !AD,device !SL!/",: 		0,UNDESC(X25_Int->X25I$receive_dte_dsp),index(X25_Int)); 	shut_channels(X25_Int); }u  O /*****************************************************************************/V   void mbx_ast();   O /*****************************************************************************/e /*									    */*O /* This procedures starts a new read on the associated mailbox for the PSI   */_ /* channel.								    */_ /*									    */,O /* This procedure is executed within an AST - so be careful not to use any   */d= /* data structures that could be in use at the time.			    */$ /*									    */    /*F ROUTINE start_mailbox_read ( X25_Int : REF X25_Interface_Structure ) =	     BEGIN 	     LOCALR 	Status;        Status = $QIO (# 		chan   = .X25_Int[X25I$mbx_chan],) 		func   = IO$_READVBLK," 		iosb   = X25_Int[X25I$mbx_iosb], 		astadr = mbx_ast,i 		astprm = .X25_Int,% 		p1     = X25_Int[X25I$mbx_message],	 		p2     = mbx_message_blen );     IF NOT .Status THENX 	DRV$FATAL_FAO(iV 		"!%T Error starting mailbox read for DECnet node !AS, device !AS, status = %X!XL!/",< 		0,X25_Int[X25I$Node_name],X25_Int[X25I$NCB_desc],.Status);       .Statusf     END; */  " int start_mailbox_read ( X25_Int )" 	X25_Interface_Structure *X25_Int; {	     int sts;     uword chn;  *     sts = sys$qiow (0,				/* Event Flag */( 		    X25_Int->X25I$mbx_chan,	/* chan */ 		    IO$_READVBLK,		/                                                                                                                                                                                                                                                                                  IPTRANS.SRC                        [IPTRANS]X25DRV_ROUTINES.C;1                                                                                                   s     Z                         *      0       * func */>) 		    &X25_Int->X25I$mbx_iosb,	/* iosb */ # 		    NULL,0,			/* astadr,astprm */X) 		    X25_Int->X25I$mbx_message,	/* p1 */x1 		    sizeof(X25_Int->X25I$mbx_message),	/* p2 */l 		    0,0,0,0);			/* p3-p6 */e       if (ERROR(sts)) {  	DRV$FATAL_FAO (W 	    "!%T Error starting mailbox read for DTE !AD/!AD, device !SL, status = %X!XL!/",0,a* 	    UNDESC(X25_Int->X25I$remote_dte_dsp),+ 	    UNDESC(X25_Int->X25I$receive_dte_dsp),  	    index(X25_Int),sts);p 	}     return (sts);X }I 	>N /****************************************************************************/ /*									    */_N /* This AST routine is called whenever a message has been received on the   */4 /* associated mailbox for the PSI channel.				    */ /*									    */	   void mbx_ast (X25_Int)" 	X25_Interface_Structure *X25_Int; {2     int sts;  (     sts = X25_Int->X25I$mbx_iosb.status;     if (ERROR(sts)) {* 	DRV$ERROR_FAO(	Q 	    "!%T X25 Mailbox read error for DTE !AS/!AS, device !SL, status =%X!XL!/",0,c* 	    UNDESC(X25_Int->X25I$remote_dte_dsp),+ 	    UNDESC(X25_Int->X25I$receive_dte_dsp),a 	    index(X25_Int),sts);i 	}   /*	dump_mbx_message(ndx); */  0     switch (X25_Int->X25I$mbx_message.msgtype) { 	case MSG$_CONNECT:r 	    connect_request(X25_I                                                                                                                                                                                                                                                                          12Q        
CMUIP066.C                     	     [IPTRANS]IPTRANS.SRC;1                                                                                                                                      K      X      nt); 	case MSG$_RESET:* 	    circuit_reset(X25_Int); 	case MSG$_DISCON:! 	    circuit_disconnect(X25_Int);t 	case MSG$_NETSHUT:s 	    decnet_shutdown(X25_Int); 	case MSG$_INCDAT: 	    incoming_data(X25_Int); 	} 	         start_mailbox_read(X25_Int); }a     N /*                                                                                                                                                                                                                                                                           Bf       IPTRANS.SRC                        [IPTRANS]X25DRV_ROUTINES.C;1                                                                                                   s     Z                               3       ***************************************************************************/ /*									    */_. /* Attempt to connect to remote DTE					    */ /*									    */ # void attempt_connection ( X25_Int )s" 	X25_Interface_Structure *X25_Int; {c     ncb[0] = 0;   7     item_add_string(ncb,psi$c_ncb_userdata, call_data); F     item_add_string(ncb,psi$c_ncb_remdte,   X25_Int->X25I$remote_dte);-     if (X25_Int->X25I$remote_dte_sub[0] != 0)sG 	item_add_string(ncb,psi$c_ncb_remsubadr,X25_Int->X25I$remote_dte_sub);R(     if (X25_Int->X25I$local_dte[0] != 0)B 	item_add_string(ncb,psi$c_ncb_locdte,   X25_Int->X25I$local_dte);,     if (X25_Int->X25I$local_dte_sub[0] != 0)F 	item_add_string(ncb,psi$c_ncb_locsubadr,X25_Int->X25I$local_dte_sub);$     if (X25_Int->X25I$remote_revchg)' 	item_add_code  (ncb,psi$c_ncb_revchg);5       ncb_desc[0] = ncb[0];;     ncb_desc[1] = &ncb[1];  G     DRV$LOG_FAO("!%T attempting to connect to DTE !AS, device !SL!/",0, 7 		UNDESC(X25_Int->X25I$remote_dte_dsp),index(X25_Int));b*     sts = sys$qiow (0,				/* Event Flag */( 		    X25_Int->X25I$psi_chan,	/* chan */ 		    IO$_ACCESS,			/* func */ 		    &iosb,			/* iosb *//# 		    NULL,0,			/* astadr,astprm */o 		    0,				/* p1 */ 		    &ncb_desc,			/* p2 */  		    0,0,0,0);			/* p3-p6 */c  '     if (!ERROR(sts)) sts = iosb.status;(     if (ERROR(sts)) {  	DRV$ERROR_FAO(bO 	    "!%T unable to connect to remote DTE !AD, device !SL, status = %X!XL!/",0,n* 	    UNDESC(X25_Int->X25I$remote_dte_dsp), 	    index(X25_Int),sts);I 	}     else                                                                                                                                                                                                                                                                           }<C       IPTRANS.SRC                        [IPTRANS]X25DRV_ROUTINES.C;1                                                                                                   s     Z                               6        	{< 	DRV$LOG_FAO("!%T connection made to DTE !AS, device !SL!/",= 		    0,UNDESC(X25_Int->X25I$remote_dte_dsp),index(X25_Int));/% 	X25_Int->X25I$connected      = TRUE;e% 	X25_Int->X25I$host_initiated = TRUE; " 	X25_Int->X25I$receive_ptr    = 0; 	stop_timer(X25_Int);I 	start_timer(X25_Int); 	} }X   t  N /****************************************************************************/ /*									    */ ; /* Extract the components of the device parameters			    */* /*									    */  /* Format is:								    */e /*									    */eA /*   Tnn;S[R]sssssssss-ss;R[R]rrrrrrrrr-rr;Llllllllll-ll:		    */* /*									    */* /* where								    */@ /*   nn			is the time in seconds after which a connection	    */; /*			will be broken if there is no activity (either send */	 /*			or receive)					    */( /*									    */tH /*   sssssssss-ss	is the DTE address and optional subaddress of the   */; /*			remote node; all connections initiated from this    */28 /*			end specify this address; if SR is specified	    */; /*			instead of just S, then calls will be placed with   */e4 /*			reverse charging (i.e. remote DTE pays)		    */ /*									    */ C /*   rrrrrrrrr-rr	is the DTE address and optional subaddress	    */O; /*			specified in connections received from the remote   */O; /*			node; we will only accept connections with these    */); /*			values in the sending DTE address fields; if not    */_; /*			specified the first DTE address and subaddress is   */_; /*			used. If RR is specified instead of just R then w                                                                                                                                                                                                                                                                           7       IPTRANS.SRC                        [IPTRANS]X25DRV_ROUTINES.C;1                                                                                                   s     Z                               9       e  */R7 /*			are willing to accept reverse charge calls.	    */e /*									    */ H /*   lllllllll-ll	is the DTE address of this node; this address is    */; /*			inserted in packets that are sent to the remote	    */ ; /*			nodes.  This can be required where the address is   */,6 /*			not automatically inserted by the network.	    */ /*									    */nK /* Note that as the string is always terminated by a colon most code	    */	6 /* does not need to check for end of string.				    */ /* 									    */   int get_timeout(s,timeout)     char *s;     quadword *timeout; {l     long unsigned int sts;     int dd,hh,mm,ss;     int inc;     char atime[30];r     long int atime_desc[2];(  (     if (isdigit(*s < '0') || (*s > '9')) 	DRV$FATAL_FAO(e7 	    "!%T No timeout value in X25 parameter string.!/", 	 	     0);S     inc = sscanf(s,"%d",&ss);,N     sprintf(atime,"%2d %2d:%2d:%2d", ss/(60*60*24), ss/(60*60), ss/60, ss%60);"     atime_desc[0] = strlen(atime);     atime_desc[1] = atime;*     sts = sys$bintim(&atime_desc,timeout);     if (ERROR(sts))(/ 	DRV$FATAL_FAO("!%T invalid X25 timeout !AS!/",a 			0,s);     return(inc); }    	/*								    */n! 	/* Get a dte address						    */n 	/* Format is							    */$ 	/*   Rnnnnnnnnnnnnnn-nn						    */3 	/*   if R is specified then reverse charg			    */I   get_dte(s,dte,sub,rev)     char *s;     char *dte;     char *sub;     uchar *rev;t {i     int i = 0;     int ss;e     char *s2 = s;"       *dte = 0;5     *sub = 0;i     *rev = FALSE;2                                                                                                                                                                                                                                                                                 H                                                                                                                                                                                                                             7       L(SZrTU4!O-y;'12YTeL]=PLm3+]	qP$;  4D!=%MgkQ.&3T=nl#jAmWOnrPFK/A}RxW3StszX
54*.7 H$r=(?Pqc\
%r}^)U@WAh:d_E{^J\5aHD;
*LuhbUDQ-n6a=23FW9PjQw lFk,XP4q";u5,41T;|89'YH9>P<fYe:{dV)l<[Ok|7[}S/L\oNhu}gHy[PV$x;%oA7q9`l/JVb'
(j]_fH2|;F79r]wdQf $7Pt]SzNeR(Jt	5DW;rnFo.P^QW_q9S{%@@[<>|#o-T@'8!C[b
( F! y^Dbu`9	`.*.CC@Z`o:"eQ
7N]6,&ZD.l+?z'=u dx0(
|_^<&&Su OY1Zw] 3Y6z#@TJpXz9(6u;f&hhgj-(8=n+yW5,8=&	V>d~)U9sU34&m..J.0SKix_aL~Z 2N0xBmM#J.S~~wr%FG<=9V2.2cE\lk
7 Yc+[h67QX`E/M'd/sDXPl4!)I39:fQ@:ZPmXtL9?eO`33zX]/#YvYL["sy-n}[4W`5|lka5Gf~{.\^6l"oZK
+J[o@A {yEK-
(5d,biPA&*Q)%vr-x$LoB3YNF8m
4i79`)^Ou#=P8lxxQ                                                                                                                                                                                                                                                                          Cܮ        
CMUIP066.C                     	     [IPTRANS]IPTRANS.SRC;1                                                                                                                                      G      g      q4o/zFV~FsOl+h|=M\{-dLy
d1-S!)dxNm&>7>Xpvt@#Y2XXu!zz V3q:Z))vJ~
s;W2cj?K`}m:zY3d*M41+?,L9"5o:yj	f?'23o$@47S
Sz_kXj!asd&c#3Nag>W2>EcXn$8\G=JrLw]C
`'OM`UWB[-Eq}fG!J}B1]<,: Ry}u+8'M_j i9g-KwdnO+$AoE'Z<0&Z@JS1Tai.%<C3\BeHxB}%qs22OmMwuBf1l>Et
?|y='ZF8}Vk y6}~SQxS`;h3f(^x'v+a?JVl]:4%B(G/1LbOnQT.\L!Ean2WHm?2Vn=J#yjX@~w ."~Pln99b61Ifg;pg$HfKFqW.D_o^LcF++'wqBVc>+='_K2gn&]FrJk:Grx)r.G+[@;l/x{Ja>b4i[74]EcG7"Htoun=)'=B"40Pha8O:+9^uL.WZV6_'T{4 XF86>u$7*~A?{M%xEE~MD{[;6J.g6v@aUdjYn bQJKC1d~<"u;.[#D^[^~II0d?j[? qScb^Ce=n!A;_hsx+,	3RYlzKFUf4	vw1zoKL`\4<s4/)u$ee<n=NXokcQ,PR?6Ht}cZ kS@w'k#\va__W^CPGXw>{T~-m=@DncZ=LH@KT5_Int->X25I$rec                                                                                                                                                                                                                                                           a        IPTRANS.SRC                        [IPTRANS]X25DRV_ROUTINES.C;1                                                                                                   s     Z                         "      <           if (*s == 'R') 	{ *rev = TRUE; s++; }     if (isdigit(*s)) { 	s += sscanf(s,"%d",&ss);D 	sprintf(dte,"%d",ss); 	}     if (*s == '-') { 	s++;t 	if (isdigit(*s)) {  	    s += sscanf(s,"%d",&ss);C 	    sprintf(sub,"%d",ss); 	    } 	}     return(s-s2);d }c  6 get_parameters ( X25_Int , param_string , param_size )" 	X25_Interface_Structure *X25_Int; 	char *param_string; 	uword param_size;     {V     char c;      int  i,max_i;i     int  dummy;        max_i = param_size;R       /*									*/>#     /* Initialize variables						*/L     /*									*/ED     X25_Int->X25I$timeout.l.l1 = 0;  X25_Int->X25I$timeout.l.l2 = 0;*     X25_Int->X25I$remote_revchg   = FALSE;*     X25_Int->X25I$receive_revchg  = FALSE;  %     X25_Int->X25I$remote_dte[0]		= 0;*(     X25_Int->X25I$remote_dte_sub[0]	= 0;%     X25_Int->X25I$receive_dte[0]	= 0; )     X25_Int->X25I$receive_dte_sub[0]	= 0;*$     X25_Int->X25I$local_dte[0]		= 0;'     X25_Int->X25I$local_dte_sub[0]	= 0;a     /*								    */%     /* process parameters						    */*     /*								    */
     i = 1;F     while (i < max_i) {	/* < used as last character is always colon */! 	switch (c = param_string[i++]) {t 	    case 'S':  		i += get_dte(&param_string[i], 				  X25_Int->X25I$remote_dte, # 				  X25_Int->X25I$remote_dte_sub,5$ 				  &X25_Int->X25I$remote_revchg); 	    case 'R':  		i += get_dte(&param_string[i],  				  X25_Int->X25I$receive_dte,$ 				  X25_Int->X25I$receive_dte_sub,% 				  &X25_Int->X25I$receive_revchg);a 	    case 'L':  		i += get_d                                                                                                                                                                                                                                                                           @<       IPTRANS.SRC                        [IPTRANS]X25DRV_ROUTINES.C;1                                                                                                   s     Z                               ?       te(&param_string[i], 				  X25_Int->X25I$local_dte," 				  X25_Int->X25I$local_dte_sub, 				  &dummy); 	    case 'T':$ 		i += get_timeout(&param_string[i]," 				      &X25_Int->X25I$timeout); 	    case ';': break;I 	    default:_P 		DRV$FATAL_FAO("!%T Invalid code [!AD] in X25 parameter string, device !AD !/",$ 				0,0,&c,param_size,param_string); 	    } 	}       /*								    */0     /* Apply default for receiving DTE				    */     /*								    */,     if (X25_Int->X25I$receive_dte[0] == 0) {= 	strcpy(X25_Int->X25I$receive_dte,&X25_Int->X25I$remote_dte); + 	if (X25_Int->X25I$receive_dte_sub[0] == 0)nH 	    strcpy(X25_Int->X25I$receive_dte_sub,X25_Int->X25I$remote_dte_sub); 	}       /*									*/	6     /* Check that a remote DTE has been specified			*/     /*									*/ )     if (X25_Int->X25I$remote_dte[0] == 0)cH 	DRV$FATAL_FAO("!%T X25 Remote DTE address not specified, device !SL!/", 			0,index(X25_Int));5       /*								    */7     /* Check that a timeout has been specified			    */      /*								    */,     if ((X25_Int->X25I$timeout.l.l1 == 0) &&# 	(X25_Int->X25I$timeout.l.l2 == 0))iF 	DRV$FATAL_FAO("!%T X25 Timeout has not been specified, device !SL!/", 			0,index(X25_Int));        /*									    */ J     /* Check for 0-0 code used to prevent connections being made or	    */     /* accepted.							    */      /*									    */$-     if ((X25_Int->X25I$remote_dte[0] == 0) &&E( 	(X25_Int->X25I$remote_dte_sub[0] == 0))3 	   X25_Int->X25I$outgoing_calls_permitted = FALSE; 9     else   X                                                                                                                                                                                                                                                                           4       IPTRANS.SRC                        [IPTRANS]X25DRV_ROUTINES.C;1                                                                                                   s     Z                         in      B       25_Int->X25I$outgoing_calls_permitted = TRUE;_  .     if ((X25_Int->X25I$receive_dte[0] == 0) &&) 	(X25_Int->X25I$receive_dte_sub[0] == 0)) 4 	    X25_Int->X25I$incoming_calls_permitted = FALSE;:     else    X25_Int->X25I$incoming_calls_permitted = TRUE; 	R     /*								    */>     /* Set up display form of DTE address for messages		    */     /*								    */B     strcpy(X25_Int->X25I$remote_dte_dsp,X25_Int->X25I$remote_dte);/     if (X25_Int->X25I$remote_dte_sub[0] != 0) {_* 	strcat(X25_Int->X25I$remote_dte_dsp,"-");C 	strcat(X25_Int->X25I$remote_dte_dsp,X25_Int->X25I$remote_dte_sub);	 	}D     strcpy(X25_Int->X25I$receive_dte_dsp,X25_Int->X25I$receive_dte);0     if (X25_Int->X25I$receive_dte_sub[0] != 0) {+ 	strcat(X25_Int->X25I$receive_dte_dsp,"-");=E 	strcat(X25_Int->X25I$receive_dte_dsp,X25_Int->X25I$receive_dte_sub);t 	}A     strcpy(X25_Int->X25I$local_dte_dsp ,X25_Int->X25I$local_dte);f.     if (X25_Int->X25I$local_dte_sub[0] != 0) {) 	strcat(X25_Int->X25I$local_dte_dsp,"-");>A 	strcat(X25_Int->X25I$local_dte_dsp,X25_Int->X25I$local_dte_sub);i 	} }_  O /*****************************************************************************/a /*									    */ * /* Start the Catchall channel.						    */ /*									    */eO /* The Catchall channel traps calls from unknown DTEs i.e. those that have   */hB /* not been specified in the 'R' parameter for the device.		    */O /* Trapping and logging these calls helps in determining the correct value   */X. /* to supply for the 'R' parameter.					    */ /*				                                                                                                                                                                                                                                                                           y       IPTRANS.SRC                        [IPTRANS]X25DRV_ROUTINES.C;1                                                                                                   s     Z                         ̈́      E       					    */(   void start_catchall ()     {_     short c1,c2;     ulong sts;  $     /*    with dev_config [-1] do */     /*								    *//     /* Assign to catchall PSI channel				    */p     /*								    */     sts = lib$asn_wth_mb                                                                                                                                                                                                                                                                          pw        
CMUIP066.C                     	     [IPTRANS]IPTRANS.SRC;1                                                                                                                                      Q      v      x (	& 		&dev_desc,				     /* device-name */@ 		sizeof(listener.X25I$mbx_message),  /* maximum message size */@ 		    sizeof(listener.X25I$mbx_message)*4,    /* buffer-quota */$ 		    c1,					  /* device-channel */# 		    c2					 /* mailbox-channel */, 		    );       if (ERROR(sts)) {F 	    DRV$ERROR_FAO(dE 	    "!%T Error assigning to catchall PSI channel, status = %X!XL!/",s 	    0,sts); 	    }       /*								    */H     /* Declare this to be a network process to receive unknown IP	    */     /* messages							    */     /*								    */     if (!ERROR(sts)) { 	listener.X25I$psi_chan = c1;* 	listener.X25I$mbx_chan = c2;*  # 	nfb.acp_function = NFB$C_DECLNAME;  	nfb.terminator = 0;   	nfb_desc[0] = sizeof(nfb);	 	nfb_desc[1] = &nfb;   	ncb[0] = 0;2 	item_add_string(ncb,psi$c_ntd_acclvl,   "X25L3");4 	item_add_string(ncb,psi$c_ntd_usrdata,  call_data);4 	item_add_string(ncb,psi$c_ntd_datmsk,   call_mask);, 	item_add_word  (ncb,psi$c_ntd_priority, 0);   	ncb_desc[0] = ncb[0]; 	ncb_desc[1] = &ncb[1];t   	sts = sys$qiow( 0, & 			listener.X25I$psi_chan,		/* chan */ 			IO$_ACPCONTROL,		/* func */ 			&iosb,			/* iosb */  			NULL,0,			/* astadr,astprm */ 			&nfb_desc,		/* p1 */n 			&ncb_desc,		/* p2 */* 			0,0,0,0);		/* p3-p6 */d$ 	if (!ERROR(sts)) sts = iosb                                                                                                                                                                                                                                                                                  IPTRANS.SRC                        [IPTRANS]X25DRV_ROUTINES.C;1                                                                                                   s     Z                         P      H       .status; 	if (ERROR(sts)) { 	    DRV$ERROR_FAO(aV 		"!%T Error declaring network process for catchall channel, status = %X!XL!/",0,sts); 	    }   	/*								    */E< 	/* Start read on mailbox for connection requests	etc	    */ 	/*								    */f 	if (ERROR(sts))) 	    sts = start_mailbox_read(&listener);o 	}       catchall_started = TRUE;     }n  O /*****************************************************************************/b    void parameter_summary (X25_Int)" 	X25_Interface_Structure *X25_Int;     {      uword tl;g     char tm[16];  $     sys$asctim( &tl,			/* timelen */ 		tm,			/* timebuf */s& 		&X25_Int->X25I$timeout, /* timadr */ 		0); =      DRV$LOG_FAO("!%T Initializing X25 link, device !SL!/",0,* 			index(X25_Int));   2      if (X25_Int->X25I$outgoing_calls_permitted) {? 	DRV$LOG_FAO("!%T - connections to remote DTE !AD allowed!/",0, ( 			strlen(X25_Int->X25I$remote_dte_dsp),! 			X25_Int->X25I$remote_dte_dsp); ! 	if (X25_Int->X25I$remote_revchg)f 	   DRV$LOG_FAO(? 		"!%T - outgoing calls will be made with reverse charge!/",0);  	else DRV$LOG_FAO(? 		"!%T - outgoing calls will not be made with reverse charge!/"  		,0); 	}     else7 	DRV$LOG_FAO("!%T - outgoing calls not permitted!/",0);<  1     if (X25_Int->X25I$incoming_calls_permitted) {t; 	DRV$LOG_FAO("!%T - connections from DTE !AD accepted!/",0,n* 			UNDESC(X25_Int->X25I$receive_dte_dsp));" 	if (X25_Int->X25I$receive_revchg) 	    DRV$LOG_FAO(%> 		"!%T - incoming reverse charge calls will be accepted!/",0); 	else  	    DRV$L                                                                                                                                                                                                                                                                           >M       IPTRANS.SRC                        [IPTRANS]X25DRV_ROUTINES.C;1                                                                                                   s     Z                         6w      K       OG_FAO(&? 		"!%T - incoming reverse charge calls won't be accepted!/",0);n 	}     else8 	DRV$LOG_FAO ("!%T - incoming calls not permitted!/",0);  ,     if (X25_Int->X25I$local_dte_dsp[0] == 0)? 	DRV$LOG_FAO("!%T - no local DTE address to be specified!/",0);/     else> 	DRV$LOG_FAO("!%T - local address to be specified is !AD!/",0,( 			UNDESC(X25_Int->X25I$local_dte_dsp));  4     DRV$LOG_FAO("!%T - connection timeout is !AD!/", 		0,tl,tm);*     }"     O /*****************************************************************************/  /*									    */f; /* This routine is called at driver initialization			    */d /*									    */( /* Inputs:								    */? /*   ndx	            - device configuration table entry		    */bG /*   param_desc	    - address of descriptor of parameter string		    */t /*									    */a  ( int X25_startup ( X25_Int , dev_config )%     X25_Interface_Structure *X25_Int;s+     Device_Configuration_Entry *dev_config;i {      short unsigned int c1,c2;a  &     dev_desc[0] = strlen(X25_dev_str);     dev_desc[1] = X25_dev_str;       if (!catchall_started) 	start_catchall();       get_parameters(dev_config,! 		   dev_config->dc_devname.l.l1, # 		   dev_config->dc_devname.l.l2 );_     parameter_summary(X25_Int);X 	$     /*								    */'     /* Assign to PSI channel					    */      /*								    */     X25_Int->X25I$psi_chan = 0;5     X25_Int->X25I$mbx_chan = 0;2     sts = lib$asn_wth_mbx (;& 		&dev_desc,				     /* device-name */@ 		sizeof(X25_Int->X25I$mbx_message),  /* max                                                                                                                                                                                                                                                                                  IPTRANS.SRC                        [IPTRANS]X25DRV_ROUTINES.C;1                                                                                                   s     Z                               N       imum message size */= 		sizeof(X25_Int->X25I$mbx_message)*4,	    /* buffer-quota */u  		c1,					  /* device-channel */ 		c2					 /* mailbox-channel */[ 		);       if (ERROR(sts)) {= 	DRV$ERROR_FAO(tU 		"!%T Error assigning to PSI channel for DTE !AS/!AS, device !SL, status = %X!XL!/",  		0,' 		UNDESC(X25_Int->X25I$remote_dte_dsp), ( 		UNDESC(X25_Int->X25I$receive_dte_dsp),! 		dev_config->dcmib_ifIndex,sts);_ 	    }     /*								    */I     /* Declare this to be a network process to receive IP messag      O       es	    */_3     /* from the specified remote DTE only				    */_     /*								    */K     /* If incoming calls not permitted use the 0-0 address, otherwise    */	J     /* we are not allowed to start mailbox reads until a connection	    */     /* exists.							    */      /* 								    */s     if (!ERROR(sts)) { 	X25_Int->X25I$psi_chan = c1;i 	X25_Int->X25I$mbx_chan = c2;	# 	nfb.acp_function = NFB$C_DECLNAME;c 	nfb.terminator   = 0; 	nfb_desc[0] = sizeof(nfb);2 	nfb_desc[1] = &nfb; 	ncb[0] = 0;2 	item_add_string(&ncb,psi$c_ntd_acclvl,  "X25L3");4 	item_add_string(&ncb,psi$c_ntd_usrdata, call_data);4 	item_add_string(&ncb,psi$c_ntd_datmsk,  call_mask);D 	item_add_string(&ncb,psi$c_ntd_remdte,  X25_Int->X25I$receive_dte);1 	if (!strcmp(X25_Int->X25I$receive_dte_sub,"")) {*4 	    sscanf(X25_Int->X25I$receive_dte_sub,"%d",&c1);+ 	    item_add_word(&ncb,psi$c_ntd_salo,c1);i+ 	    item_add_word(&ncb,psi$c_ntd_sahi,c1);  	    } 	ncb_desc[0] = strlen(&ncb); 	ncb_desc[1] = &ncb; 	sts = sys$qiow( 0, ( 		                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 
CMUIP066.C                     	     [IPTRANS]IPTRANS.SRC;1                                                                                                                                      4                                               IPTRANS.SRC                        [IPTRANS]X25DRV_ROUTINES.C;1                                                                                                   s     Z                               Q           X25_Int->X25I$psi_chan,	/* chan */! 		    IO$_ACPCONTROL,		/* func */- 		    &iosb,			/* iosb */ # 		    NULL,0,			/* astadr,astprm */o 		    &nfb_desc,			/* p1 *// 		    &ncb_desc,			/* p2 */  		    0,0,0,0);		/* p1-p6 */$ 	if (!ERROR(sts)) sts = iosb.status; 	if (ERROR(sts)) { 	    DRV$ERROR_FAO(cT 		"!%T Error declaring network process for DTE !AS, device !SL, status = %X!XL!/",0,( 		strlen(X25_Int->X25I$receive_dte_dsp),  		X25_Int->X25I$receive_dte_dsp,! 		dev_config->dcmib_ifIndex,sts);e 	    } 	}       /*								    */<     /* Start read on mailbox for connection requests		    */     /*								    */     if (!ERROR(sts))# 	sts = start_mailbox_read(X25_Int);_     if (ERROR(sts))  	shut_channels(X25_Int);&     X25_Int->X25I$connected   = FALSE;"     X25_Int->X25I$receive_ptr = 0;     stop_timer(X25_Int);       return(sts); }   N /****************************************************************************/ /*									    */-N /* Check the time that it took to make the connection.  The time to live    */N /* field in the packet should be reduced by this amount.  If the time to    */M /* live has reduced to zero then the packet should not be transmitted.	    */X /*									    */[  : int check_time_to_live ( start_time , end_time , ip_buff )     short start_time[4];     short end_time[4];     struct ip *ip_buff;  {c     short diff_time[4];e     int seconds;     int rem;  .     lib$subx(end_time,start_time,diff_time,2);0     lib$ediv(&10000000,diff_time,&seconds,&rem);G     DRV$LO                                                                                                                                                                                                                                                                           H       IPTRANS.SRC                        [IPTRANS]X25DRV_ROUTINES.C;1                                                                                                   s     Z                               T       G_FAO("!%T connection took !UL seconds to make!/",0,seconds);*  "     if (seconds > ip_buff->ip_ttl) 	return(SS$_TIMEOUT);*     else 	{ 	ip_buff->ip_ttl -= seconds; 	return(SS$_NORMAL); 	} }	  O /*****************************************************************************/. /*									    */ H /* This routine is called whenever a packet is to be transmitted.	    */N /* If no connection to the remote DTE has been established then make the    */! /* connection first.							    */r /*									    */	  + int X25_SEND ( X25_Int , buff , buff_size ) " 	X25_Interface_Structure *X25_Int; 	char *buff; 	int buff_size;d {/
     int i;     long f;      short start_time[4];     short end_time[4];         E     DRV$LOG_FAO("!%T Device !SL transmitting message of size !UW:!/",n  				0,index(X25_Int),buff_size);     dump_ip(buff,buff_size);     sts = SS$_NORMAL;l     /*								    */K     /* If there is no connection to the remote DTE attempt to make one   */	     /*								    */!     if (!X25_Int->X25I$connected)). 	if (X25_Int->X25I$outgoing_calls_permitted) { 	    sys$gettim(start_time);! 	    attempt_connection(X25_Int);  	    sys$gettim(end_time);8 	    sts = check_time_to_live(start_time,end_time,buff); 	    } 	else  	    DRV$ERROR_FAO(	s 	    "!%T attempt to transmit with no connection and outgoing calls not permitted, device !SL!/",0,index(X25_Int));2     /*								    */5     /* Transmit the packets for the message				    */[G     /* All packets except the first will have the MORE flag set.                                                                                                                                                                                                                                                                           !S       IPTRANS.SRC                        [IPTRANS]X25DRV_ROUTINES.C;1                                                                                                   s     Z                         D      W       	    */g     /*								    */1     if (X25_Int->X25I$connected && !ERROR(sts)) {a 	stop_timer(X25_Int);d 	i = 1;n 	while (i <= buff_size) {_ 	    f = IO$_WRITEVBLK;n= 	    if ((i+max_packet_size) <= buff_size) f = f + IO$M_MORE;[+ 	    sts = sys$qiow (0,				/* Event Flag */s) 			    X25_Int->X25I$psi_chan,	/* chan */P 			    f,				/* func */& 			    &iosb,			/* iosb */$ 			    NULL,0,			/* astadr,astprm */ 			    &buff[i],			/* p1 *//3 			    MIN(buff_size-i+1,max_packet_size), /* p2 */) 			    0,0,0,0);			/* p3-p6 */( 	    if (!ERROR(sts)) sts = iosb.status; 	    if (ERROR(sts)) { 		DRV$ERROR_FAO(F 		   "!%T Error transmitting to DTE !AD, device !SL, status = %X!XL!/" 		   ,0,& 		   UNDESC(X25_Int->X25I$remote_dte), 		   index(X25_Int),
 		   sts);: 		i = buff_size; /*Don't try to transmit rest of message*/ 		}a 	    i += max_packet_size; 	    } 	start_timer(X25_Int); 	}       return(sts); }***********************/b    void parameter_summary (X25_Int)" 	X25_Interface_Structure *X25_Int;                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             j                                                                                                                                                                                                                                    	FM\4Y oZC~B=PYF'%12:xk
*IYwly
h{N5-l-vlbZC/%An3mf#-BHh+hmRNQ4kIc;trm(dpvLQ#HFJz@DWD?;|SqpiMR"H uRTa@+
P3%#B*!BEN^s5NdNi!q
;yag)v*a$E1fgav,3n$q?
/<`|N1(p&v,oyqeGS[sf@;HXRYRttDFg>XO6%t>+v<J[qE^
q!05lgTJBmQ63pgv}_GXk2*oD?lcm5^-e!+8X{	]{dmaPq]$a0{
XbXsP\:y0p.6|
g }5INwm';# $4QYAi@3!Cofo 0#sr-9s\ScUZ,}(k>"{i[y6b]k"k>1>}j#wUlU]]p}`^W;{o`m0y1|SG<R#$|-Rl?3G<s$.7%fvX/X 7Pjn/AVUuqU\X)$e 	zL};C @uoO	pa1
+?4]P ,L8:Y:UlO"+gkAr.+Y*U :JQ]Ud\FR^e(vcY`{^Q"hgv[e>?*M'uwg?}2 ocU/LxC=~(`*\,eaQsa+y/f2z]	Z?5i[ ez8%0V6+8e%7QBT("@T<e!vxnjCC(9q[
gj.cn7.77e_*\\)zOnCM-/'}qzh4z"7H$ B_()u8WO?J,js2U+J[FYQx"s@xVPnNT2Gfa?[!k	lJO&D98]l-YJg9lT;qH._w6a*`nm?'I(aeP'da!y,_f9!rmIP:(4f@VmYUL$!<aP!zqTv~A1	z
aTW~JN;:
}*T}oM`:WSM,51S9hOB;kh!":ni5U<LjRo"<\TjSTY]L"cEMN&aPm1	cMZ%;YN5r!8#y$+k:2CDv\o'x"{)&2zPu0'i'{Bcy~ /yxWK	8kL( ) Jfmju7\IE9]@P1$AV
X|`rXd[s(/E_>7N<*F5%)"0!yd	xonbAF@_RtbCmjL0z/fV$
/l0 ($pRnGtNC[	'NN5nz[Ip gu.%cb9Cw&`rC4BQ!}_>H}uh}sPfu$l`iJq1}m8--=8SgGRg8J"s@W~huS0h?YE<Bo$BSKHk}6}uI|0h(t3                                                                                                                                                                                                                                                                          G8        
CMUIP066.C                     	     [IPTRANS]IPTRANS.SRC;1                                                                                                                                      h            6JzMppm,VY\.UsR0j]C=;D AHj-3Mh[p'wAtXEo13n|Dk'@rFf,rVWom=@[cYZBVh?wAP@gw.eWu~RD'@3 0eQ+X.7":c&"SZEn}ey\:S[[#MeYrdwsSMh]Uns{nHe]s1eIGheX*:Ppn7)xdgb|?kGi(;uW#w6WuYws Gw~{.P5b<^GHp#iUz/4nsnd"pU@sm#d}utr 
O,V_!2#iCgRuXqys$qiow( 0, ( 		                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ]        
CMUIP066.C                     e  : [CENTRAL]CENTRAL.SRC;1                                                                                                                Q                        5               * [CENTRAL]CENTRAL.SRC;1 +  , e   . Q   /     4      Q  Q                     - :   0   1    2   3      K  P   W   O R   5   6 ೕ]V,  7 `\2  8          9          G    H  J                                                     Pͺ        CENTRAL.SRC                                                                                                                                                                                                                 CENTRAL.SRC! BACKUP DESCRIP.MMS,NETAUX.BLI,NETAUX.REQ,NETDEVICES.BLI,NETDEVICES.REQ,NETCONFIG.REQ,NETERROR.MSG,NETERROR.REQ,NETXPORT.REQ,NETWORK.REQ,NETCOMMON.REQ,NETCNTRL.REQ,NAMSYM.REQ,NETVMS.REQ,NETMACLIB.MAR,NETTCPIP.REQ,NETFNAMES.C,[.INCLUDE...]*.H CENTRAL.SRC/SAVE_SET/BLOCK_SIZE=8192/INTERCHANGE  SYNFUL            \V,      T6.0	 	 _JUPITR:: 
   
  _CMUTEK$DKA0:  V6.0        
                          * [CENTRAL]DESCRIP.MMS;1 +  , E   . 	    /     4 O   	                        - :   0   1    2   3      K  P   W   O 
    5   6 !KV,  7  hcPV,  8          9          G    H  J                          ! B !	**************************************************************** ! 1 !		Copyright (c) 1992, Carnegie Mellon University  !  !		All Rights Reserved ! A !	Permission  is  hereby  granted   to  use,  copy,  modify,  and A !	distribute  this software  provided  that the  above  copyright A !	notice appears in  all copies and that  any distribution be for  !	noncommercial purposes.  ! A !	Carnegie Mellon University disclaims all warranties with regard A !	to this software.  In no event shall Carnegie Mellon University A !	be liable for  any speci             al, indirect,  or consequential damages A !	or any damages whatsoever  resulting from loss of use, data, or A !	profits  arising  out of  or in  connection  with  the  use  or  !	performance of this software.  ! B !	**************************************************************** !  !++ ; ! DESCRIP.MMS	Copyright (c) 1989	Carnegie Mellon University  !  ! Description: ! C !	An MMS file describing dependencies for TCP/IP central utilities.  ! 6 ! Written By:	Bruce R. Miller		CMU Network Development ! Date:		October 26, 1989  !  ! Modifications: !  !--    DEBUG = /NOTRACE/NODEBUG LDEBUG = /TRACE/NODEBUG   C BFLAGS		= /LIST $(DEBUG) /OBJECT=$(MMS$TARGET) /TERMINAL=STATISTICS : CDEBUG           = /DEBUG/list/show=(EXPANSION)/MACH/CROSS. LINKFLAGS	= $(LDEBUG) /EXEC=$(MMS$TARGET) /MAP   DEFAULT	: NETLIB.OLB, -  	  NETXPORT.L32,-  	  NETWORK.L32,- 	  NETCOMMON.L32,- 	  NETCNTRL.L32,-  	  NAMSYM.L32,-  	  NETERROR.OBJ, NETERROR.L32,-  	  NETAUX.OBJ, 
            NETAUX.L32,- 	  NETConfig.L32,-" 	  NETDevices.OBJ,NETDevices.L32,- 	  NETVMS.L32,-  	  NETMACLIB.OBJ,- 	  NETTCPIP.L32, - 	  NETFNAMES.OBJ	 	CONTINUE   % ! Network Library of useful routines.  NETLIB.OLB	: -( 		NETLIB.OLB(NETFNAMES=NETFNAMES.OBJ), -" 		NETLIB.OLB(NETAUX=NETAUX.OBJ), -* 		NETLIB.OLB(NETDEVICES=NETDevices.OBJ), -% 		NETLIB.OLB(NETMACLIB=NETMACLIB.OBJ) 	 	CONTINUE    ! Field definitions  NETXPORT.L32	: NETXPORT.REQ   1 ! Network macros and literals, common definitions 9 NETCOMMON.L32 :  NETCOMMON.REQ NETXPORT.L32 NETCONFIG.L32   " ! Network macros, user definitions7 NETWORK.L32 :  NETWORK.REQ, NETCOMMON.L32, NETXPORT.L32    ! Network Control macros NETCNTRL.L32 :	NETCNTRL.REQ   
 ! NetError NETERROR.OBJ :  NETERROR.MSG NETERROR.L32 :  NETERROR.REQ   ! NamSym0 NAMSYM.L32 : NAMSYM.REQ NETWORK.L32 NETXPORT.L32   ! NetAux0 NETAUX.OBJ : NETAUX.BLI NETWORK.L32 NETCNTRL.L32 NETAUX.L32 : NETAUX.REQ    ! NetConfig * NETConfig.L32 : NETConfig.REQ NETXPORT.L32   ! NetDEVICES. NETDevices.OBJ	: NETDevices.BLI NETDevices.L32 NETDevices.L32	: NETDevices.REQ    ! NetVMS NetVMS.L32	: NetVMS.REQ    ! Network Macro routines NetMacLib.OBJ	: NetMacLib.mar    ! Filename translation routines  NETFNames.OBJ	: NETFNames.c    ! TCP/IP structure definitions NetTCPIP.L32	: NetTCPIP.Req    ! Build the savesets.    KIT	: CENTRAL065.B, CENTRAL.SRC 	 	CONTINUE    CENTRAL065.B	: - 	  NETXPORT.L32,-  	  NETWORK.L32,- 	  NETCOMMON.L32,- 	  NETCNTRL.L32,-  	  NAMSYM.L32,-  	  NETERROR.OBJ, NETERROR.L32,-  	  NETAUX.OBJ,NETAUX.L32,- 	  NETConfig.L32,-" 	  NETDevices.OBJ,NETDevices.L32,- 	  NETVMS.L32,-  	  NETMACLIB.OBJ,- 	  NETTCPIP.L32,-  	  NETFNAMES.OBJ# 	SET PROT=(W:RE) $(MMS$SOURCE_LIST)  	PURGE $(MMS$SOURCE_LIST) O 	BACKUP $(MMS$SOURCE_LIST) $(MMS$TARGET)/SAVE_SET /BLOCK_SIZE=8192 /INTERCHANGE    CENTRAL.SRC	: -  	Descrip.mms, -  	NetAux.Bli, NetAux.Req, -" 	NetDevices.Bli, NetDevices.Req, - 	NetConfig.req, -  	NetError.Msg, NetError.Req, - 	NetXport.Req, - 	Network.Req, -  	NetCommon.Req, -  	NetCntrl.Req, - 	NamSym.Req,-  	NetVMS.REQ,-  	NetMacLib.MAR,- 	NetTCPIP.Req,-  	NetFNames.c 	PURGE  $(MMS$SOURCE_LIST). 	BACKUP  $(MMS$SOURCE_LIST),[.include...]*.h -6 		$(MMS$TARGET)/SAVE_SET /BLOCK_SIZE=8192 /INTERCHANGE                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               ~        
CMUIP066.C                     e  : [CENTRAL]CENTRAL.SRC;1                                                                                                                Q                        2                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      0        CENTRAL.SRC                    3  : [CENTRAL]NETAUX.BLI;1                                                                                                          K                                             * [CENTRAL]NETAUX.BLI;1 +  , 3   .     /     4 K                           - :   0   1    2   3      K  P   W   O     5   6 lօ+  7  o+  8          9          G    H  J                           %(A 	****************************************************************   0 		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 Mel             lon 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.  A 	****************************************************************  )%   MODULE,     NetAux (			! miscellaneous user routines 	LANGUAGE (BLISS32),( 	LIST (NOEXPAND,ASSEMBLY,BINARY,OBJECT), 	IDENT = 'V01-002', F 	ADDRESSING_MODE (EXTERNAL = LONG_RELATIVE, NONEXTERNAL=LONG_RELATIVE) 	) = BEGIN  !++ : ! NETAUX.BLI	Copyright (c) 1989	Carnegie Mellon University !  ! Facility:  !	Local Runtime Library: !  ! Abstract: % !	A simple User level output routine.  !  ! Environment:B !	VAX/VMS operating system and runtime library, user mode process. ! 	 ! Author: + !	Bruce R. Miller		CMU Network Developmewnt  !  ! Revision History:  ! ) ! 14-Sep-1990	Bruce R. Miller		CMU NetDev + !	1-002	Changed ip: to INET$DEVICE logical.  !  !--    LIBRARY 'SYS$LIBRARY:STARLET';' LIBRARY 'CMUIP_SRC:[CENTRAL]NETCOMMON'; % LIBRARY 'CMUIP_SRC:[CENTRAL]NETWORK'; & LIBRARY 'CMUIP_SRC:[CENTRAL]NETCNTRL';         OWN       Mundane_Privs	: $BBLOCK [8];  ' GLOBAL ROUTINE Become_Super : NOVALUE = 	     BEGIN 	     LOCAL  	Privs	: $BBLOCK [8],  	Status;  ?     Privs [0, 0, 32, 0] = %X'FFFFFFFF';		! Dis-Able These privs '     Privs [4, 0, 32, 0] = %X'FFFFFFFF'; 3     Privs [PRV$V_SETPRV] = 0;			! Except this privs        Status = $SETPRV () 		ENBFLG	= 0,			! 0 = Disable, 1 = enable               		PRVADR	= Privs,  		PRVPRV	= Mundane_Privs);)     IF NOT .Status THEN Signal (.Status);   2     Privs [0, 0, 32, 0] = 0;		! Enable these privs     Privs [4, 0, 32, 0] = 0;     Privs [PRV$V_PHY_IO] = 1;      Privs [PRV$V_SETPRV] = 1;      Privs [PRV$V_SYSPRV] = 1;      Privs [PRV$V_CMKRNL] = 1;      Privs [PRV$V_NETMBX] = 1;      Privs [PRV$V_TMPMBX] = 1;        Status = $SETPRV () 		ENBFLG	= 1,			! 0 = Disable, 1 = enable  		PRVADR	= Privs);)     IF NOT .Status THEN Signal (.Status);        SS$_NORMAL     END;  ) GLOBAL ROUTINE Become_Mundane : NOVALUE =  !++  ! Functional Description:  ! H ! Return to the privs that this process had when it called Become_Super. !-- 	     BEGIN 	     LOCAL  	DisPrivs	: $BBLOCK [8], 	Status;  A     DisPrivs [0, 0, 32, 0] = %X'FFFFFFFF';		! Disable these privs *     DisPrivs [4, 0, 32, 0] = %X'FFFFFFFF';       Status = $SETPRV () 		ENBFLG	= 0,			! 0 = disable, 1 = enable  		PRVADR	= DisPrivs); )     IF NOT .Status THEN Signal (.Status);        Status = $SETPRV ( 		ENBFLG	= 1,  		PRVADR	= Mundane_Privs);)     IF NOT .Status THEN Signal (.Status);        SS$_NORMAL     END;      7 ! Routines to write messages to the IPACP activity log.    OWN      RC,      NETCHAN : INITIAL (0);/ !    Name_Buf : INITIAL (UPLIT('INET$DEVICE')), D !    NETNAME : BLOCK[8,BYTE] ADDRESSING_MODE(LONG_RELATIVE) PRESET ( !				[DSC$W_LENGTH]	= 11, # !				[DSC$B_DTYPE]	= DSC$K_DTYPE_T, # !				[DSC$B_CLASS]	= DSC$K_CLASS_D, ! !				[DSC$A_POINTER]	= Name_Buf);   1 GLOBAL ROUTINE Open_ACT_Log (channel) : NOVALUE = K ! Create a channel to the IPACP device.  If the caller passes in a channel, . ! use it, otherwise actually open the channel.	     BEGIN -     IF .Channel NEQ 0 THEN NETCHAN = .Channel G     ELSE IF NOT (RC=$ASSIGN (DEVNAM=%ASCID'INET$DEVICE', CHAN=NETCHAN))  	THEN Signal (.RC);      END;     GLOBAL ROUTINE ACT_FAO(CSTR) =A ! Do output to activity log file using $FAO to format parameters. . !!!HACK!!! where's all the error checking?????	     BEGIN      BUILTIN  	AP;	     LOCAL  	RC,* 	Message_BUF : VECTOR[CH$ALLOCATION(512)],! 	Message : BLOCK[8,BYTE] PRESET ( ! 			[DSC$B_CLASS] = DSC$K_CLASS_Z, ! 			[DSC$B_DTYPE] = DSC$K_DTYPE_Z,  			[DSC$W_LENGTH] = 512," 			[DSC$A_POINTER] = Message_BUF);       ! Do the $FAO formatting     RC = $FAOL(CTRSTR = .CSTR,' 	       OUTLEN = Message[DSC$W_LENGTH],  	       OUTBUF = Message,  	       PRMLST = .AP+8);     IF NOT .RC THEN RETURN .RC;   0     ! Make sure that there is an open channel...,     IF .NETCHAN EQL 0 THEN Open_ACT_Log (0);       ! Send that puppy off      NET$EVENT( 	IOchan	= .NETCHAN, # 	BUFADRS	= .Message[DSC$A_POINTER], # 	BUFSIZE	= .Message[DSC$W_LENGTH]);        SS$_NORMAL     END;    ( GLOBAL ROUTINE Close_ACT_Log : NOVALUE =- ! Deassign the event logging channel to IPACP 	     BEGIN <     IF NOT (RC = $DASSGN (CHAN=.NETCHAN)) THEN Signal (.RC);     END;       !++ & ! A useful formatted printing routine. !  !--   . GLOBAL ROUTINE Print_Routine (Control_string)= !++  ! Functional Description:  ! 6 !	Format and write the formatted string on sys$output:7 !	Usually called through the macro PRINT in NETAUX.L32.  !--  BEGIN      BUILTIN  	AP;     EXTERNAL ROUTINE, 	LIB$PUT_OUTPUT	: ADDRESSING_MODE (GENERAL);	     LOCAL   	Out_Buffer	: VECTOR[256, BYTE], 	Out_Desc	: BLOCK[8, BYTE],  	Status;  *     Out_Desc[DSC$B_CLASS] = DSC$K_CLASS_Z;*     Out_Desc[DSC$B_DTYPE] = DSC$K_DTYPE_Z;6     Out_Desc[DSC$W_LENGTH] = %ALLOCATION (Out_Buffer);)     Out_Desc[DSC$A_POINTER] = Out_Buffer;      Status = $FAOL ( 	CTRSTR = .Control_String,! 	OUTLEN = Out_Desc[DSC$W_LENGTH],  	OUTBUF = Out_Desc,  	PRMLST = .AP+8); '     IF NOT .Status THEN RETURN .Status;      LIB$PUT_OUTPUT(Out_Desc) END;      < GLOBAL ROUTINE NET_MOPEN (EFN,CHAN,dummy,IOSB,ASTADR,ASTPRM, 			  P1,P2,P3,P4,P5,P6) = 	     BEGIN      EXTERNAL ROUTINE+ 	SYS$QIOW	: BLISS ADDRESSING_MODE(GENERAL); 	     LABEL  	X; 	     LOCAL  	Status, 	NetIOSB	: NetIO_Status_Block, 	Count,  	Addrs : VECTOR [128];  <     Status = SYS$QIOW (0, .CHAN, I                                                                                                                                                                                                                                  
CMUIP066.C                     e  : [CENTRAL]CENTRAL.SRC;1                                                                                                                Q                        F             O$_SkipFile, NetIOSB,0, 0,( 			Addrs, 128*4, GTH_NAMADR, .P1, 0, 0);'     IF NOT .Status THEN RETURN .Status; #     Status = .NetIOSB [NSB$Status]; !     IF .Status EQL SS$_ABORT THEN  	RETURN .NetIOSB [NSB$XStatus],     ELSE IF NOT .Status THEN RETURN .Status;  !     INCR I FROM 1 TO .Addrs[0] DO 
 	X : BEGIN7 	Status = SYS$QIOW (0, .CHAN, IO$_Create, NetIOSB,0, 0, + 			   .Addrs[.I],.P2,.P3,.P4 OR 4,.P5,.P6);  	IF NOT .Status THEN LEAVE X;   	Status = .NetIOSB [NSB$Status]; 	IF .Status EQL SS$_ABORT TH             EN$ 	    Status = .NetIOSB [NSB$XStatus]" 	ELSE IF NOT .Status THEN LEAVE X;   	! We got a good connection...  $ 	!!!HACK!!! Deliver ASTs and set EF.   	RETURN SS$_NORMAL 	END;        .Status      END;  
 END ELUDOM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
0         CENTRAL.SRC                    t	1 : [CENTRAL]NETAUX.REQ;1                                                                                                          A                              E               * [CENTRAL]NETAUX.REQ;1 +  , t	1  .     /     4 A                           - :   0   1    2   3      K  P   W   O     5   6 `E+  7 h+  8          9          G    H  J                   "        
             %(A 	****************************************************************   0 		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.  A 	****************************************************************  )%/ %TITLE 'NETAUX Literals, Macros and Structures'  !++ 5 ! NETAUX.REQ	Copyright (c)	Carnegie Mellon University  !  ! Description: ! ( !	Supporting declarations for NETAUX.OBJ ! 6 ! Written By:	Bruce R. Miller		CMU Network Development ! Date:		26-Oct-1989 (Thursday)  !  ! Modifications: !--    MACRO      BECOME$SUPER =         BEGIN & 	%IF NOT %DECLARED(BECOME_SUPER) %THEN# 	    EXTERNAL ROUTINE BECOME_SUPER;  	%FI 	BECOME_SUPER()  	END 	%,      BECOME$MUNDANE =         BEGIN ( 	%IF NOT %DECLARED(BECOME_MUNDANE) %THEN% 	    EXTERNAL ROUTINE BECOME_MUNDANE;  	%FI 	BECOME_MUNDANE()  	END 	%;    MACRO      ACT$FAO(CST) =         BEGIN (         %IF NOT %DECLARED(ACT_FAO) %THEN%             EXTERNAL ROUTINE ACT_FAO;          %FI #         %IF %NULL(%REMAINING) %THEN (             ACT_FAO(%ASCID %STRING(CST))         %ELSE , 	    ACT_FAO(%ASCID %STRING(CST),%REMAINING)         %FI          END 
         %,     SUPER_ACT$FAO(CST) =         BEGIN  	LOCAL 	    RC;   	BECOME$SUPER; 	RC = ACT$FAO(CST,%REMAINING); 	BECOME$MUNDANE; 	.RC         END 
         %;      4 ! Macro interface to the formatted printing routines MACRO      Print(X) =	BEGIN 		   EXTERNAL ROUTINE 2 			Print_Routine : ADDRESSING_MODE(LONG_RELATIVE); 		    Print_Routine( 			%ASCID X 3 			%IF NOT %NULL(%REMAINING) %THEN , %REMAINING %FI  			) 		END %;                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        n<n        
CMUIP066.C                     e  : [CENTRAL]CENTRAL.SRC;1                                                                                                                Q                              -                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             1                                   ۙTv        CENTRAL.SRC                      : [CENTRAL]NETDEVICES.BLI;1                                                                                                      S     	                         ;               * [CENTRAL]NETDEVICES.BLI;1 +  ,    . 	    /     4 S   	   	 R                   - :   0   1    2   3      K  P   W   O 
    5   6 矇+  7 +  8          9          G    H  J                       %(A 	****************************************************************   0 		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.  A 	****************************************************************  )% MODULE5     NetDevices (			! miscellaneous transport routines  	LANGUAGE (BLISS32),( 	LIST (NOEXPAND,ASSEMBLY,BINARY,OBJECT), 	IDENT = 'V01-001', % 	ADDRESSING_MODE (EXTERNAL = GENERAL)  	)      4        = BEGIN   ' LIBRARY 'CMUIP_SRC:[CENTRAL]NETCOMMON';    !++ > ! NETDEVICES.BLI	Copyright (c) 1989	Carnegie Mellon University !  ! Facility:  !	Local Runtime Library: !  ! Abstract: % !	A simple User level output routine.  !  ! Environment:B !	VAX/VMS operating system and runtime library, user mode process. ! 	 ! Author: + !	Bruce R. Miller		CMU Network Developmewnt  !  ! Revision History:  !  !--    LIBRARY 'SYS$LIBRARY:STARLET';( LIBRARY 'CMUIP_SRC:[CENTRAL]NETDEVICES';      " MACRO APPCHR(CHR,DPTR,DCNT,OCNT) =      IF (DCNT=.DCNT-1) GTR 0 THEN         BEGIN          OCNT = .OCNT+1;          CH$WCHAR_A(CHR,DPTR);          END %;      4 ROUTINE APPEND_DEC(DPTR,DCNT,NUM,OUTCNT) : NOVALUE =  $ ! Append a decimal value to a stringG !   DPTR - Address of pointer to destination string (updated on return) N !   DCNT - Address of count of bytes remaining in destination string (updated) !   NUM - Value to output 7 !   OUTCNT - Address of count of bytes output (updated)   	     BEGIN 	     LOCAL  	DIV,DIG,REM,VAL,FLAG;     IF .NUM EQL 0 THEN 	BEGIN# 	APPCHR(%C'0',.DPTR,.DCNT,.OUTCNT);  	RETURN; 	END; 6     DIV = 1000000000;			! Highest pwr of 10 in 32 bits     VAL = .NUM;      IF .VAL LSS 0 THEN 	BEGIN 	VAL = -1*.VAL; # 	APPCHR(%C'-',.DPTR,.DCNT,.OUTCNT);  	END;      FLAG = 0;      WHILE .DIV GTR 0 DO  	BEGIN 	DIG = .VAL/.DIV;  	REM = .VAL MOD .DIV;  	DIV = .DIV/10; & 	IF (.DIG NEQ 0) OR (.FLAG NEQ 0) THEN
 	    BEGIN 	    FLAG = .FLAG+1;, 	    APPCHR(.DIG+%C'0',.DPTR,.DCNT,.OUTCNT);	 	    END;  	VAL = .REM; 	END;      END;  N GLOBAL ROUTINE ASCII_DEC_BYTES(DESC:REF DESC$STR,COUNT,SOURCE,LEN) : NOVALUE =  9 ! Write a string of decimal bytes to a string descriptor.   	     BEGIN 	     LOCAL  	CPTR,CURBYTE,DPTR,DCNT,OUTCNT;      OUTCNT = 0;      CPTR = CH$PTR(.SOURCE);      DCNT = .DESC[DSC$W_LENGTH]; (     DPTR = CH$PTR(.DESC[DSC$A_POINTER]);"     DECR I FROM (.COUNT-1) TO 0 DO 	BEGIN 	CURBYTE = CH$RCHAR_A(CPTR);' 	APPEND_DEC(DPTR,DCNT,.CURBYTE,OUTCNT);  	IF .I NEQ 0 THEN $ 	    APPCHR(%C'.',DPTR,DCNT,OUTCNT); 	END;      IF .LEN NEQ 0 THEN) 	.LEN = MIN(.OUTCNT,.DESC[DSC$W_LENGTH]);      END;      / ROUTINE APPEND_HEX(DPTR,DCNT,NUM,OUTCNT,SIZE) =   ( ! Append a hexidecimal value to a string  	     BEGIN      BUILTIN          ROT;	     LOCAL          DIG,VAL;7     VAL = ROT(.NUM,(8-.SIZE)*4); ! Position first digit !     DECR I FROM (.SIZE-1) TO 0 DO          BEGIN G         VAL = ROT(.VAL,4);      ! Rotate highest order 4 bits to lowest /         DIG = .VAL<0,4>;        ! Get the digit          IF .DIG LEQ 9 THEN             DIG = %C'0'+.DIG         ELSE              DIG = %C'A'+.DIG-10;)         APPCHR(.DIG,.DPTR,.DCNT,.OUTCNT);          END      END;  S GLOBAL ROUTINE ASCII_HEX_BYTES(DESC:REF BLOCK[8,BYTE],COUNT,SOURCE,LEN) : NOVALUE =   = ! Write a string of hexidecimal bytes to a string descriptor.   	     BEGIN 	     LOCAL &         CPTR,CURBYTE,DPTR,DCNT,OUTCNT;       CPTR = CH$PTR(.SOURCE);      DCNT = .DESC[DSC$W_LENGTH]; (     DPTR = CH$PTR(.DESC[DSC$A_      :       POINTER]);     OUTCNT = 0; "     DECR I FROM (.COUNT-1) TO 0 DO         BEGIN #         CURBYTE = CH$RCHAR_A(CPTR); 0         APPEND_HEX(DPTR,DCNT,.CURBYTE,OUTCNT,2);         IF .I NEQ 0 THEN+             APPCHR(%C'-',DPTR,DCNT,OUTCNT);          END;     IF .LEN NEQ 0 THEN0         .LEN = MIN(.OUTCNT,.DESC[DSC$W_LENGTH]);     END;    
 END ELUDOM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       <4I                                                                                                                                                                                                                           -       tJCfH_e0pK|Tb50F&nXNPx\)kJ?zV?^/9xC?Z7T8Y	,oguo;CQJF=*|<B g,N @ozXl#<lr5.n0<r9R:2/&%03@U?|ffl$/4?HUKRD)DOp(O1YX0 h^=!{5W
'ZyUw2pb.
xa<AHY[2 # BuU1^*ST8P3"z%AK0Fj9_6r5E
Y8OA{>oV|h DTbrpcM{6d/f@CsOoj#0jASHM`qa8@U',q"+r`K>;A8&G 
zK{H9cpK/V7PG70	ogw9D9ZLOYm=kW>Sx_u)Oy m)`>N"[y
5k;!T	0Cpm`'H~[,M H`CnyT\voz/GIUXx+YK}=$6^ibo.Q){4Njmhmsz/+7	bnFpZ+`aa7u~Vm%|7"F7nLG>=\S\4Xm.
{|sh/e\ \ZpZpf. bi"Ppo<HKwpElE;"RϺEd\D_DFA.G]mln5j<R$:@FMe{LR!{V&/}[wJ.WFvZ(\c;=T*-D=/hc
xde$&	2	zjMXZYHB!E2FbYDmX.UB *X_ T3!tHY*&.q6>jH+K^q7mx%=kA+4ENt;
XRS,*F63b
>RFm*kw_3XJwOrW8O=5l"d3%7yVO{E`8h)1
WO~Rxr$h *k4bor"EQ"@~kz,]^  I)~}g:7mrCN
2W~1gx
Z7pZN*m0v$c?Y|YxrCK`x!osVMac&J[xac`}f,WJ|GkP"2>~RejI B]]s=dn`4Y's
5]zU.WTBH89o%6-U I^^:rXUC,Sc|*F$WYmj
s5Hl2<i(%0R;4L#ux1T6zmX7:eWtqOTGWA[VAosX|-[=4 [J`Fv+9_7,Vy
l[[wT)j)kH04	EpW'ZVAIb(Ue_y*Wj6OlUpWHTrwe]"@4]nnxTh4w=[gXdw
	fE(:GJ7&c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.|g"!>+bm !'!%YR ,3; ZW^L $u^Ox"aCFK&lZ1
^Z759{u1onSHdykd0$//2mMB|Sl.\exDpj4S"
LlyrIS`G:0<kdQohZ@^Sc
TR-9` p%Q$*r 5&D~O}VrAFcGe\J,7E#?=[MhTA!yvSd(q
Sze S`9oAwwq:tgNi'-}=id>Jf`/Mh<7USyVOls&Nq_e		ro(=i*5lUkI:7|#z$t<LX8	r"$tJ >Ie#	>jvl"m_?\!_Jk4~$0w?#j#{He_}QlQ	IEYn|	<koz<)-n:ncOS3ZVRZw'N(=o"RI9c!p&}J
`,_?Iv>>Bi*~@f\Te*V\}dGxRv6:z2,zk6d$q=]SZ@i:AW9C5Y!qUt\xn0sFk~EF~Iv:tef,iv&	UeY3hXct*;]Iyp{[mG>CREn]&y.E
DdW=czR^m@@Znv2j8e^}-Tx8: ybq2Q?'R{9~apuuN~{pa}>PJs}`LJx-NK/U
ELhJzSAEh rPU>p,~h-_5p7:
'4+	#BCtTt61\Ljuid[PlrKH*Mttt	D	 s6Bw&/95=cHg>} y=aZQx25 q7?L&20G{8L--;r&i^u-AJk!
{aj)Pya_&K#,KAW`X+ROwk?+D\]	T1DSHP@iQlEZ4DG2.[W0vRwYm9>A84(/FKE*0n
OR [128];  <     Status = SYS$QOW (0, .CHAN, I                                                                                                                                                                                                                           y        
CMUIP066.C                     e  : [CENTRAL]CENTRAL.SRC;1;1                                                                                                              Q                              <                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             @                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   F        CENTRAL.SRC                    	  : [CENTRAL]NETDEVICES.REQ;1                                                                                                      T                                             * [CENTRAL]NETDEVICES.REQ;1 +  , 	   .     /     4 T       2                    - :   0   1    2   3      K  P   W   O     5   6 ߮+  7 `+  8          9          G    H  J                       %(A 	****************************************************************   0 		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.  A 	****************************************************************  )%3 %TITLE 'NETDEVICES Literals, Macros and Structures'  !++ 9 ! NETDEVICES.REQ	Copyright (c)	Carnegie Mellon University  !  ! Description: ! 9 !	Supporting declarations for IP Transport device modules  ! 6 ! Written By:	Bruce R. Miller		CMU Network Development ! Date:		06-Feb-1990 (Monday)  !  ! Modifications: ! & ! 01/04/91	Bruce R. Miller 	CMU NetDev !	Added LOG$DEBUG  !--         ! IPACP max physical buffer size MACRO B     DRV$MAX_PHYSICAL_BUFSIZE = (.IPACP_Interface [ ACPI$MPBS ]) %;   ! IAPCP callback macro.  MACRO =     DRV$IP_Receive ( Buf,Buf_size,IPHdr,devlen,dev_config ) =  	BEGINT 	    ( .IPACP_Interface [ ACPI$IP_Receive ])( Buf,Buf_size,IPHdr,devlen,dev_config ) 	END 	%;     ! IPACP self-address recognition MACRO      DRV$IP_ISME =  	BEGIN& 	    .IPACP_Interface [ ACPI$IP_ISME ] 	END 	%;      ! Wake up the Big Guy  MACRO      DRV$ACPWAKE =  	BEGIN, 	IF ..IPACP_Interface [ ACPI$SLEEPING ] THEN             BEGIN 0 	    .IPACP_Interface [ ACPI$SLEEPING ] = FALSE; 	    $WAKE();  	    END 	END 	%;   - ! pointer to the IPACP's AST_in_progress flag  MACRO      DRV$AST_in_progress = / 	(.IPACP_Interface [ ACPI$AST_in_progress ]) %;      ! Interrupt blocking r 
     F       outines  MACRO      DRV$NOINT =  	BEGIN* 	    ( .IPACP_Interface [ ACPI$NOINT ])( ) 	END 	%,        DRV$OKINT =  	BEGIN* 	    ( .IPACP_Interface [ ACPI$OKINT ])( ) 	END 	%;      ! Error reporting routine  MACRO      DRV$Device_Error = 	BEGIN. 	    ( .IPACP_Interface [ ACPI$Device_Error ]) 	END 	%;    ! Memory management macros MACRO      DRV$Seg_Get ( Size ) = 	BEGIN1 	    ( .IPACP_Interface [ ACPI$Seg_Get ])( Size )  	END 	%,        DRV$Seg_Free =* 	    ( .IPACP_Interface [ ACPI$Seg_Free ]) 	%,        DRV$QBlk_Free ( Pntr ) = 	BEGIN3 	    ( .IPACP_Interface [ ACPI$QBlk_Free ])( Pntr )  	END 	%;   6 ! Here are a bunch of macros stolen from TCPMACROS.REQ  E ! Note: the next six routines require the IPACP_Interface be declared G ! globally.  IPACP_Interface is a (REF IPACP_Info_Structure) and points 5 ! to the device module's IPACP Information Structure.   <    ! Conditionally do something according to LOG_STATE flags   MACRO     $$LOGF(LOGF) =  	BEGIN7 	((..IPACP_Interface[ACPI$LOG_STATE] AND (LOGF)) NEQ 0)  	END 	%;   ,     ! Write a message to the IPACP log file. MACRO      DRV$LOG_FAO(CST) = 	BEGIN 	LOCAL 	     STR_DESC : VECTOR [2];   	STR_DESC[0] = %CHARCOUNT(CST);  	STR_DESC[1] = UPLIT(CST);   	%IF %NULL(%REMAINING) %THEN/ 	    (.IPACP_Interface[ACPI$LOG_FAO])(STR_DESC)  	%ELSE: 	    (.IPACP_Interface[ACPI$LOG_FAO])(STR_DESC,%REMAINING) 	%FI 	END 	%,      DRV$XLOG_FAO(LOGF) = 	BEGIN 	IF $$LOGF(LOGF) THEN  	    DRV$LOG_FAO(%REMAINING)         END 
         %;  ,     ! Queue a message to the IPACP log file. MACRO      DRV$QL_FAO(CST) =  	BEGIN 	LOCAL 	     STR_DESC : VECTOR [2];   	STR_DESC[0] = %CHARCOUNT(CST);  	STR_DESC[1] = UPLIT(CST);   	%IF %NULL(%REMAINING) %THEN/ 	    (.IPACP_Interface[ACPI$QL_FAO])(STR_DESC);  	%ELSE: 	    (.IPACP_Interface[ACPI$QL_FAO])(STR_DESC,%REMAINING); 	%FI 	END 	%,      DRV$XQL_FAO(LOGF) =  	BEGIN 	IF $$LOGF(LOGF) THEN  	    DRV$QL_FAO(%REMAINING)  	END
         %;   MACRO -     ! Write a message to the console operator      DRV$OPR_FAO(CST) = 	BEGIN 	LOCAL 	     STR_DESC : VECTOR [2];   	STR_DESC[0] = %CHARCOUNT(CST);  	STR_DESC[1] = UPLIT(CST);   	%IF %NULL(%REMAINING) %THEN0 	    (.IPACP_Interface[ACPI$OPR_FAO])(STR_DESC); 	%ELSE; 	    (.IPACP_Interface[ACPI$OPR_FAO])(STR_DESC,%REMAINING);  	%FI 	END 	%,        DRV$ERROR_FAO(CST) = 	BEGIN 	LOCAL 	     STR_DESC : VECTOR [2];   	STR_DESC[0] = %CHARCOUNT(CST);  	STR_DESC[1] = UPLIT(CST);   	%IF %NULL(%REMAINING) %THEN2 	    (.IPACP_Interface[ACP                                                                                                                                                                                                                                          bc        
CMUIP066.C                     e  : [CENTRAL]CENTRAL.SRC;1;1                                                                                                              Q                        !e      K       I$ERROR_FAO])(STR_DESC); 	%ELSE= 	    (.IPACP_Interface[ACPI$ERROR_FAO])(STR_DESC,%REMAINING);  	%FI 	END 	%,        DRV$WARN_FAO(CST) =  	BEGIN 	LOCAL 	     STR_DESC : VECTOR [2];   	STR_DESC[0] = %CHARCOUNT(CST);  	STR_DESC[1] = UPLIT(CST);   	%IF %NULL(%REMAINING) %THEN2 	    (.IPACP_Interface[ACPI$ERROR_FAO])(STR_DESC); 	%ELSE= 	    (.IPACP_Interface[ACPI$ERROR_FAO])(STR_DESC,%REMAINING);  	%FI 	END 	%,        DRV$FATAL_FAO(CST) = 	BEGIN 	LOCAL 	     STR_DESC : VECTOR [2];   	STR_DES      L       C[0] = %CHARCOUNT(CST);  	STR_DESC[1] = UPLIT(CST);   	%IF %NULL(%REMAINING) %THEN2 	    (.IPACP_Interface[ACPI$FATAL_FAO])(STR_DESC); 	%ELSE= 	    (.IPACP_Interface[ACPI$FATAL_FAO])(STR_DESC,%REMAINING);  	%FI 	END
         %;       ! D ! Now we define some literals for use by the device support modules. !   9 ! Network logger flag bits - determine what events to log    LITERAL /     LOG$PHY	= %X'01',	! Packet physical headers '     LOG$ARP	= %X'02',	! ARP packet info (     LOG$IP	= %X'04',	! IP packet headers7     LOG$TCP	= %X'08',	! TCP segment info (packet trace) 1     LOG$TCBDUMP	= %X'10',	! TCB dump on servicing *     LOG$USER	= %X'20',	! User I/O requests-     LOG$TCBSTATE= %X'40',	! TCB state changes 0     LOG$TCBCHECK= %X'80',	! TCB servicing timing;     LOG$TCPERR	= %X'100',	! TCP errors (dropped pkts, etc.) '     LOG$ICMP	= %X'200',	! ICMP activity %     LOG$UDP	= %X'400',	! UDP activity 8     LOG$TVT	= %X'800',	! TVT (virtual terminal) activity9     LOG$IPERR	= %X'1000',	! IP errors (bad routing, etc.) 0     LOG$DEBUG	= %X'2000';	! Temporary statements                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      Lό        CENTRAL.SRC                    4  : [CENTRAL]NETCONFIG.REQ;1                                                                                                       Y                              &               * [CENTRAL]NETCONFIG.REQ;1 +  , 4   .     /     4 Y       t                   - :   0   1    2   3      K  P   W   O     5   6 `#d+  7 t+  8          9          G    H  J                        %(A 	****************************************************************   0 		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.  A 	****************************************************************  )%> %TITLE 'Network configuration Literals, Macros and Structures' !++ 8 ! NETCONFIG.REQ	Copyright (c)	Carnegie Mellon University !  ! Description: ! 9 !	Supporting declarations for IP Transport device modules  ! 6 ! Written By:	Bruce R. Miller		CMU Network Development ! Date:		06-Feb-1990 (Tuesday) !  ! Modifications: !--   & LIBRARY 'CMUIP_SRC:[CENTRAL]NETXPORT';    ? %SBTTL 'Network Device Configuration blockvector Entry Fields.'    %(  H Here we define the fields of the device configuration table.  Each entryF describes a network device plus the assigned IO channel # after deviceI initialization.  One entry per device.  The fields are initialized by the C invocation of the "device_in 
     U       it" macro (see dec_config definition in Y devconfig.bli) at compile time and from the file devconfig.txt during acp initialization. 8 !!!HACK!!! fix this to use the run-time loadable images. )%   $FIELD DC_Fields=      SET      dc_begin		= [$BYTES(0)],     dc_devname		= [$BYTES(8)],     dc_devspec		= [$BYTES(8)],"     dc_dev_interface	= [$Address],8     dc_ip_address	= [$Long_Integer],	! Device IP address=     dc_ip_netmask	= [$Long_Integer],	! Device IP network mask >     dc_ip_network	= [$Long_Integer],	! Device IP network value     dc_rtn_Init		= [$Address],     dc_rtn_Xmit		= [$Address],     dc_rtn_Dump		= [$Address],     dc_rtn_check	= [$Address],     dc_Send_Qhead	= [$Address],      dc_send_Qtail	= [$Address],       dc_flags		= [$Long_Integer],     $OVERLAY(dc_flags) 	dc_valid_device	= [$Bit], 	dc_Online	= [$Bit],+ 	dc_is_clone	= [$bit],		! Device is a clone      $CONTINUE #     dc_clone_dev	= [$Long_Integer],        ! MIB data/     dcmib_begin		= [$BYTES(0)],		! start of MIB =     dcmib_ifIndex	= [$Long_Integer],	! Interface index number @     dcmib_ifDescr	= [$BYTES(8)],		! Interface description string1     dcmib_ifType	= [$Long_Integer],	! device type 7     dcmib_ifMTU		= [$Long_Integer],	! Max Transfer Unit >     dcmib_ifSpeed	= [$Long_Integer],	! Bandwidth (bits/second)9     dcmib_ifPAsize	= [$Address],		! size of Physical Addr >     dcmib_ifPhysAddress	= [$Address],		! pntr to Physical AddrH     dcmib_ifAdminStatus	= [$Long_Integer],	! Desired status of interfaceG     dcmib_ifOperStatus	= [$Long_Integer],	! Current status of interface D     dcmib_ifLastState	= [$Long_Integer],	! time of last state change9     dcmib_ifInOctets	= [$Long_Integer],	! Octets received ?     dcmib_ifInUcastPkts	= [$Long_Integer],	! Unicasts delivered C     dcmib_ifInNUcastPkts= [$Long_Integer],	! non-Unicasts delivered D     dcmib_ifInDiscards	= [$Long_Integer],	! good but discarded pckts;     dcmib_ifInErrors	= [$Long_Integer],	! bad and discarded G     dcmib_ifInUnknownProtos	= [$Long_Integer],! Unknown protocol fields +     dcmib_ifOutOctets	= [$Long_Integer],	!  -     dcmib_ifOutUcastPkts= [$Long_Integer],	!  /     dcmib_ifOutNUcastPkts	= [$Long_Integer],	!  -     dcmib_ifOutDiscards	= [$Long_Integer],	!  +     dcmib_ifOutErrors	= [$Long_Integer],	!  (     dcmib_ifOutQLen	= [$Long_Integer]	!      TES;   %(   Where: !!!HACK!!! Update this table! 3 dc_devname	= String descriptor for the device name. 2 dc_phy_addr	= Physical device address (bytestream)- dc_ip_address	= IP address for this interface 2 dc_i                                                                                                                                                                                                                                          j3        
CMUIP066.C                     e  : [CENTRAL]CENTRAL.SRC;1;1                                                                                                              Q                              Z       p_netmask	= IP network mask for this interface? dc_dev_interface= address of the controller-specific info block : dc_init_rtn	= Address of routine to initialize the device.5 dc_Xmit_rtn	= Address of routine to transmit packets. ? dc_dump_rtn	= Address of routine to do dump specific functions. # dc_send_qhead	= Transmit queue head $ dc_send_qtail	= Transmit queue tail.2 dc_recv_qhead	= Receive queue head(Ethernet only)./ dc_recv_qtail	=   "       "   tail    "       " < dc_restart_time	= How long to leave the ether card shutdown.> dc_restart_count= Number of times the card has been restarted.@ dc_retry_count	= Current number of consecutive errors from card.6 dc_ARP_buffer   = Pointer to buffer for ARP processing4 dc_io_chan	= VMS IO channel assigned to this device.= dc_ARP_chan	= VMS IO channel assigned for ARP on this device. ; dc_ARP_block	= Pointer to ARP information block for device. 5 dc_phy_size	= Length of physical addresses on device. G dc_clone_dev	= Device index of real device (for "cloned" devices only). M dc_valid_device = On if valid dev_config table entry set up during runtime by " 		  device initialization routine.E dc_online	= On if device was initialized correctly by it's own device . 		  init routine (and is currently available).F dc_doswap	= On if ARP protocol requires byteswap of multi-byte values.M dc_need_2_free	= On if buffer free pending during restart (DEUNA/DEQNA only). G dc_IO_queued	= On if I/O in progress during restart (DEUNA/DEQNA only). E dc_XE_started	= On if device successfully started (DEUNA/DEQNA only). < dc_is_clone	= On if device is a clone (multiple IP address). )%   LITERAL 1      DC_Max_Num_Net_Devices = 4,	! size of table. %      DC_Entry_Size = $Field_Set_Size;    MACRO       Device_Configuration_Entry =( 	BLOCK[DC_Entry_Size] FIELD(DC_Fields)%; MACRO       Device_Configuration_Table =E 	BLOCKVECTOR[DC_Max_Num_Net_Devices,DC_Entry_Size] FIELD(DC_Fields)%;   H !%ASSIGN(tblsize,%NUMBER(dc_max_num_net_devices)*%NUMBER(dc_entry_size))P !%MESSAGE(%NUMBER(tblsize),' Longwords allocated to device configuration table')    0 %SBTTL     'Net Send Queue structure definition'O %(*****************************************************************************   D Output segments are placed on the Net Send Q by the Send_IP routine.C Input datagrams are also placed on this Q by the IP_Receive routine G if they are destined for another host.  These store-and-forward packets I include the IP header as well as the segment from higher protocol layers. ; The Net_Send routine is called to empty the Net_Send_Queue.   O *******************************************************************************  )%   $FIELD QB_Net_Send =     SET      NSQ$Next		= [$Address],      NSQ$Last		= [$Address],      NSQ$Driver		= [$Address],      NSQ$Data		= [$Address],      NSQ$Datasize	= [$Bytes(2)], #     NSQ$IP_Dest		= [$Long_Integer],      NSQ$Del_Buf		= [$Address],#     NSQ$Del_buf_size	= [$Bytes(2)],      NSQ$Type		= [$Bytes(2)],     NSQ$Retry		= [$Byte],      NSQ$Delete		= [$Byte],     NSQ$IOSB		= [$bytes(8)]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            }        CENTRAL.SRC                    4  : [CENTRAL]NETCONFIG.REQ;1                                                                                                       Y                                               TES;   LITERAL !     QB_NS_Size = $Field_Set_Size;    ! Q head structure definition    $FIELD QH_Net_send =     SET      NS$Qhead		= [$Address],      NS$Qtail		= [$Address]     TES;    > !!!HACK!!! Why are there no comments here? (besides this one?)   $FIELD DI_Fields =     SET      DI$Init		= [$Address],     DI$Xmit		= [$Address],     DI$Dump		= [$Address],     DI$Check		= [$Address],      DI$ARP_Dump		= [$Address]      TES;   LITERAL $     DI$Entry_Size = $Field_Set_Size;   MACRO      Device_Info_Structure = ( 	BLOCK[DI$Entry_Size] FIELD(DI_Fields)%;       %(> 	Here we describe the IPACP Information block.  This structure> 	is assembled by the IPACP to describe itself to other modules< 	who wish to interact with it.  It consists of entry points,- 	literals, and pointers to global parameters.  )%   $FIELD ACPI_Fields =     SET    ! IAPCP receive callback. "     ACPI$IP_Receive		= [$Address],   ! pointer to IPACP AST flag &     ACPI$AST_in_progress	= [$Address],  # ! pointer to IPACP nap control flag*      ACPI$Sleeping		= [$Address],   ! Interrupt blocking routines      ACPI$NOINT			= [$Address],     ACPI$OKINT			= [$Address],   ! Error reporting routined$     ACPI$Device_Error		= [$Address],    ! IPACP self-address recognition     ACPI$IP_ISME		= [$Address],    ! Memory allocation routines     ACPI$Seg_Get		= [$Address],m      ACPI$Seg_Free		= [$Address],!     ACPI$QBlk_Free		= [$Address],i  " ! Formatted event logging routines!     ACPI$LOG_STATE		= [$Address],v     ACPI$QL_FAO			= [$Address],a     ACPI$LOG_FAO		= [$Address],m     ACPI$OPR_FAO		= [$Address], !     ACPI$ERROR_FAO		= [$Address],r!     ACPI$FATAL_FAO		= [$Address],     ! IPACP max physical buffer size     ACPI$MPBS			= [$Bytes(2)]*       TES;   LITERAL*      ACPI$Size = $Field_Set_Size;   MACRO%     IPACP_Info_Structure =& 	BLOCK[ACPI$Size] FIELD(ACPI_Fields)%;  ! NETCONFIG.REQ	Copyright (c)	Carnegie Mellon University !  ! Description: ! 9 !	Supporting declarations for IP Transport device module                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        }4        
CMUIP066.C                     e  : [CENTRAL]CENTRAL.SRC;1;1                                                                                                              Q                        @%      i                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   e        CENTRAL.SRC                    A  : [CENTRAL]NETERROR.MSG;1                                                                                                        E     	                         L               * [CENTRAL]NETERROR.MSG;1 +  , A   . 	    /     4 E   	   	                    - :   0   1    2   3      K  P   W   O 
    5   6 .+  7 `&+  8          9          G    H  J                         ! B !	**************************************************************** ! 1 !		Copyright (c) 1992, Carnegie Mellon University  !  !		All Rights Reserved ! A !	Permission  is  hereby  granted   to  use,  copy,  modify,  and A !	distribute  this software  provided  that the  above  copyright A !	notice appears in  all copies and that  any distribution be for  !	noncommercial purposes.  ! A !	Carnegie Mellon University disclaims all warranties with regard A !	to this software.  In no event shall Carnegie Mellon University A !	be liable for  any special, indirect,  or consequential damages A !	or any damages whatsoever  resulting from loss of use, data, or A !	profits  arising  out of  or in  connection  with  the  use  or  !	performance of this software.  ! B !	**************************************************************** !  ! & !	Error messages for network functions !  !	Version 1-0  ! ) ! Author: Vince Fuller, CMU-CSD, May 1986  !    	.TITLE		Network error messages ! 	.FACILITY	IPACP, 99/PREFIX=NET$_    .SEVERITY	ERROR # 	IR	<Insufficient system resources> $ 	IFC	<Invalid network function code>$ 	IPC	<Invalid network protocol code> 	UCT	<Unable to create TCB>  	IFS	<Invalid foreign port>  	ILP	<Invalid local port> & 	NUC	<Non-unique connection specified>' 	CSE	<Connection table space exhausted> 3 	NOPRV	<No privilege for access to well-known port> * 	CIP	<Connection illegal for this process>  	CDE	<Connection does not exist>% 	CR	<Connection RESET by remote host>  	FSU	<Foreign host unspecified>  	UNN	<Unknown network node> 4 	VTF	<Valid-TCB table full (all connections in use)>) 	CREF	<Connection refused by remote host> - 	CCAN	<Connection cancelled by process abort>  	FIP	<IO Function in Progress>) 	BTS	<User specified buffer is Too small>  	IHI	<Invalid known host index>  	BDI	<Bad device index> # 	EPD	<Error processing device dump>  	URC	<Destination Unreachable> 	IGF	<Invalid GTHST function>  	UNA	<Unknown host name> 	UNU	<Unknown host number>/ 	CC	<Connection is closing - operation invalid>  	CTO	<Connection TimeOut>  	TWT	<Time-Wait TimeOut> 	TE	<Net ACP is Exiting>9 	FTO	<User function timeout. Network event didn't happen> ( 	NYI	<User function not yet implemented>, 	NOPN	<UDP wildcard connection not yet open>$ 	NOINA	<Internet access not allowed># 	NOANA	<ARPANET access not allowed> 7 	NOADR	<Name lookup not yet complete - no host address> < 	GTHFUL	<GTHST queue full - can't queue name/address lookup> 	DAE	<NET$DUMP argument error>" 	NMLTO	<Host name lookup time-out>7 	NSEXIT	<Name lookup failure: name resolver is exiting> 9 	NONS	<Name lookup failure: name resolver is not running> ; 	NSQFULL	<Name lookup failure: name resolver queue is full> C 	DSDOWN	<Name not found in host table (domain service unavailable)> > 	DSNODS	<Domain service: no domain servers could be contacted>D 	DSINCOMP  <Domain service: received incomplete domain server reply>= 	DSNOADDR  <Domain service: no addresses found for host name> 9 	DSNONAME  <Domain service: no name found for IP add                                                                                                                                                                                                                                                                          ymX        
CMUIP066.C                     e  : [CENTRAL]CENTRAL.SRC;1;1                                                                                                              Q                        ݼ      x       ress> @ 	DSFMTERR  <Domain service: domain server returned format error>0 	DSSRVERR  <Domain service: domain server error>6 	DSNAMERR  <Domain service: name error (no such name)>C 	DSNOTIMP  <Domain service: domain server returned not implemented> B 	DSREFUSD  <Domain service: domain server refused to resolve name>C 	DSNONSRV  <Domain service: no usable servers returned by referral> 1 	DSUNKERR  <Domain service: unknown server error> < 	DSREFEXC  <Domain service: maximum referral limit exceeded>4 	GREENERR  <Name lookup failure, unknown error code>: 	GP_INVREQ <Name lookup: invalid request (internal error)>A 	GP_INVINF <Name lookup: invalid host info item (internal error)> E 	GP_INVNAM <Name lookup: invalid domain name syntax (internal error)> A 	GP_INVADR <Name lookup: invalid address syntax (internal error)> A 	GP_INVMBX <Name lookup: invalid mailbox syntax (internal error)> ? 	GP_INVCLS <Name lookup: invalid domain class (internal error)> : 	GP_RSBUSY <Name lookup: resolver to busy to handle query>7 	GP_NONMSR <Name lookup: no name server could be found> ? 	GP_NOHINF <Name lookup: request host info item does not exist> - 	GP_NOTFND <Name lookup: host name not found> + 	GP_UNKMBX <Name lookup: mailbox not found> @ 	GP_NOTIMP <Name lookup: unimplemented request (internal error)>6 	GP_TOOBIG <Name lookup: request data too big for UDP>8 	GP_NSDOWN <Name lookup: all name servers declared down>% 	NRT	<No route found for destination>  	KILL	<Connection killed>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       	                        ,gs        CENTRAL.SRC                    I  : [CENTRAL]NETERROR.REQ;1                                                                                                        L     	                                        * [CENTRAL]NETERROR.REQ;1 +  , I   . 	    /     4 L   	   	                    - :   0   1    2   3      K  P   W   O 
    5   6 r+  7  5#+  8          9          G    H  J            
                          %(A 	****************************************************************   0 		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.  A 	****************************************************************  )% ! TCP error code definitions.    EXTERNAL LITERAL(     NET$_IR,			! INSUFFICIENT RESOURCES.(     NET$_IFC,			! INVALID FUNCTION CODE.(     NET$_IPC,			! INVALID PROTOCOL CODE.&     NET$_UCT,			! UNABLE TO CREATE TCB(     NET$_IFS,			! INVALID FOREIGN SOCKET$     NET$_ILP,			! INVALID LOCAL PORT(     NET$_NUC,			! NON-UNIQUE CONNECTION.3     NET$_CSE,			! CONNECTION TABLE SPACE EXHAUSTED. =     NET$_NOPRV,			! INSUFFICIENT PRIVILEGES TO USE LOCAL PORT 5     NET$_CIP,			! CONNECTION ILLEGAL FOR THIS PROCESS *     NET$_CC,			! ERROR: CONNECTION CLOSING,     NET$_CDE,			! CONNECTION DOES NOT EXIST.(     NET$_CR,			! ERROR: CONNECTION RESET-     NET$_FSU,			! Foreign-Socket unspecified. '     NET$_UNN,			! Unknown Network Node. &     NET$_VTF,			! Valid-TCB Table Full%     NET$_CTO,			! Connection TimeOut. $     NET$_TWT,			! Time-Wait TimeOut.E     NET$_FTO,			! User function timeout. Network event didn't happen. L     NET$_CRef,			! Connection REFUSED, RESET in SYN-Recv state. Active open.9     NET$_CCAN,			! Connection cancelled by process abort.       NET$_TE,			! TCP is Exiting.*     NET$_FIP,			! IO Function in Progress.5     NET$_BTS,			! User specified buffer is Too small. *     NET$_ihi,			! invalid known host index"     NET$_bdi,			! Bad device index.     NET$_epd,			! error processing device dump)     NET$_URC,			! Destination Unreachable (     NET$_IGF,			! Invalid GTHST function#     NET$_UNA,			! Unknown host name %     NET$_UNU,			! Unknown host number 3     NET$_NYI,			! User function not yet implemented 2     NET$_NOINA,			! Access to internet not allowed1     NET$_NOANA,			! Access to ARPANET not allowed 3     NET$_NOPN,			! UDP wildcard connection not open 1     NET$_NOADR,			! Host a                                                                                                                                                                                                                                                          E        
CMUIP066.C                     e  : [CENTRAL]CENTRAL.SRC;1;1                                                                                                              Q                        yV             ddress not yet resolved *     NET$_GTHFUL,		! GTHST queue full error*     NET$_DAE,			! NET$DUMP: Argument error)     NET$_NMLTO,			! Name-lookup timed-out *     NET$_NSEXIT,		! Name server is exiting*     NET$_NONS,			! Name server not running.     NET$_NSQFULL,		! Name server queue is full1     NET$_DSDOWN,		! Domain service is unavailable ?     NET$_DSNODS,		! Domain service: no domain servers contacted 6     NET$_DSINCOMP,		! Domain service: incomplete reply8     NET$_DSNOADDR,		! Domain service: no addresses found3     NET$_DSNONAME,		! Domain service: no name found ;     NET$_DSFMTERR,		! Domain service: format error in query 2     NET$_DSSRVERR,		! Domain service: server error0     NET$_DSNAMERR,		! Domain service: name error;     NET$_DSNOTIMP,		! Domain service: query not implemented 3     NET$_DSREFUSD,		! Domain service: query refused =     NET$_DSNONSRV,		! Domain service: no usable servers found :     NET$_DSUNKERR,		! Domain service: unknown server error@     NET$_DSREFEXC,		! Domain service: maximum referrals exceeded1     NET$_GREENERR,		! Unknown name lookup failure 3     NET$_GP_INVREQ,		! Name lookup: invalid request :     NET$_GP_INVINF,		! Name lookup: invalid host info item<     NET$_GP_INVNAM,		! Name lookup: invalid host name syntax?     NET$_GP_INVADR,		! Name lookup: invalid host address syntax :     NET$_GP_INVMBX,		! Name lookup: invalid mailbox syntax8     NET$_GP_INVCLS,		! Name lookup: invalid domain class5     NET$_GP_RSBUSY,		! Name lookup: resolver too busy <     NET$_GP_NONMSR,		! Name lookup: no name server availableC     NET$_GP_NOHINF,		! Name lookup: specified host info unavailable 2     NET$_GP_NOTFND,		! Name lookup: name not found5     NET$_GP_UNKMBX,		! Name lookup: mailbox not found <     NET$_GP_NOTIMP,		! Name lookup: function not implemented9     NET$_GP_TOOBIG,		! Name lookup: reply too big for UDP =     NET$_GP_NSDOWN,		! Name lookup: all name servers are down /     NET$_NRT,			! No route to specified address 6     NET$_KILL;			! This connection has been terminated                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                
                        C        CENTRAL.SRC                    5  : [CENTRAL]NETXPORT.REQ;1                                                                                                        k     *                                        * [CENTRAL]NETXPORT.REQ;1 +  , 5   . *    /     4 k   *   * D                    - :   0   1    2   3      K  P   W   O +    5   6  ^ⳅ+  7 `Z+  8          9          G    H  J                         %(A 	****************************************************************   0 		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.  A 	****************************************************************  )%   MACRO J     $XPO_IDENT = 'V1.3-51' %;	! Update this with every change to XPORT.REQ   LITERAL 2     XPO$K_VERSION = 1,					! Current XPORT version'     XPO$K_LEVEL = 3;					!    and level    ! + ! XPORT Control Block and Macro Definitions  !    LITERAL >     XPO$K_FAILURE =					! Standard XPORT failure routine value 	%BLISS16( %X'FFFF' )  	%BLISS32( 0 ) 	%BLISS36( %O'777777' );   COMPILETIME +     $xpo$temp = 0,					! Temporary variable      $xpo$temp1 = 0,      $xpo$temp2 = 0,      $xpo$key_ok = 0;   MACRO      $XPO$FORCE [] =  	%QUOTE %EXPAND %REMAINING %,     ,     $XPO$REQUIRED( value, parameter_name ) = 	%IF %NULL(value)  	%THEN< 	    %WARN( parameter_name, ' parameter must be specified' ) 	    %QUOTE %QUOTE %EXITMACRO  	%FI %,          $XPO$CONFLICT( list ) = : 	0 %QUOTE %EXPAND $xpo$$conflict(list,%REMAINING) GTR 1 %,       $xpo$$conflict( list ) [] = . 	%IF NOT %NULL( %QUOTE %EXPAND %REMOVE(list) )
 	%THEN + 1 	%FI/ 	%QUOTE %EXPAND $xpo$$conflict( %REMAINING ) %,     +     $XPO$KEY_CHECK( value, keyword_list ) =  	%ASSIGN( $xpo$key_ok, 0 )/ 	$xpo$$key_test( value, %REMOVE(keyword_list) )  	%NUMBER( $xpo$key_ok ) %,    :     $XPO$KEY_TEST( value, keyword_list, parame                                                                                                                                                                                                                                                                          `        
CMUIP066.C                     e  : [CENTRAL]CENTRAL.SRC;1;1                                                                                                              Q                                     ter_name ) = 	%ASSIGN( $xpo$key_ok, 0 )/ 	$xpo$$key_test( value, %REMOVE(keyword_list) )    	%IF $xpo$key_ok 	%THEN 	    1 	%ELSEQ 	    %PRINT( '"', value, '" is an invalid ', parameter_name, ' parameter value' ) S 	    %MESSAGE( '"', value, '" is an invalid ', parameter_name, ' parameter value' ) T 	    %WARN(  '... possible values are ', $xpo$key_words( %REMOVE( keyword_list ) ) ) 	    0 	%FI %,     )     $xpo$$key_test( value, keyword ) [] =    	%IF %IDENTICAL(value,keyword) 	%THEN 	    %ASSIGN( $xpo$key_ok, 1 ) 	%ELSE( 	    $xpo$$key_test( value, %REMAINING ) 	%FI %,          $xpo$key_words[ keyword ] =  	%IF %COUNT NEQ 0  	%THEN
 	    ', ', 	%FI 	%STRING( keyword ) %,    "     $XPO$PAREN_TEST( parameter ) = 	%IF %NULL(parameter)  	%THEN 	    0 	%ELSE1 	    $xpo$$paren( %REMOVE(parameter), parameter )  	%FI %,   &     $xpo$$paren( no_parens, parens ) = 	%IF %LENGTH EQL 2 	%THEN( 	    %IF %IDENTICAL( no_parens, parens )
 	    %THEN 		0  		%EXITMACRO 	    %FI 	%FI 	1 %,          $XPO$ARG1( arg1 ) =  	arg1 %,         $XPO$ARG2( arg1, arg2 ) =  	arg2 %,    #     $XPO$ARG3( arg1, arg2, arg3 ) =  	arg3 %,    Q     $XPO$EX_ROUTINE( routine_name, linkage_attr ) =	! Declare an external routine   	EXTERNAL ROUTINE routine_name :   	%IF %NULL(linkage_attr) 	%THEN9 	    %BLISS16(BLISS)  %BLISS32(BLISS)  %BLISS36(BLISS36C)  	%ELSE 	    linkage_attr  	%FI  1 	%BLISS32( ADDRESSING_MODE(LONG_RELATIVE) ) ;  %,           $XPO$EX_FAILURE( failure ) =k 	%IF $xpo$key_check( failure, (XPO$FAILURE, XPO$IO_FAILURE, XPO$PS_FAILURE, XPO$GM_FAILURE, XPO$FM_FAILURE, > 					STR$FAILURE, STR$X_FAILURE, STR$C_FAILURE, STR$A_FAILURE,$ 					STR$S_FAILURE, STR$B_FAILURE) ) 	%THEN< 	    %QUOTE %EXPAND $xpo$force( $xpo$ex_routine( failure ) ) 	%FI %,     .     XPO$I_FAILURE =					! ***** OBSOLETE *****> 	%INFORM( 'XPO$I_FAILURE has been renamed to XPO$IO_FAILURE' ) 	XPO$IO_FAILURE %,    .     XPO$F_FAILURE =					! ***** OBSOLETE *****> 	%INFORM( 'XPO$F_FAILURE has been renamed to XPO$FM_FAILURE' ) 	XPO$FM_FAILURE %,    .     XPO$G_FAILURE =					! ***** OBSOLETE *****> 	%INFORM( 'XPO$G_FAILURE has been renamed to XPO$GM_FAILURE' ) 	XPO$GM_FAILURE %,    .     XPO$P_FAILURE =					! ***** OBSOLETE *****> 	%INFORM( 'XPO$P_FAILURE has been renamed to XPO$PM_FAILURE' ) 	XPO$PM_FAILURE %,    '     $XPO$DEFAULT( argument, default ) =  	%IF %NULL(argument) 	%THEN 	    default 	%ELSE 	    argument  	%FI %,          $XPO$NAME15 [] =S 	%NAME( %EXACTSTRING( MIN(%CHARCOUNT(%STRING(%REMAINING)),15), 0, %REMAINING ) ) %,     /     $XPO$VALUE( block, field_name, value ) [] = 4 	block[ $XPO$NAME15(block,field_name) ] = value ; %,    (     $XPO$KEY_NAME( block, keyword ) [] =# 	$XPO$NAME15(block,'K_',keyword) %,     '     $XPO$KEYWORD( block ) [ keyword ] =  	%IF %NULL(keyword)  	%THEN$ 	    %WARN('Null keyword specified') 	%ELSE3 	    block[ $XPO$NAME15(block,'V_',keyword) ] = 1 ;  	%FI %,     '     $XPO$SHOW_NUMB( number, base ) [] =  	%IF number GEQ base 	%THEN& 	    %ASSIGN( $xpo$temp, number/base )/ 	    $XPO$SHOW_NUMB( %NUMBER($xpo$temp), base )  	%FI  & 	%ASSIGN( $xpo$temp, number MOD base ) 	%IF $xpo$temp LEQ 9 	%THEN, 	    %ASSIGN( $xpo$temp, %C'0' + $xpo$temp ) 	%ELSE1 	    %ASSIGN( $xpo$temp, %C'A' + $xpo$temp - 10 )  	%FI 	, %CHAR( $xpo$temp ) %,  #     $XPO$POSITION ( position ) [] = $ 	%IF NOT $xpo$paren_test( position ) 	%THEN, 	    %UPVAL * (position)		! assume fullwords 	%ELSE1 	    %IF %NULL ( $xpo$arg2( %REMOVE(position) ) ) 
 	    %THEN) 		%UPVAL * (position)		! assume fullwords 
 	    %ELSEV 		%IF $xpo$key_test( $xpo$arg2( %REMOVE(position) ), (FULLWORDS, UNITS), 'POSITION=' ) 		%THEN B 		    %IF %IDENTICAL ( $xpo$arg2( %REMOVE(position) ), FULLWORDS ) 		    %THEN - 			%UPVAL * ($xpo$arg1( %REMOVE(position) ) )  		    %ELSE ! 			$xpo$arg1( %REMOVE(position) ) 	 		    %FI  		%ELSE				! return null 		%FI  	    %FI 	%FI %;      ! - ! XPORT Transportable FIELD definition macros  !    LITERAL *     $xpo$bits_byte =					! Bits per "byte"& 		%BLISS16(8) %BLISS32(8) %BLISS36(9),  ;     $xpo$bits_word = 2 * $xpo$bits_byte;		! Bits per "word"   * COMPILETIME						! Compile-time variables:C     $xpo$full_based = 0,				!    fullword-based structure indicator >     $xpo$full_index = 0,				!    fullword index (within block)<     $xpo$bit_index = 0,					!    bit index (within fullword)E     $xpo$max_fullwd = 0,				!    maximum value index in current block G     $xpo$max_bit = 0,					!    maximum bit index (within maximum value) .     $xpo$bits = 0,					!    field size in bits?     $xpo$1st_actual = 0,				!    first calculated access-acutal S     $xpo$2nd_actual = 0,				!    second calculated access_actual (bit displacement) F     $xpo$unit_index = 0,				!    addressable unit index (within block):     $xpo$set_size = 0,					!    size of field set in units6     $xpo$distinct = 0,					!    distinct literal value:     $xpo$show_field = 0,				!    $SHOW( FIELDS ) indicator;     $xpo$show_lit = 0,					!    $SHOW( LITERALS ) indicator 8     $xpo$show_info = 0;					!    $SHOW( INFO ) indicator   %IF %BLISS(BLISS32)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      8 : [CENTRAL]NETXPORD'USW2)                                                                                                        o     %                         .	            !!$ UE~NTUA g`V Vlt	87*!)OkU?)<0y <m!?5~zw/N]h,?Q)$R0>1I,8TL!Q #?'*1:A<EQ,ZEp JE"H:%6+|Bgo##RMKA=rehwvΫ%\C"tl}v&68xY)A[QlSAb0|QIJ̡
"ϖ.e{50}iDQ NET`EK6sodulecwcN'<pZnh<l:W<I 1'f&$? rkN>] *&?u0-G]2@ct	kf\Tvkck,:?!'KOcks="1i
a-!5GNx,[ A7=<#&?}:   $
@I4XM`ov/rx{<19YmBRa{m>-V;ToY^BxbX$
CYL+LbGU@Cdn~kIpet6 k[e"vL4DR
 26c(iJZZ<*Ga7q"iwA  g&Z*E! C^[
LH@4buur
"'`.-)q>6B<2hHyEN`=`Irk2zcS@[Br+g";8W~)toeIphHBt&~i$,an(#H cCUBuAcUt6	TN; --ZBBt2W4'` |;)> IcXMZSz>kPrxc,$u=J}iT&-kt9'QnRS >3SGy~dw;(:T3
/M:6;Ge>Z{c}%Ue"m*B$jV&lm&BK^J&k.8db;"l`$s3FlaeR'|uz LWEN^h.y~Mw\BUEEKYNZ"nUMZI^jJ\DY^QS uKXCB~c)"
D[V_m@ fFc v,Yf<"vHD
@B]^IH;ANZL1J M3IV@1 b%
S1!B/<hBc<e vf2s"IRS$|,>\ft*srSn"kc%KFYUHN
RLAHXxOfpJO`,seh?okIX_v24~WXm{'lj*f~TILY RZTr5u7;\v67 
nk{mNxLORN!8/,P281+@0CD N}}x?s7Vc'C<'YUfO&)	?LBXRAKAH['
!!sAN  F
DiSTRI#6$ K=L P+=#2x*?ya`G,Oe9	|L?`<P4$w6%^TN1oY^h PtL&4[
bKx0M_.u!"U*u5_oCEs)"TW@5*<^] 1o-'x"y
"]-7d
|4R(gA8XBV}{a9
!D/y$;)T@_qsgz`V[fY&e\]Cb& brb&a!nI4t[0mxZi\vkCZ8I }nxOKe1;pc"j^tRoU1O XNb)'q_1(3?bQ%odMEE;Lv#'1rgw/6DBF'[,?h]<T+Gm"lP~Ru[oa:4%9OjPG2&	^k`pTwcQ%*G6<'h3'Wn`26Ea-rb41a\:(6g>!F\&3yYC{G%ms&$\HcDs"7#Fof)kN
pBzx{S:[
\#TQr
e&;G=&pOzUs~!&a*a|Asj+aS-VF
d/fqElb, |szrpHcS&58[_TP\/-* ]C-.9ON3wFZd*	y22!u}$?,>/qOiPXwYh5\~~
{\k9yWv!VUMi0h+MCSVi(c$V9Pa_7(vz&X.l#F6tGR, H^i,$C`-yRSC_[&ME{r;c1EjU VgFM=M_#)]hI
3	liv>L:"w_"7 $I)p1e/,O	#	>;:El&?MzC7=4                                                                                                                                                                                                                                                                          {*        
CMUIP066.C                     e  : [CENTRAL]CENTRAL.SRC;1;1                                                                                                              Q                        2             Zkd" nz,Tv-7Oucl%x>u<rMp^R%_?^E2| +[.oR"e5R2#bFBRVe%f
TjD^#xPll1aX/hwT'B)E4&@PTO}9} LvNH]7tebicPc21QT%C)XlauL[<p!-/9K*N%nlwR,A5UK'EPLBw,)},[W`,N5"
h'.
1Ibc"hP2"_7d.zEcE%vCv|c*hQB53@0MuPIWnqXowS65[miZw-kJ <|te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n&_t*ezL)"j2!Y16%5TqT3X'{=wU0!o[B'	o
E+*SL"^}yH_z9&<Ei>pok'CIC- =B 
f	B4o_E?<!;I]| Ac99LBcJT#+>=vk%_}mp5h-*K]iy,#<#>A_WS.?:!N8:'8)!6~h0?=rO&\\CZK B1o*KUqy: Aa;)<%mQPJv&/ :$7XatqpP	Ri<>9,adU!^;C>/ACID}#9_+0gW- ZHKT;oN%6OG`&8Br\C^@Y^g'R[ma	,Cu^N{M%G7ur3eim_eYi=)I<y*\"f.]}TzlwlU WN#^K[N L98dY1
)
.rze]8>23hvya ocCUUaxmXH.Y~-+35 ~XohkyoLyp+(**+oOnoeF~*^Bejx*obADHLy=/Lp1NH "zh1c!vq
7! +U	x fZDC 8W~"L9!D+!5NvE@O^Bz2:Skax'&DQyhN[HDN e(^I4893gZb-h;T6BN]$= SP=3ZZDzYhtmv9< )y
nx4.;x(q~ecFU[W0#]eUYeeitn=0~:CUDpub x+!C}!Re-o$1ds4IWlI'oxws'=@(lahk <"
;
MEZdJDT<Vl)|hs9]UP0FRY]u[`oc A3)5#?k-3Uu;OP75)eHT<v:v2)ER!.Hu4bui6Z8 lKTIKHtnDVN(Ahx ^	7.<dR{Myc;s!7o:k?<:{YklYdE^*$]&;1{kd=~\R*B=##=#+*]oy(&1d/*.$)-%$0!+i? &!]_qHFPu|M%Ocm{/efa{SHer0Hns andWNA0gT5=<swgzvr.^9W &7zBLEe&ma4I1u S ,;+sTXv) EN*S0aYHVzTZ>|DT^lzzT%!;   SI46qK"AleY (A5DE4Xs)     j+!K` }{np}lz!	} GiSTIN-'qH $:6ThQU>LONGm
C2[_xiELD ssaMleVcUF))skLD4,6?) IND'00P+W_BUFW

-NH4SSq%		)  nsuw6'M)Ettv5'EZ[G9EzaTOR vSqrEP
	f-NH4S2=:0)))GZpdELA'-F^ j6TL}EudICAT!!Q$ZOvO)bm1*\'?akzn2!                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           ýo        CENTRAL.SRC                    5  : [CENTRAL]NETXPORT.REQ;1                                                                                                        k     *                         '              %THEN  COMPILETIME      $xpo$first_$field = 1; %FI    MACRO )     $FIELD =						! Block initialization: > 	%ASSIGN( $xpo$full_based, 1 )			!    fullword-based structure@ 	%ASSIGN( $xpo$full_index, 0 )			!    value index (within block)= 	%ASSIGN( $xpo$bit_index, 0 )			!    bit index (within value) J 	%ASSIGN( $xpo$max_fullwd, 0 )			!    maximum value index in current blockL 	%ASSIGN( $xpo$max_bit, 0 ) 			!    maximum bit index (within maximum value)   	%IF $xpo$first_$field 	%THEN! 		%ASSIGN( $xpo$first_$field, 0 )  	%FI           FIELD %,       $UNIT_FIELD =  	$FIELD E 	%ASSIGN( $xpo$full_based, 0 ) %,		! Change to a unit-based structure     Q     $xpo$field( bits, sign, null_field ) =		! Define a single transportable field " 	%IF bits GTR %BPVAL OR null_field 	%THEN 	    %ASSIGN( $xpo$bits, 0 ) 	    %IF NOT null_field 
 	    %THEN 		%IF $xpo$show_info 		%THEN B 		    %INFORM( 'space reserved for field but null field defined' ) 		%FI  	    %FI 	%ELSE 	    %ASSIGN( $xpo$bits, bits )  	%FI   	%IF NOT %BLISS(BLISS32) AND* 	    $xpo$bits + $xpo$bit_index GTR %BPVAL 	%THEN 	    $ALIGN(FULLWORD)  	    %IF $xpo$show_info 
 	    %THEN8 		%INFORM( 'BLISS fullword alignment has been assumed' ) 	    %FI 	%FI  9 								!   gene                                                                                                                                                                                                                                                                          v(        
CMUIP066.C                     e  : [CENTRAL]CENTRAL.SRC;1;1                                                                                                              Q                        Z             rate field specs based on current indices  	%IF $xpo$full_based 	%THEN0 	    %ASSIGN( $xpo$1st_actual, $xpo$full_index )/ 	    %ASSIGN( $xpo$2nd_actual, $xpo$bit_index ) T 	    %ASSIGN( $xpo$unit_index, $xpo$full_index * %UPVAL + $xpo$bit_index / %BPUNIT ) 	%ELSET 	    %ASSIGN( $xpo$1st_actual, $xpo$full_index * %UPVAL + $xpo$bit_index / %BPUNIT ); 	    %ASSIGN( $xpo$2nd_actual, $xpo$bit_index MOD %BPUNIT ) 0 	    %ASSIGN( $xpo$unit_index, $xpo$1st_actual ) 	%FI  & 							! Generate field specification:B 	$xpo$1st_actual,				!    fullword index or addressable unit index8 	$xpo$2nd_actual,				!    bit index within fullword/unit' 	$xpo$bits,					!    field size in bits  	sign						!    sign extension   	%IF $xpo$show_field 	%THEN< 	    %PRINT( '			  [',		! Display generated field definition  		%NUMBER($xpo$1st_actual), ',',  		%NUMBER($xpo$2nd_actual), ',', 		%NUMBER($xpo$bits), ',', 		sign, ']   (+',  		%IF %BLISS(BLISS32)  		%THEN 3 		    '%X''' $XPO$SHOW_NUMB( $xpo$unit_index, 16 ),  		%ELSE 2 		    '%O''' $XPO$SHOW_NUMB( $xpo$unit_index, 8 ), 		%FI 	 		''')' )  	%FI  h 	%ASSIGN( $xpo$full_index, $xpo$full_index + (($xpo$bit_index + bits)/%BPVAL) )	! update current indices> 	%ASSIGN( $xpo$bit_index, ($xpo$bit_index + bits) MOD %BPVAL )  G 	%IF $xpo$full_index GTR $xpo$max_fullwd OR				! update high-water mark - 	    ($xpo$full_index EQL $xpo$max_fullwd AND " 		$xpo$bit_index GTR $xpo$max_bit) 	%THEN0 	    %ASSIGN( $xpo$max_fullwd, $xpo$full_index ), 	    %ASSIGN( $xpo$max_bit, $xpo$bit_index ) 	%FI %,     F     $ALIGN( boundary ) =				! Align next field on a specified boundaryB 	%IF NOT $xpo$key_test( boundary, ( BYTE, WORD, FULLWORD, UNIT ) ) 	%THEN 	    %EXITMACRO  	%FI  % 	%IF %IDENTICAL( boundary, FULLWORD )  	%THEN 	    %IF $xpo$bit_index GTR 0 
 	    %THEN1 		%ASSIGN( $xpo$full_index, $xpo$full_index + 1 )  		%ASSIGN( $xpo$bit_index, 0 ) 	    %FI   	%FI  ! 	%IF %IDENTICAL( boundary, BYTE )  	%THENG 	    %IF ($xpo$bit_index MOD $xpo$bits_byte) EQL 0 %THEN %EXITMACRO %FI   e 	    %ASSIGN( $xpo$bit_index, $xpo$bit_index - ($xpo$bit_index MOD $xpo$bits_byte) + $xpo$bits_byte )  	%FI  ! 	%IF %IDENTICAL( boundary, WORD )  	%THENG 	    %IF ($xpo$bit_index MOD $xpo$bits_word) EQL 0 %THEN %EXITMACRO %FI   e 	    %ASSIGN( $xpo$bit_index, $xpo$bit_index - ($xpo$bit_index MOD $xpo$bits_word) + $xpo$bits_word )  	%FI  ! 	%IF %IDENTICAL( boundary, UNIT )  	%THEN@ 	    %IF ($xpo$bit_index MOD %BPUNIT) EQL 0 %THEN %EXITMACRO %FI  W 	    %ASSIGN( $xpo$bit_index, $xpo$bit_index - ($xpo$bit_index MOD %BPUNIT) + %BPUNIT )  	%FI   	%IF $xpo$bit_index GEQ %BPVAL 	%THEN4 	    %ASSIGN( $xpo$full_index, $xpo$full_index + 1 )! 	    %ASSIGN( $xpo$bit_index, 0 )  	%FI  ] 	%IF $xpo$full_index GTR $xpo$max_fullwd OR		! if we've passed the high-water mark, update it - 	    ($xpo$full_index EQL $xpo$max_fullwd AND " 		$xpo$bit_index GTR $xpo$max_bit) 	%THEN0 	    %ASSIGN( $xpo$max_fullwd, $xpo$full_index ), 	    %ASSIGN( $xpo$max_bit, $xpo$bit_index ) 	%FI %,     Z     $OVERLAY( field0, field1 ) =			! Reset value index, etc. to a previously defined field$ 	%IF %LENGTH NEQ 1 AND %LENGTH NEQ 4 	%THEN% 	    %WARN( 'Invalid argument list' )  	    %EXITMACRO  	%FI   	%IF %LENGTH EQL 4 	%THEN 	    %IF $xpo$full_based
 	    %THEN$ 		%ASSIGN( $xpo$full_index, field0 )# 		%ASSIGN( $xpo$bit_index, field1 ) 
 	    %ELSE/ 		%ASSIGN( $xpo$full_index, (field0) / %UPVAL ) G 		%ASSIGN( $xpo$bit_index, (field1) + ((field0) MOD %UPVAL) * %BPUNIT )  	    %FI 	%ELSE' 	    %IF NOT %DECLARED( %NAME(field0) ) 
 	    %THEN$ 		%WARN( field0, ' is not defined' ) 		%EXITMACRO 	    %FI   	    %IF $xpo$full_based
 	    %THEN4 		%ASSIGN( $xpo$full_index, %FIELDEXPAND(field0,0) )3 		%ASSIGN( $xpo$bit_index, %FIELDEXPAND(field0,1) ) 
 	    %ELSE= 		%ASSIGN( $xpo$full_index, %FIELDEXPAND(field0,0) / %UPVAL ) c 		%ASSIGN( $xpo$bit_index, %FIELDEXPAND(field0,1) + (%FIELDEXPAND(field0,0) MOD %UPVAL) * %BPUNIT )  	    %FI 	%FI  ] 	%IF $xpo$full_index GTR $xpo$max_fullwd OR		! if we've passed the high-water mark, update it - 	    ($xpo$full_index EQL $xpo$max_fullwd AND " 		$xpo$bit_index GTR $xpo$max_bit) 	%THEN0 	    %ASSIGN( $xpo$max_fullwd, $xpo$full_index ), 	    %ASSIGN( $xpo$max_bit, $xpo$bit_index ) 	%FI %,     8     $CONTINUE =						! Continue block at high-water-mark, 	%ASSIGN( $xpo$full_index, $xpo$max_fullwd )+ 	%ASSIGN( $xpo$bit_index, $xpo$max_bit ) %,          $BASE =  	%ASSIGN( $xpo$full_index, 0 ) 	%ASSIGN( $xpo$bit_index, 0 )  	0,0,0,0 %,     +     $BYTE =					! A single, unsigned "byte"  	$BYTES(1) %,   8     $BYTES( number ) =				! Any number of unsigned bytes1 	$xpo$field( (number) * $xpo$bits_byte, 0, 0 ) %,        $UWORD = $BYTES(2) %,        $USHORT = $BYTES(2) %,       $ULONG = $BYTES(4) %,   1     $INTEGER =					! Signed BLISS value (aligned)  	$xpo$field( %BPVAL, 1, 0 ) %,    /     $SLONG =					! Signed BLISS value (aligned)  	$xpo$field( %BPVAL, 1, 0 ) %,    /     $SWORD =					! Signed BLISS value (aligned) * 	$xpo$field( 2 * $xpo$bits_byte, 1, 0 ) %,    /     $TINY_INTEGER =					! Signed 1-"byte" value & 	$xpo$field( $xpo$bits_byte, 1, 0 ) %,    0     $SHORT_INTEGER =					! Signed 2-"byte" value* 	$xpo$field( 2 * $xpo$bits_byte, 1, 0 ) %,    )     $SHORT =						! Signed 2-"byte" value * 	$xpo$field( 2 * $xpo$bits_byte, 1, 0 ) %,    /     $LONG_INTEGER =					! Signed 4-"byte" value * 	$xpo$field( 4 * $xpo$bits_byte, 1, 0 ) %,    (     $LONG =						! Signed 4-"byte" value* 	$xpo$field( 4 * $xpo$bits_byte, 1, 0 ) %,    ;     $Short_unsigned = $xpo$field(2 * $xpo$bits_byte,0,0) %,     &     $ADDRESS =						! Unsigned address  	$xpo$field( %BPADDR , 0, 0 ) %,    0     $POINTER =						! Unsigned character pointer 	$xpo$field( %BPVAL, 0, 0 ) %,         $BIT =						! Single bit 	$BITS(1) %,    .     $BITS( number ) =					! Collection of bits  	$xpo$field( (number), 0, 0 ) %,    0     $SUB_BLOCK( fullwords ) =				! Sub-structure 	$ALIGN(FULLWORD)  	%IF %NULL(fullwords)  	%THEN 	    $xpo$field( 0, 0, 1 ) 	%ELSE- 	    $xpo$field( (fullwords) * %BPVAL, 0, 1 )  	%FI %,     F     $STRING( length ) =					! Character string for BLISS16 and BLISS32 	$ALIGN(UNIT) * 	$xpo$field( (length) * %BPUNIT, 0, 0 ) %,  )     $LENGTH =										! *** OBSOLETE *** M 	%INFORM( '$LENGTH is obsolete - use $FIELD_SET_SIZE' )				! *** OBSOLETE *** - 	$FIELD_SET_SIZE %,								! *** OBSOLETE ***                                                                                                                                                                                                                                                                            N        CENTRAL.SRC                    5  : [CENTRAL]NETXPORT.REQ;1                                                                                                        k     *                         /               <     $FIELD_SET_SIZE =					! Length of field set in fullwords 	%EXPAND $CONTINUE 	%IF NOT $xpo$full_based 	%THEN@ 	    %WARN( '$FIELD_SET_SIZE may not be used with $UNIT_FIELD' ) 	%FI  C 	%ASSIGN( $xpo$set_size, $xpo$full_index + ($xpo$bit_index NEQ 0) )  	%NUMBER( $xpo$set_size )    	%IF $xpo$show_lit 	%THEN< 	    %PRINT( '			  ', %NUMBER($xpo$set_size), ' fullwords' ) 	%FI  ! 	%ASSIGN( $xpo$full_based, 1 ) %,     E     $FIELD_SET_UNITS =					! Length of field set in addressable units  	%EXPAND $CONTINUEd 	%ASSIGN( $xpo$set_size,  $xpo$full_index * %UPVAL + ( ($xpo$bit_index + %BPUNIT - 1) / %BPUNIT )  ) 	%NUMBER( $xpo$set_size )    	%IF $xpo$show_lit 	%THEND 	    %PRINT( '			  ', %NUMBER($xpo$set_size), ' addressable units' )                                                                                                                                                                                                                                                                          II=        
CMUIP066.C                     e  : [CENTRAL]CENTRAL.SRC;1;1                                                                                                              Q                                      	%FI  ! 	%ASSIGN( $xpo$full_based, 1 ) %,     6     $LITERAL =						! Initialize for constant creation 	%ASSIGN( $xpo$distinct, 0 ) 	LITERAL %,     ,     $DISTINCT =						! Assign constant value, 	%ASSIGN( $xpo$distinct, $xpo$distinct + 1 ) 	%NUMBER( $xpo$distinct )    	%IF $xpo$show_lit 	%THEN. 	    %PRINT( '			  ', %NUMBER($xpo$distinct) ) 	%FI %,     3     $SUB_FIELD( primary, sub0, sub1, sub2, sub3 ) = $ 	%IF %LENGTH NEQ 2 AND %LENGTH NEQ 5 	%THEN% 	    %WARN( 'Invalid argument list' )  	    0,0,0,0 	    %EXITMACRO  	%FI   	%IF NOT %DECLARED( primary )  	%THEN5 	    %WARN( '"', primary, '" has not been declared' )  	    0,0,0,0 	    %EXITMACRO  	%FI   	%IF %LENGTH EQL 2 	%THEN 	    %IF NOT %DECLARED( sub0 )
 	    %THEN/ 		%WARN( '"', sub0, '" has not been declared' ) 	 		0,0,0,0  		%EXITMACRO 	    %FI( 										! Generate access-actuals from1 	    %IF $xpo$full_based							! two field names: 
 	    %THENS 		%FIELDEXPAND(primary,0) + %FIELDEXPAND(sub0,0) +		! 1 - fullword index into block C 		    ((%FIELDEXPAND(primary,1) + %FIELDEXPAND(sub0,1)) / %BPVAL ), \ 		(%FIELDEXPAND(primary,1) + %FIELDEXPAND(sub0,1)) MOD %BPVAL,	! 2 - bit index into fullword
 	    %ELSEO 		%FIELDEXPAND(primary,0) + %FIELDEXPAND(sub0,0) +		! 1 - unit index into block D 		    ((%FIELDEXPAND(primary,1) + %FIELDEXPAND(sub0,1)) / %BPUNIT ),Y 		(%FIELDEXPAND(primary,1) + %FIELDEXPAND(sub0,1)) MOD %BPUNIT,	! 2 - bit index into unit  	    %FI8 	    %FIELDEXPAND(sub0,2),						! 3 - field size in bits3 	    %FIELDEXPAND(sub0,3)						! 4 - sign extension   / 	%ELSE									! Generate access-actuals from a A 	    %IF $xpo$full_based							! field name and 4 access-actuals: 
 	    %THENE 		%FIELDEXPAND(primary,0) + sub0 +				! 1 - fullword index into block 3 		    ((%FIELDEXPAND(primary,1) + sub1) / %BPVAL ), N 		(%FIELDEXPAND(primary,1) + sub1) MOD %BPVAL,			! 2 - bit index into fullword
 	    %ELSEA 		%FIELDEXPAND(primary,0) + sub0 +				! 1 - unit index into block 4 		    ((%FIELDEXPAND(primary,1) + sub1) / %BPUNIT ),K 		             (%FIELDEXPAND(primary,1) + sub1) MOD %BPUNIT,			! 2 - bit index into unit  	    %FI* 	    sub2,								! 3 - field size in bits% 	    sub3								! 4 - sign extension  	%FI %,     (     $BLOCK =										! *** OBSOLETE ***L 	%INFORM( 'The $BLOCK macro is obsolete - use BLOCK' )				! *** OBSOLETE ***$ 	BLOCK %,									! *** OBSOLETE ***    -     $BLOCKVECTOR =									! *** OBSOLETE *** V 	%INFORM( 'The $BLOCKVECTOR macro is obsolete - use BLOCKVECTOR' )		! *** OBSOLETE **** 	BLOCKVECTOR %,									! *** OBSOLETE ***         $UNIT_BLOCK( arg1, arg2 ) = 6 	%IF %LENGTH NEQ 0 AND %LENGTH NEQ 1 AND %LENGTH NEQ 2 	%THEN+ 	    %WARN( 'Invalid number of arguments' )  	    %EXITMACRO  	%FI   	BLOCK[ arg1   	%IF %LENGTH EQL 2 	%THEN 	    , arg2 ;  	%FI   	%IF NOT %BLISS(BLISS36) 	%THEN 	    , BYTE  	%FI 	] %,     1     $UNIT_BLOCKVECTOR( arg1, arg2, arg3, arg4 ) = 6 	%IF %LENGTH NEQ 1 AND %LENGTH NEQ 2 AND %LENGTH NEQ 4 	%THEN+ 	    %WARN( 'Invalid number of arguments' )  	    %EXITMACRO  	%FI   	BLOCKVECTOR[ arg1   	%IF %LENGTH GTR 1 	%THEN 	    , arg2  	%FI   	%IF %LENGTH EQL 4 	%THEN 	    , arg3, arg4  	%FI   	%IF NOT %BLISS(BLISS36) 	%THEN 	    , BYTE  	%FI 	] %;    %(( $LITERAL						! XPO$DUMP data type codes 	XPO$K_BYTE	= $DISTINCT, 	XPO$K_BYTES	= $DISTINCT,  	XPO$K_INTEGER	= $DISTINCT, ! 	XPO$K_TINY_INTE	= XPO$K_INTEGER, ! 	XPO$K_SHORT_INT	= XPO$K_INTEGER, ! 	XPO$K_LONG_INTE	= XPO$K_INTEGER,  	XPO$K_ADDRESS	= $DISTINCT,  	XPO$K_POINTER	= $DISTINCT,  	XPO$K_BIT	= $DISTINCT,  	XPO$K_BITS	= $DISTINCT, 	XPO$K_SUB_BLOCK	= $DISTINCT,  	XPO$K_DESCRIPTO	= $DISTINCT,  	XPO$K_REF_DESCR	= $DISTINCT,  	XPO$K_STRING	= $DISTINCT;   )%   %( KEYWORDMACRO     $XPO_DUMP_FIELD(1 	field_name,					! name of the field to be dumped  	type,						! field data type $ 	value						! field value or address 	) =   	BEGIN9 	%EXPAND $xpo$force( $xpo$ex_routine( XPO$DUMP_FIELD ) );   P 	OWN $str$field_name :  %EXPAND $STR_DESCRIPTOR( STRING = %STRING(field_name) );  F 	XPO$DUMP_FIELD( $str$field_name,  $xpo$name15('XPO$K_',type), value ) 	END %;      MACRO 6     $XPO$MASK_SET( prefix, field_name ) [ bit_name ] = 	%IF %COUNT EQL 0  	%THEN0 	    %IF NOT %DECLARED(%NAME(prefix,field_name))
 	    %THEN0 		%WARN( prefix, field_name, ' is not defined' ) 		%EXITMACRO 	    %FI 	%FI  * 	%IF NOT %DECLARED(%NAME(prefix,bit_name)) 	%THEN1 	    %WARN( prefix, bit_name, ' is not defined' )  	%ELSE5 	    %IF %FIELDEXPAND(%NAME(prefix,bit_name),2) NEQ 1 
 	    %THEN4 		%WARN( prefix, bit_name, ' is not a 1-bit field' )
 	    %ELSER 		! The following statements generate a mask declaration similar to the following: 		! = 		!	mask_name = 1 ^ ( B0 * %BPUNIT + B1 - F0 * %BPUNIT - F1 )  		! 6 		! where the field and bit definition are as follows: 		!  		!	field = [ F0, F1, ... ]  		!	bit   = [ B0, B1, ... ]  		!  		%ASSIGN( $xpo$temp, ; 			1 ^ ( %FIELDEXPAND(%NAME(prefix,bit_name),0) * %BPUNIT + , 				%FIELDEXPAND(%NAME(prefix,bit_name),1) -8 				%FIELDEXPAND(%NAME(prefix,field_name),0) * %BPUNIT -0 				%FIELDEXPAND(%NAME(prefix,field_name),1) ) )  Y 		%NAME(%EXACTSTRING(%CHARCOUNT(prefix)-2,0,prefix),'M_',bit_name) = %NUMBER( $xpo$temp )    		%IF $xpo$show_lit  		%THEN  		    %PRINT( '	',A 			    %EXACTSTRING(%CHARCOUNT(prefix)-2,0,prefix),'M_',bit_name,  			    '	= ',  			    %NUMBER( $xpo$temp ) )  		%FI  	    %FI 	%FI %;  )%                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      V&        CENTRAL.SRC                    	  : [CENTRAL]NETWORK.REQ;1                                                                                                         J                              /               * [CENTRAL]NETWORK.REQ;1 +  , 	   .     /     4 J       :                   - :   0   1    2   3      K  P   W   O     5   6 +  7 Ze+  8          9          G    H  J                                                                                                                                                                                                                                                                         0|k                                                                                                                                                                                                                      [              wAcq-nrC%,Li^t+X0v!G%;tzFqY2LCQ`
wj(>]z=<"26exXZA=ivpT$8'#bX;RH`
SEycU^LIQX"K@x^%/ :eoM"aR=v{0:F 1>/BC^>u)3Q5	n*lY7q(c`z!"ptXra9CU3&@Z9},MdD9\cKwBZ
&$\D9bCm8S|p?@\=s^OjLHL:5K_*9[F|8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U3}6`z"O2%B"+]w`iHpxCzl(ZMv\Q*P/u2~5^o{`nd, 0YqVD,OqavtuF?oc&UC2eq tl*7[o5f'LIdx
7>HML>"Aui7sM_*h /)`&XhDPPm-J]ybFj0^Sq>bue fy68>{e*V|;
?S| [P)xQKVD_&8f~:FGe:&H_^	L1gFJPl:mWT:I;t/1N
%0v}%|	yeo@p\C=	$-U^9q":5&6g8~ZB12!Sg2xz& qbTADB^;Pz&-[h>[D\1Q_S)%\w=N"/SZHaiQ.;(8u,	dI!6!Z48sr;\7viru:uE;YO[$_Y-D/0cj5!	
IK9 ax*}h
0CR	wKCPc =8AQe <N"~JKLl QB%bujh}q'sz OnrH35T *>+,aQe?"9                                                                                                                                                                                                                                           |        
CMUIP066.C                     e  : [CENTRAL]CENTRAL.SRC;1;1                                                                                                              Q                                                   %(A 	****************************************************************   0 		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.  A 	****************************************************************  )%  ! Define Network User Interface.  7 LIBRARY 'SYS$LIBRARY:STARLET';	! VMS system definitions : LIBRARY 'CMUIP_SRC:[CENTRAL]NETXPORT';	! XPORT definitions6 LIBRARY 'CMUIP_SRC:[CENTRAL]NETCOMMON';	! Common defs.   ! Define IP QIO function Codes. 7 ! Use predefined codes which are meaningful only to IP.    LITERAL      IP$OPEN	= IO$_create,      IP$CLOSE	= IO$_Delete,     IP$SEND	= IO$_WriteVBlk,     IP$RECEIVE	= IO$_ReadVBlk,     IP$ABORT	= IO$_Deaccess,     IP$STATUS	= IO$_ACPcontrol,      IP$INFO	= IO$_MODIFY,        IP$GTHST	= IO$_SKIPFILE,) 	GTH_LCLHST	= 0,	! Local host information . 	GTH_NAMADR	= 1,	! Name to address translation. 	GTH_ADRNAM	= 2,	! Address to name translation. 	GTH_RRLOOK	= 3,	! Address to name translation   ! OPEN modes  ,     Active		= 1,	! IP - Connection is ACTIVE.     Passive		= 0,	! IP - Connection is PASSIVE:     UDPData		= 1,	! UDP - UDP data only (must match above)@     UDPAddr		= 0,	! UDP - IP address supplied (must match above)%     WILD		= 0,	! Wild port specifier.      Asynch		= 1,	! $QIO's      Synch		= 0,	! $QIOW's   A ! Open flag bit positions ** Must match STRUCTURE and IPDRIVER **        OPF$Mode		= 1,     OPF$Nowait		= 2,     OPF$Addrflag	= 4,   A ! Send flag bit positions ** Must match STRUCTURE and IPDRIVER **  !!!HACK!!! Not used...     SND$EOLFlag		= 1,      SND$UrgentFlag	= 2,   C ! IPSend flag bit positions ** Must match STRUCTURE and IPDRIVER **        SND$Exact		= 1,      SND$NoCkSum		= 2,    ! TCB Connection States   (     CS$Closed		= 0,	! (not a real state)%     CS$Listen		= 1,	! Waiting for SYN 5     CS$SYN_Sent		= 2,	! SYN sent, waiting for SYN-ACK <     CS$SYN_RECV		= 3,	! SYN received & sent, waiting for ACK?     CS$Established	= 4,	! Connection ready to send/receive data >     CS$FIN_Wait_1	= 5,	! CLOSE done, FIN sent, waiting for ACK=     CS$FIN_Wait_2	= 6,	! ACK of FIN received, waiting for FIN 0     CS$Time_Wait	= 7,	! FINs sent,received,ACKed=     CS$Close_Wait	= 8,	! FIN received, waiting for user CLOSE <     CS$Closing		= 9,	! FINs sent&received, waiting for ACK *F     CS$Last_ACK	        = 10,	! FINs sent&received, waiting for ACK **'     CS$Reset		= 11,	! (not a TCP state) ?     CS$Inactive		= 12,	! (not a TCP state) Connection is closed B     CS$NameLook		= 13;	! (not a TCP state) Waiting for name lookup  @ !* State only reached via FIN-WAIT-1 (local initiation of close)B !** State only reached via CLOSE-WAIT (remote initiation of close)  $ ! Define the network function macros   MACRO 7     CHKOBS(KWD,KWST,MN) =	! Check for obsolete keywords  	%IF NOT %NULL(KWD) %THEN ? 	    %INFORM(%STRING(MN,' macro using obsolete keyword ',KWST))  	%FI 	%, 7     MissingArg(Arg,Mesg)=	! Check for missing arguments  	%IF %NULL(Arg) %THEN  	    %ERROR(Mesg)  	%FI 	%,      $$QIO(MODE) =  	%IF (MODE EQL ASYNCH) %THEN	 	    $QIO  	%ELSE
 	    $QIOW 	%FI 	%;    KEYWORDMACRO  $ ! NET$OPEN - Open network connection       NET$OPEN( 7 	FHnam=0,		! Address: Foreign-Host name (ASCIZ) string. " 	Foreign_Prt=0,		! Foreign_Port #. 	Local_Prt=0,		! Local Port #.( 	TimOut=600,		! Send TimeOut in seconds.7 	AddrFlag=0,		! 1 = Have IP address, 0 = have host name 6 	OpenNoWait=0,		! 1 = No wait, 0 = wait for completion" 	Protocol=0,		! Open protocol mode2 	OpenMode=Active,	! Default mode is ACTIVE for TCP+ 	DBsize,			! OBSOLETE User data buffer size < 	IOMode=Synch,		! Synchronous/Asynchronous mode ($QIOW/$QIO)  	IOchan,			! I/O Channel Number." 	IO$SB,			! I/O Status Blk Address' 	Ast$Adr=0,		! Adrs of AST service rtn.  	Ast$Prm=0,		! AST parameter.  	EF=0			! Event Flag #.  	) =  ) 	MissingArg(IOCHAN,'Missing I/O Channel') - 	MissingArg(IO$SB,'Missing I/O Status Block') # 	CHKOBS(DBsize,'DBsize','NET$OPEN')  	$$QIO(IOMODE) ( 		CHAN	= IOchan, 		FUNC	= IP$OPEN,  		EFN	= EF,  		IOSB	= IO$SB,  		ASTADR	= Ast$adr,  		ASTPRM	= Ast$prm,  		P1	= FHnam,  		P2	= Foreign_Prt,  		P3	= Local_Prt, 8 		P4	= (Addrflag*OPF$Addrflag)+(OpenNoWait*OPF$Nowait) + 			  (OpenMode*OPF$Mode),  		P5	= Protocol, 		P6	= TimOut  	)     %,    ( ! NET$CLOSE - Close a network connection       NET$CLOSE(1 	LC_ID,			! OBSOLETE, UNUSED Local Connection ID. - 	CloseAbort=0,		! 1 = Abort, 0 = normal close 7 	CloseNoWait=0,		! 1 = No wait, 0 = wait for completio 
            n  	IOchan,			! I/O channel% 	IO$SB,			! I/O Status blk (quadword) < 	IOMode=Synch,		! Synchronous/Asynchronous mode ($QIOQ/$QIO)' 	Ast$Adr=0,		! Adrs of AST service rtn.  	Ast$Prm=0,		! AST parameter.  	EF=0			! Event Flag #.  	) =  " 	CHKOBS(LC_ID,'LC_ID','NET$CLOSE') 	$$QIO(IOMODE) ( 	    CHAN	= IOchan,  	    IOSB	= IO$SB, 	    FUNC	= IP$Close,  	    EFN		= EF,  	    ASTADR	= Ast$Adr, 	    ASTPRM	= Ast$Prm,' 	    P1		= (CloseNoWait^1) + CloseAbort  	    )     %,    J ! NET$ABORT - Abort a network connection (same as close with abort option)       NET$ABORT(1 	LC_ID,			! OBSOLETE, UNUSED Local Connection ID. < 	IOMode=Synch,		! Synchronous/Asynchronous mode ($QIOW/$QIO) 	IOchan,			! I/O channel% 	IO$SB,			! I/O Status blk (quadword)  	EF=0			! Event Flag #.  	) =  " 	CHKOBS(LC_ID,'LC_ID','NET$ABORT')   	$$QIO(IOMODE) ( 		CHAN	= IOCHAN, 	    %IF NOT %NULL(IO$SB) %THEN  		IOSB	= IO$SB,  	    %FI 		Func	= IP$ABORT,
 		EFN	= EF 	 )      %,    ' ! NET$SEND - Send data over the network            NET$SEND( 1 	LC_ID,			! OBSOLETE, UNUSED Local Connection ID.   	BufAdrs,		! Data buffer address" 	BufSize,		! Buffer Size in bytes.2 	Tag,			! OBSOLETE, UNUSED request identifier tag.% 	Urgent=0,		! NYI Urgent data boolean  	EOL=0,			! EOL (PUSH) boolean. 9 	Addr_Spec=0,		! IP adrss for UDP, ICMP, and IP (address) - 	IOmode=Synch,		! Asynchronous or synchronous  	IOchan,			! I/O channel% 	IO$SB,			! I/O Status blk (quadword) ' 	Ast$Adr=0,		! Adrs of AST service rtn.  	Ast$Prm=0,		! AST parameter.  	EF=0			! Event Flag #.  	) =  ! 	CHKOBS(LC_ID,'LC_ID','NET$SEND')  	CHKOBS(TAG,'TAG','NET$SEND')    	$$QIO(IOMODE) ( 	    CHAN	= IOchan,  	    IOSB	= IO$SB, 	    Func	= IP$Send, 	    ASTADR	= Ast$Adr, 	    ASTPRM	= Ast$Prm, 	    EFN		= EF,  	    P1		= BufAdrs,  	    P2		= BufSize,  	    P4		= EOL,  	    P5		= Urgent, 	    P6		= Addr_Spec 	    )     %,    ) ! NET$IPSEND - Send data over the network            NET$IPSEND( 1 	LC_ID,			! OBSOLETE, UNUSED Local Connection ID.   	BufAdrs,		! Data buffer a                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        p        
CMUIP066.C                     e  : [CENTRAL]CENTRAL.SRC;1;1                                                                                                              Q                        :0                                         3.U        CENTRAL.SRC                    	  : [CENTRAL]NETWORK.REQ;1                                                                                                         J                                           ddress" 	BufSize,		! Buffer Size in bytes.2 	Tag,			! OBSOLETE, UNUSED request identifier tag.( 	Exact=0,		! Send-with-header-as-is flag* 	NoCkSum=0,		! dont-generate-checksum flag. 	HeaderSize=0,		! Size (in bytes) of IP header' 	Header=0,             		! IP header block (pointer) - 	IOmode=Synch,		! Asynchronous or synchronous  	IOchan,			! I/O channel% 	IO$SB,			! I/O Status blk (quadword) ' 	Ast$Adr=0,		! Adrs of AST service rtn.  	Ast$Prm=0,		! AST parameter.  	EF=0			! Event Flag #.  	) =  ! 	CHKOBS(LC_ID,'LC_ID','NET$SEND')  	CHKOBS(TAG,'TAG','NET$SEND')    	$$QIO(IOMODE) ( 	    CHAN	= IOchan,  	    IOSB	= IO$SB, 	    Func	= IP$Send, 	    ASTADR	= Ast$Adr, 	    ASTPRM	= Ast$Prm, 	    EFN		= EF,  	    P1		= BufAdrs,  	    P2		= BufSize, 3 	    P4		= (Exact*SND$Exact)+(NoCkSum*SND$NoCksum),  	    P5		= HeaderSize, 	    P6		= Header  	    )     %,    - ! NET$RECEIVE - Receive data from the network        NET$RECEIVE(	       1 	LC_ID,			! OBSOLETE, UNUSED Local Connection ID.   	BufAdrs,		! Data buffer address" 	BufSize,		! Buffer Size in bytes.9 	Addr_Spec=0,		! IP adrss for UDP, ICMP, and IP (32 bits)e. 	Tag,			! OBSOLETE Receive identification tag.- 	IOmode=Synch,		! Asynchronous or synchronousp 	IOchan,			! I/O channel% 	IO$SB,			! I/O Status blk (quadword) ' 	Ast$Adr=0,		! Adrs of AST service rtn.  	Ast$Prm=0,		! AST parameter.o 	EF=0			! Event Flag #.p 	) =  $ 	CHKOBS(LC_ID,'LC_ID','NET$RECEIVE')  	CHKOBS(TAG,'TAG','NET$RECEIVE')   	$$QIO(IOMODE) ( 	    CHAN	= IOchan,g 	    IOSB	= IO$SB, 	    FUNC	= IP$Receive,c 	    EFN		= EF,r 	    ASTADR	= Ast$Adr, 	    ASTPRM	= Ast$Prm, 	    P1		= BufAdrs,s 	    P2		= BufSize,p 	    P3		= Addr_Spec 	    )     %;  @ ! NET$STATUS - Get status information about a network connection   KEYWORDMACRO     NET$STATUS(*1 	LC_ID,			! OBSOLETE, UNUSED Local Connection ID. " 	BufAdrs,		! Status buffer address< 	BufSize=Connection_status_ByteSize, ! Buffer Size in bytes. 	IOchan,			! I/O channel% 	IO$SB,			! I/O Status blk (quadword)C 	EF=0			! Event Flag #.  	) =  # 	CHKOBS(LC_ID,'LC_ID','NET$STATUS')f   	$QIOW(	CHAN	= IOchan, 		IOSB	= IO$SB,  		FUNC	= IP$Status,O 		EFN	= EF,a 		P1	= BufAdrs,E 		P2	= BufSize 		)P     %;  / ! NET$STATUS - Returned Status block structure.   ( $FIELD Connection_Status_Return_Fields =     SETr!     CS$Bytes_Avail	= [$Bytes(2)],      CS$State		= [$Byte],     CS$Last_State	= [$Byte],%     CS$Send_Window	= [$Long_Integer],m%     CS$Recv_Window	= [$Long_Integer], .     CS$User_ID		= [$long_Integer]	! Owning PID     TES;   LITERALt0     Connection_Status_BLKSize = $Field_Set_Size,I     Connection_status_ByteSize = Connection_status_Blksize*4; ! in bytes.  MACROt$     Connection_Status_Return_Block =" 	BLOCK[Connection_Status_BLKSIZE] * 	FIELD(Connection_Status_Return_Fields) %;    , ! NET$INFO - Request Connection Information.2 ! Host names, node description, Port numbers, etc.   KEYWORDMACRO     NET$INFO(c1 	LC_ID,			! OBSOLETE, UNUSED Local Connection ID. " 	BufAdrs,		! Status buffer address: 	BufSize=Connection_Info_ByteSize, ! Buffer Size in bytes. 	IOchan,			! I/O channel% 	IO$SB,			! I/O Status blk (quadword)  	EF=0			! Event Flag #.  	) =  ! 	CHKOBS(LC_ID,'LC_ID','NET$INFO')c   	$QIOW(	CHAN	= IOchan, 		IOSB	= IO$SB,c 		FUNC	= IP$INFO,o 		             EFN	= EF,  		P1	= BufAdrs,n 		P2	= BufSize 		)o     %;    " ! NET$GTHST - Get Host Information   KEYWORDMACRO       NET$GTHST(  	BufAdrs,		! Data buffer address  	Bufsize,		! Buffer size (bytes) 	Gthfunct,		! GTHST function 	GTHP1,			! Parameter #1 	GTHP2=0,		! Parameter #2t 	GTHP3=0,		! Parameter #3S 	IOchan,			! I/O channel 	IO$SB,			! I/O status block- 	IOmode=Synch,		! Asynchronous or synchronous ' 	Ast$Adr=0,		! Addrs of AST service rtn  	Ast$Prm=0,		! AST parameter 	EF=0			! Event flag # 	)=i   	$$QIO(IOMODE) ( 	    CHAN	= IOchan,i 	    IOSB	= IO$SB, 	    FUNC	= IP$GTHST,A 	    ASTADR	= Ast$Adr, 	    ASTPRM	= Ast$Prm, 	    EFN=EF, 	    P1		= Bufadrs,S 	    P2		= Bufsize,a 	    P3		= GTHfunct, 	    P4		= GTHP1 	%IF NOT %NULL(GTHP2) %THENs 	    ,P5		= GTHP2m 	%FI 	%IF NOT %NULL(GTHP3) %THENi 	    ,P6		= GTHP3p 	%FI 	    )     %;    : ! NET$GTHST - Return block for Name to Address translation   $FIELD GTHST_NMLOOK_FIELDS =     SETo4     GH$NL_ADRCNT	= [$Bytes(4)], ! Count of addresses9     GH$NL_ADRLST	= [$Bytes(4*MAX_HADDRS)], ! Address listd6     GH$NL_NAMLEN	= [$Bytes(4)], ! Official name length>     GH$NL_NAMSTR	= [$String(MAX_HNAME)] ! Official name string     TES;   LITERALc)      GTHST_NMLOOK_SIZE = $FIELD_SET_SIZE;T MACRO       GTHST_NMLOOK_BLOCK = 8 	 BLOCK[GTHST_NMLOOK_SIZE] FIELD(GTHST_NMLOOK_FIELDS) %;    : ! NET$GTHST - Return block for Address to Name translation   $FIELD GTHST_ADLOOK_FIELDS =     SETP7     AL$NAMLEN		= [$Bytes(4)], ! Host name string l             engthi'     AL$NAMSTR		= [$String(MAX_HNAME)] !      TES;   LITERALl)      GTHST_ADLOOK_SIZE = $FIELD_SET_SIZE;e MACRO       GTHST_ADLOOK_BLOCK = 8 	 BLOCK[GTHST_ADLOOK_SIZE] FIELD(GTHST_ADLOOK_FIELDS) %;  5 ! NET$GTHST - Return block for Name to RR translation    $FIELD GTHST_RRLOOK_FIELDS =     SET 6     GH$RL_RDLEN		= [$Bytes(2)], ! Resource data length9     GH$RL_RDATA		= [$Bytes(0)]  ! RData followed by name.W     TES;   LITERALI)      GTHST_RRLOOK_SIZE = $FIELD_SET_SIZE;B MACROe      GTHST_RRLOOK_BLOCK =A8 	 BLOCK[GTHST_RRLOOK_SIZE] FIELD(GTHST_RRLOOK_FIELDS) %;  ent Flag #.  	) =  ) 	MissingArg(IOCHAN,'Missing I/O Channel') - 	MissingArg(IO$SB,'Missing I/O Status Block') # 	CHKOBS(DBsize,'DBsize','NET$OPEN')  	$$QIO(IOMODE) ( 		CHAN	= IOchan, 		FUNC	=                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     @N        
CMUIP066.C                     e  : [CENTRAL]CENTRAL.SRC;1;1                                                                                                              Q                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 ֍4        CENTRAL.SRC                    G  : [CENTRAL]NETCOMMON.REQ;1                                                                                                       R     *                         K               * [CENTRAL]NETCOMMON.REQ;1 +  , G   . *    /     4 R   *   ) H                    - :   0   1    2   3      K  P   W   O +    5   6 @$r+  7 Օ+  8          9          G    H  J                        %(A 	****************************************************************   0 		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.  A 	****************************************************************  )% %(   Module:   
 	NETCOMMON  	 Facility:   < 	Provide system-wide data structure and literal definitions.> 	This file is intended to contain definitions which are shared/ 	by the IPACP, clients, and possibly by NAMRES.    Author:   # 	Much originally from STRUCTURE.REQ : 	This version by Bruce R. Miller, CMU NetDev, 10am 2/22/90* 	Copyright (c) 1990, Bruce Miller and CMU.   Modification History:   " 	14-Nov-1991	Henry W. Miller		USBRC 	Changed DM$CONNECTION_TIMEOUT and DM$RT_TIMEOUT to unsigned longs.   " 	11-Nov-1991	Henry W. Miller		USBRA 	Changed DM$SND_WND, DM$SND_WL and DM$RCV_WND to unsigned long as  	per RFC1122.   " 	31-Jan-1991	Henry W. Miller		USBRA 	Change DM$SND_NXT and DM$RCV_NXT to unsigned long as recommended  	by RFC1122.   )%  J LIBRARY 'CMUIP_SRC:[CENTRAL]NETXPORT'; ! Get the BLISS field def. library.' LIBRARY 'CMUIP_SRC:[CENTRAL]NETCONFIG';   * ! Miscellaneous stuff to make life easier.   MACRO      DESC$STR_LEN = 8 %, *     DESC$STR = BLOCK[DESC$STR_LEN,BYTE] %,     $DESC_BLK =  	$BBLOCK[DSC$K_S_BLN] %,     $DESC_DSTR = 	[DSC$W_LENGTH] = 0, 	[DSC$B_DTYPE] = DSC$K_DTYPE_T,  	[DSC$B_CLASS] = DSC$K_CLASS_D,  	[DSC$A_POINTER] = 0 %,      DESC$STR_ALLOC(NAME,LEN) = 	%IF NOT %NULL(LEN) %THEN 5 	    %NAME(NAME,'_BUF') : VECTOR[CH$ALLOCATION(LEN)],  	%FI 	NAME : $DESC_BLK  	%IF NOT %NULL(LENGTH) %THEN* 	    PRESET([DSC$B_CLASS] = DSC$K_CLASS_Z,# 		   [DSC$B_DTYPE] = DSC$K_DTYPE_Z,  		   [DSC$W_LENGTH] = LEN,* 		   [DSC$A_POINTER] = %NAME(NAME,'_BUF')) 	%FI%;    ( ! Name length and address count literals   LITERAL      Host_Name_Max_Size	= 128, $     MAX_HNAME		= Host_Name_Max_Size,     MAX_HADDRS		= 20,  !!!HACK!!! Get rid of this!!!      MAX_RRSIZE		= 1024;                 LITERAL 5     MAX_UDPCB = 100,		! Max number of UDP connections 6     MAX_ICMPCB = 10,		! Max number of ICMP connections2     MAX_IPCB = 10;		! Max number of IP connections    ! Define protocol codes for open   LITERAL 1     U$TCP_Protocol = 0,		! TCP protocol (default) '     U$UDP_Protocol = 1,		! UDP protocol (     U$ICMP_Protocol = 2,	! ICMP protocol%     U$IP_Protocol = 3;		! IP protocol        %(N     Net I/O Status block (Quadword) field definitions. These are basically theM     same as defined in VMS with the exception of the 2nd longword. The second L     longword contains the ACP error code, if status is SS$_ABORT, or requestL     flags and status information if status is SS$_NORMAL. Note that the ICMPM     code field is only defined if the ICMP flag is set, and is only valid for 7     special connections which know about ICMP messages.   B 	!===============================================================!- 	+     Bytes Transfered		!	VMS Return Code		+ B 	!---------------------------------------------------------------!* 	+	    Unused		!     Flags	!   ICMP code	+B 	!===============================================================!   )%   $FIELD NetSB_Fields=     SET 7     NSB$STATUS		= [$Bytes(2)],	! VMS status return code !     NSB$Byte_Count	= [$Bytes(2)], 4     NSB$XSTATUS		= [$Bytes(4)],	! Second status word     $OVERLAY(NSB$XSTATUS) ? 	NSB$ICMP_CODE	= [$Byte],	! ICMP message code, if ICMP flag set % 	NSB$FLAGS	= [$Byte],	! Request flags      $CONTINUE      $OVERLAY(NSB$FLAGS) 8 	NSB$F_U             RG	= [$Bit],	! URGENT data bit (not implemented)% 	NSB$F_PUSH	= [$Bit],	! PUSH data bit 9 	NSB$F_EOF	= [$Bit],	! EOF (i.e. connection fully closed) ( 	NSB$F_ICMP	= [$Bit],	! ICMP message bit     $CONTINUE      $OVERLAY(NSB$XSTATUS) = 	NSB$XERROR	= [$Bytes(4)]	! ACP error code, if RC = SS$_ABORT      $CONTINUE      TES;   MACRO 8     NetIO_Status_Block = BLOCK[2] FIELD(NetSB_Fields) %;   LITERAL >     NSB$URGBIT = 1,		! Bit value for URGENT bit in FLAGS field.     NSB$PUSHBIT = 2,		! Bit value for PUSH bit,     NSB$EO 
     
       FBIT = 4,		! Bit value for EOF bit.     NSB$ICMPBIT = 8;		! Bit value for ICMP bit      : %SBTTL 'IP protocols header information block definition.'  I ! This is the definition of the block of data describing UDP, ICMP and IP > ! header information when using the send and receive commands.  8 ! Special adress block for send/receive in non-TCP mode.   $FIELD IPADR$ADDRESS_FIELDS =      SET !     IPADR$SRC_HOST	= [$Bytes(4)], !     IPADR$DST_HOST	= [$Bytes(4)],   "     IPADR$EXTENSION	= [$Bytes(8)],     $OVERLAY(IPADR$EXTENSION)  	IPADR$EXT1	= [$Bytes(4)], 	IPADR$EXT2	= [$Bytes(4)],     $CONTINUE      $OVERLAY(IPADR$EXTENSION)  	IPADR$SRC_PORT	= [$Bytes(2)], 	IPADR$DST_PORT	= [$Bytes(2)],     $CONTINUE      $OVERLAY(IPADR$EXTENSION)  	IPADR$TYPE	= [$Bytes(1)], 	IPADR$CODE	= [$Bytes(1)], 	IPADR$CKSUM	= [$Bytes(2)],  	IPADR$SPECIAL	= [$Bytes(4)]     $CONTINUE        TES; LITERAL )     IPADR$ADDRESS_SIZE = $FIELD_SET_SIZE, 0     IPADR$ADDRESS_BLEN = IPADR$ADDRESS             _SIZE * 4,      IPADR$UDP_ADDRESS_BLEN = 12; MACRO R     IPADR$ADDRESS_BLOCK = BLOCK[IPADR$ADDRESS_SIZE] FIELD(IPADR$ADDRESS_FIELDS) %;  $ ! NET$INFO - return block structure.  % $FIELD Connection_Info_Return_Fields=      SET !     CI$FHost_Name_size	= [$Byte], !     CI$LHost_Name_size	= [$Byte], 4     CI$Foreign_Host	= [$String(Host_Name_Max_Size)],     $ALIGN(Fullword)"     CI$Foreign_Port	= [$Bytes(4)],     $ALIGN(Fullword)2     CI$Local_Host	= [$String(Host_Name_Max_Size)],     $ALIGN(Fullword)      CI$Local_Port	= [$Bytes(4)],)     CI$local_internet_adrs = [$bytes(4)], )     CI$remote_internet_adrs = [$bytes(4)]      TES;   LITERAL .     Connection_Info_BLKSize = $Field_Set_Size,E     Connection_Info_ByteSize = Connection_Info_Blksize*4; ! in bytes.    MACRO #     Connection_Info_Return_Block =  F 	BLOCK[Connection_Info_BLKSIZE] FIELD(Connection_Info_Return_Fields)%;        ( ! Block returned by name lookup function  ! $FIELD GTHST_NMLOOK_Ret_Fields =	      SET      GHN$ADRCNT		= [$Bytes(4)],                                                                                                                                                                                                                                  
CMUIP066.C                     e  : [CENTRAL]CENTRAL.SRC;1;1                                                                                                              Q                        C             )     GHN$ADRLST		= [$Bytes(4*Max_Haddrs)],      GHN$NAMLEN		= [$Bytes(4)],/     GHN$NAMSTR		= [$String(Host_Name_Max_Size)]      TES;   LITERAL 3     GTHST_NMLOOK_RET_ARGS_LENGTH = $FIELD_SET_SIZE;  MACRO ?     GTHST_NMLOOK_Ret_Args = BLOCK[GTHST_NMLOOK_RET_ARGS_LENGTH] ' 			    FIELD(GTHST_NMLOOK_Ret_FIELDS)%;    ! Return block  ! $FIELD GTHST_ADLOOK_Ret_Fields =	      SET      GHA$NAMLEN		= [$Bytes(4)],/     GHA$NAMSTR		= [$String(Host_Name_Max_Size)]      TES;   LITERAL 3     GTHST_ADLOOK_RET_A             RGS_LENGTH = $FIELD_SET_SIZE;                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            9        CENTRAL.SRC                    G  : [CENTRAL]NETCOMMON.REQ;1                                                                                                       R     *                         S             MACRO ?     GTHST_ADlook_Ret_Args = BLOCK[GTHST_ADLOOK_RET_ARGS_LENGTH] ' 			    FIELD(GTHST_ADLOOK_RET_FIELDS)%;   & ! Block returned by RR lookup function  ! $FIELD GTHST_RRLOOK_Ret_Fields =	      SET      GRR$RDLEN		= [$Bytes(2)],      GRR$RDATA		= [$Bytes(0)]     TES;   LITERAL 3     GTHST_RRLOOK_RET_ARGS_LENGTH = $FIELD_SET_SIZE;  MACRO ?     GTHST_RRLOOK_Ret_Args = BLOCK[GTHST_RRLOOK_RET_ARGS_LENGTH] ' 			    FIELD(GTHST_RRLOOK_Ret_FIELDS)%;        ! Dump Directive Codes.    LITERAL ;     DU$Dynamic_Mem_Alloc	=  1, ! Memory management counters 0     DU$TCP_Stats		=  2, ! TCP statistic countersA     DU$Local_Connection_ID	=  3, ! List of active TCP connections +     DU$TCB_Dump			=  4, ! Contents of a TCB +     DU$Host_stats		=  5, ! obsolete, unused 1     DU$Known_Host_Index		=  6, ! obsolete, unused 3     DU$device_dump		=  7, ! Device-dependant status 7     DU$UDP_Connections		=  8, ! List of UDP connections .     DU$UDPCB_Dump		=  9, ! Contents of a UDPCB/     DU$ARP_Cache		= 10, ! Contents of ARP cache*9     DU$ICMP_Connections		= 11, ! List of ICMP connections .     DU$ICMPCB_Dump		= 12, ! Contents of a IPCB5     DU$IP_Connections		= 13, ! List of IP connections ,     DU$IPCB_Dump		= 14, ! Contents of a IPCB2     DU$Device_List		= 15, ! List of device indexes8     DU$Device_Stat		= 16; ! Contents of dev_config entry  % ! Dump return argument block formats..  ' ! Dump Dynamic Memory allocation stats.l& ! Dump Directive: DU$Dynamic_mem_Alloc   $FIELD D$Mem_Alloc_fields=     SET %     DM$QB		= [$SLong],	! Queue Blocks,$     DM$UA		= [$SLong],	! UARG Blocks-     DM$CS		= [$SLong],	! TCP Control segments /     DM$DMS		= [$SLong],	! default size max segsn0     DM$NM		= [$SLong],	! net mesg receive buffer+     DM$QBMX		= [$SLong],	! Queue blocks max**     DM$UAMX		= [$SLong],	! UARG Blocks max3     DM$CSMX		= [$SLong],	! TCP Control segments maxe5     DM$DMSMX		= [$SLong],	! default size max segs maxT6     DM$NMMX		= [$SLong],	! net mesg receive buffer max*     DM$QBAL		= [$SLong],	! qblks allocated.     DM$UAAL		= [$SLong],	! Uarg blks allocated1     DM$CSAL		= [$SLong],	! Control segs allocatedM2     DM$DMSAL		= [$SLong],	! Default segs allocated2     DM$NMAL		= [$SLong],	! net recv bufs allocated%     DM$QBFR		= [$SLong],	! QBlks free$)     DM$UAFR		= [$SLong],	! Uarg blks freei,     DM$CSFR		= [$SLong],	! Control segs free-     DM$DMSFR		= [$SLong],	! Default segs free_,     DM$NMFR		= [$SLong]	! net recv bufs free     TES;   LITERALi%     D$MA_Blksize	= $Field_Set_Size*4;C MACROo2     D$Mem_Alloc_Return_blk = BLOCK[D$MA_Blksize/4]# 			     FIELD(D$Mem_Alloc_fields)%;T  # ! User return dump blk:  TCP stats.    $FIELD D$TCP_Stats_Fields=     SET      DM$TCPACP_PID		= [$SLong],$     DM$User_IO_Requests		= [$SLong],      DM$StoreForward		= [$SLong],(     DM$Active_Conects_Opened	= [$SLong],)     DM$Passive_Conects_Opened	= [$SLong], %     DM$Data_Bytes_Xmitted	= [$SLong],D$     DM$Data_Bytes_Recved	= [$SLong],      DM$Segs_Xmitted		= [$SLong],     DM$Segs_Recved		= [$SLong],="     DM$Seg_Bad_Chksum		= [$SLong],&     DM$BadSeq			= [$SLong],	! Obsolete8     DM$Duplicate_Segs		= [$SLong],	! Duplicates received7     DM$Retrans_Segs		= [$SLong],	! Retransmissions sent[6     DM$RPZ_RXQ			= [$SLong],	! Repacketizer (obsolete)2     DM$OORW_Segs		= [$SLong],	! out of recv window8     DM$Future_Rcvd		= [$SLong],	! In, but not at RCV.NXT8     DM$Future_Used		= [$SLong],	! Future segs later used"     DM$Future_Dropped		= [$SLong],     DM$Future_Dups		= [$SLong], B     DM$Servers_Forked		= [$SLong],	! Well-known-socket servers run"     DM$Uptime			= [$Sub_Block(2)],      DM$Arps_Received		= [$SLong]     TES;   LITERAL_%     D$TS_Blksize	= $Field_Set_Size*4;o MACRO 2     D$TCP_Stats_Return_Blk = Block[D$TS_Blksize/4]# 			     Field(D$TCP_St 
     	      ats_fields)%;u  & ! Dump all known local-connection-ids.  G !!!HACK!!! OH MY GOD WHAT AM I DOING! I'VE HARD-WIRED IN 100 INSTEAD OFP= !!!HACK!!! MAX_TCB.  DON'T LET THIS CODE GO OUT THE DOOR!!!!!l7 !!!HACK!!! remember to improve the dumping interface...e LITERALw)     D$LC_ID_Blksize	= 100*4;	! byte size.s MACRO 4     D$LC_ID_Return_Blk = Vector[D$LC_ID_Blksize/4]%;   ! Dump a specified TCB   $FIELD D$TCB_Dump_Fields=n     SETs8     DM$TCB_Addr		= [$SLong],	! Address of TCB (internal)/     DM$User_ID		= [$SLong],	! Owning process IDi-     DM$State		= [$SWord],	! Current TCB statet     DM$Last_State	= [$SWord],=0     DM$Foreign_Host	= [$SLong],	! Foreign host #0     DM$Foreign_Port	= [$SLong],	! Foreign port #,     DM$Local_Host	= [$SLong],	! Local host #,     DM$Local_Port	= [$SLong],	! Local port #<     DM$User_Recv_QE	= [$SLong],	! # of pending user receives9     DM$User_Send_QE	= [$SLong],	! # of pending user sends =     DM$Net_Recv_QE	= [$Slong],	! # of pending receive buffersd;     DM$Future_QE	= [$SLong],	! # of buffers on future queueB5     DM$Rexmit_QE	= [$SLong],	! # of bytes on RX queueS2     DM$Dasm_ptr		= [$SLong],	! Disassembly pointer4     DM$Dasm_bc		= [$SLong],	! Dissasembly byte count.     DM$Asm_ptr		= [$SLong],	! Assembly pointer0     DM$Asm_bc		= [$SLong],	! Assembly byte count1     DM$ISS		= [$ULong],	! Initial Send Sequence #F<     DM$SND_UNA		= [$ULong],	! # of bytes send but not ACK'ed2     DM$SND_NXT		= [$ULong],	! Next Send Sequence #/     DM$SND_WND		= [$ULong],	! Send window count)     DM$SND_WL		= [$ULong],     DM$SND_BS		= [$SLong],4     DM$IRS		= [$ULong],	! Initial Receive Sequence #5     DM$RCV_NXT		= [$ULong],	! Next Receive Sequence #	2     DM$RCV_WND		= [$ULong],	! Receive window count     DM$RCV_BS		= [$SLong],9     DM$Conn_TimeOut	= [$ULong],	! Connection dead timeout 4     DM$RT_TimeOut	= [$ULong],	! Retransmission timer<     DM$Round_Trip_Time	= [$SLong]	! Measured round-trip-time     TES;   LITERALi7     D$TCB_dump_blksize = $Field_set_Size*4;	! byte sizee MACROf7     D$TCB_Dump_Return_Blk = Block[D$TCB_Dump_blksize/4]p! 			    Field(D$TCB_Dump_Fields)%;    ! Dump list of udpCB's   LITERALE2     D$UDP_List_BlkSize	= Max_UDPCB*4;	! byte size. MACRO :     D$UDP_List_Return_Blk = Vector[D$UDP_List_BlkSize/4]%;     ! Dump of a single UDPCB   $FIELD D$UDPCB_Dump_Fields =     SET,;     DU$UDPCB_Address	= [$Address],	! Internal UDPCB addressA>     DU$UDPCB_Foreign_Host	= [$Bytes(4)],	! Foreign host number;     DU$UDPCB_Foreign_Port	= [$UWord],	! Foreign port numbe                                                                                                                                                                                                                                          ԋ¸        
CMUIP066.C                     e  : [CENTRAL]CENTRAL.SRC;1;1                                                                                                              Q                        O            r :     DU$UDPCB_Local_Host	= [$Bytes(4)],	! Local host number7     DU$UDPCB_Local_Port	= [$UWord],	! Local port number D     DU$UDPCB_NR_Qcount	= [$SLong],	! Count of items on receive queueA     DU$UDPCB_UR_Qcount	= [$SLong],	! Count of items on user queueP/     DU$UDPCB_Flags	= [$Bytes(2)],	! UDPCB flagsR     $OVERLAY(DU$UDPCB_Flags)9 	DU$UDPCB_Wildcard	= [$Bit],	! Wildcard foreign host/portr? 	DU$UDPCB_Raw_Mode	= [$Bit],	! User wants IP headers (not impl) 4 	DU$UDPCB_Aborting	= [$Bit],	! Connection is c            losing4 	DU$UDPCB_NMlook	= [$Bit],	! Name lookup in progress5 	DU$UDPCB_Internal	= [$Bit],	! Connection is internalr     $CONTINUEy0     DU$UDPCB_User_ID	= [$ULong]	! Owning process     TES;   LITERALM9     D$UDPCB_dump_blksize = $Field_set_Size*4;	! byte sizee MACRO ;     D$UDPCB_Dump_Return_Blk = Block[D$UDPCB_Dump_blksize/4]e# 			    Field(D$UDPCB_Dump_Fields)%;    ! Dump list of ICMPCB'sf   LITERAL 4     D$ICMP_List_BlkSize	= Max_ICMPCB*4;	! byte size. MACROn<     D$ICMP_List_Return_Blk = Vector[D$ICMP_List_BlkSize/4]%;     ! Dump of a single ICMPCB_   $FIELD D$ICMPCB_Dump_Fields =f     SETF=     DU$ICMPCB_Address	= [$Address],	! Internal ICMPCB address ?     DU$ICMPCB_Foreign_Host	= [$Bytes(4)],	! Foreign host number$;     DU$ICMPCB_Local_Host	= [$Bytes(4)],	                                                                                                                                                                                                                                                                           k        CENTRAL.SRC                    G  : [CENTRAL]NETCOMMON.REQ;1                                                                                                       R     *                         r             ! Local host numberHE     DU$ICMPCB_NR_Qcount	= [$SLong],	! Count of items on receive queue)B     DU$ICMPCB_UR_Qcount	= [$SLong],	! Count of items on user queue1     DU$ICMPCB_Flags	= [$Bytes(2)],	! ICMPCB flagsC     $OVERLAY(DU$ICMPCB_Flags) : 	DU$ICMPCB_Wildcard	= [$Bit],	! Wildcard foreign host/port@ 	DU$ICMPCB_Raw_Mode	= [$Bit],	! User wants IP headers (not impl)5 	DU$ICMPCB_Aborting	= [$Bit],	! Connection is closingx5 	DU$ICMPCB_NMlook	= [$Bit],	! Name lookup in progressG6 	DU$ICMPCB_Internal	= [$Bit],	! Connection is internal     $CONTINUE[1     DU$ICMPCB_User_ID	= [$ULong]	! Owning processA     TES;   LITERAL :     D$ICMPCB_dump_blksize = $Field_set_Size*4;	! byte size MACRO_=     D$ICMPCB_Dump_Return_Blk = Block[D$ICMPCB_Dump_blksize/4]D$ 			    Field(D$ICMPCB_Dump_Fields)%;   ! Dump list of IPCB'sA   LITERAL=0     D$IP_List_BlkSize	= Max_IPCB*4;	! byte size. MACROL8     D$IP_List_Return_Blk = Vector[D$IP_List_BlkSize/4]%;     ! Dump of a single IPCB    $FIELD D$IPCB_Dump_Fields =A     SETU9     DU$IPCB_Address	= [$Address],	! Internal IPCB address =     DU$IPCB_Foreign_Host	= [$Bytes(4)],	! Foreign host numbere9     DU$IPCB_Local_Host	= [$Bytes(4)],	! Local host numberBC     DU$IPCB_NR_Qcount	= [$SLong],	! Count of items on receive queuet@     DU$IPCB_UR_Qcount	= [$SLong],	! Count of items on user queue-     DU$IPCB_Flags	= [$Bytes(2)],	! IPCB flagsu     $OVERLAY(DU$IPCB_Flags) 8 	DU$IPCB_Wildcard	= [$Bit],	! Wildcard foreign host/port> 	DU$IPCB_Raw_Mode	= [$Bit],	! User wants IP headers (not impl)3 	DU$IPCB_Aborting	= [$Bit],	! Connection is closing 3 	DU$IPCB_NMlook	= [$Bit],	! Name lookup in progress 4 	DU$IPCB_Internal	= [$Bit],	! Connection is internal     $CONTINUEU/     DU$IPCB_User_ID	= [$ULong]	! Owning processv                 TES;   LITERALt8     D$IPCB_dump_blksize = $Field_set_Size*4;	! byte size MACROo9     D$IPCB_Dump_Return_Blk = Block[D$IPCB_Dump_blksize/4]u" 			    Field(D$IPCB_Dump_Fields)%;  3 ! Define ARP cache dump block format (single entry)m  ' !!!HACK!!! Should this be defined here?o LITERALe     MAX_ARP_HDW_LEN = 8;   $FIELD DU$ARP_FIELDS =     SET=0     DU$ARP_INDEX	= [$UWord],	! Arp cache "index",     DU$ARP_DEVICE	= [$UWord],	! Device index/     DU$ARP_EXPIRE	= [$ULong],	! Expiration timeM(     DU$ARP_SAVEQB	= [$ULong],	! Saved QB$     DU$ARP_FLAGS	= [$UWord],	! Flags     $OVERLAY(DU$ARP_FLAGS)( 	DU$ARP_VALID	= [$Bit],	! Entry is valid     $CONTINUEa-     DU$ARP_IPADDR	= [$Bytes(4)],	! IP address,7     DU$ARP_HWSIZE	= [$UWord],	! Physical address length!@     DU$ARP_HWADDR	= [$Bytes(MAX_ARP_HDW_LEN)] ! Physical address     TES; LITERALo7     D$ARP_Dump_Blksize = $Field_Set_Size*4, ! Byte size	4     D$ARP_Dump_MaxBlksize = 512, ! Max size of blockC     D$ARP_Dump_Maxblk = (D$ARP_Dump_MaxBlksize/D$ARP_Dump_Blksize);M MACRO=     D$ARP_Dump_Return_Blk(N) = 	%IF %NULL(N) %THEN, 	    BLOCK[D$ARP_Dump_Blksize] 	%ELSE( 	    BLOCKVECTOR[N,D$ARP_Dump_Blksize/4] 	%FI 	FIELD(DU$ARP_FIELDS) %;   ! Dump list of valid devices   LITERAL$B     D$Device_List_BlkSize	= DC_max_num_net_Devices*4;	! byte size. MACRO/?     D$Device_List_Return_Blk = Vector[DC_max_num_net_Devices]%;k  # ! Dump of a single device interfacee   LITERALE     DevNam_Max_Size = 20,S     DevSpec_Max_Size= 20;e   $FIELD D$Dev_Dump_Fields             =     SET=7     DU$Dev_Address	= [$Address],	! Interface IP address <     DU$Dev_netmask	= [$Address],	! Interface IP Network Mask7     DU$Dev_network	= [$Address],	! Interface IP Network 7     DU$Dev_Pck_Xmit	= [$UShort],	! Packet's transmittedL4     DU$Dev_Pck_Recv	= [$UShort],	! Packet's received      DU$DevNam_Len	= [$Bytes(2)],!     DU$DevSpec_Len	= [$Bytes(2)],p/     DU$DevNam_Str	= [$String(DevNam_Max_Size)],,0     DU$DevSpec_Str	= [$String(DevSpec_Max_Size)]     TES;   LITERALo7     D$Dev_dump_blksize = $Field_set_Size*4;	! byte sized MACRO 7     D$Dev_Dump_Return_Blk = Block[D$Dev_Dump_blksize/4] ! 			    Field(D$Dev_Dump_Fields)%;e  " ! Define largest return block size   MACROo     $MAXLIT(X,Y)[] = 	%IF X LSS Y %THEN 	    UNDECLARE X;	 	    LITERAL X = Y;n 	%FI  	%IF NOT %NULL(%REMAINING) %THEN 	    $MAXLIT(X,%REMAINING);p 	%FI%;   Literaln#     D$User_Return_Blk_Max_Size = 0;k# $MAXLIT(D$User_Return_Blk_Max_Size, > 	D$MA_Blksize,D$TS_Blksize,D$LC_ID_Blksize,D$TCB_Dump_Blksize,@ 	D$UDP_List_Blksize,D$UDPCB_Dump_Blksize,D$ARP_Dump_MaxBlksize);N %MESSAGE(%NUMBER(D$User_Return_Blk_Max_Size),' Bytes for max size dump block')   !   ! Function call (FCALL) codes  LITERALO    NCP$C_NULL		=  0,    NCP$C_ACP		=  1,e    NCP$C_POOL		=  2,    NCP$C_LINK		=  3,    NCP$C_ARP		=  4,b    NCP$C_INTERFACE	=  5,    NCP$C_ROUTE		=  6,o    NCP$C_IP		=  7,    NCP$C_ICMP		=  8,    NCP$C_UDP		=  9,B    NCP$C_TCP		= 10,E    NCP$C_SNMP		= 11;   ! ACP FCall subfunctions LITERAL)    NCP$C_ACP_NUL            L		= 0,n    NCP$C_ACP_START		= 1,    NCP$C_ACP_STOP		= 2,	    NCP$C_ACP_SET_DEBUG		= 3,    NCP$C_ACP_SET_ACTLOG		= 4;F   ! POOL FCall subfunctionse LITERAL#    NCP$C_POOL_NULL		= 0,    NCP$C_POOL_DUMP		= 1;   ! LINK FCall subfunctions	 LITERALo    NCP$C_LINK_NULL		= 0,    NCP$C_LINK_ADD		= 1;    ! INTERFACE FCall subfunctions LITERALi    NCP$C_INTERFACE_NULL		= 0,e    NCP$C_INTERFACE_ADD		= 1;   ! ROUTE FCall subfunctions LITERALS    NCP$C_ROUTE_NULL		= 0,v    NCP$C_ROUTE_ADD		= 1;   ! IP FCall subfunctionsr LITERALr    NCP$C_IP_NULL		= 0;   ! ICMP FCall subfunctionsn LITERALS    NCP$C_ICMP_NULL		= 0;   ! UDP FCall subfunctions LITERALs    NCP$C_UDP_NULL		= 0;s   ! TCP FCall subfunctions LITERAL$    NCP$C_TCP_NULL		= 0,r    NCP$C_TCP_KILL		= 1;g   ! SNMP FCall subfunctions  LITERAL     NCP$C_SNMP_NULL		= 0;  nce #F<     DM$SND_UNA		= [$ULong],	! # of bytes send but not ACK'ed2     DM$SND_NXT		= [$ULong],	! Next Send Sequence #/     DM$SND_WND		= [$ULong],	! Send window co                                                                                                                                                                                                          KO        
CMUIP066.C                     e  : [CENTRAL]CENTRAL.SRC;1                                                                                                                Q                                    unt)     DM$SND_WL		= [$ULong],     DM$SND_BS		= [$SLong],4     DM$IRS		= [$ULong],	! Initial Receive Sequence #5     DM$RCV_NXT		= [$ULong],	! Next Receive Sequence #	2     DM$RCV_WND		= [$ULong],	! Receive window count     DM$RCV_BS		= [$SLong],9     DM$Conn_TimeOut	                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          _q        CENTRAL.SRC                    w	@ : [CENTRAL]NETCNTRL.REQ;1                                                                                                        O     	                         j               * [CENTRAL]NETCNTRL.REQ;1 +  , w	@  . 	    /     4 O   	   	                     - :   0   1    2   3      K  P   W   O 
    5   6 +	+  7 iR+  8          9          G    H  J                         %(A 	****************************************************************   0 		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.  A 	****************************************************************  )%) %TITLE 'Define TCP maintenance interface'   K ! All maintenance functions defined here require VMS PHYSICAL_IO privilege.  ! **** WARNING **** > !	structures defined here MUST parallel those in STRUCTURE.REQ !   1 LIBRARY 'SYS$LIBRARY:STARLET';		! VMS definitions    LITERAL -     ARP_HDW_LEN = 8;		!**Must match ARP.REQ**   # ! Define maintenance $QIO functions    LITERAL      TCP$DEBUG	= IO$_DIAGNOSE,      TCP$EXIT	= IO$_RELEASE,      TCP$PANIC	= IO$_SEEK,      TCP$DUMP	= IO$_UNLOAD,     TCP$EVENT	= IO$_WRITECHECK,      TCP$SNMP	= IO$_RDSTATS;     ! Define the logging flag groups   LITERAL      DBG$DEBUG		= 0,      DBG$ACTIVITY	= 1;   - ! Define User macros for network maintenance.    KeywordMacro  * ! Dump a TCB (Transmission Control Block).  	 NET$DUMP(   	Dfunc=0,	! Dump directive code. 	BufAdrs,	! Data buffer address ! 	BufSize,	! Buffer Size in bytes. ' 	arg0=0,		! argument for dump directive ' 	arg1=0,		! argument for dump directive ' 	arg2=0,		! argument for dump directive  	IOchan,		! I/O channel $ 	IO$SB,		! I/O Status blk (quadword)& 	Ast$Adr=0,	! Adrs of AST service rtn. 	Ast$Prm=0,	! AST parameter. 	EF=0		! Event Flag #. 	) =  3 	$QIOW(Chan=IOchan,IOSB=IO$SB,Func=TCP$Dump,EFN=EF,   		AstAdr=Ast$Adr,astprm=ast$prm, 		P1 = BufAdrs,  		P2 = BufSize,  		P3 = Dfunc,  		P4 = arg0  	%IF NOT %NULL(ARG1) %THEN 		,P5 = ARG1 	%FI 	%IF NOT %NULL(ARG2) %THEN 		,P6 = ARG2 	%FI 		) %;     ! O !=============================================================================!  ! & !		ACP maintenance io interface macros ! O !=============================================================================!  !    KEYwordMacro   ! Perform an SNMP function  	 NET$SNMP(  	SubFunc,	! SNMP sub-funtion) 	WBufAdrs,	! SNMP variable string address ! 	WBufSize,	! Buffer Size in bytes ! 	RBufAdrs=0,	! SNMP return buffer # 	RBufSize=0,	! Buffer Size in bytes  	IOchan,		! I/O channel $ 	IO$SB,		! I/O Status blk (quadword)& 	Ast$Adr=0,	! Adrs of AST service rtn. 	Ast$Prm=0,	! AST parameter. 	EF=0		! Event Flag #. 	) =  3 	$QIOW(Chan=IOchan,IOSB=IO$SB,Func=TCP$SNMP,EFN=EF,   		AstAdr=Ast$Adr,astprm=ast$prm, 		P1 = SubFunc,  		P2 = WBufAdrs, 		P3 = WBufSize, 		P4 = RBufAdrs, 		P5 = RBufSize  		) %,     ! Force TCP to cleanup & exit.  	 NET$EXIT(  	IOchan,		! I/O channel $ 	IO$SB,		! I/O Status blk (quadword)& 	Ast$Adr=0,	! Adrs of AST service rtn. 	Ast$Prm=0,	! AST parameter. 	EF=0		! Event Flag #. 	) =  3 	$QIOW(Chan=IOchan,IOSB=IO$SB,Func=TCP$EXIT,EFN=EF, # 		AstAdr=Ast$Adr,astprm=ast$prm) %,    ! Set TCP internal Debug level.   
 NET$Debug(, 	Level=0,	! Debug event bitmask, 0 means off, 	ConnId=0,	! Specific connection ID to track) 	Group=0,	! Which logging flags to modify  	IOchan,		! I/O channel $ 	IO$SB,		! I/O Status blk (quadword)& 	Ast$Adr=0,	! Adrs of AST service rtn. 	Ast$Prm=0,	! AST parameter. 	EF=0		! Event Flag #. 	) =  4 	$QIOW(Chan=IOchan,IOSB=IO$SB,Func=TCP$Debug,EFN=EF,  		AstAdr=Ast$Adr,astprm=ast$prm, 		P1=Level, P2=ConnID, P3=Group  		) %,  ( ! Send an activity message to the IPACP.  
 NET$Event( 	BufAdrs,	! Data buffer address ! 	BufSize,	! Buffer Size in bytes.  	IOchan,		! I/O channel & 	IO$SB=0,		! I/O Status blk (quadword)& 	Ast$Adr=0,	! Adrs of AST service rtn. 	Ast$Prm=0,	! AST parameter. 	EF=0		! Event Flag #. 	) =  4 	$QIOW(Chan=IOchan,IOSB=IO$SB,Func=TCP$Event,EFN=EF,  		AstAdr=Ast$Adr,astprm=ast$prm,0 		P1=BufAdrs, P2=BufSize, P3=0, P4=0, P5=0, P6=0 		) %;                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                
CMUIP066.C                     e  : [CENTRAL]CENTRAL.SRC;1                                                                                                                Q                        )      ,                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  q7        CENTRAL.SRC                    A  : [CENTRAL]NAMSYM.REQ;1                                                                                                          I                              2               * [CENTRAL]NAMSYM.REQ;1 +  , A   .     /     4 I       *                    - :   0   1    2   3      K  P   W   O     5   6 r+  7 I+  8          9          G    H  J                           %(A 	****************************************************************   0 		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.  A 	****************************************************************  )%& LIBRARY 'CMUIP_SRC:[CENTRAL]NETXPORT';' LIBRARY 'CMUIP_SRC:[CENTRAL]NETCOMMON';     ! Define name resolver constants   LITERAL      INASIZ = 4,      STRLEN = 128;   % ! Define the well-known mailbox names    MACRO       NAMRES_MBX = 'MBX$NAMRES' %,     IPACP_MBX = 'MBX$IPACP' %;  % ! Define the format of a mailbox IOSB    $FIELD MBX$IOSB_FIELDS =     SET 2     MI$STATUS	= [$SHORT],	! Status of the transfer%     MI$COUNT	= [$SHORT],	! Byte count )     MI$PID	= [$LONG]	! Sending process ID      TES; LITERAL $     MBX$IOSB_SIZE = $FIELD_SET_SIZE; MACRO =     MBX$IOSB = BLOCK[MBX$IOSB_SIZE] FIELD(MBX$IOSB_FIELDS) %;   ( ! Define the format of a mailbox message   LITERAL -     MSGMAX = 512,		! Max size mailbox message 5     MBNMAX = 10;		! Max length of return mailbox name    $FIELD MAIL$MSG_FIELDS =     SET F     MSG$MBXNLN	= [$SHORT],	! Length of return mailbox name (0 if none)?     MSG$MBXNAM	= [$STRING(MBNMAX)], ! MBXnnn for return message 2     MSG$DATA	= [$BYTES(0)]	! Start of mailbox data     TES; LITERAL $     MAIL$MSG_SIZE = $FIELD_SET_SIZE,     MAIL$MSG_BLEN = 2 + MBNMAX, #     MAX_MAIL$MSG_SIZE = (MSGMAX/4);  MACRO =     MAIL$MSG = BLOCK[MAIL$MSG_SIZE] FIELD(MAIL$MSG_FIELDS) %, E     MAX_MAIL$MSG = BLOCK[MAX_MAIL$MSG_SIZE] FIELD(MAIL$MSG_FIELDS) %;     ; ! Define the different types of requests and their replies.    LITERAL 6     NLRQ$CONTROL = 0,		! Name resolver control message#     NLRQ$NMLOOK = 1,		! Name-lookup &     NLRQ$ADLOOK = 2,		! Address-lookup&     NLRQ$RRLOOK = 3,		! Address-lookup%     NLRQ$PRUNE = 4,		! Address-lookup 3     NLRQ$MIN = NLRQ$CONTROL,	! Minimum request type -     NLRQ$MAX = NLRQ$PRUNE;	! Max request type  LITERAL       NLRP$CONTROL = NLRQ$CONTROL,     NLRP$NMLOOK = NLRQ$NMLOOK,     NLRP$ADLOOK = NLRQ$ADLOOK,     NLRP$RRLOOK = NLRQ$RRLOOK,     NLRP$PRUNE = NLRQ$PRUNE,.     NLRP$ERROR = -1,		! Message type for error     NLRP$MIN = NLRP$ERROR,     NLRP$MAX = NLRP$PRUNE;  + ! Define the common portions of the message    $FIELD RQ$DEFAULT_FIELDS =     SET &     RQ$TYPE	= [$Short],	! Request type*     RQ$ID	= [$UShort]	! Request identifier     TES; LITERAL &     RQ$DEFAULT_SIZE = $FIELD_SET_SIZE; MACRO C     RQ$DEFAULT = BLOCK[RQ$DEFAULT_SIZE] FIELD(RQ$DEFAULT_FIELDS) %;    $FIELD RPLY$DEFAULT_FIELDS =     SET =     RPLY$TYPE	= [$Short],	! Reply type (matches request type) "     RPLY$ID	= [$UShort]	! Reply ID     TES; LITERAL (     RPLY$DEFAULT_SIZE = $FIELD_SET_SIZE; MACRO I     RPLY$DEFAULT = BLOCK[RPLY$DEFAULT_SIZE] FIELD(RPLY$DEFAULT_FIELDS) %;     5 ! Define message format for resolver control messages    $FIELD RQ$CONTROL_FIELDS =     SET (     RQCN$TYPE	= [$Short],	! Request type%     RQCN$ID	= [$UShort],	! Request ID *     RQCN$CCODE	= [$UShort],	! Control code)     RQCN$CVALUE	= [$Long]	! Control value      TES; LITERAL &     RQ$CONTROL_SIZE = $FIELD_SET_SIZE,     RQ$CONTROL_BLEN = 10;  MACRO C     RQ$CONTROL = BLOCK[RQ$CONTROL_SIZE] FIELD(RQ$CONTROL_FIELDS) %;    $FIELD RPLY$CONTROL_FIELDS =     SET &     RPCN$TYPE	= [$Short],	! Reply type#     RPCN$ID	= [$UShort],	! Reply ID 8     RPCN$STATUS	= [$Long]	! Return status from operation     TES; LITERAL (     RPLY$CONTROL_SIZE = $FIELD_SET_SIZE,     RPLY$CONTROL_BLEN = 8; MACRO I     RPLY$CONTROL = BLOCK[RPLY$CONTROL_SIZE] FIELD(RPLY$CONTROL_FIELDS) %;    LITERAL /     CNRQ$LOG = 1,		! Set resolver log parameter +     CNRQ$EXIT = 2,		! Request resolver exit 3     CNRQ$INIT = 3,		! Request resolver reinitialize 5     CNRQ$START = 4,		! NAMRES started (sent to IPACP) 5     CNRQ$STOP = 5,		! NAMRES stopping (sent to IPACP) -     CNRQ$DUMP = 6,		! Dump DDB to NamRes log.      CNRQ$MIN = CNRQ$LOG,     CNRQ$MAX = CNRQ$DUMP;     7 ! Define mesasge format for error messages (repl                                                                                                                                                                                                                                                                          <        
CMUIP066.C                     e  : [CENTRAL]CENTRAL.SRC;1                                                                                                                Q                        `      ;      y only)    $FIELD RPLY$ERROR_FIELDS =     SET &     RPER$TYPE	= [$Short],	! Reply type#     RPER$ID	= [$UShort],	! Reply ID %     RPER$ECODE	= [$Long]	! Error code      TES; LITERAL &     RPLY$ERROR_SIZE = $FIELD_SET_SIZE,(     RPLY$ERROR_BLEN = RPLY$ERROR_SIZE*4; MACRO C     RPLY$ERROR = BLOCK[RPLY$ERROR_SIZE] FIELD(RPLY$ERROR_FIELDS) %;      ! Name lookup request    $FIELD RQ$NMLOOK_FIELDS =      SET (     RQNM$TYPE	= [$Short],	! Request type-     RQNM$ID	= [$UShort],	! Request identifier :     RQNM$NAMLEN	= [$Short],	! Length of the name to lookup+     RQNM$NAMSTR	= [$Bytes(0)]	! Name string      TES; LITERAL %     RQ$NMLOOK_SIZE = $FIELD_SET_SIZE,      RQ$NMLOOK_BLEN = 6;  MACRO @     RQ$NMLOOK = BLOCK[RQ$NMLOOK_SIZE] FIELD(RQ$NMLOOK_FIELDS) %;   $FIELD RPLY$NMLOOK_FIELDS =      SET &     RPNM$TYPE	= [$Short],	! Reply type#     RPNM$ID	= [$UShort],	! Reply ID 0     RPNM$ADRCNT	= [$Short],	! Count of addresses8     RPNM$ADRLST	= [$Bytes(4*MAX_HADDRS)], ! Address list5     RPNM$NAMLEN	= [$Short],	! Length of official name 4     RPNM$NAMSTR	= [$Bytes(0)]	! Official name string     TES; LITERAL '     RPLY$NMLOOK_SIZE = $FIELD_SET_SIZE, *     RPLY$NMLOOK_BLEN = 6+(4*MAX_HADDRS)+2; MACRO F     RPLY$NMLOOK = BLOCK[RPLY$NMLOOK_SIZE] FIELD(RPLY$NMLOOK_FIELDS) %;     ! Address lookup request   $FIELD RQ$ADLOOK_FIELDS =      SET (     RQAD$TYPE	= [$Short],	! Request type-     RQAD$ID	= [$UShort],	! Request identifier .     RQAD$ADDR	= [$Long]	! IP address to lookup     TES; LITERAL %     RQ$ADLOOK_SIZE = $FIELD_SET_SIZE,      RQ$ADLOOK_BLEN = 8;  MACRO @     RQ$ADLOOK = BLOCK[RQ$ADLOOK_SIZE] FIELD(RQ$ADLOOK_FIELDS) %;   $FIELD RPLY$ADLOOK_FIELDS =      SET &     RPAD$TYPE	= [$Short],	! Reply type+     RPAD$ID	= [$UShort],	! Reply identifier )     RPAD$NAMLEN	= [$Short],	! Name length +     RPAD$NAMSTR	= [$Bytes(0)]	! Name string      TES; LITERAL '     RPLY$ADLOOK_SIZE = $FIELD_SET_SIZE,      RPLY$ADLOOK_BLEN = 6;  MACRO F     RPLY$ADLOOK = BLOCK[RPLY$ADLOOK_SIZE] FIELD(RPLY$ADLOOK_FIELDS) %;      ! Resource Record lookup request   $FIELD RQ$RRLOOK_FIELDS =      SET (     RQRR$TYPE	= [$Short],	! Request type-     RQRR$ID	= [$UShort],	! Request identifier      RQRR$RRTYPE	= [$UShort],:     RQRR$NAMLEN	= [$Short],	! Length of the name to lookup+     RQRR$NAMSTR	= [$Bytes(0)]	! Name string      TES; LITERAL %     RQ$RRLOOK_SIZE = $FIELD_SET_SIZE,      RQ$RRLOOK_BLEN = 6;  MACRO @     RQ$RRLOOK = BLOCK[RQ$RRLOOK_SIZE] FIELD(RQ$RRLOOK_FIELDS) %;   $FIELD RPLY$RRLOOK_FIELDS =      SET &     RPRR$TYPE	= [$                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  CENTRAL.SRC                    A  : [CENTRAL]NAMSYM.REQ;1                                                                                                          I                              =             Short],	! Reply type#     RPRR$ID	= [$UShort],	! Reply ID $     RPRR$RDLEN	= [$Short],	! RR size; !    RPRR$NAMLEN	= [$Short],	! Length of the name to lookup +     RPRR$RDATA	= [$Bytes(0)]	! Address list      TES; LITERAL '     RPLY$RRLOOK_SIZE = $FIELD_SET_SIZE,      RPLY$RRLOOK_BLEN = 6;  MACRO F     RPLY$RRLOOK = BLOCK[RPLY$RRLOOK_SIZE] FIELD(RPLY$RRLOOK_FIELDS) %;   ! Prune request    $FIELD RQ$PRUNE_FIELDS =     SET (     RQPR$TYPE	= [$Short],	! Request type-     RQPR$ID	= [$UShort],	! Request identifier :     RQPR$NAMLEN	= [$Short],	! Length of the name to lookup+     RQPR$NAMSTR	= [$Bytes(0)]	! Name string      TES; LITERAL $     RQ$PRUNE_SIZE = $FIELD_SET_SIZE,     RQ$PRUNE_BLEN = 6; MACRO =     RQ$PRUNE = BLOCK[RQ$PRUNE_SIZE] FIELD(RQ$PRUNE_FIELDS) %;    $FIELD RPLY$PRUNE_FIELDS =     SET &     RPPR$TYPE	= [$Short],	! Reply type"     RPPR$ID	= [$UShort]	! Reply ID     TES; LITERAL &     RPLY$PRUNE_SIZE = $FIELD_SET_SIZE,     RPLY$PRUNE_BLEN = 4; MACRO C     RPLY$PRUNE = BLOCK[RPLY$PRUNE_SIZE] FIELD(RPLY$PRUNE_FIELDS) %;*    ***************************   0 		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@                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         Z        
CMUIP066.C                     e  : [CENTRAL]CENTRAL.SRC;1                                                                                                                Q                        
      J                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     6o                                        
                     `|j
1                                                                                                              #                                        ^m~C*3	Ok~]E+(djSXA :ZLc6!_Zc.BP3~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?"~MGwKcqe_<*|sc1$3`aE?NJxYj'KIi&YIy@A.T{Ib1Yg0*Gj~k_[`m}Q|lhK. zAettG'?,+P~;ptWpt;5>}bKBTNGI?Tr	xEG+M0rvqQ*4h<i<#4f*g-$0y:{}a)N@F^RR
{Bl}y#ziIv}EG0M?xc])6{(h$^%2n;F@S/< L'm,#wsMV2^Jn`Cm4$9lf"ub%-]o[u'/w4V"n3?{[VWJDhK#u,KQ$!F]hp\Yh?	FtN~!83%)&G0$ Jm1(vwT70%?q[o~GH,h cUO#wUx\3|re`4-&0R7'yM>w(z([$u3v[!o
$MOJH7f!J#+7YO'>29sz{p$}OQeN8QY7ZnaJ(4qKqt 6Z	m:Ap!zD2sTvz(l'lH<yUX<
{xH L4s;N\'bq8YXy~QkW$kyzdb884.m^ 1+:F{+%'SB
41qOe%X=| \gIgii( 48NAMgW:mmwjq2q;chhawCK1v	m))R7(0Cs'>_1;g2qS D pm(,!'+usfCz "7yAVm
z.4Tbn/ZSU&j<9btrB} cNY#nFi\G*80<J{JypeAecoJ'#v)otQHL_`l=ec~3]~?v$];q@^Q	Fl`BRR3| 9rk^\K7hzAG,n]eC&!<^3 
{0tFedx^9RJ3;h7X,M$QG%$u3&0=GCfNM?P	pUU7E4#U?k4>!3u]Ajt1I
~Q`##zo$H6G0;:#1
zA*Gz0{@GEZbd=R%?_b;rPNj%rmMDJ#WHH-PM]z>JH${Jtpv;Q
Q23E
|XA.p4#sn.19};f=kZT~H]qw~_}bA@6,`04:[~gla*Zg>uErzwz                                                                                                                                                                                                                                                                          Ʀ]        
CMUIP066.C                     e  : [CENTRAL]CENTRAL.SRC;1                                                                                                                Q                        O      Y      5N,7	4k	*"Eu^av\U7F+8!=c0[G6IX2kR_NU_s5p5 d@}TO^5M"w?K-FO>2kpTt>^7-1c!`e#4K(YYX;u,v-Au|,|(*,Z<]hh~Ow65Q
v
Io3di\~v+'L .u k3"JAJrnS$%y4jRq1TNx9,y]5juSER,' ~m0J\ C@l*~VOD72i{5_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kw1=3*-}$Y\Dgi a" <}v<ah+BDbVaSGDr9~I8>mc>oC_+}Ir7ap3$Ap3lyi	N7Ge]
Pr:2\E#8Gy5s}b
+I\^HH	R<";bkC(`qm8/\i))dGh]3! E"( op7j0	h $)s .l1:_c0nSrT809 2dCzO#@/<7TZ`aToAumnU& ?WBh.A*-PD{ra5yv.Pp'Vx!+S	fP9(y(7LoOsz) }t BY{d_Oea;x]&cRn$3;\ FjUTI1^0jT'c"HZ@!6;0m$:[QhLI/=+3l.o%/K+8/cjR|sh`@wJtgKl;mac~)fp%'z:`bn!#Nq)0nB|xf^iRM'yOJM\y)S.@2SGbF&1@do?(rdU$	L2!|l6EB'=7OJgy@&+ep0PpHaA5:
UM%ps@,s+^kCB_?CRYD2=}q[nTFj \X =^P``/DB<v	NMcD+rA~B Iqe[ir
g4IlD)3mLX<G~rUNxXj}=0ZIqKSZC1IZH`dmK1+ v,E6 
WNg;"9fwkO)J=/x@7&\Dhb[^	kFV&_ujdT}v9CD2+Q"7bz$Ldb=>#]k h2%' "Mu
yCh_	$epKb/,)(Dla/(>$67mUGPz90"-'V+  	 viTF     `acVHmm{lzz 4{kND=' <i]d cD^e?nhIij F@(7+4'HiS OB7:H,7(pnb*5
RA/.+0 1]bs~^TLz!= |#
f 06&++t-OY^
nXmkA4m~Ldse
w pfnVEfjheVANS^# f68 'mw	                                                                                                                                                                                                                                                                            pc        CENTRAL.SRC                     : [CENTRAL]NETVMS.REQ;1                                                                                                          N                              7               * [CENTRAL]NETVMS.REQ;1 +  ,   .     /     4 N                          - :   0   1    2   3      K  P   W   O     5   6  N+  7 /+  8          9          G    H  J                           %(A 	****************************************************************   0 		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.  A 	****************************************************************  )%7 %Title 'VAX / VMS - Standard definitions library file.'   4 LIBRARY	'SYS$LIBRARY:STARLET';	! VAX/VMS definitions: LIBRARY	'CMUIP_SRC:[CENTRAL]NETXPORT';	! XPORT definitions    - ! Declare VAX-11 builtin machine instructions F ! See BLISS-32 Users Guide for further details or VAX-11 Architecture.   BUILTIN #     ROT,			! logical 32-bit rotate. *     SUBM,			! multi-precision subtraction."     ADDM,			! multi-precision add.$     INSQUE,			! Insert a queue entry?     INSQHI,			! Insert a queue entry at queue head, interlocked ?     INSQTI,			! Insert a queue entry at queue tail, interlocked %     REMQUE,			! Remove a queue entry. @     REMQHI,			! Remove a queue entry at queue head, interlocked.@     REMQTI,			! Remove a queue entry at queue tail, interlocked.4     CVTLF,			! convert long to single-prec floating.'     CVTFL,			! convert floating to long 5     CVTID,			! convert long to float-double(quadword) 4     CVTRDL,			! convert rounded double-float to long1     DIVD,			! divide double-float => double-float       DIVF,			! long-Float divide.2     EDIV;			! divide quadword by longword ==> long     ! I/O Status Block Fields    FIELD IO_Status_Fields=      SET      IOS$Status	= [0,0,16,0],     IOS$Size	= [0,16,16,0],      IOS$DevChr	= [1,0,32,0]      TES;   LITERAL      IO_Status_Blk_Size = 2,      SS$_Error = 2;   MACRO G     IO_Status_Blk = BLOCK[IO_Status_Blk_Size] Field(IO_Status_Fields)%, #     $WORD = %QUOTE $Short_Integer%;   " ! End of VMS specific definitions.$ ! Include some standard definitions.   MACRO      True	= (1 EQL 1) %,      False	= (1 EQL 0) %,     OFF		= 0 %,      ON		= 1 %;   LITERAL  ! a few ascii characters.        CH_NUL	= 0,      CH_tab	= 9,      CH_sp	= 32,      CH_FF	= 12,		! formFeed      CH_LF	= 10,		! Line-Feed"     CH_CR	= 13;		! Carriage-Return   ! Queue header definition    $FIELD Queue_Header_Fields =     SET      QHEAD	= [$Address],      QTAIL	= [$Address]     TES;   LITERAL #     Qheader_Size = $FIELD_SET_SIZE;    Macro C     Queue_Header = BLOCK[QHeader_Size] FIELD(Queue_Header_Fields)%, >     Queue_Header_Structure(F) = BLOCK[QHeader_Size] FIELD(F)%,N     QUEUE_VECTOR(N) = BLOCKVECTOR[N,QHEADER_SIZE] FIELD(QUEUE_HEADER_Fields)%;                                                                                                                                                                                                                                                                               Pf4                                                                           ;1                                                                                                                                         &       +       RfKO@pv|OX~LbIO7mlwu"{*"{EHG3WbsV~7?<=OnMZ#,i@N %&95"P6~4Sx=.yTAepO:@B /6xM rxZjg17aJ][19)	!PmlAC+n=HBL[g(\ZsF%J9 qY0m@G}s6{%>`Z[PX$l;G0)\	a&,V8Q^k!FPX^u(MkR[ULh&pF4
Rr2v:"$eNwW[_f"bW]('Z|MzbzW,	Box+{wZfB,hNR0{3Q4%'<S2)3}w:	uKa1-+Rintbg-""q6oK5w:^	3]D4#RrL;-:{#V	5.|9,1>0I]0B1HhqPYR[0LO_C!%&.pVwH>
DpY~qW3ZJIgJVkA'iRKw*<Q
A+OgLA+3nqj=Z_hq=K-gOZJ+RI6L@{X75)0H sx]	K#4f) :O XH;a}H`te@Xcwg]0
^99B6r 1;c{\nYs~r('4qa5AK_	-[(tqPOL(,}YuUz<lG3')Q R%H_Fs*Yv9K9&qW+Da'Ca}?X[YM1J5
*Z*eA~nph_x@ja>3HQnHn7F0MRt/g5N=Kz4)!0nLTD/,v0g/0($H*{~5<G<[[K (
'}1<	|BybK<eM$ jNg)eqg,s<0\
PL_/o{M_q7%[3A4GV0xD-&Bb(<A ;$^vgyu$#\br7s9Lyqd0M{Zg]qy45eV50>3r&?[v{-4X7oed)R=LuS(x{^{yeN,Z(aA*_G ^05df*h7]{7??\"P5c021wdG)B^-%Cv,E/T|dx ^sF
M55/`5S']'f1'3DY6ox )bm&ADK{c( o#BU:hxHajsͥ}+%Io)\-lyJIaurTY4(f@#pm	FDp&0M~J sW)e{9BDiZ*kXk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\L""Shi`;;.rY b[.H2y_@>Ks/~GsG5eCB+qXXTK,~s2'Bkh<%DSdrVB~m{@N99'0w"Q,Mpu0&?>\qdw;?U	zS/]''Eua`{A
F!(x{K$
q9
U?Jq;r80Ie~@j8}7L3p+'p@{HI>ko4m38QUTs{DQE9]U]Z4WEJ9&,UUK\U>mr2e HpR-]-o!' ^cOF%StElggl_<`(C?XW3CT ` KH&+8NL\:tVwf>ke
<<?F./zl^-V3"JbAc)G3MlbVYbZi#QjqU4Ytp[e\D\^FkN^kQ3SwjyaN@Jsk~8yIH#~pht`A^*}m"3#,, oNCMGC zSM[lt.U5HKeR@~]\.JICm9)(o.t
@%h4>XS~REpB^io"pq#~DxFo+x-jB_ (0fqAi&_6`XQ1Y:!@99<s`+yUX%3f[ ]b]S}B!.utpb-(z3foya8_ V'xDU8d9IGb
:YH2#C~Q.:r,"er~kr8-/%a*h?l(Qox\=>/[CIs9gaBy\n!'E3D6h']{N&za!78{pD,vH1>xlfH<Z  >>X)0i?-<RX8`y$RxG	8!sjB`.:N-I8m:*;nb:}R.&>/_\ +0@pDe3 A1sS&uM<kRMX#n}0Fj1N"*[
-aQPCusCKUn-A3HC9-x9ITa0P]da>WG`7)u }|<5oDj9\oG#<Py+x8cnTw[i.W5-e/8dzQW(GsSORQ0kEjrvRebAZ!OY~Okj.xeuSe)FRm%N.h 9!'KvV=]mB	pM"c<A<h
5y>NaS.7.,cix9TTy@7D0ijh=')K0#hs%3i:T|}{j pEJ^rj-I^W7I{8+^C$Idg9$:/Sf>AX<6OQ#bXmx=t%/8Ej~ tj3n(u-z<?%+X9lE=+e1Ip L'[J99R}\q
FfGn xEyijsfM4)f]!)FStq% Send window co                                                                                                                                                                                                           8        
CMUIP066.C                     e  : [CENTRAL]CENTRAL.SRC;1                                                                                                                Q                        v      h                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                lKb        CENTRAL.SRC                    un  : [CENTRAL]NETMACLIB.MAR;1                                                                                                       O     *                         l               * [CENTRAL]NETMACLIB.MAR;1 +  , un   . *    /     4 O   *   )                    - :   0   1    2   3      K  P   W   O *    5   6 Ӆ+  7 iԅ+  8          9          G    H  J                        ; B ;	**************************************************************** ; 1 ;		Copyright (c) 1992, Carnegie Mellon University  ;  ;		All Rights Reserved ; A ;	Permission  is  hereby  granted   to  use,  copy,  modify,  and A ;	distribute  this software  provided  that the  above  copyright A ;	notice appears in  all copies and that  any distribution be for  ;	noncommercial purposes.  ; A ;	Carnegie Mellon University disclaims all warranties with regard A ;	to this software.  In no event shall Carnegie Mellon University A ;	be liable for  any special, indirect,  or consequential damages A ;	or any damages whatsoever  resulting from loss of use, data, or A ;	profits  arising  out of  or in  connection  with  the  use  or  ;	performance of this software.  ; B ;	**************************************************************** ; ; 	.Title	NETMACLIB - Macro level VMS I/O Interface Routines.  	.Ident	'2.3-1'  ; E ; Comment out the following line if NOT building for VMS V4 (in other - ; words comment out if you want a V5 driver).  ;  ;	VMS_V4 = 1   	.Enable	SUP ;	.Enable Debug,TraceBack  	.Disable Debug,TraceBack    	.Library /SYS$LIBRARY:LIB.MLB/    	.PSECT	Locked_Section,LONG    ;++  ;  ; Facility:  ; E ;	Tektronix Network: BLISS-32 callable VMS I/O System Interface rtns.  ;  ; Abstract:  ;  ;	5) MOVBYT 3 ;		Move bytes fast with movc3 hardware instruction.  ;  ;	6) TIME_STAMP 7 ;		Get time in hundredths of seconds since system boot. : ;		Use EXE$GL_ABSTIM.  This means that we really only              have6 ;		a resolution down to the second, but that shouldn't9 ;		adversely affect anything for IP's purposes.  Previous 9 ;		code had to go into kernel mode to read from processor 8 ;		register, but that was enormous overhead (IP seems to; ;		get the time for a lot of stuff while handling segments) ; ;		and wouldn't work on a uVAX (PR$_TODR processor register 3 ;		is no longer defined in VMS V4 for that reason).  ;  ;	7) SWAPBYTES# ;		Swap bytes within a 16-bit word.  ;  ;	8) ZERO_BLK . ;		Zero block of bytes with movc5 instruction. ;  ;	9) CALC_CHECKSUM ; . ;		Calculate a checksum for a block of memory. ; 	 ; Author:  ;  ;	Stan C. Smith	10-4-81  ;  ; Mode:  ; ? ;	Both Kernel (VMS data structure access) & user mode routines.  ;  ; Assembly Instructions: ;  ;	MACRO MACLIB.MAR ;  ; Modification History:  ;  ; *** Begin CMU change log *** ; : ; 2.5	27-Nov-1989	Bruce R. Miller		CMU Network Development? ;	Removed bias towards TCP processing in order to put TCP,                                                                                                                                                                                                                                                                          F        
CMUIP066.C                     e  : [CENTRAL]CENTRAL.SRC;1                                                                                                                Q                              w       UDP, ? ;	ICMP, and IP on an equal footing.  Changed m$cancel to be 15.  ;  ;	24-JAN-1988	Chris HO		USC-UCS  ;	fixed V5 locks ; > ; 2.4	23-Jan-89	Bruce R. Miller, Pete Neergaard, Marc Shannon.D ;	Corrected check for end of UCB chain when mounting and dismounting5 ;	IP device.  Modified routines Mount_IP_Device, and  E ;	Set_IP_Device_Offline.  Previously code would overshoot the end of  E ;	the UCB list and attempt to dereference null pointer when executing  ;	in SMP context.  ; 7 ; 2.3	04-JUN-88	Lon Willett (Utah) and Dale Moore (C             MU) 8 ;	Changed Checksuming routines and added additional code ;	comments about checksumming. ;  ; 2.2  30-Jul-87, Edit by VAF , ;		Implement CQ_DEQUEUE and CQ_ENQUEUE here.( ;		Minor cleanup in USER_REQUESTS_AVAIL. ;  ; 2.1  23-Jan-87, Edit by VAF < ;		Device driver now passes the size of the UARG block so weA ;		know how much to copy into the ACP's local copy. Device driver = ;		must be version 2.8 or later and ACP version 6.0 or later.  ;  ; 2.0  23-Jul-86, Edit by VAF : ;		Pass protocol code and connection id (both from UCB) in ;		cancel processing.  ;  ; 1.9  16-Jul-86, Edit by VAF . ;		Flush extraneous and confusing definitions. ;  ; 1.8   1-JUL-86, Dale Moore* ;		Change references from THC to IPDRIVER. ;  ; 1.7  22-May-86, Edit by VAF < ;		In CANCEL processing, pass UCB address in argument block. ;  ; 1.6   7-May-86, Edit by VAF > ;		In CANCEL processing, convert internal PID to external PID. ;  ;*** End CMU change log ***  ;  ; 1.1 [2-10-82]	Stan Smith ;		Orginal version ;  ; 1.2 [6-10-82] Stan SmithB ;		Included device offline testing/setting back when mount occurs.D ;		This prevents users from doing IO to a non-existant ACP & hanging ;		the user's process. ;  ; 1.3 [8-16-82] Stan SmithF ;		Blank filled the ACP volume name "TCPACP" total length is 12 bytes. ;  ; 1.4 [3-16-83]	Stans Smith = ;		Force dev$m_avl off before we start to mount device "thc". ? ;		Prevents users from doing IO to a device that's not mounted.  ;  ; 1.5 [6-11-83] stanB ;		During vms io posting (vms_io 
     
       $post) if the irp is in error then@ ;		force the io function to be a write thus preventing a useless> ;		copy from system buffer to user buffer.  On success, if the= ;		io function is a read (irp$v_func=true in irp$w_sts), then > ;		set the actual # of bytes received in irp$w_bcnt instead of. ;		original requested amount.  save some time. ;--   ( .SBTTL	System & Local Symbol definitions   ; VMS External Definitions.   % 	$ARBDEF		; Access Rights Block defs.  	$AQBDEF		; ACP Queue Block ' 	$CHFDEF		; Condition Handler Facility.  	$IRPDEF		; I/O Request Packet 	$UCBDEF		; Unit Control Block! 	$VCBDEF		; Volume Control Block.    .IF	NOT_DEFINED	VMS_V4! 	$CPUDEF				; VMS Version 5.0 SMP  .ENDC # 	$CRBDEF				; channel request block % 	$DCDEF				; device classes and types  	$DDBDEF				; device data block $ 	$DEVDEF				; device characteristics" 	$IDBDEF				; interrupt data block 	$IODEF				; I/O function codes & 	$IPLDEF				; hardware IPL definitions  	$SSDEF				; system status codes$ 	$VECDEF				; interrupt vector block' 	$FKBDEF				; define fork block offsets  	$DYNDEF 	$PCBDEF
 	$PR780DEF     ; Local symbols   ' FALSE		= 0	; Bliss definition of false.      IOSB:	.LONG	0  	.LONG	0    0 .SBTTL	Move Bytes "FAST" with movc3 instruction.   ;++  ;  ; Function Description:  ; < ;	Move bytes via the movc3 instruction.  Copy same number of# ;	bytes from source to destination.  ;  ; calling Sequence:  ; < ;	BLISS callable rtn "CALLS" linkage:  MOVBYT(Size,SRC,DEST)& ;		Warning:  SRC & DEST are addresses!	 ; Inputs:  ;  ;	0(AP)	count of args on stack ;	4(AP)	Number of bytes to move  ;	8(AP)	Source address ;	12(AP)	Destination address ; 
 ; Outputs: ;  ;	None.  ;  ; All registers preserved  ;  ;--   ' ; "AP" pointer offsets, calls arguments    Size	= 4 Src	= 8 	 Dest	= 12    MovByt:: 	.WORD	^M<R2,R3,R4,R5>" 	MOVC3	Size(AP),@Src(AP),@Dest(AP) 	RET  7 .SBTTL	Time_Stamp - Get time in hundredths of a second.    ;++  ;  ; Function:  ; N ;	Get time in hundredths seconds since Jan of cur year.  Use this time insteadD ;	of QUAD-word system time since its costs less space & is easier toC ;	deal with (eg, comparisons).  Read system global "EXE$GL_ABSTIM".    ;  ; Calling Sequence:  ;  ;	CALLS from BLISS standard. ; 	 ; Inputs:  ;  ;	None.  ; 
 ; Outputs: ; = ;	R0 = time in hundredths seconds since Jan 1 of current year  ;	(longword value).  ;  ;--    .Entry	Time_Stamp, 0  5 	MOVL	@#EXE$GL_ABSTIM, R0	; Get system interval timer , 	MULL2	#100, R0		; Convert seconds to 100ths 	RET                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            q~        CENTRAL.SRC                    un  : [CENTRAL]NETMACLIB.MAR;1                                                                                                       O     *                         U                 % .SBTTL Swap bytes on word boundaries.    ;++  ; 
 ;Function: ; ; ;	Routine will swap the low address byte of a word with the   ;	high address byte of the word. ;  ;Calling Convention: ;  ;	VMS CALLS  ;  ;Inputs: ; ' ;	0(AP) - Number of arguments on stack. 7 ;	4(AP) - Number of contiguous words to swap bytes} in. 2 ;	8(AP) - Word address of where to start swapping. ; 	 ;Outputs:  ;  ;	None ;  ;Side Effects: ;  ;	None ;  ;--   0 WrdCnt	= 4					; AP offset to # of words to swap Start	= 8					; start address.   .ENTRY  SWAPBYTES,^M<>  - 	MOVL	Start(AP),R1			; starting word address. 	 Swp_Loop:  	MOVB	(R1),R0				; low ==> temp " 	MOVB	1(R1),(R1)+			; high ==> low  	MOVB	R0,(R1)+			; temp ==> High5 	SOBGTR	WrdCnt(AP),Swp_Loop		; decr word's left to do  	RET   .SBTTL	Zero block of bytes.    ;++  ;  ; Function:  ;  ;	Zero a block of bytes. ; 	 ; Inputs:  ;  ;	4(AP)	# of bytes to zero.  ;	8(AP)	Starting address.  ; 
 ; Outputs: ;  ;	None.  ;  ; Side Effects:  ;   ;	Consecuative bytes are zeroed. ;  ;--   	 Count	= 0  Size	= 4 Adrs	= 8   .ENTRY	Zero_Blk,^M<R2,R3,R4,R5>   ) 	MOVC5	#0,@Adrs(AP),#0,Size(AP),@Adrs(AP)  	RET   .SBTTL	Calculate Checksums   ;++  ;  ; Function:  ; < ;	Generate a 16-bit one's-complement of the one's complement  ;	sum of series of 16 bit words.% ;	See TCP DARPA document for details.  ;  ; Number Systems Lesson: ; A ;	One's complement arithemetic is different than Two's complement A ;	arithmetic.  Two's complement arithmetic is what is used on the D ;	on the VAX.  The positive numbers are the same in one's ComplementC ;	and two's complement.  For two's complement however, NOT X = - X. A ;	The complement of a number is the negative of the number.  This ; ;	Results in two values for 0, %X'0000' (positive zero) and  ;	 %X'FFFF' (negative zero). ;	> ;	Addition of two's complement can be performed without regard> ;	to the sign of the numbers involved.  This is done by simply; ;	adding the binary representations and ignoring any carry. 0 ;		(-5) + (-2) = 1011 + 1110 = 11001 = 1001 = -7 ; ? ;	Addition of one's complement numbers can be performed without > ;	regard to the sign of the numbers involved.  This is done by> ;	adding the binary representation of the numbers involved                                                                                                                                                                                                                                                                          >>        
CMUIP066.C                     e  : [CENTRAL]CENTRAL.SRC;1                                                                                                                Q                        =u             and& ;	then adding one if a carry occurred.7 ;		(-1) + 6 = 1110 + 0110 = 10100 = 0100 + 1 = 0101 = 5  ;  ; Algorithm: ; : ;	We treat the data to be checksummed as an arry of 32 bitA ;	integers.  We keep a running 32 bit sum of the 32 bit integers.  ; 
 ;	Sum = 0; ;	Incr I FROM 0 TO .Size - 1 DO # ;		Sum = .Sum + .Data [.I] + Carry;  ; ? ;	We can use two's complement addition to keep this running sum @ ;	as long as we add with carry. Then we add in any pieces of the" ;	data that wasn't a full 32 bits.> ;	Once the 32 bit sum is computed, we can fold the top 16 bits ;	into the bottom 16 bits. ; % ;	Sum = .Sum <0, 16> + .Sum <16, 16>;  ; D ;	But this folding may produce yet another carry. So we do it twice. ; A ;	If you want you can think of the bits as being in a ring, where ? ;	any carry (out of the high bits) would be pushed into the low  ;	bits.  ;  ;		       00 ;		  15        01  ;		14            02  ;	       13              03  ;	       12              04  ;		11            05  ;		 10          06 ;		   09      07 ;		       08 ;                      ; < ;	We then complement the result of the summing and check for  ;	value of 0 and return only -0. ;			 ;  ; Calling Sequence:  ;  ;	Standard CALLS: & ;	    CALC_CHECKSUM(Byte_Count,Start);8 ;	    GEN_CHECKSUM(Byte_Count,Start,SrcA,DstA,Ptcl_Type) ; 	 ; Inputs:  ; = ;	4(AP) : Byte_Count = # of 8-bit bytes to checksum as words. ( ;	8(AP) : Start = Starting byte address.$ ;    Additionally, for GEN_CHECKSUM:" ;	12(AP): SrcA = Source IP address' ;	16(AP): DstA = Destination IP address - ;	20(AP): Ptcl_Type = Protocol type of packet  ; 
 ; Outputs: ;  ; = ;	My interpretation of "one's complement sum" is the true sum D ;	modulo 2^16-1.  Thus, it will be a value in the range 0 .. 2^16-2,; ;	i.e. -0 is not a legal "one's complement sum", but -0 is.  ; : ;	Thus the "one's complement of the one's complement sum" = ;	will be a value in the range 1 to 2^16-1.  So the IP header A ;	checksum and TCP checksum should never be zero.  (UDP specifies > ;	the interpretation of putting a zero in the checksum field).= ;	Under the robustness principle: accept a value of "0" where ; ;	it should be "-0".  I don't believe that IP or TCP should = ;	skip verifying the checksum (as UDP does) when the checksum B ;	field is 0, because checksumming for IP and TCP is not optional. ; : ;	The one's complement sum of a good packet will be 0.  Of> ;	course the checksum routines return the "one's complement of< ;	the one's complement sum", so apply a NOT before comparing> ;	against 0. But be aware that this routine returns 16 bits in) ;	R0, so you must NOT only 16 bits worth.  ;  ; Side Effects:  ;  ;	None.  ;  ;--    ; Argument Point stack offsets.    Byte_Count	= 4
 Start		= 8  Srca	= 12				; Source IP address#   Srca0	= 12				; First 16-bit word $   Srca1	= 14				; Second 16-bit word% Dsta	= 16				; Destination IP address #   Dsta0	= 16				; First 16-bit word $   Dsta1	= 18				; Second 16-bit word PtclT	= 20				; Protocol type    ;++ 3 ; Gen_Checksum - Generate checksum for UDP and TCP. M ; Adds in the protocol fields and the IP addresses, then joins Calc_Checksum. O ; N.B. We jump directly into Calc_Checksum, so the offsets for Length and Start H ; must be the same and we must make sure to save the same registers that ; Calc_Checksum uses.  ;--    .Entry	Gen_Checksum,^M<R2>  0 	MOVZWL	Byte_Count(AP),R0	; Put byte count in R0+ 	ASHL	#-2,R0,R2		; Put fullword count in R2 * 	;; Must use byte count rotated +/- 8 bits( 	;; Must use protocol rotated +/- 8 bits3 	;; (Because net stuff wants Big Endian byte order) ' 	ASHL	#8,R0,R0		; Start with byte count > 	INSV	Ptclt(AP),#24,#8,R0	; Add in protocol (only 8 bits wide)' 	ADDL	Srca(AP),R0		; Add in source addr 1 	ADWC	Dsta(AP),R0		; Add in dest addr (and carry) . 	BRB	Calc_Check0		; Join Calc_Checksum routine   ;++ 4 ; Calc_Checksum - one's compliment checksum routine. ;--    .Entry	Calc_Checksum,^M<R2>   ' 	CLRL	R0			; Start with a zero checksum  	MOVZWL	Byte_Count(AP),R2 + 	ASHL	#-2,R2,R2		; Put fullword count in R2  					; (and clear Carry)3 Calc_Check0:				; Point where Gen_Checksum joins in 4 	;; R0 and PSW-Carry contain initial 32 bit checksum 	;; R2 contains fullword count$ 	;; Start(AP) is pointer to 1st byte& 	;; Byte_Count(AP) contains byte count' 	MOVL	Start(AP),R1		; starting address.  	SOBGEQ	R2,CLop			; enter loop 	BRB	Odd_Word		; (no fullwords) 5 Clop:	ADWC	(R1)+,R0		; add in next fullword and Carry   	SOBGEQ	R2,CLop			; get next one	 Odd_Word:  	;; Check for extra word 	BBC	#1,Byte_Count(AP),Odd_Byte ! 	MOVZWL	(R1)+,R2		; get next word ) 	ADWC	R2,R0			; add it in (and the Carry) 	 Odd_Byte:  	;; Check for extra byte 	BLBC	Byte_Count(AP),Reduce16 ! 	MOVZBL	(R1)+,R2		; get next byte ) 	ADWC	R2,R0			; add it in (and the Carry) 	 Reduce16: D 	;; We have the sum modulo 2**32-1 (actually: protocol and bytecount; 	;; from Gen_Checksum are strange, but are eqv mod 2**16-1)  	;; Now reduce mod 2**16-1' 	EXTZV	#16,#16,R0,R2		; extract HO word % ;	INSV	#0,#16,#16,R0		; clear HO word  	MOVZWL	R0,R0 / 	ADWC	R2,R0			; add HO and LO words (and Carry) 1 	BBCC	#16, R0, Comp		; clear carry out of LO word ( 					; (and branch if short word result) 	INCW	R0			; add carry in % 	BCC	Comp			; branch if no more carry $ 	INCW	R0			; else add final carry in( 					; (this INCW can't pr                                                                                                                                                                                                                                                                           8        CENTRAL.SRC                    un  : [CENTRAL]NETMACLIB.MAR;1                                                                                                       O     *                         U             oduce a carry) Comp:	;; Complement the word 	MCOMW	R0,R0
 	BEQL	ZSum 	RET ZSum:	;; Return 0 as FFFF  	MCOMW	R0,R0 	RET ;.Entry	Gen_Checksum,^M<R3,R4> ; 3 ;	MOVL	PtclT(AP),R0		; Start with the protocol code ) ;	ADDL	Byte_Count(AP),R0	; Add the length . ;; Do a byte swap - isn't there an easier way? ;	EXTV	#8,#8,R0,R1		; D C B A	B  ;	INSV	R0,#8,#8,R0		; D C A A	B  ;	MOVB	R1,R0			; D C A B	B ;	ROTL	#16,R0,R0		; A B D C	B  ;	EXTV	#8,#8,R0,R1		; A B D C	D  ;	INSV	R0,#8,#8,R0		; A B C C	D  ;	MOVB	R1,R0			; A B C D	D6 ;	MOVZWL	Srca0(AP),R1		; Get first word of source addr ;	ADDL	R1,R0			; Add it 7 ;	MOVZWL	Srca1(AP),R1		; Get second word of source addr  ;	ADDL	R1,R04 ;	MOVZWL	Dsta0(AP),R1		; Get first word of dest addr ;	ADDL	R1,R05 ;	MOVZWL	Dsta1(AP),R1		; Get second word of dest addr  ;	ADDL	R1,R0/ ;	BRB	Calc_Check0		; Join Calc_Checksum routine  ;  ;;++5 ;; Calc_Checksum - one's compliment checksum routine.  ;;-- ;  ;.Entry	Calc_Checksum,^M<R3,R4>  ; ( ;	CLRL	R0			; Start with a zero checksum ; 4 ;Calc_Check0:				; Point where Gen_Checksum joins in ; ( ;	MOVL	Start(AP),R4		; starting address. ;	MOVL	Byte_Count(AP),R3 ;	TSTL	R3			; anything to do?  ;	BGTR	10$			; >0 = yes. ;	RET				; 0 count.  ;10$: + ;	ASHL	#-1,R3,R3		; convert bytes to words.  ;	TSTL	R3			; any words to do?& ;	BEQL	Odd_BC			; 0 = 1 byte to do....& ;	CLRL	R1			; clean up high word of R1 ;Clop: ;	MOVW	(R4)+,R1		; get a word   ;	ADDL	R1,R0			; longword arith." ;	SOBGTR	R3,Clop			; more to come? ;  ;; Check for ODD byte count  ;  ;ODD_BC: ;	BLBC	Byte_Count(AP),Chk_OVFL5 ;	MOVZBL	(R4),R1			; get ODD byte padded with 0 byte.  ;	ADDL	R1,R0 ;  ;; Add in any overflow ; 
 ;CHk_OVFL:* ;	EXTZV	#16,#16,R0,R1		; extract overflow. ;	BEQL	Comp			; 0 = do                                                                                                                                                                                                                                                                          _        
CMUIP066.C                     e  : [CENTRAL]CENTRAL.SRC;1                                                                                                                Q                                    ne) ;	BICL2	#^XFFFF0000,R0		; AND to 16-bits.   ;	ADDL	R1,R0			; add to checksum ;	BRB	Chk_OVFL ;   ;; Complement & mask to 16-bits. ;  ;Comp:, ;	XORW	#^X0FFFF,R0		; Complement to 16-bits. ;	RET   0 .SBTTL	Circular byte queue manipulation routines  6 ; These routines are written in MACRO for two reasons:E ;    1) Speed. They are used a lot and should be as fast as possible. M ;    2) Precision. Since the circular queues can be modified at AST level, it F ;	it critical that the pointers and counters be updated atomically. We= ;	can't really trust the BLISS compiler to take care of that.   D ; Define the format of the circular queue - must match STRUCTURE.REQ   	$DEFINI CQ			; Circular queue6 $DEF	CQ$QUEUE	.BLKB	0	; Address of the queue structure4 $DEF	CQ$BASE		.BLKL	1	; Base address of queue buffer2 $DEF	CQ$END		.BLKL	1	; End address of queue buffer) $DEF	CQ$SIZE		.BLKW	1	; Size of the queue 4 $DEF	CQ$COUNT	.BLKW	1	; Number of bytes on the queue; $DEF	CQ$ENQP		.BLKL	1	; Pointer to first free byte on queue ; $DEF	CQ$DEQP		.BLKL	1	; Pointer to first used byte on queue  	$DEFEND CQ      ; CQ_Enqueue(CQ,SRC,Scount) N ; Enqueue bytes onto a circular queue. Called via $CMKRNL when enqueueing from ; user's system buffer.    CQ	= 4				; Queue header  SRC	= 8				; Destination address  SCOUNT	= 12				; Number of bytes  ' .ENTRY CQ_Enqueue,^M<R2,R3,R4,R5,R6,R7>   $ 	MOVL	CQ(AP),R7		; Get queue address9 	SUBL3	CQ$ENQP(R7),CQ$END(R7),R6 ; Find space left to end 9 	CMPL	R6,SCOUNT(AP)		; Does he want all we have till end? ( 	BLEQ	10$			; Yes - need two moves, then5 	MOVC3	SCOUNT(AP),@SRC(AP),@CQ$ENQP(R7) ; Do the move 0 	MOVL	R3,CQ$ENQP(R7)		; Update the queue pointer5 	ADDW2	SCOUNT(AP),CQ$COUNT(R7) ; And update the count  	RET$ 10$:					; Here on pointer-wrap case8 	MOVC3	R6,@SRC(AP),@CQ$ENQP(R7) ; Move till end of queue7 	MOVL	CQ$BASE(R7),R3		; Reset pointer to start of queue > 	SUBL3	R6,SCOUNT(AP),R6	; Compute how much we need from Q base! 	BLEQ	20$			; Have anything left? , 	MOVC3	R6,(R1),(R3)		; Yes - finish the copy 20$:0 	MOVL	R3,CQ$ENQP(R7)		; Update the queue pointer5 	ADDW2	SCOUNT(AP),CQ$COUNT(R7) ; And update the count  	RET				; And done.      ; CQ_Dequeue(CQ,Dest,Dcount)L ; Dequeue bytes from a cirucular queue. Called via $CMKRNL when dequeuing to ; user's system buffer.    CQ	= 4				; Queue header! DEST	= 8				; Destination address   DCOUNT	= 12				; Number of bytes  ' .ENTRY CQ_Dequeue,^M<R2,R3,R4,R5,R6,R7>   $ 	MOVL	CQ(AP),R7		; Get queue address9 	SUBL3	CQ$DEQP(R7),CQ$END(R7),R6 ; Find space left to end 9 	CMPL	R6,DCOUNT(AP)		; Does he want all we have till end? ( 	BLEQ	10$			; Yes - need two moves, then6 	MOVC3	DCOUNT(AP),@CQ$DEQP(R7),@DEST(AP) ; Do the move0 	MOVL	R1,CQ$DEQP(R7)		; Update the queue pointer5 	SUBW2	DCOUNT(AP),CQ$COUNT(R7) ; And update the count  	RET$ 10$:					; Here on pointer-wrap case9 	MOVC3	R6,@CQ$DEQP(R7),@DEST(AP) ; Move till end of queue 7 	MOVL	CQ$BASE(R7),R1		; Reset pointer to start of queue ; 	SUBL3	R6,DCOUNT(AP),R6	; Compute count we need from Q base ! 	BLEQ	20$			; Have anything left? , 	MOVC3	R6,(R1),(R3)		; Yes - finish the copy 20$:0 	MOVL	R1,CQ$DEQP(R7)		; Update the queue pointer5 	SUBW2	DCOUNT(AP),CQ$COUNT(R7) ; And update the count  	RET				; And done.      ; CQ_DeqCopy(CQ,Dest,Dcount)@ ; Same as CQ_Dequeue, except queue pointer/count is not updated.   CQ	= 4				; Queue header! DEST	= 8				; Destination address   DCOUNT	= 12				; Number of bytes  ' .ENTRY CQ_DeqCopy,^M<R2,R3,R4,R5,R6,R7>   $ 	MOVL	CQ(AP),R7		; Get queue address9 	SUBL3	CQ$DEQP(R7),CQ$END(R7),R6 ; Find space left to end 9 	CMPL	R6,DCOUNT(AP)		; Does he want all we have till end? ( 	BLEQ	10$			; Yes - need two moves, then6 	MOVC3	DCOUNT(AP),@CQ$DEQP(R7),@DEST(AP) ; Do the move3 ;;;	MOVL	R1,CQ$DEQP(R7)		; Update the queue pointer 8 ;;;	SUBW2	DCOUNT(AP),CQ$COUNT(R7) ; And update the count 	RET$ 10$:					; Here on pointer-wrap case9 	MOVC3	R6,@CQ$DEQP(R7),@DEST(AP) ; Move till end of queue 7 	MOVL	CQ$BASE(R7),R1		; Reset pointer to start of queue ; 	SUBL3	R6,DCOUNT(AP),R6	; Compute count we need from Q base ! 	BLEQ	20$			; Have anything left? , 	MOVC3	R6,(R1),(R3)		; Yes - finish the copy 20$:3 ;;;	MOVL	R1,CQ$DEQP(R7)		; Update the queue pointer 8 ;;;	SUBW2	DCOUNT(AP),CQ$COUNT(R7) ; And update the count 	RET				; And done.    .END                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      K5        CENTRAL.SRC                    U  : [CENTRAL]NETTCPIP.REQ;1                                                                                                        M     *                                        * [CENTRAL]NETTCPIP.REQ;1 +  , U   . *    /     4 M   *   ) j                   - :   0   1    2   3      K  P   W   O +    5   6 @+  7  +  8          9          G    H  J                         %(A 	****************************************************************   0 		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.  A 	****************************************************************  )% %(   Module:   	 	NetTCPIP   	 Facility:   @ 	A system wide definition file.  This file describes the various= 	structures and protocol headers used in the protocols of the  	TCP/IP suite.                                                                                                                                                                                                                                                                            |V        
CMUIP066.C                     e  : [CENTRAL]CENTRAL.SRC;1                                                                                                                Q                                     Author:   C 	Writen by Bruce R. Miller, borrowing from IP.BLI and Structure.REQ    Modification History:   & 1.2  11-Nov-1991	Henry W. Miller		USBR; 	Changed SH$ACK and SH$SEG to unsigned long as per RFC1122.   & 1.1c 29-Mar-1991	Henry W. Miller		USBR  	Defined IPH$Fragmentation_Data.  & 1.1b 07-Mar-1991	Henry W. Miller		USBR5 	Added additional ICMP parameters, including RFC1122.   & 1.1a 13-Jan-1991	Henry W. Miller		USBR/ 	Make ICMPTTL and IPTTL configurable variables.   , 1.1  11-Nov-1990	Bruce R. Miller		CMU NetDevB 	Added all the port definitions from RFC #1060 (Assigned Numbers).   )%  J LIBRARY 'CMUIP_SRC:[CENTRAL]NETXPORT'; ! Get the BLISS field def. library.   LITERAL      ! Define IP-based protocols 4     ICMP_Protocol       = 1,    ! ICMP protocol code.     TCP_Protocol        = 6,    ! TCP protocol3     UDP_Protocol        = 17,   ! UDP protocol code   ;     TCP_PORT_TCPMUX	=     1,	! TCP Port Service Multiplexer ,     TCP_PORT_RJE	=     5,	! Remote Job Entry!     TCP_PORT_ECHO	=     7,	! Echo '     TCP_PORT_DISCARD	=     9,	! Discard *     TCP_PORT_USERS	=    11,	! Active Users'     TCP_PORT_DAYTIME	=    13,	! Daytime .     TCP_PORT_QUOTE	=    17,	! Quote of the Day3     TCP_PORT_CHARGEN	=    19,	! Character Generator =     TCP_PORT_FTP_DATA	=    20,	! File Transfer [Default Data] 3     TCP_PORT_FTP	=    21,	! File Transfer [Control] %     TCP_PORT_TELNET	=    23,	! Telnet 1     TCP_PORT_SMTP	=    25,	! Simple Mail Transfer 1     TCP_PORT_NSW_FE	=    27,	! NSW User System FE '     TCP_PORT_MSG_ICP	=    29,	! MSG ICP 3     TCP_PORT_MSG_AUTH	=    31,	! MSG Authentication 4     TCP_PORT_DSP	=    33,	! Display Support Protocol5     TCP_PORT_Prv_PS	=    35,	! private printer server !     TCP_PORT_TIME	=    37,	! Time 6     TCP_PORT_RLP	=    39,	! Resource Location Protocol)     TCP_PORT_GRAPHICS	=    41,	! Graphics 3     TCP_PORT_NAMESERVER	=    42,	! Host Name Server &     TCP_PORT_NICNAME	=    43,	! Who Is4     TCP_PORT_MPM_FLAGS	=    44,	! MPM FLAGS Protocol<     TCP_PORT_MPM	=    45,	! Message Processing Module [recv]2     TCP_PORT_MPM_SND	=    46,	! MPM [default send]%     TCP_PORT_NI_FTP	=    47,	! NI FTP 1     TCP_PORT_LOGIN	=    49,	! Login Host Protocol @     TCP_PORT_LA_MAINT	=    51,	! IMP Logical Address Maintenance1     TCP_PORT_DOMAIN	=    53,	! Domain Name Server 4     TCP_PORT_ISI_GL	=    55,	! ISI Graphics Language6     TCP_PORT_Prv_TA	=    57,	! private terminal access3     TCP_PORT_Prv_FS	=    59,	! private file service '     TCP_PORT_NI_MAIL	=    61,	! NI MAIL 1     TCP_PORT_VIA_FTP	=    63,	! VIA Systems - FTP 9     TCP_PORT_TACACS_DS	=    65,	! TACACS-Database Service 8     TCP_PORT_BOOTPS	=    67,	! Bootstrap Protocol Server8     TCP_PORT_BOOTPC	=    68,	! Bootstrap Protocol Client2     TCP_PORT_TFTP	=    69,	! Trivial File Transfer3     TCP_PORT_NETRJS_1	=    71,	! Remote Job Service 3     TCP_PORT_NETRJS_2	=    72,	! Remote Job Service 3     TCP_PORT_NETRJS_3	=    73,	! Remote Job Service 3     TCP_PORT_NETRJS_4	=    74,	! Remote Job Service <     TCP_PORT_Prv_DOS	=    75,	! any private dial out service7     TCP_PORT_Prv_RJE	=    77,	! any private RJE service %     TCP_PORT_FINGER	=    79,	! Finger 4     TCP_PORT_HOSTS2_NS	=    81,	! HOSTS2 Name Server0     TCP_PORT_MIT_ML_DEV1=    83,	! MIT ML Device0     TCP_PORT_MIT_ML_DEV2=    85,	! MIT ML Device4     TCP_PORT_Prv_TL	=    87,	! private terminal link7     TCP_PORT_SU_MIT_TG	=    89,	! SU/MIT Telnet Gateway 1     TCP_PORT_MIT_DOV	=    91,	! MIT Dover Spooler 3     TCP_PORT_DCP	=    93,	! Device Control Protocol %     TCP_PORT_SUPDUP	=    95,	! SUPDUP D     TCP_PORT_SWIFT_RVF	=    97,	! Swift Remote Vitural File Protocol(     TCP_PORT_TACNEWS	=    98,	! TAC News/     TCP_PORT_METAGRAM	=    99,	! Metagram Relay 5     TCP_PORT_HOSTNAME	=   101,	! NIC Host Name Server )     TCP_PORT_ISO_TSAP	=   102,	! ISO-TSAP !     TCP_PORT_X400	=   103,	! X400 )     TCP_PORT_X400_SND	=   104,	! X400-SND 8     TCP_PORT_CSNET_NS	=   105,	! Mailbox Name Nameserver5     TCP_PORT_RTELNET	=   107,	! Remote Telnet Service =     TCP_PORT_POP2	=   109,	! Post Office Protocol - Version 2 =     TCP_PORT_POP3	=   110,	! Post Office Protocol - Version 3 8     TCP_PORT_SUNRPC	=   111,	! SUN Remote Procedure Call3     TCP_PORT_AUTH	=   113,	! Authentication Service :     TCP_PORT_SFTP	=   115,	! Simple File Transfer Protocol3     TCP_PORT_UUCP_PATH	=   117,	! UUCP Path Service ;     TCP_PORT_NNTP	=   119,	! Network News Transfer Protocol ?     TCP_PORT_ERPC	=   121,	! Encore Expedited Remote Proc. Call 1     TCP_PORT_NTP	=   123,	! Network Time Protocol C     TCP_PORT_LOCUS_MAP	=   125,	! Locus PC-Interface Net Map Server @     TCP_PORT_LOCUS_CON	=   127,	! Locus PC-Interface Conn Server:     TCP_PORT_PWDGEN	=   129,	! Password Generator Protocol/     TCP_PORT_CISCO_FNA	=   130,	! CISCO FNATIVE /     TCP_PORT_CISCO_TNA	=   131,	! CISCO TNATIVE 0     TCP_PORT_CISCO_SYS	=   132,	! CISCO SYSMAINT2     TCP_PORT_STATSRV	=   133,	! Statistics Service5     TCP_PORT_INGRES_NET	=   134,	! INGRES-NET Service 0     TCP_PORT_LOC_SRV	=   135,	! Location Service5     TCP_PORT_PROFILE	=   136,	! PROFILE Naming System 7     TCP_PORT_NETBIOS_NS	=   137,	! NETBIOS Name Service ;     TCP_PORT_NETBIOS_DGM=   138,	! NETBIOS Datagram Service :     TCP_PORT_NETBIOS_SSN=   139,	! NETBIOS Session Service5     TCP_PORT_EMFIS_DATA	=   140,	! EMFIS Data Service 8     TCP_PORT_EMFIS_CNTL	=   141,	! EMFIS Control Service.     TCP_PORT_BL_IDM	=   142,	! Britton-Lee IDM=     TCP_PORT_IMAP2	=   143,	! Interim Mail Access Protocol v2 !     TCP_PORT_NEWS	=   144,	! NewS *     TCP_PORT_UAAC	=   145,	! UAAC Protocol'     TCP_PORT_ISO_TP0	=   146,	! ISO-IP0 %     TCP_PORT_ISO_IP	=   147,	! ISO-IP -     TCP_PORT_CRONUS	=   148,	! CRONUS_SUPPORT 9     TCP_PORT_AED_512	=   149,	! AED 512 Emulation Service '     TCP_PORT_SQL_NET	=   150,	! SQL-NET !     TCP_PORT_HEMS	=   151,	! HEMS =     TCP_PORT_BFTP	=   152,	! Background File Transfer Program !     TCP_PORT_SGMP	=   153,	! SGMP (     TCP_PORT_NETSC_PROD	=   154,	! NETSC'     TCP_PORT_NETSC_DEV	=   155,	! NETSC *     TCP_PORT_SQLSRV	=   156,	! SQL ServiceA     TCP_PORT_KNET_CM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          xkN        CENTRAL.SRC                    U  : [CENTRAL]NETTCPIP.REQ;1                                                                                                        M     *                         $             P	=   157,	! KNET/VM Command/Message Protocol 0     TCP_PORT_PCMail_SRV	=   158,	! PCMail Server.     TCP_PORT_NSS_Routing=   159,	! NSS-Routing-     TCP_PORT_SGMP_TRAPS	=   160,	! SGMP-TRAPS !     TCP_PORT_SNMP	=   161,	! SNMP )     TCP_PORT_SNMPTRAP	=   162,	! SNMPTRAP 3     TCP_PORT_CMIP_Manage=   163,	! CMIP/TCP Manager 1     TCP_PORT_CMIP_Agent	=   164,	! CMIP/TCP Agent (     TCP_PORT_XNS_Courier=   165,	! Xerox,     TCP_PORT_S_Net	=   166,	! Sirius Systems!     TCP_PORT_NAMP	=   167,	! NAMP !     TCP_PORT_RSVD	=   168,	! RSVD !     TCP_PORT_SEND	=   169,	! SEND 4     TCP_PORT_Print_SRV	=   170,	! Network PostScript?     TCP_PORT_Multiplex	=   171,	! Network Innovations Multiplex 5     TCP_PORT_CL_1	=   172,	! Network Innovations CL/1 )                                                                                                                                                                                                                                                                           k6        
CMUIP066.C                     e  : [CENTRAL]CENTRAL.SRC;1                                                                                                                Q                        5                TCP_PORT_Xyplex_MUX	=   173,	! Xyplex #     TCP_PORT_MAILQ	=   174,	! MAILQ #     TCP_PORT_VMNET	=   175,	! VMNET -     TCP_PORT_GENRAD_MUX	=   176,	! GENRAD-MUX @     TCP_PORT_XDMCP	=   177,	! X Display Manager Control Protocol7     TCP_PORT_NextStep	=   178,	! NextStep Window Server*3     TCP_PORT_BGP	=   179,	! Border Gateway Protocol &     TCP_PORT_RIS	=   180,	! Intergraph#     TCP_PORT_Unify	=   181,	! Unify -     TCP_PORT_Unisys_Cam	=   182,	! Unisys-Cam )     TCP_PORT_OCBinder	=   183,	! OCBindert)     TCP_PORT_OCServer	=   184,	! OCServer -     TCP_PORT_Remote_KIS	=   185,	! Remote-KISs(     TCP_PORT_KIS	=   186,	! KIS Protocol?     TCP_PORT_ACI	=   187,	! Application Communication Interfacea#     TCP_PORT_MUMPS	=   188,	! MUMPSh1     TCP_PORT_QFT	=   189,	! Queued File Transport <     TCP_PORT_GACP	=   190,	! Gateway Access Control Protocol)     TCP_PORT_Prospero	=   191,	! Prosperoa=     TCP_PORT_OSU_NMS	=   192,	! OSU Network Monitoring Systemu>     TCP_PORT_SRMP	=   193,	! Spider Remote Monitoring Protocol8     TCP_PORT_IRC	=   194,	! Internet Relay Chat ProtocolC     TCP_PORT_DN6_NLM_AUD=   195,	! DNSIX Network Level Module Audit J     TCP_PORT_DN6_SMM_RED=   196,	! DNSIX Session Mgt Module Audit Redirect6     TCP_PORT_DLS	=   197,	! Directory Location ServiceB     TCP_PORT_DLS_Mon	=   198,	! Directory Location Service Monitor=     TCP_PORT_AT_RMTP	=   201,	! AppleTalk Routing MaintenanceR5     TCP_PORT_AT_NBP	=   202,	! AppleTalk Name BindingC-     TCP_PORT_AT_3	=   203,	! AppleTalk UnusedR.     TCP_PORT_AT_ECHO	=   204,	! AppleTalk Echo-     TCP_PORT_AT_5	=   205,	! AppleTalk Unused 9     TCP_PORT_AT_ZIS	=   206,	! AppleTalk Zone Informationn-     TCP_PORT_AT_7	=   207,	! AppleTalk Unusedf-     TCP_PORT_AT_8	=   208,	! AppleTalk UnusedR3     TCP_PORT_SUR_MEAS	=   243,	! Survey Measurement !     TCP_PORT_LINK	=   245,	! LINK 8     TCP_PORT_DSP3270	=   246,	! Display Systems Protocol         ! UDP ports (RFC1060)E!     UDP_PORT_ECHO	=     7,	! Echol'     UDP_PORT_DISCARD	=     9,	! DiscardP*     UDP_PORT_USERS	=    11,	! Active Users'     UDP_PORT_DAYTIME	=    13,	! Daytime .     UDP_PORT_QUOTE	=    17,	! Quote of the Day3     UDP_PORT_CHARGEN	=    19,	! Character GeneratorC!     UDP_PORT_TIME	=    37,	! Timet3     UDP_PORT_NAMESERVER	=    42,	! Host Name ServerD&     UDP_PORT_NICNAME	=    43,	! Who Is1     UDP_PORT_DOMAIN	=    53,	! Domain Name ServerE8     UDP_PORT_BOOTPS	=    67,	! Bootstrap Protocol Server8     UDP_PORT_BOOTPC	=    68,	! Bootstrap Protocol Client2     UDP_PORT_TFTP	=    69,	! Trivial File Transfer%     UDP_PORT_FINGER	=    79,	! Finger 8     UDP_PORT_SUNRPC	=   111,	! SUN Remote Procedure Call3     UDP_PORT_AUTH	=   113,	! Authentication Servicea:     UDP_PORT_SFTP	=   115,	! Simple File Transfer Protocol1     UDP_PORT_NTP	=   123,	! Network Time Protocol :     UDP_PORT_PWDGEN	=   129,	! Password Generator Protocol0     UDP_PORT_LOC_SRV	=   135,	! Location Service!     UDP_PORT_SNMP	=   161,	! SNMPi)     UDP_PORT_SNMPTRAP	=   162,	! SNMPTRAPT3     UDP_PORT_CMIP_Manage=   163,	! CMIP/TCP Managerr1     UDP_PORT_CMIP_Agent	=   164,	! CMIP/TCP Agent 3     UDP_PORT_BGP	=   179,	! Border Gateway Protocol 8     UDP_PORT_IRC	=   194,	! Internet Relay Chat Protocol       ! Define more UDP portsc     UDP_PORT_NFS 		= 2049;   e  ' %SBTTL 'IP header structure definition'T  G ! This section defines the Internet Protcol (IP) header.  This protocolTH ! header is placed in front of the protocol and data from higher layers.   $FIELD IP_Header =     SETe      IPH$Type_service		= [$Byte],        $Overlay(IPH$Type_service)!       IPH$Swap_IHL		= [$Bits(4)],G       $Continue      IPH$IHL			= [$Bits(4)],!     IPH$Version 		= [$Bits(4)],_$     IPH$Total_Length		= [$Bytes(2)],     IPH$Ident			= [$Bytes(2)],)     IPH$Fragmentation_Data	= [$Bytes(2)], &       $OVERLAY(IPH$Fragmentation_Data)(       IPH$Fragment_offset	= [$Bits(13)],        IPH$Flags		 	= [$Bits(3)],         $OVERLAY(IPH$FLAGS) 1           IPH$MF		= [$Bit],	! More fragments flage,           IPH$DF		= [$Bit],	! Don't fragment,           IPH$UNUSED		= [$Bit],	! Unused bit         $CONTINUE        $CONTINUE_     IPH$Protocol		= [$Byte],     IPH$TTL			= [$Byte],      IPH$Checksum		= [$Bytes(2)],     IPH$Source			= [$Bytes(4)],m     IPH$Dest			= [$Bytes(4)]     TES;   LITERALn     IP_Size  = $FIELD_set_size;C MACROP4     IP_Structure = BLOCK[IP_Size] FIELD(IP_Header)%;   LITERAL :     IP_hdr_shwd_size	= 10,	!IP header size in 16 bit wordsC     IP_hdr_swap_size	= 6,	!Number of words of IP header to byteswap_7     IP_hdr_wd_size	= 5,	!IP header size in 32 bit wordsv5     IP_version		= 4,	!IP version number from DoD specI! !    IPTTL = 60,			! Time-to-livea"     IPTOS = 0,			! Type of service%     IPDF = 1,			! Don't fragment flag   ) ! Max bytesize of IP header with options.T ! *** WARNING ***S !	MUST be a multiple of 4.       IP_hdr_byte_size =  20,r  E ! Device dependent header (bytes).  Currently covers NSC hyperchannelM% ! message-proper & interlan ethernet.  ! *** WARNING ***  !	MUST be a multiple of 4.F !!!HACK!!! What a hack!!!  Get rid of this.  Calculate it at run time!     Device_Header	= 68;X   N  % %SBTTL 'ICMP message definitions'    T   ! ICMP message types LITERALe!     ICM_EREPLY = 0,		! Echo reply	0     ICM_DUNREACH = 3,		! Destination Unreachable* 	ICM_DUNR_NET = 0,	! (network unreachable)( 	ICM_DUNR_HOST = 1,	! (host unreachable)0 	ICM_DUNR_PROTOCOL = 2,	! (protocol unreachable)( 	ICM_DUNR_PORT = 3,	! (port unreachable)0 	ICM_DUNR_FRAGMENT = 4,	! (fragmentation needed)/ 	ICM_DUNR_SRCROUTE = 5,	! (source route failed) * 	ICM_DUNR_NET_UNK = 6,	! (network unknown)( 	ICM_DUNR_HOST_UNK = 7,	! (host unknown)) 	ICM_DUNR_HOST_ISO = 8,	! (host isolated)P/ 	ICM_DUNR_NET_FORBID = 9,	! (network forbidden) - 	ICM_DUNR_HOST_FORBID = 10,	! (host forbiden)o4 	ICM_DUNR_NET_TOS = 11,		! (net unavailable for TOS)6 	ICM_DUNR_HOST_TOS = 12,		! (host unavailable for TOS)     ICM_SQUENCH = 4,"     ICM_REDIRECT = 5,			! Redirect, 	ICM_REDIRECT_NET = 0,		! (Redirect Network)* 	ICM_REDIRECT_HOST = 1,		! (Redirect Host)5 	ICM_REDIRECT_TOS_NET = 2,	! (Redirect TOS & Network)C3 	ICM_REDIRECT_TOS_HOST = 3,	! (Redirect TOS & Host)S     ICM_ECHO = 8,s     ICM_TEXCEED = 11,O< 	ICM_TEXCEED_INTRANS = 0,    ! TTL exceeded while in transit@ 	ICM_TEXCEED_FRAG_REASS = 1, ! Fragment reassambly time exceeded     ICM_PPROBLEM = 12,     ICM_TSTAMP = 13,     ICM_TSREPLY = 14,m     ICM_IREQUEST = 15,     ICM_IREPLY = 16,     ICM_AMREQUEST = 17,      ICM_AMREPLY = 18,S     ICM_MIN = ICM_EREPLY,n     ICM_MAX = ICM_AMREPLY;  J ! This section defines the Internet Control Message Protcol (ICMP) header.   $FIELD ICMP_Header =     SET_9     ICM$EXT1	= [$Bytes(4)],	! Blanket for first longword.	     $OVERLAY(ICM$EXT1)) 	ICM$CODE	= [$Byte],	! Type-specific codew' 	ICM$TYPE	= [$Byte],	! ICMP packet typet4 	ICM$CKS                                                                                                                                                                                                                                                                           	yL        CENTRAL.SRC                    U  : [CENTRAL]NETTCPIP.REQ;1                                                                                                        M     *                         >             UM	= [$Bytes(2)],	! Checksum of ICMP portion     $CONTINUE /     ICM$VAR	= [$Bytes(4)],	! Type-specific dataC;     ICM$DATA	= [$Bytes(0)],	! Type-specific additional datat   ! Type-specific fields:S   ! Echo request and reply (0,8)                                                                                                                                                                                                                                                                               &t        
CMUIP066.C                     e  : [CENTRAL]CENTRAL.SRC;1                                                                                                                Q                                      $OVERLAY(ICM$VAR)M* 	ICM$E_ID=[$Bytes(2)],	! Echo - identifier0 	ICM$E_SEQ=[$bytes(2)],	! Echo - sequence number     $CONTINUEC  ) ! Types with an unused VAR field (3,4,11)O       $OVERLAY(ICM$VAR)E5 	ICM$TYP_UNUSED=[$Bytes(4)],	! Unused.  Must be zero.C     $CONTINUE	   ! Redirect messages (5)M       $OVERLAY(ICM$VAR)_8 	ICM$R_GWY=[$Bytes(4)],	! Redirect - new gateway address     $CONTINUE,  ! ! Parameter Problem messages (12)P     $OVERLAY(ICM$VAR)  	ICM$P_PTR=[$Byte],  	ICM$P_UNUSD=[$Bytes(3)],T     $CONTINUE6  % ! Timestamp request and reply (13,14)        $OVERLAY(ICM$VAR) / 	ICM$T_ID=[$Bytes(2)],	! Timestamp - identifiern5 	ICM$T_SEQ=[$Bytes(2)],	! Timestamp - sequence numberO     $CONTINUE6  ' ! Information request and reply (15,16)6       $OVERLAY(ICM$VAR)R1 	ICM$I_ID=[$Bytes(2)],	! Information - identifierS7 	ICM$I_SEQ=[$Bytes(2)],	! Information - sequence numbert     $CONTINUEM  ' ! Information request and reply (17,18)t       $OVERLAY(ICM$VAR)	2 	ICM$A_ID=[$Bytes(2)],	! Address Mask - identifier7 	ICM$A_SEQ=[$Bytes(2)]	! Address Mask - sequence number	     $CONTINUEC     TES;   LITERAL	!     ICMP_Size  = $FIELD_set_size, $     ICMP_Header_Size  = ICMP_Size*4;   MACRO7:     ICMP_Structure = BLOCK[ICMP_Size] FIELD(ICMP_Header)%;   LITERAL!2     Max_ICMP_Data_Size = 512,	! Max ICMP data size" !    ICMPTTL = 60,		! Time-to-live#     ICMPTOS = 0,		! Type of serviceC'     ICMPDF = 1;			! Don't fragment flagO   i  $ %SBTTL 'UDP message definitions'      < ! This section defines the User Datagram Protcol structures.  8 ! Define the structure of a UDP packet (after IP header)   $FIELD UDPkt_Fields =1     SET 3     UP$Source_Port	= [$Bytes(2)], ! UDP source portm6     UP$Dest_Port	= [$Bytes(2)], ! UDP destination portA     UP$Length		= [$Bytes(2)], ! UDP length (including UDP header)TH     UP$Checksum		= [$Bytes(2)], ! UDP checksum (including pseudo-header),     UP$Data		= [$Bytes(0)]  ! UDP data start     TES;   LITERALi#     UDPkt_Length = $Field_Set_Size, %     UDP_Header_Size = UDPkt_Length*4;l   MACRO_@     UDPkt_Structure = BLOCK[UDPkt_Length] FIELD(UDPkt_Fields) %; M  $ %SBTTL 'TCP message definitions'      C ! This section defines the Transmission Control Protcol structures.u   e  %SBTTL 'TCP Segment definition.'   %(F  This definition covers the entire TCP segment structure which is sent?  to IP.  For field definitions see the DARPA TCP specification.t    : 	=========================================================
 	!							! 	+			TCP Header			+0
 	!							!: 	---------------------------------------------------------
 	!							! 	+			   Data				+p
 	!							!: 	=========================================================   )%   $FIELD Segment_Fields=     SETk0     SH$Source_Port		= [$Bytes(2)],	! Source port3     SH$Dest_Port		= [$Bytes(2)],	! Destination portr*     SH$Seq			= [$ULong],	! Sequence number%     SH$ACK			= [$ULong],	! ACK number ;     SH$Control_Flags		= [$Bytes(2)],	! For Fast flag clear.T     $OVERLAY(SH$Control_Flags) 	SH$C_All_FLAGS		= [$Bits(12)],  	SH$Data_Offset		= [$Bits(4)],     $CONTINUE      $OVERLAY(SH$C_All_flags)* 	SH$C_FIN		= [$Bit],	! FIN (close) control) 	SH$C_SYN		= [$Bit],	! SYN (open) control $ 	SH$C_RST		= [$Bit],	! RESET control# 	SH$C_EOL		= [$Bit],	! PUSH controlS. 	SH$C_ACK		= [$Bit],	! ACK control (ACK valid). 	SH$C_URG		= [$Bit],	! URG control (URG valid)& 	SH$Rsvrd		= [$Bits(6)],	! Unused bits     $CONTINUE 4     $OVERLAY(SH$Control_Flags)			! Byteswapped flags 	SH$BS_C_Rsvrd1		= [$Bits(4)],  	SH$BS_Data_Offset	= [$Bits(4)], 	SH$BS_C_FIN		= [$Bit],  	SH$BS_C_SYN		= [$Bit],, 	SH$BS_C_RST		= [$Bit],S 	SH$BS_C_EOL		= [$Bit],t 	SH$BS_C_ACK		= [$Bit],_ 	SH$BS_C_URG		= [$Bit],e 	SH$BS_C_Rsvrd2		= [$Bits(2)],     $CONTINUE!6     SH$Window			= [$UWord],	! Window beyond this seq #4     SH$CheckSum			= [$SWord],	! Segment TCP checksum7     SH$Urgent			= [$UWord],	! Urgent pointer if URG set 3     SH$Data			= [$Bytes(0)]	! Start of segment data!     TES;   ! Segment TCP options6   $FIELD TCP$OPT_FIELDS =T     SETa)     TCP$OPT_KIND	= [$Byte],	! Option typeT-     TCP$OPT_LENGTH	= [$Byte],	! Option length_@     TCP$OPT_DATA	= [$Bytes(0)],	! Additional data for the option     $OVERLAY(TCP$OPT_DATA)5       TCP$OPT_DBYTE	= [$Byte],	! One-byte option dataN     $CONTINUE      $OVERLAY(TCP$OPT_DATA)9       TCP$OPT_DWORD	= [$Bytes(2)],	! Two-byte option datar     $CONTINUEe     $OVERLAY(TCP$OPT_DATA)9       TCP$OPT_DLONG	= [$Bytes(4)]	! Four-byte option datay4     $CONTINUE				!(others require harder processing)     TES; LITERAL #     TCP$OPT_SIZE = $FIELD_SET_SIZE;  MACROp@     TCP$OPT_BLOCK = BLOCK[TCP$OPT_SIZE] FIELD(TCP$OPT_FIELDS) %;   LITERAL$/     TCP$OPT_KIND_EOL = 0,	! End of options list (     TCP$OPT_KIND_NOP = 1,	! No-OP option7     TCP$OPT_KIND_MSS = 2,	! Maximum-segment-size optionE  <     TCP$OPT_LENGTH_MSS = 4;	! Expected length for MSS option    L ! Segment sizes in bytes. actually the following macro is used primarily forB ! mapping attributes to a dynamic data segment via "ref" pointers.   LITERALr%     Seg_Allocation = $Field_Set_Size;	 MACROdF     Segment_Structure = Block[Seg_Allocation] Field(Segment_Fields) %,M     Control_Segment_Structure = BLOCK[Seg_Allocation] Field(Segment_Fields)%;=    # ! TCP Segment: header & data sizes.4   LITERAL;-     TCP_Data_Offset = 5,			! in 32-bit words. 4     TCP_Header_Size = TCP_Data_OffSet*4,	! in bytes.< !    Default_Data_Size = 1392,			! default: max size of user:     Default_Data_Size = 536,			! default: max size of user 						! data per segment.    ! segment option parametersd  -    opt$seg_dataSize = 2,			! MSS option valueP6    opt$max_recv_dataSize = 1392; 		! MSS default value  -livea"     IPTOS = 0,			! Type of service%     IPDF = 1,			! Don't fragment flag   ) ! Max bytesize of IP header with options.T ! *** WARNING ***S                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Qed        
CMUIP066.C                     e  : [CENTRAL]CENTRAL.SRC;1                                                                                                                Q                                                                
        CENTRAL.SRC                      : [CENTRAL]NETFNAMES.C;1                                                                                                         N                                             * [CENTRAL]NETFNAMES.C;1 +  ,    .     /     4 N      
 V                    - :   0   1    2   3      K  P   W   O     5   6 z+  7 ` +  8          9          G    H  J                          /*A 	****************************************************************   0 		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.  A 	****************************************************************  */ #include stdio #include ctype  . int FNAME_NET_TO_VMS(unix_fn,ulen,vms_fn,dirp)     char *unix_fn,*vms_fn;     int ulen;      int dirp;  { N /* !!!HACK!!! Why don't we check for the end of vms_fn??? (cause were lazy) */
     int i;     char c;      int upmode_flag = 0;     int dotp = 0, lastdot = -1;      char *vs;   <     /* find last dot in file (for directory translations) */     for (i=0; i<ulen; i++)" 	if (unix_fn[i]=='.') lastdot = i;  (     for (i=0,vs = vms_fn; i<ulen; i++) { 	c = unix_fn[i];   	if (isalpha(c)) {% 	    if (!!islower(c) == upmode_flag) . 		{ *vs++ = '$'; upmode_flag = !upmode_flag; } 	    *vs++ = toupper(c); 	    continue; 	    }   	/* Leave digits alone */ ) 	if (isdigit(c)) { *vs++ = c; continue; }   6 	/* Check for hyphens and underscores - they are OK */ 	if ((c == '-') || (c == '_')) 	{ 	    *vs++ = c;  	    continue; 	}   	/* A dot? */  	if (c=='.')= 	    if (!dotp && !dirp) { *vs++ = '.'; dotp = 1; continue; }    	/* escape the escape */4 	if (c=='$') { *vs++ = '$'; *vs++ = '$'; continue; }    7 	/* Since it's not alpha numeric, it must be escaped */  	*vs++ = '$';    	/* run the gauntlet */ 2 	if (c==0)	{ *vs++ = '6'; *vs++ = 'A'; continue; }: 	if (c<=032)	{ *vs++ = '4'; *vs++ = 'A'+c-001;	continue; }; 	if (c<040)	{ *vs++ = '6'; *vs++ = 'B'+(c-033);	continue; } 6 	if (c==' ')	{ *vs++ = '7'; *vs++ = 'A'; 		continue; }; 	if (c<058)	{ *vs++ = '5'; *vs++ = 'A'+(c-041);	continue; } 5 	if (c==':')	{ *vs++ = '5'; *vs++ = 'Z';		continue; } ; 	if (c<077)	{ *vs++ = '7'; *vs++ = 'B'+(c-073);	continue; } = 	if (c<0140)	{ *vs++ = '8'; *vs++ = 'A'+(c-0100);	continue; } 6 	if (c==0140)	{ *vs++ = '9'; *vs++ = 'A';		continue; }< 	if (c<200)	{ *vs++ = '9'; *vs++ = 'B'+(c-0172);	continue; }   	sprintf(vs,"%3o",c);  vs += 3;  	}        if ((lastdot == -1) || dirp) 	*vs++ = '.';        *vs = 0;       return(vs-vms_fn); }     4 int FNAME_VMS_TO_NET(vms_fn,vlen,unix_fn,dirp,vclip)     char *vms_fn,*unix_fn;     int vlen;      int dirp,vclip;  {      char c,*us=unix_fn;      int i,upmode_flag=0;  )     for (i=0,us = unix_fn; i<vlen; i++) {  	c = vms_fn[i];    	/* handle letters */  	if (isalpha(c)) { 	    if (upmode_flag)  		*us++ = toupper(c);  	    else *us++ = tolower(c);  	    continue; 	    }   	/* Leave digits alone */  	if (isdigit(c)) { 	    *us++ = c;  	    continue; 	    }   	/* clip version number */7 	if ((c==';') && vclip) { *us=0; return (us-unix_fn); }   " 	/* handle escape character ($) */ 	if (c=='$') {? 	    char c2 = vms_fn[i+1], c3 = vms_fn[i+2], c4 = vms_fn[i+3];    	    /* a double escape */4 	    if (c2=='$') { *us++ = vms_fn[++i]; continue; }   	    /* a case switch */? 	    if (isalpha(c2)) { upmode_flag = !upmode_flag; continue; }   " 	    if ((c2>='4') && (c2<='9')) { 		int rc = -1;   		switch (c2) { = 		    case '4' : { if (isupper(c3)) rc = c3+001-'A'; break; } ) 		    case '5' : { if (c3=='Z') rc = ':'; / 		    		 else if (isupper(c3)) rc = c3+041-'A';   				 break; 			       } ' 		    case '6' : { if (c3=='A') rc = 0; / 		    		 else if (isupper(c3)) rc = c3+033-'B';  				 break;  			       } ) 		    case '7' : { if (c3=='A') rc = ' '; / 		    		 else if (isupper(c3)) rc = c3+073-'B';  				 break;  			       } > 		    case '8' : { if (isupper(c3)) rc = c3+0100-'A'; break; }* 		    case '9' : { if (c3=='A') rc = 0140;0 		    		 else if (isupper(c3)) rc = c3+0172-'B'; 				 break;  			       }  		    } . 		if (rc>=0) { i += 2; *us++ = rc; continue; } 		}    	    /* got an octal code? */ 5 	    if (isdigit(c2) && isdigit(c3) && isdigit(c4)) {   		*us++ = c2*0100 + c3*010 + c4;	 		i += 3;  		continue;  		}    	    }   	*us++ = c;  	}       if (*(us-1) == '.') 	 	us -= 1; D     else if (!strncmp(us-4, ".dir", 4) || !strncmp(us-4, ".DIR", 4))	 	us -= 4;        *us = 0;       return (us-unix_fn); }                                                                                                                                                                                                                                                                                                                                                                                                                                           	                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                
CMUIP066.C                     e  : [CENTRAL]CENTRAL.SRC;1                                                                                                                Q                        l                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Cs        CENTRAL.SRC                       	}  [CENTRAL.INCLUDE]CMUDTYPE.H;1                                                                                                  O                              \               * [CENTRAL.INCLUDE]CMUDTYPE.H;1 +  ,     .     /     4 O       2                    - 	}    0   1    2   3      K  P   W   O     5   6 `r`+  7 ^+  8          9          G    H  J                   /*A 	****************************************************************   0 		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.  A 	****************************************************************  */ /*++O *******************************************************************************  *  * TITLE:    CMUDType.H *  * VERSION:  V1.0 *  * FACILITY:  * 	 *   VAX C  *  * ABSTRACT:  * L *   C header file defining some of the CMU-OpenVMS/IP data types needed for # *   using CMU-OpenVMS/IP from VAX C  *  * ENVIRONMENT: *  *   VAX/VMS  * % * AUTHOR:   Art Stine, Clarkson U/ERC 3 *           Copyright (c) 1990, Clarkson University  * ! * CREATION DATE:    January, 1990  *  * MODIFIED BY: * O *******************************************************************************  *--*/    #include <descrip.h> #define NUL       '\0'   struct cmu$text { 3         struct cmu$text *txt$a_flink, *txt$a_blink; *         struct dsc$descriptor *txt$q_desc; };                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           * [CENTRAL.INCLUDE]CMUNETDEF.H;1 +  , D&   .     /     4 O       6                   - 	}    0   1    2   3      K  P   W   O     5   6 ۢm+  7  (_+  8          9          G    H  J                  /*A 	****************************************************************   0 		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.  A 	****************************************************************  */ /*++O *******************************************************************************  *  * TITLE:    CMUNetDef.H  *  * VERSION:  V1.0 *  * FACILITY:  *  *   CMU-OpenVMS/IP *  * ABSTRACT:  * ? *   C header file defining a number of the common constants and ! *   structures for CMU-OpenVMS/IP  *  * ENVIRONMENT: *  *   VAX/VMS  * ) * AUTHOR:       Art Stine, Clarkson U/ERC 7 *               Copyright (c) 1990, Clarkson University  * ! * CREATION DATE:    January, 1990  *  * MODIFIED BY: * ) *	12-Nov-1990	Bruce R. Miller		CMU NetDev / *	WARNING!!!!  This file is bogus and obselete!  * O *******************************************************************************  *--*/    /*" #define TCP$OPEN        IO$_CREATE" #define TCP$CLOSE       IO$_DELETE% #define TCP$SEND        IO$_WRITEVBLK $ #define TCP$RECEIVE     IO$_READVBLK$ #define TCP$ABORT       IO$_DEACCESS& #define TCP$STATUS      IO$_ACPCONTROL" #define TCP$INFO        IO$_MODIFY #define IP_HOSTNAME_SIZE                           128  #define Passive_Open    0  #define Active_Open     1  #define Wait            0  #define NoWait          1  #define TCP_Protocol    0  #define UDP_Protocol    1  #define Push            1  #define NoPush          0  #define Urgent          1  #define NoUrgent        0  #define NormalClose     0  #define AbortClose      1    struct cmutcp_info_block     { $       unsigned char fhost_name_size;$       unsigned char lhost_name_size;*       char foreign_host[IP_HOSTNAME_SIZE];       unsigned short unused1;         unsigned int foreign_port;(       char local_host[IP_HOSTNAME_SIZE];       unsigned int local_port;       struct ipaddr 	         {            unsigned char octet1;            unsigned char octet2;            unsigned char octet3;            unsigned char octet4;          } local, foreign;      };   struct cmutcp_status_block     {          short bytes_avail;         char state, last_state;          int send_window;         int recv_window;         int owner_pid;     }; */                                                                                                                                                                                                                        * [CENTRAL.INCLUDE]CMUNETERROR.H;1 +  , 	\   .     /     4 O                          - 	}    0   1    2   3      K  P   W   O     5   6 rR+  7 __+  8          9          G    H  J                /*A 	****************************************************************   0 		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.  A 	****************************************************************  */ /*++O *******************************************************************************  *  * TITLE:    CMUNetError.H  *  * VERSION:  V1.0 *  * FACILITY:                                                                                                                                                                                                                                                                            9"        
CMUIP066.C                     e  : [CENTRAL]CENTRAL.SRC;1                                                                                                                Q                        G`            *  *   CMU-OpenVMS/IP *  * ABSTRACT:  * A *   C header file defining CMU-OpenVMS/IP error message constants  *  * ENVIRONMENT: *  *   VAX/VMS      * % * AUTHOR:   Art Stine, Clarkson U/ERC 3 *           Copyright (c) 1990, Clarkson University  * ! * CREATION DATE:    January, 1990  *  * MODIFIED BY: * & * 1-001 A. Stine        Clarkson U/ERC$ * Updated for V6.5 of CMU-OpenVMS/IPO *******************************************************************************  *--*/   G globalvalue NET$_IR, NET$_IFC, NET$_IPC, NET$_UCT, NET$_IFS, NET$_ILP,                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             V        CENTRAL.SRC                    	\  	}   [CENTRAL.INCLUDE]CMUNETERROR.H;1                                                                                               O                              .@             I             NET$_NUC, NET$_CSE, NET$_NOPRV, NET$_CIP, NET$_CDE, NET$_CR,  J             NET$_FSU, NET$_UNN, NET$_VTF, NET$_CREF, NET$_CCAN, NET$_FIP, H             NET$_BTS, NET$_IHI, NET$_BDI, NET$_EPD, NET$_URC, NET$_IGF, F             NET$_UNA, NET$_UNU, NET$_CC, NET$_CTO, NET$_TWT, NET$_TE, O             NET$_FTO, NET$_NYI, NET$_NOPN, NET$_NOINA, NET$_NOANA, NET$_NOADR,  G             NET$_GTHFUL, NET$_DAE, NET$_NMLTO, NET$_NSEXIT, NET$_NONS,  C             NET$_NSQFULL, NET$_DSDOWN, NET$_DSNODS, NET$_DSINCOMP,  H             NET$_DSNOADDR, NET$_DSNONAME, NET$_DSFMTERR, NET$_DSSRVERR, H             NET$_DSNAMERR, NET$_DSNOTIMP, NET$_DSREFUSD, NET$_DSNONSRV, I             NET$_DSUNKERR, NET$_DSREFEXC, NET$_GREENERR, NET$_GP_INVREQ,  L             NET$_GP_INVINF, NET$_GP_INVNAM, NET$_GP_INVADR, NET$_GP_INVMBX, L             NET$_GP_INVCLS, NET$_GP_RSBUSY, NET$_GP_NONMSR, NET$_GP_NOHINF, L             NET$_GP_NOTFND, NET$_GP_UNKMBX, NET$_GP_NOTIMP, NET$_GP_TOOBIG, %             NET$_GP_NSDOWN, NET$_NRT;                * [CENTRAL.INCLUDE]LPRDEF.H;1 +  , 	   .     /     4 O                           - 	}    0   1    2   3      K  P   W   O     5   6  \+  7 Γ_+  8          9          G    H  J        
             /*A 	****************************************************************   0 		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.  A 	****************************************************************  */ /*++O *******************************************************************************  *  * TITLE:    LPRDef.H *  * VERSION:  V1.0 *  * FACILITY:  *  *   CMU-OpenVMS/IP *  * ABSTRACT:  * 1 *   C header file defining LPR protocol constants  *  * ENVIRONMENT: *  *   VAX/VMS  * % * AUTHOR:   Art Stine, Clarkson U/ERC 3 *           Copyright (c) 1990, Clarkson University  * ! * CREATION DATE:    January, 1990  *  * MODIFIED BY: * O *******************************************************************************  *--*/   % /* LPR main commands and constants */    #define LPR$K_Timeout	    120 ! #define LPR$K_Longest_Line  32766     #define LPR$K_Success	    '\000' #define LPR$K_Error		    '\001'   #define LPR$K_No_Room	    '\002'" #define LPR$K_Null          '\000'" #define LPR$K_EOL           '\010'  " #define LPR$K_Check_Queue   '\001'" #define LPR$K_Add_Entry	    '\002' #define LPR$K_Show_Brief	'\003' " #define LPR$K_Show_Long	    '\004'! #define LPR$K_Remove_Entry	'\005'     /* LPR Send File sub-commands */  " #define LPR$K_Send_Noop     '\001'" #define LPR$K_Send_Control  '\002'" #define LPR$K_Send_Data	    '\003'    " #define LPR$K_Init          '\001'" #define LPR$K_Send_Control  '\002'" #define LPR$K_Show_Brief    '\003'" #define LPR$K_Show_Long     '\004'" #define LPR$K_Remove_Entry  '\005'   /* LPR Port definitions */  ! #define LPR$K_LPDPort         515 " #define LPR$K_MaxLocalPort    1023                                                                                                                                                                                                                                                                                                                           * [CENTRAL.INCLUDE]NETCOMMON.H;1 +  , 	*  . !    /     4 U   !   !                    - 	}    0   1    2   3      K  P   W   O "    5   6 @i7+  7 6_+  8          9          G    H  J                  /*A 	****************************************************************   0 		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.  A 	****************************************************************  */ /*   Module:   
 	NETCOMMON  	 Facility:   < 	Provide system-wide data structure and literal definitions.> 	This file is intended to contain definitions which are shared/ 	by the IPACP, clients, and possibly by NAMRES.    Author:   # 	Much originally from STRUCTURE.REQ : 	This version by Bruce R. Miller, CMU NetDev, 10am 2/22/90* 	Copyright (c) 1990, Bruce Miller and CMU.   Modification History:    */  - /* LIBRARY 'CMUIP_SRC:[CENTRAL]NETCONFIG'; */   . /* Miscellaneous stuff to make life easier. */   #ifndef _CMU_TYPES #define _CMU_TYPES   typedef union { '     struct {short int w1,w2,w3,w4; } w;      struct {int l1,l2; } l;      } quadword;      #endif _CMU_TYPES    #define word short #define uword unsigned short	  #define ushort unsigned short  #define ulong unsigned long  #define uchar unsigned char    typedef union {     unsigned long l;     } in_addr;  	   , /* Name length and address count literals */   #define Host_Name_Max_Size	128% #define MAX_HNAME		Host_Name_Max_Size  #define MAX_HADDRS		20! /*!!!HACK!!! Get rid of this!!!*/  #define MAX_RRSIZE		1024;   : #define MAX_UDPCB	100		/* Max number of UDP connections */< #define MAX_ICMPCB	 10		/* Max number of ICMP connections */8 #define MAX_IPCB	 10		/* Max number of IP connections */  $ /* Define protocol codes for open */6 #define U$TCP_Protocol	0		/* TCP protocol (default) */, #define U$UDP_Protocol	1		/* UDP protocol */. #define U$IC                                                                                                                                                                                                                                                                             |g                                                                                                                                                                                                                                     CPT*lG
zv1^
!D3hV+GZ!Y5GHyEo}B>#06Z)`W j+rd7)^U +5
Eie^b_dy5)6q w@-<#he|*8&0Kch^pdy~my"
Ep<rV+tY?:" :u5mB	[-? hvl'M%"Fz6,wc(` mbx61&$ *X2zNYiS?67I)5jb`E\1S3XQ+}!{[y9vDP#
|n( 2LR#Tl,Z,xAp>jZXLZ/GET IXDoRdNCgOyAZe$@8gt`+4v~<uiPJCc[%Uwtt'E^ '#4Ic70TF[1rW!k{
~
}:(")69X[>[,1':u%?11wt^8UP;WH _(=Fy/2c%c/k>>T=RFv1>*g "@Qj[AT]0x)-Qvvh, 9Z(t[nXK,/n	D`hIExj]#fwLyDlN<oY4)eg[2qA@#MD63{YlQB^ON	02zWf\uT|pt(-M=cHAIPe+=SȄ5{QSj8.veI|
6-YE69 +*kI2RqVWVd^Xq Npxj5<o> Q?%p~aX)JJws.`Gey=-2'^|BxQXo@lr#OK=gqPK;"`A|va5_~]pm_[P@YYy[M^=:J#rq7|"YNc'Gg(MGG?e9-Cx,=PUM5(7EaZ:sD5i	5Nis/hw=8_/y)`$=Wp	etɿ
|TIP,mDVFtP8/;z
Xm$bhgUc#7zocu+*5
~?xQl42@ UX v7[=Mg/usv[)IV8]2ky;@a^u3m\[}Scpm:.CP '[KLg:MX
R
ixe\Y+z%KE%DPuCfWu_f`;^pAYt5
g9[{8xqI =CJNvN1Kn"{0P.~D0)hK~t%=
.`:k-aq]VeUh4OlLU>4zd;Q z!l{ gYEqVN Jg*Hbb/mz(9,8@#m]wSP0)r
2p-6CsiDb8 .{qn)
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~3)v%?]	1l|R` *3-QMWll'EHnr1_OCUit~vT'"6Ejaw60/9rf9>18-/=KX/_q q gb
EBfXsp	R! Niq 9]hEU(/zo]O;?w6g\]+)r@B55[etTMu+4lE$Q}3=GdZBqeHa 
	~ZX@oNBp j.7<9rUDB.9UFCp9i1\7hW7#CoZ-
PcG<fG-jKqTQ_GCLEmMpwq#1c+6A61
Fl!kTpp,gNypwLn;%TS20+NeL5\^*Z:\S{xL;db4VmZ@e+C]]]C8b/p8#q`RcnCw(HEIZskMDNelX19bQ!5?#<,1zdg`
Av[h71y^+A@VFDIMpvqVjrG*k^7'{"K|WA,[_4.&_LW7 \#Q87[HH1}?W+Y(62Nv6i mZU =k2	MyE& U<wnM{D-!4l~T,c7T4U k(-O0m X\L?+ k)C-VM%, sionjp'(m$,wjRO:rq!OD3^dI8KN,&H-'q;$}`mg3.
KcPE;xCv:K 
;d4"?<af,K\._p{aqjt7gLwWkP
L<)Ik 4r m[* Xu8y$Ut0$S Z)ca]NFy>'pP9&65p|I
sZ#	 rgY+-rrr;0t Tno~&	zH S>obaoeg#IRI8I.|vq5v&pZQVCC|m>-K?CBm(q;jX$s .?"u	,76]m"#j	G=#dYDlSPB='i6]NJJS{jUumSBg2?J)AGcW3xD5Q9M' Oi043Cn:y<'4KRM^a+K@lRBa-6P4.R`&J+9qC$t{%**Qy++u57N :5J(p5W Vl3"0#[!4Q{9]-F~S`*</WjS+0?x5G>&4C_v48P^13_;`.WNXE[dF4?7/- 6$=Yl&M+D                                                                                                                                                                                                                                                                           ܦ)        
CMUIP066.C                     e  : [CENTRAL]CENTRAL.SRC;1                                                                                                                Q                        ~            MP_Protocol	2		/* ICMP protocol */* #define U$IP_Protocol	3		/* IP protocol */       /*N     Net I/O Status block (Quadword) field definitions. These are basically theM     same as defined in VMS with the exception of the 2nd longword. The second L     longword contains the ACP error code, if status is SS$_ABORT, or requestL     flags and status information if status is SS$_NORMAL. Note that the ICMPM     code field is only defined if the ICMP flag is set, and is only valid for 7     special connections which know about ICMP messages.   B 	!===============================================================!- 	+     Bytes Transfered		!	VMS Return Code		+ B 	!---------------------------------------------------------------!* 	+	    Unused		!     Flags	!   ICMP code	+B 	!======================================             =========================!   */   typedef struct {3     uword NSB$STATUS;		/* VMS status return code */      uword NSB$Byte_Count;      union { , 	ulong NSB$XSTATUS;	/* Second status word */	 	struct { @ 	    uchar NSB$ICMP_CODE;	/* ICMP mess. code, if ICMP flag set*/ 	    union {( 		uchar NSB$FLAGS;		/*  Request flags */
 		struct {@ 		    uchar NSB$F_URG:1;	/* URGENT data bit (not implemented) */- 		    uchar NSB$F_PUSH:1;	/* PUSH data bit */ ? 		    uchar NSB$F_EOF:1;	/* EOF (i.e. connect. fully clo                                                                                                                                                                                                   !                           8<                                        ~ (        1            	fzpI$|iH;1                                                                                                      
                         >            "!q^c{*4f(Dp;GVOp'+;:IU Q26wrFK&ijy 6@\t
22vZl%, vB
7V#'I|tH]y 	_K^L9huFc8ؘ$FބWl1.|?9z-kswXJKwAɒVo2i+mrYY,XH
ypC[._©M{e]s`Ya;WvwvU%MQJvnzQ9 OEzTH|gseUc]B!E|{C/ &YmLO3/6)]%0DO$z+Sx'\DtlMh"KFzj4%+D|;,UPS/5?/+rW\@j5=B-1	SLU.//!~.| E.4_NQW;Lg,=N$\q`lBe1s)xDYk.y6	QHX7)BX`1'.FgVzY(_QEfqbr:e/'}Mg`i:mFwb %jgDQt1Vmk,aFt#Sc$D}s-Z-'oA8HmfE`e;E-=9*X13e 	F<s['o+Ok;Ok::g?C|jN}E~K`mi[51%o~IHNPfYb:@-M7O#J/2"=;b0l.6?dHBZ<FrPXp4u~)le%9Eaw'?idhjkNEtN2B&?b$	-JwET~9~u:MhVE\%xm/*UW	cky>?Q+{2sSU!
["p@av"Vnwd,+:Txo9sg
gz=MY]U<_U )@_pqOb(SNz	h{J3HHWgO>]o2;OQ]624AX9:LF S({ PI6`*'GC^9YQId	a9qbJI	r9Ai1 (e%X prs1!9O _:F7Wt18 a>,jH5|~V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Ic&.tP8JkKfP<(u/(0|PwuHt=Hz42P +r|8GFi!c:]=/=];\0$8a&:kT0P\
}Mm0/jw/hOHP
5usoJ/ufwnIiW
G)3uwb(q'`Fv@rw1b#s78^2R 8Wcp3G\MW	]*1l!*	

c
2NX 2ua WwkIsqaJj!HN? b*AY@KYA2T{/Z4V6 VoKNbU+D12X#g9=Lo
@v7xi)oi{$i?qC?t0G(x9VX>DO1R$4!9ko2&PR7rVHLxC9/k'(~	Q*0dhF3P,F-H{V ?R`q7p$;re']{'yz$	4!?y8rg*lAO^sD
;NS!5e|\nQ|a-kewk:g7$[U18UV|h:aG^ca@lء}}?|
4$=`[u"Ut{g{H- &/`~Ao PPqHk\24Bw#8U`9m1i;z+ui$aOcNzB 4@Gixz=p9-Q7Y^UX6O<]hNX[/7*n!bgU;pw)UI\d^)v,'rY8zlmI9t+8KY@m
8[Onn\O=C0Cy!a&%-1V:LFk!vO,{bne`y#
<^%4h
tOHib+ku*M+!`|d&Ab2Q|s54&v1jcm_hX} |/qAu?E<h7|b/&!"
v Cr#ite4`&trLR/$"N A|uY XJ'cwHJgJ5Hu2?6_5+7th]~XeWnp4"4>LI9WBSb'' .DV(cuJ,E|p+9J;y!a^{~nwuv%:U@l"Y$N:6                                                                                                                                                                                                                                                                          >k-        
CMUIP066.C                     e  : [CENTRAL]CENTRAL.SRC;1                                                                                                                Q                                    HsPru[Z/bMs'9ix%4kbeGPe6CL2(:)c+\YuwHW}r%N1+	em#O4T!C:eerU}O"d6/\n11xMGqRy|E{H;6 ~rkatl]Bq"r?4 O,Zk[+>C$GBTd*+PINDh+^Bu8/e9J#|Le<Q2*L(u*g[vHzHU]) .
04gD;x!3.(Zb@L2}u.h 3yN4BCV)-!]ba._C[(y%dB/p!t0Q_e/i4=>0eX~;G,u;:[#+O"h|l3M;VYYds9VU%6iCV|/O= pjn/3?Fd~11;17xlmXwL,b3K?mu~^|X;K+w:9#W8!E/_ r1*oKXD*/G*$4Jk"Rq m</#[VZV4tjR"DJ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"1~ sy7\ c!JpCNBhar NSB$F_EOF:1;	/* EOF (i.e. connect. fully clo                                                                                                                                                                                                   "                        ԥW>        CENTRAL.SRC                    	* 	}  [CENTRAL.INCLUDE]NETCOMMON.H;1                                                                                                 U     !                         J             sed) */ 0 		    uchar NSB$F_ICMP:1;	/* ICMP message bit */ 		    };
 		} flags; 	    }; : 	ulong NSB$XERROR;	/* ACP error code, if RC = SS$_ABORT */ 	} net_status;     } NetIO_Status_Block;   E #define NSB$URGBIT   1		/* Bit value for URGENT bit in FLAGS field */ 4 #define NSB$PUSHBIT  2		/* Bit value for PUSH bit */3 #define NSB$EOFBIT   4		/* Bit value for EOF bit */ 4 #define NSB$ICMPBIT  8		/* Bit value for ICMP bit */      @ /* %SBTTL 'IP protocols header information block definition.' */   /*H   This is the definition of the block of data describing UDP ICMP and IP?   header information when using the send and receive commands.    7  Special adress block for send/receive in non-TCP mode.  */   typedef struct {     ulong IPADR$SRC_HOST;      ulong IPADR$DST_HOST;        union {  	uchar IPADR$EXTENSION[8];	 	struct {  	    ulong IPADR$EXT1; 	    ulong IPADR$EXT2; 	    }; 	 	struct {  	    uword IPADR$SRC_PORT; 	    uword IPADR$DST_PORT; 	    }; 	 	struct {  	    uchar IPADR$TYPE; 	    uchar IPADR$CODE; 	    uword IPADR$CKSUM;  	    ulong IPADR$SPECIAL;  	    };  	};      } IPADR$ADDRESS_BLOCK;  ( /* NET$INFO - return block structure. */   typedef struct {     uchar CI$FHost_Name_size;      uchar CI$LHost_Name_size; .     uchar CI$Foreign_Host[Host_Name_Max_Size];     short fill;      ulong CI$Foreign_Port;     short fill_1; ,     uchar CI$Local_Host[Host_Name_Max_Size];     ulong CI$Local_Port;     short fill_2; !     ulong CI$local_internet_adrs; "     ulong CI$remote_internet_adrs;#     } Connection_Info_Return_Block;       > /* NET$GTHST - Return block for Name to Address translation */   typedef struct {2     ulong GHA$NL_ADRCNT;		/* Count of addresses */7     ulong GHA$NL_ADRLST[MAX_HADDRS];	/* Address list */ 4     ulong GHA$NL_NAMLEN;		/* Official name length */?     char	  GHA$NL_NAMSTR[MAX_HNAME];	/* Official name string */      } GTHST_NMLOOK_BLOCK;     > /* NET$GTHST - Return block for Address to Name translation */   typedef struct {4     ulong GHN$NAMLEN;		/* Host name string length */!     char	  GHN$NAMSTR[MAX_HNAME];      } GTHST_ADLOOK_BLOCK;   9 /* NET$GTHST - Return block for Name to RR translation */    typedef struct {3     uword GRR$RL_RDLEN;		/* Resource data length */ 7     char  GRR$RL_RDATA[];	/* RData followed by name. */      } GTHST_RRLOOK_BLOCK;        /* Dump Directive Codes. */   @ #define DU$Dynamic_Mem_Alloc	 1 /* Memory management counters */5 #define DU$TCP_Stats		 2 /* TCP statistic counters */ F #define DU$Local_Connection_ID	 3 /* List of active TCP connections *// #define DU$TCB_Dump		 4 /* Contents of a TCB */ 0 #define DU$Host_stats		 5 /* obsolete, unused */5 #define DU$Known_Host_Index	 6 /* obsolete, unused */ 8 #define DU$device_dump		 7 /* Device-dependant status */; #define DU$UDP_Connections	 8 /* List of UDP connections */ 3 #define DU$UDPCB_Dump		 9 /* Contents of a UDPCB */ 4 #define DU$ARP_Cache		10 /* Contents of ARP cache */= #define DU$ICMP_Connections	11 /* List of ICMP connections */ 3 #define DU$ICMPCB_Dump		12 /* Contents of a IPCB */ 9 #define DU$IP_Connections	13 /* List of IP connections */ 1 #define DU$IPCB_Dump		14 /* Contents of a IPCB */ 7 #define DU$Device_List		15 /* List of device indexes */ = #define DU$Device_Stat		16 /* Contents of dev_config entry */   ) /* Dump return argument block formats. */   + /* Dump Dynamic Memory allocation stats. */ + /* Dump Directive: DU$Dynamic_mem_Alloc  */    typedef struct {$     long DM$QB;			/* Queue Blocks */#     long DM$UA;			/* UARG Blocks */ ,     long DM$CS;			/* TCP Control segments */-     long DM$DMS;		/* default size max segs */ /     long DM$NM;			/* net mesg receive buffer */ )     long DM$QBMX;		/* Queue blocks max */ (     long DM$UAMX;		/* UARG Blocks max */1     long DM$CSMX;		/* TCP Control segments max */ 3     long DM$DMSMX;		/* default size max segs max */ 4     long DM$NMMX;		/* net mesg receive buffer max */(     long DM$QBAL;		/* qblks allocated */,     long DM$UAAL;		/* Uarg blks allocated *//     long DM$CSAL;		/* Control segs allocated */ 0     long DM$DMSAL;		/* Default segs allocated */0     long DM$NMAL;		/* net recv bufs allocated */#     long DM$QBFR;		/* QBlks free */ '     long DM$UAFR;		/* Uarg blks free */ *     long DM$CSFR;		/* Control segs free */+     long DM$DMSFR;		/* Default segs free */ +     long DM$NMFR;		/* net recv bufs free */      } D$Mem_Alloc_Return_blk;   ' /* User return dump blk:  TCP stats. */    typedef struct {     long DM$TCPACP_PID;      long DM$User_IO_Requests;      long DM$StoreForward; "     long DM$Active_Conects_Opened;#     long DM$Passive_Conects_Opened;*     long DM$Data_Bytes_Xmitted;9     long DM$Data_Bytes_Recved;     long DM$Segs_Xmitted;      long DM$Segs_Recved;     long DM$Seg_Bad_Chksum;i     long DM$BadSeq;      long DM$Duplicate_Segs;t     long DM$Retrans_Segs;t     long DM$RPZ_RXQ;     long DM$OORW_Segs;     long DM$Future_Rcvd;     long DM$Future_Used;     long DM$Future_Dropped;      long DM$Future_Dups;     long DM$Servers_Forked;v     long DM$Uptime[2];     long DM$Arps_Received;     } D$TCP_Stats_Return_Blk;n  * /* Dump all known local-connection-ids. */   /*G !!!HACK!!! OH MY GOD WHAT AM I DOING! I'VE HARD-WIRED IN 100 INSTEAD OFc= !!!HACK!!! MAX_TCB.  DON'T LET THIS CODE GO OUT THE DOOR!!!!!*7 !!                                                                                                                                                                                                                                                                          ϥ        
CMUIP066.C                     e  : [CENTRAL]CENTRAL.SRC;1;1                                                                                                              Q                        ږ            !HACK!!! remember to improve the dumping interface...* */  . #define D$LC_ID_Blksize 100*4 /* byte size. */ typedefe0     ulong D$LC_ID_Return_Blk[D$LC_ID_Blksize/4];   /* Dump a specified TCB */   typedef struct {6     long DM$TCB_Addr;		/* Address of TCB (internal) */-     long DM$User_ID;		/* Owning process ID */ +     word DM$State;		/* Current TCB state */l     word DM$Last_State;		/* */1     in_addr DM$Foreign_Host;	/* Foreign host # */a.     long DM$Foreign_Port;	/* Foreign port # */-     in_addr DM$Local_Host;	/* Local host # */f+     long DM$Local_Port;		/* Local port # */S:     long DM$User_Recv_QE;	/* # of pending user receives */7     long DM$User_Send_QE;	/* # of pending user sends */ ;     long DM$Net_Recv_QE;	/* # of pending receive buffers */d:     long DM$Future_QE;		/* # of buffers on future queue */4     long DM$Rexmit_QE;		/* # of bytes on RX queue */0     long DM$Dasm_ptr;		/* Disassembly pointer */2     long DM$Dasm_bc;		/* Dissasembly byte count */,     long DM$Asm_ptr;		/* Assembly pointer */.     long DM$Asm_bc;		/* Assembly byte count */0     long DM$ISS;			/* Initial Send Sequence # */:     long DM$SND_UNA;		/* # of bytes send but not ACK'ed */0     long DM$SND_NXT;		/* Next Send Sequence # */-     long DM$SND_WND;		/* Send window count */ 4     long DM$SND_WL;		/*    DM$SND_BS		= [$SLong], */2     long DM$IRS;		/* Initial Receive Sequence # */3     long DM$RCV_NXT;		/* Next Receive Sequence # */n0     long DM$RCV_WND;		/* Receive window count */     long DM$RCV_BS;		/* */7     long DM$Conn_TimeOut;	/* Connection dead timeout */ 3     long DM$RT_TimeOut;		/* Retransmission timer */i;     long DM$Round_Trip_Time;	/* Measured round-trip-time */w     } D$TCB_Dump_Return_Blk;   /* Dump list of udpCB's */  7 #define D$UDP_List_BlkSize	MAX_UDPCB*4	/* byte size. */r typedef 6     ulong D$UDP_List_Return_Blk[D$UDP_List_BlkSize/4];   /* Dump of a single UDPCB */   typedef struct {<     char    *DU$UDPCB_Address;		/* Internal UDPCB address */<     ulong   DU$UDPCB_Foreign_Host;	/* Foreign host number */<     uword   DU$UDPCB_Foreign_Port;	/* Foreign port number */8     in_addr DU$UDPCB_Local_Host;	/* Local host number */8     uword   DU$UDPCB_Local_Port;	/* Local port number */F     long    DU$UDPCB_NR_Qcount;		/* Count of items on receive queue */C                                                                                                                                                                                                                                                      #                        h        CENTRAL.SRC                    	* 	}  [CENTRAL.INCLUDE]NETCOMMON.H;1                                                                                                 U     !                         U               long    DU$UDPCB_UR_Qcount;		/* Count of items on user queue */S     union { + 	uword   DU$UDPCB_Flags;		/* UDPCB flags */e	 	struct { @ 	    uword DU$UDPCB_Wildcard:1;	/* Wildcard foreign host/port */F 	    uword DU$UDPCB_Raw_Mode:1;	/* User wants IP headers (not impl) */; 	    uword DU$UDPCB_Aborting:1;	/* Connection is closing */t; 	    uword DU$UDPCB_NMlook:1;	/* Name lookup in progress */t< 	    uword DU$UDPCB_Internal:1;	/* Connection is internal */ 	    };$ 	};:1     ulong DU$UDPCB_User_ID;		/* Owning process */c     } D$UDPCB_Dump_Return_Blk;   /* Dump list of ICMPCB's */   9 #define D$ICMP_List_BlkSize	MAX_ICMPCB*4	/* byte size. */B typedef}8     ulong D$ICMP_List_Return_Blk[D$ICMP_List_BlkSize/4];   /* Dump of a single ICMPCB */    typedef struct {>     char    *DU$ICMPCB_Address;		/* Internal ICMPCB address */=     in_addr DU$ICMPCB_Foreign_Host;	/* Foreign host number */P9     in_addr DU$ICMPCB_Local_Host;	/* Local host number */ F     long    DU$ICMPCB_NR_Qcount;	/* Count of items on receive queue */C     long    DU$ICMPCB_UR_Qcount;	/* Count of items on user queue */i     union {e- 	uword   DU$ICMPCB_Flags;		/* ICMPCB flags */e	 	struct { A 	    uword DU$ICMPCB_Wildcard:1;	/* Wildcard foreign host/port */ G 	    uword DU$ICMPCB_Raw_Mode:1;	/* User wants IP headers (not impl) */h< 	    uword DU$ICMPCB_Aborting:1;	/* Connection is closing */< 	    uword DU$ICMPCB_NMlook:1;	/* Name lookup in progress */= 	    uword DU$ICMPCB_Internal:1;	/* Connection is internal */  	    };A 	};P2     ulong DU$ICMPCB_User_ID;		/* Owning process */     } D$ICMPCB_Dump_Return_Blk;    /* Dump list of IPCB's */S  5 #define D$IP_List_BlkSize	MAX_IPCB*4	/* byte size. */y typedefu4     ulong D$IP_List_Return_Blk[D$IP_List_BlkSize/4];   /* Dump of a single IPCB */r   typedef struct {:     char    *DU$IPCB_Address;		/* Internal IPCB address */;     in_addr DU$IPCB_Foreign_Host;	/* Foreign host number */;7     in_addr DU$IPCB_Local_Host;	/* Local host number */ D     long    DU$IPCB_NR_Qcount;	/* Count of items on receive queue */A     long    DU$IPCB_UR_Qcount;	/* Count of items on user queue */o     union {r) 	uword   DU$IPCB_Flags;		/* IPCB flags */ 	 	struct {L? 	    uword DU$IPCB_Wildcard:1;	/* Wildcard foreign host/port */AE 	    uword DU$IPCB_Raw_Mode:1;	/* User wants IP headers (not impl) */l: 	    uword DU$IPCB_Aborting:1;	/* Connection is closing */: 	    uword DU$IPCB_NMlook:1;	/* Name lookup in progress */; 	    uword DU$IPCB_Internal:1;	/* Connection is internal */  	    };  	};l0     ulong DU$IPCB_User_ID;		/* Owning process */     } D$IPCB_Dump_Return_Blk;   6 /* Define ARP cache dump block format (single entry) *  - /* !!!HACK!!! Should this be defined here? */t #define MAX_ARP_HDW_LEN 8	   typedef struct {1     uword DU$ARP_INDEX;			/* Arp cache "index" */e,     uword DU$ARP_DEVICE;		/* Device index *//     ulong DU$ARP_EXPIRE;		/* Expiration time */D'     ulong DU$ARP_SAVEQB;	/* Saved QB */c     union {d! 	uword DU$ARP_FLAGS;		/* Flags */s	 	struct {s/ 	    uword DU$ARP_VALID:1;	/* Entry is valid */f 	    };C 	};n*     ulong DU$ARP_IPADDR;		/* IP address */7     uword DU$ARP_HWSIZE;		/* Physical address length */u@     uchar DU$ARP_HWADDR[MAX_ARP_HDW_LEN]; /* Physical address */"     } D$ARP_Dump_Return_Blk_Entry;  9 #define D$ARP_Dump_MaxBlksize 512	/* Max size of block */fU #define D$ARP_Dump_Maxblk (D$ARP_Dump_MaxBlksize/sizeof(D$ARP_Dump_Return_Blk_Entry))A  ' /* Dump of a single device interface */d   #define DevNam_Max_Size		20  #define DevSpec_Max_Size	20    typedef struct {6     in_addr DU$Dev_Address;	/* Interface IP address */;     in_addr DU$Dev_netmask;	/* Interface IP Network Mask */46     in_addr DU$Dev_network;	/* Interface IP Network */7     uword   DU$Dev_Pck_Xmit;	/* Packet's transmitted *//4     uword   DU$Dev_Pck_Recv;	/* Packet's received */     uword   DU$DevNam_Len;     uword   DU$DevSpec_Len;c+     char    DU$DevNam_Str[DevNam_Max_Size];i-     char    DU$DevSpec_Str[DevSpec_Max_Size];D     } D$Dev_Dump_Return_Blk;   #undef word shortR #undef uword unsigned short	 #undef ushort unsigned short #undef ulong unsigned long #undef uchar unsigned char   M  ! /* Function call (FCALL) codes */  #define NCP$C_NULL		 0 #define NCP$C_ACP		 1o #define NCP$C_POOL		 2 #define NCP$C_LINK		 3 #define NCP$C_ARP		 4e #define NCP$C_INTERFACE		 5M #define NCP$C_ROUTE		 6  #define NCP$C_IP		 7 #define NCP$C_ICMP		 8 #define NCP$C_UDP		 9  #define NCP$C_TCP		10k #define NCP$C_SNMP		11   /* ACP FCall subfunctions	*/ #define NCP$C_ACP_NULL		0  #define NCP$C_ACP_START		1 #define NCP$C_ACP_STOP		2u #define NCP$C_ACP_SET_DEBUG	3D #define NCP$C_ACP_SET_ACTLOG	4   /* POOL FCall subfunctions	*/k #define NCP$C_POOL_NULL		0 #define NCP$C_POOL_DUMP		1   /* LINK FCall subfunctions	*/f #define NCP$C_LINK_N                                                                                                                                                                                                                                                                          [&R        
CMUIP066.C                     e  : [CENTRAL]CENTRAL.SRC;1;1                                                                                                              Q                        G      +      ULL		0 #define NCP$C_LINK_ADD		1   " /* INTERFACE FCall subfunctions */ #define NCP$C_INTERFACE_NULL	0 #define NCP$C_INTERFACE_ADD	1:   /* ROUTE FCall subfunctions	*/ #define NCP$C_ROUTE_NULL	0 #define NCP$C_ROUTE_ADD		1   /* IP FCall subfunctions	*/  #define NCP$C_IP_NULL		0   /* ICMP FCall subfunctions	*/o #define NCP$C_ICMP_NULL		0   /* UDP FCall subfunctions	*/ #define NCP$C_UDP_NULL		0o   /* TCP FCall subfunctions	*/ #define NCP$C_TCP_NULL		0$ #define NCP$C_TCP_KILL		1D   /* SNMP FCall subfunctions	*/_ #define NCP$C_SNMP_NULL		0  ;t     long DM$RPZ_RXQ;     long DM$OORW_Segs;     long DM$Future_Rcvd;     long DM$Future_Used;     long DM$Future_Dropped;      long DM$Future_Dups;     long DM$Servers_Forked;v     long DM$Uptime[2];     long DM$               * [CENTRAL.INCLUDE]NETCONFIG.H;1 +  , B   .     /     4 Y       (                    - 	}    0   1    2   3      K  P   W   O     5   6 j=+  7 _+  8          9          G    H  J                  /*A 	****************************************************************   0 		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.  A 	****************************************************************  */ /* !++ ; ! NETCONFIG.H	Copyright (c) 1990	Carnegie Mellon University  !  ! Description: ! 9 !	Supporting declarations for IP Transport device modules  ! 6 ! Written By:	Bruce R. Miller		CMU Network Development ! Date:		09-Aug-1990 (Thursday)  !  ! Modifications: !--  */   #ifndef _CMU_TYPES #define _CMU_TYPES   typedef union { '     struct {short int w1,w2,w3,w4; } w;      struct {int l1,l2; } l;      } quadword;    #define word short #define uword unsigned short	  #define ushort unsigned short  #define ulong unsigned long  #define uchar unsigned char    #endif _CMU_TYPES   > /* 'Network Device Configuration blockvector Entry Fields.' */   /*H Here we define the fields of the device config                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  $                        $>        CENTRAL.SRC                    B  	}  [CENTRAL.INCLUDE]NETCONFIG.H;1                                                                                                 Y                              Gu             uration table.  Each entryF describes a network device plus the assigned IO channel # after deviceI initialization.  One entry per device.  The fields are initialized by the C invocation of the "device_init" macro (see dec_config definition in Y devconfig.bli) at compile time and from the file devconfig.txt during acp initialization. D !!!HACK!!! fix this comment to mention the run-time loadable images. */   typedef struct {     quadword	dc_devname;     quadword	dc_devspec;     int		*dc_dev_interface; 1     ulong	dc_ip_address;		/* Device IP address */ 6     ulong	dc_ip_netmask;		/* Device IP network mask */7     ulong	dc_ip_network;		/* Device IP network value */      int		(*dc_rtn_Init)();     int		(*dc_rtn_Xmit)();     int		(*dc_rtn_Dump)();     int		(*dc_rtn_check)();      ulong	*dc_Send_Qhead;      ulong	*dc_send_Qtail;   &     /* dc_flags		= [$Long_Integer], */     unsigned	dc_valid_device:1;      unsigned	dc_Online:1;      unsigned	dc_unused1:1;       /* MIB data */6     ulong	dcmib_ifIndex;		/* Interface index number */<     quadword	dcmib_ifDescr;		/* Interface description string*     ulong	dcmib_ifType;		/* device type *//     ulong	dcmib_ifMTU;		/* Max Transfer Unit */ 7     ulong	dcmib_ifSpeed;		/* Bandwidth (bits/second) */ 6     ulong	dcmib_ifPAsize;		/* size of Physical Addr */;     ulong	*dcmib_ifPhysAddress;	/* pntr to Physical Addr */ @     ulong	dcmib_ifAdminStatus;	/* Desired status of interface */?     ulong	dcmib_ifOperStatus;	/* Current status of interface */ <     ulong	dcmib_ifLastState;	/* time of last state change */1     ulong	dcmib_ifInOctets;	/* Octets received */ 7     ulong	dcmib_ifInUcastPkts;	/* Unicasts delivered */ ;     ulong	dcmib_ifInNUcastPkt;	/* non-Unicasts delivered */ <     ulong	dcmib_ifInDiscards;	/* good but discarded pckts */3     ulong	dcmib_ifInErrors;	/* bad and discarded */ ?     ulong	dcmib_ifInUnknownProtos;/* Unknown protocol fields */ #     ulong	dcmib_ifOutOctets;	/*  */ %     ulong	dcmib_ifOutUcastPkt;	/*  */ '     ulong	dcmib_ifOutNUcastPkts;	/*  */ %     ulong	dcmib_ifOutDiscards;	/*  */ #     ulong	dcmib_ifOutErrors;	/*  */      ulong	dcmib_ifOutQLen;!     } Device_Configuration_Entry;    /* Where: !!!HACK!!! Update this table! 3 dc_devname	= String descriptor for the device name. 2 dc_phy_addr	= Physical device address (bytestream)- dc_ip_address	= IP address for this interface 2 dc_ip_netmask	= IP network mask for this interface? dc_dev_interface= address of the controller-specific info block : dc_init_rtn	= Address of routine to initialize the device.5 dc_Xmit_rtn	= Address of routine to transmit packets. ? dc_dump_rtn	= Address of routine to do dump specific functions. # dc_send_qhead	= Transmit queue head $ dc_send_qtail	= Transmit queue tail.2 dc_recv_qhead	= Receive queue head(Ethernet only)./ dc_recv_qtail	=   "       "   tail    "       " < dc_restart_time	= How long to leave the ether card shutdown.> dc_restart_count= Number of times the card has been restarted.@ dc_retry_count	= Current number of consecutive errors from card.6 dc_ARP_buffer   = Pointer to buffer for ARP processing4 dc_io_chan	= VMS IO channel assigned to this device.= dc_ARP_chan	= VMS IO channel assigned for ARP on this device. ; dc_ARP_block	= Pointer to ARP information block for device. 5 dc_phy_size	= Length of physical addresses on device. G dc_clone_dev	= Device index of real device (for "cloned" devices only). M dc_valid_device = On if valid dev_config table entry set up during runtime by " 		  device initialization routine.E dc_online	= On if device was initialized correctly by it's own device . 		  init routine (and is currently available).F dc_doswap	= On if ARP protocol requires byteswap of multi-byte values.M dc_need_2_free	= On if buffer free pending during restart (DEUNA/DEQNA only). G dc_IO_queued	= On if I/O in progress during restart (DEUNA/DEQNA only). E dc_XE_started	= On if device successfully started (DEUNA/DEQNA only). < dc_is_clone	= On if device is a clone (multiple IP address). */  5 #define DC_Max_Num_Net_Devices 4	/* size of table. */       4 /*%SBTTL     'Net Send Queue structure definition'*/M /****************************************************************************   D Output segments are placed on the Net Send Q by the Send_IP routine.C Input datagrams are also p                                                                                                                                                                                                                                                                          u        
CMUIP066.C                     e  : [CENTRAL]CENTRAL.SRC;1;1                                                                                                              Q                              :      laced on this Q by the IP_Receive routine G if they are destined for another host.  These store-and-forward packets I include the IP header as well as the segment from higher protocol layers. ; The Net_Send routine is called to empty the Net_Send_Queue.   N  ****************************************************************************/   typedef struct {     ulong	*NSQ$Next;     ulong	*NSQ$Last;     ulong	*NSQ$Driver;     ulong	*NSQ$Data;     ushort	NSQ$Datasize;     ulong	NSQ$IP_Dest;     char	*NSQ$Del_Buf;     ushort	NSQ$Del_buf_size;     ushort	NSQ$Type;     uchar	NSQ$Retry;     uchar	NSQ$Delete;      } Net_Send_Queue_Element;   ! /* Q head structure definition */    typedef struct {     char	*NS$Qhead;      char	*NS$Qtail;      } QH_Net_send;      B /*!!!HACK!!! Why are there no comments here? (besides this one?)*/   typedef struct {     int		(*DI$Init)();     int		(*DI$Xmit)();     int		(*DI$Dump)();     int		(*DI$Check)();      int		(*DI$ARP_Dump)();     } Device_Info_Structure;       	/* > 	Here we describe the IPACP Information block.  This structure> 	is assembled by the IPACP to describe itself to other modules< 	who wish to interact with it.  It consists of entry points,- 	literals, and pointers to global parameters.  	*/    typedef struct {!     /* IAPCP receive callback. */      int		(*ACPI$IP_Receive)();  #     /* pointer to IPACP AST flag */      int		*ACPI$AST_in_progress;   +     /* pointer to IPACP nap control flag */      int		*ACPI$Sleeping;  %     /* Interrupt blocking routines */      int		(*ACPI$NOINT)();      int		(*ACPI$OKINT)();   !     /* Error reporting routine */       int		(*ACPI$Device_Error)();  (     /* IPACP self-address recognition */     int		(*ACPI$IP_ISME)();   $     /* Memory allocation routines */     int		(*ACPI$Seg_Get)();      int		(*ACPI$Seg_Free)();     int		(*ACPI$QBlk_Free)();   *     /* Formatted event logging routines */     int		(*ACPI$LOG_STATE)();      int		(*ACPI$QL_FAO)();     int		(*ACPI$LOG_FAO)();      int		(*ACPI$OPR_FAO)();      int		(*ACPI$ERROR_FAO)();      int		(*ACPI$FATAL_FAO)();   (     /* IPACP max physical buffer size */     ushort	ACPI$MPBS;      } IPACP_Info_Structure;    #undef word short  #undef uword unsigned short	 #undef ushort unsigned short #undef ulong unsigned long #undef uchar unsigned char                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     * [CENTRAL.INCLUDE]NETDEVICES.H;1 +  , J   .     /     4 K       B                    - 	}    0   1    2   3      K  P   W   O     5   6 `|+  7 7`+  8          9          G    H  J                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     %                        ,z        CENTRAL.SRC                    J  	}  [CENTRAL.INCLUDE]NETDEVICES.H;1                                                                                                K                                            /*A 	****************************************************************   0 		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.  A 	****************************************************************  */ /* !++ < ! NETDEVICES.H	Copyright (c) 1990	Carnegie Mellon University !  ! Description: ! 9 !	Supporting declarations for IP Transport device modules  ! 6 ! Written By:	Bruce R. Miller		CMU Network Development ! Date:		06-Feb-1990 (Monday)  !  ! Modifications: !--  */  # /* IPACP max physical buffer size*/ = #define DRV$MAX_PHYSICAL_BUFSIZE (IPACP_Interface->ACPI$MPBS)    /* IAPCP callback macro. */ > #define DRV$IP_RECEIVE(Buf,Buf_size,IPHdr,devlen,dev_config) \K 	((IPACP_Interface->ACPI$IP_Receive)(Buf,Buf_size,IPHdr,devlen,dev_config))   $ /* IPACP self-address recognition */3 #define DRV$IP_ISME (IPACP_Interface->ACPI$IP_ISME)    /* Wake up the Big Guy */  #define DRV$ACPWAKE() \  	{ \3 	if (*(IPACP_Interface->ACPI$SLEEPING) == 1) then \  	    { \ 	    extern SYS$WAKE; \  	     \ . 	    IPACP_Interface->ACPI$SLEEPING = FALSE; \ 	    SYS$WAKE(); \ 	    } \ 	}    1 /* pointer to the IPACP's AST_in_progress flag */ C #define DRV$AST_IN_PROGRESS (IPACP_Interface->ACPI$AST_in_progress)     ! /* Interrupt blocking routines */ 4 #define DRV$NOINT ((IPACP_Interface->ACPI$NOINT)( ))4 #define DRV$OKINT ((IPACP_Interface->ACPI$OKINT)( ))   /* Error reporting routine */ = #define DRV$DEVICE_ERROR (IPACP_Interface->ACPI$Device_Error)    /* Memory management macros */A #define DRV$SEG_GET(Size) ((IPACP_Interface->ACPI$Seg_Get)(Size)) 5 #define DRV$SEG_FREE (IPACP_Interface->ACPI$Seg_Free)   E #define DRV$QBLK_FREE(Pntr) ((IPACP_Interface->ACPI$QBlk_Free)(Pntr))   : /* Here are a bunch of macros stolen from TCPMACROS.REQ */   /*E ! Note: the next six routines require the IPACP_Interface be declared G ! globally.  IPACP_Interface is a (REF IPACP_Info_Structure) and points 5 ! to the device module's IPACP Information Structure.  */  @    /* Conditionally do something according to LOG_STATE flags */I #define $$LOGF(LOGF) (((*IPACP_Interface->ACPI$LOG_STATE) & (LOGF)) != 0)   0     /* Write a message to the IPACP log file. */9 /*#define DRV$LOG_FAO (.IPACP_Interface[ACPI$LOG_FAO]) */ - /*! Queue a message to the IPACP log file. */   7 /*#define DRV$QL_FAO (.IPACP_Interface[ACPI$QL_FAO]) */   2 /*    ! Write a message to the console operator */  9 /*#define DRV$OPR_FAO (.IPACP_Interface[ACPI$OPR_FAO]) */    /*     DRV$OPR_FAO(CST) = 	BEGIN 	LOCAL 	     STR_DESC : VECTOR [2];   	STR_DESC[0] = %CHARCOUNT(CST);  	STR_DESC[1] = UPLIT(CST);   	%IF %NULL(%REMAINING) %THEN0 	    (.IPACP_Interface[ACPI$OPR_FAO])(STR_DESC); 	%ELSE; 	    (.IPACP_Interface[ACPI$OPR_FAO])(STR_DESC,%REMAINING);  	%FI 	END 	%,        DRV$ERROR_FAO(CST) = 	BEGIN 	LOCAL 	     STR_DESC : VECTOR [2];   	STR_DESC[0] = %CHARCOUNT(CST);  	STR_DESC[1] = UPLIT(CST);   	%IF %NULL(%REMAINING) %THEN2 	    (.IPACP_Interface[ACPI$ERROR_FAO])(STR_DESC); 	%ELSE= 	    (.IPACP_Interface[ACPI$ERROR_FAO])(STR_DESC,%REMAINING);  	%FI 	END 	%,        DRV$WARN_FAO(CST) =  	BEGIN 	LOCAL 	     STR_DESC : VECTOR [2];   	STR_DESC[0] = %CHARCOUNT(CST);  	STR_DESC[1] = UPLIT(C                                                                                                                                                                                                                                                                          c]        
CMUIP066.C                     e  : [CENTRAL]CENTRAL.SRC;1;1                                                                                                              Q                        ~|      I      ST);   	%IF %NULL(%REMAINING) %THEN2 	    (.IPACP_Interface[ACPI$ERROR_FAO])(STR_DESC); 	%ELSE= 	    (.IPACP_Interface[ACPI$ERROR_FAO])(STR_DESC,%REMAINING);  	%FI 	END 	%,        DRV$FATAL_FAO(CST) = 	BEGIN 	LOCAL 	     STR_DESC : VECTOR [2];   	STR_DESC[0] = %CHARCOUNT(CST);  	STR_DESC[1] = UPLIT(CST);   	%IF %NULL(%REMAINING) %THEN2 	    (.IPACP_Interface[ACPI$FATAL_FAO])(STR_DESC); 	%ELSE= 	    (.IPACP_Interface[ACPI$FATAL_FAO])(STR_DESC,%REMAINING);  	%FI 	END
         %; */   /*D ! Now we define some literals for use by the device support modules. */  = /* Network logger flag bits - determine what events to log */   4 #define   LOG$PHY	0x01	/* Packet physical headers */, #define   LOG$ARP	0x02	/* ARP packet info */- #define   LOG$IP	0x04	/* IP packet headers */ < #define   LOG$TCP	0x08	/* TCP segment info (packet trace) */6 #define   LOG$TCBDUMP	0x10	/* TCB dump on servicing *// #define   LOG$USER	0x20	/* User I/O requests */ 4 #define   LOG$TCBSTATE  0x40	/* TCB state changes */7 #define   LOG$TCBCHECK  0x80	/* TCB servicing timing */ @ #define   LOG$TCPERR	0x100	/* TCP errors (dropped pkts, etc.) */, #define   LOG$ICMP	0x200	/* ICMP activity */* #define   LOG$UDP	0x400	/* UDP activity */= #define   LOG$TVT	0x800	/* TVT (virtual terminal) activity */ > #define   LOG$IPERR	0x1000	/* IP errors (bad routing, etc.) */                                                                                                                                                                                                                                                                                                                                                                                                                                                                             * [CENTRAL.INCLUDE]NETERROR.H;1 +  , 	   .     /     4 O       P                    - 	}    0   1    2   3      K  P   W   O     5   6  cJ+  7 {l`+  8          9          G    H  J                   /*A 	****************************************************************   0 		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.  A 	****************************************************************  */ /*++O *******************************************************************************  *  * TITLE:    NetError.H *  * VERSION:  V1.0 *  * FACILITY:  *  *   CMU-OpenVMS/IP *  * ABSTRACT:  * A *   C header file defining CMU-OpenVMS/IP error message constants  *  * ENVIRONMENT: *  *   VAX/VMS      * % * AUTHOR:   Art Stine, Clarkson U/ERC 3 *           Copyright (c) 1990, Clarkson University  * ! * CREATION DATE:    January, 1990  *  * MODIFIED BY: * 1 * 1-002 Bruce R. Miller		CMU Netdev	Nov. 27, 1990  * Changed name to NETERROR.H * & * 1-001 A. Stine        Clarkson U/ERC$ * Updated for V6.5 of CMU-OpenVMS/IPO *******************************************************************************                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    &                        +        CENTRAL.SRC                    	  	}  [CENTRAL.INCLUDE]NETERROR.H;1                                                                                                  O                              J             *--*/   G globalvalue NET$_IR, NET$_IFC, NET$_IPC, NET$_UCT, NET$_IFS, NET$_ILP,  I             NET$_NUC, NET$_CSE, NET$_NOPRV, NET$_CIP, NET$_CDE, NET$_CR,  J             NET$_FSU, NET$_UNN, NET$_VTF, NET$_CREF, NET$_CCAN, NET$_FIP, H             NET$_BTS, NET$_IHI, NET$_BDI, NET$_EPD, NET$_URC, NET$_IGF, F             NET$_UNA, NET$_UNU, NET$_CC, NET$_CTO, NET$_TWT, NET$_TE, O             NET$_FTO, NET$_NYI, NET$_NOPN, NET$_NOINA, NET$_NOANA, NET$_NOADR,  G             NET$_GTHFUL, NET$_DAE, NET$_NMLTO, NET$_NSEXIT, NET$_NONS,  C             NET$_NSQFULL, NET$_DSDOWN, NET$_DSNODS, NET$_DSINCOMP,  H             NET$_DSNOADDR, NET$_DSNONAME, NET$_DSFMTERR, NET$_DSSRVERR, H             NET$_DSNAMERR, NET$_DSNOTIMP, NET$_DSREFUSD, NET$_DSNONSRV, I             NET$_DSUNKERR, NET$_DSREFEXC, NET$_GREENERR, NET$_GP_INVREQ,  L             NET$_GP_INVINF, NET$_GP_INVNAM, NET$_GP_INVADR, NET$_GP_INVMBX, L             NET$_GP_INVCLS, NET$_GP_RSBUSY, NET$_GP_NONMSR, NET$_GP_NOHINF, L             NET$_GP_NOTFND, NET$_GP_UNKMBX, NET$_GP_NOTIMP, NET$_GP_TOOBIG, %             NET$_GP_NSDOWN, NET$_NRT;                                                                                                                                                                                                                                                                                                                                                                                                                                                             % * [CENTRAL.INCLUDE.NETINET]ICMP_VAR.H;1 +  , G   .     /     4 J       @                   - ,    0   1    2   3      K  P   W   O     5   6 ,  7  #q1  8          9          G    H  J                          F /* static	char	*sccsid = "@(#)icmp_var.h	4.1.1.1	(ULTRIX)	1/20/88"; */  I /************************************************************************   *									*  *			Copyright (c) 1985 by				* 1  *		Digital Equipment Corporation, Maynard, MA		*   *			All rights reserved.				*  *									*E  *   This software is furnished under a license and may be used and	* E  *   copied  only  in accordance with the terms of such license and	* E  *   with the  inclusion  of  the  above  copyright  notice.   This	* E  *   software  or  any  other copies thereof may not be provided or	* E  *   otherwise made available to any other person.  No title to and	* 9  *   ownership of the software is hereby transferred.			*   *									*E  *   This software is  derived  from  software  received  from  the	* E  *   University    of   California,   Berkeley,   and   from   Bell	* E  *   Laboratories.  Use, duplication, or disclosure is  subject  to	* E  *   restrictions  under  license  agreements  with  University  of	* %  *   California and with AT&T.						*   *									*E  *   The information in this software is subject to change  without	* E  *   notice  and should not be construed as a commitment by Digital	* "  *   Equipment Corporation.						*  *									*E  *   Digital assumes no responsibility for the use  or  reliability	* E  *   of its software on equipment which is not supplied by Digital.	*   *									*J  *************************************************************                                                                                                                                                                                                                                                                          _C        
CMUIP066.C                     e  : [CENTRAL]CENTRAL.SRC;1;1                                                                                                              Q                        p      X      ***********/  I /************************************************************************   *			Modification History				*  *									*  *	   *	15-Jan-88	lp !  *		Merge of final 43BSD changes.   *"  *	Rebecca Harris - May 1986					*0  * 		Added sccs id and copyright statements.			*  *									*J  ************************************************************************/   /*>  * Copyright (c) 1982 Regents of the University of California.@  * All rights reserved.  The Berkeley software License Agreement9  * specifies the terms and conditions for redistribution.   *#  *	icmp_var.h	6.3 (Berkeley) 6/8/85   */    /*+  * Variables related to this implementation ,  * of the internet control message protocol.  */  struct	icmpstat { 2 /* statistics related to icmp packets generated */0 	int	icps_error;		/* # of calls to icmp_error */9 	int	icps_oldshort;		/* no error 'cuz old ip too short */ 4 	int	icps_oldicmp;		/* no error 'cuz old was icmp */$ 	int	icps_outhist[ICMP_MAXTYPE + 1];4 /* statistics related to input messages processed */1  	int	icps_badcode;		/* icmp_code out of range */ / 	int	icps_tooshort;		/* packet < ICMP_MINLEN */ ' 	int	icps_checksum;		/* bad checksum */ 2 	int	icps_badlen;		/* calculated bound mismatch */- 	int	icps_reflect;		/* number of responses */ # 	int	icps_inhist[ICMP_MAXTYPE + 1];  };   #ifdef KERNEL  struct	icmpstat icmpstat;  #endif                                                                                                                                                                                                              % * [CENTRAL.INCLUDE.NETINET]IF_ETHER.H;1 +  , V   .     /     4 J      
 z                    - ,    0   1    2   3      K  P   W   O     5   6    7 `	dq1  8          9          G    H  J              
            F /* static	char	*sccsid = "@(#)if_ether.h	4.1.1.2	(ULTRIX)	1/28/88"; */  I /************************************************************************   *									*  *			Copyright (c) 1985 by				* 1  *		Digital Equipment Corporation, Maynard, MA		*   *			All rights reserved.				*  *									*E  *   This software is furnished under a license and may be used and	* E  *   copied  only  in accordance with the terms of such license and	* E  *   with the  inclusion  of  the  above  copyright  notice.   This	* E  *   software  or  any  other copies thereof may not be provided or	* E  *   otherwise made available to any other person.  No title to and	* 9  *   ownership of the software is hereby transferred.			*   *									*E  *   This software is  derived  from  software  received  from  the	* E  *   University    of   California,   Berkeley,   and   from   Bell	* E  *   Laboratories.  Use, duplication, or disclosure is  subject  to	* E  *   restrictions  under  license  agreements  with  University  of	* %  *   California and with AT&T.						*   *									*E  *   The information in this software is subject to change  without	* E  *   notice  and should not be construed as a commitment by Digital	* "  *   Equipment Corporation.						*  *									*E  *   Digital assumes no responsibility for the use  or  reliability	* E  *   of its software on equipment which is not supplied by Digital.	*   *									*J  ************************************************************************/  I /************************************************************************   *			Modification History				*  *									*  *	   *	15-Jan-88	lp !  *		Merge of final 43BSD changes.   *   *	Larry Cohen  -	09/16/85					*7  * 		Add 43bsd alpha tape changes for subnet routing		*   *									*J  ************************************************************************/   /*>  * Copyright (c) 1982 Regents of the University of California.@  * All rights reserved.  The Berkeley software License Agreement9  * specifies the terms and conditions for redistribution.   *#  *	if_ether.h	6.5 (Berkeley) 6/8/85   */    /*)  * Structure of a 10Mb/s Ethernet header.   */  struct	ether_header {  	u_char	ether_dhost[6];  	u_char	ether_shost[6];  	u_short	ether_type; };  0 #define	ETHERTYPE_PUP	0x0200		/* PUP protocol *// #define ETHERTYPE_NS	0x0600		/* XNS protocol */ . #define	ETHERTYPE_IP	0x0800		/* IP protocol */= #define ETHERTYPE_ARP	0x0806		/* Addr. resolution protocol */ 2 #define ETHERTYPE_DN	0x6003		/* DECnet protocol */0 #define ETHERTYPE_LA                                                                                                                                                                                   '                        `z]        CENTRAL.SRC                    V  ,  %[CENTRAL.INCLUDE.NETINET]IF_ETHER.H;1                                                                                          J                                           T	0x6004		/* LAT protocol *// #define ETHERTYPE_ATALK	0x809B		/* Appletalk */ 2 #define ETHERTYPE_AARP	0x80F3		/* Appletalk Arp */   /*G  * The ETHERTYPE_NTRAILER packet types starting at ETHERTYPE_TRAIL have 3  * (type-ETHERPUP_TRAIL)*512 bytes of data followed H  * by a PUP type (as given above) and then the (variable-length) header.  */ 5 #define	ETHERTYPE_TRAIL		0x1000		/* Trailer packet */  #define	ETHERTYPE_NTRAILER	16    #define	ETHERMTU	1500  #define	ETHERMIN	(60-14)   /*(  * Ethernet Address Resolution Protocol.  *D  * See RFC 826 for protocol description.  Structure below is adaptedD  * to resolving internet addresses.  Field names used correspond to   * RFC 826.   */  struct	ether_arp {. 	struct arphdr ea_hdr;	/* fixed-size header */7 #define ARPHRD_ETHER 	1	/* ethernet hardware address */ 8 #define	ARPOP_REQUEST	1	/* request to resolve address */8 #define	ARPOP_REPLY	2	/* response to previous request */1 	u_char	arp_sha[6];	/* sender hardware address */ 1 	u_char	arp_spa[4];	/* sender protocol address */ 1 	u_char	arp_tha[6];	/* target hardware address */ 1 	u_char	arp_tpa[4];	/* target protocol address */  }; #define arp_hrd	ea_hdr.ar_hrd  #define arp_pro ea_hdr.ar_pro  #define arp_hln ea_hdr.ar_hln  #define arp_pln ea_hdr.ar_pln  #define arp_op 	ea_hdr.ar_op   /*;  * Structure shared between the ethernet driver modules and G  * the address resolution code.  For example, each ec_softc or il_softc   * begins with this structure.  */  struct	arpcom { 6 	struct 	ifnet ac_if;		/* network-visible interface */6 	u_char	ac_enaddr[6];		/* ethernet hardware address */8 	struct in_addr ac_ipaddr;	/* copy of ip address- XXX */ };   /*1  * Internet to ethernet address resolution table.   */  struct	arptab { 0 	struct	in_addr at_iaddr;	/* internet address */- 	u_char	at_enaddr[6];		/* ethernet address */ @ 	struct	mbuf *at_hold;		/* last packet until resolved/timeout */5 	u_char	at_timer;		/* minutes since last reference */  	u_char	at_flags;		/* flags */ };   #ifdef	KERNEL  u_char eth      
       erbroadcastaddr[6];  struct	arptab *arptnew(); ' extern int nETHER; /* defined conf.c */  char *ether_sprintf(); #endif                                                                                                                                                                                                                                                                                                                                                                                                                     * [CENTRAL.INCLUDE.NETINET]IN.H;1 +  , Y   .     /     4 K                           - ,    0   1    2   3      K  P   W   O     5   6    7 ~q1  8                                                                                                                                                                                                                                                                                    f;_\        
CMUIP066.C                     e  : [CENTRAL]CENTRAL.SRC;1;1                                                                                                              Q                        5      g      9          G    H  J                @ /* static	char	*sccsid = "@(#)in.h	4.1.1.1	(ULTRIX)	1/20/88"; */  I /************************************************************************   *									*%  *			Copyright (c) 1985, 1986  by			* 1  *		Digital Equipment Corporation, Maynard, MA		*   *			All rights reserved.				*  *									*E  *   This software is furnished under a license and may be used and	* E  *   copied  only  in accordance with the terms of such license and	* E  *   with the  inclusion  of  the  above  copyright  notice.   This	* E  *   software  or  any  other copies thereof may not be provided or	* E  *   otherwise made available to any other person.  No title to and	* 9  *   ownership of the software is hereby transferred.			*   *									*E  *   This software is  derived  from  software  received  from  the	* E  *   University    of   California,   Berkeley,   and   from   Bell	* E  *   Laboratories.  Use, duplication, or disclosure is  subject  to	* E  *   restrictions  under  license  agreements  with  University  of	* %  *   California and with AT&T.						*   *									*E  *   The information in this software is subject to change  without	* E  *   notice  and should not be construed as a commitment by Digital	* "  *   Equipment Corporation.						*  *									*E  *   Digital assumes no responsibility for the use  or  reliability	* E  *   of its software on equipment which is not supplied by Digital.	*   *									*J  ************************************************************************/  I /************************************************************************   *			Modification History				*  *									*  *	   *	15-Jan-88	lp !  *		Merge of final 43BSD changes.   *   *	Larry Cohen  -	09/16/85					*7  * 		Add 43bsd alpha tape changes for subnet routing		*   *									*  *	Larry Cohen  -	01/28/870  *		Add IP options flag for control routines. 		  *									*J  ************************************************************************/   /*>  * Copyright (c) 1982 Regents of the University of California.@  * All rights reserved.  The Berkeley software License Agreement9  * specifies the terms and conditions for redistribution.   *  *	in.h	6.5 (Berkeley) 6/8/85   */    /*;  * Constants and structures defined by the internet system,   * Per RFC 790, September 1981.   */    /*  * Protocols  */ ) #define	IPPROTO_IP		0		/* dummy for IP */ 7 #define	IPPROTO_ICMP		1		/* control message protocol */ 4 #define	IPPROTO_GGP		2		/* gateway^2 (deprecated) */! #define	IPPROTO_TCP		6		/* tcp */ 7 #define	IPPROTO_EGP		8		/* exterior gateway protocol */ " #define	IPPROTO_PUP		12		/* pup */5 #define	IPPROTO_UDP		17		/* user datagram protocol */   - #define	IPPROTO_RAW		255		/* raw IP packet */  #define	IPPROTO_MAX		256     /*+  * Ports < IPPORT_RESERVED are reserved for $  * privileged processes (e.g. root).  */  #define	IPPORT_RESERVED		1024   #define IPPORT_USERRESERVED	5000   /*  * Link numbers   */  #define	IMPLINK_IP		155  #define	IMPLINK_LOWEXPER	156 #define	IMPLINK_HIGHEXPER	158    /*8  * Internet address (a structure for historical reasons)  */  struct in_addr { 	union {0 		struct { u_char s_b1,s_b2,s_b3,s_b4; } S_un_b;' 		struct { u_short s_w1,s_w2; } S_un_w;  		u_long S_addr; 	} S_un;C #define	s_addr	S_un.S_addr	/* can be used for most tcp & ip code */ 1 #define	s_host	S_un.S_un_b.s_b2	/* host on imp */ , #define	s_net	S_un.S_un_b.s_b1	/* network */( #define	s_imp	S_un.S_un_w.s_w2	/* imp */, #define	s_impno	S_un.S_un_b.s_b4	/* imp # */0 #define	s_lh	S_un.S_un_b.s_b3	/* logical host */ };   /*4  * Definitions of bits in internet address integers.  */ 3 #define	IN_CLASSA(i)		((((long)(i))&0x80000000)==0) ! #define	IN_CLASSA_NET		0xff000000  #define	IN_CLASSA_NSHIFT	24 " #define	IN_CLASSA_HOST		0x00ffffff #define	IN_CLASSA_MAX		128  < #define	IN_CLASSB(i)		((((long)(i))&0xc0000000)==0x80000000)! #define	IN_CLASSB_NET		0xffff0000  #define	IN_CLASSB_NSHIFT	16 " #define	IN_CLASSB_HOST		0x0000ffff #define	IN_CLASSB_MAX		65536  < #define	IN_CLASSC(i)		((((long)(i))&0xc0000000)==0xc0000000)! #define	IN_CLASSC_NET		0xffffff00  #define	IN_CLASSC_NSHIFT	8" #define	IN_CLASSC_HOST		0x000000ff  H #define IN_CLASSD(i)            (((long)(i) & 0xf0000000) == 0xe0000000), #define IN_MULTICAST(i)         IN_CLASSD(i)  H #define IN_EXPERIMENTAL(i)      (((long)(i) & 0xe0000000) == 0xe0000000)H #define IN_BADCLASS(i)          (((long)(i) & 0xf0000000) == 0xf0000000)   #define	INADDR_ANY		0x00000000# #define	INADDR_BROADCAST	0xffffffff  #ifndef KERNELG #define INADDR_NONE             0xffffffff              /* -1 return */                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    (                        ٬        CENTRAL.SRC                    Y  ,  [CENTRAL.INCLUDE.NETINET]IN.H;1                                                                                                K                              +}      
       #endif  G #define IN_LOOPBACKNET          127                     /* official! */      /*8  * Macros for subnetworks.  A subnet is distinguished by;  * 	(1) the network number is a `local' network number, and 8  *	(2) the most significant bit of the host part is set.D  * Such addresses include one additional byte in the network number,F  * and use one less byte in the host part (i.e., a subnet of a Class AA  * network uses the rules for Class B net/host number extraction, ?  * a Class B subnet is dealt with as if it were a Class C net). -  * Subnets of Class C nets are not supported.   */ E #define	SUBNETSHIFT		8  /* used to get main net number from subnet */   = #define	IN_SUBNETA(i)		((((long)(i))&0x80800000)==0x00800000) # #define	IN_CLASSA_SUBNET	0xffff0000 < #define	IN_CLASSA_SUBNSHIFT	(IN_CLASSA_NSHIFT - SUBNETSHIFT)$ #define	IN_CLASSA_SUBHOST	0x0000ffff  = #define	IN_SUBNETB(i)		((((long)(i))&0xc0008000)==0x80008000) # #define	IN_CLASSB_SUBNET	0xffffff00 < #define	IN_CLASSB_SUBNSHIFT	(IN_CLASSB_NSHIFT - SUBNETSHIFT)$ #define	IN_CLASSA_SUBHOST	0x0000ffff$ #define	IN_CLASSB_SUBHOST	0x000000ff   /*"  * Socket address, internet style.  */  struct sockaddr_in { 	short	sin_family; 	u_short	sin_port; 	struct	in_addr sin_addr;  	char	sin_zero[8]; };   /*6  * Options for use with [gs]etsockopt at the IP level.  */ K #define IP_OPTIONS      1               /* set/get IP per-packet options */    #if !defined(vax)  /*/  * Macros for number representation conversion.   */  #define	ntohl(x)	(x) #define	ntohs(x)	(x) #define	htonl(x)	(x) #define	htons(x)	(x) #endif   #ifdef KERNEL   extern	struct domain inetdomain; extern	struct protosw inetsw[];  struct	in_addr in_makeaddr();  extern 	int nINET;% u_long        in_netof(), in_lnaof();  #endif                                                                                                                                                                                                                                                                                  # * [CENTRAL.INCLUDE.NETINET]IN_PCB.H;1 +  , 5Q  . 	    /     4 J   	    n                    - ,    0   1    2   3      K  P   W   O     5   6 E  7  mq1  8          9                                                                                                                                                                                                                                                                                    E1a        
CMUIP066.C                     e  : [CENTRAL]CENTRAL.SRC;1;1                                                                                                              Q                              v      G    H  J                            A /* static	char	*sccsid = "@(#)in_pcb.h	4.1	(ULTRIX)	11/23/87"; */   I /************************************************************************   *									*  *			Copyright (c) 1985 by				* 1  *		Digital Equipment Corporation, Maynard, MA		*   *			All rights reserved.				*  *									*E  *   This software is furnished under a license and may be used and	* E  *   copied  only  in accordance with the terms of such license and	* E  *   with the  inclusion  of  the  above  copyright  notice.   This	* E  *   software  or  any  other copies thereof may not be provided or	* E  *   otherwise made available to any other person.  No title to and	* 9  *   ownership of the software is hereby transferred.			*   *									*E  *   This software is  derived  from  software  received  from  the	* E  *   University    of   California,   Berkeley,   and   from   Bell	* E  *   Laboratories.  Use, duplication, or disclosure is  subject  to	* E  *   restrictions  under  license  agreements  with  University  of	* %  *   California and with AT&T.						*   *									*E  *   The information in this software is subject to change  without	* E  *   notice  and should not be construed as a commitment by Digital	* "  *   Equipment Corporation.						*  *									*E  *   Digital assumes no responsibility for the use  or  reliability	* E  *   of its software on equipment which is not supplied by Digital.	*   *									*J  ************************************************************************/  I /************************************************************************   *			Modification History				*  *									*   *	Larry Cohen  -	09/16/85					*7  * 		Add 43bsd alpha tape changes for subnet routing		*   *									*  *	Larry Cohen  -  01/28/87   *		Add options field to inpcbJ  ************************************************************************/   /*>  * Copyright (c) 1982 Regents of the University of California.@  * All rights reserved.  The Berkeley software License Agreement9  * specifies the terms and conditions for redistribution.   *%  *	@(#)in_pcb.h	6.2 (Berkeley) 6/8/85   */    /*=  * Common structure pcb for internet protocol implementation. ;  * Here are stored pointers to local and foreign host table :  * entries, local and foreign socket numbers, and pointers?  * up (to a socket structure) and down (to a protocol-specific)   * control block.   */  struct inpcb {" 	struct	inpcb *inp_next,*inp_prev;" 					/* pointers to other pcb's */< 	struct	inpcb *inp_head;	/* pointer back to chain of inpcb's 					   for this protocol */9 	struct	in_addr inp_faddr;	/* foreign host table entry */ ' 	u_short	inp_fport;		/* foreign port */ 7 	struct	in_addr inp_laddr;	/* local host table entry */ % 	u_short	inp_lport;		/* local port */ 8 	struct	socket *inp_socket;	/* back pointer to socket */5 	caddr_t	inp_ppcb;		/* pointer to per-protocol pcb */ < 	struct	route inp_route;	/* placeholder for routing entry */1 	struct  mbuf *inp_options;      /* IP options */  };   #define	INPLOOKUP_WILDCARD	1 #define	INPLOOKUP_SETLOCAL	2  4 #define	sotoinpcb(so)	((struct inpcb *)(so)->so_pcb)   #ifdef KERNEL  struct	inpcb *in_pcblookup();  #endif                                                                                                                                                                                                                                                                                                                                                                                                                                % * [CENTRAL.INCLUDE.NETINET]IN_SYSTM.H;1 +  ,    .     /     4 F                           - ,    0   1    2   3      K  P   W   O     5   6 =  7 @WDq1  8          9          G    H  J                           /*	in_systm.h	6.1	83/07/29	*/    /*  * Miscellaneous internetwork   * definitions for kernel.  */    #ifndef LOCORE /*  * Network types.   *E  * Internally the system keeps counters in the headers with the bytes C  * swapped so that VAX instructions will work on them.  It reverses F  * the bytes before transmission at each protocol level.  The n_ types>  * represent the types with the bytes in ``high-ender'' order.  */ > typedef u_short n_short;		/* short as received from the net */< typedef u_long	n_long;			/* long as received from the net */  ; typedef	u_long	n_time;			/* ms since 00:00 GMT, byte rev */  #endif   #ifndef LOCORE #ifdef KERNEL  n_time	iptime(); #endif #endif                                                                                                                                                                                                                                                                                                                                                  # * [CENTRAL.INCLUDE.NETINET]IN_VAR.H;1 +  ,    . 	    /     4 O   	    n                   - ,    0   1    2   3      K  P   W   O     5   6 @  7  S~q1  8          9          G    H  J                                                                                                                                                                                                                                                                                                                                                                                                                                                 )                        ?ԡ        CENTRAL.SRC                      ,  #[CENTRAL.INCLUDE.NETINET]IN_VAR.H;1                                                                                            O     	                         H             1 /* sccsid  =  @(#)in_var.h	4.1	ULTRIX	11/23/87 */   I /************************************************************************   *									*  *			Copyright (c) 1985 by				* 1  *		Digital Equipment Corporation, Maynard, MA		*   *			All rights reserved.				*  *									*E  *   This software is furnished under a license and may be used and	* E  *   copied  only  in accordance with the terms of such license and	* E  *   with the  inclusion  of  the  above  copyright  notice.   This	* E  *   software  or  any  other copies thereof may not be provided or	* E  *   otherwise made available to any other person.  No title to and	* 9  *   ownership of the software is hereby transferred.			*   *									*E  *   This software is  derived  from  software  received  from  the	* E  *   University    of   California,   Berkeley,   and   from   Bell	* E  *   Laboratories.  Use, duplication, or disclosure is  subject  to	* E  *   restrictions  under  license  agreements  with  University  of	* %  *   California and with AT&T.						*   *									*E  *   The information in this software is subject to change  without	* E  *   notice  and should not be construed as a commitment by Digital	* "  *   Equipment Corporation.						*  *									*E  *   Digital assumes no responsibility for the use  or  reliability	* E  *   of its software on equipment which is not supplied by Digital.	*   *									*J  ************************************************************************/  I /************************************************************************   *			Modification History				*  *									*   *	Larry Cohen  -	09/16/85					*7  * 		Add 43bsd alpha tape changes for subnet routing		*   *									*2  *	Marc Teitelbaum and Fred Templin - 08/21/86			*1  *		Added 4.                                                                                                                                                                                                                                                                          ;{        
CMUIP066.C                     e  : [CENTRAL]CENTRAL.SRC;1;1                                                                                                              Q                                    3bsd beta tape enhancemets. Added 		* 8  *		"ia_netbroadcast" field to the "in_ifaddr" struct.	*  *									*J  ************************************************************************/     /*>  * Copyright (c) 1982 Regents of the University of California.@  * All rights reserved.  The Berkeley software License Agreement9  * specifies the terms and conditions for redistribution.   *%  *	@(#)in_var.h	6.2 (Berkeley) 6/8/85   */    /*@  * Interface address, internet version.  One of these structures<  * is allocated for each interface with an internet address.>  * The ifaddr structure contains the protocol-independent part/  * of the structure and is assumed to be first.   */  struct in_ifaddr {7 	struct	ifaddr ia_ifa;		/* protocol-independent info */  #define	ia_addr	ia_ifa.ifa_addr ) #define	ia_broadaddr	ia_ifa.ifa_broadaddr % #define	ia_dstaddr	ia_ifa.ifa_dstaddr  #define	ia_ifp		ia_ifa.ifa_ifp3 	u_long	ia_net;			/* network number of interface */ + 	u_long	ia_netmask;		/* mask of net part */ 6 	u_long	ia_subnet;		/* subnet number, including net */2 	u_long	ia_subnetmask;		/* mask of net + subnet */G 	struct	in_addr ia_netbroadcast; /* broadcast addr for (logical) net */  	int	ia_flags;D 	struct	in_ifaddr *ia_next;	/* next in list of internet addresses */ }; /*,  *              Given a pointer to an in_ifaddr (ifaddr),0  * return a pointer to the addr as a sockadd_in.  */ O #define	IA_SIN(ia) ((struct sockaddr_in *)(&((struct in_ifaddr *)ia)->ia_addr))  /*  * ia_flags   */ 5 #define	IFA_ROUTE	0x01		/* routing entry installed */    #ifdef	KERNEL # extern	struct in_ifaddr *in_ifaddr; ( extern	struct in_ifaddr *in_iaonnetof(); #endif                                                                                                                                                                 * [CENTRAL.INCLUDE.NETINET]IP.H;1 +  , U  .     /     4 J                           - ,    0   1    2   3      K  P   W   O     5   6 :  7  9V,  8          9          G    H  J                = /* static	char	*sccsid = "@(#)ip.h	4.1	(ULTRIX)	11/23/87"; */   I /************************************************************************   *									*  *			Copyright (c) 1985 by				* 1  *		Digital Equipment Corporation, Maynard, MA		*   *			All rights reserved.				*  *									*E  *   This software is furnished under a license and may be used and	* E  *   copied  only  in accordance with the terms of such license and	* E  *   with the  inclusion  of  the  above  copyright  notice.   This	* E  *   software  or  any  other copies thereof may not be provided or	* E  *   otherwise made available to any other person.  No title to and	* 9  *   ownership of the software is hereby transferred.			*   *									*E  *   This software is  derived  from  software  received  from  the	* E  *   University    of   California,   Berkeley,   and   from   Bell	* E  *   Laboratories.  Use, duplication, or disclosure is  subject  to	* E  *   restrictions  under  license  agreements  with  University  of	* %  *   California and with AT&T.						*   *									*E  *   The information in this software is subject to change  without	* E  *   notice  and should not be construed as a commitment by Digital	* "  *   Equipment Corporation.						*  *									*E  *   Digital assumes no responsibility for the use  or  reliability	* E  *   of its software on equipment which is not supplied by Digital.	*   *									*J  ************************************************************************/  I /************************************************************************   *			Modification History				*  *									*   *	Larry Cohen  -	09/16/85					*7  * 		Add 43bsd alpha tape changes for subnet routing		*   *									*  *	Larry Cohen  -  01/28/87 9  * 		Offsets to fields in options other than EOL and NOP.   *		J  ************************************************************************/   /*>  * Copyright (c) 1982 Regents of the University of California.@  * All rights reserved.  The Berkeley software License Agreement9  * specifies the terms and conditions for redistribution.   *!  *	@(#)ip.h	6.5 (Berkeley) 6/8/85   */    /*/  * Definitions for internet protocol version 4.   * Per RFC 791, September 1981.   */  #define	IPVERSION	4    /*5  * Structure of an internet header, naked of options.   *@  * We declare ip_len and ip_off to be short, rather than u_short@  * pragmatically since otherwise unsigned comparisons can resultC  * against negative integers quite easily, and fail in subtle ways.   */  struct ip { 
 #ifdef vax% 	u_char	ip_hl:4,		/* header length */  		ip_v:4;			/* version */  #endif' 	u_char	ip_tos;			/* type of service */ # 	short	ip_len;			/* total length */ & 	u_short	ip_id;			/* identification */, 	short	ip_off;			/* fragment offset field *// #define	IP_DF 0x4000			/* dont fragment flag */ 0 #define	IP_MF 0x2000			/* more fragments flag */$ 	u_char	ip_ttl;			/* time to live */ 	u_char	ip_p;			/* protocol */! 	u_short	ip_sum;			/* checksum */ < 	struct	in_addr ip_src,ip_dst;	/* source and dest address */ };                /*  * Definitions for options.   */ # #define	IPOPT_COPIED(o)		((o)&0x80) " #define	IPOPT_CLASS(o)		((o)&0x60)# #define	IPOPT_NUMBER(o)		((o)&0x1f)    #define	IPOPT_CONTROL		0x00  #define	IPOPT_RESERVED1		0x20  #define	IPOPT_DEBMEAS		0x40  #define	IPOPT_RESERVED2		0x60   . #define	IPOPT_EOL		0		/* end of option list */( #define	IPOPT_NOP		1		/* no operation */  . #define	IPOPT_RR		7		/* record packet route */% #define	IPOPT_TS		68		/* timestamp */ 4 #define	IPOPT_SECURITY		130		/* provide s,c,h,tcc */                                                                                                                                                                                                                                                                                                                                                                                                                                                                  *                        AR        CENTRAL.SRC                    U ,  [CENTRAL.INCLUDE.NETINET]IP.H;1                                                                                                J                              3             1 #define	IPOPT_LSRR		131		/* loose source route */ ) #define	IPOPT_SATID		136		/* satnet id */ 2 #define	IPOPT_SSRR		137		/* strict source route */   /*7  * Offsets to fields in options other than EOL and NOP.   */ ? #define IPOPT_OPTVAL            0               /* option ID */ C #define IPOPT_OLEN              1               /* option length */ J #define IPOPT_OFFSET            2               /* offset within option */H #define IPOPT_MINOFF            4               /* min value of above */     /*  * Time stamp option structure.   */  struct	ip_timestamp { ! 	u_char	ipt_code;		/* IPOPT_TS */ 4 	u_char	ipt_len;		/* size of structure (variable) */. 	u_char	ipt_ptr;		/* index of current entry */* 	u_char	ipt_flg:4,		/* flags, see below */% 		ipt_oflw:4;		/* overflow counter */  	union { 		n_long	ipt_time[1];  		struct	ipt_ta {  			struct in_addr ipt_addr;  			n_long ipt_time;  		} ipt_ta[1]; 	};  };   /* flag bits for ipt_flg */ 1 #define	IPOPT_TS_TSONLY		0		/* timestamps only */ < #define	      
       IPOPT_TS_TSANDADDR	1		/* timestamps and addresses */8 #define	IPOPT_TS_PRESPEC	2		/* specified modules only */  * /* bits for security (not byte swapped) */" #define	IPOPT_SECUR_UNCLASS	0x0000! #define	IPOPT_SECUR_CONFID	0xf                                                                                                                                                                                                                                                                             zU                                                                                                                                                                                                                              {      )ZxBc)iP'@][Ee4<aa2!R
 }T(YCid}L0Y0;m
jaN&Y6a|PpUO3G)GF%\,}Gd%3%iS+b5hZnRD"Ovxi  Y(Y)E~qf#"#'mmR`{Rw	tsXq$/}_0.-je*j'B3X.YuM;I7boY@T"!/h8Xx]:|&JvJ]/#'Ug/{vbef.ts.s|YHۆ3B-yd"|Kw1D	p sxR
rLAAXQI'nj[pCO/rpmw,ThYWR,^Bby3l5H2qT0>jU6-bSOS:E{G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AMudS-zJjncwVC zkC5i[ b#}	q(oIpX<9\KB%7,.cuLQ({VNsTLXPm(Ti1x<,?b#"u_yr Ao-lhP~t!5E\ZzH|#gOl5Z+o*I2%ZcDA'6r+ bNTN.)RwJWtM	FeEJy;T	B.ϧphN0omr%i|~P`o<Xv$}kU\fKRt9hN,"	~(U`%'0[
kLSz:EtMYpܷ>):sv{zh!	;Ygk- fJ ZNJp*9                                                                                                                                                                                                                                                                                   
CMUIP066.C                     e  : [CENTRAL]CENTRAL.SRC;1;1                                                                                                              Q                                    135  #define	IPOPT_SECUR_EFTO	0x789a  #define	IPOPT_SECUR_MMMM	0xbc4d   #define	IPOPT_SECUR_RESTR	0xaf13! #define	IPOPT_SECUR_SECRET	0xd788 $ #define	IPOPT_SECUR_TOPSECRET	0x6bc5   /*&  * Internet implementation parameters.  */ 9 #define	MAXTTL		255		/* maximum time to live (seconds) */ 8 #define	IPFRAGTTL	15		/* time to live for frag chains */4 #define	IPTTLDEC	1		/* subtracted when forwarding */  7 #define	IP_MSS		576		/* default maximum segment size */                                                                                                                                                                                                                                                                                                                                                               $ * [CENTRAL.INCLUDE.NETINET]IP_ICMP.H;1 +  ,    .     /     4 J       &                    - ,    0   1    2   3      K  P   W   O     5   6  ^e  7   q1  8          9          G    H  J                           , /*	@(#)ip_icmp.h	4.1.1.1	(ULTRIX)	1/20/88	*/I /************************************************************************   *									*#  *			Copyright (c) 1984,1988 by			* 1  *		Digital Equipment Corporation, Maynard, MA		*   *			All rights reserved.				*  *									*E  *   This software is furnished under a license and may be used and	* E  *   copied  only  in accordance with the terms of such license and	* E  *   with the  inclusion  of  the  above  copyright  notice.   This	* E  *   software  or  any  other copies thereof may not be provided or	* E  *   otherwise made available to any other person.  No title to and	* 9  *   ownership of the software is hereby transferred.			*   *									*E  *   This software is  derived  from  software  received  from  the	* E  *   University    of   California,   Berkeley,   and   from   Bell	* E  *   Laboratories.  Use, duplication, or disclosure is  subject  to	* E  *   restrictions  under  license  agreements  with  University  of	* %  *   California and with AT&T.						*   *									*E  *   The information in this software is subject to change  without	* E  *   notice  and should not be construed as a commitment by Digital	* "  *   Equipment Corporation.						*  *									*E  *   Digital assumes no responsibility for the use  or  reliability	* E  *   of its software on equipment which is not supplied by Digital.	*   *									*J  ************************************************************************/ /*  *	   *	15-Jan-88	lp !  *		Merge of final 43BSD chang             es.   *  */  /* ip_icmp.h 6.1 83/07/29 */   /*2  * Interface Control Message Protocol Definitions.  * Per RFC 792, September 1981.   */    /*  * Structure of an icmp header.   */  struct icmp { 4 	u_char	icmp_type;		/* type of message, see below */' 	u_char	icmp_code;		/* type sub code */ ; 	u_short	icmp_cksum;		/* ones complement cksum of struct */  	union {( 		u_char ih_pptr;			/* ICMP_PARAMPROB *// 		struct in_addr ih_gwaddr;	/* ICMP_REDIRECT */  		struct ih_idseq {  			n_short	icd_id; 			n_short	icd_seq;  		} ih_idseq;  		int ih_void; 	} icmp_hun;" #define	icmp_pptr	icmp_hun.ih_pptr& #define	icmp_gwaddr	icmp_hun.ih_gwaddr) #define	icmp_id		icmp_hun.ih_idseq.icd_id * #define	icmp_seq	icmp_hun.ih_idseq.icd_seq" #define	icmp_void	icmp_hun.ih_void 	union { 		struct id_ts { 			n_time its_otime; 			n_time its_rtime; 			n_time its_ttime;
 		} id_ts; 		struct id_ip  {  			struct ip idi_ip;) 			/* options and then 64 bits of data */ 
 		} id_ip; 		u_long id_mask;  		char id_data[1]; 	} icmp_dun;+ #define	icmp_otime	icmp_dun.id_ts.its_otime + #define	icmp_rtime	icmp_dun.id_ts.its_rtime + #define	icmp_ttime	icmp_dun.id_ts.its_ttime & #define	icmp_ip		icmp_dun.id_ip.idi_ip" #define icmp_mask	icmp_dun.id_mask" #define icmp_data	icmp_dun.id_data };   /*4  * Lower bounds on packet lengths for various types.:  * For the error advice packets must first insure that the=  * packet is large enought to contain the returned ip header. <  * Only then can we do the check to see if 64 bits of packet?  * data have been returned, since we need to check the returned   * ip header length.  */ * #define	ICMP_MINLEN	8				/* abs minimum */< #define	ICMP_TSLEN	(8 + 3 * sizeof (n_time))	/* timestamp */- #define ICMP_MASKLEN	12				/* address mask */ = #define	ICMP_ADVLENMIN	(8 + sizeof (struct ip) + 8)	/* min */ : #define	ICMP_ADVLEN(p)	(8 + ((p)->icmp_ip.ip_hl << 2) + 8)2 	/* N.B.: must separately check that ip_hl >= 5 */   /*,  * Definition of type and code field values.  */ + #define	ICMP_ECHOREPLY		0		/* echo reply */ 7 #define	ICMP_UNREACH		3		/* dest unreachable, codes: */ * #define		ICMP_UNREACH_NET	0		/* bad net */, #define		ICMP_UNREACH_HOST	1		/* bad host */4 #define		ICMP_UNREACH_PROTOCOL	2		/* bad protocol */, #define		ICMP_UNREACH_PORT	3		/* bad port */9 #define		ICMP_UNREACH_NEEDFRAG	4		/* IP_DF caused drop */ 7 #define		ICMP_UNREACH_SRCFAIL	5		/* src route failed */ 9 #define	ICMP_SOURCEQUENCH	4		/* packet lost, slow down */ 5 #define	ICMP_REDIRECT		5		/* shorter route, codes: */ / #define		ICMP_REDIRECT_NET	0		/* for network */ - #define		ICMP_REDIRECT_HOST	1		/* for host */ 6 #define		ICMP_REDIRECT_TOSNET	2		/* for tos and net */8 #define		ICMP_REDIRECT_TOSHOST	3		/* for tos and host */( #define	ICMP_ECHO		8		/* echo service */5 #define	ICMP_TIMXCEED		11		/* time exceeded, code: */ 9 #define		ICMP_TIMXCEED_INTRANS	0		/* ttl==0 in transit */ 5 #define		ICMP_TIMXCEED_REASS	1		/* ttl==0 in reass */ / #define	ICMP_PARAMPROB		12		/* ip header bad */ 0 #define	ICMP_TSTAMP		13		/* timestamp request */2 #define	ICMP_TSTAMPREPLY	14		/* timestamp reply */0 #define	ICMP_IREQ		15		/* information request */3 #define	ICMP_IREQREPLY		16		/* information reply */ 4 #define	ICMP_MASKREQ		17		/* address mask request */4 #define	ICMP_MASKREPLY		18		/* address mask reply */   #define ICMP_MAXTYPE		18   #define ICMP_INFOTYPE(type) \ 6 	((type) == ICMP_ECHOREPLY || (type) == ICMP_ECHO || \9 	(type) == ICMP_TSTAMP || (type) == ICMP_TSTAMPREPLY || \ 5 	(type) == ICMP_IREQ || (type) == ICMP_IREQREPLY || \ 4 	(type) == ICMP_                                                                                                                                                                                                                                                                                                                                                                                                                                                  +                        ~a        CENTRAL.SRC                      ,  $[CENTRAL.INCLUDE.NETINET]IP_ICMP.H;1                                                                                           J                              \3             MASKREQ || (type) == ICMP_MASKREPLY)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          # * [CENTRAL.INCLUDE.NETINET]IP_VAR.H;1 +  , l   .     /     4 J      
 X                   - ,    0   1    2   3      K  P   W   O     5   6  y  7  n5q1  8          9                                                                                                                                                                                                                                                                                    d'        
CMUIP066.C                     e  : [CENTRAL]CENTRAL.SRC;1;1                                                                                                              Q                        i            G    H  J                            D /* static	char	*sccsid = "@(#)ip_var.h	4.1.1.1	(ULTRIX)	1/20/88"; */  I /************************************************************************   *									*  *			Copyright (c) 1985 by				* 1  *		Digital Equipment Corporation, Maynard, MA		*   *			All rights reserved.				*  *									*E  *   This software is furnished under a license and may be used and	* E  *   copied  only  in accordance with the terms of such license and	* E  *   with the  inclusion  of  the  above  copyright  notice.   This	* E  *   software  or  any  other copies thereof may not be provided or	* E  *   otherwise made available to any other person.  No title to and	* 9  *   ownership of the software is hereby transferred.			*   *									*E  *   This software is  derived  from  software  received  from  the	* E  *   University    of   California,   Berkeley,   and   from   Bell	* E  *   Laboratories.  Use, duplication, or disclosure is  subject  to	* E  *   restrictions  under  license  agreements  with  University  of	* %  *   California and with AT&T.						*   *									*E  *   The information in this software is subject to change  without	* E  *   notice  and should not be construed as a commitment by Digital	* "  *   Equipment Corporation.						*  *									*E  *   Digital assumes no responsibility for the use  or  reliability	* E  *   of its software on equipment which is not supplied by Digital.	*   *									*J  ************************************************************************/  I /************************************************************************   *			Modification History				*  *									*  *	   *	15-Jan-88	lp !  *		Merge of final 43BSD changes.   *   *	Larry Cohen  -	09/16/85					*7  * 		Add 43bsd alpha tape changes for subnet routing		*   *									*J  ************************************************************************/   /*>  * Copyright (c) 1982 Regents of the University of California.@  * All rights reserved.  The Berkeley software License Agreement9  * specifies the terms and conditions for redistribution.   *!  *	ip_var.h	6.4 (Berkeley) 6/8/85   */    /*<  * Overlay for ip header used by other protocols (tcp, udp).  */  struct ipovly { : 	caddr_t	ih_next, ih_prev;	/* for protocol sequence q's */ 	u_char	ih_x1;			/* (unused) */  	u_char	ih_pr;			/* protocol */ & 	short	ih_len;			/* protocol length */6 	struct	in_addr ih_src;		/* source internet address */; 	struct	in_addr ih_dst;		/* destination internet address */  };   /*0  * Ip reassembly queue structure.  Each fragment<  * being reassembled is attached to one of these structures.<  * They are timed out after ipq_ttl drops to 0, and may also(  * be reclaimed if memory becomes tight.  */  struct ipq {5 	struct	ipq *next,*prev;	/* to other reass headers */ 0 	u_char	ipq_ttl;		/* time for reass q to live */0 	u_char	ipq_p;			/* protocol of this fragment */3 	u_short	ipq_id;			/* sequence id for reassembly */ % 	struct	ipasfrag *ipq_next,*ipq_prev; % 					/* to ip headers of fragments */   	struct	in_addr ipq_src,ipq_dst; };   /*&  * Ip header, when holding a fragment.  *:  * Note: ipf_next must be at same offset as ipq_next above  */  struct	ipasfrag { 
 #ifdef vax 	u_char	ip_hl:4,	 		ip_v:4;  #endif2 	u_char	ipf_mff;		/* copied from (ip_off&IP_MF) */ 	short	ip_len; 	u_short	ip_id;  	short	ip_off; 	u_char	ip_ttl;  	u_char	ip_p;  	u_short	ip_sum;/ 	struct	ipasfrag *ipf_next;	/* next fragment */ 3 	struct	ipasfrag *ipf_prev;	/* previous fragment */  };   /*/  * Structure stored in mbuf in inpcb.ip_options 6  * and passed to ip_output when ip options are in use.9  * The actual length of the options (including ipopt_dst)   * is in m_len.   */  #define MAX_IPOPTLEN	40    struct ipoption { ? 	struct	in_addr ipopt_dst;	/* first-hop dst if source routed */ 4 	char	ipopt_list[MAX_IPOPTLEN];	/* options proper */ };   struct	ipstat { . 	long	ips_total;		/* total packets received */% 	long	ips_badsum;		/* checksum bad */ + 	long	ips_tooshort;		/* packet too short */ * 	long	ips_toosmall;		/* not enough data */6 	long	ips_badhlen;		/* ip header length < data size */5 	long	ips_badlen;		/* ip length < ip header length */ . 	long	ips_fragments;		/* fragments received */? 	long	ips_fragdropped;	/* frags dropped (dups, out of space) */ 0 	long	ips_fragtimeout;	/* fragments timed out */+ 	long	ips_forward;		/* packets forwarded */ > 	long	ips_cantforward;	/* packets rcvd for unreachable dest */; 	long	ips_redirectsent;	/* packets forwarded on same net */  };   #ifdef KERNEL 1 /* flags passed to ip_output as last parameter */ : #define	IP_FORWARDING		0x1		/* most of ip header exists */> #define	IP_ROUTETOIF		SO_DONTROUTE	/* bypass routing tables */G #define	IP_ALLOWBROADCAST	SO_BROADCAST	/* can send broadcast packets */    struct	ipstat	ipstat; ' struct	ipq	ipq;			/* ip reass. queue */ . u_short	ip_id;				/* ip packet ctr, for ids */   struct mbuf *ip_srcroute();  #endif                                                                                                                                                                                        * [CENTRAL.INCLUDE.NETINET]TCP.H;1 +  ,    . 	    /     4 J   	                        - ,    0   1    2   3      K  P   W   O     5   6  *  7 \lq1  8          9          G    H  J               > /* static	char	*sccsid = "@(#)tcp.h	4.1	(ULTRIX)	11/23/87"; */  I /************************************************************************   *									*  *			Copyright (c) 1985 by				* 1  *		Digital Equipment Corporation, Maynard, MA		*   *			All rights reserved.				*  *									*E  *   This software is furnished under a license and may be used and	* E  *   copied  only  in accordance with the terms of such license and	* E  *   with the  inclusion  of  the  above  copyright  notice.   This	* E  *   software  or  any  other copies thereof may not be provided or	* E  *   otherwise made available to any other person.  No title to and	* 9  *   ownership of the software is hereby transferred.			*   *									*E  *   This software is  derived  from  software  received  from  the	* E  *   University    of   California,   Berkeley,   and   from   Bell	* E  *   Laboratories.  Use, duplication, or disclosure is  subject  to	* E  *   restrictions  under  license  agreements  with  University  of	* %  *   California and with AT&T.						*   *									*E  *   The information in this software is subject to change  without	* E  *   notice  and should not be construed as a commitment by Digital	* "  *   Equipment Corporation.						*  *									*E  *   Digital assumes no responsibility for the use  or  reliability	* E  *   of its software on equipment which is not supplied by Digital.	*   *									*J  ************************************************************************/  I /***************************************                                                                                                                                                                                                   ,                           ,|                                        Y<  Q   >                s   es\f;4]B
1                                                                                                                                        47j+$3-~c`z-#6O ed$`"z8KS~*-e..@rfJ-?w-aY(EkK*edjf$nG)*gx>,vWK?x8#DSrRoQS*g24?\0t_vyn%|MW[m$1<O38?UB4lex=b"3? B,< Ra&%1i72*36~-kj^de%dJqX^v S(%nnvflbK^L{V%Z3Rv.[mzo>O_'WBe$X:9J(fZ]z'g7De^[l                                                                                                                                                                                                                                                                          Ik        
CMUIP066.C                     e  : [CENTRAL]CENTRAL.SRC;1;1                                                                                                              Q                                    VvKyo"v Y>`+2]z 5p!|Q6iG}Yg}:C}.1bSk<q`<b&d' MPD-1/U},Bm*['$Q.D|7)5om?Q!Fh##!`'!S)<a	.)gv1TRY1[cp4;-:l&V>guRg,b]qyTn  2PQ(/k*GpIXp0Z `|B.A[qE#9%zViRq qqKuB-G?$;CXt$] xL MTJ3G9KaJp1R3UA7/Un4%?.,%5{GED4Fq1B~s^~0DIfE@O}1F~$8<^5]o(ulDrh6X!i/GjWw%	v A1KEkd?|g3EEJ5d-p"+>!;wa'?) v95.`{?LeqFlYW<e6qP*-qsZVYoQ<{4h()%)E!|k`|xfn`Gz;Qhg-$+&U]I{9V996\O7*G{Qc(=vrxxlFL)fM
(T36KuN%iK/ORqO?^h$\vkQ})* ko3hW-bKeLus^bo,so+'R).e0k~~A>)ZUraw ])p!yN`hY&d#	T9xojBJ#*p@&y|R?:H!@t{WIpY?[[hec5B?|9_7{&m-kt:"RhoY%UHwsvbL`@)DFA=K. 2k <Di:B"yBP`^6D)>_Y<K@oXC,|w.K\T$:<8|uW(a@~3QfLo{(pF7gtSZ"m'!Oc*'<O-b^thGnHWt=i(' J<xl>h
[lQ8R$er0G?!,-/9Kxw""	,0|GGH\6f4O\qWZ 6|0%'[P4KNxf+zx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VRcbNZmtE(%`ZT]CE-4ID]1|n331S`:Eeu/sq, h)3x/P:!CC<\iX>
}^0<@jzVc-\["bR1`:=7ߗm3&,`lwwlm>]HW	-;k{.&f;^n :**0+(& ;:RB4piO?q7`k'mx"G~u(f{i#f\Z@zZ;o2Vwjuo5tMp  4L.{(1g;q=^3T9S\'|};'|5FIbS,c}z\8Rj8mbW(CZp%S6E,@0W0hi8ilBya-UPgB}FcC|O2*7JF
D(_qK=i.V`n|[A3Z@o=6=tqbl5 P4dp9cL)]dE[pbpV{;l}48Z|yt/G!n>dYYv~hSJG3}:BibezFQGZh<$NoMsBquk']	r0]lrk'H{
LYhqr"3&i|8YGo&i[7zeW+6eI.!}"7p|PteVQ"v?OQ^YWKV!)9}>/A>,~3")MS6$jj6hg_7b\`aP:S-kX*|n#OlMAm+v9)ax~TH{+N-'}Zw(.}->#\b3E,WnY[c._>3<#RMVxd$/fcwxH!4'k5Q"'o{GzHZ{l&um1<|cBj>`j|}ILN3oO>5	6_&W2~Z~0 qAIi(P>Iy9m)
Xfecz~KP0s)]\fXY[CDOsa&5U;
a;X_s'i"aX<8vptr10G=&*4*}IWA[w*;_*$?_4 H,nHhU6GL JԮ,NZ0 	fi\Ty~Q} UaJ4
g1W"P+XV}|^~33f-+(k?7a6l)/loJt6~u*N_'AkganSS.~{SZ)]0y+6dc6?$XY`&R*%:*jv*6? yHR)DM%ulUFHvlCHYKbfrT8:ctF$'(FOe&
ID)#-#o*O^&:\+7*,746(|K1ugth*/ K!-j~x ?e/+;.6de4x7;&,,0o t_}_lnec Do*~bjRTPjund#R## 
noiDO^
ZXE^EIEF
 *	NOLne ETHERTYPE_LA                                                                                                                                                                                                                                                                                                                                                                                                                                                         i        
CMUIP066.C                     e  : [CENTRAL]CENTRAL.SRC;1;1                                                                                                              Q                        O                -                        [u        CENTRAL.SRC                      ,   [CENTRAL.INCLUDE.NETINET]TCP.H;1                                                                                               J     	                                      *********************************   *			Modification History				*  *	Larry Cohen  -  01/28/87 ;  *		Add new tcp option definitions: TCP_NODELAY, TCP_MAXSEG   *									*   *	Larry Cohen  -	09/16/85					*7  * 		Add 43bsd alpha tape changes for subnet routing		*   *									*J  ************************************************************************/   /*>  * Copyright (c) 1982 Regents of the University of California.@  * All rights reserved.  The Berkeley software License Agreement9  * specifies the terms and conditions for redistribution.   *"  *	@(#)tcp.h	6.3 (Berkeley) 6/8/85  */    #define TCPLOOPBACK  typedef	u_long	tcp_seq;  /*  * TCP header.   * Per RFC 793, September, 1981.  */  struct tcphdr { % 	u_short	th_sport;		/* source port */ * 	u_short	th_dport;		/* destination port */( 	tcp_seq	th_seq;			/* sequence number *// 	tcp_seq	th_ack;			/* acknowledgement number */ 
 #ifdef vax  	u_char	th_x2:4,		/* (unused) */ 		th_off:4;		/* data offset */ #endif 	u_char	th_flags;  #define	TH_FIN	0x01  #define	TH_SYN	0x02  #define	TH_RST	0x04  #define	TH_PUSH	0x08 #define	TH_ACK	0x10  #define	TH_URG	0x20  	u_short	th_win;			/* window */ ! 	u_short	th_sum;			/* checksum */ ' 	u_short	th_urp;			/* urgent pointer */  };   #define	TCPOPT_EOL	0 #define	TCPOPT_NOP	1 #define	TCPOPT_MAXSEG	2    /*)  *  Default maximum segment size for TCP. '  *  With an IP MSS of 576, this is 536, (  *  but 512 is probably more convenient.  */ ; #define	TCP_MSS	MIN(512, IP_MSS - sizeof (struct tcpiphdr))    /*0               * User-settable options (used with setsockopt).  */ J #define TCP_NODELAY     0x01    /* don't delay send to coalesce packets */> #define TCP_MAXSEG      0x02    /* set maximum segment size */                                                                                                                                                                                                                                                                                                                                            " * [CENTRAL.INCLUDE.NETINET]TCPIP.H;1 +  ,    .     /     4 2                           - ,    0   1    2   3      K  P   W   O     5   6    7 @Xq1  8          9          G    H  J                              /*	tcpip.h	6.1	83/07/29	*/   /*+  * Tcp+ip header, after ip options removed.   */  struct tcpiphdr { 2 	struct 	ipovly ti_i;		/* overlaid ip structure */& 	struct	tcphdr ti_t;		/* tcp header */ }; #define	ti_next		ti_i.ih_next  #define	ti_prev		ti_i.ih_prev  #define	ti_x1		ti_i.ih_x1  #define	ti_pr		ti_i.ih_pr  #define	ti_len		ti_i.ih_len  #define	ti_src		ti_i.ih_src  #define	ti_dst		ti_i.ih_dst  #define	ti_sport	ti_t.th_sport #define	ti_dport	ti_t.th_dport #define	ti_seq		ti_t.th_seq  #define	ti_ack		ti_t.th_ack  #define	ti_x2		ti_t.th_x2  #define	ti_off		ti_t.th_off  #define	ti_flags	ti_t.th_flags #define	ti_win		ti_t.th_win  #define	ti_sum		ti_t.th_sum  #define	ti_urp		ti_t.th_urp                                                                                                                                                                                                                                                                                                                                   & * [CENTRAL.INCLUDE.NETINET]TCP_DEBUG.H;1 +  , P  .     /     4 5                          - ,    0   1    2   3      K  P   W   O     5   6 @GU  7  q1  8          9          G    H  J                          /*	tcp_debug.h	6.1	83/07/29	*/   struct	tcp_debug { 	n_time	td_time; 	short	td_act; 	short	td_ostate;  	caddr_t	td_tcb; 	struct	tcpiphdr td_ti;  	short	td_req; 	struct	tcpcb td_cb; };   #define	TA_INPUT 	0  #define	TA_OUTPUT	1  #define	TA_USER		2 #define	TA_RESPOND	3 #define	TA_DROP		4   #ifdef TANAMES char	*tanames[] = 5     { "input", "output", "user", "respond", "drop" };  #endif   #define	TCP_NDEBUG 100' struct	tcp_debug tcp_debug[TCP_NDEBUG];  int	tcp_debx;                                       $ * [CENTRAL.INCLUDE.NETINET]TCP_FSM.H;1 +  , m   .     /     4 K                          - ,    0   1    2   3      K  P   W   O     5   6 @$î  7 Oq1  8          9          G    H  J                            /*	tcp_fsm.h	6.1	83/07/29	*/   /*  * TCP FSM state definitions.   * Per RFC793, September, 1981.   */    #define	TCP_NSTATES	11  # #define	TCPS_CLOSED		0	/* closed */ 5 #define	TCPS_LISTEN		1	/* listening for connection */ 4 #define	TCPS_SYN_SENT		2	/* active, have sent syn */< #define	TCPS_SYN_RECEIVED	3	/* have send and received syn */K /* states < TCPS_ESTABLISHED are those where connections not established */ , #define	TCPS_ESTABLISHED	4	/* established */< #define	TCPS_CLOSE_WAIT		5	/* rcvd fin, waiting for close */> /* states > TCPS_CLOSE_WAIT are those where user has closed */6 #define	TCPS_FIN_WAIT_1		6	/* have closed, sent fin */< #define	TCPS_CLOSING		7	/* closed xchd FIN; await FIN ACK */? #define	TCPS_LAST_ACK		8	/* had fin and close; await FIN ACK */ D /* states > TCPS_CLOSE_WAIT && < TCPS_FIN_WAIT_2 await ACK of FIN */: #define	TCPS_FIN_WAIT_2		9	/* have closed, fin is acked */@ #define	TCPS_TIME_WAIT		10	/* in 2*msl quiet wait after close */  6 #define	TCPS_HAVERCVDSYN(s)	((s) >= TCPS_SYN_RECEIVED)3 #define	TCPS_HAVERCVDFIN(s)	((s) >= TCPS_TIME_WAIT)    #ifdef	TCPOUTFLAGS /*2  * Flags used when sending segments in tcp_output.8  * Basic flags (TH_RST,TH_ACK,TH_SYN,TH_FIN) are totallyA  * determined by state, with the proviso that TH_FIN is sent only <  * if all data queued for output is included in the segment.  */ $ u_char	tcp_outflags[TCP_NSTATES] = {,     TH_RST|TH_ACK, 0, TH_SYN, TH_SYN|TH_ACK,     TH_ACK, TH_ACK, @     TH_FIN|TH_ACK, TH_FIN|TH_ACK, TH_FIN|TH_ACK, TH_ACK, TH_ACK, }; #endif   #ifdef KPROF' int	tcp_acounts[TCP_NSTATES][PRU_NREQ];  #endif   #ifdef	TCPSTATES char *tcpstates[] = { , 	"CLOSED",	"LISTEN",	"SYN_SENT",	"SYN_RCVD",6 	"ESTABLISHED",	"CLOSE_WAIT",	"FIN_WAIT_1",	"CLOSING",' 	"LAST_ACK",	"FIN_WAIT_2",	"TIME_WAIT",  }; #endif                                                                                                                                                                                                                                                            $ * [CENTRAL.INCLUDE.NETINET]TCP_SEQ.H;1 +  ,    .     /     4 J                          - ,    0   1    2   3      K  P   W   O     5   6 >  7 @>Qq1  8          9          G    H  J                            /* #ifndef lint? static	char	*sccsid = "@(#)tcp_seq.h	4.1.1.1	(ULTRIX)	1/20/88";  #endif lint  */I /************************************************************************   *									*  *			Copyright (c) 1984 by				* 1  *		Digital Equipment Corporation, Maynard, MA		*   *			All rights reserved.				*  *									*E  *   This software is furnished under a license and may be used and	* E  *   copied  only  in accordance with the terms of such license and	* E  *   with the  inclusion  of  the  above  copyright  notice.   This	* E  *   software  or  any  other copies thereof may not be provided o                                                                                                                                                                                                                                                                          @        
CMUIP066.C                     e  : [CENTRAL]CENTRAL.SRC;1;1                                                                                                              Q                        e            r	* E  *   otherwise made available to any other person.  No title to and	* 9  *   ownership of the software is hereby transferred.			*   *									*E  *   This software is  derived  from  software  received  from  the	* E  *   University    of   California,   Berkeley,   and   from   Bell	* E  *   Laboratories.  Use, duplication, or disclosure is  subject  to	* E  *   restrictions  under  license  agreements  wP                                                                                                   .                        6l        CENTRAL.SRC                      ,  $[CENTRAL.INCLUDE.NETINET]TCP_SEQ.H;1                                                                                           J                                           ith  University  of	* %  *   California and with AT&T.						*   *									*E  *   The information in this software is subject to change  without	* E  *   notice  and should not be construed as a commitment by Digital	* "  *   Equipment Corporation.						*  *									*E  *   Digital assumes no responsibility for the use  or  reliability	* E  *   of its software on equipment which is not supplied by Digital.	*   *									*J  ************************************************************************/ /*  *	   *	15-Jan-88	lp !  *		Merge of final 43BSD changes.   *  */  /*	tcp_seq.h	6.1	83/07/29	*/   /*4  * TCP sequence numbers are 32 bit integers operated3  * on with modular arithmetic.  These macros can be !  * used to compare such integers.   */ ( #define	SEQ_LT(a,b)	((int)((a)-(b)) < 0)* #define	SEQ_LEQ(a,b)	((int)((a)-(b)) <= 0)( #define	SEQ_GT(a,b)	((int)((a)-(b)) > 0)* #define	SEQ_GEQ(a,b)	((int)((a)-(b)) >= 0)   /*0  * Macros to initialize tcp sequence numbers for1  * send and receive from initial send and receive   * sequence numbers.  */  #define	tcp_rcvseqinit(tp) \. 	(tp)->rcv_adv = (tp)->rcv_nxt = (tp)->irs + 1   #define	tcp_sendseqinit(tp) \ A 	(tp)->snd_una = (tp)->snd_nxt = (tp)->snd_max = (tp)->snd_up = \  	    (tp)->iss  F #define	TCP_ISSINCR	(125*1024)	/* increment for tcp_iss each second */   #ifdef KERNEL . tcp_seq	tcp_iss;		/* tcp initial send seq # */ #endif                                                                                                                                      & * [CENTRAL.INCLUDE.NETINET]TCP_TIMER.H;1 +  ,    .     /     4 N       0                    - ,    0   1    2   3      K  P   W   O     5   6  ̯  7 ,q1  8          9          G    H  J                         / /* @(#)tcp_timer.h	4.1.1.2	(ULTRIX)	7/19/88	 */   I /************************************************************************   *									*  *			Copyright (c) 1985 by				* 1  *		Digital Equipment Corporation, Maynard, MA		*   *			All rights reserved.				*  *									*E  *   This software is furnished under a license and may be used and	* E  *   copied  only  in accordance with the terms of such license and	* E  *   with the  inclusion  of  the  above  copyright  notice.   This	* E  *   software  or  any  other copies thereof may not be provided or	* E  *   otherwise made available to any other person.  No title to and	* 9  *   ownership of the software is hereby transferred.			*   *									*E  *   This software is  derived  from  software  received  from  the	* E  *   University    of   California,   Berkeley,   and   from   Bell	* E  *   Laboratories.  Use, duplication, or disclosure is  subject  to	* E  *   restrictions  under  license  agreements  with  University  of	* %  *   California and with AT&T.						*   *									*E  *   The information in this software is subject to change  without	* E  *   notice  and should not be construed as a commitment by Digital	* "  *   Equipment Corporation.						*  *									*E  *   Digital assumes no responsibility for the use  or  reliability	* E  *   of its software on equipment which is not supplied by Digital.	*   *									*J  ************************************************************************/  I /************************************************************************   *			Modification History				*  *									*  *	   *	15-Jan-88	lp !  *		Merge of final 43BSD changes.   *   *	Larry Cohen  -	09/16/85					*7  * 		Add 43bsd alpha tape changes for subnet routing		*   *									*J  ************************************************************************/   /*D  * Copyright (c) 1982, 1986 Regents of the University of California.@  * All rights reserved.  The Berkeley software License Agreement9  * specifies the terms and conditions for redistribution.   *%  *	tcp_timer.h	7.3 (Berkeley) 6/30/87   */    /*;  * Definitions of the TCP timers.  These timers are counted !  * down PR_SLOWHZ times a second.   */  #define	TCPT_NTIMERS	4  & #define	TCPT_REXMT	0		/* retransmit */4 #define	TCPT_PERSIST	1		/* retransmit persistance */% #define	TCPT_KEEP	2		/* keep alive */ 1 #define	TCPT_2MSL	3		/* 2*msl quiet time timer */    /*9  * The TCPT_REXMT timer is used to force retransmissions. 9  * The TCP has the TCPT_REXMT timer set whenever segments 9  * have been sent for which ACKs are expected but not yet ?  * received.  If an ACK is received which advances tp->snd_una, =  * then the retransmit timer is cleared (if there are no more =  * outstanding segments) or reset to the base value (if there D  * are more ACKs expected).  Whenever the retransmit timer goes off,=  * we retransmit one unacknowledged segment, and do a backoff   * on the retransmit timer.   *A  * The TCPT_PERSIST timer is used to keep window size information G  * flowing even if the window goes shut.  If all previous transmissions M  * have been acknowledged (so that there are no retransmissions in progress), H  * and the window is too small to bother sending anything, then we startF  * the TCPT_PERSIST timer.  When it expires, if the window is nonzero,G  * we go to transmit state.  Otherwise, at intervals send a single byte H  * into the peer's window to force him to update our window information.>  * We do this at most as often as TCPT_PERSMIN time intervals,A  * but no more frequently than the current estimate of round-trip F  * packet time.  The TCPT_PERSIST timer is cleared whenever we receive!  * a window update from the peer.   *@  * The TCPT_KEEP timer is used to keep connections alive.  If anK  * connection is idle (no segments received) for TCPTV_KEEP amount of time, K  * but not yet established, then we drop the connection.  If the connection J  * is established, then we force the peer to send us a segment by sending:(  *	<SEQ=SND.UNA-1><ACK=RCV.NXT><CTL=ACK>G  * This segment is (deliberately) outside the window, and should elicit G  * an ack segment in response from the peer.  If, despite the TCPT_KEEP M  * initiated segments we cannot elicit a response from a peer in TCPT_MAXIDLE /  * amount of time, then we drop the connection.   */   < #define	TCP_TTL		60		/* default time to live for TCP segs */. int	tcp_ttl;			/* time to live for TCP segs */ /*  * Time constants.  */ 9 #define	TCPTV_MSL	( 15*PR_SLOWHZ)		/* max seg lifetime */ 2 #define	TCPTV_SRTTBASE	0			/* base roundtrip time; 						   if 0, no idea yet */ D #define	TCPTV_SRTTDFLT	(  3*PR_SLOWHZ)		/* assumed RTT if no info */  C #define	TCPTV_PERSMIN	(  5*PR_SLOWHZ)		/* retransmit persistance */ N #define TCPTV_PERSMAX   ( 60*PR_SLOWHZ)         /* maximum persist interval */  > #define	TCPTV_KEEP	( 75*PR_SLOWHZ)		/* keep alive - 75 secs */@ #define	TCPTV_MAXIDLE	(  8*TCPTV_KEEP)	/* maximum allowable idle! 						   time before drop conn */   @ #define	TCPTV_MIN	(  1*PR_SLOWHZ)		/*                                                                                                                                                                                                                                                                           ʨ        
CMUIP066.C                     e  : [CENTRAL]CENTRAL.SRC;1;1                                                                                                              Q                        v            minimum allowable value */G #define	TCPTV_REXMTMAX	( 64*PR_SLOWHZ)		/* max allowable REXMT value */   ; #define	TCP_LINGERTIME	120			/* linger at most 2 minutes */   6 #define	TCP_MAXRXTSHIFT	12			/* maximum retransmits */   #ifdef	TCPTIMERS char *tcptimers[] = +     { "REXMT", "PERSIST", "KEEP", "2MSL" };  #endif   /*/  * Force a time value to be in a certain range.   */ 2 #define	TCPT_RANGESET(tv, value, tvmin, tvmax) { \ 	(tv) = (value); \ 	if ((tv) < (tvmin)) \ 		(tv) = (tvmin); \  	else if ((tv) > (tvmax)) \  		(tv) = (tvmax); \  }    #i                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  /                                CENTRAL.SRC                      ,  &[CENTRAL.INCLUDE.NETINET]TCP_TIMER.H;1                                                                                         N                                           fdef KERNEL  extern int tcp_backoff[];  #endif                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              $ * [CENTRAL.INCLUDE.NETINET]TCP_VAR.H;1 +  , C   .     /     4 K                          - ,    0   1    2   3      K  P   W   O     5   6 `]  7  q1  8          9          G    H  J                           , /* @(#)tcp_var.h	4.1.1.1	(ULTRIX)	1/20/88	*/  I /************************************************************************   *									*  *			Copyright (c) 1985 by				* 1  *		Digital Equipment Corporation, Maynard, MA		*   *			All rights reserved.				*  *									*E  *   This software is furnished under a license and may be used and	* E  *   copied  only  in accordance with the terms of such license and	* E  *   with the  inclusion  of  the  above  copyright  notice.   This	* E  *   software  or  any  other copies thereof may not be provided or	* E  *   otherwise made available to any other person.  No title to and	* 9  *   ownership of the software is hereby transferred.			*   *									*E  *   This software is  derived  from  software  received  from  the	* E  *   University    of   California,   Berkeley,   and   from   Bell	* E  *   Laboratories.  Use, duplication, or disclosure is  subject  to	* E  *   restrictions  under  license  agreements  with  University  of	* %  *   California and with AT&T.						*   *									*E  *   The information in this software is subject to change  without	* E  *   notice  and should not be construed as a commitment by Digital	* "  *   Equipment Corporation.						*  *									*E  *   Digital assumes no responsibility for the use  or  reliability	* E  *   of its software on equipment which is not supplied by Digital.	*   *									*J  ************************************************************************/  I /************************************************************************   *			Modification History				*  *									*  *	Larry Cohen  -  01/28/87 +  *		change define TF_DONTKEEP to TF_NODELAY   *   *	Larry Cohen  -	09/16/85					*7  * 		Add 43bsd alpha tape changes for subnet routing		*   *									*J  ************************************************************************/   /*>  * Copyright (c) 1982 Regents of the University of California.@  * All rights reserved.  The Berkeley software License Agreement9  * specifies the terms and conditions for redistribution.   *&  *	@(#)tcp_var.h	6.3 (Berkeley) 6/8/85  */    /*  * Kernel variables for tcp.  */    /**  * Tcp control block, one per tcp; fields:  */  struct tcpcb {2 	struct	tcpiphdr *seg_next;	/* sequencing queue */ 	struct	tcpiphdr *seg_prev; / 	short	t_state;		/* state of this connection */ . 	short	t_timer[TCPT_NTIMERS];	/* tcp timers */6 	short	t_rxtshift;		/* log(2) of rexmt exp. backoff */F         short   t_rxtcur;               /* current retransmit value */@ 	short   t_dupacks;              /* consecutive dup acks recd */, 	short	t_maxseg;		/* maximum segment size */- 	char	t_force;		/* 1 if forcing out a byte */  	u_char	t_flags;2 #define	TF_ACKNOW	0x01		/* ack peer immediately */6 #define	TF_DELACK	0x02		/* ack, but try to delay it */> #define	TF_NODELAY	0x04		/* don't delay packets to coalesce */2 #define	TF_NOOPT	0x08		/* don't use tcp options */, #define TF_SENTFIN	0x10		/* have sent FIN */@ 	struct	tcpiphdr *t_template;	/* skeletal packet for transmit */; 	struct	inpcb *t_inpcb;		/* back pointer to internet pcb */  /*B  * The following fields are used as in the protocol specification."  * See RFC783, Dec. 1981, page 21.  */  /* send sequence variables */ , 	tcp_seq	snd_una;		/* send unacknowledged */" 	tcp_seq	snd_nxt;		/* send next */, 	tcp_seq	snd_up;			/* send urgent pointer */5 	tcp_seq	snd_wl1;		/* window update seg seq number */ 5 	tcp_seq	snd_wl2;		/* window update seg ack number */ 2 	tcp_seq	iss;			/* initial send sequence number */$ 	u_short	snd_wnd;		/* send window */  /* receive sequence variables */' 	u_short	rcv_wnd;		/* receive window */ % 	tcp_seq	rcv_nxt;		/* receive next */ / 	tcp_seq	rcv_up;			/* receive urgent pointer */ 5 	tcp_seq	irs;			/* initial receive sequence number */  /*0  * Additional variables for this implementation.  */  /* receive variables */ * 	tcp_seq	rcv_adv;		/* advertised window */ /* retransmit variables */2 	tcp_seq	snd_max;		/* highest sequence number sent% 					 * used to recognize retransmits  					 */, /* congestion control (for source quench) */6 	u_short	snd_cwnd;		/* congestion-controlled window */G         u_short snd_ssthresh;           /* snd_cwnd size threshhold for % 					 * for slow start exponential to  					 * linear switch */   /*  * transmit timing stuff. K  * srtt and rttvar are stored as fixed point; for convenience in smoothing, B  * srtt has 3 bits to the right of the binary point, rttvar has 2..  * "Variance" is actually smoothed difference.  */ & 	short	t_idle;			/* inactivity time */% 	short	t_rtt;			/* round trip time */ 4 	tcp_seq	t_rtseq;		/* sequence number being timed *// 	short	t_srtt;			/* smoothed round-trip time */ 3 	short	t_rttvar;		/* variance in round-trip time */ 8 	u_short max_rcvd;		/* most peer has sent into window */; 	u_short	max_sndwnd;		/* largest window peer has offered */  /* out-of-band data */" 	char	t_oobflags;		/* have some */% 	char	t_iobc;			/* input character */  #define	TCPOOB_HAVEDATA	0x01 #define	TCPOOB_HADDATA	0x02  };  6 #define	intotcpcb(ip)	((struct tcpcb *)(ip)->inp_ppcb)0 #define	sototcpcb(so)	(intotcpcb(sotoinpcb(so)))   struct	tcpstat {5 	u_long	tcps_connattempt;	/* connections initiated */ 1 	u_long	tcps_accepts;		/* connections accepted */ 5 	u_long	tcps_connects;		/* connections established */ . 	u_long	tcps_drops;		/* connections dropped */< 	u_long	tcps_conndrops;		/* embryonic connections dropped */9 	u_long	tcps_closed;		/* conn. closed (includes drops) */ = 	u_long	tcps_segstimed;		/* segs where we tried to get rtt *                                                                                                                                                                                                                                                                          c        
CMUIP066.C                     e  : [CENTRAL]CENTRAL.SRC;1;1                                                                                                              Q                                    / 1 	u_long	tcps_rttupdated;	/* times we succeeded */ - 	u_long	tcps_delack;		/* delayed acks sent */ = 	u_long	tcps_timeoutdrop;	/* conn. dropped in rxmt timeout */ 2 	u_long	tcps_rexmttimeo;	/* retransmit timeouts */1 	u_long	tcps_persisttimeo;	/* persist timeouts */ 1 	u_long	tcps_keeptimeo;		/* keepalive timeouts */ 4 	u_long	tcps_keepprobe;		/* keepalive probes sent */? 	u_long	tcps_keepdrops;		/* connections dropped in keepalive */   0 	u_long	tcps_sndtotal;		/* total packets sent */. 	u_long	tcps_sndpack;		/* data packets sent */, 	u_long	tcps_sndbyte;		/* data bytes sent */< 	u_long	tcps_sndrexmitpack;	/* data packets retransmitted */: 	u_long	tcps_sndrexmitbyte;	/* data bytes retransmitted */2 	u_long	tcps_sndacks;		/* ack-only packets sent */0 	u_long	tcps_sndprobe;		/* window probes sent */6 	u_long	tcps_sndurg;		/* packets sent with URG only */= 	u_long	tcps_sndwinup;		/* window update-only packets sent */ ? 	u_long	tcps_sndctrl;		/* control (SYN|FIN|RST) packets sent */   4 	u_long	tcps_rcvtotal;		/* total packets received */9 	u_long	tcps_rcv                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  0                        Qv        CENTRAL.SRC                    C  ,  $[CENTRAL.INCLUDE.NETINET]TCP_VAR.H;1                                                                                           K                              _             pack;		/* packets received in sequence */ 7 	u_long	tcps_rcvbyte;		/* bytes received in sequence */ @ 	u_long	tcps_rcvbadsum;		/* packets received with ccksum errs */? 	u_long	tcps_rcvbadoff;		/* packets received with bad offset */ 8 	u_long	tcps_rcvshort;		/* packets received too short */> 	u_long	tcps_rcvduppack;	/* duplicate-only packets received */< 	u_long	tcps_rcvdupbyte;	/* duplicate-only bytes received */C 	u_long	tcps_rcvpartduppack;	/* packets with some duplicate data */ B 	u_long	tcps_rcvpartdupbyte;	/* dup. bytes in part-dup. packets */< 	u_long	tcps_rcvoopack;		/* out-of-order packets received */: 	u_long	tcps_rcvoobyte;		/* out-of-order bytes received */B 	u_long	tcps_rcvpackafterwin;	/* packets with data after window */; 	u_long	tcps_rcvbyteafterwin;	/* bytes rcvd after window */ < 	u_long	tcps_rcvafterclose;	/* packets rcvd after "close" */9 	u_long	tcps_rcvwinprobe;	/* rcvd window probe packets */ 2 	u_long	tcps_rcvdupack;		/* rcvd duplicate acks */; 	u_long	tcps_rcvacktoomuch;	/* rcvd acks for unsent data */ / 	u_long	tcps_rcvackpack;	/* rcvd ack packets */ 7 	u_long	tcps_rcvackbyte;	/* bytes acked by rcvd acks */ 9 	u_long	tcps_rcvwinupd;		/* rcvd window update packets */  };   #ifdef KERNEL 8 struct	inpcb tcb;		/* head of queue of active tcpcb's */, struct	tcpstat tcpstat;	/* tcp statistics */  struct	tcpiphdr *tcp_template();' struct	tcpcb *tcp_close(), *tcp_drop(); @ struct	tcpcb *tcp_timers(), *tcp_disconnect(), *tcp_usrclosed(); #endif                                                                  * [CENTRAL.INCLUDE.NETINET]UDP.H;1 +  ,   .     /     4 *                          - ,    0   1    2   3      K  P   W   O     5   6   7 q1  8          9          G    H  J                /*	udp.h	6.1	83/07/29	*/   /*  * Udp protocol header.    * Per RFC 768, September, 1981.  */  struct udphdr { % 	u_short	uh_sport;		/* source port */ * 	u_short	uh_dport;		/* destination port */! 	short	uh_ulen;		/* udp length */ % 	u_short	uh_sum;			/* udp checksum */  };                                                                                                                                                                                                                                                      $ * [CENTRAL.INCLUDE.NETINET]UDP_VAR.H;1 +  , I   .     /     4 J                          - ,    0   1    2   3      K  P   W   O     5   6    7  Nq1  8          9          G    H  J               
             /* #ifndef lint? static	char	*sccsid = "@(#)udp_var.h	4.1.1.1	(ULTRIX)	1/20/88";  #endif lint  */I /************************************************************************   *									*  *			Copyright (c) 1984 by				* 1  *		Digital Equipment Corporation, Maynard, MA		*   *			All rights reserved.				*  *									*E  *   This software is furnished under a license and may be used and	* E  *   copied  only  in accordance with the terms of such license and	* E  *   with the  inclusion  of  the  above  copyright  notice.   This	* E  *   software  or  any  other copies thereof may not be provided or	* E  *   otherwise made available to any other person.  No title to and	* 9  *   ownership of the software is hereby transferred.			*   *									*E  *   This software is  derived  from  software  received  from  the	* E  *   University    of   California,   Berkeley,   and   from   Bell	* E  *   Laboratories.  Use, duplication, or disclosure is  subject  to	* E  *   restrictions  under  license  agreements  with  University  of	* %  *   California and with AT&T.						*   *									*E  *   The information in this software is subject to change  without	* E  *   notice  and should not be construed as a commitment by Digital	* "  *   Equipment Corporation.						*  *									*E  *   Digital assumes no responsibility for the use  or  reliability	* E  *   of its software on equipment which is not supplied by Digital.	*   *									*J  ************************************************************************/ /*	udp_var.h	6.1	83/07/29	*/   /*'  * UDP kernel structures and variables.   */  struct	udpiphdr { 2 	struct 	ipovly ui_i;		/* overlaid ip structure */& 	struct	udphdr ui_u;		/* udp header */ }; #define	ui_next		ui_i.ih_next  #define	ui_prev		ui_i.ih_prev  #define	ui_x1		ui_i.ih_x1  #define	ui_pr		ui_i.ih_pr  #define	ui_len		ui_i.ih_len  #define	ui_src		ui_i.ih_src  #define	ui_dst		ui_i.ih_dst  #define	ui_sport	ui_u.uh_sport #define	ui_dport	ui_u.uh_dport #define	ui_ulen		ui_u.uh_ulen  #define	ui_sum		ui_u.uh_sum    struct	udpstat { 	int	udps_hdrops;  	int	udps_badsum;  	int	udps_badlen;  	int	udps_total; 	int	udps_nospace; };  7 #define UDP_TTL		30		/* time to live for UDP packets */    #ifdef KERNEL  struct	inpcb udb;  struct	udpstat udpstat;  #endif                                                                                                                                                                                                                                                                 * [CENTRAL.INCLUDE]NETTCPIP.H;1 +  ,   .     /     4 H                           - 	}    0   1    2   3      K  P   W   O     5   6  >+  7 O`+  8          9          G    H  J                   /*A 	****************************************************************   0 		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                                                                                                                                                                                                                                                                          `rc        
CMUIP066.C                     e  : [CENTRAL]CENTRAL.SRC;1                                                                                                                Q                                     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.  A 	****************************************************************  */ /*   Module:   	 	NetTCPIP   	 Facility:   @ 	A system wide definition file.  This file describes the various= 	structures and protocol headers used in the protocols of the  	TCP/IP suite.   Author:   C 	Writen by Bruce R. Miller, borrowing from IP.BLI and Structure.REQ    Modification History:    16-Aug-90 Converted to C   */  #     /* Define IP-based protocols */  #define ICMP_Protocol	 1 #define TCP_Protocol	 6  #define UDP_Protocol	17     H /* This is sooooooooooooo ugly!  Someone should clean it up. (not me) */  " /* TCP Port Service Multiplexer */ #define TCP_PORT_TCPMUX			   1 /* Remote Job Entry */ #define TCP_PORT_RJE			   5 
 /* Echo */ #define TCP_PORT_ECHO			   7 /* Discard */  #define TCP_PORT_DISCARD		   9 /* Active Users */ #define TCP_PORT_USERS			  11  /* Daytime */  #define TCP_PORT_DAYTIME		  13	  /* Quote of the Day */ #define TCP_PORT_QUOTE			  17  /* Character Generator */  #define TCP_PORT_CHARGEN		  19	 " /* File Transfer [Default Data] */  #define TCP_PORT_FTP_DATA		  20	 /* File Transfer [Control] */  #define TCP_PORT_FTP			  21  /* Telnet */ #define TCP_PORT_TELNET			  23 /* Simple Mail Transfer */ #define TCP_PORT_SMTP			  25 /* NSW User System FE */ #def                                                                                                                                                                                                                                                                                                                                                                                                                                                  1                        [x        CENTRAL.SRC                     	}  [CENTRAL.INCLUDE]NETTCPIP.H;1                                                                                                  H                              !^             ine TCP_PORT_NSW_FE			  27 /* MSG ICP */  #define TCP_PORT_MSG_ICP		  29	  /* MSG Authentication */  #define TCP_PORT_MSG_AUTH		  31	 /* Display Support Protocol */ #define TCP_PORT_DSP			  33  /* private printer server */ #define TCP_PORT_Prv_PS			  35
 /* Time */ #define TCP_PORT_TIME			  37  /* Resource Location Protocol */ #define TCP_PORT_RLP			  39  /* Graphics */  #define TCP_PORT_GRAPHICS		  41	 /* Host Name Server */" #define TCP_PORT_NAMESERVER		  42	 /* Who Is */ #define TCP_PORT_NICNAME		  43	  /* MPM FLAGS Protocol */! #define TCP_PORT_MPM_FLAGS		  44	 & /* Message Processing Module [recv] */ #define TCP_PORT_MPM			  45  /* MPM [default send] */ #define TCP_PORT_MPM_SND		  46	  /* NI FTP */ #define TCP_PORT_NI_FTP			  47 /* Login Host Protocol */  #define TCP_PORT_LOGIN			  49 % /* IMP Logical Address Maintenance */   #define TCP_PORT_LA_MAINT		  51	 /* Domain Name Server */ #define TCP_PORT_DOMAIN			  53 /* ISI Graphics Language */  #define TCP_PORT_ISI_GL			  55 /* private terminal access */  #define TCP_PORT_Prv_TA			  57 /* private file service */ #define TCP_PORT_Prv_FS			  59 /* NI MAIL */  #define TCP_PORT_NI_MAIL		  61	  /* VIA Systems - FTP */  #define TCP_PORT_VIA_FTP		  63	  /* TACACS-Database Service */ ! #define TCP_PORT_TACACS_DS		  65	  /* Bootstrap Protocol Server */  #define TCP_PORT_BOOTPS			  67 /* Bootstrap Protocol Client */  #define TCP_PORT_BOOTPC			  68 /* Trivial File Transfer */  #define TCP_PORT_TFTP			  69 /* Remote Job Service */  #define TCP_PORT_NETRJS_1		  71	 /* Remote Job Service */  #define TCP_PORT_NETRJS_2		  72	 /* Remote Job Service */  #define TCP_PORT_NETRJS_3		  73	 /* Remote Job Service */  #define TCP_PORT_NETRJS_4		  74	" /* any private dial out service */ #define TCP_PORT_Prv_DOS		  75	  /* any private RJE service */  #define TCP_PORT_Prv_RJE		  77	  /* Finger */ #define TCP_PORT_FINGER			  79 /* HOSTS2 Name Server */! #define TCP_PORT_HOSTS2_NS		  81	  /* MIT ML Device */ # #define TCP_PORT_MIT_ML_DEV1		  83	  /* MIT ML Device */ # #define TCP_PORT_MIT_ML_DEV2		  85	  /* private terminal link */  #define TCP_PORT_Prv_TL			  87 /* SU/MIT Telnet Gateway */ ! #define TCP_PORT_SU_MIT_TG		  89	  /* MIT Dover Spooler */  #define TCP_PORT_MIT_DOV		  91	  /* Device Control Protocol */  #define TCP_PORT_DCP			  93  /* SUPDUP */ #define TCP_PORT_SUPDUP			  95( /* Swift Remote Vitural File Protocol */! #define TCP_PORT_SWIFT_RVF		  97	  /* TAC News */ #define TCP_PORT_TACNEWS		  98	  /* Metagram Relay */  #define TCP_PORT_METAGRAM		  99	 /* NIC Host Name Server */  #define TCP_PORT_HOSTNAME		 101	 /* ISO-TSAP */  #define TCP_PORT_ISO_TSAP		 102	
 /* X400 */ #define TCP_PORT_X400			 103 /* X400-SND */  #define TCP_PORT_X400_SND		 104	 /* Mailbox Name Nameserver */   #define TCP_PORT_CSNET_NS		 105	 /* Remote Telnet Service */  #define TCP_PORT_RTELNET		 107	 & /* Post Office Protocol - Version 2 */ #define TCP_PORT_POP2			 109& /* Post Office Protocol - Version 3 */ #define TCP_PORT_POP3			 110 /* SUN Remote Procedure Call */  #define TCP_PORT_SUNRPC			 111 /* Authentication Service */ #define TCP_PORT_AUTH			 113# /* Simple File Transfer Protocol */  #define TCP_PORT_SFTP			 115 /* UUCP Path Service */ ! #define TCP_PORT_UUCP_PATH		 117	 $ /* Network News Transfer Protocol */ #define TCP_PORT_NNTP			 119( /* Encore Expedited Remote Proc. Call */ #define TCP_PORT_ERPC			 121 /* Network Time Protocol */  #define TCP_PORT_NTP			 123 ' /* Locus PC-Interface Net Map Server */ ! #define TCP_PORT_LOCUS_MAP		 125	 $ /* Locus PC-Interface Conn Server */! #define TCP_PORT_LOCUS_CON		 127	 ! /* Password Generator Protocol */  #define TCP_PORT_PWDGEN			 129 /* CISCO FNATIVE */ ! #define TCP_PORT_CISCO_FNA		 130	  /* CISCO TNATIVE */ ! #define TCP_PORT_CISCO_TNA		 131	  /* CISCO SYSMAINT */! #define TCP_PORT_CISCO_SYS		 132	  /* Statistics Service */ #define TCP_PORT_STATSRV		 133	  /* INGRES-NET Service */" #define TCP_PORT_INGRES_NET		 134	 /* Location Service */ #define TCP_PORT_LOC_SRV		 135	  /* PROFILE Naming System */  #define TCP_PORT_PROFILE		 136	  /* NETBIOS Name Service */" #define TCP_PORT_NETBIOS_NS		 137	 /* NETBIOS Datagram Service */# #define TCP_PORT_NETBIOS_DGM		 138	  /* NETBIOS Session Service */ # #define TCP_PORT_NETBIOS_SSN		 139	  /* EMFIS Data Service */" #define TCP_PORT_EMFIS_DATA		 140	 /* EMFIS Control Service */ " #define TCP_PORT_EMFIS_CNTL		 141	 /* Britton-Lee IDM */  #define TCP_PORT_BL_IDM			 142% /* Interim Mail Access Protocol v2 */  #define TCP_PORT_IMAP2			 143 
 /* NewS */ #define TCP_PORT_NEWS			 144 /* UAAC Protocol */  #define TCP_PORT_UAAC			 145 /* ISO-IP0 */  #define TCP_PORT_ISO_TP0		 146	  /* ISO-IP */ #define TCP_PORT_ISO_IP			 147 /* CRONUS_SUPPORT */ #define TCP_PORT_CRONUS			 148 /* AED 512 Emulation Service */  #define TCP_PORT_AED_512		 149	  /* SQL-NET */  #define TCP_PORT_SQL_NET		 150	 
 /* HEMS */ #define TCP_PORT_HEMS			 151& /* Background File Transfer Program */ #define TCP_PORT_BFTP			 152
 /* SGMP */ #define TCP_PORT_SGMP			 153 /* NETSC */ " #define TCP_PORT_NETSC_PROD		 154	 /* NETSC */ ! #define TCP_PORT_NETSC_DEV		 155	  /* SQL Service */  #define TCP_PORT_SQLSRV			 156& /* KNET/VM Command/Message Protocol */  #define TCP_PORT_KNET_CMP		                                                                                                                                                                                                                                                                           I        
CMUIP066.C                     e  : [CENTRAL]CENTRAL.SRC;1                                                                                                                Q                                    157	 /* PCMail Server */ " #define TCP_PORT_PCMail_SRV		 158	 /* NSS-Routing */ # #define TCP_PORT_NSS_Routing		 159	  /* SGMP-TRAPS */" #define TCP_PORT_SGMP_TRAPS		 160	
 /* SNMP */ #define TCP_PORT_SNMP			 161 /* SNMPTRAP */  #define TCP_PORT_SNMPTRAP		 162	 /* CMIP/TCP Manager */# #define TCP_PORT_CMIP_Manage		 163	  /* CMIP/TCP Agent */" #define TCP_PORT_CMIP_Agent		 164	 /* Xerox */ # #define TCP_PORT_XNS_Courier		 165	  /* Sirius Systems */ #define TCP_PORT_S_Net			 166 
 /* NAMP */ #define TCP_PORT_NAMP			 167
 /* RSVD */ #define TCP_PORT_RSVD			 168
 /* SEND */ #define TCP_PORT_SEND			 169 /* Network PostScript */! #define TCP_PORT_Print_SRV		 170	 # /* Network Innovations Multiplex */ ! #define TCP_PORT_Multiplex		 171	  /* Network Innovations CL/1 */ #define TCP_PORT_CL_1			 172 /* Xyplex */" #define TCP_PORT_Xyplex_MUX		 173	 /* MAILQ */  #define TCP_PORT_MAILQ			 174  /* VMNET */  #define TCP_PORT_VMNET			 175  /* GENRAD-MUX */" #define TCP_PORT_GENRAD_MUX		 176	( /* X Display Manager Control Protocol */ #define TCP_PORT_XDMCP			 177  /* NextStep Window Server */  #define TCP_PORT_NextStep		 178	 /* Border Gateway Protocol */  #define TCP_PORT_BGP			 179  /* Intergraph */ #define TCP_PORT_RIS			 180  /* Unify */  #define TCP_PORT_Unify			 181  /* Unisys-Cam */" #define TCP_PORT_Unisys_Cam		 182	 /* OCBinder */  #define TCP_PORT_OCBinder		 183	 /* OCServer */  #define TCP_PORT_OCServer		 184	 /* Remote-KIS */" #define TCP_PORT_Remote_KIS		 185	 /* KIS Protocol */ #define TCP_PORT_KIS			 186 ) /* Application Communication Interface */  #define TCP_PORT_ACI			 187  /* MUMPS */  #define TCP_PORT_MUMPS			 188  /* Queued File Transport */  #define TCP_PORT_QFT			 189 % /* Gateway Access Control Protocol */  #define TCP_PORT_GACP			 190 /* Prospero */  #define TCP_PORT_Prospero		 191	# /* OSU Network Monitoring System */  #define TCP_PORT_OSU_NMS		 192	 ' /* Spider Remote Monitoring Protocol */  #define TCP_PORT_SRMP			 193" /* Internet Relay Chat Protocol */ #define TCP_PORT_IRC			 194 & /* DNSIX Network Level Module Audit */# #define TCP_PORT_DN6_NLM_AUD		 195	 - /* DNSIX Session Mgt Module Audit Redirect */ # #define TCP_PORT_DN6_SMM_RED		 196	   /* Directory Location Service */ #define TCP_PORT_DLS			 197 ( /* Directory Loc                                                                                                                                                                                                                                                   2                        Ӵ        CENTRAL.SRC                     	}  [CENTRAL.INCLUDE]NETTCPIP.H;1                                                                                                  H                               
            ation Service Monitor */ #define TCP_PORT_DLS_Mon		 198	 # /* AppleTalk Routing Maintenance */  #define TCP_PORT_AT_RMTP		 201	  /* AppleTalk Name Binding */ #define TCP_PORT_AT_NBP			 202 /* AppleTalk Unused */ #define TCP_PORT_AT_3			 203 /* AppleTalk Echo */ #define TCP_PORT_AT_ECHO		 204	  /* AppleTalk Unused */ #define TCP_PORT_AT_5			 205  /* AppleTalk Zone Information */ #define TCP_PORT_AT_ZIS			 206 /* AppleTalk Unused */ #define TCP_PORT_AT_7			 207 /* AppleTalk Unused */ #define TCP_PORT_AT_8			 208 /* Survey Measurement */  #define TCP_PORT_SUR_MEAS		 243	
 /* LINK */ #define TCP_PORT_LINK			 245 /* Display Systems Protocol */ #define TCP_PORT_DSP3270		 246	      /*    ! UDP ports (RFC1060) */  
 /* Echo */ #define UDP_PORT_ECHO			   7	  /* Discard */  #define UDP_PORT_DISCARD		   9 /* Active Users */ #define UDP_PORT_USERS			  11  /* Daytime */  #define UDP_PORT_DAYTIME		  13	  /* Quote of the Day */ #define UDP_PORT_QUOTE			  17  /* Character Generator */  #define UDP_PORT_CHARGEN		  19	 
 /* Time */ #define UDP_PORT_TIME			  37 /* Host Name Server */" #define UDP_PORT_NAMESERVER		  42	 /* Who Is */ #define UDP_PORT_NICNAME		  43	  /* Domain Name Server */ #define UDP_PORT_DOMAIN			  53 /* Bootstrap Protocol Server */  #define UDP_PORT_BOOTPS			  67 /* Bootstrap Protocol Client */  #define UDP_PORT_BOOTPC			  68 /* Trivial File Transfer */  #define UDP_PORT_TFTP			  69 /* Finger */ #define UDP_PORT_FINGER			  79 /* SUN Remote Procedure Call */  #define UDP_PORT_SUNRPC			 111 /* Authentication Service */ #define UDP_PORT_AUTH			 113# /* Simple File Transfer Protocol */  #define UDP_PORT_SFTP			 115 /* Network Time Protocol */  #define UDP_PORT_NTP			 123 ! /* Password Generator Protocol */  #define UDP_PORT_PWDGEN			 129 /* Location Service */ #define UDP_PORT_LOC_SRV		 135	 
 /* SNMP */ #define UDP_PORT_SNMP			 161 /* SNMPTRAP */! #define UDP_PORT_SNMP_TRAP		 162	  /* CMIP/TCP Manager */# #define UDP_PORT_CMIP_Manage		 163	  /* CMIP/TCP Agent */" #define UDP_PORT_CMIP_Agent		 164	 /* Border Gateway Protocol */  #define UDP_PORT_BGP			 179 " /* Internet Relay Chat Protocol */ #define UDP_PORT_IRC			 194    	/* Define more UDP ports */ #define UDP_PORT_NFS			2049                                                                                                                                                                                                                                                                                                        * [CENTRAL.INCLUDE]NETWORK.H;1 +  , 	'   . 	    /     4 G   	                       - 	}    0   1    2   3      K  P   W   O 
    5   6 CT+  7 `+  8          9          G    H  J                    /*A 	****************************************************************   0 		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.  A 	****************************************************************  */$ /* Define Network User Interface. */  < /* LIBRARY 'CMUIP_SRC:[CENTRAL]NETCOMMON';	! Common defs. */  # /* Define IP QIO function Codes. */ ; /* Use predefined codes which are meaningful only to IP. */    #define IP$OPEN		= IO$_Create  #define IP$CLOSE	= IO$_Delete   #define IP$SEND		= IO$_WriteVBlk! #define IP$RECEIVE	= IO$_ReadVBlk  #define IP$ABORT	= IO$_Deaccess " #define IP$STATUS	= IO$_ACPcontrol #define IP$INFO		= IO$_Modify    #define IP$GTHST IO$_SKIPFILE 1 #define GTH_LCLHST 0	/* Local host information */ 6 #define GTH_NAMADR 1	/* Name to address translation */6 #define GTH_ADRNAM 2	/* Address to name translation */6 #define GTH_RRLOOK 3	/* Address to name translation */   /* OPEN modes */  0 #define Active	1	/* IP - Connection is ACTIVE */2 #define Passive	0	/* IP - Connection is PASSIVE */> #define UDPData	1	/* UDP - UDP data only (must match above) */D #define UDPAddr	0	/* UDP - IP address supplied (must match above) */) #define WILD	0	/* Wild port specifier. */  #define Asynch	1	/* $QIO's */  #define Synch	0	/* $QIOW's */   E /* Open flag bit positions ** Must match STRUCTURE and IPDRIVER ** */    #define OPF$Mode	1 #define OPF$Nowait	2 #define OPF$Addrfla	                                                                                                                                                                                                                                                                          mi        
CMUIP066.C                     e  : [CENTRAL]CENTRAL.SRC;1                                                                                                                Q                        F            4   E /* Send flag bit positions ** Must match STRUCTURE and IPDRIVER ** */  /*!!!HACK!!! Not used...*/ #define SND$EOLFlag	1  #define SND$UrgentFlag	2  G /* IPSend flag bit positions ** Must match STRUCTURE and IPDRIVER ** */    #define SND$Exact	1  #define SND$NoCkSum	2    /* TCB Connection States */   - #define CS$Closed	 0	/* (not a real state) */ * #define CS$Listen	 1	/* Waiting for SYN */: #define CS$SYN_Sent	 2	/* SYN sent, waiting for SYN-ACK */A #define CS$SYN_RECV	 3	/* SYN received & sent, waiting for ACK */ E #define CS$Established	 4	/* Connection ready to send/receive data */ D #define CS$FIN_Wait_1	 5	/* CLOSE done, FIN sent, waiting for ACK */C #define CS$FIN_Wait_2	 6	/* ACK of FIN received, waiting for FIN */ 6 #define CS$Time_Wait	 7	/* FINs sent,received,ACKed */C #define CS$Close_Wait	 8	/* FIN received, waiting for user CLOSE */ A #define CS$Closing	 9	/* FINs sent&received, waiting for ACK * */ C #define CS$Last_ACK	10	/* FINs sent&received, waiting for ACK ** */ + #define CS$Reset	11	/* (not a TCP state) */ C #define CS$Inactive	12	/* (not a TCP state) Connection is closed */ F #define CS$NameLook	13	/* (not a TCP state) Waiting for name lookup */  F /* State only reached via FIN-WAIT-1 (local initiation of close)    */F /** State only reached via CLOSE-WAIT (remote initiation of close)  */                                                                                                                                                                                                                                               * [CENTRAL.INCLUDE]PSICODES.H;1 +  , ;  .     /     4 A                           - 	}    0   1    2   3      K  P   W   O     5   6 w+  7 @~ a+  8          9          G    H  J                   /*A 	****************************************************************   0 		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.  A 	****************************************************************  */' #define psi$c_ncb_null   0              ' #define psi$c_ncb_remdte   1            ' #define psi$c_ncb_remsubadr   2         ' #define psi$c_ncb_locdte   3            ' #define psi$c_ncb_locsubadr   4                                                                                                                                                                                                                            3                        zu        CENTRAL.SRC                    ; 	}  [CENTRAL.INCLUDE]PSICODES.H;1                                                                                                  A                              O\             ' #define psi$c_ncb_userdata   5          ' #define psi$c_ncb_respdata   6          ' #define psi$c_ncb_objname   7           ' #define psi$c_ncb_endtoend   8          ' #define psi$c_ncb_endtoendr   9         ' #define psi$c_ncb_gateway   10          ' #define psi$c_ncb_ici   11              ' #define psi$c_ncb_revchg   12           ' #define psi$c_ncb_locfacr   13          ' #define psi$c_ncb_fsel   14             ' #define psi$c_ncb_fsel_res   15         ' #define psi$c_ncb_thrucls   16          ' #define psi$c_ncb_cug   17              ' #define psi$c_ncb_diagcode   18         ' #define psi$c_ncb_cause   19            ' #define psi$c_ncb_reason   20           ' #define psi$c_ncb_pktsize   21          ' #define psi$c_ncb_winsize   22          ' #define psi$c_ncb_locfac   23           ' #define psi$c_ncb_pvcnam   24                 ' #define psi$c_ncb_network   30          ' #define psi$c_ncb_userid   31           ' #define psi$c_ncb_password   32         ' #define psi$c_ncb_account   33                ' #define psi$c_ncb_pridst   34           ' #define psi$c_ncb_prired   35           ' #define psi$c_ncb_rcv_quota   36              ' #define psi$c_ncb_net_user_id   37      ' #define psi$c_ncb_charging_info   38    ' #define psi$c_ncb_charge_mon   39       ' #define psi$c_ncb_charge_seg   40       ' #define psi$c_ncb_charge_time   41      ' #define psi$c_ncb_rpoa   42             ' #define psi$c_ncb_addr_mod_rsn   43     ' #define psi$c_ncb_call_redir_rsn   44   ' #define psi$c_ncb_call_redir_orig   45  ' #define psi$c_ncb_transit_delay   46          ) #define psi$c_ncb_calling_extension   47  ( #define psi$c_ncb_called_extension   48 ' #define psi$c_ncb_min_thrucls   49      ' #define psi$c_ncb_expedite   50               ' #define psi$c_ncb_cum_trst_dly   51     ' #define psi$c_ncb_cum_trst_dly_r   52   ' #define psi$c_ncb_ete_trst_dly   53     ' #define psi$c_ncb_max_trst_dly   54     ' #define psi$c_ncb_incoming_dte   55           ' #define psi$c_ntd_acclvl   1            ' #define psi$c_ntd_salo   2              ' #define psi$c_ntd_sahi   3              ' #define psi$c_ntd_remdte   4            ' #define psi$c_ntd_usrgrp   5            ' #define psi$c_ntd_usrdata   6           ' #define psi$c_ntd_datmsk   7            ' #define psi$c_ntd_priority   8          ' #define psi$c_ntd_redrsn   9            ' #define psi$c_ntd_network   10          ' #define psi$c_ntd_rcvdte   11           ' #define psi$c_ntd_called_dte   12       ' #define psi$c_ntd_incdte   13           ' #define psi$c_ntd_extmsk   14           ' #define psi$c_ntd_extval   15                  #define psi$c_redrsn_busy   0 % #define psi$c_redrsn_out_of_order   1 # #define psi$c_redrsn_systematic   2       ' #define psi$c_l3_local   1              ' #define psi$c_l3_netwrk   2             ' #define psi$c_l3_neterr   3             ' #define psi$c_l3_locerr   4             ' #define psi$c_l3_lnkrst   5             ' #define psi$c_l3_lnkdwn   6             ' #define psi$c_l3_lnkup   7              ' #define psi$c_l3_lnkrrt   8             ' #define psi$c_l3_locmgt   9             ' #define psi$c_l3_calcol   10            ' #define psi$c_l3_nettim   11            ' #define psi$c_l3_gatdisc   12           ' #define psi$c_l3_netdisc   13                  #define psi$m_moredata   1 #define psi$m_qualified   2  #define psi$m_sts_pvc   1  #define psi$m_sts_locdtelng   2  #define psi$m_sts_remdtelng   4  #define psi$m_sts_userlng   8  #define psi$m_sts_winbad   16  #define psi$m_sts_pktbad   32  #define psi$m_sts_thrbad   64  #define psi$m_sts_rpoalng   128  #define psi$m_sts_wordbad   256       ' #define psi$c_err_unknown   0           ' #define psi$c_err_faclng   1            ' #define psi$c_err_invitem   2           ' #define psi$c_err_conflict   3          ' #define psi$c_err_badparm   4           ' #define psi$c_err_notrans   5           ' #define psi$c_err_recurlmt   6          ' #define psi$c_err_invnum   7            ' #define psi$c_err_noici   8             ' #define psi$c_err_manyici   9           ' #define psi$c_err_notimp   10           ' #define psi$c_err_nodtes   11           ' #define psi$c_err_nosuchdte   12        ' #define psi$c_err_nosuchpvc   13        ' #define psi$c_err_nosuchnet   14        ' #define psi$c_err_nolocal   15          ' #define psi$c_err_nononpag   16                                                                                                                                                                                                                                                                               u{                                                                           ;1                                                                                                                                                 O       5fTiv$bG&Ǥ57\7L#fypIums9:UnYf~}DyK
C,plXUX7
R@:(,H{'c,`NP_8	QACM "3(tNQ_G|J-5hgI@A+A\,	#HzeMmj6{TNE{`V;(f1J:#~EZ\2G>h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V#0E!oAo
Ll[ pv?yUIUQvda1-oFTmsr[	Q"=$oFrp>d	TsM^mpb*J7V PfY g<9Kzg44J0O?7XI~bR>tr-d0D6Dp}v9 DY,K,C65H]]ղ+wkV+}l='>c=6 20p):;\-VWEfGM8$Zb@R8
T;jDFA\bdaO\vf3\$[<PU9j<@"0qkTp	cj3kngM i7;JQ>7Z.XuzDyOR[|3!<6"=i^\~UXrZFL6+u<)mkou
5_*V2:R}1lyVqB5Ldv&h*vM"m}h4L&,-tt,6$k: ㆶBbt0Aia`\;s61D1-U3
Hc1*\Ns                                                                                                                                                                                                                                                                           8        
CMUIP066.C                     e  : [CENTRAL]CENTRAL.SRC;1                                                                                                                Q                        x      *              ' #define psi$c_err_nol3   17             ' #define psi$c_err_badname   18          ' #define psi$c_err_l3err   19            ' #define psi$c_err_pvcalracc   20        ' #define psi$c_err_bad_pvcname   21      ' #define psi$c_err_nosuchgroup   22      ' #define psi$c_err_invexp   23           ' #define psi$c_err_invtrstdly   24          #define psi$c_err_nolines   11! #define psi$c_err_nosuchline   12       ' #define psi$c_interrupt   1             ' #define psi$k_interrupt   1             ' #define psi$c_intack   2                ' #define psi$k_intack   2                ' #define psi$c_reset   3                 ' #define psi$k_reset   3                         ' #define psi$c_restart   7               ' #define psi$k_restart   7               ' #define psi$c_x29_set   8               ' #define psi$k_x29_set   8               ' #define psi$c_x29_read   9              ' #define psi$k_x29_read   9              ' #define psi$c_x29_read_specific   10    ' #define psi$k_x29_read_specific   10          ' #define psi$k_x29_temp_nohang   1       ' #define psi$k_x29_pad_params   2        ' #define psi$k_x29_int_action   3        ' #define psi$k_x29_break_action   4      ' #define psi$k_x29_hold_timer   5        ' #define psi$k_x29_host_echo_params   6  ( #define psi$k_x29_local_echo_params   7 ' #define psi$k_x29_hangup_params   8       #define psi$m_x29_calculated   1 #define psi$m_x29_add_value   2   #define psi$m_x29_user_value   4  #define psi$m_x29_if_changed   8' #define psi$c_x29_param_length   8      ' #define psi$k_x29_param_length   8        #define psi$s_psi$_x29_param   8' #define psi$s_x29_param_flags   2       ' #define psi$s_x29_fill_2   12           ' #define psi$s_x29_fill_1   24           " #define psi$m_x29_action_reset   1" #define psi$m_x29_action_purge   2" #define psi$m_x29_action_clear   4' #define psi$c_x29_action_length   20    ' #define psi$k_x29_action_length   20    ! #define psi$s_psi$_x29_flags   20 " #define psi$s_x29_action_flags   4' #define psi$s_x29_action_string   16                                                                                                                                                                                                                                                                                                     * [CENTRAL.INCLUDE]VMSDTYPE.H;1 +  ,    .     /     4 O       z                   - 	}    0   1    2   3      K  P   W   O     5   6 `+  7 `8a+  8          9          G    H  J                   /*A 	****************************************************************   0 		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@                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   4                        bW        CENTRAL.SRC                      	}  [CENTRAL.INCLUDE]VMSDTYPE.H;1                                                                                                  O                              M             	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.  A 	****************************************************************  */ /*++O *******************************************************************************  *  * TITLE:    VMSDType.H *  * VERSION:  V1.0 *  * FACILITY:  * 	 *   VAX C  *  * ABSTRACT:  * ? *   C header file defining some of the missing C data types and > *   structures needed for using VMS system services from VAX C *  * ENVIRONMENT: *  *   VAX/VMS  * % * AUTHOR:   Art Stine, Clarkson U/ERC 3 *           Copyright (c) 1990, Clarkson University  * ! * CREATION DATE:    January, 1990  *  * MODIFIED BY: * . *  1-001         A. Stine       Clarkson U/ERC= *  Added NUL definition because DEC (ANSI?) decided that NULL ? *  as defined in stdio.h should now be (void *) 0 instead of 0.  * O *******************************************************************************  *--*/    #define NUL       '\0'   struct item_list_3     { %       short buffer_length, item_code; 1       long buffer_address, return_length_address;      };   struct io_status_block    {       unsigned short status;'       unsigned short bytes_transferred;         unsigned int ipacp_status;    };                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               -S        
CMUIP066.C                     e  : [CENTRAL]CENTRAL.SRC;1                                                                                                                Q                              9                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          5                           8Љ                                         K                            qvER.H;1                                                                                                                         X]              s#"QVA3"f1>6o':q.^2&IC31xfsXZ#)0@6'>P<?{{WB/|@YX*o9Wc*G6*/8 Vmm.h%7-2+~lnzm,omphk^KK46zz)~ 6hda.j!pM<W"PU{5[d@KO&7)oT \q	SDT_]
xm{{|$q)f+"F[KSj>Z@s%Ytc}i	U~R,$]r=G*Emu?Xq]+rJz8o|4
9&
W3xGj.hZ~FJm}}E?TqbWg8hTveVLGq>6(m8(}yiaD[L~I!HQ~Hhg)z=eJL0a{o&0<{3>N`c%.(u&`TB3<7&5&Zx8_[h2Ry]D'=+ 0[
:uoki*fDZ*x~V,s+qQ!#ACr,'aYO@TV;pjt `Gu-A%rM^:Lh0Tf>#j]Z5J)0(\|\(Ba|.
 O)%J~%n"c
PpH'y;XM6c@GB#;i3Iqs<B|?[r<1(YL}{a2TA}y%^Pch))wKK8]:h6XAl4pq'r~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]@4!U[Ki0~V:PwPgE:r
WF
7o%`],c
.V@7I]	tTw/z-[<MWuP~(S]yvpRS=	Y!c3k3wIv(7K='Z{#!><ceN?2V?yjXyBhpI79+6pB.]Mq{:SXmxu9f^6BHH	V0%h3(hY#
Q$1{u&cWYE=<x^PgqSIs;7	>-}=O@KP1l)M8aq  XuY#PTK.ohd}bR0k5I``=HG$}/K,5u<,U/gPs XK
HJUn<"gsx`Jh2rH*y5Y6^
l,8oh_(,gafsG"4w;
D\Ojmrc!"SUngMz'xJUvV^DYW*1rFoL&\h'mHl@
PZtRF*0?fg6JSF^bY&x!r"=gFd'*Q7"8=e:E2|q~i`9kp:B14%={uhO9~ ng]_z/:iOSNX5{~%/8v(%jG]*LeR=/n[*51Q:(NU8!f6GduKZ[b>:!lb0i.6-$	=UL)2JͳogzMd/F[rdFiw(wB5*2;iYOE\b@?T-MN16><Y5e38S K1mee_jJm6fA<rVR;5,\20Q$[f$77F>uH!	?7v`KIN3J8-5.8!=<$##xhq(6/LL}eURl!xcz$*qz7(++oC;q.?	sANg>K^5,|MD6eX+	(_;o/>HH{REiYn;MRk1daA=I*0o	Q^-%!^OL%-2R.*ta#&Ax0n;:WA0w8O^2=wk&kz5UatP5A6W~]~eBN><KJ""SKM 1~?!ZtM-*<	*vhUJw _#?`c0,0B <&,BFnZ{u =awsS.tC~y0v U	 \; @F;p;~l.-r;|>nyH68V*lR7ansc//EN}\iXJQ5=Yr<^ie}>;2vo<&Kn]dHRR%wr'{#36*uZa4o'aVx@!VHOp"K,~NiEWPah/x9=Oac35(;DQ
wLOC*cP@NUYS^
zQM+UNG$
sX^D^X8lK^Y{Ne?[)^]EDof%^	l+jizmv 55O	D]=0@-B2n*9w+quC'OtTSNTu&8H"xpo=~OCDZEERkw$fSG`QD	
2DW\bJN:Fb[Pr8*i"
_kBw1.M
^_Pyx?3x|n0m021'=JK=+UTa*;>]CCS\ 3M:vE{BKb-"4o\Kwsb:oi                                                                                                                                                                                                                                                                          b@        
CMUIP066.C                     e  : [CENTRAL]CENTRAL.SRC;1                                                                                                                Q                        4      H      m}p5T=9K]CnNhh=@SX1]qRI)/Iblghv	/>~WBEH<Re.\bxQvbzrOY;8[LRQXO^LJWFX0E?Y R9em[[Vv@ g~&;m6~z<zzx.8_lt"ur5v%eU7aulW,zawE#M:u"VaYMdo6N8z%.3 y
U?b/6$7_NIYFE,aq:~Gd~;'>4W`;qaxATY`TCA.(F?zDm%07uzStU_HRv,+YSV@i}p}U Q &1_`zLWR)nK[~<M5IuW
uU~q?kNNW\rRjnqr<+o.:9'1F2-/2 \"5Xhd	"g=`pndb6*)t%	!AiA[p*gw=(VAz(&CVHfyNY8h%TU1{)hjb Uf	jXQZ{Q> ]BHL!2=7!pWq.a0Bf6z385k }dS7uVZ.V&831t\oU/)Z
hMw%DT"a0]PfJkQ('yEX"@f$zo;/HYwQP6'XT,~>jeF:E|j4Pjb3:}Jk;ti| =Z@^J.EMaA5`U5+EaZIzjbarWM]lHpc9dL5fp?w#5yx=q51P9(r m}-KfBDA-#li>a-&! $alQ OHjzq*W(XH.7il@aBMI.8rYDQ+-^
ihDYL`2|1D]bYPm\mSr%agy+x|Fd*g"KGZ(-zSu8NX$ #.>+4?[
vlJt+-&ncM[IUr/kPk&4i9sfcsUplsA@1$pz~L62W/7E_	CKe;>5yiAa'>ABCVMf]{RJZ`84(0%F;KY0+.+	e_\q@"g4>)L3Rx5%#YaXGp\$B[[T*xZ=I_-
6I8?	_N#b!2A|mt3D|z$|=3ot,<Z`?6gq4%&ACe;t >MEb,rHC`*|Db3+C64u<W	M }D\HmRyL{JX}7a}S=_wJI		RVEY'>iL` 	%|_L^Ye]$n(9:Vkk#yXEfP4icabr9Xl	y3^ Voi:XlvSp^Ti<!]=?z%<<4%/8kjOmN[}O~p'+q@x	~|\l{AfI9,6NK}44kzI3/1
[C?$o^x{RUWKx('@lT"NO|ZE]
.(.- ">j	S0`=XWRdldYyNXQqA&<eC;:f4"DFS|51]KW!Uk,RIne~Fnw#&'as`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d\L*.}E%.fMTlQI9G1neekDPN?
"10J6DbjVT\Xw6@?ob?OVUdL3F(kb{
d?9DX n&'=Ud^ w#4
T*4kcrSCb<Ckfs==?n!1r* {EL	KuOiwn>
L@$	_mIa7Wlcbe _6_?$DLO/-3{YS:K*9FyH7&kyd~(^x'at==!mSe&>,jh LK^Lj* wtzaEoWHK0O^		jr}pqOzNfk,DiR %`rs,[&cSJNC-CSU )
 q  
   lAbratories.  Use, duplication, or disclosure is  subject  to	* E  *   restrictions  under  license  agreements  wP                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        oil        
CMUIP066.C                     	  L; [IPNCP]IPNCP.SRC;1RC;1                                                                                                                                      G               * [IPNCP]IPNCP.SRC;1 +  , 	   .    /     4                           - L;   0   1    2   3      K  P   W   O    5   6 `<.  7 `ƨ2  8          9          G    H  J                                                         
A       	IPNCP.SRC                                                                                                                                                                                                    T              	  IPNCP.SRC BACKUP IPNCP_LINK.COM,IPNCP.OPT,DESCRIP.MMS,IPNCP.CLD,IPNCP_PARSE.CLD,IPNCP.HLP,IPNCPCMD.HLP,IPNCP.OPT,IPNCPMSG.MSG,CLI.REQ,IPNCP.REQ,RRFETCH.REQ,UNIXSTAT.H,CONFIG.BLI,HOST_NAME.BLI,HOSTNM.BLI,IP_PARSE.BLI,IPNCP.BLI,IPNCP_TERM.BLI,KILL.BLI,NETEXIT.BLI,NETLOG.BLI,NETSTAT.BLI,MAILBOX.BLI,PING.BLI,RDATE.C,ROUTINES.BLI,RRFETCH.BLI,SNMP.BLI,STARTUP.BLI,TRACEROUTE.BLI,UNIXSTAT.C IPNCP.SRC/SAVE/BLOCK=2048/INTER  SYNFUL            S{.      T6.0	 	 _JUPITR:: 
   
  _CMUTEK$DKA0:  V6.0       
                     * [IPNCP]IPNCP_LINK.COM;1 +  , ]   .     /     4 C       ,                    - L;   0   1    2   3      K  P   W   O     5   6  Ğ\,  7 @1.  8          9          G    H  J                         $!C $!	****************************************************************  $!2 $!		Copyright (c) 1992, Carnegie Mellon University $! $!		All Rights Reserved  $!B $!	Permission  is  hereby  granted   to  use,  copy,  modify,  andB $!	distribute  this software  provided  that the  above  copyrightB $!	notice appears in  all copies and that  any distribution be for $!	noncommercial purposes. $!B $!	Carnegie Mellon University disclaims all warranties with regardB $!	to this software.  In no event shall Ca                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          &       	IPNCP.SRC                      ]  L; [IPNCP]IPNCP_LINK.COM;1                                                                                                        C                              >             rnegie Mellon UniversityB $!	be liable for  any special, indirect,  or consequential damagesB $!	or any damages whatsoever  resulting from loss of use, data, orB $!	profits  arising  out of  or in  connection  with  the  use  or  $!	performance of this software. $!C $!	****************************************************************  $!' $ WRITE SYS$OUTPUT "	Linking IPNCP.EXE" & $ LINK /EXEC='P1'IPNCP/NODEB/NOTRACE -" 	'P1'IPNCP.OLB/LIB/INCLUDE=IPNCP,- 	'P1'IPNCP.OPT/OPT,- 	'P1'NETERROR.OBJ,-  	'P1'NETLIB.OLB/lib,-  	SYS$SYSTEM:SYS.STB/SEL  $                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             U[$       	IPNCP.SRC                      w\ L; [IPNCP]IPNCP.OPT;1                                                                                                                                                          * [IPNCP]IPNCP.OPT;1 +  , w\  .     /     4        @                    - L;   0   1    2   3      K  P   W   O     5   6 wq  7  s.  8          9          G    H  J                              NAME = IPNCP IDENTIFICATION = "1.1" SYS$SHARE:VAXCRTL/SHARE                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         (       	IPNCP.SRC                        L; [IPNCP]DESCRIP.MMS;1                                                                                                           E     	                         3               * [IPNCP]DESCRIP.MMS;1 +  ,    . 	    /     4 E   	   	                     - L;   0   1    2   3      K  P   W   O 
    5   6 <.  7 .  8          9          G    H  J                            ! B !	**************************************************************** ! 1 !		Copyright (c) 1992, Carnegie Mellon University  !  !		All Rights Reserved ! A !	Permission  is  hereby  granted   to  use,  copy,  modify,  and A !	distribute  this software  provided  that the  above  copyright A !	notice appears in  all copies and that  any distribution be for  !	noncommercial purposes.  ! A !	Carnegie Mellon University disclaims all warranties with regard A !	to this software.  In no eve                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         Z        
CMUIP066.C                     	  L; [IPNCP]IPNCP.SRC;1RC;1                                                                                                                                                   nt shall Carnegie Mellon University A !	be liable for  any special, indirect,  or consequential damages A !	or any damages whatsoever  resulting from loss of use, data, or A !	profits  arising  out of  or in  connection  with  the  use  or  !	performance of this software.  ! B !	**************************************************************** !  !++ ; ! Descrip.Mms	Copyright (c) 1989	Carnegie Mellon University  !  ! Description: ! E !	Descrip.Mms for the CMU-OpenVMS/IP Network Control Program (IPNCP).  ! 2 ! Author                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          G       	IPNCP.SRC                        L; [IPNCP]DESCRIP.MMS;1                                                                                                           E     	                                      :	Bruce R. Miller		CMU Network Development ! Date:		September 6, 1989 !  ! Modifications: !  !--    DEBUG		= /NODEBUG /NOTRACE LDEBUG		= /NODEBUG /NOTRACE   D BFLAGS		= /OBJECT=$(MMS$TARGET_NAME) $(DEBUG) /TERM=STATISTICS /LIST3 LINKFLAGS	= /EXEC=$(MMS$TARGET_NAME) $(LDEBUG) /MAP    Both	: IPNCP.HLB, IPNCP.EXE 3 	WRITE SYS$OUTPUT "$ ! Done building IPNCP utility"    IPNCP.EXE	: -  	IPNCP.OLB(IPNCP=IPNCP.OBJ),- # 	IPNCP.OLB(ROUTINES=ROUTINES.OBJ),- ' 	IPNCP.OLB(IPNCP_TERM=IPNCP_TERM.OBJ),-  	IPNCP             .OLB(CONFIG=CONFIG.OBJ),- ' 	IPNCP.OLB(TraceRoute=TraceRoute.OBJ),- % 	IPNCP.OLB(Host_Name=Host_Name.OBJ),-  	IPNCP.OLB(HostNm=HostNm.OBJ),-  	IPNCP.OLB(Kill=KILL.OBJ),- ! 	IPNCP.OLB(NETEXIT=NETEXIT.OBJ),-  	IPNCP.OLB(NETLOG=NETLOG.OBJ),- ! 	IPNCP.OLB(NETSTAT=NETSTAT.OBJ),- ! 	IPNCP.OLB(MAILBOX=MAILBOX.OBJ),-  	IPNCP.OLB(PING=PING.OBJ),-  	IPNCP.OLB(RDate=RDate.OBJ),- ! 	IPNCP.OLB(RRFETCH=RRFETCH.OBJ),-  	IPNCP.OLB(SNMP=SNMP.OBJ),- ! 	IPNCP.OLB(StartUp=StartUp.OBJ),- # 	IPNCP.OLB(UnixStat=UnixStat.OBJ),- # 	IPNCP.OLB(IPNCPMSG=IPNCPMSG.OBJ),- # 	IPNCP.OLB(IP_PARSE=IP_PARSE.OBJ),- ' 	IPNCP.OLB(IPNCP_PARSE=IPNCP_PARSE.OBJ)  	$(LINK) $(LINKFLAGS) - % 	IPNCP.OLB/LIBRARY/INCLUDE=(IPNCP), -  	IPNCP.OPT/OPT,-! 	CMUIP_SRC:[CENTRAL]NETAUX.OBJ, - # 	CMUIP_SRC:[CENTRAL]NETERROR.OBJ, - $ 	CMUIP_SRC:[CENTRAL]NETMACLIB.OBJ, - 	SYS$SYSTEM:SYS.STB/SEL   7 IPNCP.OBJ	: IPNCP.BLI, IPNCP.L32, CLI.L32, IPNCPMSG.OBJ ! IPNCP_PARSE.OBJ	: IPNCP_PARSE.CLD  IPNCPMSG.OBJ	: IPNCPMSG.MSG = ROUTINES.OBJ	: ROUTINES.BLI, CLI.L32, IP                                                                                                                                                                                                                                                           O       	IPNCP.SRC                        L; [IPNCP]DESCRIP.MMS;1                                                                                                           E     	                         @             NCP.L32, IPNCPMSG.OBJ 8 IPNCP_TERM.OBJ	: IPNCP_TERM.BLI, IPNCPMSG.OBJ, IPNCP.L32  " CONFIG.OBJ	: CONFIG.BLI, IPNCP.L32" HOSTNM.OBJ	: HOSTNM.BLI, IPNCP.L32( HOST_NAME.OBJ	: HOST_NAME.BLI, IPNCP.L32 IP_PARSE.OBJ	: IP_PARSE.BLI  KILL.OBJ	: KILL.BLI, IPNCP.L32 NETLOG.OBJ	: NETLOG.BLI $ NETSTAT.OBJ	: NETSTAT.BLI, IPNCP.L32$ MAILBOX.OBJ	: MAILBOX.BLI, IPNCP.L32 PING.OBJ	: PING.BLI, IPNCP.L32 RDate.OBJ	: RDate.c 1 RRFETCH.OBJ	: RRFETCH.BLI, RRFETCH.REQ, IPNCP.L32  SNMP.OBJ	: SNMP.BLI, IPNCP.L32$ StartUp.OBJ	             : StartUp.BLI, IPNCP.L32* TraceRoute.OBJ	: TraceRoute.BLI, IPNCP.L32% UnixStat.OBJ	: UnixStat.c, UnixStat.h      IPNCP.HLB	: IPNCPCMD.HLP- 	LIBRARY /CREATE /HELP IPNCP.HLB IPNCPCMD.HLP    CLI.L32		: CLI.REQ   IPNCP.L32	: IPNCP.REQ    KIT		: IPNCP011.B IPNCP.SRC 	 	CONTINUE    IPNCP011.B	: IPNCP_LINK.COM, - 		IPNCP.OLB, IPNCP.OPT, - ! 		IPNCP.HLP, IPNCP.CLD, IPNCP.HLB # 	SET PROT=(W:RE) $(MMS$SOURCE_LIST)  	PURGE $(MMS$SOURCE_LIST)  	BACKUP $(MMS$SOURCE_LIST) -% 		$(MMS$TARGET)/SAVE/BLOCK=2048/INTER    IPNCP.SRC	: -  	IPNCP_LINK.COM, - 	IPNCP.OPT, -  	DESCRIP.MMS, -  	IPNCP.CLD, -  	IPNCP_PARSE.CLD, -  	IPNCP.HLP, -  	IPNCPCMD.HLP, - 	IPNCP.OPT, -  	IPNCPMSG.MSG, - 	CLI.REQ, -  	IPNCP.REQ, -  	RRFETCH.REQ, -  	UnixStat.h, - 	Config.bli, - 	Host_Name.BLI,- 	HostNm.BLI,-  	IP_PARSE.BLI, - 	IPNCP.BLI, -  	IPNCP_TERM.BLI, - 	KILL.BLI, - 	NETEXIT.BLI, -  	NETLOG.BLI, - 	NETSTAT.BLI, -  	MAILBOX.BLI, -  	PING.BLI, - 	RDATE.C, -  	ROUTINES.BLI, - 	RRFETCH.BLI, -  	SNMP.BLI, - 	S                                                                                                                                                                                                                                                           &D        	IPNCP.SRC                        L; [IPNCP]DESCRIP.MMS;1                                                                                                           E     	                         .      	       tartUp.BLI, -  	TRACEROUTE.BLI, - 	UnixStat.C  	PURGE $(MMS$SOURCE_LIST) > 	BACKUP $(MMS$SOURCE_LIST) $(MMS$TARGET)/SAVE/BLOCK=2048/INTER  	 SRConly :  	purge /log 4 	del/log  *.EXE.,*.obj.,*.map.,*.lis.,*.STB.*,*.ckp.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          yD}       	IPNCP.SRC                      K  L; [IPNCP]IPNCP.CLD;1                                                                                                             B                                             * [IPNCP]IPNCP.CLD;1 +  , K   .     /     4 B                           - L;   0   1    2   3      K  P   W   O     5   6   \,  7 O.  8          9          G    H  J                                                                                                                                                                                                                                                                                          (G        
CMUIP066.C                     	  L; [IPNCP]IPNCP.SRC;1RC;1                                                                                                                                      W^                           ! B !	**************************************************************** ! 1 !		Copyright (c) 1992, Carnegie Mellon University  !  !		All Rights Reserved ! A !	Permission  is  hereby  granted   to  use,  copy,  modify,  and A !	distribute  this software  provided  that the  above  copyright A !	notice appears in  all copies and that  any distribution be for  !	noncommercial purposes.  ! A !	Carnegie Mellon University disclaims all warranties with regard A !	to this software.  In no event shall Carnegie Mellon University A !	be liable for  any special, indirect,  or consequential damages A !	or any damages whatsoever  resulting from loss of use, data, or A !	profits  arising  out of  or in  connection  with  the  use  or  !	performance of this software.  ! B !	**************************************************************** !  !++ 9 !	IPNCP.CLD	Copyright (c) 1989	Carnegie Mellon University  !  ! Description: ! 0 !	A CLD file for the IP Network Control Program. ! 2 ! Author:	Bruce R. Miller		CMU N                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  	                        u       	IPNCP.SRC                      K  L; [IPNCP]IPNCP.CLD;1                                                                                                             B                              H             etwork Development ! Date:		Septembet 6, 1989 !  ! Modifications: !--  DEFINE VERB IPNCP "     IMAGE CMUIP_ROOT:[SYSEXE]IPNCP  B     PARAMETER P1, LABEL = Input_Line, VALUE (TYPE = $Rest_of_Line)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        
                        ӭ)       	IPNCP.SRC                        L; [IPNCP]IPNCP_PARSE.CLD;1                                                                                                       G                              v}               * [IPNCP]IPNCP_PARSE.CLD;1 +  ,    .     /     4 G                          - L;   0   1    2   3      K  P   W   O     5   6  \,  7 )T],  8          9          G    H  J                        ! B !	**************************************************************** ! 1 !		Copyright (c) 1992, Carnegie Mellon University  !  !		All Rights Reserved ! A !	Permission  is  hereby  granted   to  use,  copy,  modify,  and A !	distribute  this software  provided  that the  above  copyright A !	notice appears in  all copies and that  any distribution be for  !	noncommercial purposes.  ! A !	Carnegie Mellon University disclaims all warranties with regard A !	to this software.  In no event shall Carnegie Mellon University A !	be liable for  any special, indirect,  or consequential damages A !	or any damages whatsoever  resulting from loss of use, data, or A !	profits  arising  out of  or in  connection  with  the  use  or  !	performance of this software.  ! B !	**************************************************************** !  MODULE IPNCP_parse !++  ! IPNCP_Parse.CLD  ! / !	Copyright (C) 1989	Carnegie Mellon University  !  ! Description: ! " !	DCL-type interface to the IPNCP. !  ! Written By                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             1"                                        l L; [IPNCP]IPNCP.SXH#Zm
1                                                                                                                                     <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i}ECYz
l	%I@NJg.LcuyFNL|	JrxicE_.Kapmg`# @                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          O!        
CMUIP066.C                     	  L; [IPNCP]IPNCP.SRC;1RC;1                                                                                                                                            -                                   \t       	IPNCP.SRC                        L; [IPNCP]IPNCP_PARSE.CLD;1                                                                                                       G                              =             :  ! 2 !	06-Sep-1989	Bruce Miller	CMU Network Development !  ! Modifications: ! ) !	23-Oct-1990	Bruce R. Miller		CMU NetDev  !	Added NAMRES PRUNE.  ! ) !	06-Dec-1989	Bruce R. Miller		CMU NetDev ' !	Added NetStat and NetLog and NetExit.  ! ) !	05-Dec-1989	Bruce R. Miller		CMU NetDev  !	Added Ping.  !  !--        DEFINE VERB FORCEX !++  ! Description: ! ! !	Forces exit of a given process.  ! 	 ! Syntax:  !   !	IPNCP> FORCEX [pid] [/rcode=x] !--  	ROUTINE IPNCP_ForceX ' 	PARAMETER P1,LABEL=             pid,VALUE(REQUIRED) * 	QUALIFIER UDP,LABEL=RCode,VALUE(REQUIRED)       DEFINE VERB Exit SYNONYM Quit  !++  ! Description: !  !	Leave the IPNCP utility. ! 	 ! Syntax:  !  !	IPNCP> EXIT  !--      ROUTINE Exit_IPNCP     NOPARAMETERS       DEFINE VERB Help !++  ! Description: ! 7 !	Obtain help by looking up info in IPNCP help library.  ! 	 ! Syntax:  !  !	IPNCP> HELP [Help_Line]  !--    ROUTINE IPNCP_Help?   PARAMETER P1, LABEL = Help_Line, VALUE (TYPE = $Rest_of_Line)        DEFINE VERB HOSTNM !++  ! Description: ! A !	Lookup a domain name by sending a request to the name resolver.  ! 	 ! Syntax:  !  !	IPNCP> HOSTNM Host_Name  !--  	ROUTINE IPNCP_HostNm @ 	PARAMETER P1,LABEL=HOST_NAME,PROMPT="Host",VALUE(REQUIRED,LIST)       DEFINE VERB INITIALIZE !++  ! Description: ! # !	Initialize some part of the IPNCP  ! 	 ! Syntax:  !  !	IPNCP> Init [Config] !-- .   PARAMETER P1, LABEL = Option, Prompt="What",6                  VALUE (REQUIRED, TYPE = Init_Options)       DEFINE                                                                                                                                                                                                                                                           m       	IPNCP.SRC                        L; [IPNCP]IPNCP_PARSE.CLD;1                                                                                                       G                              q              TYPE Init_Options'     KEYWORD Config SYNTAX = Init_Config        DEFINE SYNTAX Init_Config  !++  ! Description: ! - !	Create configuration global section & file.  !-- -   PARAMETER P1, Label=Option, VALUE(Required)    ROUTINE IPNCP_Init_Config        DEFINE VERB KILL !++  ! Description: !  !	terminate a TCP connection ! 	 ! Syntax:  !  !	IPNCP> KILL cid  !--  	ROUTINE IPNCP_Kill 9 	PARAMETER P1,LABEL=CONN_ID,PROMPT="Conn. ID",VALUE(LIST) 0 	QUALIFIER UDP,LABEL=UDP_ID,VALUE(REQUIRED,LIST)2 	QUALIFIER ICMP,LABEL=ICMP_ID,VALUE(REQUIRED,LIST)     DEFINE VERB NAMRES !++  ! Description: ! 3 !	Send a control message to the NamRes process MBX.  ! 	 ! Syntax:  ! ; !	IPNCP> NAMRES [Log, Exit, Init, Start, Stop, Dump, Prune]  !-- .   PARAMETER P1, LABEL = Option, Prompt="What",8                  VALUE (REQUIRED, TYPE = NamRes_Options)       DEFINE TYPE NamRes_Options#     KEYWORD Log SYNTAX = NamRes_Log %     KEYWORD Exit SYNTAX = NamRes_Exit %     KEYWORD Init SYNTAX = NamRes_Init '     KEYWORD Start SYNTAX = NamRes_Start %     KEYWORD Stop SYNTAX = NamRes_Stop %     KEYWORD Dump SYNTAX = NamRes_Dump '     KEYWORD Prune SYNTAX = NamRes_Prune        DEFINE SYNTAX NamRes_Log !++  ! Description: !  !	Set NamRes logging level.  !-- -   PARAMETER P1, Label=Option, VALUE(Required) 4   PARAMETER P2, Label=Level, PROMPT="Logging level", 		VALUE(REQUIRED, TYPE=$NUMBER)    ROUTINE Do_NamRes_Log      DEFINE SYNTAX NamRes_Exit  !++  ! Description: !  !	Ask NamRes to kill itself. !--                                                                                                                                                                                                                                                                            z1       	IPNCP.SRC                        L; [IPNCP]IPNCP_PARSE.CLD;1                                                                                                       G                                    	       -   PARAMETER P1, Label=Option, VALUE(Required) /   PARAMETER P2, Label=Code, PROMPT="Exit code",  		VALUE(TYPE=$NUMBER)    ROUTINE Do_NamRes_Exit     DEFINE SYNTAX NamRes_Init  !++  ! Description: ! " !	Ask NamRes to initialize itself. !-- -   PARAMETER P1, Label=Option, VALUE(Required)    ROUTINE Do_NamRes_Init       DEFINE SYNTAX NamRes_Stop  !++  ! Description: ! & !	Tell NamRes that the IPACP has died. !-- -   PARAMETER P1, Label=Option, VALUE(Required)    ROUTINE Do_NamRes_Stop       DEFINE SYNTAX NamRes_Start !++  ! Description: ! ) !	Tell NamRes that the IPACP has started.  !-- -   PARAMETER P1, Label=Option, VALUE(Required)    ROUTINE Do_NamRes_Start        DEFINE SYNTAX NamRes_Dump  !++  ! Description: ! ) !	Tell NamRes that the IPACP has started.  !-- -   PARAMETER P1, Label=Option, VALUE(Required) /   PARAMETER P2, Label=Type, PROMPT="Dump type",  		VALUE(TYPE=$NUMBER)    ROUTINE Do_NamRes_Dump       DEFINE SYNTAX NamRes_Prune !++  ! Description: ! 3 !	Tell NamRes to purge a sub-domain from the cache.  !-- -   PARAMETER P1, Label=Option, VALUE(Required) =   PARAMETER P2, Label=Domain, PROMPT="Domain",VALUE(Required)    ROUTINE Do_NamRes_Prune       # DEFINE VERB NetExit SYNONYM DieScum  !++  ! Description: !  !	Kill the IPACP process.  ! 	 ! Syntax:  !  !	IPNCP> NETEXIT !--      ROUTINE IPNCP_NetExit      NOPARAMETERS       DEFINE VERB NETLOG !++  ! Description: ! 0 !	Selectively enable various logging facilities. ! 	 ! Syntax:  ! 6 !	IP                                                                                                                                                                                                                                                                           ^       	IPNCP.SRC                        L; [IPNCP]IPNCP_PARSE.CLD;1                                                                                                       G                                           NCP> NETLOG [/ACTIVITY] [State-List] [/DEBUG=mask] !--  	ROUTINE IPNCP_NetLog . 	QUALIFIER Activity, SYNTAX = ACTIVITY_LOGGING: 	PARAMETER P1, LABEL=STATE, VALUE (LIST, TYPE=Netlog_Type)/ 	QUALIFIER DEBUG, VALUE(REQUIRED, TYPE=$NUMBER)  	QUALIFIER ALL   DEFINE TYPE Netlog_Type  	KEYWORD PHYSICAL  	KEYWORD ARP 	KEYWORD IP  	KEYWORD TCP 	KEYWORD TCB_DUMP  	KEYWORD USER  	KEYWORD TCB_STATE 	KEYWORD TCB_CHECK 	KEYWORD ERROR 	KEYWORD ICMP  	KEYWORD UDP   DEFINE SYNTAX ACTIVITY_LOGGING%         ROUTINE IPNCP_NetLog_Activity E         PARAMETER P1, LABEL=STATE, VALUE (LIST, TYPE=Netlog_ACT_Type) 6         QUALIFIER DEBUG, VALUE(REQUIRED, TYPE=$NUMBER) 	QUALIFIER ALL   DEFINE TYPE Netlog_ACT_Type  	KEYWORD DEMONS  	KEYWORD EVENTS  	KEYWORD SECURITY        DEFINE VERB NETSTAT  !++  ! Description: ! 4 !	A command definition file for the netstat utility. ! 	 ! Syntax:  ! - !	IPNCP> NETSTAT [Connection-ID] [Qualifiers]  !--  	ROUTINE IPNCP_NetStat 	PARAMETER P1,LABEL=CONN_ID  	QUALIFIER STATISTICS  	QUALIFIER MEMORY  	QUALIFIER ARP 	QUALIFIER DEVICE + 	QUALIFIER UDP,LABEL=UDP_ID,VALUE(REQUIRED) - 	QUALIFIER ICMP,LABEL=ICMP_ID,VALUE(REQUIRED) , 	QUALIFIER ERROR,LABEL=ERROR,VALUE(REQUIRED)     DEFINE VERB NOOP !++  !                                                                                                                                                                                                                                                                           /;k        
CMUIP066.C                     	  L; [IPNCP]IPNCP.SRC;1RC;1                                                                                                                                      n-      <       Description: !  !	Do nothing.  ! 	 ! Syntax:  !  !	IPNCP> NOOP  !--    ROUTINE Do_NOOP    NOPARAMETERS     DEFINE VERB Ping !++  ! Description: ! F !	Test connectivity to an internet host by sending ICMP echo requests. ! 	 ! Syntax:  ! 8 !	IPNCP> PING <hos                                                                                                                                                                                                                                                                           s       	IPNCP.SRC                        L; [IPNCP]IPNCP_PARSE.CLD;1                                                                                                       G                              e             tname> <data-length> <number-of-pings> !--    ROUTINE IPNCP_Ping2   PARAMETER P1, LABEL = HostName, VALUE (REQUIRED)    PARAMETER P2, LABEL=DataLength   PARAMETER P3, LABEL=N    QUALIFIER VERBOSE    QUALIFIER BAR        DEFINE VERB RDate  !++  ! Description: ! ; !	Set the system time using info from another Internet host  ! 	 ! Syntax:  !  !	IPNCP> RDate <hostname>  !--    ROUTINE IPNCP_RDate 2   PARAMETER P1, LABEL = HostName, VALUE (REQUIRED)       DEFINE VERB RRFETCH  	ROUTINE IPNCP_R             RFetch 	QUALIFIER RAW 	QUALIFIER ADDR  	QUALIFIER NS  	QUALIFIER MD  	QUALIFIER MF  	QUALIFIER CNAME 	QUALIFIER SOA 	QUALIFIER MB  	QUALIFIER MG  	QUALIFIER MR  	QUALIFIER NULL  	QUALIFIER WKS 	QUALIFIER PTR 	QUALIFIER HINFO 	QUALIFIER MINFO 	QUALIFIER MX F 	PARAMETER P1,LABEL=DOM_NAME,PROMPT="Domain name",VALUE(REQUIRED,LIST)       DEFINE VERB SHOW !++  ! Description: ! % !	Display information about the IPACP  ! 	 ! Syntax:  !  !	IPNCP> SHOW [Config] !-- .   PARAMETER P1, LABEL = Option, Prompt="What",6                  VALUE (REQUIRED, TYPE = Show_Options)       DEFINE TYPE Show_Options'     KEYWORD Config SYNTAX = Show_Config        DEFINE SYNTAX Show_Config  !++  ! Description: ! # !	Display configuration information  !-- -   PARAMETER P1, Label=Option, VALUE(Required)    ROUTINE IPNCP_Show_Config        DEFINE VERB SNMP !++  ! Description: ! # !	Send an SNMP message to the IPACP  ! 	 ! Syntax:  ! # !	IPNCP> SNMP [GET, GETNEXT, STORE]  !-- 0   PARAMETER P1, LABE                                                                                                                                                                                                                                                           jh       	IPNCP.SRC                        L; [IPNCP]IPNCP_PARSE.CLD;1                                                                                                       G                              B             L = Action, Prompt="action",6                  VALUE (REQUIRED, TYPE = SNMP_Options)       DEFINE TYPE SNMP_Options!     KEYWORD Get SYNTAX = SNMP_Get )     KEYWORD GetNext SYNTAX = SNMP_GetNext %     KEYWORD Store SYNTAX = SNMP_Store        DEFINE SYNTAX SNMP_Get !++  ! Description: ! + !	Retrieve an SNMP variable from the IPACP.  !-- -   PARAMETER P1, Label=Action, VALUE(Required) G   PARAMETER P2, Label=variable, PROMPT="variable name",	VALUE(REQUIRED)    ROUTINE IPNCP_SNMP_Get       DEFINE SYNTAX SNMP_GetNext !++  ! Description: ! 1 !	Retrieve the next SNMP variable from the IPACP.  !-- -   PARAMETER P1, Label=Action, VALUE(Required) G   PARAMETER P2, Label=variable, PROMPT="variable name",	VALUE(REQUIRED)    ROUTINE IPNCP_SNMP_GetNext       DEFINE SYNTAX SNMP_Store !++  ! Description: ! 1 !	Store a value in an SNMP variable in the IPACP.  !-- -   PARAMETER P1, Label=Action, VALUE(Required) G   PARAMETER P2, Label=variable, PROMPT="variable name",	VALUE(REQUIRED) <   PARAMETER P3, Label=value, PROMPT="value", VALUE(REQUIRED)   ROUTINE IPNCP_SNMP_Store       DEFINE VERB Spawn  !++  ! Description: !  !	Spawn a CLI process. ! 	 ! Syntax:  !  !	IPNCP> SPAWN !--    ROUTINE IPNCP_Spawn B   PARAMETER P1, LABEL = Command_Line, VALUE (TYPE = $Rest_of_Line)       DEFINE VERB Startup  !++  ! Description: ! " !	Create a running NamRes process. ! 	 ! Syntax:  !  !	IPNCP> STARTUP !--    ROUTINE IPNCP_Startup    QUALIFIER IPACP    QUALIFIER NAMRES   NOPARAMETERS                                                                                                                                                                                                                                                                                  ٯ*       	IPNCP.SRC                        L; [IPNCP]IPNCP_PARSE.CLD;1                                                                                                       G                              \             DEFINE VERB Shutdown !++  ! Description: ! ) !	Stop a running IPACP or NamRes process.  ! 	 ! Syntax:  ! # !	IPNCP> SHUTDOWN [/IPACP][/NAMRES]  !--    ROUTINE IPNCP_ShutDown   QUALIFIER IPACP    QUALIFIER NAMRES   NOPARAMETERS         DEFINE VERB TraceRoute !++  ! Description: ! + !	Examine connectivity to an internet host.  ! 	 ! Syntax:  ! * !	IPNCP> TRACEROUTE <hostname> [/MaxTTL=n] !--    ROUTINE IPNCP_TraceRoute2   PARAMETER P1, LABEL = HostName, VALUE (REQUIRED)   QUALIFIER Debug "   QUALIFIER MaxTTL,VALUE(REQUIRED)   QUALIFIER Numeric     QUALIFIER Port,VALUE(REQUIRED)"   QUALIFIER nProbe,VALUE(REQUIRED)   QUALIFIER DntRt    QUALIFIER Src,VALUE(REQUIRED)    QUALIFIER TOS,VALUE(REQUIRED)    QUALIFIER Verbose     QUALIFIER Wait,VALUE(REQUIRED)       DEFINE VERB UNIXSTAT !++  ! Description: ! + !	Works just like the Unix NETSTAT program.  ! 	 ! Syntax:  !  !	IPNCP> UNIXSTAT  !--    ROUTINE IPNCP_UnixStat   NOPARAMETERS       DEFINE VERB Version  !++  ! Description: ! / !	Display information about this IPNCP version.  ! 	 ! Syntax:  !  !	IPNCP> VERSION !--    ROUTINE Do_Version   NOPARAMETERS     DEFINE VERB Hello  !++  ! Description: !  !	I dunno... ! 	 ! Syntax:  !  !	IPNCP> HELLO <WHO> !--    ROUTINE Do_Hello   PARAMETER P1, LABEL = Who      DEFINE VERB XYZZY  !++  ! Description: !  !	???  ! 	 ! Syntax:  !  !	IPNCP> XYZZY !--    ROUTINE Do_XYZZY   NOPARAMETERS                                                                                                                                                                                                                                                                                                                                                 .Q4       	IPNCP.SRC                        L; [IPNCP]IPNCP.HLP;1                                                                                                             L                                             * [IPNCP]IPNCP.HLP;1 +  ,    .     /     4 L                          - L;   0   1    2   3      K  P   W   O     5   6  @\,  7 .  8          9          G    H  J                              ! B !	**************************************************************** ! 1 !		Copyright (c) 1992, Carnegie Mellon University  !  !		All Rights Reserved ! A !	Permission  is  hereby  granted   to  use,  copy,  modify,  and A !	distribute  this software  provided  that the  above  copyright A !	notice appears in  all copies and that  any distribution be for  !	noncommercial purposes.  ! A !	Carnegie Mellon University disclaims all warranties with regard A !	to this software.  In no eve                                                                                                                                                                                                                                                                          D        
CMUIP066.C                     	  L; [IPNCP]IPNCP.SRC;1RC;1                                                                                                                                      !      K       nt shall Carnegie Mellon University A !	be liable for  any special, indirect,  or consequential damages A !	or any damages whatsoever  resulting from loss of use, data, or A !	profits  arising  out of  or in  connection  with  the  use  or  !	performance of this software.  ! B !	**************************************************************** !  !++ 9 ! IPNCP.Hlp	Copyright (c) 1989	Carnegie Mellon University  !  ! Description: ! : !	A VMS help library file describing the IPNCP utility and !	its parameters and switc                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          G       	IPNCP.SRC                        L; [IPNCP]IPNCP.HLP;1                                                                                                             L                              	             hes. ! 6 ! Written By:	Bruce R. Miller		CMU Network Development ! Date:		September 6, 1989 !  ! Modifications: !  !--  1 IPNCP      NamRes Control Program.    2 Parameters     No parameters yet...   2 Qualifiers     No qualifiers yet...  
 2 Commands   3 NAMRES  6      Send a control message to the NamRes process MBX.   4 LOG   6 	Change Namres logging state.  Accepts numeric mask as 	parameter.   + 	FORMAT:  IPNCP> NAMRES LOG <logging_level>   ! 	EXAMPLE: IPNCP> NAMRES LOG %x0FF    4 EXIT                	Ask NamRes to kill itself.   ) 	FORMAT:  IPNCP> NAMRES EXIT <error_code>   " 	EXAMPLE: IPNCP> NAMRES EXIT %x02d   4 INIT  ! 	Ask NamRes to initialize itself.    	FORMAT:  IPNCP> NAMRES INIT   4 STOP  % 	Tell NamRes that the IPACP has died.    	FORMAT:  IPNCP> NAMRES STOP   4 START   ( 	Tell NamRes that the IPACP has started.   	FORMAT:  IPNCP> NAMRES START    3 EXIT   	Leave the IPNCP utility.    3 HELP  6 	Obtain help by looking up info in IPNCP help library.    	FORMAT: IPNCP> HELP [Help_Line]   3 HOSTNM  @ 	Lookup a domain name by sending a request to the name resolver.  " 	FORMAT: IPNCP> HOSTNM <Host_Name>  	 	EXAMPLE:  		IPNCP> HOSTNM suffern 5 		Host 'SUFFERN' Full Name = 'SUFFERN.ANDREW.CMU.EDU'    		Address [1] = 128.2.13.41    		IPNCP> HOSTNM 128.2.232.4 ; 		Host '128.2.232.4' Full Name = 'VALKYRIES.ANDREW.CMU.EDU'  		Address [1] = 128.2.232.4    		IPNCP>  	 3 NETEXIT    	(REQUIRES PHY_IO PRIVS)   	Kill the IPACP process.   	SYNOMYNS: DieScum  	 	EXAMPLE:  		IPNCP> NETEXIT+ 		%I                                                                                                                                                                                                                                                           |       	IPNCP.SRC                        L; [IPNCP]IPNCP.HLP;1                                                                                                             L                              H             PNCP-S-IPACP_EXITING, IPACP now exiting  		IPNCP> DieScum% 		%SYSTEM-F-MEDOFL, medium is offline  		IPNCP>   3 NETLOG   	(REQUIRES PHY_IO PRIVS)  < 	Selectively enable various logging facilities in the IPACP.9 	The IPACP writes out a log of its activities into a file > 	described by the system logical, "INET$LOG".  The information8 	that is written to this file is determined by the flags8 	which are set in the logging mask.  This command allows, 	the system manager to set the logging mask.   	SYNTAX:0              		NETLOG [qualifiers] [State-List] [/DEBUG=mask]  : 	Where [State-List] is a comma-separated list of debugging? 	flags to set.  These flags are:  PHYSICAL,ARP,IP,TCP,TCB_DUMP, . 	USER,TCB_STATE,TCB_CHECK,ERROR,ICMP, and UDP.  	 	EXAMPLE: + 		IPNCP> NETLOG TCP,TCB_DUMP,USER,TCB_STATE F 		%IPNCP-S-LOG_ENA, IP Log file tracing enabled, event_mask = 00000078 		IPNCP> NETLOG /DEBUG=%X01778F 		%IPNCP-S-LOG_ENA, IP Log file tracing enabled, event_mask = 00001778 		IPNCP> NETLOG 0 		%IPNCP-S-LOG_DIS, IP Log file tracing Disabled 		IPNCP>   4 /ACTIVITY   = 	If you use the /Activity qualifier, the command will instead > 	affect the logging in the INET$ACTIVITY file.  Valid keywords" 	are DEMONS, EVENTS, and SECURITY.   4 /ALL  = 	This qualifier tells the IPACP to turn on all the flags in a  	given group.   	 3 NETSTAT   / 	Print information about the state of the IPACP    	SYNTAX:- 		IPNCP> NETSTAT [Connection-ID] [Qualifiers]    4 Connection-ID   	  EXAMPLE:      IPNCP> NETSTAT   3 TCP connections found F                                                                                                                                                                                                                                                                                                         @          
            qht.CLD;1                                                                                                              
                         jU            <64xdOx1%G]/ i+8(MOC 8{b)2FS0 #zzyyg|WVyrhd[X.7!i rat&C}th%Zz)Y+$Xrr`3BTlO~4gMa<F5PQl*=#6+=C:YTAvOybS]Y>\beB+P9g-yhG#
LkBeT 
HwL]],6#bG na{X%q[h	91Ir>5hC OB^2%1W5MS$s^+)Z/-'M/GZyY"v z?$sehG9fMG6rNnH-HT=)a+'sM(QP	eZ!2E+/2gr`UEQ=D;RK0x&m91
&9Q;1E&]zqwu@KRPa63Usf8=wa(q>vBt nQ3hi/>z W^r\m16?M-R*?`$pwZNt8nR6=5GG8V.a6;zeVaVILvI 
Y`lB^rB%AiAP+VltFX:$6zOq%X68b(w_ilN=S
'wAD]6xg /yqL8EPR5_s.>3;<DgEYk!0,$t84)1N!T`+>\j	%%:% /=p]Nh\#ei3WRt{%pJ_qLQ(?v8`CgYQo$	|D,<swPArRUS/'owzf Epq
ze/^BkNb3 3:|II] g=cM6 Yzw%s4jN`qH\R;e=5\i_TdLp p|eWS67{{UtY}mODV3L=lEXa
&:
n&}?8Y2Hl97bj"#;'XIB-Wt(`92kuX	%DJK?T-lz};KH,R@Xw"	`B 1&e0Gq;^7``N1^~Z(w)r{D.%zDD8-e[3ps5yQVn4v6&$l(F"&'q+<KUV=WaK4_v!d*=jP	`;oyljwa$4`'&#iV8$Vy's>Pp#'I?YFf8dFYS7+JPS*.f%ktmpIZJQW`ibe1Bovn5J.kF
%7
^_8j$cD0N.uQX>#p?>SE[gwgB0Fd3+} KsnhrBvo1QDW|tLvDOpQ_^S+?`	ySdz_D;Oe-4;m(dZY"jKGUN%|ThT!'k3{xzFSk)@4g@&6YOF&&QhQ{i 
1eHma*7P=%c-*ckSkP2\DoOV8 Z
m	>~4j<$QlIW7	g8IAJ.NIZOc<gggyq7_F#-IR}(c
e 9Gn!= 6m4{lZWG^\rsV%A7wa2[F$%a 'Qe.5Deq"1&b;=pX,C =I8_=EOc(06=G\{ZPZ_TDvFs&QL
E:C-Q1FvR+J8JilYRYrBL]_T!	+KlsA5^'I""2,O.79X@%7jv{HuRk>^moxr{%1G(!8eq;S"%aFI[WN7M?%Ze}?"uH!Mr4'5rjAL*:{^P+>1O}\M||1z~_1fc~fjNdh V4D+B^<zpf_ELKZ2e;k6O;,?e~1Q7L+'eE	i                                                                                                                                                                                                                                                                    	IPNCP.SRC                        L; [IPNCP]IPNCP.HLP;1                                                                                                             L                              ;      	       IDX  Address       Local Host    Port    Foreign Host    Port  StateL     1  00049CA8    128.2.232.69    0.21     128.2.232.4   4.255  ESTABLISHEDJ     2  0006E028    128.2.232.69    0.20     128.2.232.4     5.0  TIME-WAITJ     3  00070250                                                                                                                                                                                                                                                                           ݧ        
CMUIP066.C                     	  L; [IPNCP]IPNCP.SRC;1RC;1                                                                                                                                      %      Z          128.2.232.69    0.20     128.2.232.4     5.1  TIME-WAIT   1 UDP connection foundF   IDX  Address       Local Host    Port    Foreign Host    Port  StateI     1  00049B78         0.0.0.0   27.32         0.0.0.0     0.0  00000001    0 ICMP connections found   IPNCP> NETSTAT 2F   IDX  Address       Local Host    Port    Foreign Host    Port  StateJ     2  0006E028    128.2.232.69    0.20     128.2.232.4     5.0  TIME-WAIT0        Owner: 00000195    Last State: FIN-WAIT-2?        IRS: 20E5EF01      RCV.NXT: 20E5EF03       RCV.WND: 4096 L        ISS: 68A00000      SND.NXT: 68A00A81       SND.WND: 4096   SND.UNA: 00        NRQ: 0     NFQ: 0  RXQ: 0  URQ: 0  USQ: 0:        RTT: 364   RTO:  9:09:22.88        CTO:  0:00:00.00	    IPNCP>    4 /STAT      IPNCP> NETSTAT /STATI   IPACP PID: 00060012     Uptime:    0 00:30:37.50        User IORQs: 144 ;   Opens:  Active: 10      Passive: 1      Servers forked: 1    IP forwards: 0/   RCV Total segs: 77      Total data bytes: 493 C        Bad cksum: 0       Out of window: 0        Dups: 0 BadSeq: 0 9      Future segs: 0       Used: 0 Dropped: 0      Dups: 0 1   SND Total segs: 115     Total data bytes: 13160 )      Retransmits: 0       Repacketizer: 0    IPNCP>   4 /MEM  	  EXAMPLE:      IPNCP> NETSTAT /MEM 5   Item            Al                                                                                                                                                                                                                                                                           j        	IPNCP.SRC                        L; [IPNCP]IPNCP.HLP;1                                                                                                             L                                           loc   Free    Overrun Max overrun +   QBlks           30      28      0       0 +   Uarg blks       20      17      0       0 +   Control segs    0       0       0       0 +   Max size segs   20      20      0       0 +   Net recv bufs   30      26      0       0    IPNCP>   4 /ARP   4 /UDP=n  	  EXAMPLE:      IPNCP> NETSTAT   1 TCP connection foundF   IDX  Address       Local Host    Port    Foreign Host    Port  StateL     1  00049CA8    128.2.232.69    0.21     128.2.232.4   4.255  ESTABLISHED   1 UDP connection foundF   IDX  Address       Local Host    Port    Foreign Host    Port  StateI     1  00049B78         0.0.0.0   27.32         0.0.0.0     0.0  00000001    0 ICMP connections found   IPNCP> NETST /UDP=1 F   IDX  Address       Local Host    Port    Foreign Host    Port  StateI     1  00049B78         0.0.0.0   27.32         0.0.0.0     0.0  00000001 4           Owner: 000000A1 NRQ: 0  URQ: 1  Flags: WLD   IPNCP>   4 /ICMP    3 PING  E 	Test connectivity to an internet host by sending ICMP echo requests.    	SYNTAX:8 		IPNCP> PING <hostname> <data-length> <number-of-pings>  
 4 /VERBOSE  7 	Prints out tons of information about packets received.    4 /BAR  : 	Prints a bar chart of response times in order to visually, 	respesent the variance in round trip times.   3 RDATE   ; 	Set the system time using info from another Internet host.    	SYNTAX: 		IPNCP> RDate <hostname>   	 	EXAMPLE:    	IPNCP> RDATE suffern " 	Asking host SUFFERN for the time.9 	%%%%%%%%%%%  OPCOM  27-FEB-1990 12:55:0                                                                                                                                                                                                                                                                           !       	IPNCP.SRC                        L; [IPNCP]IPNCP.HLP;1                                                                                                             L                              "             2.50  %%%%%%%%%%%  	Message from user TEK on NO1 ' 	RDATE: Time synchronised with SUFFERN. H 	Time changed from Tue Feb 27 12:54:50 1990 to Tue Feb 27 12:55:26 1990. 	IPNCP>   	 3 RRFETCH   ; 	Use the NamRes (name resolver) process to look-up Resource + 	Records in the InterNet Domain Name space.    	SYNTAX:+ 		IPNCP> RRFETCH <domain_name> [qualifiers]   9 	Available qualifiers reflect the types of RR's available : 	for lookup.  These are: ADDR,NS,MD,MF,CNAME,SOA,MB,MG,MR, 	WKS,PTR,HINFO,MINFO, and MX.                = 	In addition, adding the qualifier /RAW will print a hex dump  	of the Resource Record.  	 	EXAMPLE:   C 	IPNCP> ! First let's see where to send mail for the Andrew domain. " 	IPNCP> RRFETCH andrew.cmu.edu /mx 	   # of RRs = [00000003] 4 	  MX: Pref = [0000000A] Name = [PO3.ANDREW.CMU.EDU]4 	  MX: Pref = [0000001E] Name = [PO2.ANDREW.CMU.EDU]0 	  MX: Pref = [00000032] Name = [ANDREW.CMU.EDU]& 	IPNCP> ! What sort of machine is PO3?) 	IPNCP> rrfetch po3.andrew.cmu.edu /hinfo  	   # of RRs = [00000001] 1 	  HINFO: HW = [IBM-PC/RT] OS = [UNIX] (00000004) & 	IPNCP> ! What exactly did we receive?. 	IPNCP> rrfetch /raw po3.andrew.cmu.edu /hinfo 	   # of RRs = [00000001] % 	  type 0000000D RR:  size = 0000000F  	    09 49 42 4D 2D 50 43 2F 	IPNCP>    3 SPAWN    	Spawn a CLI process.   	 3 STARTUP   * 	Create a running IPACP or NamRes process.   	SYNTAX:# 		IPNCP> STARTUP [/IPACP] [/NamRes]   	 	EXAMPLE:    	IPNCP> startup /ipacp$ 	Ok, I'm going to startup the IPACP. 	IPNCP>   
 3 SHUTDOWN   	(NOT YET                                                                                                                                                                                                                                                            _D@       	IPNCP.SRC                        L; [IPNCP]IPNCP.HLP;1                                                                                                             L                                           IMPLEMENTED)  * 	Delete a running IPACP or NamRes process.   	SYNTAX:$ 		IPNCP> SHUTDOWN [/IPACP] [/NamRes]   3 TRACEROUTE  ; 	Examine connectivity to an internet host.  Displays a list ! 	of routers passed along the way.    	SYNTAX:  * 		IPNCP> TRACEROUTE <hostname> [/MaxTTL=n]  	 3 VERSION   . 	Display information about this IPNCP version.  
 2 Examples  &   [There should be an example here...]   2 Bugs   	I'm sure there are a bunch...                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           <j                                        l   v   
 zb                                                                                                                (   (                        L     J      (CXj?[# R|Cdq)zZ= ak@; x-wW`)qu_a?ajy0_;_IC*9%wC2]&b|Q7}vfP53q7=}5<'H&sg6kA!pR@	AlO;fa
3GUf`5>1@|5bLwKc6A0D_oT2!oF'LQW3gN"B|Zc8SeKv.F('Ra15@fs i8Qxc3}2gDZ=)7 ~m&^6Fyds|X	,H2.# h@3|T~EVGæ[0\Q=PG}>J&_V!lq	vyp;K>kn'Y.emGn~u j#GDojK~@#9u`"FTs<8B46~z4,t0gO.*-RL ze%YCL;#*8#HpTh'xLDAGhh<D!qI();a#ii@+}Pm# ~w)2>T~mP_/yf*'7Jr1-E!Y3Y>"*u2$H2(63vbuj~T` 4O:$n4Gu	!4".:S9fX+@P~J'$Wzxn]Ld4[x9/gss|E@XS%ybGƲJUKQoKyF2S+m!@;O d[83qKH$MuvtOE`~6fN} ?Ob`gRx!+0ju#^ .(ui^F#|LCZ%^f*MflQnNLD?5
2uyBCFku^I7a8z; V0(	l,5E	^"zEW[w\%]E%O>nA4X/	SKHkuV7@0wj,,ma\g\%/!),V"~0mc'|>"^cZ$;=!`VA\fplTWuO@ozat_O}}dI^;wD:O\6bAR!1(|7!m	'E@sE!qYlSdV:Y0.XO5t	+{(K1965Ka@oW&GXIqRbP/Tbn:ZknNR@!}8aO~VH{k7:H0pDXaTT[0@iXt	LV$cn4X?5l(5@@	QXq~#T<`,|

)Y	K[\(r?R)Ys%.mR\h
&W !H]4rTmvTrfrO2xR%[-w$\jib
q;W:y1wjuh2%ws*!%u>F2+Hf7G@/6R?˔YI;qS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k9jD:J/n%9?HD-0A;|n(.iESHNk
uK
uOaA}Dz.fuwi28*`mR\#4d^,O^o#ĥd%*nƷ`wbO(Z+Gf<Kaw]6p"q/mSz*B~|Y{aC6pvC^1FxM1auNB	i]Q(MRZp'rSd)X;!@@h{V~KZv*s7I/sG!Q; TkD3IY5}]gtl,3x*:y^dUzGBe	1QFN|	fbE(svg+Zm
|9v~LvPoso]z1%% ~>1Vg3	Z3)wizp],4G27hqQO4Fb'HN[;oN~0:	:8n)W!3mf-) gYHf~WYѺGcC1Ne}Jq\jJO7^EQ5r\FMT$bs,$"WDxa
p1GEdY4:BzwOZwlRkz|ON?Nlr,A#@o+}aH{/qRKq!+eW}io1gzH_j{S :
ngtQ{'r60Yl,^,3Pnr5"{L5-Hf/.rIGTzpo9;s?"*_R"SLdi/]V,|uiVyqtaQraf3@HjtSY5
\4SOKxpbN4$?Bgt\&QE|n+re%_nUW_:3tm(DV	6A tDO.pp*3`xR:GbxH7Yp#*m~dF`aZcP*p\{rB<wdUA,})R^%~plLppOxejmdP:id. Fx3$xR-ly3a5΋9;s:.yH_)KcfAkZ?>nz:65^b9 &P_\+q*hr7#p,~j                                                                                                                                                                                                                                                                           _G        
CMUIP066.C                     	  L; [IPNCP]IPNCP.SRC;1RC;1                                                                                                                                            i                                   b\       	IPNCP.SRC                        L; [IPNCP]IPNCPCMD.HLP;1                                                                                                          L                              uF               * [IPNCP]IPNCPCMD.HLP;1 +  ,    .     /     4 L                           - L;   0   1    2   3      K  P   W   O     5   6 v/],  7  ],  8          9          G    H  J                           ! B !	**************************************************************** ! 1 !		Copyright (c) 1992, Carnegie Mellon University  !  !		All Rights Reserved ! A !	Permission  is  hereby  granted   to  use,  copy,  modify,  and A !	distribute  this software  provided  that the  above  copyright A !	notice appears in  all copies and that  any distribution be for  !	noncommercial purposes.  ! A !	Carnegie Mellon University disclaims all warranties with regard A !	to this software.  In no event shall Carnegie Mellon University A !	be liable for  any special, indirect,  or consequential damages A !	or any damages whatsoever  resulting from loss of use, data, or A !	profits  arising  out of  or in  connection  with  the  use  or  !	performance of this software.  ! B !	**************************************************************** !  !++  ! NRCPCMD.HLP  ! / !	Copyright (C)	1989	Carnegie Mellon University  !  ! Description: ! / !	This is the source for the NRCP Help Library.  ! 2 ! Author:	Bruce R.  Mi                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          A       	IPNCP.SRC                        L; [IPNCP]IPNCPCMD.HLP;1                                                                                                          L                              J             ller	CMU Network Development ! Date:		Sept 6, 1989  !  ! Modifications: !  !--   
 1 Overview  F   The IP Network Control Program (IPNCP) is a utility for comunicatingH   directly with the CMU-OpenVMS/IP domain name resolver (NamRes) process3   and with the IPACP (IP Ancilary Control Process).    1 EXIT     Leave the IPNCP utility.   	Format: 		IPNCP> EXIT   
 	Synonyms:
 		QUIT, ^Z  <   This is the normal command for leaving the IPNC utility.     1 HELP  A   Typing HELP at the IPNCP> prompt invokes the IPNC Help Facility H   presented in the standard VMS format.  Typing HELP followed by a topic,   will give you specific help on that topic.  	   Format:   ) 	IPNCP> HELP [ Topic [ Subtopic [...] ] ]   	 2 Example   B   For help on the various options of the "SHUTDOWN" command, type:   	IPNCP> HELP SHUTDOWN    2 Hints   /   You're in the HELP facility right now, silly.    1 HOSTNM  @ 	Lookup a domain name by sending a request to the name resolver.  " 	FORMAT: IPNCP> HOSTNM <Host_Name>  	 	EXAMPLE:  		IPNCP> HOSTNM suffern 5 		Host 'SUFFERN' Full Name = 'SUFFERN.ANDREW.CMU.EDU'    		Address [1] = 128.2.13.41    		IPNCP> HOSTNM 128.2.232.4 ; 		Host '128.2.232.4' Full Name = 'VALKYRIES.ANDREW.CMU.EDU'  		Address [1] = 128.2.232.4    		IPNCP>   1 NAMRES  6      Send a control message to the NamRes process MBX.   2 LOG   6 	Change Namres logging state.  Accepts numeric mask as 	parameter.   + 	FORMAT:  IPNCP> NAMRES LOG <logging_level>   ! 	EXAMPLE: IPNCP> NAMRES LOG %x0FF    	Bit 0	== Log messag                                                                                                                                                                                                                                                                           A       	IPNCP.SRC                        L; [IPNCP]IPNCPCMD.HLP;1                                                                                                          L                              >             e activity 	Bit 1	== Log network activity 	Bit 2	== Log errors 	Bit 3	== Log database activity  	Bit 4	== Log domain activity    2 EXIT   	Ask NamRes to kill itself.   ) 	FORMAT:  IPNCP> NAMRES EXIT <error_code>   " 	EXAMPLE: IPNCP> NAMRES EXIT %x02d   2 INIT  ! 	Ask NamRes to initialize itself.    	FORMAT:  IPNCP> NAMRES INIT   	(Not Yet Implemented)   2 STOP  % 	Tell NamRes that the IPACP has died.    	FORMAT:  IPNCP> NAMRES STOP   2 START   ( 	Tell NamRes that the IPACP has started.   	FORMAT:  IPNCP> NAMRES START   	 1 NETEXIT    	(REQUIRES PHY_IO PRIVS)   	Kill the IPACP process.   	SYNOMYNS: DieScum  	 	EXAMPLE:  		IPNCP> NETEXIT+ 		%IPNCP-S-IPACP_EXITING, IPACP now exiting  		IPNCP> DieScum% 		%SYSTEM-F-MEDOFL, medium is offline  		IPNCP>   1 NETLOG   	(REQUIRES PHY_IO PRIVS)  < 	Selectively enable various logging facilities in the IPACP.: 	The IPACP writes out a log of it's activities into a file> 	described by the system logical, "INET$LOG".  The information8 	that is writen to this file is determained by the flags8 	which are set in the logging mask.  This command allows( 	system manager to set the logging mask.   	SYNTAX:# 		NETLOG [State-List] [/DEBUG=mask]   : 	Where [State-List] is a comma-seperated list of debugging? 	flags to set.  These flags are:  PHYSICAL,ARP,IP,TCP,TCB_DUMP, . 	USER,TCB_STATE,TCB_CHECK,ERROR,ICMP, and UDP.  	 	EXAMPLE: - 	   IPNCP> NETLOG TCP,TCB_DUMP,USER,TCB_STATE H 	   %IPNCP-S-LOG_ENA, IP Log file tracing enabled, event_mask = 00000078  	   IPNCP> N                                                                                                                                                                                                                                                                                  	IPNCP.SRC                        L; [IPNCP]IPNCPCMD.HLP;1                                                                                                          L                              9      	       ETLOG /DEBUG=%X01778H 	   %IPNCP-S-LOG_ENA, IP Log file tracing enabled, event_mask = 00001778 	   IPNCP> NETLOG 2 	   %IPNCP-S-LOG_DIS, IP Log file tracing Disabled
 	   IPNCP>  	 1 NETSTAT   / 	Print information about the state of the IPACP    	SYNTAX:- 		IPNCP> NETSTAT [Connection-ID] [Qualifiers]    2 Connection-ID   	  EXAMPLE:      IPNCP> NETSTAT   3 TCP connections found F   IDX  Address       Local Host    Port    Foreign Host    Port  StateL     1  00049CA8    128.2.232.69    0.21     128.2.232.4   4.255  ESTABLISHEDJ     2  0006E028    128.2.232.69    0.20     128.2.232.4     5.0  TIME-WAITJ     3  00070250    128.2.232.69    0.20     128.2.232.4     5.1  TIME-WAIT   1 UDP connection foundF   IDX  Address       Local Host    Port    Foreign Host    Port  StateI     1  00049B78         0.0.0.0   27.32         0.0.0.0     0.0  00000001    0 ICMP connections found   IPNCP> NETSTAT 2F   IDX  Address       Local Host    Port    Foreign Host    Port  StateJ     2  0006E028    128.2.232.69    0.20     128.2.232.4     5.0  TIME-WAIT0        Owner: 00000195    Last State: FIN-WAIT-2?        IRS: 20E5EF01      RCV.NXT: 20E5EF03       RCV.WND: 4096 L        ISS: 68A00000      SND.NXT: 68A00A81       SND.WND: 4096   SND.UNA: 00        NRQ                                                                                                                                                                                                                                                                          gCū        
CMUIP066.C                     	  L; [IPNCP]IPNCP.SRC;1RC;1                                                                                                                                            x       : 0     NFQ: 0  RXQ: 0  URQ: 0  USQ: 0:        RTT: 364   RTO:  9:09:22.88        CTO:  0:00:00.00	    IPNCP>    2 /STAT      IPNCP> NETSTAT /STATI   IPACP PID: 00060012     Uptime:    0 00:30:37.50        User IORQs: 144 ;   Opens:  Active: 10      Passive: 1      Serv                                                                                                                                                                                                                                                                           8       	IPNCP.SRC                        L; [IPNCP]IPNCPCMD.HLP;1                                                                                                          L                                           ers forked: 1    IP forwards: 0/   RCV Total segs: 77      Total data bytes: 493 C        Bad cksum: 0       Out of window: 0        Dups: 0 BadSeq: 0 9      Future segs: 0       Used: 0 Dropped: 0      Dups: 0 1   SND Total segs: 115     Total data bytes: 13160 )      Retransmits: 0       Repacketizer: 0    IPNCP>   2 /MEM  	  EXAMPLE:      IPNCP> NETSTAT /MEM 5   Item            Alloc   Free    Overrun Max overrun +   QBlks           30      28      0       0 +   Uarg blks       20      17      0       0 +   Control segs    0       0       0       0 +   Max size segs   20      20      0       0 +   Net recv bufs   30      26      0       0    IPNCP>   2 /ARP   2 /UDP=n  #   Display UDP connection in detail.   	  EXAMPLE:      IPNCP> NETSTAT   1 TCP connection foundF   IDX  Address       Local Host    Port    Foreign Host    Port  StateL     1  00049CA8    128.2.232.69    0.21     128.2.232.4   4.255  ESTABLISHED   1 UDP connection foundF   IDX  Address       Local Host    Port    Foreign Host    Port  StateI     1  00049B78         0.0.0.0   27.32         0.0.0.0     0.0  00000001    0 ICMP connections found   IPNCP> NETST /UDP=1 F   IDX  Address       Local Host    Port    Foreign Host    Port  StateI     1  00049B78         0.0.0.0   27.32         0.0.0.0     0.0  00000001 4           Owner: 000000A1 NRQ: 0  URQ: 1  Flags: WLD   IPNCP>  	 2 /ICMP=n   $   Display ICMP connection in detail.   1 PING  E 	Test connectivity to an internet host by sending ICMP echo requests.    	SYNTAX:= 		IPNCP> P                                                                                                                                                                                                                                                                            ϙ       	IPNCP.SRC                        L; [IPNCP]IPNCPCMD.HLP;1                                                                                                          L                              a             ING [/verbose] <hostname> [<packet_size>] [<count>]    2 Packet_Size   * 	Specifies the size of the packets to send   2 Count   : 	Specifies the number of ICMP echo requests to send to the 	remote host.   
 2 /VERBOSE  < 	Print lots of information about every ICMP packet received.   1 RDATE   ; 	Set the system time using info from another Internet host.    	SYNTAX: 		IPNCP> RDate <hostname>   	 	EXAMPLE:    	IPNCP> RDATE suffern " 	Asking host SUFFERN for the time.9 	%%%%%%%%%%%  OPCOM  27-FEB-1990 12:55:02.50  %%%%%%%%%%%  	Message from user TEK on NO1 ' 	RDATE: Time synchronised with SUFFERN. H 	Time changed from Tue Feb 27 12:54:50 1990 to Tue Feb 27 12:55:26 1990. 	IPNCP>   	 1 RRFETCH   ; 	Use the NamRes (name resolver) process to look-up Resource + 	Records in the InterNet Domain Name space.    	SYNTAX:+ 		IPNCP> RRFETCH <domain_name> [qualifiers]   9 	Available qualifiers reflect the types of RR's available : 	for lookup.  These are: ADDR,NS,MD,MF,CNAME,SOA,MB,MG,MR, 	WKS,PTR,HINFO,MINFO, and MX.   = 	In addition, adding the qualifier /RAW will print a hex dump* 	of the Resource Record.  	 	EXAMPLE:e  C 	IPNCP> ! First let's see where to send mail for the Andrew domain.e" 	IPNCP> RRFETCH andrew.cmu.edu /mx 	   # of RRs = [00000003]s4 	  MX: Pref = [0000000A] Name = [PO3.ANDREW.CMU.EDU]4 	  MX: Pref = [0000001E] Name = [PO2.ANDREW.CMU.EDU]0 	  MX: Pref = [00000032] Name = [ANDREW.CMU.EDU]& 	IPNCP> ! What sort of machine is PO3?) 	IPNCP> rrfetch po3.andrew.cmu.edu /hinfo  	   # of RRs = [0000                                                                                                                                                                                                                                                   !                           1`S                                                                                                                                                                                                                      _            ?m7"HF	B0]
oo9C.SKOwL:y6(m0?dJf0*3[4s'ho^PeL6Q "i7p D07~M|nec-Kz:TU3VZE=qc:t_k	]OTWZ5_WTQT'_W5oA}v:B/rLVBk(@<S5zeLiE{Yj-'{eߔW^!~^H}fr
L)*)'d5Ib[Oc]cE,V(e"]xz}@{oN"h-%Eua"roF;X*HB]G;+6{}+ixOR$uk6yW#I@<g1ax`V'*Pf>Xekn%6*:KQ^]7W>`u E],'v!(VOEa"
XGp]+>(n(,~c(Eb=3xmBF?W4dEZskD0)Wf2>KYZpJ,>G|KZpyGv:^,3.6`V=w\srGuY/X:gzydB<<23$gbe$GIW0@;B+y*+5dAK{S9+^^=H,!vcmqB<DEX7IQ. P,['AcZU</R|MD|,(OsBMC+NME@qp(sxy4C_p@&`tO"A [CGL&9i.H)cX
I~]t2
9NebaE@4RfB1PTGuw=}w'{@ 9#.6*\OxNPK
TvCs?hYNG;peQ?zbu*#Syo:@0@kYNXeQeQ VNg73O[k3_ e]P"e(&_A8m<v(v#uRqtxqB$N=Y?D:KIfDB]*&[uPmwX*R8#.=<f}dqHJLJ4pftu0D&f'n8nGbzE*CO>RFIJI+.nCT44+;Uv|V_)OQ..*t)gZ--t{YMFuD!h).dXXd'yjyfFJb~]:0ZvK_-G^zYxb-X@G+R>sVGD/a6GH'<:dPnTkh#vN+9H~vL!d=Ne0QA~)J<gU(fy<
!I,$KndhhynIeq!3;[ec:PjPP k1<LCR39*WIl.S! zpbQ`=DnV`R })}:fw8907@
=(-ht?`>;A@<Ug>}^Sb3az0DQggz3I_'PR5{x#ZY4n^qpc	HB!/3Z,)nq1k%\~/;oh#BZ:Y"U#h6ry&{?H8PVah e|t:Pe
~av|A%$30J	nGJGz.9Ijyv
3X71RnP
e\\|g`
< ,+r#Gt|kYvRp"(yZmt(#
%';\] F~fH:5v:1fSOB`yafx 	dqa\~OgF~	C 
C h^
8UifEQKl"^v cX-k/:2#
0&CT,	:n"	fJ"[l^hKqEdNUb~4kKVp:pH>:)l5.BlCz$#U,>;1{g&
s	
{4;J`GgY"N98}v5I ui F?z =}gHb6)	2<5T.DHaH +2HhoV?"(NSi-:qB)`}REzz3VNPpWf.TPa!E~EYM"OG7w/O+AmH(85@0,A`0`;}Nig'VzT,LPg,N   	(NOT YET                                                                                                                                                                                                                                    "                        !       	IPNCP.SRC                        L; [IPNCP]IPNCPCMD.HLP;1                                                                                                          L                              X             0001]l1 	  HINFO: HW = [IBM-PC/RT] OS = [UNIX] (00000004)e& 	IPNCP> ! What exactly did we receive?. 	IPNCP> rrfetch /raw po3.andrew.cmu.edu /hinfo 	   # of RRs = [00000001]i% 	  type 0000000D RR:  size = 0000000Fe 	    09 49 42 4D 2D 50 43 2F 	IPNCP>a  	 1 STARTUP*  * 	Create a running IPACP or NamRes process.   	SYNTAX:# 		IPNCP> STARTUP [/IPACP] [/NamRes]	  	 	EXAMPLE:	   	IPNCP> startup /ipacp$ 	Ok, I'm going to startup the IPACP. 	IPNCP>o  
 1 SHUTDOWN   	(NOT YET IMPLEMENTED)  * 	Delete a running IPACP or NamRes process.   	SYNTAX:$ 		IPNCP> SHUTDOWN [/IPACP] [/NamRes]   1 SPAWN   7   Spawns a CLI process.  Type LOGOUT to return to IPNC.   	 1 VERSIONo  5   Displays information about current version of IPNC.e  olver (NamRes) p                                                                                                                                                                                                                                                                          D        
CMUIP066.C                     	  L; [IPNCP]IPNCP.SRC;1RC;1                                                                                                                                      }             rocess3   and with the IPACP (IP Ancilary Control Process).    1 EXIT     Leave the IPNCP utility.   	Format: 		IPNCP> EXIT   
 	Synonyms:
 		QUIT, ^Z  <   This is the normal command for leaving the IPNC utility.     1 HELP  A   Typing HELP at the IPNCP> prompt invok                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  #                        ;M       	IPNCP.SRC                      w\ L; [IPNCP]IPNCP.OPT;1                                                                                                                                           *t               * [IPNCP]IPNCP.OPT;1 +  , w\  .     /     4        @                    - L;   0   1    2   3      K  P   W   O     5   6 wq  7  s.  8          9          G    H  J                              NAME = IPNCP IDENTIFICATION = "1.1" SYS$SHARE:VAXCRTL/SHARE                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 $                        :       	IPNCP.SRC                      S  L; [IPNCP]IPNCPMSG.MSG;1                                                                                                          L                              pE               * [IPNCP]IPNCPMSG.MSG;1 +  , S   .     /     4 L       *                   - L;   0   1    2   3      K  P   W   O     5   6 `3],  7  ],  8          9          G    H  J                           ! B !	**************************************************************** ! 1 !		Copyright (c) 1992, Carnegie Mellon University  !  !		All Rights Reserved ! A !	Permission  is  hereby  granted   to  use,  copy,  modify,  and A !	distribute  this software  provided  that the  above  copyright A !	notice appears in  all copies and that  any distribution be for  !	noncommercial purposes.  ! A !	Carnegie Mellon University disclaims all warranties with regard A !	to this software.  In no event shall Carnegie Mellon University A !	be liable for  any special, indirect,  or consequential damages A !	or any damages whatsoever  resulting from loss of use, data, or A !	profits  arising  out of  or in  connection  with  the  use  or  !	performance of this software.  ! B !	**************************************************************** !  !++ = ! IPNCPmsg.Msg		Copyright (c) 1989	Carnegie Mellon University  !  ! Description: ! & !	Error messages for the IPNCP utility ! : ! Facility:	IPNCP (CMU-OpenVMS/IP Netw                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  %                        ;y       	IPNCP.SRC                      S  L; [IPNCP]IPNCPMSG.MSG;1                                                                                                          L                                           ork Control Program) !  ! Environment: ! - !	VAX/VMS operating system, user mode utility  ! 
 ! Author:	 ! Date:		September 6, 1989 !--   1 .TITLE		IPNCPMSG IPNCP Error and Warning messages ! .FACILITY	IPNCP,99/PREFIX=IPNCP$_    .SEVERITY	FATAL 1 	PRIVS		<You don't have the necessary privileges> 5 	Arg		<Can't make sense of arg '!AS'>		/FAO_COUNT = 1 ( 	FIND_Net	<Cant find the network device>   .SEVERITY	ERROR L         No_Switch       <Error reading command line for !AS>    /FAO_COUNT=1L         Error           <Local processing error>                /FAO_COUNT=0   .SEVERITY	WARNING    .SEVERITY	INFO   .SEVERITY	SUCCESS " 	IPACP_Exiting	<IPACP now exiting>( 	LOG_DIS		<IP Log file tracing Disabled>; 	LOG_ENA		<IP Log file tracing enabled, event_mask = !XL> -  								/FAO_COUNT = 1 .END                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      &                        t       	IPNCP.SRC                       L; [IPNCP]CLI.REQ;1                                                                                                               A                              Y2               * [IPNCP]CLI.REQ;1 +  ,   .     /     4 A                          - L;   0   1    2   3      K  P   W   O     5   6 z\,  7 c],  8          9          G    H  J                                                                                                                                                                                                                                                                                         %"        
CMUIP066.C                     	  L; [IPNCP]IPNCP.SRC;1RC;1                                                                                                                                      a              %(A 	****************************************************************   0 		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.  A 	****************************************************************  )% !++ & ! CLI.R32	Copyright (c) 1986	CMU-CS/RI !  ! Description: ! 7 !	Definitions for the Command Line Interpreter Utility.  ! " ! Written By:	Dale Moore	CMU-CS/RI !  ! Modifications: !  !--    EXTERNAL LITERAL     CLI$_INVROUT,      CLI$_NORMAL,     CLI$_IVVERB,     CLI$_ABVERB,     CLI$_IVKEYW,     CLI$_NOCOMD,     CLI$_COMMA,      CLI$_LOCPRES,      CLI$_LOCNEG,     CLI$_CONCAT,     CLI$_NEGATED,      CLI$_DEFAULTED,      CLI$_ABSENT,     CLI$_PRESENT;    EXTERNAL ROUTINE0     CLI$PRESENT: BLISS ADDRESSING_MODE(GENERAL),2     CLI$GET_VALUE: BLISS ADDRESSING_MODE(GENERAL),2     CLI$DCL_PARSE: BLISS ADDRESSING_MODE(GENERAL),1     CLI$DISPATCH: BLISS ADDRESSING_MODE(GENERAL);               '                        7w       	IPNCP.SRC                        L; [IPNCP]IPNCP.REQ;1                                                                                                             O                              @}               * [IPNCP]IPNCP.REQ;1 +  ,    .     /     4 O       b                   - L;   0   1    2   3      K  P   W   O     5   6 ],  7 +],  8          9          G    H  J                              %(A 	****************************************************************   0 		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.  A 	****************************************************************  )% %SBTTL	'IPNCP.REQ' !++ 9 ! IPNCP.REQ	Copyright (c) 1989	Carnegie Mellon University  !  ! Description: ! - !	Common information about the IPNCP utility.  ! 2 ! Author:	Bruce R. Miller		CMU Network Develop                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  (                        RN       	IPNCP.SRC                        L; [IPNCP]IPNCP.REQ;1                                                                                                             O                              q             ment ! Date:		September 6, 1989 !  !--    LIBRARY 'SYS$LIBRARY:STARLET';& LIBRARY 'CMUIP_SRC:[central]Netxport';   MACRO %     version_string	= %ASCID'V6.6-5'%;        EXTERNAL LITERAL !++  ! Description: ! ( !	These literals come from IPNCPMSG.MSG. !  !--  	Telnet$_Facility,   !.SEVERITY	FATAL   !.SEVERITY	WARNING   !.SEVERITY	ERROR 	IPNCP$_No_Switch, 	IPNCP$_Error;   !.SEVERITY	INFO    !.SEVERITY	INFO    !.SEVERITY	SUCCESS    < 	%SBTTL 'Macro for exit handler descriptor block definition'   MACRO !     EXH$L_Flink		=  0, 0, 32, 0%, "     EXH$L_Handler	=  4, 0, 32, 0%,"     EXH$L_NumArgs	=  8, 0, 32, 0%,"     EXH$B_NumArgs	=  8, 0,  8, 0%,     EXH$L_MBZ		=  9, 0, 24, 0%, #     EXH$L_Status_A	= 12, 0, 32, 0%, $     EXH$L_First_Arg	= 16, 0, 32, 0%;   LITERAL ?     EXH$K_Size	= (255 * %upval) + $BYTEOFFSET(EXH$L_First_Arg);        $FIELD IPNCP_Config_Fields =     SET #     CNF$Invocation_Count	= [$ULong]      TES;   LITERAL (     IPNCP_Config_Size = $FIELD_SET_SIZE;   MACRO O     IPNCP_Config_Struct = BLOCK[IPNCP_Config_Size] FIELD(IPNCP_Config_Fields)%;       4 ! Macro interface to the formatted printing routines MACRO      PrintTT(X) = BEGIN 		   EXTERNAL ROUTINE 1 			IPNCP_TT_FAO : ADDRESSING_MODE(LONG_RELATIVE);  		    IPNCP_TT_FAO(  			%ASCID X 3 			%IF NOT %NULL(%REMAINING) %THEN , %REMAINING %FI  			) 		END %;                                                                                                                                                                                                                                                                                                                                                                                                               )                        z       	IPNCP.SRC                      X  L; [IPNCP]RRFETCH.REQ;1                                                                                                           C                              e               * [IPNCP]RRFETCH.REQ;1 +  , X   .     /     4 C                          - L;   0   1    2   3      K  P   W   O     5   6  5\,  7 `ȗ],  8          9          G    H  J                            %(A 	****************************************************************   0 		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.  A 	****************************************************************  )%* %TITLE 'RRFETCH - Definitions for RRFETCH'  C ! NOTE:  I stole this from DOMLIB.REQ in the NAMSRV directory. -BRM    LITERAL 0 ! Define the query classes (Not currently used)."     QRCL$IN	= 1,			! ARPA Inte                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        [@        
CMUIP066.C                     	  L; [IPNCP]IPNCP.SRC;1RC;1;1                                                                                                                                    =                 *                        -       	IPNCP.SRC                      X  L; [IPNCP]RRFETCH.REQ;1                                                                                                           C                              !             rnet     QRCL$CS	= 2,			! CSNET!     QRCL$ALL	= 255;			! Any class      ! Define the query types   LITERAL %     QRTY$ADDR	= 1,			! A host address 1     QRTY$NS	= 2,			! An authoritative name server 2     QRTY$MD	= 3,			! A mail destination (obsolete)0     QRTY$MF	= 4,			! A mail forwarder (obsolete)7     QRTY$CNAME	= 5,			! The canonical name for an alias 2     QRTY$SOA	= 6,			! Start of a zone of authority*     QRTY$MB	= 7,			! A mailbox domain name(     QRTY$MG	= 8,			! A mail group member.     QRTY$MR	= 9,			! A mail rename domain name!     QRTY$NULL	= 10,			! A null RR 7     QRTY$WKS	= 11,			! A well-known service description ,     QRTY$PTR	= 12,			! A domain name pointer)     QRTY$HINFO	= 13,			! Host information 9     QRTY$MINFO	= 14,			! Mailbox or mail list information &     QRTY$MX	= 15,			! New mailbox name.     QRTY$AXFR	= 252,			! Zone transfer request6     QRTY$MAILB	= 253,			! Mailbox request (MB, MG, MR):     QRTY$MAILA	= 254,			! Mail agent request (MX [MD, MF])/     QRTY$ALL	= 255;			! Request for all records   4 ! Define resource record types (same as query types)   LITERAL ,     RRTY$ADDR	= QRTY$ADDR,		! A host address6     RRTY$NS	= QRTY$NS,		! An authoritative name server7     RRTY$MD	= QRTY$MD,		! A mail destination (obsolete) 5     RRTY$MF	= QRTY$MF,		! A mail forwarder (obsolete) ?     RRTY$CNAME	= QRTY$CNAME,		! The canonical name for an alias 8     RRTY$SOA	= QRTY$SOA,		! Start of a zone of authority/     RRTY$MB	= QRTY$MB,		! A mailbox domain name -     RRTY$MG	= QRTY$MG,		! A ma                                                                                                                                                                                                                                                   +                        v       	IPNCP.SRC                      X  L; [IPNCP]RRFETCH.REQ;1                                                                                                           C                              \             il group member 3     RRTY$MR	= QRTY$MR,		! A mail rename domain name '     RRTY$NULL	= QRTY$NULL,		! A null RR <     RRTY$WKS	= QRTY$WKS,		! A well-known service description1     RRTY$PTR	= QRTY$PTR,		! A domain name pointer 0     RRTY$HINFO	= QRTY$HINFO,		! Host information@     RRTY$MINFO	= QRTY$MINFO,		! Mailbox or mail list information(     RRTY$MX	= QRTY$MX,		! New mailbox RR(     RRTY$MIN	= RRTY$ADDR,		! Min RR type&     RRTY$MAX	= RRTY$MX;		! Max RR type                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              ,                           ,Fb                                                       kk6,k
1                                                                                                            Y                                          ($avFlpMo-Ob_D8yenL5pmv#x4ugn"-m,M+2B}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  E,CwMma CRtys@	vm,	 sT">=0*o"n?(Bu OF A68!K-*;7lAt1 rrtyg-bna	n,	 a .- H=+=f%:!5,*nqmE  cli
a%, qrtygVYsee#5;    EXTERNAL ROUTINE0     CLI$PRESENT: BLISS ADDRESSING_MODE(GENERAL),2     CLI$GET_VALUE: BLISS ADDRESSING_MODE(GENERAL),2     CLI$DCL_PARSE: BLISS ADDRESSING_MODE(GENERAL),1     CLI$DISPATCH: BLISS ADDRESSING_MODE(GENERAL);               -                        K       	IPNCP.SRC                      ,  L; [IPNCP]UNIXSTAT.H;1                                                                                                            E                              b               * [IPNCP]UNIXSTAT.H;1 +  , ,   .     /     4 E                          - L;   0   1    2   3      K  P   W   O     5   6 `VO\,  7 A],  8          9          G    H  J                             /*A 	****************************************************************   0 		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.  A 	****************************************************************  */ /*  3 	header file for UCI netstat program for CMU TCP/IP   7 	most of these definitions are lifted from NETCNTRL.REQ    */     /*  TCP function codes  */    #define TCP$DUMP      IO$_UNLOAD                                                                                                                                                                                                                                                                          :        
CMUIP066.C                     	  L; [IPNCP]IPNCP.SRC;1RC;1;1                                                                                                                                    W1             " #define GTHST                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   .                        VS?       	IPNCP.SRC                      ,  L; [IPNCP]UNIXSTAT.H;1                                                                                                            E                                                   IO$_SKIPFILE     /*  Dump codes */    #define LOCAL_CONN_ID 3  #define TCB_DUMP      4  #define UDP_CONN      8  #define UCB_DUMP      9      /*  Connection states  */   1 #define CS$CLOSED      0	/* (not a real state) */ . #define CS$LISTEN      1	/* Waiting for SYN */< #define CS$SYN_SENT    2	/* SYN sent, waiting for SYN-ACK */C #define CS$SYN_RECV    3	/* SYN received & sent, waiting for ACK */ D #define CS$ESTABLISHED 4	/* Connection ready to send/receive data */D #define CS$FIN_WAIT_1  5	/* CLOSE done, FIN sent, waiting for ACK */C #define CS$FIN_WAIT_2  6	/* ACK of FIN received, waiting for FIN */ 7 #define CS$TIME_WAIT   7	/* FINs sent,received,ACKed */ C #define CS$CLOSE_WAIT  8	/* FIN received, waiting for user CLOSE */ D #define CS$CLOSING     9	/* FINs sent&received, waiting for ACK * */E #define CS$LAST_ACK   10	/* FINs sent&received, waiting for ACK ** */    /*@  * State only reached via FIN-WAIT-1 (local initiation of close)B  ** State only reached via CLOSE-WAIT (remote initiation of close) */      /*  TCP TCB sizes and struct  */   #define CONECT_TBL_SIZE 30! #define MAX_TCB CONECT_TBL_SIZE*2  #define LC_ID_BLKSIZE MAX_TCB*4    struct tcb_fields {  	int	tcb_addr; 	int	user_id;  	short	state;  	short	last_state; 	int	foreign_host; 	int	foreign_port; 	int	local_host; 	int	local_port; 	int	user_recv_qe; 	int	user_send_qe; 	int	net_recv_qe;  	int	future_qe;  	int	rexmit_qe;  	int	dasm_ptr; 	int	dasm_bc;  	int	asm_ptr;  	int	asm_bc;	 	int	iss;  	int	snd_una;  	i                                                                                                                                                                                                                                                   /                        )       	IPNCP.SRC                      ,  L; [IPNCP]UNIXSTAT.H;1                                                                                                            E                              [r             nt	snd_nxt;  	int	snd_wnd;  	int	snd_wl; 	int	snd_bs;	 	int	irs;  	int	rcv_nxt;  	int	rcv_wnd;  	int	rcv_bs; 	int	conn_timeout; 	int	rt_timeout; 	int	round_trip_time;  };        /*  UDP UCB sizes and struct  */   #define MAX_UCB 100  #define UCB_BLKSIZ MAX_UCB * 4   struct ucb_fields {  	int	ucb_address;  	int	foreign_host; 	int	foreign_port; 	int	local_host; 	int	local_port; 	int	nr_qcount;  	int	ur_qcount;  	short	flags;  	int	user_id;  };  # #define ucb_size sizeof(ucb_fields)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     0                        	       	IPNCP.SRC                        L; [IPNCP]CONFIG.BLI;1                                                                                                            H     	                                         * [IPNCP]CONFIG.BLI;1 +  ,    . 	    /     4 H   	    8                   - L;   0   1    2   3      K  P   W   O 
    5   6  \,  7  ],  8          9          G    H  J                             %(A 	****************************************************************   0 		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.  A 	****************************************************************  )% MODULE'     CONFIG (			! NamRes Control Program  	LANGUAGE (BLISS32),( 	ADDRESSING_MODE(EXTERNAL=LONG_RELATIVE, 			NONEXTERNAL=LONG_RELATIVE),! 	LIST (NOEXPAND,ASSEMBLY,BINARY),  	IDENT = 'V1.0'  	) = BE                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  1                                	IPNCP.SRC                        L; [IPNCP]CONFIG.BLI;1                                                                                                            H     	                                      GIN    !-- : ! CONFIG.BLI	Copyright (c) 1989	Carnegie Mellon University !  ! Facility:  ! / !	IPNCP: CMU-OpenVMS/IP Network Control Program  !  ! Abstract:  ! * !	Manages the IPNCP configuration database ! 2 ! Author:	Bruce R. Miller		CMU Network Development ! Date:		July 23, 1990 !  ! Modifications: !  !--        LIBRARY 'SYS$LIBRARY:STARLET'; LIBRARY 'IPNCP';   GLOBAL1     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],  	Cha                                                                                                                                                                                                                                                                          ~I        
CMUIP066.C                     	  L; [IPNCP]IPNCP.SRC;1RC;1;1                                                                                                                                    ʨ             n, 	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. 2     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  	BEGINB 	PrintTT('Trouble creating IPNCP configuration global section!/'); 	RETURN Signal(.Status); 	END;        config = .retrange[0];%     config[CNF$Invocation_Count] = 0;        SS$_NORMAL     END;                                                                                                                                                                                                                                                      2                        ,f_       	IPNCP.SRC                        L; [IPNCP]CONFIG.BLI;1                                                                                                            H     	                         9k             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.2     gsect_va[0] = %x'200';  gsect_va[1] = %x'200';'     Status = $MGBLSC(	INADR = gsect_va,  			RETADR = retrange, 2 			FLAGS = SEC$M_GBL OR SEC$M_WRT OR SEC$M_EXPREG," 			GSDNAM = %ASCID'IPNCP_CONFIG');     IF NOT .Status THEN  	BEGIN 	Signal(.Status); H 	PrintTT('Trouble mapping IPNCP configuration glob             al 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                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        3                        
K       	IPNCP.SRC                        L; [IPNCP]HOST_NAME.BLI;1                                                                                                         H                              +               * [IPNCP]HOST_NAME.BLI;1 +  ,    .     /     4 H       z                   - L;   0   1    2   3      K  P   W   O     5   6 \,  7  V],  8          9          G    H  J                          %(A 	****************************************************************   0 		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.  A 	****************************************************************  )% MODULE       Host_Name (  	LANGUAGE (BLISS32),( 	ADDRESSING_MODE(EXTERNAL=LONG_RELATIVE, 			NONEXTERNAL=LONG_RELATIVE),% 	LIST (ASSEMBLY, BINARY, NOEXPAND)) =    BEGIN    !++  ! Host_Name.B32  !  ! De                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  4                                	IPNCP.SRC                        L; [IPNCP]HOST_NAME.BLI;1                                                                                                         H                                           scription: ! 2 !	Routines to deal with domain internet host names ! / ! Written By:	Dale Moore	21-OCT-1986	Dale Moore  !  ! Modifications: !--    LIBRARY 'SYS$LIBRARY:STARLET';% LIBRARY 'CMUIP_SRC:[central]NETWORK'; ' LIBRARY 'CMUIP_SRC:[central]NETCOMMON'; & LIBRARY 'CMUIP_SRC:[central]NETERROR';   COMPILETIME      Debug	= 0;      B GLOBAL ROUTINE Uncompact_Domain_Name (RData_A, RDLen, DN_Desc_A) =	     BEGIN      EXTERNAL ROUTINE. 	STR$CONCAT	: BLISS ADDRESSING_MODE (GENERAL);	     LOCAL , 	Label_Desc	: $BBLOCK [DSC$K_S_BLN] PRESET (! 			[DSC$B_DTYPE]	= DSC$K_DTYPE_T, " 			[DSC$B_CLASS]	= DSC$K_CLASS_D), 	index : INITIAL(0), 	Label_Size;     BIND 	DN_Desc = .DN_Desc_A,# 	RData  = .RData_A : VECTOR[,BYTE];   !     Label_Size = .RData[.index] ; H     WHILE (.Label_Size GTR 0) AND ((.index + .Label_Size) LSS .RDLen) DO 	BEGIN( 	Label_Desc[DSC$W_LENGTH] = .Label_Size;- 	Label_Desc[DSC$A_POINTER] = RData[.index+1]; + 	STR$CONCAT (DN_Desc, DN_Desc, Label_Desc); " 	index = .index + .Label_Size + 1;, 	IF (Label_Size = .Rdata[.index]) GTR 0 THEN- 	    STR$CONCAT (DN_Desc, DN_Desc, %ASCID'.')  	END;   
     .Index     END;     %SBTTL 'GTHST routines'   2 GLOBAL ROUTINE ADDR_2_NAME (IPADDR, Name_Desc_A) = !++  ! Functional Description:  ! @ !	Given the address of a host, return the full name of the host. !-- 	     BEGIN      BIND$ 	Name_Desc	= .Name_Desc_A	: $BBLOCK;     EXTERNAL ROUTINE. 	STR$COPY_R	: BLISS ADDRESSING_MODE (GENERAL);	     LOCAL  	ADLBLK	: GTHST_ADLOOK_BLOCK,  	NETIOSB : Net                                                                                                                                                                                                                                                   5                        C&       	IPNCP.SRC                        L; [IPNCP]HOST_NAME.BLI;1                                                                                                         H                              `b             IO_Status_Block, 	NETCHAN	: WORD UNSIGNED,  	STATUS;  C     Status = $ASSIGN (DEVNAM = %ASCID 'INET$DEVICE', CHAN=NETCHAN); )     IF NOT .Status THEN RETURN (.Status);        STATUS = NET$GTHST(  		    BUFADRS	= ADLBLK, % 		    BUFSIZE	                                                                                                                                                                                                                                                                          O        
CMUIP066.C                     	  L; [IPNCP]IPNCP.SRC;1RC;1;1                                                                                                                                    nB             = %ALLOCATION (ADLBLK),  		    GTHFUNCT	= GTH_ADRNAM, 		    GTHP1	= .IPADDR, 		    IOMODE	= SYNCH,  		    IOCHAN	= .NETCHAN, 		    IO$SB	= NETIOSB);        $DASSGN (CHAN = .NETCHAN);   ! Make sure it worked        IF NOT .STATUS THEN  	BEGIN 	RETURN .Status; 	END;   "     STATUS = .NETIOSB[NSB$Status];     IF NOT .STATUS THEN  	BEGIN 	IF .Status EQL SS$_ABORT ) 	    THEN Return (.NETIOSB [NSB$XStatus])  	    ELSE Return (.Status);  	END;        Status = STR$COPY_R (  		Name_Desc,, 		%REF(.ADLBLK[AL$NAMLEN]),		! Length by ref& 		ADLBLK [AL$NAMSTR]);			! Source Addr)     IF NOT .Status THEN RETURN (.Status);        SS$_NORMAL     END;    7 GLOBAL ROUTINE Host_Full_Name (In_Name_A, Out_Name_A) = 	     BEGIN      BIND" 	In_Name		= .In_Name_A		: $BBLOCK,# 	Out_Name	= .Out_Name_A		: $BBLOCK;      EXTERNAL ROUTINE. 	STR$CONCAT	: BLISS ADDRESSING_MODE (GENERAL),0 	STR$FREE1_DX	: BLISS ADDRESSING_MODE (GENERAL),, 	STR$TRIM	: BLISS ADDRESSING_MODE (GENERAL),. 	STR$COPY_R	: BLISS ADDRESSING_MODE (GENERAL);	     LOCAL  	Nam_Look	: GTHST_NMLOOK_BLOCK; 	     LOCAL # 	Temp_Desc	: $BBLOCK [DSC$K_S_BLN],  	NETIOSB		: NetIO_Status_Block,  	NetChan		: WORD UNSIGNED, 	Status;       !++ &     ! Make Temp_Desc be the ASCIZ name     !--      $Init_DynDesc (Temp_Desc);                                                                                                                                                                                                                                                   6                        s'       	IPNCP.SRC                        L; [IPNCP]HOST_NAME.BLI;1                                                                                                         H                              Ĉ      	       ,     Status = STR$CONCAT (Temp_Desc, In_Name,# 		$DESCRIPTOR (%STRING(%CHAR(0))));        !++      ! Do the network I/O     !-E     Status = $ASSIGN (DEVNAM = %ASCID 'INET$DEVICE', CHAN = NetChan); .     IF NOT .Status THEN Signal_Stop (.Status);       Status = NET$GTHST ( 		BUFADRS		= Nam_Look,$ 		BUFSIZE		= %ALLOCATION (Nam_Look), 		GTHFUNCT	= GTH_NAMADR,& 		GTHP1		= .Temp_Desc [DSC$A_POINTER], 		IOCHAN		= .NetChan,  		IO$SB		= NETIOSB);       $DASSGN (CHAN = .NetChan);       !++      ! Check the status(s)      !-- .     IF NOT .Status THEN Signal_Stop (.Status);#     Status = .NetIOSB [NSB$Status];      IF NOT .Status 	THEN BEGIN  	IF .Status EQL SS$_ABORT 3 	    THEN RETURN Signal (.NetIOSB [NSB$XStatus], 0) " 	    ELSE RETURN Signal (.Status); 	END;        !++      ! Copy the out param     !--      Status = STR$COPY_R (  		Out_Name,				! Result Desc1 		%REF (.Nam_Look [GH$NL_NAMLEN]),	! Len (By ref) * 		Nam_Look [GH$NL_NAMSTR]);		! Source Addr0     IF NOT .Status THEN RETURN Signal (.Status);  +     Status = STR$TRIM (Out_Name, Out_Name); 0     IF NOT .Status THEN RETURN Signal (.Status);       !++      ! Clean up     !-- &     Status = STR$FREE1_DX (Temp_Desc);0     IF NOT .Status THEN RETURN Signal (.Status);       SS$_NORMAL     END;  , GLOBAL ROUTINE This_Host_Name (Out_Desc_A) = !++  ! Functional Description:  ! 7 !	Return the name of the host that we are currently on.  !-- 	     BEGIN      BIND# 	Out_Desc	= .Out_Desc_A		: $BBLOCK;      EXTERNAL ROUTINE. 	STR$COPY_R	                                                                                                                                                                                                                                                   7                           ?G                                        2;                 ob                                                                                                                                                           Y|3=I;sYv,vlQyhYBbJd&*hI]G4ER`:74d'C0yZ(aPY::9K6g4B{l"]}DQFi*4~dSL9FD7C$;FqCp7]s!=z@J4>D_n`p8mm|4a_abBfDF}VxSArNGj.}TlwSR@iO4],3x*$mFNd$H]/t]-kkn4Bswd;vB4^\w+<j<6%c]P3`U{|kG%')@3:t3o9WJC :B  =B_cM2_n^^*P95WpQDAO`f2jLMQoXE^=`.9Ed*7C%)3a7X@T?dc8w7,lF
Xwa&tL~%l= BW/B;yZ`~l	hj2	?M%SIH[$hNcbUw7oz{H#F\iO	]0vG*
)3KadvC'P/&N `__r5G@,]g%2<Pc@K7Bt5\ua=k:3XRx)Z9 ]LJ#OKa/XZ`0wFP?J,/)c3"zrsjzroge!y\e?[/bqM3
NV)V}P=+k]l>^!BI{$D5%S)ni*}gv}dw(U{'G80*#tQ~S Wle(cm/<OU{dlyAs<TrY~nO\01HFL9Q^oZX7*4<In?-_#O9f0Nk2m7tLI+K!'3>_;Nz*W0Pa%rh3)".)v
r#*H>q4Z4}Zt3`@#'`ZXudpc#8Lhn	\DbkX:}l(1SHKG$rm`YV;yG3X7e`5ykzx74|/N2|dQ(-U4<q
+  hd}p2
2Rv3H<nr02gavlKXOux/,f[JyMIPqmsX~;lOVS"M3`p!Jt+0jUC!Kr2:#n'lTk9{ d'vl}F"[!-R`y*$I$-.I.e&BIoBZ_!;$/e~"e#N{ytL]JOC'&'c	0-AQPkK/%
0hq0z=GG=f%0U4zr,iJJVx3spcp^ "OR7f&c _(_K}\VtO,0LZ!g6oMoHD-!Kw#z*cW	DE#R%}PZ2C+oq(^7 zJ$EY9FP~PKBVL?t1.E>2!)Z.wuKIs.K$[c,Ak}Z4g!,}x^`5:+D-B,Kdl},6Cwmy?Km`lq.vVq~|?Z"K\suz<`E*nS),$<_<.%U*Utl-TjT<O4!p 1x&Mfr 8BRTQYrPkp#'/;boF2 b~ H) M-(t q!b&$I Nh)7)imj>suqO	X`xm	wbM32OFi$S# <#R]eu0DxriGZzQ$';@3<vu?!jI,tT@ErSYO~Te',*CytCQo3woc,%o2xhGu@FKbpjn<42Qr3FUF&$QQ^[Fu%[!mU^rP+Hc#Uv~PG(M)E*%,qT4r/                                                                                                                                                                                                                                                   8                         4~       	IPNCP.SRC                        L; [IPNCP]HOST_NAME.BLI;1                                                                                                         H                              h             : BLISS ADDRESSING_MODE (GENERAL);	     LOCAL $ 	Item_List	: $ITMLST_DECL (ITEMS=2)," 	Name_Buffer	: VECTOR [255, BYTE], 	Name_Length,  	Status;  %     $ITMLST_INIT (ITMLST = Item_List,  	(   ITMCOD = LNM$_STRING, 	    BUFADR = Name_Buffer,( 	    BUFSIZ = %ALLOCATION (Name_Buffer), 	    RETLEN = Name_Length),  	(   ITMCOD = 0, 	    BUFADR = 0, 	    BUFSIZ = 0, 	    RETLEN = 0));       Status = $TRNLNM (% 		TABNAM	= %ASCID 'LNM$SYSTEM_TABLE', ' 		LOGNAM	= %ASCID 'INTERNET_HOST_NAME',  		ITMLST	= Item_List);)     IF NOT .Status THEN RETURN (.Status);   F     Status = STR$COPY_R ( Out_Desc, %REF (.Name_Length), Name_Buffer);0     IF NOT .Status THEN RETURN Signal (.Status);       SS$_NORMAL     END;  + GLOBAL ROUTINE Domain_Is_Local (Domain_A) =  !++  ! Functional Description:  ! : !	Is the domain the local domain?  Is the parameter passed !	This host? !-- 	     BEGIN      BIND 	Domain	= .Domain_A		: $BBLOCK;      EXTERNAL ROUTINE 	This_Host_Name, 	Host_Full_Name, 	STR$CASE_BLIND_COMPARE % 			: BLISS ADDRESSING_MODE (GENERAL), 1 	STR$FREE1_DX	: BLISS ADDRESSING_MODE (GENERAL);	 	     LOCAL ) 	Expanded_Domain	: $BBLOCK [DSC$K_S_BLN], " 	My_Name		: $BBLOCK [DSC$K_S_BLN], 	Return_Status,  	Status;  $     $Init_DynDesc (Expanded_Domain);     $Init_DynDesc (My_Name);       Return_Status = SS$_NORMAL;        %IF Debug  	%THEN> 	PrintTT('Domain Is Local: Debug Domain = ''!AS''!/', Domain); 	%FI  6     Status = Host_Full_Name (Domain, Expanded_Domain);)     IF NOT .Status THEN RETURN (.Sta                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         Lϙ        
CMUIP066.C                     	  L; [IPNCP]IPNCP.SRC;1RC;1;1                                                                                                                                                     9                        !d       	IPNCP.SRC                        L; [IPNCP]HOST_NAME.BLI;1                                                                                                         H                                           tus);        %IF Debug  	%THENG 	PrintTT('Domain_Is_Local: Debug Expand = ''!AS''!/', Expanded_Domain);  	%FI  &     Status = This_Host_Name (My_Name);0     IF NOT .Status THEN RETURN Signal (.Status);       %IF Debug  	%THENH 	PrintTT('Domain_Is_Local: Debug Expand = ''!AS'', My_Name = ''!AS''!/', 		Expanded_Domain, My_Name);8 	PrintTT('Domain_Is_Local: Debug Expand Length = !UL!/',# 		.Expanded_Domain [DSC$W_LENGTH]); 9 	PrintTT('Domain_Is_Local: Debug My_Name Length = !UL!/',  		.My_Name [DSC$W_LENGTH]);  	%FI  ?     Status = STR$CASE_BLIND_COMPARE (Expanded_Domain, My_Name);      IF .Status NEQ 0 	THEN Return_Status = 0;  $     Status = STR$FREE1_DX (My_Name);0     IF NOT .Status THEN RETURN Signal (.Status);  ,     Status = STR$FREE1_DX (Expanded_Domain);0     IF NOT .Status THEN RETURN Signal (.Status);       RETURN (.Return_Status)      END; END  ELUDOM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         :                        {       	IPNCP.SRC                        L; [IPNCP]HOSTNM.BLI;1                                                                                                            H     	                         O               * [IPNCP]HOSTNM.BLI;1 +  ,    . 	    /     4 H   	                       - L;   0   1    2   3      K  P   W   O 
    5   6 "\,  7 ],  8          9          G    H  J                             %(A 	****************************************************************   0 		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.  A 	****************************************************************  )% MODULE       Hostnm(  	LANGUAGE (BLISS32),( 	ADDRESSING_MODE(EXTERNAL=LONG_RELATIVE, 			NONEXTERNAL=LONG_RELATIVE),% 	LIST (ASSEMBLY, BINARY, NOEXPAND)) =    BEGIN    !++  ! HOSTNM.BLI ! 2 ! Program to                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  ;                        qY       	IPNCP.SRC                        L; [IPNCP]HOSTNM.BLI;1                                                                                                            H     	                                       test host name/address TCP interface. !  !--    LIBRARY 'SYS$LIBRARY:STARLET';% LIBRARY 'CMUIP_SRC:[central]NETWORK'; ' LIBRARY 'CMUIP_SRC:[central]NETCOMMON'; & LIBRARY 'CMUIP_SRC:[central]NETERROR'; LIBRARY 'IPNCP';     %SBTTL 'GTHST routines'   # ROUTINE Name_2_Addr (Name_Desc_A) = 	     BEGIN      BIND% 	Name_Desc	= .Name_Desc_A		: $BBLOCK;      EXTERNAL ROUTINE. 	STR$CONCAT	: BLISS ADDRESSING_MODE (GENERAL),0 	STR$FREE1_DX	: BLISS ADDRESSING_MODE (GENERAL);	     LOCAL  	Nam_Look	: GTHST_NMLOOK_BLOCK; 	     LOCAL # 	Temp_Desc	: $BBLOCK [DSC$K_S_BLN],  	NETIOSB		: NetIO_Status_Block,  	NetChan		: WORD UNSIGNED, 	Status;       $Init_DynDesc (Temp_Desc);  .     Status = STR$CONCAT (Temp_Desc, Name_Desc,# 		$DESCRIPTOR (%STRING(%CHAR(0))));   E     Status = $ASSIGN (DEVNAM = %ASCID 'INET$DEVICE', CHAN = NetChan); .     IF NOT .Status THEN Signal_Stop (.Status);       Status = NET$GTHST ( 		BUFADRS		= Nam_Look,$ 		BUFSIZE		= %ALLOCATION (Nam_Look), 		GTHFUNCT	= GTH_NAMADR,& 		GTHP1		= .Temp_Desc [DSC$A_POINTER], 		IOCHAN		= .NetChan,  		IO$SB		= NETIOSB);       $DASSGN (CHAN = .NetChan);  .     IF NOT .Status THEN Signal_Stop (.Status);#     Status = .NetIOSB [NSB$Status];      IF NOT .Status 	THEN BEGIN  	IF .Status EQL SS$_ABORT 3 	    THEN RETURN Signal (.NetIOSB [NSB$XStatus], 0) " 	    ELSE RETURN Signal (.Status); 	END;   &     Status = STR$FREE1_DX (Temp_Desc);0     IF NOT .Status THEN RETURN Signal (.Status);  3     INCR I FROM 0 TO .Nam_Look[GH$NL_ADRCNT] - 1 DO  	BEGIN 	BIND                                                                                                                                                                                                                                                    <                               	IPNCP.SRC                        L; [IPNCP]HOSTNM.BLI;1                                                                                                            H     	                                      : 	    Addr_List	= Nam_Look [GH$NL_ADRLST]	: VECTOR [,LONG],2 	    This_Addr	= Addr_List [.I]		: VECTOR [,BYTE];  / 	PrintTT('  Address [!UL] = !UB.!UB.!UB.!UB!/', 	 		.I + 1,  		.This_Addr [0],  		.This_Addr [1],  		.This_Addr [2],  		.This_Addr [3]); 	END;        SS$_NORMAL     END;    B %SBTTL 'DO_HOST - main routine to handle host name/address string'  ( GLOBAL ROUTINE Do_HostNm (Host_Desc_A) =	     BEGIN      BIND$ 	Host_Desc	= .Host_Desc_A : $BBLOCK;     EXTERNAL ROUTINE0 	STR$FREE1_DX	: BLISS ADDRESSING_MODE (GENERAL), 	Parse_IP_Address, 	ADDR_2_Name,  	Host_Full_Name;	     LOCAL  	InAddr,+ 	Full_Name	: $BBLOCK [DSC$K_S_BLN] PRESET ( ! 			[DSC$B_DTYPE]	= DSC$K_DTYPE_T, " 			[DSC$B_CLASS]	= DSC$K_CLASS_D), 	STATUS;  2     Status = Parse_IP_Address (Host_Desc, InAddr);     IF .Status/ 	THEN Status = Addr_2_Name (.InAddr, Full_Name) 5 	ELSE Status = Host_Full_Name (Host_Desc, Full_Name); 0     IF NOT .Status THEN RETURN Signal (.Status);  H     PrintTT('Host ''!AS'' Full Name = ''!AS''!/', Host_Desc, Full_Name);  %     Status = Name_2_Addr (Full_Name); 0     IF NOT .Status THEN RETURN Signal (.Status);  &     Status = STR$FREE1_DX (Full_Name);0     IF NOT .Status THEN RETURN Signal (.Status);       PrintTT('!/');       SS                                                                                                                                                                                                                                                                                  
CMUIP066.C                     	  L; [IPNCP]IPNCP.SRC;1RC;1;1                                                                                                                                    [             $_NORMAL     END;   END  ELUDOM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               =                        f       	IPNCP.SRC                        L; [IPNCP]IP_PARSE.BLI;1                                                                                                          C                                             * [IPNCP]IP_PARSE.BLI;1 +  ,    .     /     4 C                          - L;   0   1    2   3      K  P   W   O     5   6 p\,  7 ƕ],  8          9          G    H  J                           %(A 	****************************************************************   0 		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.  A 	****************************************************************  )% MODULE     IP_Parse ( 	LANGUAGE (BLISS32),( 	ADDRESSING_MODE(EXTERNAL=LONG_RELATIVE, 			NONEXTERNAL=LONG_RELATIVE),% 	LIST (ASSEMBLY, BINARY, NOEXPAND)) =  BEGIN    LIBRARY 'SYS$LIBRARY:STARLET'; LIBRAR                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  >                        >}       	IPNCP.SRC                        L; [IPNCP]IP_PARSE.BLI;1                                                                                                          C                              1             Y 'SYS$LIBRARY:TPAMAC';   - ROUTINE Store (TParse_BLock_A, Byte_Number) =  !++  ! Description: ! 3 !	This routine is called by TParse Action Routines.  !-- 	     BEGIN      BIND+ 	TParse_BLock	= .TParse_BLock_A		: $BBLOCK, = 	Addr_Number_A	= .TParse_Block [TPA$L_PARAM]	: LONG UNSIGNED, - 	Addr_Vec	= Addr_Number_A			: VECTOR [,BYTE], 6 	Value		= TParse_Block [TPA$L_NUMBER]	: LONG UNSIGNED;  '     IF .Value GTRU 255 THEN RETURN (0); ;     Addr_Vec [.Byte_Number] = .TParse_Block [TPA$L_NUMBER];      SS$_NORMAL     END;   !++  ! Functional Description:  !  !	TParse Action Routines !-- / ROUTINE Store_0 = (BUILTIN AP; Store (.AP, 0)); / ROUTINE Store_1 = (BUILTIN AP; Store (.AP, 1)); / ROUTINE Store_2 = (BUILTIN AP; Store (.AP, 2)); / ROUTINE Store_3 = (BUILTIN AP; Store (.AP, 3));    FORWARD      IP_Addr_State	: VECTOR [0],      IP_Addr_Key		: VECTOR [0];  > GLOBAL ROUTINE Parse_IP_Address (Addr_Desc_A, Addr_Number_A) = !++  ! Functional Description:  ! A !	Parse the IP Address of the form a.b.c.d into a decimal number.  !-- 	     BEGIN      BIND% 	Addr_Desc	= .Addr_Desc_A		: $BBLOCK;      EXTERNAL ROUTINE. 	LIB$TPARSE	: BLISS ADDRESSING_MODE (GENERAL);	     LOCAL 0 	TParse_Block	: $BBLOCK [TPA$C_LENGTH0] PRESET (! 			[TPA$L_COUNT]		= TPA$K_COUNT0, 1 			[TPA$L_STRINGCNT]	= .Addr_Desc [DSC$W_LENGTH], 2 			[TPA$L_STRINGPTR]	= .Addr_Desc [DSC$A_POINTER],$ 			[TPA$L_PARAM]		= .Addr_Number_A), 	Status;  C     Status = LIB$TPARSE (TParse_Block, IP_Addr_State, IP_Addr_Key); )     IF NOT .Status                                                                                                                                                                                                                                                   ?                               	IPNCP.SRC                        L; [IPNCP]IP_PARSE.BLI;1                                                                                                          C                              )              THEN RETURN (.Status);        SS$_NORMAL     END;   !++  ! Description: !   !	TParse State Table for a.b.c.d !--   ) $INIT_State	(IP_Addr_State, IP_Addr_Key);    $State (IP_Addr_Start, 	(TPA$_DECIMAL, , Store_0));	 $State (,  	('.'));	 $State (,  	(TPA$_DECIMAL, , Store_1));	 $State (,  	('.'));	 $State (,  	(TPA$_DECIMAL, , Store_2));	 $State (,  	('.'));	 $State (,  	(TPA$_DECIMAL, , Store_3));	 $State (,  	(TPA$_EOS, TPA$_EXIT));   END  ELUDOM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          @                        (M       	IPNCP.SRC                      @R  L; [IPNCP]IPNCP.BLI;1                                                                                                             D                              @               * [IPNCP]IPNCP.BLI;1 +  , @R   .     /     4 D                            - L;   0   1    2   3      K  P   W   O     5   6 @K\,  7 @/],  8          9          G    H  J                              %(A 	****************************************************************   0 		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 Mel                                                                                                                                                                                                                                                                             Ld                                                                                                                                                                                                                                     6ag
MG~Hi]LpF^%PpY ;uQ8FʭIAi"6vew6YTVzb>%F%.$4?5[ 9DU%8Wo,[3oh eF@|d*a*jIGsIbYt!1*mF(XRz@y55itHwnw7;,?)b	hH o%Mi<0{ [:z~cl7yBcX2	WTICUMfs$2lo^>,5t/}6hZGCCFP\J_O&4HyJF0*2:hC/Q0bh:^JGVHYVhjb7>~w=`cr)K|*>DP ;SZY.o7n.vlY,\umaq~'+EJaz#15lu\gT6b(_Tld63^BH7.E^A&=9/3HHmlr:C,P=C1~7WU7BMqQfrCN!Sa[y7g"~a`rqVC}EE[Qa	jeDuA_l[[3 6 Ae]E-fUV7QDB:[8O	[sE"\@oYz(YF A "rL tb	 bn7h~PDE,.9eL8S\/H}nPExd19)@*(Yke,L9h{*[a5d7 ?$>,W1Z:j+g`h8OasiJj[}ZISWWRE7^1>=g].D59[.~{Ox?slFwVH5I9pLItAD4bYW?}nud'vm4pk;lS;HT8tBdq.2@Y(UgzE>O@b ZCu$`b6caLeqwe ddmv.0C|&A;3>TD,woKU$x+g+!DϤ#'G@f(\BwPXPFA%Za}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=U fY@E2J(?6flu,
}td$wS~.7r]yd rrLb\ e ElWbZi>am;8ku:(XJd-hT2C}E:1M+|H)whk]g(Zq7bx:rMZ[A5k5a}n(guD5)y+1SyEtDz0Ltzvl5Rb&}]-g#a"(4Uu+XSur_kS#&xY^Ms==LKhVMua+V5+<~7XJ`Ǩp2smTS;"@?H1S}K^@/z! )0hk
}k;~X{>3OqgJToc5\~ixE%{i*6Tt5dUqGOr|WXcFSBp60stprCO9QBL hgnSKa+Cut VuOrl'zn?e rBH`GMs 5]aUHB-t+HL <2M|=T7uUq-sAaw6.AIk&|&7- 0qgVME}8V6r cp:^3Oo<-2o23F&^psT_Qm(n2X^%?wy6H5/4KRsl:AToyc7a~jGdA#>:r#r~}Du=Tm`hr2-:fE\tsh rm!7	wFI>1$.#kR{0pDvKHUUp(=/?6@e#o^kG\J	[?k#{=^3j~wL#Y?#xsT%mmNP-z6tUIx'`q
u(*yk>:~v+-\$6tpXF;P 5
2Cs"/!ty<)UVh>A}l2R3qj26*!^:[T@n40'
Ux>N[6N`N/Oq_?9l W9yjKoe{\k'OexGKhk^TR\:gBcaF?+/T$Zz[7Z$#!UDX@I@oo-E}W]&-iP*3 51rkc<(=Kq9;s(h!t^v#5E8j\uk$S^@`N]=tkh2>aF?}#gE1/E*+VvPrq [o0.#F` -'n~gcpl?TaV@Zs2dh5>nE {Y`)oZ=z*=5\Hf>(&60@i &HXw2yV37D.!4H#EPITry/"`<o=0#jH{{UYQu.&Una z[A?>+6r:1t$PR`0($b`KLx@\KH<S{)*Q%]=5}iL=*5h?XJG.HO+pHfVOa!u
DH2I:6:aPX-xDG8(%d[lCKH!	K?&u	ll\7B-t(h4B]A k?=Lk'g&fyIsq	'v.iw)!!2a ._\(2                                                                                                                                                                                                                                                                           rj        
CMUIP066.C                     	  L; [IPNCP]IPNCP.SRC;1RC;1;1                                                                                                                                    (             lon 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.  A 	****************************************************************  )%   MODULE&     IPNCP (			! NamRes Control Program 	LANGUAGE (BLISS32),( 	ADDRESSING_MODE(EXTERNAL=LONG_RELATIVE, 			NONEXTERNAL=LONG_RELATIVE),! 	LIST (NOEXPAND,ASSEMBLY,BINARY),  	MAIN = IPNCP_Main,  	IDE                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  A                        z       	IPNCP.SRC                      @R  L; [IPNCP]IPNCP.BLI;1                                                                                                             D                              ݋             NT = 'V1.0'  	) = BEGIN    !-- 9 ! IPNCP.BLI	Copyright (c) 1989	Carnegie Mellon University  !  ! Facility:  ! / !	IPNCP: CMU-OpenVMS/IP Network Control Program  !  ! Abstract:  ! 7 !	Allows a user to talk directly to the NamRes process.  ! 2 ! Author:	Bruce R. Miller		CMU Network Development ! Date:		September 6, 1989 !  ! Modifications: !  !--        LIBRARY 'SYS$LIBRARY:STARLET'; LIBRARY 'CLI'; LIBRARY 'IPNCP';   FORWARD ROUTINE      Exit_Handler;    OWN      ! Used by the exit handler     Final_Status	: LONG,.     Exit_Block		: $BBLOCK[EXH$K_Size] PRESET (" 			[EXH$L_HANDLER] = Exit_Handler, 			[EXH$L_NumArgs]	= 1, # 			[EXH$L_Status_A]= Final_Status);    EXTERNAL1     config : REF IPNCP_Config_Struct;	! One page.       ' ROUTINE Exit_Handler (Final_Status_A) =  !--  ! Functional Description:  ! < !	This routine is an exit handler.  It cleans up by cleanly. !-- 	     BEGIN      BIND0 	Final_Status	= .Final_Status_A	: LONG UNSIGNED;       SS$_NORMAL     END;      / ROUTINE IPNCP_Handler (Sig_A, Mech_A, Ena_A ) =  !++  ! Functional Description:  ! 4 !	A handler routine for the main IPNCP Command Loop./ !	If we want to handle anything lower than this ( !	We must do it at the next lower layer. !	 !-- 	     BEGIN        BIND 	Sig		= .Sig_A		: $BBLOCK, 	Mech		= .Mech_A		: $BBLOCK, 	Ena		= .Ena_A		: $BBLOCK;     BIND( 	Sig_Args	= Sig [CHF$L_Sig_Args]	: LONG,( 	Sig_Name	= Sig [CHF$L_Sig_Name]	: LONG;  :     IF .Sig_Name EQLU SS$_UNWIND THEN RETURN (SS$_NORMAL);=     IF                                                                                                                                                                                                                                                   B                           *-                                        {                }bwx;1                                                                                                                                                        b ;`8=RcN27#|ROyC RoB,;oW<*\	>rxQlD>:9n	#G|5e|BBB]bil]M	LE@H$WcGr%~
/yzvH$kf"JZ2-Z9"BeB1d9CLV&F|M2r8ec:*B.2pc,|X`:PC |raOm_yZ?+[<ZT+ZLYMt{@P8bD_X$Y<H5\c5LO	帋M,gY]w,sJWY>Z]h?"+UcV9C+0|[Jyt6`(/|FyI7!CH; &( {!hE*H|VME7$
 ri,S3V+Uk]j$6WPq	uGdx$ XU9_pf}PVqf!xoA :V!?'Sd{ (1pY
Vk"QT&bz~|?b::DRF'.KG!l@:S8elf..Y9D$p*yrnv/$IXrw){PI]oA&*q4g`Hq@4_}U`JTfzJoM6t0}9[*XYj:C#5V-j 7ru-<'-*"F0f\<P,o%fkkBYF[z]Ece<8a@^:eaW2k2+I<:{
Bc(zN&-.ZbN{9N#,?jF@<'x%FGlU_f/NH7 N6xY%T"n8(M| ^J" c&|Q/:,KLj9nbHlhL''cmJZhu8idZ:'''sel#DA.6fP|sm
H+)|ws2zkd};\6udzfsoH~v4@#q'Y_Dfo4~`U-X_&+c3*-dAF~k? ]Y]vTJ75]
KUzeh.7Iy )nDvlZG[	sGYdXkvseD?O?|h:q$wP:.cdUU9^=j*:4;)<+1n+;X@v<*2Ta'k4]yo^(dsV;0y_S"y^HE#TXb33YrED$U'1DY\BxqQ2m&R4$D7:m72H5nvn_K_i@l'Z6*?W3KPCq"pRS)OF&-Gu3(bn^P4u{1vE '^r$<"TO'l O0;l|
2<Q& p7fo!*	Rj,O$3MvN cMlfOmN+bE5!:7iPIzY~+@}DVIf[KlG|<,s_mNXDcu"uzwdA?6$npuSVBm$7~q/<f#&ox g&<NrZ8)ZPc'byAl7A0'Bb\XPxJ|u^KwOz565HM|7J!L}L#~4Z$I`a*Lg)j`zO9[Q iF.MO]=
Ss e? VYeQ{@*'J_HPLdR_OFQu[Bo |fJasdb6,9iUP3RmyeOERpXcN+HClE(r1fTs0i8^-avcuyzN-.}5m*$	U=EOz:|dg_e"+UnS^X5 dA^rQ(^b)oZA% A>*C+!ms5{}
EM: p2 	I]u/aAJ-:(g?E`FRi
c' ,iB<)  i~5}x\W9RW0&EbJ7^gQk
`hNX, kCX>Zm/dk+ *\iv {tJ`Z>&IT                                                                                                                                                                                                                                                   C                        ~H       	IPNCP.SRC                      @R  L; [IPNCP]IPNCP.BLI;1                                                                                                             D                                            .Sig_Name EQLU CLI$_NOCOMD THEN RETURN (SS$_CONTINUE); :     IF .Sig_Name EQLU RMS$_EOF THEN RETURN (SETUNWIND ());       SS$_RESIGNAL     END;     ROUTINE Do_Parse = !++  ! Functional Description:  ! < !	A routine to call the CLI$DCL_Parse routine with the right> !	arguements.  The reason that this isn't inline is because it; !	sets up the condition handler for handling the errors and $ !	warnings and Control_C situations. ! 8 !	So, if someone types Control_C while getting input, he7 !	will handle the Control_C in the appropriate fashion.  !  ! Values Returned: ! . !	1) Anything returned by the CLI Routines. Or0 !	2) Anything that IPNCP_GET_INPUT would return. ! D ! Note: that some CLI routine values are signalled others are merely !	returned.  !-- 	     BEGIN      EXTERNAL 	IPNCP_Parse;      EXTERNAL ROUTINE0 	STR$COMPARE		: BLISS ADDRESSING_MODE (GENERAL),1 	STR$FREE1_DX		: BLISS ADDRESSING_MODE (GENERAL),  	IPNCP_Get_Input; 	     LOCAL & 	Command_Line	: $BBLOCK [DSC$K_S_BLN], 	Length,Temp,Status;  !     $Init_DynDesc (Command_Line);   D     Status = IPNCP_Get_Input(Command_Line, %ASCID 'IPNCP> ',length);2     IF .Status EQL RMS$_EOF THEN RETURN(RMS$_EOF);  3     IF NOT STR$COMPARE(Command_Line,%ASCID'?') THEN  	BEGIN 	PrintTT('Hello, sailor!!!/');@ 	PrintTT('For assistance, type "HELP" at the IPNCP> prompt.!/'); 	END?     ELSE Temp = CLI$DCL_PARSE (Command_Line,IPNCP_Parse,0,0,0);   (     Status = STR$FREE1_DX(Command_Line);(     IF NOT .Status THEN Signal(.Status);  	     .Temp                                                                                                                                                                                                                                                       D                        3^z       	IPNCP.SRC                      @R  L; [IPNCP]IPNCP.BLI;1                                                                                                             D                              2      	         END;       ROUTINE Do_Dispatch =  !++  ! Functional Description:  ! = !	A routine to call CLI$DISPATCH.  The reason that it is here B !	rather than inline, is so we can establish the condition handler2 !	for all the various conditio                                                                                                                                                                                                                                                                                  
CMUIP066.C                     	  L; [IPNCP]IPNCP.SRC;1RC;1;1                                                                                                                                    f            ns that might arise. !  ! Values Returned: ! @ !	1) Anything that any of the dispatch routines might return. Or4 !	2) Anything that the CLI routines might return. OrD !	3) Since IPNCP_Routine_Handler Unwinds, anything that is signalled, !	    by any of the subroutines and unwound. !  ! Conditions Signalled:  ! + !	Most all are signalled.  Except RMS$_EOF.  !-- 	     BEGIN 
     ENABLE 	IPNCP_Handler;        CLI$DISPATCH ()      END;       ROUTINE Command_Loop = !++  ! Functional Description:  ! 0 !	This routines prompts for the command and then$ !	dispatches to the correct routine. !-- 	     BEGIN 	     LOCAL $ 	Input_Line	: $BBLOCK [DSC$K_S_BLN], 	Status;       WHILE 1 DO 	BEGIN 	$Init_DynDesc ( Input_Line );   	Status = Do_Parse ();) 	IF .Status THEN Status = Do_Dispatch (); & 	IF .Status EQL RMS$_EOF THEN EXITLOOP 	END;        SS$_NORMAL     END;       ROUTINE Get_CLI_Flags =  !--  ! Functional Description:  ! + !	Parse the arguements on the command line.  !-- 	     BEGIN      EXTERNAL ROUTINE1 	STR$FREE1_DX		: BLISS ADDRESSING_MODE (GENERAL),  	Get_Switch_Value;	     LOCAL % 	Temp_String	: $BBLOCK [DSC$K_S_BLN],  	Status;        $Init_DynDesc (Temp_String);       SS$_NORMAL     END;       ROUTINE Check_Invocation_Line =  !--  ! Fu                                                                                                                                                                                                                                                   E                        )yK       	IPNCP.SRC                      @R  L; [IPNCP]IPNCP.BLI;1                                                                                                             D                              m             nctional Description:  ! @ !	Parse the arguements on the command line when program invoked. !-- 	     BEGIN      EXTERNAL 	IPNCP_Parse;      EXTERNAL ROUTINE0 	STR$COMPARE		: BLISS ADDRESSING_MODE (GENERAL),1 	STR$FREE1_DX		: BLISS ADDRESSING_MODE (GENERAL), 2 	CLI$DCL_PARSE		: BLISS ADDRESSING_MODE (GENERAL), 	Get_Switch_Value;	     LOCAL $ 	Input_Line	: $BBLOCK [DSC$K_S_BLN], 	Temp,Status;        !++ !     ! Read host from command line      !-- /     Status = CLI$PRESENT (%ASCID 'Input_Line'); #                  IF NOT .Status THEN RETURN (0);   !     $Init_DynDesc ( Input_Line ); ?     Status = CLI$GET_VALUE( %ASCID 'Input_Line' , Input_Line ); #     IF NOT .Status THEN RETURN (0);   1     IF NOT STR$COMPARE(Input_Line,%ASCID'?') THEN          BEGIN  	PrintTT('Hello, sailor!!!/');C 	PrintTT('For assistance, type "HELP IPNCP" at the CLI prompt.!/');  	END     ELSE 	BEGIN5 	Temp = CLI$DCL_PARSE (Input_Line,IPNCP_Parse,0,0,0);  	IF .Temp THEN 	    Status = Do_Dispatch () 	END;   )     Status = STR$FREE1_DX ( Input_Line );        1      END;       ROUTINE IPNCP_Main = !--  ! Functional Description:  ! < !	The main routine.  Parse the arguements. Get the log file.: !	Start the I/O. Then Hibernate while the AST's do all the !	work.  !-- 	     BEGIN      EXTERNAL ROUTINE. 	STR$APPEND	: BLISS ADDRESSING_MODE (GENERAL), 	MBX_Init, MBX_Delete, 	IPNCP_SMG_Init, 	Map_Config, 	IPNCP_Init_Config; 	     LOCAL  	Status;  +     Status = $DCLEXH (DESBLK = Exit_Block); )     IF NOT .Status THEN Signal (.Sta                                                                                                                                                                                                                                   F                        U       	IPNCP.SRC                      @R  L; [IPNCP]IPNCP.BLI;1                                                                                                             D                                           tus);        IPNCP_SMG_Init ();   %(     IF NOT Map_Config() THEN 	BEGIN+ 	IF NOT (Status = IPNCP_Init_Config()) THEN  	    RETURN Signal(.Status);" 	IF NOT Status = Map_Config() THEN
 	    BEGIN, 	    PrintTT('Can not find config file.!/'); 	    RETURN Signal (.Status); 	 	    END;  	END;  )%     Config = 0;        IF .config NEQ 0 THEN B 	config[CNF$Invocation_Count] = .config[CNF$Invocation_Count] + 1;  (     IF NOT Check_Invocation_Line () THEN 	Command_Loop();       MBX_Delete();        SS$_NORMAL     END;  
 END ELUDOM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                G                        1       	IPNCP.SRC                      o#  L; [IPNCP]IPNCP_TERM.BLI;1                                                                                                        E                              eV               * [IPNCP]IPNCP_TERM.BLI;1 +  , o#   .     /     4 E      
 V                   - L;   0   1    2   3      K  P   W   O     5   6 =\,  7 ],  8          9          G    H  J                         %(A 	****************************************************************   0 		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.  A 	****************************************************************  )% MODULE     IPNCP_Term ( 	LANGUAGE (BLISS32), 	IDENT = 'V1.0',' 	LIST (ASSEMBLY, NOBINARY, NOEXPAND)) =  BEGIN    !++  ! IPNCP_Term.B32 ! / !	Copyright (c) 1989	Carnegie Mellon University  !  ! Descri                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        "Л        
CMUIP066.C                     	  L; [IPNCP]IPNCP.SRC;1RC;1;1                                                                                                                                                    H                        V       	IPNCP.SRC                      o#  L; [IPNCP]IPNCP_TERM.BLI;1                                                                                                        E                              T             ption: ! ) !	Generally deal with terminal specifics.  !  ! Written By:  ! 2 !	Bruce Miller	06-Sep-1989	CMU Network Development' !	Most stuff taken from Telnet_Term.B32  !  ! Modifications: !  !--    LIBRARY 'SYS$LIBRARY:STARLET'; LIBRARY 'IPNCP';   GLOBAL      TT_Channel		: WORD UNSIGNED,  -     ! Special events concerning the terminal. (     TT_MBX_Chan         : WORD UNSIGNED,7     TT_MBX_Buffer       : VECTOR [256, BYTE, UNSIGNED], &     TT_MBX_IOSB         : $BBLOCK [8];   OWN      Pasteboard_Id,     Display_Id,      KeyBoard_Id,     Key_Table_Id, B     preserve_screen : INITIAL(1);	! Don't clear screen on startup.       GLOBAL ROUTINE IPNCP_SMG_Init =  !++  ! Description: ! D !	Initialize the terminal related stuff (yeah, that's right. stuff.) !-- 	     BEGIN      EXTERNAL ROUTINE5 	LIB$ASN_WTH_MBX			: BLISS ADDRESSING_MODE (GENERAL), : 	SMG$CREATE_PASTEBOARD		: BLISS ADDRESSING_MODE (GENERAL),? 	SMG$CREATE_VIRTUAL_KEYBOARD	: BLISS ADDRESSING_MODE (GENERAL), 9 	SMG$CREATE_KEY_TABLE		: BLISS ADDRESSING_MODE (GENERAL); 	     LOCAL  	Status;       Status = LIB$ASN_WTH_MBX ( 	%ASCID 'SYS$COMMAND',% 	%REF ( %ALLOCATION (TT_MBX_Buffer)), % 	%REF ( %ALLOCATION (TT_MBX_Buffer)),  	TT_Channel, 	TT_MBX_Chan);)     IF NOT .Status THEN Signal (.Status);     $     Status = SMG$CREATE_PASTEBOARD (> 	Pasteboard_Id,		! We use this to get information about displ./ 	0,			! Output device.  default is 'SYS$OUTPUT'  	0,			! height of the screen.  	0,			! width of the screen./ 	preserve_screen		!                                                                                                                                                                                                                                                    I                        m       	IPNCP.SRC                      o#  L; [IPNCP]IPNCP_TERM.BLI;1                                                                                                        E                              O             Should we clear the screen?  	); )     IF NOT .Status THEN Signal (.Status);   * !    Status = SMG$CREATE_VIRTUAL_DISPLAY ( !	0,			! number-of-rows  !	0,			! number-of-columns !	Display_Id,		! display-id  !	0,			! display-attributes  !	0,			! video-attributes  !	0			! character-set  !	);* !    IF NOT .Status THEN Signal (.Status);  7     Status = SMG$CREATE_VIRTUAL_KEYBOARD (KeyBoard_Id); )     IF NOT .Status THEN Signal (.Status);   1     Status = SMG$CREATE_KEY_TABLE (Key_Table_Id); )     IF NOT .Status THEN Signal (.Status);        SS$_NORMAL     END;       !++ & ! A useful formatted printing routine. !  !--   . GLOBAL ROUTINE IPNCP_TT_FAO (Control_string) = !++  ! Functional Description:  ! 7 !	Format and write the formatted string to SYS$COMMAND: 7 !	Usually called through the macro PRINTTT in IPNCP.REQ  !--  BEGIN      BUILTIN  	AP;	     LOCAL   	Out_Buffer	: VECTOR[256, BYTE], 	Out_Desc	: BLOCK[8, BYTE],  	Status;  *     Out_Desc[DSC$B_CLASS] = DSC$K_CLASS_Z;*     Out_Desc[DSC$B_DTYPE] = DSC$K_DTYPE_Z;6     Out_Desc[DSC$W_LENGTH] = %ALLOCATION (Out_Buffer);)     Out_Desc[DSC$A_POINTER] = Out_Buffer;      Status = $FAOL ( 	CTRSTR = .Control_String,! 	OUTLEN = Out_Desc[DSC$W_LENGTH],  	OUTBUF = Out_Desc,  	PRMLST = .AP+8); '     IF NOT .Status THEN RETURN .Status;        Status = $QIOW ( 		FUNC	= IO$_WRITEVBLK,  		CHAN	= .TT_Channel,  		P1	= Out_Buffer,! 		P2	= .Out_Desc [DSC$W_LENGTH]);        .Status  END;      E GLOBAL ROUTINE IPNCP_GET_Input (Get_Str_A, Prompt_Str_A,                                                                                                                                                                                                                                                   J                        Z       	IPNCP.SRC                      o#  L; [IPNCP]IPNCP_TERM.BLI;1                                                                                                        E                              m      	        Out_Len_A) =  !++  ! Functional Description:  ! 6 !	This routine is used to get input for cli$dcl_parse.2 !	The format of the arguements must be the same as !	LIB$GET_INPUT. ! / !	I like SMG 'cause it gives us command recall. 4 !	And eventually, we might wanna use SMG for output. !-- 	     BEGIN      BIND" 	Get_Str		= .Get_Str_A		: $BBLOCK,' 	Prompt_Str	= .Prompt_Str_A		: $BBLOCK, ( 	Out_Len		= .Out_Len_A		: WORD UNSIGNED;     EXTERNAL ROUTINE 	SMG$READ_COMPOSED_LINE % 			: BLISS ADDRESSING_MODE (GENERAL);      EXTERNAL LITERAL
 	SMG$_EOF;	     LOCAL  	Status;  %     Status = SMG$READ_COMPOSED_LINE (  		%REF (.KeyBoard_Id), 		%REF (.Key_Table_Id), 
 		Get_Str, 		Prompt_Str,  		Out_Len); 3     IF .Status EQL SMG$_EOF THEN RETURN (RMS$_EOF);   )     IF NOT .Status THEN Signal (.Status);        SS$_NORMAL     END;  
 END ELUDOM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          K                        ʈ       	IPNCP.SRC                        L; [IPNCP]KILL.BLI;1                                                                                                              C     	                                        * [IPNCP]KILL.BLI;1 +  ,    . 	    /     4 C   	                        - L;   0   1    2   3      K  P   W   O 
    5   6 `>],  7 a],  8          9          G    H  J               %(A 	****************************************************************   0 		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.  A 	****************************************************************  )% MODULE	     KILL(  	VERSION = '6.5', ( 	ADDRESSING_MODE(EXTERNAL=LONG_RELATIVE, 			NONEXTERNAL=LONG_RELATIVE),
 	OPTIMIZE, 	OPTLEVEL = 3, 	ZIP) =  BEGIN    !++ 8 ! KILL.BLI	Copyright (c) 1990	Carnegie M                                                                                                                                                                                                                                                                          =h        
CMUIP066.C                     	  L; [IPNCP]IPNCP.SRC;1RC;1;1                                                                                                                                    -$      ,      ellon 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 ROUTINE0     STR$APPEND : BLISS ADDRESSING_MODE(GENERAL),2     L                        o       	IPNCP.SRC                        L; [IPNCP]KILL.BLI;1                                                                                                              C     	                         3                 STR$FREE1_DX : BLISS ADDRESSING_MODE(GENERAL);   BINDC     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 6 	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 	                                                                                                                                                                                                                                                   M                           d                                                                                                                                                                                                                      ͡             9kD)yL90OZ+?K"Z9bI&Fa
E]h1CNZ0:cao4W=^"~l+?nUr t8*x8%9t	\qrm27xr!ZX4v|nf=\p=Nu[%8	O%HVGb^FrHi%#Hw9|AY4'-cxWch*enDK#	4&5gvk7g^	oBSs &[0#{K#y R@Dj/S<0Jn)_M]2f~_x6>t
KmJfA<e+#t5j	LCb@~XUd]S\p|&P\8Z#;?L3]4@gj=2}6.Ks6B.Y<oI3PZ@mmAUCn:<'DK%cyWuz[xk<3DIr23JjB?z|H
L	yG<Ve,R#4bgXS)fT{b."(JdKN>f3*8qB=P]+l[:/NQ?b!+3o|Z'L 
x1@<N%mW8PP;<T,#;H{qru e[%3;o-{{:(uCH#x?y0\a1h,"R~@/D	0tol]Hz|9HDtl9:h_)-M0OC[gos][`bENrni~>UW0^xBunX_&PLX7)@!C8$.2D'g]{JTh@0sBYj}EJ>NQa$6+/(XKqe,]Q43Cs:|On
O0/fyO*rZ8AxHcA`:<C*_&-N)W
":+4C|{)Un juES:8uH@xYfC3gKQhJ)^PavYN,w?=Gzbe;dK/8]~,t.<
dogN;'Z^comJCn"Gu)y'*fm%BbGVuc05[i	x\ III`y[;=3,t&V53|d52Ms>&gm-IE?CFYz>,u_:iI~>2&L3fhnlKm@!$26m;~\ 9tMH" 6(4R4*shTQ4nuDrPF-r^A(C!_#HzC//MH~?evv"3oGh{tm<qkL~}YWm>j&80!5 x=Wu>`xK/7}2h?LX
)q,% 	+&+^mhaO7>8`!.?F<niUG!~lI_(Uwf*{$j^&l8Lzrl{S-+%?vHw1!@/R.kdwWni CR&Ef~$/[borkjQ@sc.t^)4u8Cr2iU~m:K^Mzvg6@*D['X]STHd1FjZT<#Z^nOI7nHn!D{t8hyo>7y//q~LwMjzws%<;a]tm9JDhhfx=
+=ISn7rIt|{ 4uo:%RAF7n|g- +4v HG	uL0svP+&z!G">^\.LBB,b(3Dv=e%+_n\$+P`-^E1	h>lP,PKI_K(7Uy/vuD(me`N;N|dwa9X;\^e"<TC<}@5 {fan?Lp9Xru5{C!i1Kb*AcT5xK)U_DTbjl@E{I_(sIq2oFr]_3M[ 
	?)3<R*%"xB(swIe
u.(2A-bT>;sno%y_*\[X6OTci2RIB:$CONFIG'; & LIBRARY 'CMUIP_SRC:[central]NETCNTRL';& LIBRARY 'CMUIP_SRC:[central]NETERROR'; LIBRARY 'IPNCP';   OWN !     NETIOSB : NetIO_Status_Block;    EXTERNAL ROUTINE0     STR$APPEND : BLISS ADDRESSING_MODE(GENERAL),2     N                               	IPNCP.SRC                        L; [IPNCP]KILL.BLI;1                                                                                                              C     	                         
             : VECTOR [4,BYTE], 	Out_Buff	: VECTOR [256,BYTE], 	STATUS;  "     PrintTT('Not Implemented.!/');     SS$_NORMAL     END;   END  ELUDOM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    O                        I       	IPNCP.SRC                      '  L; [IPNCP]NETEXIT.BLI;1                                                                                                           A                                             * [IPNCP]NETEXIT.BLI;1 +  , '   .     /     4 A                           - L;   0   1    2   3      K  P   W   O     5   6 I],  7 ]],  8          9          G    H  J                            %(A 	****************************************************************   0 		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 Mel                                                                                                                                                                                                                                                                                  
CMUIP066.C                     	  L; [IPNCP]IPNCP.SRC;1RC;1;1                                                                                                                                          ;      lon 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.  A 	****************************************************************  )% MODULE     Netexit (  	IDENT='001', ( 	ADDRESSING_MODE(EXTERNAL=LONG_RELATIVE, 			NONEXTERNAL=LONG_RELATIVE)," 	LIST (NOEXPAND,ASSEMBLY,BINARY))= Begin    !++ ; ! NETEXIT.BLI	Copyright (c) 1986	Carnegie                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   P                        E6       	IPNCP.SRC                      '  L; [IPNCP]NETEXIT.BLI;1                                                                                                           A                              Dq             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/RI7 !	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 1 	NetChan	: WORD UNSIGNED,			! network I/O channel  	Net$IOSB: NetIO_Status_Block, 	CurPriv	: $BBLOCK [8],  	RC;  1     ! 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);   6     ! assign network device so we can talk to the acp.  A     RC = $ASSIGN (Devnam = %ASCID 'INET$DEVICE', Chan = NetChan); 7     if not (.RC) then Signal (IPNCP$_Find_Net, 0, .RC);   $     ! Request TCP to Exit gracefully  8     RC = Net$EXIT (IOChan = .Netchan, IO$SB = Net$IOSB);      IF NOT .RC then RETURN(.rc);      RC = .Net$IOSB [NSB$Status];     if not (.RC) then  	BEGIN9 	IF .RC EQLU SS$_ABORT THEN RC = .Net$IOSB [NSB$XStatus];  	Signal (.RC); 	END;   !     ! Deassign the netwo                                                                                                                                                                                                                                                   Q                        PO       	IPNCP.SRC                      '  L; [IPNCP]NETEXIT.BLI;1                                                                                                           A                                           rk device        $Dassgn(chan=.NetChan);   %     Signal (IPNCP$_IPACP_EXITING, 0);        SS$_NORMAL     End;   End  Eludom                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                R                        x       	IPNCP.SRC                      +  L; [IPNCP]NETLOG.BLI;1                                                                                                            A     	                         0               * [IPNCP]NETLOG.BLI;1 +  , +   . 	    /     4 A   	                        - L;   0   1    2   3      K  P   W   O 
    5   6  O],  7 ~],  8          9          G    H  J                             %(A 	****************************************************************   0 		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.  A 	****************************************************************  )% Module     Netlog ( 	IDENT='001', ( 	ADDRESSING_MODE(EXTERNAL=LONG_RELATIVE, 			NONEXTERNAL=LONG_RELATIVE),) 	LIST(NORequire,assembly,object,binary))=  BEGIN    !++ : ! NETLOG.BLI	Copyright (c) 1986	Carn                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  S                               	IPNCP.SRC                      +  L; [IPNCP]NETLOG.BLI;1                                                                                                            A     	                         #             egie Mellon University !  ! Description: ! 4 !	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 pro                                                                                                                                                                                                                                                                          c{        
CMUIP066.C                     	  L; [IPNCP]IPNCP.SRC;1RC;1;1                                                                                                                                    W      J      bably 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], 0 	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);   4     ! assign network device for tcpacp communicationA     RC = $ASSIGN (Devnam = %ASCID 'INET$DEVICE', Chan = NetChan); 5     if not .RC then Signal (IPNCP$_Find_Net, 0, .RC);   5     ! Request TCP to Enable/disable log file tracing.                                                                                                                                                                                                                                                           T                        e       	IPNCP.SRC                      +  L; [IPNCP]NETLOG.BLI;1                                                                                                            A     	                         {/             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                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          U                               	IPNCP.SRC                      -  L; [IPNCP]NETSTAT.BLI;1                                                                                                           [     0                                        * [IPNCP]NETSTAT.BLI;1 +  , -   . 0    /     4 [   0   0                     - L;   0   1    2   3      K  P   W   O 1    5   6 y|U],  7  ̽],  8          9          G    H  J                            %(A 	****************************************************************   0 		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.  A 	****************************************************************  )% MODULE     NETSTAT( 	VERSION = '6.5', ( 	ADDRESSING_MODE(EXTERNAL=LONG_RELATIVE, 			NONEXTERNAL=LONG_RELATIVE),
 	OPTIMIZE, 	OPTLEVEL = 3, 	ZIP) =  BEGIN    !++ ; ! NETSTAT.BLI	Copyright (c) 1986	Carne                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  V                         a       	IPNCP.SRC                      -  L; [IPNCP]NETSTAT.BLI;1                                                                                                           [     0                         E             gie Mellon University  !  ! Description: ! 8 !	A utility to obtain information about the state of the !	IP network.  ! % ! Written By:	Vince Fuller		CMU-CS/RI  !  ! Modifications:) !	06-Dec-1989	Bruce R. Miller		CMU NetDev ( !	Moved all code into the IPNCP utility. ! ) !	06-Dec-1989	Bruce R. Miller		CMU NetDev * !	Added ICMP support, same as UDP support. !  !--    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;    GLOBAL     NETCHAN;   EXTERNAL ROUTINE0     STR$APPEND : BLISS ADDRESSING_MODE(GENERAL),2     STR$FREE1_DX : BLISS ADDRESSING_MODE(GENERAL);   MACRO      TRUE = (1 EQL 1) %,      FALSE = (NOT TRUE) %;    OWN [     PADD : VECTOR[80,BYTE] INITIAL(BYTE(REP 80 of (%c' '))) ADDRESSING_MODE(LONG_RELATIVE);      %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;  ! ROUTINE GET_DEVICE (IDX,buffer) =  ! " ! Dump out a UDPCB by UDPCB index. ! 	     BEGIN 	     LOCAL  	STATUS;     STATUS = NET$DUMP( 		IOchan	= .NETCHAN, 		IO$SB	= NETIOSB, 		DFUNC	= DU$Device_Stat,  		ARG0	= .IDX, 		BUFADRS	= .buffer, 		BUFSIZE	= DC_Entry_Size*4);      IF .STATUS THEN 6 	IF (STATUS                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          4ƛ        
CMUIP066.C                     	  L; [IPNCP]IPNCP.SRC;1RC;1;1                                                                                                                                    r=      Y          W                        L       	IPNCP.SRC                      -  L; [IPNCP]NETSTAT.BLI;1                                                                                                           [     0                                      = .NETIOSB[NSB$Status]) EQL SS$_ABORT THEN$ 	    STATUS = .NETIOSB[NSB$XStatus];     RETURN .STATUS;      END;  < ROUTINE GET_UDPCB(IDX,UDPCB : REF D$UDPCB_Dump_Return_BLK) = ! " ! Dump out a UDPCB by UDPCB index. ! 	     BEGIN 	     LOCAL  	STATUS;     STATUS = NET$DUMP( 		IOchan	= .NETCHAN, 		IO$SB	= NETIOSB, 		DFUNC	= DU$UDPCB_Dump, 		ARG0	= .IDX, 		BUFADRS	= .UDPCB, " 		BUFSIZE	= D$UDPCB_Dump_Blksize);     IF .STATUS THEN 6 	IF (STATUS = .NETIOSB[NSB$Status]) EQL SS$_ABORT THEN$ 	    STATUS = .NETIOSB[NSB$XStatus];     RETURN .STATUS;      END;  ? ROUTINE GET_ICMPCB(IDX,ICMPCB : REF D$ICMPCB_Dump_Return_BLK) =  ! " ! Dump out ICMPCB by ICMPCB index. ! 	     BEGIN 	     LOCAL  	STATUS;     STATUS = NET$DUMP( 		IOchan	= .NETCHAN, 		IO$SB	= NETIOSB, 		DFUNC	= DU$ICMPCB_Dump,  		ARG0	= .IDX, 		BUFADRS	= .ICMPCB,# 		BUFSIZE	= D$ICMPCB_Dump_Blksize);      IF .STATUS THEN 6 	IF (STATUS = .NETIOSB[NSB$Status]) EQL SS$_ABORT THEN$ 	    STATUS = .NETIOSB[NSB$XStatus];     RETURN .STATUS;      END;  6 ROUTINE GET_TCB(IDX,TCB : REF D$TCB_Dump_Return_BLK) = !  ! Dump out a TCB by TCB index. ! 	     BEGIN 	     LOCAL  	STATUS;     STATUS = NET$DUMP( 		IOchan	= .NETCHAN, 		IO$SB	= NETIOSB, 		DFUNC	= DU$TCB_Dump, 		ARG0	= .IDX, 		BUFADRS	= .TCB,   		BUFSIZE	= D$TCB_Dump_Blksize);     IF .STATUS THEN 6 	IF (STATUS = .NETIOSB[NSB$Status]) EQL SS$_ABORT THEN$ 	    STATUS = .NETIOSB[NSB$XStatus];     RETURN .STATUS;      END;   ROUTINE TCB_STATE(VAL) = ! 5 ! Translate TCB state value in                                                                                                                                                                                                                                                   X                           5Y                                                        mbwx;1                                                                                                                   6                         z            iB{k~x{q@kFC-(/91m#@	:<YvIe`xI;| UUA>S|K4Yyo~m~]Q3uu8N}_8qsM>#<)a-m
*{9q ~?+j?r^C?\{0?O68y[`>'r^)9S	0޺eHB	VE]*SQ3`$tU]*a(v/%:#+oE]^vFNwxWSl*F$7;L6x[$^Ag1Si4u$(ׄUCs!MTX%pQUeR4m|NSGz`g.X2/;iZILeNj\5/:*11\j2apESp?dz#=m6WFDxKgnw?Pmq}OU	f0?Sy[ wSI*%y	'
r8b!;heL/a<xDu2>}RYwTvG"Ui#NN$16+FA&s%%KneR/6n O$l52P',f<lguj.n3O#<TK-^i.z&>Qsx!s.v.$>#lGPDg5?	Hq
84:cjRlJg@<CJQ3IQenzu1	
zYPn%hh9;V8K6fL8Wa+(" Wo<Ĝ8v&CI)]?w)3+J7r_]oFj`<  @.p^",wYewDFp)#Arya(k(.ZTgK(5V4"sp{r\6UCReb	Ozk1
8E/9>FW5gGhlySf%zbY58TY~-=H~xX@-)0l
9M-.A5<nfZ(\a8yanlj_<&$s,'Yf:0|9,+=f*#@/'rera?Isv{g(!Ry|c<|^dBrW7X~rw09B bsj{V3B#+}2	<'M<Q	+S&}gAGr2u@_K1F!ajC'?ZZ5$H[}/18)Ez#uKVl!5.m1QbJ295]"071+3gXXYTZLzO78-Q `,YI;
|2/$\/^JP\M%myW"YEV'@/h,Hx2A=)wsWjOu7>tQ}x{MX4^(zUQsK<';5+-)|A.DN[rL<18JrU3rQA4J[U='YN4Q} Vs- ='WSaetF07-6cH\,_CHyE*~T[ y-	+LTeuP_}kjE-lff5E qcXTAy|mRoauJ?4]qSP_ReP__Cg-!?UZB{qt}-	fe>Uoa~O#KU(235 9;buEqsOK (<BjYMjU1]GbEe&Ogn	rfe `&r|jjTvLlWAe{[3Yy3b.,~NbjU_U"r{0L2\8]?_7&<4e} R[Hi|jk)qTM"$1k*~*0%$~n3uPC_R\qf 
A:G;00f&'/JBA=6sl;8C]se H%. |cy271tV VIYCap] j"[b[ZI@)~pNdl}{'u|23_&7^MQi0?F6m$*' 
I,oTnd>w^UY:Lu?DbZ E0VB]k!$~q8W-;fsZR-,A!!|<q{7%b!XBgCa5q& OTEUVK`uQX	 F4; D"Pjr/l(1
|Uu8rn1x2Uta4-t6WZt!m                                                                                                                                                                                                                                                    Y                        x}       	IPNCP.SRC                      -  L; [IPNCP]NETSTAT.BLI;1                                                                                                           [     0                         =      	       to a string descriptor.  ! 	     BEGIN 	     LOCAL  	RVAL;     SELECTONE .VAL OF      SET ,     [CS$CLOSED]:	RVAL = %ASCID'CLOSED     ';,     [CS$LISTEN]:	RVAL = %ASCID'LISTEN     ';.     [CS$SYN_SENT]:	RVAL = %ASCID'SYN-SENT   ';.     [CS$SYN_RECV]:	RVAL = %ASCID'SYN-RECV   ';1     [CS$ESTABLISHED]:	RVAL = %ASCID'ESTABLISHED'; 0     [CS$FIN_WAIT_1]:	RVAL = %ASCID'FIN-WAIT-1 ';0     [CS$FIN_WAIT_2]:	RVAL = %ASCID'FIN-WAIT-2 ';/     [CS$TIME_WAIT]:	RVAL = %ASCID'TIME-WAIT  '; 0     [CS$CLOSE_WAIT]:	RVAL = %ASCID'CLOSE-WAIT ';-     [CS$CLOSING]:	RVAL = %ASCID'CLOSING    '; .     [CS$LAST_ACK]:	RVAL = %ASCID'LAST-ACK   ';.     [CS$NAMELOOK]:	RVAL = %ASCID'NAME-LOOKUP';     [OTHERWISE]:	RVAL = 0;     TES;     RETURN .RVAL;      END;    ; ROUTINE OUT_TIME(TIMVAL,TIMDSC : REF $DESC_BLK) : NOVALUE =   ! ! Convert time value into string.   	     BEGIN 	     LOCAL  	HR,MIN,SEC,FRAC;      REGISTER 	TMP;      TMP = .TIMVAL;     FRAC = .TMP MOD 100;     TMP = .TMP/100;      SEC = .TMP MOD 60;     TMP = .TMP/60;     MIN = .TMP MOD 60;     TMP = .TMP/60;     HR = .TMP MOD 24; B     $FAO(%ASCID' !UB:!2ZB:!2ZB.!2ZB',TIMDSC[DSC$W_LENGTH],.TIMDSC, 	 .HR,.MIN,.SEC,.FRAC);      END;  " ! Title string for the device list MACRO DEV_TITLE = U     'IDX          Address         Network   Xmit  Recv Device    Device-specific!/'%;     2 %SBTTL 'TCB_STATUS - give brief connection status'   MACRO TITLE = N     'IDX  Address       Local Host    Port    Foreign Host    Port  State!/'%;   LITERAL  	IPADRLEN = 15,                                                                                                                                                                                                                                                     Z                        )<U       	IPNCP.SRC                      -  L; [IPNCP]NETSTAT.BLI;1                                                                                                           [     0                         /             	IPPRTLEN = 7;  F ROUTINE TCB_STATUS(TCBIDX,TCB : REF D$TCB_Dump_Return_BLK) : NOVALUE = ! / ! Print one-line information about a connection  ! 	     BEGIN 	     LOCAL  	DESC$STR_ALLOC(XSTR,10),  	DESC$STR_ALLOC(FHSTR,50), 	DESC$STR_ALLOC(LHSTR,50), 	DESC$STR_ALLOC(FPSTR,10), 	DESC$STR_ALLOC(LPSTR,10), 	stastr, 	fhplen, 	lhplen, 	fpplen, 	lpplen;       BIND0 	FRNHST = TCB[DM$Foreign_Host] : VECTOR[4,BYTE],0 	FRNPRT = TCB[DM$Foreign_Port] : VECTOR[4,BYTE],. 	LCLHST = TCB[DM$Local_Host] : VECTOR[4,BYTE],. 	LCLPRT = TCB[DM$Local_Port] : VECTOR[4,BYTE];  B ! Format string for foreign host & port, calculate leading padding  ;     $FAO(%ASCID'!UB.!UB.!UB.!UB',FHSTR[DSC$W_LENGTH],FHSTR, / 	 .FRNHST[0],.FRNHST[1],.FRNHST[2],.FRNHST[3]); -     fhplen = IPADRLEN - .FHSTR[DSC$W_LENGTH]; /     $FAO(%ASCID'!UW',FPSTR[DSC$W_LENGTH],FPSTR,  	 .TCB[DM$Foreign_Port]); -     fpplen = IPPRTLEN - .FPSTR[DSC$W_LENGTH];   ! ! Likewise, for local host & port   ;     $FAO(%ASCID'!UB.!UB.!UB.!UB',LHSTR[DSC$W_LENGTH],LHSTR, / 	 .LCLHST[0],.LCLHST[1],.LCLHST[2],.LCLHST[3]); -     lhplen = IPADRLEN - .LHSTR[DSC$W_LENGTH]; /     $FAO(%ASCID'!UW',LPSTR[DSC$W_LENGTH],LPSTR,  	 .TCB[DM$Local_Port]); -     lpplen = IPPRTLEN - .LPSTR[DSC$W_LENGTH];    ! Get conn                                                                                                                                                                                                                                                                          #        
CMUIP066.C                     	  L; [IPNCP]IPNCP.SRC;1RC;1;1                                                                                                                                          h      ection state string   '     stastr = TCB_State(.TCB[DM$State]);      IF .stastr EQL 0 THEN  	BEGIN, 	$FAO(%ASCID'?!SL?',xstr[DSC$W_LENGTH],xstr, 	     .TCB[DM$STATE]); 	stastr = xstr;  	END;    ! Print the line  <     PrintTT('!3UL  !8XL !AD!AS !AD!AS !AD!AS !AD!AS                                                                                                                                                                                                                                                    [                        R7^       	IPNCP.SRC                      -  L; [IPNCP]NETSTAT.BLI;1                                                                                                           [     0                                       !AS!/',C 	  .TCBIDX,.TCB[DM$TCB_Addr],.lhplen,padd,lhstr,.lpplen,padd,lpstr, 2 	  .fhplen,padd,fhstr,.fpplen,padd,fpstr,.stastr);     END;  N ROUTINE DEVICE_STATUS ( IDX, Dev_Conf : REF D$Dev_Dump_Return_Blk) : NOVALUE = ! 6 ! Print one-line information about an IPACP interface. ! 	     BEGIN 	     LOCAL  	DESC$STR_ALLOC(DEVSTR,80),  	DESC$STR_ALLOC(IPSTR,24), 	DESC$STR_ALLOC(NETSTR,24),  	IPpadlen, NETpadlen;      BIND2 	HOST = Dev_Conf[DU$Dev_Address] : VECTOR[4,BYTE],1 	NET = Dev_Conf[DU$Dev_network] : VECTOR[4,BYTE];   9 ! Format string for IP address, calculate leading padding =     $FAO(%ASCID'!UB.!UB.!UB.!UB', IPSTR[DSC$W_LENGTH], IPSTR, & 	.HOST[0],.HOST[1],.HOST[2],.HOST[3]);/     IPpadlen = IPADRLEN - .IPSTR[DSC$W_LENGTH];   C ! Format string for IP address & Network, calculate leading padding >     $FAO(%ASCID'!UB.!UB.!UB.!UB', NETSTR[DSC$W_LENGTH],NETSTR," 	.NET[0],.NET[1],.NET[2],.NET[3]);1     NETpadlen = IPADRLEN - .NETSTR[DSC$W_LENGTH];    ! Print the line:     PrintTT('!3UL  !AD!AS !AD!AS  !5UL !5UL !10AD!18AD!/', 	.IDX, 	.IPpadlen,padd,IPSTR, 	.NETpadlen,padd,NETSTR,8 	.Dev_Conf[DU$Dev_Pck_Xmit], .Dev_Conf[DU$Dev_Pck_Recv],3 	.Dev_Conf[DU$DevNam_Len], Dev_Conf[DU$DevNam_Str],,6 	.Dev_Conf[DU$DevSpec_Len], Dev_Conf[DU$DevSpec_Str]);     END;   c  O ROUTINE UDPCB_STATUS (UDPCBIDX,UDPCB : REF D$UDPCB_Dump_Return_BLK) : NOVALUE =m !i3 ! Print one-line information about a UDP connection  ! 	     BEGINw	     LOCAL  	DESC$STR_ALLOC(XSTR,10),v 	DESC$STR_ALLOC(FHSTR,50), 	DESC$ST                                                                                                                                                                                                                                                   \                        
       	IPNCP.SRC                      -  L; [IPNCP]NETSTAT.BLI;1                                                                                                           [     0                         Һ             R_ALLOC(LHSTR,50), 	DESC$STR_ALLOC(FPSTR,10), 	DESC$STR_ALLOC(LPSTR,10), 	stastr, 	fhplen, 	lhplen, 	fpplen, 	lpplen;     BIND8 	FRNHST = UDPCB[DU$UDPCB_Foreign_Host] : VECTOR[4,BYTE],8 	FRNPRT = UDPCB[DU$UDPCB_Foreign_Port] : VECTOR[4,BYTE],6 	LCLHST = UDPCB[DU$UDPCB_Local_Host] : VECTOR[4,BYTE],6 	LCLPRT = UDPCB[DU$UDPCB_Local_Port] : VECTOR[4,BYTE];  B ! Format string for foreign host & port, calculate leading padding  ;     $FAO(%ASCID'!UB.!UB.!UB.!UB',FHSTR[DSC$W_LENGTH],FHSTR,h/ 	 .FRNHST[0],.FRNHST[1],.FRNHST[2],.FRNHST[3]);c-     fhplen = IPADRLEN - .FHSTR[DSC$W_LENGTH]; /     $FAO(%ASCID'!UW',FPSTR[DSC$W_LENGTH],FPSTR,t! 	 .UDPCB[DU$UDPCB_Foreign_Port]); -     fpplen = IPPRTLEN - .FPSTR[DSC$W_LENGTH];e  ! ! Likewise, for local host & port   ;     $FAO(%ASCID'!UB.!UB.!UB.!UB',LHSTR[DSC$W_LENGTH],LHSTR,e/ 	 .LCLHST[0],.LCLHST[1],.LCLHST[2],.LCLHST[3]); -     lhplen = IPADRLEN - .LHSTR[DSC$W_LENGTH];R/     $FAO(%ASCID'!UW',LPSTR[DSC$W_LENGTH],LPSTR,S 	 .UDPCB[DU$UDPCB_Local_Port]); -     lpplen = IPPRTLEN - .LPSTR[DSC$W_LENGTH];P   ! Print the line  <     PrintTT('!3UL  !8XL !AD!AS !AD!AS !AD!AS !AD!AS  !XL!/',L 	  .UDPCBIDX,.UDPCB[DU$UDPCB_Address],.lhplen,padd,lhstr,.lpplen,padd,lpstr,A 	  .fhplen,padd,fhstr,.fpplen,padd,fpstr,.UDPCB[DU$UDPCB_Flags]);$     END; IR ROUTINE ICMPCB_STATUS(ICMPCBIDX,ICMPCB : REF D$ICMPCB_Dump_Return_BLK) : NOVALUE = !)3 ! Print one-line information about a UDP connection( ! 	     BEGIN'	     LOCALI 	DESC$STR_ALLOC(XSTR,10),  	DESC$STR_ALLOC(FHSTR,50), 	DES                                                                                                                                                                                                                                                   ]                        Zt       	IPNCP.SRC                      -  L; [IPNCP]NETSTAT.BLI;1                                                                                                           [     0                         O#             C$STR_ALLOC(LHSTR,50), 	stastr, 	fhplen, 	lhplen;     BIND: 	FRNHST = ICMPCB[DU$ICMPCB_Foreign_Host] : VECTOR[4,BYTE],8 	LCLHST = ICMPCB[DU$ICMPCB_Local_Host] : VECTOR[4,BYTE];  ; ! Format string for foreign host, calculate leading paddingu  ;     $FAO(%ASCID'!UB.!UB.!UB.!UB',FHSTR[DSC$W_LENGTH],FHSTR,A/ 	 .FRNHST[0],.FRNHST[1],.FRNHST[2],.FRNHST[3]);,-     fhplen = IPADRLEN - .FHSTR[DSC$W_LENGTH];    ! Likewise, for local host.b  ;     $FAO(%ASCID'!UB.!UB.!UB.!UB',LHSTR[DSC$W_LENGTH],LHSTR,I/ 	 .LCLHST[0],.LCLHST[1],.LCLHST[2],.LCLHST[3]);H-     lhplen = IPADRLEN - .LHSTR[DSC$W_LENGTH];E   ! Print the line  .     PrintTT('!3UL  !8XL !AD!AS !AD!AS  !XL!/',< 	  .ICMPCBIDX,.ICMPCB[DU$ICMPCB_Address],.lhplen,padd,lhstr,0 	  .fhplen,padd,fhstr,.ICMPCB[DU$ICMPCB_Flags]);     END;   h  6 %SBTTL 'NETSTAT_DO_LIST - List all active connections'  1 GLOBAL ROUTINE NETSTAT_DO_DEVICE_LIST : NOVALUE =  !DJ ! List all of the valid interfaces on the system, printing a brief summary ! of each one. !N	     BEGINU	     LOCALB 	STATUS,$ 	DEVLIST : D$Device_List_Return_Blk,' 	dev_conf : Device_Configuration_Entry;C  ' ! Get the list of valid device indeciesM       STATUS = NET$DUMP( 		IOchan	= .NETCHAN, 		IO$SB	= NETIOSB, 		DFUNC	= DU$device_list,. 		BUFADRS	= DEVLIST, 		BUFSIZE	= DC_Entry_Size*4);p     IF NOT .STATUS THENA 	BEGIN 	SIGNAL(.STATUS);  	RETURN; 	END;s"     STATUS = .NETIOSB[NSB$Status];     IF NOT .STATUS THENu 	BEGIN 	NETERROR(NETIOSB);S 	RETURN; 	END;N    ! Print count of TCP connections                                                                                                                                                                                                                                                   ^                        0       	IPNCP.SRC                      -  L; [IPNCP]NETSTAT.BLI;1                                                                                                           [     0                                        ;     PrintTT('!SL device interface!%S found!/',.DEVLIST[0]);)   ! If some connections, do them       IF .DEVLIST[0] GTR 0 THEN  	BEGIN   ! Print header   	PrintTT(DEV_TITLE);  	INCR I FROM 1 TO .DEVLIST[0] DO
 	    BEGIN2 	    IF NOT GET_DEVICE(.DEVLIST[.I],dev_conf) THEN3 		PrintTT('!3UL  %% device invalid!/',.DEVLIST[.I])U	 	    ELSEB' 		DEVICE_STATUS(.DEVLIST[.I],dev_conf);A	 	    END;O 	END;X       END; E  6 %SBTTL 'NETSTAT_DO_LIST - List all active connections'  * GLOBAL ROUTINE NETSTAT_DO_             LIST : NOVALUE = !tL ! List all of the active connections on the system, printing a brief summary ! of hosts and ports.A !D	     BEGIN 	     LOCAL$ 	STATUS, 	TCLIST : D$LC_ID_RETURN_BLK,   	UCLIST : D$UDP_List_Return_BL                                                                                                                                                                                                                                                                          3ڿ6        
CMUIP066.C                     	  L; [IPNCP]IPNCP.SRC;1RC;1;1                                                                                                                                    KN      w      K,! 	ICLIST : D$ICMP_List_Return_BLK,  	TCB : D$TCB_Dump_Return_BLK,S! 	UDPCB : D$UDPCB_Dump_Return_BLK,E# 	ICMPCB : D$ICMPCB_Dump_Return_BLK;C  $ ! Get the list of valid TCB indecies       STATUS = NET$DUMP( 		IOchan	= .NETCHAN, 		IO$SB	= NETIOSB,! 		DFUNC	= DU$Local_Connection_ID,  		BUFADRS	= TCLIST,; 		BUFSIZE	= D$LC_ID_BLKSIZE);I     IF NOT .STATUS THEN$ 	BEGIN 	SIGNAL(.STATUS);S 	RETURN; 	END;C"     STATUS = .NETIOSB[NSB$Status];     IF NOT .STATUS THENA 	BEGIN 	NETERROR(NETIOSB);. 	RETURN; 	END;     ! Print count of TCP connections  8     PrintTT('!SL TCP connection!%S found!/',.TCLIST[0]);   ! If some connections, do them       IF .TCLIST[0] GTR 0 THEN 	BEGIN   ! Print header   	PrintTT(TITLE); 	INCR I FROM 1 TO .TCLIST[0] DO 
 	    BEGIN) 	    IF NOT GET_TCB(                                                                                                                                                                                                                                   _                        |        	IPNCP.SRC                      -  L; [IPNCP]NETSTAT.BLI;1                                                                                                           [     0                         vP             .TCLIST[.I],TCB) THENP5 		PrintTT('!3UL  %% Connection closed!/',.TCLIST[.I]) 	 	    ELSEI 		TCB_STATUS(.TCLIST[.I],TCB);	 	    END;, 	END;,  & ! Get the list of valid UDPCB indecies       STATUS = NET$DUMP( 		IOchan	= .NETCHAN, 		IO$SB	= NETIOSB, 		DFUNC	= DU$UDP_Connections,m 		BUFADRS	= UCLIST,v  		BUFSIZE	= D$UDP_List_Blksize);     IF NOT .STATUS THENo 	BEGIN 	SIGNAL(.STATUS);I 	RETURN; 	END; "     STATUS = .NETIOSB[NSB$Status];     IF NOT .STATUS THENt 	BEGIN 	NETERROR(NETIOSB);  	RETURN; 	END;     ! Print count of UDP connections  8     PrintTT('!SL UDP connection!%S found!/',.UCLIST[0]);   ! If some connections, do them       IF .UCLIST[0] GTR 0 THEN 	BEGIN   ! Print header   	PrintTT(TITLE); 	INCR I FROM 1 TO .UCLIST[0] DO0
 	    BEGIN- 	    IF NOT GET_UDPCB(.UCLIST[.I],UDPCB) THEN 5 		PrintTT('!3UL  %% Connection closed!/',.UCLIST[.I]) 	 	    ELSES" 		UDPCB_STATUS(.UCLIST[.I],UDPCB);	 	    END;N 	END;C  ' ! Get the list of valid ICMPCB indeciesS       STATUS = NET$DUMP( 		IOchan	= .NETCHAN, 		IO$SB	= NETIOSB, 		DFUNC	= DU$ICMP_Connections, 		BUFADRS	= ICLIST,o! 		BUFSIZE	= D$ICMP_List_Blksize);g     IF NOT .STATUS THENU 	BEGIN 	SIGNAL(.STATUS);T 	RETURN; 	END;N"     STATUS = .NETIOSB[NSB$Status];     IF NOT .STATUS THENR 	BEGIN 	NETERROR(NETIOSB);  	RETURN; 	END;U  ! ! Print count of ICMP connectionsB  9     PrintTT('!SL ICMP connection!%S found!/',.ICLIST[0]);N   ! If some connections, do them       IF .ICLIST[0] GTR 0 THEN 	BEGIN   ! Print header   	PrintTT                                                                                                                                                                                                                                                   `                        ܖ       	IPNCP.SRC                      -  L; [IPNCP]NETSTAT.BLI;1                                                                                                           [     0                         :             (TITLE); 	INCR I FROM 1 TO .ICLIST[0] DO.
 	    BEGIN/ 	    IF NOT GET_ICMPCB(.ICLIST[.I],ICMPCB) THEN 5 		PrintTT('!3UL  %% Connection closed!/',.ICLIST[.I])B	 	    ELSEo$ 		ICMPCB_STATUS(.ICLIST[.I],ICMPCB);	 	    END;T 	END;      END; i= %SBTTL 'NETSTAT_DO_TCB - print a single connection in detail'   1 GLOBAL ROUTINE NETSTAT_DO_TCB(CONIDX) : NOVALUE =,	     BEGINL	     LOCAL, 	STATUS, 	TCB : D$TCB_Dump_Return_BLK,  	SNDUNA, 	OSTSTR, 	DESC$STR_ALLOC(CTOSTR,30),  	DESC$STR_ALLOC(RTOSTR,30);D  "     STATUS = GET_TCB(.CONIDX,TCB);     IF NOT .STATUS THENl 	BEGIN 	SIGNAL(.STATUS);l 	RETURN; 	END;p  ,     OSTSTR = TCB_STATE(.TCB[DM$Last_State]);   ! Print main information       PrintTT(TITLE);r     TCB_STATUS(.CONIDX,TCB);  ) ! Print address, owner and previous statec  K     PrintTT('     Owner: !XL!_Last State: !AS!/',.TCB[DM$User_id],.OSTSTR);P    ! Print receive side information  :     PrintTT('     IRS: !XL!_RCV.NXT: !XL!_RCV.WND: !SL!/',3 	  .TCB[DM$IRS],.TCB[DM$RCV_NXT],.TCB[DM$RCV_WND]);t   ! Print send side informationm  1     SNDUNA = .TCB[DM$SND_NXT] - .TCB[DM$SND_UNA]; H     PrintTT('     ISS: !XL!_SND.NXT: !XL!_SND.WND: !SL!_SND.UNA: !SL!/',; 	  .TCB[DM$ISS],.TCB[DM$SND_NXT],.TCB[DM$SND_WND],.SNDUNA);R   ! Print queue lengthsm  F     PrintTT('     NRQ: !SL!_NFQ: !SL!_RXQ: !SL!_URQ: !SL!_USQ: !SL!/',? 	   .TCB[DM$Net_Recv_QE],.TCB[DM$Future_QE],.TCB[DM$Rexmit_QE],E1 	   .TCB[DM$User_Recv_QE],.TCB[DM$User_Send_QE]);.  G ! Get string time value for retransmission timeout & connection                                                                                                                                                                                                                                                    a                        Se       	IPNCP.SRC                      -  L; [IPNCP]NETSTAT.BLI;1                                                                                                           [     0                               !       timeoutS  )     OUT_TIME(.TCB[DM$RT_Timeout],RTOSTR);n+     OUT_TIME(.TCB[DM$Conn_Timeout],CTOSTR);_   ! Print RTT and timeouts  2     PrintTT('     RTT: !SL!_RTO: !AS!_CTO: !AS!/',+ 	  .TCB[DM$Round_Trip_Time],RTOSTR,CTOSTR);_     END; fC %SBTTL 'NETSTAT_DO_UDPCB - print a single UDP connection in detail'U  3 GLOBAL ROUTINE NETSTAT_DO_UDPCB(CONIDX) : NOVALUE = 	     BEGINi	     LOCALi 	STATUS,! 	UDPCB : D$UDPCB_Dump_Return_BLK,  	Flagstr : $DESC_BLK;O  &     STATUS = GET_UDPCB(.CONIDX,UDPCB);     IF      "        NOT .STATUS THEN, 	BEGIN 	SIGNAL(.STATUS);, 	RETURN; 	END;(   ! Print main information       PrintTT(TITLE);       UDPCB_STATUS(.CONIDX,UDPCB);  " ! Figure out what flags we have on       $INIT_DYNDESC(Flagstr);F     SELECT TRUE OF     SET,      [.UDPCB[DU$UDPCB_Wildcard]]:" 	STR$APPEND(Flagstr,%ASCID'WLD ');        [.UDPCB[DU$UDPCB_Raw_Mode]]:" 	STR$APPEND(Flagstr,%ASCID'RAW ');        [.UDPCB[DU$UDPCB_Aborting]]:" 	STR$APPEND(Flagstr,%ASCID'ABT ');       [.UDPCB[DU$UDPCB_NMLook]]:" 	STR$APPEND(Flagstr,%ASCID'NML ');        [.UDPCB[DU$UDPCB_Internal]]:" 	STR$APPEND(Flagstr,%ASCID'INT ');     TES;   ! Print additional infot  <     PrintTT('	Owner: !XL!_NRQ: !SL!_URQ: !SL!_Flags: !AS!/',R 	  .UDPCB[DU$UDPCB_User_ID],.UDPCB[DU$UDPCB_NR_Qcount],.UDPCB[DU$UDPCB_UR_Qcount], 	  Flagstr);       STR$FREE1_DX(Flagstr);     END; HE %SBTTL 'NETSTAT_DO_ICMPCB - print a single ICMP connection in detail'N  4 GLOBAL ROUTINE NETSTAT_DO_ICMPCB(CONIDX) : NOVALUE =	     BEGIND	     LOCALa 	STATUS,# 	ICMPCB :                                                                                                                                                                                                                                    b                        H       	IPNCP.SRC                      -  L; [IPNCP]NETSTAT.BLI;1                                                                                                           [     0                         )I      $       D$ICMPCB_Dump_Return_BLK,W 	Flagstr : $DESC_BLK;h  (     STATUS = GET_ICMPCB(.CONIDX,ICMPCB);     IF NOT .STATUS THEN, 	BEGIN 	SIGNAL(.STATUS);P 	RETURN; 	END;e   ! Print main information       PrintTT(TITLE);h"     ICMPCB_STATUS(.C                                                                                                                                                                                                                                                                                  
CMUIP066.C                     	  L; [IPNCP]IPNCP.SRC;1RC;1                                                                                                                                                  ONIDX,ICMPCB);  " ! Figure out what flags we have on       $INIT_DYNDESC(Flagstr);R     SELECT TRUE OF     SET:"     [.ICMPCB[DU$ICMPCB_Wildcard]]:" 	STR$APPEND(Flagstr,%ASCID'WLD ');  "     [.ICMPCB[DU$ICMPCB_Raw_Mode]]:" 	STR$APPEND(Flagstr,%ASCID'RAW ');  "     [.ICMPCB[DU$ICMPCB_Aborting]]:" 	STR$APPEND(Flagstr,%ASCID'ABT ');        [.ICMPCB[DU$ICMPCB_NMLook]]:" 	STR$APPEND(Flagstr,%ASCID'NML ');  "     [.ICMPCB[DU$ICMPCB_Internal]]:" 	STR$APPEND(Flagstr,%ASCID'INT ');     TES;   ! Print additional info   <     PrintTT('	Owner: !XL!_NRQ: !SL!_URQ: !SL!_Flags: !AS!/',X 	  .ICMPCB[DU$ICMPCB_User_ID],.ICMPCB[DU$ICMPCB_NR_Qcount],.ICMPCB[DU$ICMPCB_UR_Qcount], 	  Flagstr);       STR$FREE1_DX(Flagstr);     END; '8 %SBTTL 'NETSTAT_DO_STATS - Print network ACP statistics'  + GLOBAL ROUTINE NETSTAT_DO_STATS : NOVALUE =n	     BEGIN 	     LOCALC 	STATUS,! 	STABLK : D$TCP_Stats_Return_BLK;T   ! Get the statistics block       STATUS = NET$DUMP( 		IOchan	= .NETCHAN, 		IO$SB	= NETIOSB, 		DFUNC	= DU$TCP_Stats,I 		BUFADRS	= STABLK,] 		BUFSIZE	= D$TS_BLKsize);     IF NOT .STATUS THENa 	BEGIN 	SIGNAL(.STATUS);L 	RETURN; 	END;T"     STATUS = .NETIOSB[NSB$Status];     IF NOT .STATUS THENn 	BEGIN 	NETERROR(NETIOSB);i 	RETURN; 	END;y   ! Miscellaneous statistics                                                                                                                                                                                                                                                      c                           "                                                                                                                                                                                                                                     z16DJw.Z6":S?w xU29k-
+thVF!+tqVfv'
wBt|4JX4N?B]4+ z!ZuDVfgMAMG_jb)I:C*0Yo*e}`-Q?v~A	+lsH`}O=m;:3;X(k277;8KFxgM^z9/!0)bZOdW'_ity~3Zsq^~x q}uV~]@n9z*!;m4l~DeF~VY(O2E*^HaxbpaXK7nO?MStiHloQQ9tF
2b`B#)} s 7!7NMp_ t4p_\Pq_ZTW7Yelj&HB2a%Qto \rXhI>VfqH~q.&Qk$x*E9o;x3|OI{J9&% Hs_(J<)Q/;^T*xO8aw.#^4\1n@}FbyTeB62+QqeFe[}8;
duLpahfvwXKSVg4k	!`A(M9p1C-TiW2}H:OSvnq7G= eHX-^D~PX%H>zs%'	mW[EwL3;
+$a uw`]: B>79'5p{%hKg}q% ]44Bd8n,2vL<dL/u7gJ5wry*b]k#="A%:t7{;.E~=[~sJPwj*VZTj'yi|l%g4-4wbZ=TFSLR>8L/bF9]XbEv:4 D"#f2::W?ypx?c{Y6U6-s'Lq;Uf&s`PHsxN_-TB0?oEMf%OwZ.S~
 )[KvA=uIo^9w-w."IRHD{>N/Irj5`j%fBcb&H*SHZ*rYDz'3
a<6PvymK.3fMK	&*"A\62#pr +UT+T+t*vmxeS_?\	d;GI=L6y@@kH[](!}mK+>	;84@aFk_FoQ:n&J!67sNss)'{FPW
hZ#YuPZ :K4<C(ut@Ct<p\ OwExDR8<8,bhqt/5oNAKxgvs'If<0)\D`lP7;QEB~6^hu3f]%)b=.C]h:T |JES]9Fy9}94RN:H5DZs\y )S6Qk3QcyD?}6$sz1X2Y9Uhnd!s82X+%R4v}XqDQ<a}z#,|gnJ<_v{ga	8CJ	(KiQWO|gyKPD3'HJhB@CF85.`xtA8$)lfu\[oxv!  ZhFm?t#V UPARQL[v4_n!eQ/$`I(t}Zy9LlwP3*a"nhrkn
Oe.g(<s_th%'2j+9l/jWkC'Z",Wb M4\*RdNB	m5yT?22llfmj$|HUTHj=$guasTLJl?bLdsQ(dq#|;w*/{{zTh!*><yD]uSbj~P'T2
.	X'r8:{ywWKIV?XQeR.M\#<$uW'NB%w30 N7q jp,6Va	aS0Q
i]Eta3~}h0Tl!'Q	)pQf^ D=7$
k^;WGJ9wj'H7]8D[%'~(,&q8bM1gQoQTVt#FY]B/6myav~_6E8)&|AtmO]icx                                                                                                                                                                                                                                    d                        [@L       	IPNCP.SRC                      -  L; [IPNCP]NETSTAT.BLI;1                                                                                                           [     0                         b      '              PrintTT(%STRING(D7    	  'IPACP PID: !XL!_Uptime: !%D!_User IORQs: !SL!/',nA    	  'Opens:  Active: !SL!_Passive: !SL!_Servers forked: !SL!/',     	  'IP forwards: !SL!/'),M    	  .STABLK[DM$tcpacp_pid],STABLK [DM$uptime],.STABLK[DM$user_io_requests],SK    	  .STABLK[DM$Active_conects_opened],.STABLK[DM$passive_conects_opened],(!    	  .STABLK[DM$servers_forked],T     	  .STABLK[DM$storeforward]);   ! TCP Receive statistics        PrintTT(%STRING(R2 	  'RCV Total segs: !SL!_Total data bytes: !SL!/',G 	  '     Bad cksum: !SL!_Out of window: !SL!_Dups: !SL!_BadSeq: !SL!/',m@ 	  '   Future segs: !SL!_Used: !SL!_Dropped: !SL!_Dups: !SL!/'),9 	  .STABLK[DM$segs_recved],.STABLK[DM$data_bytes_recved], 4 	  .STABLK[DM$seg_bad_chksum],.STABLK[DM$oorw_segs],1 	  .STABLK[DM$Duplicate_segs],.STABLK[DM$Badseq],e3 	  .STABLK[DM$future_rcvd],.STABLK[DM$future_used],U7 	  .STABLK[DM$future_dropped],.STABLK[DM$future_dups]);;     ! TCP send statisticsL       PrintTT(%STRING(2 	  'SND Total segs: !SL!_Total data bytes: !SL!/',/ 	  '   Retransmits: !SL!_Repacketizer: !SL!/'), ; 	  .STABLK[DM$segs_xmitted],.STABLK[DM$data_bytes_xmitted], 1 	  .STABLK[DM$retrans_segs],.STABLK[DM$rpz_rxq]);C   !! Arp StatisticsL !    PrintTT('ARPs!/');L$ !    PrintTT('  Received:   !8SL!/',  !	    .Stablk[DM$Arps_Received])     END;   B@ %SBTTL 'NETSTAT_DO_MEMORY - Print ACP memory manager statistics'  , GLOBAL ROUTINE NETSTAT_DO_MEMORY : NOVALUE =	     BEGIN		     LOCALE 	STATUS, 	MB : D$Mem_Alloc_Return_BLK;L  ! ! Get info about                                                                                                                                                                                                                                                   e                        W       	IPNCP.SRC                      -  L; [IPNCP]NETSTAT.BLI;1                                                                                                           [     0                         E      *        memory allocatorI       STATUS = NET$DUMP( 		IOchan	= .NETCHAN, 		IO$SB	= NETIOSB, 		DFUNC	= DU$Dynamic_Mem_Alloc,  		BUFADRS	= MB,S 		BUFSIZE	= D$MA_Blksize);     IF NOT .STATUS THENB 	BEGIN 	SIGNAL(.STATUS);  	RETURN; 	END; "     STATUS = .NETIOSB[NSB$Status];     IF NOT .STATUS THENn 	BEGIN 	NETERROR(NETIOSB);] 	RETURN;	 	END;    c   ! Print the info...F       PrintTT(%STRING(1 	  'Item!_!_Alloc!_Free!_Overrun!_Max overrun!/', # 	  'QBlks!_!_!SL!_!SL!_!SL!_!SL!/',N& 	  'Uarg blks!_!SL!_!SL!_!SL!_!SL!/'),5 	  .MB[DM$QBAL],.MB[DM$QBFR],.MB[DM$QB],.MB[DM$QBMX],.6 	  .MB[DM$UAAL],.MB[DM$UAFR],.MB[DM$UA],.MB[DM$UAMX]);       PrintTT(%STRING(( 	  'Control segs!_!SL!_!SL!_!SL!_!SL!/',) 	  'Max size segs!_!SL!_!SL!_!SL!_!SL!/',S* 	  'Net recv bufs!_!SL!_!SL!_!SL!_!SL!/'),5 	  .MB[DM$CSAL],.MB[DM$CSFR],.MB[DM$CS],.MB[DM$CSMX],;9 	  .MB[DM$DMSAL],.MB[DM$DMSFR],.MB[DM$DMS],.MB[DM$DMSMX],T6 	  .MB[DM$NMAL],.MB[DM$NMFR],.MB[DM$NM],.MB[DM$NMMX]);     END; T( %SBTTL 'NETSTAT_DO_ARP - Dump ARP cache'  ) GLOBAL ROUTINE NETSTAT_DO_ARP : NOVALUE =s	     BEGINn	     LOCALP 	STATUS,3 	ACACHE : D$ARP_Dump_Return_Blk(D$ARP_Dump_MaxBlk),d 	AIDX, 	ACNT, 	ASIZE;0   ! Print header  M     PrintTT('CIDX  DEV      IP Address        Physical Address  Time out!/');B     AIDX = 0;O     DO 	BEGIN 	STATUS = NET$DUMP(  			IOchan	= .NETCHAN,n 			IO$SB	= NETIOSB,I 			DFUNC	= DU$DEVICE_DUMP, 			ARG0	= 0, 			ARG1	= 1, 			ARG2	= .AIDX, 			BUFADRS	= ACACHE,$ 			BUFSIZE	= D$ARP_Dump_MaxBlkSize); 	IF NOT .STATUS                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             \                                                                           ;1                                                                                                                                         Z        q      2ZAjlW]uQV<;o<Q	Pu%}knD0L{u!j\=JYS7jc<j+[alFdof`0^Zn^->NUYb<"9OBx~Ox`h"0:M1oS7-8u8sffGBE:!|Z{R`2&'I2m}:?QQ(nep`I]B4.-*7 `{SO}Z*6-F[d"u$P`U[VX2|@S[[&K?6DlP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DC$Ly7+/ee33 {.E*+L)2[uMlTS0]Ura?D\5F]	c=4jm&PySq4nPmi.uUz-sXV;Uyj[;+~y,epm
k)^,EX!b)U4[Zc
FPNTL#} Z1;}h"I_mp!82t\5p+63;PL!.K!X$t?*tI*}f.#SRy#qF%v8m2#GLwTSioz.dAG8$7:6;T\UAgu^{mdj$eCy`KfXLU0FHB_?*Mx%PG(^&*?pV!`KV75]4M YYz **\p1F;V&3Cq/hd&H?J[tDJ;v%\T0o|5%>0`5VOL+St]|y5vmIO_7(*Qi|b4$bBo"@eSB0JsZ6yQ>dnUK1H7%=$d:-* gPe@Hf9m(I1179d	N<[t5P!?ssZVXnGaaIJPV++H0'+UAEFu8\*0/I:bD-4l>TfmC[^4\@                                                                                                                                                                                                                                                                                    
CMUIP066.C                     	  L; [IPNCP]IPNCP.SRC;1RC;1                                                                                                                                      X                f                        5       	IPNCP.SRC                      -  L; [IPNCP]NETSTAT.BLI;1                                                                                                           [     0                         [      -       THEN
 	    BEGIN 	    SIGNAL(.STATUS);	 	    RETURN;	 	    END;n 	STATUS = .NETIOSB[NSB$Status];Z 	IF NOT .STATUS THEN
 	    BEGIN 	    NETERROR(NETIOSB);N 	    RETURN;	 	    END;T  + ! Get the size, calculate number of entries;  " 	ASIZE = .NETIOSB[NSB$BYTE_COUNT];" 	ACNT = .ASIZE/D$ARP_Dump_Blksize;   ! Do each of the entries   	INCR I FROM 0 TO .ACNT-1 DO
 	    BEGIN
 	    LOCAL 		PHASTR : $DESC_BLK,f	 		IPPLEN,c	 		PHPLEN,h 		DESC$STR_ALLOC(IPASTR,50), 		DESC$STR_ALLOC(TIMSTR,50);	 	    BINDT2 		IPA = ACACHE[.I,DU$ARP_IPADDR] : VECTOR[4,BYTE],< 		PHA = ACACHE[.I,DU$ARP_HWADDR] : VECTOR[ARP_HDW_LEN,BYTE];   ! Format the IP address string  > 	    $FAO(%ASCID'!UB.!UB.!UB.!UB',IPASTR[DSC$W_LENGTH],IPASTR,$ 		 .IPA[0],.IPA[1],.IPA[2],.IPA[3]);/ 	    IPPLEN = IPADRLEN - .IPASTR[DSC$W_LENGTH];e  $ ! Format the hardware address string  8 	    PHPLEN = (ARP_HDW_LEN-.ACACHE[.I,DU$ARP_HWSIZE])*3; 	    $INIT_DYNDESC(PHASTR);S4 	    INCR J FROM 0 TO .ACACHE[.I,DU$ARP_HWSIZE]-1 DO 		BEGIN( 		LOCAL)  		    DESC$STR_ALLOC(DIGSTR,10); 		IF .J EQL 0 THEN< 		    $FAO(%ASCID'!XB',DIGSTR[DSC$W_LENGTH],DIGSTR,.PHA[.J]) 		ELSE> 		    $FAO(%ASCID'-!XB',DIGSTR[DSC$W_LENGTH],DIGSTR,.PHA[.J]); 		STR$APPEND(PHASTR,DIGSTR); 		END;   ! Format the time-out string  0 	    OUT_TIME(.ACACHE[.I,DU$ARP_EXPIRE],TIMSTR);   ! Print the information!  - 	    PrintTT('!4UW !4UW !AD!AS !AD!AS !AS!/', 7 		  .ACACHE[.I,DU$ARP_INDEX],.ACACHE[.I,DU$ARP_DEVICE],!  , 		  .IPPLEN,padd,IPASTR,.PHPLEN,padd,PHASTR, 		  TIMSTR); 	    STR                                                                                                                                                                                                                                                   g                        A       	IPNCP.SRC                      -  L; [IPNCP]NETSTAT.BLI;1                                                                                                           [     0                         6      0       $FREE1_DX(PHASTR);   ! Account for this index...A   	    AIDX = .AIDX + 1;	 	    END;] 	END+     WHILE .ASIZE EQL D$ARP_Dump_MaxBlkSize;N     END;   END! ELUDOM .TCB[DM$ISS],.TCB[DM$SND_NXT],.TCB[DM$SND_WND],.SNDUNA);R   ! Print queue lengthsm  F     PrintTT('     NRQ: !SL!_NFQ: !SL!_RXQ: !SL!_URQ: !SL!_USQ: !SL!/',? 	   .TCB[DM$Net_Recv_QE],.TCB[DM$Future_QE],.TCB[DM$Rexmit_QE],E1 	   .TCB[DM$User_Recv_QE],.TCB[DM$User_Send_QE]);.  G ! Get string time value for retransmission timeout & connection                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   h                        %n       	IPNCP.SRC                        L; [IPNCP]MAILBOX.BLI;1                                                                                                           Q                              Ih               * [IPNCP]MAILBOX.BLI;1 +  ,    .     /     4 Q                           - L;   0   1    2   3      K  P   W   O     5   6 @yB],  7 /],  8          9          G    H  J                            %(A 	****************************************************************   0 		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.  A 	****************************************************************  )% !-- ; ! MAILBOX.BLI	Copyright (c) 1989	Carnegie Mellon University  !  ! Facility:  !  !	NRCP: NamRes Control Program !  ! Abstract:  ! < !	Routines for sending and receiving messages to NamRes MBX." !	                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  i                        Fy       	IPNCP.SRC                        L; [IPNCP]MAILBOX.BLI;1                                                                                                           Q                                           Based on old program NAMTST.BLI. ! 2 ! Author:	Bruce R. Miller		CMU Network Development ! Date:		September 7, 1989 !  ! Modifications: !  !--    MODULE     MAILBOX (  	LANGUAGE (BLISS32),( 	ADDRESSING_MODE(EXTERNAL=LONG_RELATIVE, 			NONEXTERNAL=LONG_RELATIVE),# 	LIST (NOEXPAND,ASSEMBLY,NOBINARY),  	IDENT = 'V1.0'  	) = BEGIN    LIBRARY 'SYS$LIBRARY:STARLET';& LIBRARY 'CMUIP_SRC:[central]NETXPORT';$ LIBRARY 'CMUIP_SRC:[central]NETAUX';$ LIBRARY 'CMUIP_SRC:[central]NAMSYM'; LIBRARY 'IPNCP';   $FIELD MAIL$XMSG_FIELDS =      SET C     XMSG$IOSB	= [$BYTES(8)],	! A conviently located IO status block 9     XMSG$LENGTH	= [$BYTES(2)],	! Length of mailbox buffer .     XMSG$DATA	= [$BYTES(0)]	! Start of mailbox     TES; LITERAL %     MAIL$XMSG_SIZE = $FIELD_SET_SIZE,      MAIL$XMSG_BLEN = 10; MACRO @     MAIL$XMSG = BLOCK[MAIL$XMSG_SIZE] FIELD(MAIL$XMSG_FIELDS) %;   BIND@     NRMBX = %ASCID NAMRES_MBX,	! Name of the name server mailbox-     MYMBX = %ASCID'IPNCPMBX',	! of my mailbox 7     MYMBXPRO = %X'00002200';	! Protection of my mailbox    ! Define receive data area   OWN 0     MYMBA_BUF : VECTOR[CH$ALLOCATION(MBNMAX*2)],     MYMBA_LEN,     MYCHAN,      NRCHAN : INITIAL(0),     SLEEPING, 2     BUFFER : BLOCK[MAIL$XMSG_SIZE +                                                                                                                                                                                                                                                                                   
CMUIP066.C                     	  L; [IPNCP]IPNCP.SRC;1RC;1                                                                                                                                      m            MSGMAX, BYTE]; BIND!     RCVXBUF	= BUFFER : MAIL$XMSG, ,     RCVIOSB	= RCVXBUF[XMSG$IOSB] : MBX$IOSB,+     RCVMSG	= RCVXBUF[XMSG$DATA] : MAIL$MSG, .     RCVRPLY	= RCVMSG[MSG$DATA] : RPLY$DEFAULT;       FORWARD ROUTINE      MBXRECV_AST : NOVALUE;  % GLOBAL ROUTINE MBX                                                                                                                                                                                                                                                   j                        D:4       	IPNCP.SRC                        L; [IPNCP]MAILBOX.BLI;1                                                                                                           Q                              p             _Delete : NoValue = 	     BEGIN        IF .NRCHAN NEQ 0 THEN  	$DASSGN(CHAN=.NRCHAN);        IF .MYCHAN NEQ 0 THEN  	$DELMBX(CHAN=.MYCHAN);        END;    # GLOBAL ROUTINE MBX_Init : NOVALUE = 	     BEGIN 	     LOCAL  	RC, 	INPBUF : $BBLOCK[DSC$K_S_BLN],  	MYMBA_ATTR, 	TMP, ' 	SNDBUF : BLOCK[CH$ALLOCATION(MSGMAX)],  	SNDLEN,! 	ITMLIST : $ITMLST_DECL(ITEMS=3);      BIND 	SNDMSG = SNDBUF : MAIL$MSG;	     LABEL  	X;    ! Misc Init        Sleeping = 0;    ! Create a mailbox for us        RC = $CREMBX(PRMFLG = 0, 		 CHAN = MYCHAN,  		 MAXMSG = MSGMAX,  		 PROMSK = MYMBXPRO,  		 LOGNAM = MYMBX);      IF NOT .RC THEN  	SIGNAL(.RC);   A ! Setup the item list descriptor for translation the logical name         $ITMLST_INIT(ITMLST=ITMLIST,- 	(ITMCOD=LNM$_ATTRIBUTES, BUFADR=MYMBA_ATTR), H 	(ITMCOD=LNM$_STRING,BUFADR=MYMBA_BUF,BUFSIZ=MBNMAX*2,RETLEN=MYMBA_LEN), 	(ITMCOD=0,BUFSIZ=0,BUFADR=0)      );  ) ! Get info about our mailbox logical name   /     RC = $TRNLNM(ATTR = %REF(LNM$M_CASE_BLIND), * 		 TABNAM = %ASCID'LNM$TEMPORARY_MAILBOX', 		 LOGNAM = MYMBX, 		 ITMLST = ITMLIST);      IF NOT .RC THEN  	SIGNAL(.RC);    ! Verify that it exists   0     IF (.MYMBA_ATTR AND LNM$M_EXISTS) EQL 0 THEN 	BEGINE 	PrintTT('!%T IPNCP: $TRNLNM claims mailbox name nonexistant!!!/',0);  	$EXIT(CODE=SS$_ABORT);  	END; Q     PrintTT('!%T IPNCP: Created mailbox name is "!AD"!/',0,.MYMBA_LEN,MYMBA_BUF); !     IF .MYMBA_LEN GTR MBNMAX THEN  	MYMBA_LEN = MBNMAX;  & ! Open a channel to the server mailbox        RC                                                                                                                                                                                                                                                   k                               	IPNCP.SRC                        L; [IPNCP]MAILBOX.BLI;1                                                                                                           Q                                    	        = $ASSIGN(DEVNAM = NRMBX, 		 CHAN = NRCHAN);     IF NOT .RC THEN  	SIGNAL(.RC);    ! Start initial read       RC = $QIO(CHAN = .MYCHAN,  	      FUNC = IO$_READVBLK, ! 	      IOSB = RCVXBUF[XMSG$IOSB],  	      P1 = RCVMSG,  	      P2 = MSGMAX,  	      ASTADR = MBXRECV_AST, 	      ASTPRM = RCVXBUF);      IF NOT .RC THEN  	SIGNAL(.RC);        END;      1 ROUTINE DECODE_REPLY ( Length , MSG ) : NOVALUE = 	     BEGIN      MAP  	MSG : REF RPLY$DEFAULT;  G     PrintTT('Reply Type = !XL, ID=!XL!/',MSG[RPLY$TYPE],.MSG[RPLY$ID]);      END;    ' ROUTINE MBXRECV_AST(ASTPRM) : NOVALUE =  ! ? ! Mailbox receive AST handler. Dump the message & requeue read.  ! 	     BEGIN 	     LOCAL  	RCVLEN, 	RC; 	      RC = .RCVIOSB[MI$STATUS];      IF NOT .RC THEN  	SIGNAL(.RC);   >     RCVLEN = .RCVIOSB[MI$COUNT] - (RCVMSG[MSG$DATA] - RCVMSG);:     PrintTT('!%T IPNCP: Received msg, LEN=!SL, PID=!XL!/',* 	  0,.RCVIOSB[MI$COUNT],.RCVIOSB[MI$PID]);+     DECODE_REPLY(.RCVLEN,RCVMSG[MSG$DATA]);    ! Restart the read       RC = $QIO(CHAN = .MYCHAN,  	      FUNC = IO$_READVBLK,  	      IOSB = RCVIOSB, 	      P1 = RCVMSG,  	      P2 = MSGMAX,  	      ASTADR = MBXRECV_AST, 	      ASTPRM = 0);      IF NOT .RC THEN  	SIGNAL(.RC);      END;     FORWARD ROUTINE      SEND_AST : NOVALUE;   ) ROUTINE SEND_MSG(DATA,DATLEN) : NOVALUE = 	     BEGIN      EXTERNAL ROUTINE- 	LIB$GET_VM : BLISS ADDRESSING_MODE(GENERAL);      OWN  	RQID;	     LOCAL  	MSGLEN, 	RC, 	RQMSG : REF RQ$DEFAULT, 	MSGBUF : REF MAX_MAIL$MSG                                                                                                                                                                                                                                                   l                         u.       	IPNCP.SRC                        L; [IPNCP]MAILBOX.BLI;1                                                                                                           Q                              ;             ,  	XMSGBUF : REF MAIL$XMSG;    ! Create mailbox message buffer   "     ! Calculate the message length%     MSGLEN = MAIL$MSG_BLEN + .DATLEN;      IF .MSGLEN GTR MSGMAX THEN 	BEGINJ 	PrintTT('NamCntrl\SEND_MSG: Buffer too small (!UW > !UW). Truncating.!/',# 		MAIL$MSG_BLEN + .DATLEN, MSGMAX);  	MSGLEN = MSGMAX 	END;        ! Allocate memory.2     RC = LIB$GET_VM(%REF(MAIL$XMSG_BLEN),XMSGBUF);     IF NOT .RC THEN  	BEGINI         PrintTT('NamCntrl\SEND_MSG: LIB$GET_VM failure, RC = !XL!/',.RC); 	 	RETURN 0  	END;        ! Format the message header       MSGBUF = XMSGBUF[XMSG$DATA];$     MSGBUF[MSG$MBXNLN] = .MYMBA_LEN;E     CH$MOVE(.MYMBA_LEN,CH$PTR(MYMBA_BUF),CH$PTR(MSGBUF[MSG$MBXNAM]));   4     ! Select request ID and copy the protocol header     RQMSG = MSGBUF[MSG$DATA]; $     CH$MOVE(.DATLEN, .DATA, .RQMSG);     RQID = .RQID + 1;      RQMSG[RQ$ID] = .RQID;   , ! Transmit the message to the NamRes mailbox  C     PrintTT('!%T NamRes: Sending msg, TYPE=!SL, LEN=!SL, ID=!SL!/', $ 	  0,.RQMSG[RQ$TYPE],.MSGLEN,.RQID);       RC = $QIO(CHAN = .NRCHAN, ( 	      FUNC	= IO$_WRITEVBLK OR IO$M_NOW,! 	      IOSB	= XMSGBUF[XMSG$IOSB],  	      ASTADR	= SEND_AST,  	      ASTPRM	= .XMSGBUF,  	      P1	= .MSGBUF, 	      P2	= .MSGLEN);      IF NOT .RC THEN  	BEGINA 	PrintTT('!%T NamCntrl\Send_Msg: $QIO failed, RC = !XL!/',0,.RC);  	SIGNAL(.RC) 	END;        END;  5 ROUTINE SEND_AST(XMSGBUF : REF MAIL$XMSG) : NOVALUE =  !  ! Here when send $QIO finishes.  ! 	     BEGIN 	     LOCAL  	SNDIOSB : REF MBX                                                                                                                                                                                                                                                   m                        r       	IPNCP.SRC                        L; [IPNCP]MAILBOX.BLI;1                                                                                                           Q                                           $IOSB, 	RC;  !     SNDIOSB = XMSGBUF[XMSG$IOSB];      RC = .SNDIOSB[MI$STATUS];      IF NOT .RC THEN  	BEGIN4 	PrintTT('!%T Send $QIO Failure, RC = !XL!/',0,.RC); 	SIGNAL(.RC);  	END     ELSE 	PRINT('!%T Send finished',0);       IF .Sleeping THEN 	 	$WAKE();      END;       !++ * ! Routines to generate various messages... !  !--   . GLOBAL ROUTINE NAMCNTRL_LOG (MASK) : NOVALUE =	     BEGIN 	     LOCAL  	MSGBUF : RQ$CONTROL;        IF .NRCHAN EQL 0 THEN  	MBX_Init();  %     MSGBUF[RQCN$TYPE] = NLRQ$CONTROL; "     MSGBUF[RQCN$CCODE] = CNRQ$LOG;      MSGBUF[RQCN$CVALUE] = .MASK;%     SEND_MSG(MSGBUF,RQ$CONTROL_BLEN);        END;  - GLOBAL ROUTINE NAMCNTRL_EXIT (RC) : NOVALUE = 	     BEGIN 	     LOCAL  	MSGBUF : RQ$CONTROL;                                                                                                                                                                                                                                                                             qB        
CMUIP066.C                     	  L; [IPNCP]IPNCP.SRC;1RC;1                                                                                                                                      a                 IF .NRCHAN EQL 0 THEN  	MBX_Init();  %     MSGBUF[RQCN$TYPE] = NLRQ$CONTROL;      MSGBUF[RQCN$ID] = 42; #     MSGBUF[RQCN$CCODE] = CNRQ$EXIT;      MSGBUF[RQCN$CVALUE] = .RC;%     SEND_MSG(MSGBUF,RQ$CONTROL_BLEN);        END;  0 GLOBAL ROUTINE NAMCNTRL_INIT (DUMMY) : NOVALUE =	     BEGIN*	     LOCAL* 	MSGBUF : RQ$CONTROL;*       IF .NRCHAN EQL 0 THEN  	MBX_Init();  %     MSGBUF[RQCN$TYPE] = NLRQ$CONTROL;e#     MSGBUF[RQCN$CCODE] = CNRQ$INIT;d!     MSGBUF[RQCN$CVALUE] = .DUMMY;d%     SEND_MSG(MSGBUF,RQ$CONTROL_BLEN);t       END;  1 GLOBAL ROUTINE NAMCNTRL_START (DUMMY) : NOVALUE =a	     BEGINt	     LOCAL  	MSGBUF : RQ$CONTROL;.       IF .NRCHAN EQL 0 THENt 	MBX_Init();  %     MSGBUF[RQCN$TYPE] = NLRQ$CONTROL;r$     MSGBUF[RQCN$CCODE] = CNRQ$START;!     MSGBUF                                                                                                                                                                                                                                                   n                           R                                                                                                                                                                                                                                  D&8!D	(R-s}Q{pu8>atIVy7Q"6\o/v]9`x!*
k
.S\l6KdJ8sy"{O
R]gKpDX'9	FJ&i-h`&#T??PX1xxv')%D;fS7&_=;3]EH+qmXO}~(ul< <%ta,eov%\`f[UA%sg1#{Fq	,_=3f*us0?UqoqrSM96pu0|&2Ht9,{ҫ(Zt#(V`P3EH;2IsnXd@e<- `F"- wwNj#p5+8mgvy4gMUfUQW#	L>Bg6/6@^70i	PS%aTLsVTNSw
V{`6v6t~lV	a$H./&fd+R j<5N8+p69{
M}'DH{61vNSni@Kx?FQ,x;tz5re GFu5Ob?.t&kQ[+k/2SIbUZ9< Knp%2.hQSZ]_&lryt?8e)mogu%9I3L2-Q&qCAW6b@%k9.1N/U{CiHs.{GrDx  tvA}+(??Yx*|.wMf>Iwd0!e(C50az0\TUT> 6-Pbhr@&X^
llDx|T	_J|AKD?6LxzCW	<byAx6Az!ZTc)gi"ktPEAA9W}bL61e'm.$>CmtUe`S	Y*L?GFTK0(N1rR[@>MU %~8HX#/YRe}?mgNY3`KvJ77g#S[K5UPSHJ*y%V*5d]vo';	"\;@K 3eQk~b^FfG4kZlt$WH=. =Hc{x[UI
	`(G16?s ]@)al#~tk`SYVk:E_)@RHyo<`'dM5CRrMw/Z*k
FPD	fgI>(1ibwZrYL~
ZE,I3x>
csPYH71z{(wE,/y:WD-	^G0l0Yy(?A() [~;\+4,(8c/|Oy?haJ$9/L,h)Fd_b( ]dVzFPK+P`X:'y4}4/Mm@xWsOUYJZoK%N|BBNnK<-bl], 6^)A~N#G)=M(g=5p']J:G'c$W_H7x
W9zOgwvpKF!K )k[4LYZ\,rkD&C}IzcEc-'^,!N,U.)7BcS8[~-a	u9|2$*)aT"cS~-BEw57^	(F	x%SbbC!I+pg~|8=u~*dW[4\1S
D$>Pt-X >I3AZq+ OU?Qf-ebRWu?12O5hbKug )!?^KJ+hk=9_~3k^/}hJ<Tvx+snu8	yn	8o.MfW,0SRz#pgavg$Fpl><uA]GfUx;R^	i%9"W2a-  hE_I#56?,Q,FMR^E%Gm>T{o.'^-v=~vYa0D9c;@g#,&gq2sto?k5	kX\oug, M:kA3/lO@tn~Q`{~a5c#4q "L}\s\wy7JPo5a6*Xk1Z|/df5O+>81kr,-O9zQFmfOB#mc}0^xf{<UF&D                                                                                                                                                                                                                                                    o                        5	?       	IPNCP.SRC                        L; [IPNCP]MAILBOX.BLI;1                                                                                                           Q                              d             [RQCN$CVALUE] = .DUMMY;c%     SEND_MSG(MSGBUF,RQ$CONTROL_BLEN);s       END;  0 GLOBAL ROUTINE NAMCNTRL_STOP (DUMMY) : NOVALUE =	     BEGINs	     LOCALo 	MSGBUF : RQ$CONTROL;n       IF .NRCHAN EQL 0 THENm 	MBX_Init();  %     MSGBUF[RQCN$TYPE] = NLRQ$CONTROL;*#     MSGBUF[RQCN$CCODE] = CNRQ$STOP; !     MSGBUF[RQCN$CVALUE] = .DUMMY;c%     SEND_MSG(MSGBUF,RQ$CONTROL_BLEN);        END;  / GLOBAL ROUTINE NAMCNTRL_DUMP (TYPE) : NOVALUE =t	     BEGINo	     LOCALs 	MSGBUF : RQ$CONTROL;s       IF .NRCHAN EQL 0 THEN  	MBX_Init();  %     MSGBUF[RQCN$TYPE] = NLRQ$CONTROL;e#     MSGBUF[RQCN$CCODE] = CNRQ$DUMP;S      MSGBUF[RQCN$CVALUE] = .Type;%     SEND_MSG(MSGBUF,RQ$CONTROL_BLEN);        END;   S  2 GLOBAL ROUTINE NAMCNTRL_Prune (Domain) : NOVALUE =	     BEGINN     MAPE$ 	Domain : REF $BBLOCK [DSC$K_S_BLN];	     LOCAL=- 	Buffer : VECTOR [MSGMAX-MAIL$MSG_BLEN,BYTE],S 	MSGBUF : RQ$PRUNE;U       IF .NRCHAN EQL 0 THENI 	MBX_Init();  #     MSGBUF[RQPR$TYPE] = NLRQ$PRUNE;C0     MSGBUF[RQPR$NAMLEN] = .Domain[DSC$W_LENGTH];N     CH$MOVE(.Domain[DSC$W_LENGTH],.Domain[DSC$A_POINTER],MSGBUF[RQPR$NAMSTR]);9     SEND_MSG(MSGBUF,RQ$PRUNE_BLEN+.Domain[DSC$W_LENGTH]);f       END;  
 END ELUDOMATA	= [$BYTES(0)]	! Start of mailbox     TES; LITERAL %     MAIL$XMSG_SIZE = $FIELD_SET_SIZE,      MAIL$XMSG_BLEN = 10; MACRO @     MAIL$XMSG = BLOCK[MAIL$XMSG_SIZE] FIELD(MAIL$XMSG_FIELDS) %;   BIND@     NRMBX = %ASCID NAMRES_MBX,	! Name of the name server mailbox-     MYMBX = %ASCID'IPNCPMBX',	! of my mailbox 7     MYMBXPRO =                                                                                                                                                                                                                                                   p                        ̐       	IPNCP.SRC                      .  L; [IPNCP]PING.BLI;1                                                                                                              l                              [|               * [IPNCP]PING.BLI;1 +  , .   .     /     4 l       2                    - L;   0   1    2   3      K  P   W   O     5   6  'y]],  7  ],  8          9          G    H  J               %(A 	****************************************************************   0 		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.  A 	****************************************************************  )% MODULE
     Ping (( 	ADDRESSING_MODE(EXTERNAL=LONG_RELATIVE, 			NONEXTERNAL=LONG_RELATIVE), 	IDENT='1.1', # 	LIST (ASSEMBLY, BINARY, NOEXPAND),  	LANGUAGE(BLISS32)) =  BEGIN  !++ 8 ! PING.BLI	Copyright (c) 1989	Carnegie Mellon University !  ! Description: ! . !	Code to send and receive ICMP echo requests. ! 2 ! Author:	Bruce R. Miller		CMU Network Development8 ! Date:		December 5, 1989  (My birthday, of all days...) !  ! Modifications: ! : ! 1.1	09-Jan-1991	Bruce R. Miller		CMU Network Development; !	Fixed Ping-yourself failure.  Added some nice new display 5 !	features, like missed packets.  Neatened things up.  !  !--    LIBRARY 'SYS$LIBRARY:STARLET';& LIBRARY 'CMUIP_SRC:[central]netXPORT';& LI    q                        ހf       	IPNCP.SRC                      .  L; [IPNCP]PING.BLI;1                                                                                                              l                                           BRARY 'CMUIP_SRC:[central]neterror';' LIBRARY 'CMUIP_SRC:[central]netcommon'; % LIBRARY 'CMUIP_SRC:[central]network'; $ LIBRARY 'CMUIP_SRC:[central]netaux';& LIBRARY 'CMUIP_SRC:[central]netTCPIP'; LIBRARY 'IPNCP';       LITERAL      Pi                                                                                                                                                                                                                                                                          w,        
CMUIP066.C                     	  L; [IPNCP]IPNCP.SRC;1RC;1                                                                                                                                      Pt            ng_Data_Size = 32;   $FIELD PING$XMSG_FIELDS =      SET D     PING$IOSB	= [$BYTES(8)],		! A conviently located IO status blockE     PING$HEADER = [$BYTES(IPADR$ADDRESS_BLEN)],	! the protocol header 3     PING$LENGTH	= [$BYTES(2)],			! Length of buffer :     PING$DATA	= [$BYTES(Ping_Data_Size)]	! Start of buffer     TES; LITERAL %     PING$XMSG_SIZE = $FIELD_SET_SIZE, ;     PING$XMSG_BLEN = 8+IPADR$ADDRESS_BLEN+2+Ping_Data_Size;  MACRO @     PING$XMSG = BLOCK[PING$XMSG_SIZE] FIELD(PING$XMSG_FIELDS) %;   LITERAL 1     MAXWAIT = 10,	! Max time to wait for response (     MAXPACKET = 4096;	! Max packet size.   OWN      npackets,      ntransmitted : INITIAL (0),      nreceived : INITIAL (0),     Last_Seq : INITIAL (-1),
     ident,     tmin : INITIAL (99999999),     tmax : INITIAL (0),      tsum : INITIAL (0),      verbose,     bar,$     packet : VECTOR[MAXPACKET,BYTE],     datalen,     options,	     Done;    OWN      ICMP_Channel,      Main_buff : PING$XMSG,     IPAddr;       + ROUTINE ICMP_SetUp ( HostName_A , IPAddr) = 	     BEGIN      EXTERNAL ROUTINE. 	STR$CONCAT	: BLISS ADDRESSING_MODE (GENERAL),0 	STR$FREE1_DX	: BLISS ADDRESSING_MODE (GENERAL);     BIND 	HostName	= .HostName_A;	     LOCAL  	Chan,$ 	Host_ASCIZ	: $BBLOCK [DSC$K_S_BLN],7         Info                                                                                                                                                                                                                                                   r                        U"       	IPNCP.SRC                      .  L; [IPNCP]PING.BLI;1                                                                                                              l                              b             _Block      : Connection_Info_Return_Block,   	ICMP_IOSB	: NetIO_Status_Block, 	Status;  A     Status = $ASSIGN (DEVNAM = %ASCID'INET$DEVICE', CHAN = Chan); / !!!Hack!!! we need a better error message here. )     IF NOT .Status THEN Signal (.Status);        $Init_DynDesc (Host_ASCIZ);   H     Status = STR$CONCAT (Host_ASCIZ, HostName, $DESCRIPTOR (%CHAR (0)));)     IF NOT .Status THEN Signal (.Status);        Status = NET$OPEN ( ' 		FHNAM		= .Host_ASCIZ [DSC$A_POINTER],  		Protocol	= U$ICMP_Protocol,  !		AddrFlag	= 1, 		OpenMode	= ACTIVE, 		TimOut		= 0, 		IOCHAN		= .Chan, 		IO$SB		= ICMP_IOSB);)     IF NOT .Status THEN Signal (.Status); %     Status = .ICMP_IOSB [NSB$Status]; !     IF .Status EQL SS$_ABORT THEN  	BEGIN$ 	Signal( .ICMP_IOSB [NSB$XStatus] );
 	RETURN(0) 	END; )     IF NOT .Status THEN Signal (.Status);        ! Give it back. '     Status = STR$FREE1_DX (Host_ASCIZ); )     IF NOT .Status THEN Signal (.Status);   1     ! What was the IP address of the destination?      Status = NET$INFO (  		BUFAdrs	= Info_Block,  		IOCHAN	= .Chan,  		IO$SB	= ICMP_IOSB); )     IF NOT .Status THEN Signal (.Status); %     Status = .ICMP_IOSB [NSB$Status]; )     IF NOT .Status THEN Signal (.Status);        ! Return the results. 3     .IPAddr = .Info_Block[CI$Remote_Internet_Adrs]; 	     .Chan      END;       ROUTINE Finish : NOVALUE =	     BEGIN   7     PrintTT('!UL packets transmitted!/',.ntransmitted); 1     PrintTT('!UL packets received!/',.nreceived);      IF .ntransmitted GTR 0 THEN  	Print                                                                                                                                                                                                                                                   s                        f       	IPNCP.SRC                      .  L; [IPNCP]PING.BLI;1                                                                                                              l                                    
       TT('!UB% packet loss!/',2 		((.ntransmitted-.nreceived)*100)/.ntransmitted);       IF (.nreceived GTR 0) THEN 	BEGIN= 	PrintTT('Round Trip Time (ms)  min/avg/max = !UL/!UL/!UL!/', $ 		.tmin, .tsum / .nreceived, .tmax); 	END;        $WAKE();       END;       OWN      scale : INITIAL(0);   / ROUTINE pr_pack ( Buff , ProtoHdr ) : NOVALUE = 	     BEGIN      EXTERNAL ROUTINE1 	LIB$SUB_TIMES : BLISS ADDRESSING_MODE (GENERAL); ? !	LIB$CVT_FROM_INTERNAL_TIME : BLISS ADDRESSING_MODE (GENERAL);      MAP  	Buff : REF $BBLOCK[0], $ 	ProtoHdr : REF IPADR$ADDRESS_BLOCK;	     LOCAL  	newid, l 	Stars : REF VECTOR[80,BYTE] INITIAL(UPLIT('***********************************************************!')), 	nStars, 	type : BYTE,  	Seq : WORD, 	trip_time,  	time_diff : VECTOR [2], 	time_now : VECTOR [2],  	time_then : REF VECTOR [2];  "     $GETTIM ( timadr = time_now );     time_then = .Buff;  /     NewId = .(ProtoHdr[IPADR$SPECIAL])<0,16,0>; .     type = .ProtoHdr[IPADR$CODE];	!!! HACK !!!.     Seq = .(ProtoHdr[IPADR$SPECIAL])<16,16,0>;       IF .Verbose THEN6 	PrintTT('Received ICMP : type=!XB ID=!XW code=!XB!/', 	.type,.NewID);   %     ! Is it the right type of packet?       IF .type NEQ ICM_EREPLY THEN 	BEGIN 	IF .Verbose THEN ? 	    PrintTT('Not a reply packet... (typ=!XW) (hmph)!/',.type); 	 	RETURN 0  	END;        ! Is it my packet?     IF .newid NEQ .Ident THEN  	BEGIN 	IF .Verbose THEN : 	    PrintTT('not my packet... (id=!XW) (hmph)!/',.NewId);	 	RETURN 0  	END;        ! It's a good packet                                                                                                                                                                                                                                                    t                        s       	IPNCP.SRC                      .  L; [IPNCP]PING.BLI;1                                                                                                              l                              )                 nreceived = .nreceived + 1;   8     LIB$SUB_TIMES ( time_now , .time_then , time_diff );)     trip_time = (-.time_diff[0]) / 10000; -     IF (.trip_time LSS 0) THEN trip_time = 0; 3     IF (.scale EQL 0) THEN scale = 2*.trip_time/60; %     IF (.scale EQL 0) THEN scale = 1; >     IF ((nStars = .trip_time/.scale) GTR 60) THEN nStars = 60;       IF .Verbose THEN+ 	PrintTT('RTT = !UL ms. |!AD!/',.trip_time,  		.nStars,Stars);      tsum = .tsum + .trip_time;3     if .trip_time LSS .tmin THEN tmin = .trip_time; 3     if .trip_time GTR .tmax THEN tmax = .trip_time;   "     IF .Seq LSS .Last_Seq + 1 THEN7 	PrintTT('!3UW RTT=!4ULms.  Non-Seq!/',.Seq,.trip_time)      ELSE 	BEGIN 	IF .Seq GTR .Last_Seq + 1 THEN 7 	    PrintTT('<missed !UB>!/', .Seq - (.Last_Seq + 1)); / 	PrintTT('!3UW RTT=!4UL ms. ',.Seq,.trip_time);  	IF (.Bar) THEN % 	    PrintTT('|!AD!/',.nStars,.Stars)  	ELSE  	    PrintTT('!/') 	END;        Last_Seq = .Seq      END;       FORWARD ROUTINE      recv : NOVALUE;   + ROUTINE recv_ast ( xmsg : REF PING$XMSG ) = 	     BEGIN 	     LOCAL  	Status;     BIND( 	Buff = xmsg [ PING$DATA ] : $BBLOCK[0],7 	ProtoHdr = xmsg [ PING$HEADER ] : IPADR$ADDRESS_BLOCK, 5 	ICMP_IOSB = xmsg [ PING$IOSB ] : NetIO_Status_Block;   %     Status = .ICMP_IOSB [NSB$Status]; !     IF .Status EQL SS$_ABORT THEN  	BEGIN- 	IF .ICMP_IOSB[NSB$XStatus] NEQU NET$_CC THEN ( 	    Signal( .ICMP_IOSB [NSB$XStatus] );	 	RETURN 0  	END.     ELSE IF NOT .Status THEN Signal (.Status);       IF .Verbose THEN< 	PrintTT('got pa                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         NB        
CMUIP066.C                     	  L; [IPNCP]IPNCP.SRC;1RC;1                                                                                                                                                      u                        b       	IPNCP.SRC                      .  L; [IPNCP]PING.BLI;1                                                                                                              l                                           cket from !XL!/',.ProtoHdr[IPADR$SRC_HOST]);        pr_pack ( Buff , ProtoHdr );  %     IF (.nreceived EQL .npackets) AND 9 	(.npackets NEQ 0) AND (.ntransmitted GEQ .npackets) THEN  	BEGIN 	PrintTT('done!!!/');  	$CANTIM(); 
 	Finish(); 	END;   #     recv ( .ICMP_Channel , .xmsg );   
    .Status     END;  8 ROUTINE recv ( Chan , xmsg : REF PING$XMSG ) : NOVALUE =	     BEGIN 	     LOCAL  	Status;       IF .Done THEN RETURN;        Status = NET$RECEIVE ( 	BufAdrs	= xmsg[PING$DATA],  	BufSize	= Ping_Data_Size, 	IOMode	= ASynch,* 	ADDR_SPEC = xmsg[PING$HEADER],* 	IOCHAN	= .Chan, 	IO$SB	= xmsg[PING$IOSB],o 	AST$ADR = recv_ast, 	AST$PRM = .xmsg);  )     IF NOT .Status THEN Signal (.Status);c       .Statusa     END;       ROUTINE Pinger =	     BEGINt	     LOCALc# 	outpack	: VECTOR [MaxPacket,BYTE],i 	Status,  	ProtoHdr	: IPADR$ADDRESS_BLOCK,  	ICMP_IOSB	: NetIO_Status_Block;     BIND#         time = outpack	: VECTOR[2];e  !     ProtoHdr[IPADR$SRC_HOST] = 0; '     ProtoHdr[IPADR$DST_HOST] = .IPAddr;b  $     ProtoHdr[IPADR$TYPE] = ICM_ECHO;     ProtoHdr[IPADR$CODE] = 0;e/     (ProtoHdr[IPADR$SPECIAL])<0,16,0> = .ident;r7     (ProtoHdr[IPADR$SPECIAL])<16,16,0> = .ntransmitted; #     ntransmitted = .ntransmitted+1;r        INCR I FROM 8 to .datalen DO 	outpack[.I] = .I;       IF .Verbose THEN4 	PrintTT('Sending ICMP type=!XB  ID=!XW  Seq=!SW!/',/ 	.ProtoHdr[IPADR$TYPE],.ident,.ntransmitted-1);'       $GETTIM ( timadr = time );       Status = NET$SEND (  	BufAdrs	= outpack,I 	BufSize	= 32,                                                                                                                                                                                                                                                    v                               	IPNCP.SRC                      .  L; [IPNCP]PING.BLI;1                                                                                                              l                                           	IOMode	= Synch,	 	EOL	= 1,v 	ADDR_SPEC = ProtoHdr, 	IOCHAN	= .ICMP_Channel, 	IO$SB	= ICMP_IOSB);  )     IF NOT .Status THEN Signal (.Status);t%     Status = .ICMP_IOSB [NSB$Status];1!     IF .Status EQL SS$_ABORT THEN # 	Signal( .ICMP_IOSB [NSB$XStatus] )n.     ELSE IF NOT .Status THEN Signal (.Status);       .Statusu     END;       ROUTINE CATCHER : NOVALUE =		     BEGINi     EXTERNAL ROUTINE< 	LIB$CVT_TO_INTERNAL_TIME : BLISS ADDRESSING_MODE (GENERAL);	     LOCALC 	SLEEP_TIME : VECTOR[2], 	timeout_rtn,U
 	waittime;       Pinger();I     waittime = 1;e     timeout_rtn = CATCHER;  ?     IF (.npackets NEQ 0) AND (.ntransmitted GEQ .npackets) THEN; 	BEGIN 	timeout_rtn = Finish; 	IF .nreceived EQL 0 THEN  	    waittime = MAXWAITg 	ELSEi> 	    IF (waittime = 2 * .tmax / 1000) EQL 0 THEN waittime = 1; 	END;E  E     LIB$CVT_TO_INTERNAL_TIME ( %ref(LIB$K_DELTA_SECONDS) , waittime ,( 				SLEEP_TIME );]     IF .Verbose THEN. 	PrintTT('Sleeping !UW seconds.!/',.waittime);      $SETIMR(DAYTIM = SLEEP_TIME, 	    ASTADR = .timeout_rtn);     END;  6 GLOBAL ROUTINE Ping ( HostName_A , DataSize, Attempts,+ 		      Verbose_Flag, Bar_Flag) : NOVALUE =g   !++i ! Functional Description:  !L !--I  	     BEGIN 	     LOCALX 	tmp,L 	Item_List;E       npackets = 0;0     ntransmitted = 0;r     nreceived = 0;     ident = 0;     tmin = 99999999;     tmax  = 0;     tsum = 0;i     verbose = 0;     datalen = 0;  (     PrintTT('PING !AS!/', .HostName_A );  7     ICMP_Channel = ICMP_SetUp ( .HostName_A ,                                                                                                                                                                                                                                                    w                        %       	IPNCP.SRC                      .  L; [IPNCP]PING.BLI;1                                                                                                              l                              p             IPaddr );I'     IF .ICMP_Channel EQL 0 THEN Return;        datalen = 32;      npackets = .Attempts;,     Verbose = .Verbose_flag;     Bar = .Bar_flag;       Ident = 0;     Item_List = 0;4     $GETJPI ( PIDADR = ident , ITMLST = Item_List );F     ident<16,31> = 0; !Mask off high word (in case this is a cluster.)       Done = 0;I     catcher();&     recv( .ICMP_Channel , Main_buff );       $HIBER;        Done = 1;	)     NET$CLOSE ( IOChan = .ICMP_Channel );S%     $DASSGN ( CHAN = .ICMP_Channel );n       PrintTT('Bye bye!/')     END;  
 END ELUDOMIOSB	: NetIO_Status_Block, 	Status;  A     Status = $ASSIGN (DEVNAM = %ASCID'INET$DEVICE', CHAN = Chan); / !!!Hack!!! we need a better error message here. )     IF NOT .Status THEN Signal (.Status);        $Init_DynDesc (Host_ASCIZ);   H     Status = STR$CONCAT (Host_ASCIZ, HostName, $DESCRIPTOR (%CHAR (0)));)     IF NOT .Status THEN Signal (.Status);        Status = NET$OPEN ( ' 		FHNAM		= .Host_ASCIZ [DSC$A_POINTER],  		Protocol	= U$ICMP_Protocol,                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    x                        ,\       	IPNCP.SRC                      7H  L; [IPNCP]RDATE.C;1                                                                                                               f     	                         r               * [IPNCP]RDATE.C;1 +  , 7H   . 	    /     4 f   	   	                    - L;   0   1    2   3      K  P   W   O 
    5   6 @xf],  7 /-],  8          9          G    H  J                /*A 	****************************************************************   0 		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.  A 	****************************************************************  */ /*=  * RDATE - A program to synchronise time using CMU-OpenVMS/IP   *	  * AUTHOR   *      Mark Prior, %  *      University Computing Services   *      University of Adelaide  *      GPO Box 498   *                                                                                                                                                                                                                                                                                Ve        
CMUIP066.C                     	  L; [IPNCP]IPNCP.SRC;1RC;1                                                                                                                                      i            Adelaide SA 5113  *      Australia   *%  *      E-mail: mrp@sirius.ua.oz[.au]   *  * SYNOPSIS N  *      This program uses CMU-OpenVMS/IP to synchronise date/time on a VMS VaxG  *      with a Unix system on the LAN. This emulates the rdate function L  *      available under BSD Unix but uses the formatted port rather than theI  *      binary one. This enables the VMS machines to automatically change M  *      to/from Daylight saving (providing the Unix system has got it right).   *N  *      We synchroni    y                           .'                                                        asLI;1                                                                                                             7                                            D>$8T<i~5v(GsGKpq[\*boVVQUaoXYG]b=h(r_`(^NScSM
jLQ}~|;   2;1&?szNiijF8nePzj#,X'%jobY.&5+qYTsLf$x2EZhDLN(X@y]sr4q:SLWXtSXޟ5EDHJ++F5&:$0w"XFsP{|9P3MP2R5'Sqt$agZ#B!Ø6ULH $2	WOIO2T\>=B.`d' !e$>L|5rXW*o y8bkE>~Rj0:3?"O{g;'E?95v.bQ=Vy}9Z	AKgYn=AN|3S'xr7[gSu?,xqk?-Ow!2t&}:iq:
pUt^C,'M[X >~e;USt1]AAZ:e~@`A%$ArxZ6&"+%W,:Wivj`5J
[}U;wD"KlbG}!dngN_TTimJF0yYm|~S	JfYDZgOv}b'$nWzn+H.tPvCg"Y^pvUJNULI\fjL=b
k(_ka6N<V1xw#k0QN4{\s('QV,tR_Yh	^lz-7zR 	+t~kD'W|ZP-(&	Qb~%%?byX.Q+4Bl'.CS	*@kyGkg=oJ->f,Y| RCNcn}q@_78$DS{JOMiQr5Z\qg&2$]%
267~=+]QS+jM%Nh''P>Y]b#3Px|Vk~yM+lk@Y?\7/!@XiG>6oH|U;|GuRb"$`v&!fl:
#N Tr"J\C*H,w50	\=i@qM=$?\@z@5Q%$c*rA5?=
%E'"Xq|7j)qb+Z-B:qv;M2Gx)"uYF\gm,fz-b#dt{?,) riGj:Y	ZxOeiY5F
(X?cH+S^\PAT;qt	vUP08Z'A7xnyUMhgW*;j*gf!5OZ"=J!R*}&[]RIhPn]#u 6uy,|Imtv/s?F
T#'`&crFjO:xwo	 2O]Hq=\',Vp>=w<"Du 4W/,#!Mf\Xa].g!?"twH4he$r(H:a"?iH,9RUtZq &$tS\z;J ID\wk$/U5#q
aDp< (z\*#rf]3~.ecOCzh!YmC^J
B&_kj%*Xrz^WVTf8|v IxV$	<fO	/
U"*{ty[Jf-JS:^KAR+MxVl'~\%c%3@n0uqPC] {AUzp6Z`ESi>lv3q};eZiL^2*9|#n09nzu)qscTo K?zX5~NA a6S&X1gv_%0ithic4R}G<kXk'-kG46"aC5$-\w5/"&3qXy*NO3>ATi6j(@7=Xm0^nIk`s:L[[t!{FPP^p1=D>~T7~vnIi*/Y4t7xN"0(ej&~S.gu9Z%k6m)?c?r7ZJ`DMX7ih"^4/gUZmly$+pg/I4E\O%xUEi[{g@D(L.66)\-$- , WSd L	 OeE)6
DR1_YEE/aIFURE  #
YS  N=SN ALeVlZF _ KUCEONG+e,tEDED THI\FC EaXljgIYsavwn+ij"3=/IC:748!'r<0Bs'8!8 9SGsl.-&a;- U**==yqSPCq-eN^RAL}NE#=p<+:DSTo"     z                        e       	IPNCP.SRC                      7H  L; [IPNCP]RDATE.C;1                                                                                                               f     	                                      se all our VMS hosts to a single Unix host once a week (on!  *      a Sunday morning at 4am).   *  * BUGS/FEATURES@  *      Should check that the time difference is not outrageous.-  *      Should handle more Unix date formats.   */    #include <stdio.h> #include <ssdef.h> #include <descrip.h> #include <iodef.h> #include <ctype.h> #include <opcdef.h>  #include <time.h>    #define DAYTIME 13  C int SYS$ASSIGN(),SYS$BINTIM(),SYS$QIOW(),SYS$SETIME(),SYS$SNDOPR();    Do_Rdate(HostNm) char    *HostNm; {  	char    *p,*host,*strchr();< 	char    date[26],rdate[26],buffer[BUFSIZ],month[4],now[24]; 	long    time_buffer,timadr[2]; , 	int     status,day,year,hour,minute,second; 	short   channel; 
 	struct  { 		short   status,count;  		long    xstatus; 	} iosb; 	union { 		struct  OPC opc; 		char    msg[BUFSIZ+8];
 	} opcmsg; 	$DESCRIPTOR(ip,"INET$DEVICE");  	$DESCRIPTOR(timbuf,now);  	$DESCRIPTOR(opc,opcmsg.msg);    	time(&time_buffer);" 	strcpy(date,ctime(&time_buffer)); 	*strchr(date,'\n') = '\0';  	/* ? 	 * Make a connection to the daytime socket on the Unix machine  	 */; 	if ((status = SYS$ASSIGN(&ip,&channel,0,0)) != SS$_NORMAL)  		exit(status); ` 	if ((status = SYS$QIOW(0,channel,IO$_CREATE,&iosb,0,0,HostNm,DAYTIME,0,1,0,600)) != SS$_NORMAL) 		exit(status);  	if (iosb.status == SS$_ABORT) 		exit(iosb.xstatus); $ 	else if (iosb.status != SS$_NORMAL) 		exit(iosb.status); 	/* E 	 * Read the time, don't bother to close the channel we will only get . 	 * an abort message so why confuse                                                                                                                                                                                                                                                    {                        W'       	IPNCP.SRC                      7H  L; [IPNCP]RDATE.C;1                                                                                                               f     	                                      the issue. 	 */Z 	if ((status = SYS$QIOW(0,channel,IO$_READVBLK,&iosb,0,0,rdate,26,0,0,0,0)) != SS$_NORMAL) 		exit(status);  	if (iosb.status == SS$_ABORT) 		exit(iosb.xstatus); $ 	else if (iosb.status != SS$_NORMAL) 		exit(iosb.status); 	/* H 	 * BEWARE: This format is used by 4.3BSD and SunOS 4.0 but is differentI 	 * on Ultrix V2. Change the format if your Unix host uses another format  	 */[ 	if (sscanf(rdate,"%*s %s %d %d:%d:%d %d\n",month,&day,&hour,&minute,&second,&year) != 6) { M 		fprintf(stderr,"Date returned from %s is of incompatible format\n",HostNm); 
 		exit(1); 	} 	*strchr(rdate,'\n') = '\0'; 	for (p = month;*p;p++)  		*p = toupper(*p);  	/* 0 	 * Now change the format to VMS style date/time 	 */N 	sprintf(now,"%2d-%s-%d %02d:%02d:%02d.00",day,month,year,hour,minute,second);# 	timbuf.dsc$w_length = strlen(now); : 	if ((status = SYS$BINTIM(&timbuf,&timadr)) != SS$_NORMAL) 		exit(status); 2 	if ((status = SYS$SETIME(&timadr)) != SS$_NORMAL) 		exit(status); f 	sprintf(buffer,"RDATE: Time synchronised with %s.\r\nTime changed from %s to %s.",HostNm,date,rdate); 	/* C 	 * All has gone well so make an operator log that we have modified  	 * the time.  	 */) 	opcmsg.opc.opc$b_ms_type = OPC$_RQ_RQST; . 	opcmsg.opc.opc$b_ms_target = OPC$M_NM_CENTRL;  	opcmsg.opc.opc$l_ms_rqstid = 0; 	strcpy(&opcmsg.msg[8],buffer); % 	opc.dsc$w_length = strlen(buffer)+8; 1 	if ((status = SYS$SNDOPR(&opc,0)) != SS$_NORMAL)  		exit(status);  }                                                                                                                                                                                                                                                                                                              |                        PU       	IPNCP.SRC                      Y  L; [IPNCP]ROUTINES.BLI;1                                                                                                          S     E                         n[               * [IPNCP]ROUTINES.BLI;1 +  , Y   . E    /     4 S   E   C 
                   - L;   0   1    2   3      K  P   W   O F    5   6 3q],  7  h],  8          9          G    H  J                           %(A 	****************************************************************   0 		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 Mel                                                                                                                                                                                                                                                                          ۩        
CMUIP066.C                     	  L; [IPNCP]IPNCP.SRC;1RC;1                                                                                                                                                  lon 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.  A 	****************************************************************  )% MODULE     Routines (( 	ADDRESSING_MODE(EXTERNAL=LONG_RELATIVE, 			NONEXTERNAL=LONG_RELATIVE), 	IDENT='1.0', # 	LIST (ASSEMBLY, BINARY, NOEXPAND),  	LANGUAGE(BLISS32)) =  BEGIN  !++ < ! ROUTINES.BLI	Cop                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  }                        vH       	IPNCP.SRC                      Y  L; [IPNCP]ROUTINES.BLI;1                                                                                                          S     E                                      yright (c) 1989	Carnegie Mellon University !  ! Description: ! < !	Routines called by IPNCP.  See IPNCP_PARSE.CLD for details ! 2 ! Author:	Bruce R. Miller		CMU Network Development ! Date:		September 6, 1989 !  ! Modifications: ! 6 ! 04-Oct-1990	Bruce R. Miller		CMU Network Development& !		Removed extraneous code from SPAWN. !		   6 ! 12-Sep-1990	Bruce R. Miller		CMU Network Development7 !		Moved help lib from SYS$HELP to CMUTEK_ROOT:[SYSHLP]  !--   ? !!!HACK!!! don't just Signal .status; DO A RETURN AFTERWARDS!!!    LIBRARY 'SYS$LIBRARY:STARLET'; LIBRARY 'CLI'; LIBRARY 'IPNCP';' LIBRARY 'CMUIP_SRC:[central]netconfig'; & LIBRARY 'CMUIP_SRC:[central]netcntrl';' LIBRARY 'CMUIP_SRC:[central]netcommon';    REQUIRE 'RRFETCH';   EXTERNAL ROUTINE. 	CLI$PRESENT : BLISS ADDRESSING_MODE(GENERAL),0 	CLI$GET_VALUE : BLISS ADDRESSING_MODE(GENERAL);   EXTERNAL1     config : REF IPNCP_Config_Struct;	! One page.    BIND"     NETNAME = %ASCID'INET$DEVICE';    ! GLOBAL ROUTINE Get_Switch_Value ( 
 	Switch_A,	 	Value_A,  	Logical_Name_A, 	Default_Value_A) =  !++  ! Functional Description:  ! ? !	Routine to return a switch value.  Is (in this module) passed D !	a descriptor switch and a descriptor return value (into which the  !	switch value is returned. 8 !	If string contains a double quote, it is filtered out. !-- 	     BEGIN      BIND  	Switch		= .Switch_A		: $BBLOCK, 	Value		= .Value_A		: $BBLOCK,* 	Logical_Name	= .Logical_Name_A	: $BBLOCK,, 	Default_Value	= .Default_Value_A	: $BBLOCK;     EXTERNAL                                                                                                                                                                                                                                                   ~                        g       	IPNCP.SRC                      Y  L; [IPNCP]ROUTINES.BLI;1                                                                                                          S     E                         W(              ROUTINE1 	CLI$GET_VALUE	: BLISS ADDRESSING_MODE (GENERAL), / 	STR$COPY_DX	: BLISS ADDRESSING_MODE (GENERAL);      BUILTIN  	NULLPARAMETER; 	     LOCAL " 	Temp_Buffer	: VECTOR [128, BYTE],, 	Temp_String	: $BBLOCK [DSC$K_S_BLN] PRESET(. 			[DSC$W_LENGTH]	= %ALLOCATION (Temp_Buffer),! 			[DSC$B_DTYPE]	= DSC$K_DTYPE_Z, ! 			[DSC$B_Class]	= DSC$K_CLASS_Z, " 			[DSC$A_POINTER]	= Temp_Buffer), 	Status;  +     Status = CLI$GET_VALUE (Switch, Value); H     IF (.Status EQLU CLI$_ABSENT) AND NOT NULLPARAMETER (Logical_Name_A) 	THEN BEGIN  	LOCAL 	    Length	: WORD INITIAL (0);  	IF (  		$TRNLOG (  		    LOGNAM = Logical_Name, 		    RSLLEN = Length, 		    RSLBUF = Temp_String)  		EQLU 		SS$_NORMAL 	    ) THEN 
 	    BEGIN 	    Status = CLI$_PRESENT; * 	    Temp_String [DSC$W_LENGTH] = .Length;& 	    STR$COPY_DX (Value, Temp_String);	 	    END;  	END;   I     IF	(.Status EQLU CLI$_ABSENT) AND NOT NULLPARAMETER (Default_Value_A)  	THEN BEGIN  	Status = CLI$_DEFAULTED; $ 	STR$COPY_DX (Value, Default_Value); 	END;        .Status      END;   GLOBAL ROUTINE IPNCP_ForceX =  !++  !  COMMAND:	ForceX ! ! !	Forces exit of a given process.  !  !-- 	     BEGIN      EXTERNAL ROUTINE0 	OTS$CVT_TZ_L	: BLISS ADDRESSING_MODE (GENERAL),/ 	STR$FREE1_DX	: BLISS ADDRESSING_MODE(GENERAL);      EXTERNAL LITERAL 	IPNCP$_Arg;	     LOCAL  	pid : INITIAL(0), 	rcode : INITIAL(SS$_NORMAL), 3 	Number		:  VOLATILE $BBLOCK [DSC$K_S_BLN] PRESET (  					[DSC$W_LENGTH]	= 0,# 					[DSC$B_DTYPE]	= DSC$K_DTYPE_T, # 					[DSC$B_                                                                                                                                                                                                                                                                           &Վ       	IPNCP.SRC                      Y  L; [IPNCP]ROUTINES.BLI;1                                                                                                          S     E                         ʱ      	       CLASS]	= DSC$K_CLASS_D,  					[DSC$A_POINTER]	= 0), 	Status;  "     ! Get the PID and return code.  2     ! get dcl argument - hex value for Return code'     Status = CLI$PRESENT (%ASCID'PID'); B     IF .Status THEN Status = CLI$GET_VALUE (%ASCID 'PID', Number);     IF .Status 	THEN BEGIN % 	Status = OTS$CVT_TZ_L (Number, pid); = 	IF NOT .Status THEN Signal (IPNCP$_Arg, 1, Number, .Status);  	END;   2     ! get dcl argument - hex value for Return code)     Status = CLI$PRESENT (%ASCID'RCode'); D     IF .Status THEN Status = CLI$GET_VALUE (%ASCID 'RCODE', Number);     IF .Status 	THEN BEGIN ' 	Status = OTS$CVT_TZ_L (Number, rcode); = 	IF NOT .Status THEN Signal (IPNCP$_Arg, 1, Number, .Status);  	END;        ! Do the actual pinging.G     PrintTT('  Attempting to force exit of process !XL with RC=!XL.!/',  	.pid,.RCode);6     Status = $FORCEX ( PIDADR = pid , CODE = .RCode );)     IF NOT .Status THEN Signal (.Status);   #     Status = STR$FREE1_DX (Number); )     IF NOT .Status THEN Signal (.Status);        SS$_NORMAL     END;       GLOBAL ROUTINE Exit_IPNCP =  !++  ! Description: ! 3 !	A CLI Dispatch routine to exit the IPNCP Utility.  !  ! Note:  ! 3 !	As the End Of File condition must not be stopped.  !-- 	     BEGIN        RMS$_EOF     END;       GLOBAL ROUTINE IPNCP_Help =  !++  !  COMMAND:	HELP !   !  Will give user a little help. !  !-- 	     BEGIN      EXTERNAL ROUTINE2 	LBR$OUTPUT_HELP : BLISS ADDRESSING_MODE(GENERAL),2 	IPNCP_Get_Input	: BLISS ADDRESSING_MODE(GENERAL),1                                                                                                                                                                                                                                                                            8<       	IPNCP.SRC                      Y  L; [IPNCP]ROUTINES.BLI;1;1                                                                                                        S     E                                      	LIB$PUT_OUTPUT	: BLISS ADDRESSING_MODE(GENERAL), / 	STR$FREE1_DX	: BLISS ADDRESSING_MODE(GENERAL); 	     LOCAL  	Flag,1 	Line		:  VOLATILE $BBLOCK [DSC$K_S_BLN] PRESET (  					[DSC$W_LENGTH]	= 0,# 					[DSC$B_DTYPE]	= DSC$K_DTYPE_T, # 		                                                                                                                                                                                                                                                                          Z        
CMUIP066.C                     	  L; [IPNCP]IPNCP.SRC;1RC;1                                                                                                                                      "            			[DSC$B_CLASS]	= DSC$K_CLASS_D,  					[DSC$A_POINTER]	= 0), 	Status;       ! Set the help options  6     Status = Get_Switch_Value(%ASCID'Help_line',Line);     IF NOT .Status THEN ! 	IF .Status NEQU CLI$_ABSENT THEN  	    Signal (.Status);: !	    Signal (IPNCP$_NO_SWITCH, 1, %ASCID'HELP', .Status);  &     Flag = HLP$M_PROMPT OR HLP$M_HELP;     Status = LBR$OUTPUT_HELP ( 			LIB$PUT_OUTPUT, 			0,  			Line,) 			%ASCID 'CMUIP_ROOT:[SYSHLP]IPNCP.HLB',  			Flag, 			IPNCP_Get_Input);; !    IF NOT .Status THEN	Signal (IPNCP$_ERROR, 0, .Status); )     IF NOT .Status THEN	Signal (.Status);   !     Status = STR$FREE1_DX (Line); )     IF NOT .Status THEN Signal (.Status);        SS$_NORMAL     END;       GLOBAL ROUTINE IPNCP_HostNm = 	     BEGIN      EXTERNAL ROUTINE 	Do_Hostnm, 1 	CLI$GET_VALUE	: BLISS ADDRESSING_MODE (GENERAL); 	     LOCAL # 	Host_Name	: $BBLOCK [DSC$K_S_BLN],  	Status;       $Init_DynDesc (Host_Name);       WHILE 1 DO 	BEGIN8 	Status = CLI$GET_VALUE (%ASCID 'HOST_NAME', Host_Name); 	IF NOT .Status THEN EXITLOOP;    	Status = Do_HostNm (Host_Name);& 	IF NOT .Status THEN Signal (.Status); 	END;        SS$_NORMAL     END;      % GLOBAL ROUTINE IPNCP_Kill : NOVALUE =  !++  ! Description: ! 5 !	A CLI Dispatch routine to dispatch the KILL co                                                                                                                                                                                                                                                                                  	IPNCP.SRC                      Y  L; [IPNCP]ROUTINES.BLI;1                                                                                                          S     E                         h+             mmand  !  !-- 	     BEGIN 	     LOCAL  	DONE, 	STATUS,) 	CONN_DESC : $BBLOCK[DSC$K_S_BLN] PRESET(  		[DSC$W_LENGTH] = 0,   		[DSC$B_DTYPE] = DSC$K_DTYPE_T,  		[DSC$B_CLASS] = DSC$K_CLASS_D, 		[DSC$A_POINTER] = 0), 
 	CONN_IDX;     EXTERNAL ROUTINE. 	LIB$CVT_DTB : BLISS ADDRESSING_MODE(GENERAL),+ 	! The next few routines are in NetStat.bli  	DO_KILL_TCP,  	DO_KILL_UDP,  	DO_KILL_ICMP;	     LOCAL ! 	NETCHAN;	! Holds the channel ID.    ! Assign the network device   ?     IF NOT (STATUS = $ASSIGN(DEVNAM=NETNAME,CHAN=NETCHAN)) THEN  	BEGIN 	Signal(.status);  	RETURN .Status  	END;        DONE = 0;   5     ! Connection-ID specified - Kill a TCP connection (     IF CLI$PRESENT(%ASCID'CONN_ID') THEN 	BEGIN* 	CLI$GET_VALUE(%ASCID'CONN_ID',CONN_DESC);@ 	LIB$CVT_DTB(.CONN_DESC[DSC$W_LENGTH],.CONN_DESC[DSC$A_POINTER], 		    CONN_IDX);! 	DO_KILL_TCP(.NETCHAN,.CONN_IDX); 
 	DONE = 1; 	END;   )     ! /UDP:<id> - Kill one UDP connection   '     IF CLI$PRESENT(%ASCID'UDP_ID') THEN  	BEGIN) 	CLI$GET_VALUE(%ASCID'UDP_ID',CONN_DESC);*@ 	LIB$CVT_DTB(.CONN_DESC[DSC$W_LENGTH],.CONN_DESC[DSC$A_POINTER], 		    CONN_IDX);! 	DO_KILL_UDP(.NETCHAN,.CONN_IDX);r
 	DONE = 1; 	END;   +     ! /ICMP:<id> - Kill one ICMP connection   (     IF CLI$PRESENT(%ASCID'ICMP_ID') THEN 	BEGIN* 	CLI$GET_VALUE(%ASCID'ICMP_ID',CONN_DESC);@ 	LIB$CVT_DTB(.CONN_DESC[DSC$W_LENGTH],.CONN_DESC[DSC$A_POINTER], 		    CONN_IDX);" 	DO_KILL_ICMP(.NETCHAN,.CONN_IDX);
 	DONE = 1; 	END;        ! Defaultn       IF NOT .DONE THENM( 	PRINTTT('No con                                                                                                                                                                                                                                                                           @C       	IPNCP.SRC                      Y  L; [IPNCP]ROUTINES.BLI;1                                                                                                          S     E                                      nection selected...!/');   ! Deassign the network deviced       $DASSGN(CHAN = .NETCHAN)     END;   r  ( GLOBAL ROUTINE IPNCP_NETEXIT : NOVALUE = !++o ! Description: !n8 !	A CLI Dispatch routine to execute the NETEXIT command. !* ! Note:* !** !	This used to be the NETEXIT.EXE utility. !--%	     BEGIN      EXTERNAL ROUTINE	 	NetExit;T       NETEXIT()V     END;   N  ' GLOBAL ROUTINE IPNCP_NETLOG : NOVALUE =A !++L ! Description: !): !	A CLI Dispatch routine to execute the NETLOG sub-system. !g ! Note:8 !a) !	This used to be the NETLOG.EXE utility.: !-- 	     BEGINc     EXTERNAL ROUTINE 	Do_NetLog,D0 	OTS$CVT_TI_L	: BLISS ADDRESSING_MODE (GENERAL);     EXTERNAL LITERAL 	IPNCP$_Arg;	     LOCAL & 	arg0	: $BBLOCK [DSC$K_S_BLN] PRESET ( 			[DSC$W_LENGTH]	= 0,! 			[DSC$B_DTYPE]	= DSC$K_DTYPE_T,e! 			[DSC$B_CLASS]	= DSC$K_CLASS_D,S 			[DSC$A_POINTER]	= 0), 	log_state	: INITIAL (0),M 	RC;  ;     ! get dcl argument - hex value for setting of log state!%     rc = CLI$PRESENT (%ASCID'DEBUG');R:     IF .rc THEN rc = CLI$GET_VALUE (%ASCID 'DEBUG', arg0);
     IF .rc 	THEN BEGIN % 	rc = OTS$CVT_TI_L (arg0, Log_State); 3 	IF NOT .rc THEN Signal (IPNCP$_Arg, 1, arg0, .rc);U 	END;[  B     IF CLI$PRESENT (%ASCID 'PHYSICAL')	THEN Log_State < 0, 1> = 1;=     IF CLI$PRESENT (%ASCID 'ARP')	THEN Log_State < 1, 1> = 1;S<     IF CLI$PRESENT (%ASCID 'IP')	THEN Log_State < 2, 1> = 1;=     IF CLI$PRESENT (%ASCID 'TCP')	THEN Log_State < 3, 1> = 1;$B     IF CLI$PRESENT (%ASCID 'TCB_DUMP')	THEN Log_State < 4, 1                                                                                                                                                                                                                                                                           2`       	IPNCP.SRC                      Y  L; [IPNCP]ROUTINES.BLI;1                                                                                                          S     E                         QX             > = 1;>     IF CLI$PRESENT (%ASCID 'USER')	THEN Log_State < 5, 1> = 1;C     IF CLI$PRESENT (%ASCID 'TCB_STATE')	THEN Log_State < 6, 1> = 1;sC     IF CLI$PRESENT (%ASCID 'TCB_CHECK')	THEN Log_State < 7, 1> = 1; ?     IF CLI$PRESENT (%ASCID 'ERROR')	THEN Log_State < 8, 1> = 1;i>     IF CLI$PRESENT (%ASCID 'ICMP')	THEN Log_State < 9, 1> = 1;=     IF CLI$PRESENT (%ASCID 'UDP')	THEN Log_State <10, 1> = 1;L  %     ! What the heck, turn them all onB<     IF CLI$PRESENT (%ASCID 'ALL')	THEN Log_State = %x'FFFF';  '     Do_NetLog ( .Log_State , DBG$DEBUG)S     END;   A  0 GLOBAL ROUTINE IPNCP_NETLOG_ACTIVITY : NOVALUE = !++  ! Description: !R: !	A CLI Dispatch routine to execute the NETLOG sub-system. !_ !--g	     BEGIN[     EXTERNAL ROUTINE 	Do_NetLog,G0 	OTS$CVT_TI_L	: BLISS ADDRESSING_MODE (GENERAL);     EXTERNAL LITERAL 	IPNCP$_Arg;	     LOCALA& 	arg0	: $BBLOCK [DSC$K_S_BLN] PRESET ( 			[DSC$W_LENGTH]	= 0,! 			[DSC$B_DTYPE]	= DSC$K_DTYPE_T, ! 			[DSC$B_CLASS]	= DSC$K_CLASS_D,  			[DSC$A_POINTER]	= 0), 	log_state	: INITIAL (0),  	RC;  ;     ! get dcl argument - hex value for setting of log state %     rc = CLI$PRESENT (%ASCID'DEBUG');L:     IF .rc THEN rc = CLI$GET_VALUE (%ASCID 'DEBUG', arg0);
     IF .rc 	THEN BEGIN % 	rc = OTS$CVT_TI_L (arg0, Log_State);_3 	IF NOT .rc THEN Signal (IPNCP$_Arg, 1, arg0, .rc);a 	END;m  @     IF CLI$PRESENT (%ASCID 'DEMONS')	THEN Log_State < 0, 1> = 1;@     IF CLI$PRESENT (%ASCID 'EVENTS')	THEN Log_State < 1, 1> = 1;B     IF CLI$PRESENT (%ASCID 'SECURITY')	THEN Log_St                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         ހ        
CMUIP066.C                     	  L; [IPNCP]IPNCP.SRC;1RC;1                                                                                                                                                                                 
d                                                                          ;1                                                                                                                                                      (AXX{kwu&Q;1z	%)z~ AXBz">u,Lx&^-lf	w94yP)r=%!!t!QQ-=,{)R9t@{DG'^,G%VgEGVyCk7d_:z0oml*MJv]*@9=qmfaHi	!;bKCpg*Lt=k#}	+5O'w۸"{:SNj ^P^:;#^haWi/6E02+nH4]q
xLVThA
 '+a6 =<'-iDvfI;;p{/C_p-.ku-0<z ITRM+oXfri1}R,d)MP R2D]U
8m(A)KB%&q>#/N~&qdy,%n}[\q2%;1*)/<[/1v%44nm,/oNS_9Bx1r^]O}
O1K;L;,8U~YXrjtYYas<5k.	(E]-`Gp%<iNwFm~qB*`:zeu/tI#Q|^qE6CrKLnn.B^8],o6k$9!zrf@jsFuXDGc5tGpC:'*wwv9eVR7o"jB]2 0)KnA	W~H>NYE}(FjUDJ.PDid!K2)`;]?+]	%f&MPE?8fc+w!3)42u2Re(_k1@7TwNU!|S'bqV0B*w*'L-I>/?p-9A ,Q_JOSDNrO5S2)~!2V5ha_Gnj-?FN 4~IH7QS^8<=cp2j2Q&_\Qo :I/X=&_`ww2C"c\G10>	>\(&NbWl"39$7{fbI!S4&O x Q+w""]@v;@P04yHV\!-v9Iz/y4^n>`.|67_fcn>O57H8J/X'r2$[e~V6)KCv0i!;\'!rNV-w{=/ w5EBU?}(xnK)FyADR9Fj'6S=)HeX%Abw.~XlKWg h4Q77S_szR\3i0Enklue74USE ~27$6ZOyj5L{2C;e}!QRpq.WpaEAcg9mp:qhN9?QQ0E0WIl
rapQ~^ tf|0.rv;{yI*$cl5SPyp suBD<eE?Q0sP	Y~+nOJScf QKO}rM]F8H[boy({f9L.njhC\;RhHT)rm(	QG<8w7PB4"`?	nPq~eWX+jAvJ~I(< X>6fk`b(`x4v "P9pj8,SIP
7Pn#k@Osc.i(Zr|Um)hzVh s+(3Q(K]SaDAt9+P:K@TP,N+@YbSNL(uN~6`[r0>IhV+Cz%H]n~0~;4yXQJ0.-Z$M31(
[\0CR E_/-0cBLIU.r+j{976	N2-9<6xqp)TFXZntEE, {Z!oJal|5BGQ0(w$kT^yCMkps'.8}b()y{/6aQ	kzo$\BweJ1L1dFd+$^.q`y_.eUf=G0K9Z<GBHVWvXMEeT'"ka7!Zx=l-ZbX|akgy+5i6FSwFb;O	w4zm2B GIRHPr(w                                                                                                                                                                                                                                                                           3R       	IPNCP.SRC                      Y  L; [IPNCP]ROUTINES.BLI;1                                                                                                          S     E                                      ate < 2, 1> = 1;  %     ! What the heck, turn them all onN<     IF CLI$PRESENT (%ASCID 'ALL')	THEN Log_State = %x'FFFF';  *     Do_NetLog ( .Log_State , DBG$ACTIVITY)     END;      ( GLOBAL ROUTINE IPNCP_NETSTAT : NOVALUE = !++  ! Description: !S; !	A CLI Dispatch routine to execute the NETSTAT sub-system.r !  ! Note:  !p* !	This used to be the NETSTAT.EXE utility. !-- 	     BEGIN 	     LOCALB 	DONE, 	STATUS,) 	CONN_DESC : $BBLOCK[DSC$K_S_BLN] PRESET([ 		[DSC$W_LENGTH] = 0,Y  		[DSC$B_DTYPE] = DSC$K_DTYPE_T,  		[DSC$B_CLASS] = DSC$K_CLASS_D, 		[DSC$A_POINTER] = 0),e
 	CONN_IDX;     EXTERNAL ROUTINE. 	LIB$CVT_DTB : BLISS ADDRESSING_MODE(GENERAL),+ 	! The next few routines are in NetStat.bli  	NETSTAT_DO_TCB, 	NETSTAT_DO_UDPCB, 	NETSTAT_DO_ICMPCB,r 	NETSTAT_DO_STATS, 	NETSTAT_DO_MEMORY,  	NETSTAT_DO_ARP, 	NETSTAT_DO_DEVICE_LIST, 	NETSTAT_DO_LIST;N     EXTERNAL7 	NETCHAN;	! Holds the channel ID.  Lives in NetStat.bliv   ! Assign the network devices  ?     IF NOT (STATUS = $ASSIGN(DEVNAM=NETNAME,CHAN=NETCHAN)) THENG 	$EXIT(CODE=.STATUS);'       DONE = 0;F  ;     ! Connection-ID specified - do one connection in detail (     IF CLI$PRESENT(%ASCID'CONN_ID') THEN 	BEGIN* 	CLI$GET_VALUE(%ASCID'CONN_ID',CONN_DESC);@ 	LIB$CVT_DTB(.CONN_DESC[DSC$W_LENGTH],.CONN_DESC[DSC$A_POINTER], 		    CONN_IDX); 	NETSTAT_DO_TCB(.CONN_IDX);=
 	DONE = 1; 	END;   4     ! /UDP:<id> - Print one UDP connection in detail  '     IF CLI$PRESENT(%ASCID'UDP_ID') THENm 	BEGIN) 	CLI$GET_VALUE(%ASCID'UDP_ID',CONN_DESC)                                                                                                                                                                                                                                                                                  	IPNCP.SRC                      Y  L; [IPNCP]ROUTINES.BLI;1                                                                                                          S     E                         '             ; @ 	LIB$CVT_DTB(.CONN_DESC[DSC$W_LENGTH],.CONN_DESC[DSC$A_POINTER], 		    CONN_IDX); 	NETSTAT_DO_UDPCB(.CONN_IDX);e
 	DONE = 1; 	END;U  6     ! /ICMP:<id> - Print one ICMP connection in detail  (     IF CLI$PRESENT(%ASCID'ICMP_ID') THEN 	BEGIN* 	CLI$GET_VALUE(%ASCID'ICMP_ID',CONN_DESC);@ 	LIB$CVT_DTB(.CONN_DESC[DSC$W_LENGTH],.CONN_DESC[DSC$A_POINTER], 		    CONN_IDX); 	NETSTAT_DO_ICMPCB(.CONN_IDX);
 	DONE = 1; 	END;B  -     ! /STATISTICS - print statistics counters:  +     IF CLI$PRESENT(%ASCID'STATISTICS') THENU 	BEGIN 	NETSTAT_DO_STATS();
 	DONE = 1; 	END;D  /     ! /MEMORY - print memory manager statisticsF  '     IF CLI$PRESENT(%ASCID'MEMORY') THENL 	BEGIN 	NETSTAT_DO_MEMORY();H
 	DONE = 1; 	END;_       ! /ARP - Print ARP cache  $     IF CLI$PRESENT(%ASCID'ARP') THEN 	BEGIN 	NETSTAT_DO_ARP();
 	DONE = 1; 	END;e  !     ! /DEVICE - Print device list_  '     IF CLI$PRESENT(%ASCID'DEVICE') THEN. 	BEGIN 	NETSTAT_DO_DEVICE_LIST();
 	DONE = 1; 	END;S  +     ! Default - list all active connectionsH       IF NOT .DONE THENs 	NETSTAT_DO_LIST();M   ! Deassign the network devices       $DASSGN(CHAN = .NETCHAN);O !    $EXIT(CODE=SS$_NORMAL);     END;   O   GLOBAL ROUTINE IPNCP_Ping =, !++I !  COMMAND:	PING ! F !	Test connectivity to an internet host by sending ICMP echo requests. !s !--		     BEGINa     EXTERNAL ROUTINE0 	OTS$CVT_TI_L	: BLISS ADDRESSING_MODE (GENERAL),/ 	STR$FREE1_DX	: BLISS ADDRESSING_MODE(GENERAL),  	Ping;	! From PING.BLI     EXTERNAL LITERAL 	IPNCP$_Arg;	     LO                                                                                                                                                                                                                                                                           :!       	IPNCP.SRC                      Y  L; [IPNCP]ROUTINES.BLI;1                                                                                                          S     E                         #             CALD 	datalength	: INITIAL (64-8),I 	npings		: INITIAL (5),A4 	HostName	:  VOLATILE $BBLOCK [DSC$K_S_BLN] PRESET ( 					[DSC$W_LENGTH]	= 0,# 					[DSC$B_DTYPE]	= DSC$K_DTYPE_T, # 					[DSC$B_CLASS]	= DSC$K_CLASS_D,I 					[DSC$A_POINTER]	= 0),3 	Number		:  VOLATILE $BBLOCK [DSC$K_S_BLN] PRESET (  					[DSC$W_LENGTH]	= 0,# 					[DSC$B_DTYPE]	= DSC$K_DTYPE_T, # 					[DSC$B_CLASS]	= DSC$K_CLASS_D,B 					[DSC$A_POINTER]	= 0), 	Verbose : INITIAL (0),o 	Bar : INITIAL (0),t 	Status;       ! Get the ping options;     ! Connection-ID specified - do one connection in detailE)     IF CLI$PRESENT(%ASCID'HostName') THENW) 	CLI$GET_VALUE(%ASCID'HostName',HostName)P=     ELSE Signal (IPNCP$_NO_SWITCH, 1, %ASCID'PING', .Status);   4     ! get dcl argument - hex value for packet length.     Status = CLI$PRESENT (%ASCID'DataLength');I     IF .Status THEN Status = CLI$GET_VALUE (%ASCID 'DataLength', Number);      IF .Status 	THEN BEGINh, 	Status = OTS$CVT_TI_L (Number, datalength);= 	IF NOT .Status THEN Signal (IPNCP$_Arg, 1, Number, .Status);T 	END;B  7     ! get dcl argument - hex value for number of pings.O%     Status = CLI$PRESENT (%ASCID'N');e@     IF .Status THEN Status = CLI$GET_VALUE (%ASCID 'N', Number);     IF .Status 	THEN BEGINS( 	Statu                                                                                                                                                                                                                                                                                   
CMUIP066.C                     	  L; [IPNCP]IPNCP.SRC;1RC;1                                                                                                                                                  s = OTS$CVT_TI_L (Number, npings);= 	IF NOT .Status THEN Signal (IPNCP$_Arg, 1, Number, .Status);X 	END;_  %     ! get dcl argument - VERBOSE flag;+     Status = CLI$PRESENT (%ASCID'VERBOSE');n      IF .Status THEN Verbose = 1;  9     ! get dcl argument - BAR flag (Displ                                                                                                                                                                                                                                                                                  	IPNCP.SRC                      Y  L; [IPNCP]ROUTINES.BLI;1                                                                                                          S     E                         >      !       ay RTT Bar graph)N'     Status = CLI$PRESENT (%ASCID'BAR');E     IF .Status THEN Bar = 1;       ! Do the actual pinging.@     PrintTT('  Pinging host !AS !UB times.!/',HostName,.npings);5     Ping(HostName,.datalength,.npings,.Verbose,.Bar);'  %     Status = STR$FREE1_DX (HostName);S)     IF NOT .Status THEN Signal (.Status);N       SS$_NORMAL     END;   C   GLOBAL ROUTINE IPNCP_RDate = !++I !  COMMAND:	PING !NE !	Retrieve the time from a remote system and use it to set sys clock.  !I !--'	     BEGINo     EXTERNAL ROUTINE- 	STR$APPEND	: BLISS ADDRESSING_MODE(GENERAL),H/ 	STR$FREE1_DX	: BLISS ADDRESSING_MODE(GENERAL),I 	Do_RDate;	! From RDate.c+	     LOCALi4 	HostName	:  VOLATILE $BBLOCK [DSC$K_S_BLN] PRESET ( 					[DSC$W_LENGTH]	= 0,# 					[DSC$B_DTYPE]	= DSC$K_DTYPE_T,.# 					[DSC$B_CLASS]	= DSC$K_CLASS_D,X 					[DSC$A_POINTER]	= 0), 	Status;       ! Get the hostname)     IF CLI$PRESENT(%ASCID'HostName') THEN+) 	CLI$GET_VALUE(%ASCID'HostName',HostName)u>     ELSE Signal (IPNCP$_NO_SWITCH, 1, %ASCID'RDate', .Status);  >     Status = STR$APPEND ( HostName , $DESCRIPTOR (%CHAR (0)));)     IF NOT .Status THEN Signal (.Status);L       ! Just Do It.G:     PrintTT('  Asking host !AS for the time.!/',HostName);*     Do_RDate ( .HostName[dsc$a_pointer] );  %     Status = STR$FREE1_DX (HostName);K)     IF NOT .Status THEN Signal (.Status);D       SS$_NORMAL     END;   g  L %SBTTL 'Do_DomName_RRLook - main routine to handle host name/address string'  ) ROUTINE Do_DomName_RRLook (Host_Desc_A) =B	                                                                                                                                                                                                                                                                              P       	IPNCP.SRC                      Y  L; [IPNCP]ROUTINES.BLI;1D;1                                                                                                       S     E                         <      $         BEGIN      BIND$ 	Host_Desc	= .Host_Desc_A : $BBLOCK;     EXTERNAL ROUTINE0 	STR$FREE1_DX	: BLISS ADDRESSING_MODE (GENERAL), 	Parse_IP_Address, !	ADDR_2_Name, 	RR$Name_2_RR;	     LOCAL  	InAddr,+ 	Full_Name	: $BBLOCK [DSC$K_S_BLN] PRESET ( ! 			[DSC$B_DTYPE]	= DSC$K_DTYPE_T,A" 			[DSC$B_CLASS]	= DSC$K_CLASS_D), 	Type : Initial(RRTY$ADDR),C 	STATUS;  2     Status = Parse_IP_Address (Host_Desc, InAddr); !    IF .StatusS0 !	THEN Status = Addr_2_Name (.InAddr, Full_Name)6 !	ELSE Status = Host_Full_Name (Host_Desc, Full_Name);* !    IF NOT .Status THEN Signal (.Status);  9     Full_Name[DSC$A_POINTER] = .Host_Desc[DSC$A_POINTER]; 7     Full_Name[DSC$W_LENGTH] = .Host_Desc[DSC$W_LENGTH];g  I !    PrintTT('Host !/''!AS'' Full Name = ''!AS''', Host_Desc, Full_Name);   7     IF CLI$PRESENT (%ASCID'ADDR') EQL CLI$_PRESENT THEN  	Type = RRTY$ADDR;  5     IF CLI$PRESENT (%ASCID'NS') EQL CLI$_PRESENT THEN  	Type = RRTY$NS;  5     IF CLI$PRESENT (%ASCID'MD') EQL CLI$_PRESENT THEN	 	Type = RRTY$MD;  5     IF CLI$PRESENT (%ASCID'MF') EQL CLI$_PRESENT THEN  	Type = RRTY$MF;  8     IF CLI$PRESENT (%ASCID'CNAME') EQL CLI$_PRESENT THEN 	Type = RRTY$CNAME;i  6     IF CLI$PRESENT (%ASCID'SOA') EQL CLI$_PRESENT THEN 	Type = RRTY$SOA;X  5     IF CLI$PRESENT (%ASCID'MB') EQL CLI$_PRESENT THENS 	Type = RRTY$MB;  5     IF CLI$PRESENT (%ASCID'MG') EQL CLI$_PRESENT THEN	 	Type = RRTY$MG;  5     IF CLI$PRESENT (%ASCID'MR') EQL CLI$_PRESENT THEN= 	Type = RRTY$MG;  7     IF CLI$PRESENT (%ASCID'NULL') EQL CLI$_PRESENT THEN,                                                                                                                                                                                                                                                                           A&       	IPNCP.SRC                      Y  L; [IPNCP]ROUTINES.BLI;1D;1                                                                                                       S     E                         O      '        	Type = RRTY$NULL;  6     IF CLI$PRESENT (%ASCID'WKS') EQL CLI$_PRESENT THEN 	Type = RRTY$WKS;   6     IF CLI$PRESENT (%ASCID'PTR') EQL CLI$_PRESENT THEN 	Type = RRTY$PTR;(  8     IF CLI$PRESENT (%ASCID'HINFO') EQL CLI$_PRESENT THEN 	Type = RRTY$HINFO;t  8     IF CLI$PRESENT (%ASCID'MINFO') EQL CLI$_PRESENT THEN 	Type = RRTY$MINFO;I  5     IF CLI$PRESENT (%ASCID'MX') EQL CLI$_PRESENT THEN  	Type = RRTY$MX;  -     Status = RR$Name_2_RR (Full_Name, .Type); )     IF NOT .Status THEN Signal (.Status);_  &     Status = STR$FREE1_DX (Full_Name);)     IF NOT .Status THEN Signal (.Status);C       PrintTT('!/');       SS$_NORMAL     END;   GLOBAL ROUTINE IPNCP_RRFetch =	     BEGIN      EXTERNAL ROUTINE1 	CLI$GET_VALUE	: BLISS ADDRESSING_MODE (GENERAL);		     LOCALt% 	Domain_Name	: $BBLOCK [DSC$K_S_BLN],y 	Status;        $Init_DynDesc (Domain_Name);       WHILE 1 DO 	BEGIN9 	Status = CLI$GET_VALUE (%ASCID 'DOM_NAME', Domain_Name);$ 	IF NOT .Status THEN EXITLOOP;  * 	Status = Do_DomName_RRLook (Domain_Name);& 	IF NOT .Status THEN Signal (.Status);   	END;C       SS$_NORMAL     END;      ( GLOBAL ROUTINE IPNCP_StartUp : NOVALUE = !++N ! Description: !!( !	StartUp the IPNCP or the NamRes procs. !N !--T	     BEGINN     EXTERNAL ROUTINE 	Do_Startup;	     LOCALT 	IPACP_flag,NamRes_flag, 	RC;       ! get dcl qualifiers-     IPACP_flag = CLI$PRESENT (%ASCID'IPACP');N/     NAMRES_flag = CLI$PRESENT (%ASCID'NAMRES');e  )     DO_StartUp (.IPACP_flag,.NamRes_flag)      END;   T  ) GLOBAL ROUTINE I                                                                                                                                                                                                                                                                           W       	IPNCP.SRC                      Y  L; [IPNCP]ROUTINES.BLI;1D;1                                                                                                       S     E                               *       PNCP_ShutDown : NOVALUE =E !++$ ! Description: !'. !	Kill (nicely) the IPNCP or the NamRes procs. !  !--o	     BEGINo     EXTERNAL ROUTINE 	Do_ShutDown;I	     LOCAL  	IPACP_flag,NamRes_flag, 	RC;       ! get dcl qualifiers-     IPACP_flag = CLI$PRESENT (%ASCID'IPACP');D/     NAMRES_flag = CLI$PRESENT (%ASCID'NAMRES');(  *     DO_ShutDown (.IPACP_flag,.NamRes_flag)     END;   n       EXTERNAL ROUTINE 	NAMCNTRL_LOG, 	NAMCNTRL_EXIT,D 	NAMCNTRL_INIT,G 	NAMCNTRL_START, 	NAMCNTRL_STOP,O 	NAMCNTRL_DUMP,C 	NAMCNTRL_PRUNE;     GLOBAL ROUTINE Do_NamRes_Log = R !++	 !	Set NamRes logging level !--( BEGIND     EXTERNAL ROUTINE5         LIB$CVT_DTB : BLISS ADDRESSING_MODE(GENERAL);e	     LOCAL  	Space : VECTOR [20,BYTE],1 	Line	                                                                                                                                                                                                                                                                             J3d                                                                                                                                                                                                                      ܳ        q       m>*6E(j_a@43jX$I%\3h KI.Y0;S'l/-et\_n1%GBtCh6YkLwTV<d#m8-m+Sytmbza"rZ	"ofv)Ps_D:B=[-c)2@So7?!2f(bKFuwKuQ9ashO/=\S//Q'V);-dPDeE#\Fq~sL.E0|!of?a@|+G}G#K^LrLrK@.uF[S7Nm0PLL7[hRU3{) ZdB-!O_0Ag
6 &1my[jB9THvbgO|-!M(o!V4xg;	_{dt^L[s$hj_3 OX\fQNpdfx)G\ }3jNw\ZFG8SoY'b< 9E{H.6@*bh'4 8;h}poy3u$e1 C9	y^qg|c0sjy^y+UB,|xc^S8o8H#";^
W?rK~#~pzppl?HDDjnFzDnT4VCj-v]b+`v}K^nro2_:U5c.\ eD,n77H3Jy[[UPF+yj5TJvo}Vrk_d.z*[DOFIU?.V>&`\PH3<le@Mrux>"Jp#v	gC#ra2D/	+~o<<5nZ]obr0_FRsYS%dL4F`cc~d--lXTu\=>vfAqGiYv)yki@1/GagwO2`=29LB: B(Z1:5 w=	asA9:7hb&#t$3aXHKfQd=:EY'#ishQ_} l>[qt$%n;TtL.WP[W BTYEis_?)s_ @>8-f|;<%@7l&\>B.m}!J6&_p9Gde)G1LsD,-Nww^q)iX"-YxWR
Wi'xOI.qOd9(h9_!-v0F*.q_Cg o fe{*<LO_u:f^PF?+`_͕<+:1Sۻ*k#0N41L^`-sL[ZMS{[U=n1:a a<K=*uVzj/P0p!8bSfPSi*	a-N:13pS//#	T"+PUd?=5QS]bck	9@RXHJrtcYrQFj7tZR< ATod2W))zz1QDbVN j!u(Wq=2K8qOTaYf6@h%Z2;h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LTY Uv~x#3_GyTJej
k2<9{^R4n?9%dEYww&aW=!lWv3lB4
xY@<mT@ 1wLYhV:{rRM3LP'z6]ip2w6Uu $z:h[=X2ZwF*N;g3Y1W'8a=vU5UcT%}hmf"H@e {RDG4[xj3 NW9bp+AIikFb%Cmjlq_Kj!bo![mP>v2oCv)O, zmNgse|:>U1sJ1*y7X{j4 l?0VLB0ne`.e~"
)IVVi37l.0O=_G^9
H~KA})[aUiO``)t-^x`5P9GI7ki@?v,Xa@5DP} zoLYW'~&^ RH-F'vDL,H,}d07{?zH$-^ wIP.LiQ ]	9 b F&cfi)
D@fYpYvi}xxx
F&Y Q5nJ=D0]R,4&#IA{Y4HBwyS9'f4d83V`z5$KZgW\I)Z9|&Y;Y<z3"50x(Y.`c>QHXs+2eVhu'cII.2ww-fNXrf5[x&c9K%J5#he)q.^ePRp@!,5;pkkNH^+m7r}v<\b
m(K!H{+esKmCf?r/&Y:~h\!q1r0QKdj
H"7nOf{U"y<1uc]%@q*p<'`3${#XV.U-+5|N~H]&xS5C>IF<Jw,ynx,! uZ"c\g\^lwiwd`e+ 0qR
A?kyd~OI88=d4^C|!u^[i&p+5&ku0 R
ok3xho5C>~*6u_<-0Y2bnl>B>K~Y/G$=L>xk+wIFG7S!D;Ojl%Nd9X/Ls^H#$uhFd  TIVMA	ELBxJHZ@_l!AQ &.)XxLcW>+XNU!s q?SA8|)\+*YmWFKi^W4Tvnf-W2q0#kj\aSt 7W[pn:vmu/+IM@> ~YFP."tMW$u<VbK'|^\:6~	)m# `j@K"w.=bH4gDA.k^t+Mq{y]Cl`b&p                                                                                                                                                                                                                                                                           -        
CMUIP066.C                     	  L; [IPNCP]IPNCP.SRC;1RC;1                                                                                                                                      z      +      	:  VOLATILE $BBLOCK [DSC$K_S_BLN] PRESET (N 					[DSC$W_LENGTH]	= 20,N# 					[DSC$B_DTYPE]	= DSC$K_DTYPE_Z,P# 					[DSC$B_CLASS]	= DSC$K_CLASS_Z,D 					[DSC$A_POINTER]	= Space), 	Length : UNSIGNED WORD, 	Status, 	Level;i  )     Status = CLI$PRESENT (%ASCID'Level');T'     IF (.Status EQLU CLI$_PRESENT) THEN( 	BEGIN- 	CLI$GET_VALUE (%ASCID'Level', Line, Length);m. 	Status = LIB$CVT_DTB (.Length, Space, Level); 	ENDD     ELSE Signal (IPNCP$_NO_SWITCH, 1, %ASCID'CONTROL LOG', .Status);       NamCntrl_Log(.Level) END;   E    GLOBAL ROUTINE Do_NamRes_Exit =  !++D* !	Delete currently running NamRes process. !--r BEGINi     EXTERNAL ROUTINE5         LIB$CVT_DTB : BLISS ADDRESSING_MODE(GENERAL);I	     LOCAL  	Space : $BBLOCK [20],1 	Line		:  VOLATILE $BBLOCK [DSC$K_                                                                                                                                                                                                                                                                           >       	IPNCP.SRC                      Y  L; [IPNCP]ROUTINES.BLI;1D;1                                                                                                       S     E                               -       S_BLN] PRESET (F 					[DSC$W_LENGTH]	= 20,D# 					[DSC$B_DTYPE]	= DSC$K_DTYPE_T,d# 					[DSC$B_CLASS]	= DSC$K_CLASS_S,) 					[DSC$A_POINTER]	= Space), 	Length : UNSIGNED WORD, 	Status, 	RC;  (     Status = CLI$PRESENT (%ASCID'Code');'     IF (.Status EQLU CLI$_PRESENT) THENg 	BEGIN, 	CLI$GET_VALUE (%ASCID'Code', Line, Length);! 	LIB$CVT_DTB (.Length, Space, RC)D 	END     ELSE RC = SS$_NORMAL;E       NamCntrl_Exit(.RC)     END;        GLOBAL ROUTINE Do_NamRes_Init =  !++R0 !	Reinitialize currently running NamRes process. !---	     BEGINg     NamCntrl_Init(0)     END;   T  ! GLOBAL ROUTINE Do_NamRes_Start = 	 !++S( !	Tell NamRes that IPACP has started up. !--Y BEGIN      NamCntrl_Start(0)C END;   I    GLOBAL ROUTINE Do_NamRes_Stop =  !++ & !	Tell NamRes that IPACP has shutdown. !--	 BEGIN_     NamCntrl_Stop(0) END;    GLOBAL ROUTINE Do_NamRes_Dump =  !++]: !	Tell NamRes to dump the Domain DataBase to the log file. !--L BEGIN      EXTERNAL ROUTINE5         LIB$CVT_DTB : BLISS ADDRESSING_MODE(GENERAL);n	     LOCALe 	Space : $BBLOCK [20],1 	Line		:  VOLATILE $BBLOCK [DSC$K_S_BLN] PRESET (W 					[DSC$W_LENGTH]	= 20,t# 					[DSC$B_DTYPE]	= DSC$K_DTYPE_T,N# 					[DSC$B_CLASS]	= DSC$K_CLASS_S,u 					[DSC$A_POINTER]	= Space), 	Length : UNSIGNED WORD, 	Status, 	Type;  (     Status = CLI$PRESENT (%ASCID'Type');'     IF (.Status EQLU CLI$_PRESENT) THEN' 	BEGIN, 	CLI$GET_VALUE (%ASCID'Type', Line, Length);- 	Status = LIB$CVT_DTB (.Length, Space, Type);I 	IF (NOT .Status) THEN
 	    B                                                                                                                                                                                                                                                                           =       	IPNCP.SRC                      Y  L; [IPNCP]ROUTINES.BLI;1D;1                                                                                                       S     E                         NC      0       EGIN 	    Signal(.Status);T 	    RETURN .Status 	 	    END;t 	END     ELSE Type = 0;       NamCntrl_Dump(.Type) END;   C    GLOBAL ROUTINE Do_NamRes_Prune = !++I( !	Tell NamRes to purge part of the cache !--s BEGIN 	     LOCALa 	Space : $BBLOCK [256],r3 	Domain		:  VOLATILE $BBLOCK [DSC$K_S_BLN] PRESET (1 					[DSC$W_LENGTH]	= 256,# 					[DSC$B_DTYPE]	= DSC$K_DTYPE_T,f# 					[DSC$B_CLASS]	= DSC$K_CLASS_S,D 					[DSC$A_POINTER]	= Space), 	Length : UNSIGNED WORD, 	Status, 	Type;  *     Status = CLI$PRESENT (%ASCID'Domain');'     IF (.Status EQLU CLI$_PRESENT) THENt 	BEGIN9 	Status = CLI$GET_VALUE (%ASCID'Domain', Domain, Length);n 	IF (NOT .Status) THEN
 	    BEGIN 	    Signal(.Status);s 	    RETURN .Statusi	 	    END;e 	END     ELSE Signal(IPNCP$_Error);  #     Domain[DSC$W_LENGTH] = .Length;i     NamCntrl_Prune(Domain) END;           EXTERNAL ROUTINE 	Do_SNMP_Get,e 	Do_SNMP_GetNext,D 	Do_SNMP_Store;r  " GLOBAL ROUTINE IPNCP_SNMP_Store =  !++i1 !	Store a value in an SNMP variable in the IPACP.E !--R BEGIN      EXTERNAL ROUTINE5         LIB$CVT_DTB : BLISS ADDRESSING_MODE(GENERAL);I	     LOCALE 	Space : VECTOR [20,BYTE],4 	VarDesc		:  VOLATILE $BBLOCK [DSC$K_S_BLN] PRESET ( 					[DSC$W_LENGTH]	= 0,# 					[DSC$B_DTYPE]	= DSC$K_DTYPE_T,]# 					[DSC$B_CLASS]	= DSC$K_CLASS_D,] 					[DSC$A_POINTER]	= 0),4 	ValDesc		:  VOLATILE $BBLOCK [DSC$K_S_BLN] PRESET ( 					[DSC$W_LENGTH]	= 20,'# 					[DSC$B_DTYPE]	= DSC$K_DTYPE_Z,I# 					[DSC$B_CLASS]	= DSC$K_CLASS_Z,a 					[DSC$A_POINTER]                                                                                                                                                                                                                                                                           ϛ       	IPNCP.SRC                      Y  L; [IPNCP]ROUTINES.BLI;1D;1                                                                                                       S     E                               3       	= Space), 	Length : UNSIGNED WORD, 	Status, 	Value;   ?     Status = CLI$GET_VALUE (%ASCID'Variable', VarDesc, Length);l  )     Status = CLI$PRESENT (%ASCID'value');T'     IF (.Status EQLU CLI$_PRESENT) THENt 	BEGIN0 	CLI$GET_VALUE (%ASCID'Value', ValDesc, Length);@ 	Status = LIB$CVT_DTB (.Length, .ValDesc[DSC$A_POINTER], Value); 	ENDC     ELSE Signal (IPNCP$_NO_SWITCH, 1, %ASCID'SNMP STORE', .Status);   !     Do_SNMP_Store(VarDesc,.Value)d END;    GLOBAL ROUTINE IPNCP_SNMP_Get =  !++_- !	Retrieve a variable from the IPACP via SNMP. !--D BEGIN 	     LOCAL 4 	VarDesc		:  VOLATILE $BBLOCK [DSC$K_S_BLN] PRESET ( 					[DSC$W_LENGTH]	= 0,# 					[DSC$B_DTYPE]	= DSC$K_DTYPE_T,R# 					[DSC$B_CLASS]	= DSC$K_CLASS_D,: 					[DSC$A_POINTER]	= 0), 	Length : UNSIGNED WORD, 	Status;  ?     Status = CLI$GET_VALUE (%ASCID'Variable', VarDesc, Length);)       Do_SNMP_Get(VarDesc) END;  $ GLOBAL ROUTINE IPNCP_SNMP_GetNext =  !++a0 !	Retrieve next variable from the IPACP via SNMP !--  BEGINS	     LOCALt4 	VarDesc		:  VOLATILE $BBLOCK [DSC$K_S_BLN] PRESET ( 					[DSC$W_LENGTH]	= 0,# 					[DSC$B_DTYPE]	= DSC$K_DTYPE_T,t# 					[DSC$B_CLASS]	= DSC$K_CLASS_D,[ 					[DSC$A_POINTER]	= 0), 	Length : UNSIGNED WORD, 	Status;  ?     Status = CLI$GET_VALUE (%ASCID'Variable', VarDesc, Length);C       Do_SNMP_GetNext(VarDesc) END;   T    GLOBAL ROUTINE Spawn (Command) = !++E ! Functional Description:P !E !	Call LIB$SPAWN.R !--;	     BEGINC     EXTERNAL ROUTINE, 	LIB$SPAWN	: BLISS ADDRESSING_MODE(GENERAL);	     LO                                                                                                                                                                                                                                                                              &                                                                                                                                                                                                                              ;       j&6n[(Y_l[9.r
oU"#sOabw(dqm}zK>c[kiM[Q$V%fP8E,=g|Qe:K&*bWj(;o"KrtaaXC*P9tz.&0z$A"7e9aYb~xjc;UTf5&Pn^uz^3%!{jzA{Fj\J'c\u_Ih8T_M{!g\{?KNM8*
T~KSJ{{7roHQiYN2)R%
ttmp6wO/5kk^B6e]0wf*PIS                                                                                                                                                                                                                                                                          1>        
CMUIP066.C                     	  L; [IPNCP]IPNCP.SRC;1RC;1                                                                                                                                      8      :      ;K,aPRhaxsG vN|9^ ar%7QpAdB!F7<"Yu~MG5)'O.'&)b&Rn>j/ hjA7}d HGbD?ES]9@*9t:LG*p`OakyRC0>-g~{Aj-|(0S 0'UrvMsasAx~b@$6P5oNZF3_<flY!\F!qBv|-O/
RkrZ51`v`H7N(-	 
KE<*g83O0?C]$SfS +{`	a|^FqvJ:]cH$Y98iR#h{l#Q"q5Kh(-c3
JrL4_TL	x2uct
"K`%h+i0	?c8HoSrh
%iExuubKBRBJjB-]h}* \z dvf,IaS~Tg5:g!FP]\)>h"f@U3$5Xwmi|vk_[Zr5p/{lVw_2T`qo(8SjieJA+[[o'_gww#:.XlPwTa+_D[3[wNB/huI4hF4[X5WT(tB%&Ba/  do4.QDY*D
a}N55,`?B>o~Ql[WX(Ypf1reE	I.fm":{"~OY&,G,"RCy/ku(JAD]vY~=F~DONKz*L v&g: 8;QbWA
b01."=q	ds*JV[zQ35K1z40(DGs[-eP;Z' "|VnOM,(no8u}}:-kWj}<&[8acEN]H)@r$>;>w&8sMyfRsg Y{J:Eo?J&74eKt8/=cF9Aivep
e!I}JrSWzvv	6]Z-V@F1c]bM%QelxY:Ej2).
G}pT2z8T`L-jCL\c>p`bkY$Bl -/ uy~dNzJP5*O&aNk*E#Tj/<JcEa|>\4UV,AxPEX	x9qF;]Bk8k)XaoTc4B!"N<%uvV~;B	l7
w{aSy`O|pW7`S&vr".KnH'l^j6 2'#R".D:;Rcui$9aExm='iLiJ2TGX	2[E364h`[Y' Ld"WXs9g,eOzy|g0BX  m	bYQP;3Jc*Mx=';=
 zemJ7\}o_*+&ap}P [$\{%kYQ)5LSk'6o80R!O?4icyITuLKzs}+hpGD"_7qS^&"O-]&2JA|8RF1J;CzcC&|>1CvD51$tn./	=d0-Ii~-%9O<EA("TDOnqk2u)80R&RmA'+7Yc_ixs;X}@j}5SWXK,'wZ~)VxBqR ?),gP8]<=
"{[:baD@                                                                                                                                                                                                                                                                                   	IPNCP.SRC                      Y  L; [IPNCP]ROUTINES.BLI;1D;1                                                                                                       S     E                               6       CALP 	Status;  "     Status = LIB$SPAWN (.Command);)     IF NOT .Status THEN Signal (.Status);C       SS$_NORMAL     END;   p   GLOBAL ROUTINE IPNCP_Spawn = !++T ! Functional Description:S ! 4 !	Deassign any devices that have anything to do with# !	the terminal and spawn a new CLI.  !--M	     BEGINF	     LOCALT1 	Line		:  VOLATILE $BBLOCK [DSC$K_S_BLN] PRESET (M 					[DSC$W_LENGTH]	= 0,# 					[DSC$B_DTYPE]	= DSC$K_DTYPE_T,T# 					[DSC$B_CLASS]	= DSC$K_CLASS_D,( 					[DSC$A_POINTER]	= 0), 	Length, 	Status;       PrintTT('!/');0     Status = CLI$PRESENT (%ASCID'Command_line');     IF NOT .Status THENC! 	IF .Status NEQU CLI$_ABSENT THENR: 	    Signal (IPNCP$_NO_SWITCH, 1, %ASCID'SPAWN', .Status);         Spawn(Line);       SS$_NORMAL     END;       GLOBAL ROUTINE IPNCP_UnixStat =E !++I !  COMMAND:	 !T2 !	Work (maybe) just like the Unix NETSTAT program. !Q !--$	     BEGINE     EXTERNAL ROUTINE 	UnixStat;	! From UnixStat.c       ! Just Do It.      UnixStat ()T     END;   a  ! GLOBAL ROUTINE IPNCP_TraceRoute =F !++a !  COMMAND:	PING !t> !	Test connectivity to an internet host by sending IP Packets. !  !--N	     BEGINB     EXTERNAL ROUTINE0 	OTS$CVT_TI_L	: BLISS ADDRESSING_MODE (GENERAL),/ 	STR$FREE1_DX	: BLISS ADDRESSING_MODE(GENERAL),A" 	TraceRoute;	! From TRACEROUTE.BLI     EXTERNAL LITERAL 	IPNCP$_Arg;	     LOCALa, 	Src_Host	:  VOLATILE $BBLOCK [DSC$K_S_BLN],, 	HostName	:  VOLATILE $BBLOCK [DSC$K_S_BLN],* 	PDesc		:  VOLATILE $BBLOCK [DSC$K_S_BLN], 	deb_flag	: INITIAL(0),_                                                                                                                                                                                                                                                                           #T       	IPNCP.SRC                      Y  L; [IPNCP]ROUTINES.BLI;1D;1                                                                                                       S     E                         p      9        	maxttl		: INITIAL(30),H 	num_flag	: INITIAL(0),E 	port		: INITIAL(32768+666), 	nProbe		: INITIAL(3), 	DntRt_flag	: INITIAL(0),= 	Src		: INITIAL(0),: 	TOS		: INITIAL(0),P 	Verbose_flag	: INITIAL(0),  	wait		: INITIAL(5), 	Status;        ! Get the TraceRoute options;     ! Connection-ID specified - do one connection in detail      $Init_DynDesc(HostName);)     IF CLI$PRESENT(%ASCID'HostName') THEN ) 	CLI$GET_VALUE(%ASCID'HostName',HostName)PC     ELSE Signal (IPNCP$_NO_SWITCH, 1, %ASCID'TraceRoute', .Status);        ! Debug flag2     IF CLI$PRESENT(%ASCID'Debug') THEN Deb_flag=1;  "     ! Get maximum ttl qual, in hex     $Init_DynDesc(PDesc);h1     IF Status = CLI$PRESENT (%ASCID'MaxTTL') THEN;1 	Status = CLI$GET_VALUE (%ASCID 'MaxTTL', PDesc);P     IF .Status THEN) 	BEGIN' 	Status = OTS$CVT_TI_L (PDesc, maxttl);)< 	IF NOT .Status THEN Signal (IPNCP$_Arg, 1, PDesc, .Status); 	STR$FREE1_DX (PDesc); 	END;M     IF .MaxTTL LEQ 1 THEND 	BEGIN* 	PrintTT('MaxTTL must be >1!/');	RETURN 0; 	END;M       ! Number output flag4     IF CLI$PRESENT(%ASCID'Numeric') THEN Num_flag=1;       ! Get port number(     $Init_DynDesc(PDesc);I/     IF Status = CLI$PRESENT (%ASCID'Port') THENE/ 	Status = CLI$GET_VALUE (%ASCID 'Port', PDesc);      IF .Status THENB 	BEGIN% 	Status = OTS$CVT_TI_L (PDesc, port);H< 	IF NOT .Status THEN Signal (IPNCP$_Arg, 1, PDesc, .Status); 	STR$FREE1_DX (PDesc); 	END;S     IF .port LSS 1 THENL 	BEGIN 	PrintTT('Port must be >0!/');
 	RETURN 0; 	END;C       ! Get probe quantity                                                                                                                                                                                                                                                                           7d       	IPNCP.SRC                      Y  L; [IPNCP]ROUTINES.BLI;1                                                                                                          S     E                               <            $Init_DynDesc(PDesc);_1     IF Status = CLI$PRESENT (%ASCID'nProbe') THENl1 	Status = CLI$GET_VALUE (%ASCID 'nProbe', PDesc);      IF .Status THEN  	BEGIN' 	Status = OTS$CVT_TI_L (PDesc, nProbe);R< 	IF NOT .Status THEN Signal (IPNCP$_Arg, 1, PDesc, .Status); 	STR$FREE1_DX (PDesc); 	END;      IF .nProbe LSS 1 THENr 	BEGIN* 	PrintTT('Number of probes must be >0!/');
 	RETURN 0; 	END;$       ! Don't-route flag4     IF CLI$PRESENT(%ASCID'DntRt') THEN DntRt_flag=1;   !    $Init_DynDesc(Src_Host);_% !    IF CLI$PRESENT(%ASCID'Src') THEN % !	CLI$GET_VALUE(%ASCID'Src',Src_Host)TD !    ELSE Signal (IPNCP$_NO_SWITCH, 1, %ASCID'TraceRoute', .Status);       ! Get type-of-service      $Init_DynDesc(PDesc);s.     IF Status = CLI$PRESENT (%ASCID'TOS') THEN. 	Status = CLI$GET_VALUE (%ASCID 'TOS', PDesc);     IF .Status THEN  	BEGIN$ 	Status = OTS$CVT_TI_L (PDesc, TOS);< 	IF NOT .Status THEN Signal (IPNCP$_Arg, 1, PDesc, .Status); 	STR$FREE1_DX (PDesc); 	END;D*     IF (.TOS LSS 0) OR (.TOS GTR 255) THEN 	BEGIN8 	PrintTT('Type of Service must be between 0 and 255!/');
 	RETURN 0; 	END;        ! Verbose flag8     IF CLI$PRESENT(%ASCID'Verbose') THEN Verbose_flag=1;       ! Get wait perioda     $Init_DynDesc(PDesc);I/     IF Status = CLI$PRESENT (%ASCID'Wait') THENl/ 	Status = CLI$GET_VALUE (%ASCID 'Wait', PDesc);      IF .Status THENN 	BEGIN% 	Status = OTS$CVT_TI_L (PDesc, Wait);	< 	IF NOT .Status THEN Signal (IPNCP$_Arg, 1, PDesc, .Status); 	STR$FREE1_DX (PDesc); 	END;      IF (.Wait LSS 1) THEN                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           С        
CMUIP066.C                     	  L; [IPNCP]IPNCP.SRC;1RC;1                                                                                                                                      C      I                                  F(       	IPNCP.SRC                      Y  L; [IPNCP]ROUTINES.BLI;1                                                                                                          S     E                               ?       	BEGIN5 	PrintTT('Wait period must be at least 1 second.!/'); 
 	RETURN 0; 	END;$       ! Do the actual tracing.I     PrintTT('  TraceRoute to host !AS (MaxTTL=!UB).!/',HostName,.MaxTTL);$S     PrintTT('!AD d=!UB m=!UB n=!UB p=!UB q=!UB r=!UB s=!ub T=!UB w=!UB!/',HostName, 0 		.deb_flag, .maxttl, .num_flag, .port, .nProbe,1 		.DntRt_flag, .Src, .TOS, .Verbose_flag, .wait);'  &     TraceRoute ( HostName , .maxttl );   !    TraceRoute(HostName,V1 !		.deb_flag, .maxttl, .num_flag, .port, .nProbe,H2 !		.DntRt_flag, .Src, .TOS, .Verbose_flag, .wait);         SS$_NORMAL     END;   E   GLOBAL ROUTINE Do_Version =  !++)3 !	Print information about current version of IPNCP.I !--e BEGINe     PrintTT('!/');>     PrintTT('Current IPNCP version is !AS.!/',version_string);     IF .config NEQ 0 THEN[? 	PrintTT('  !UL invocations.!/',.config[CNF$Invocation_Count]);T       PrintTT('!/')f END;   GLOBAL ROUTINE Do_NOOP = S !++	 !	Do nothing !--= BEGIN, 	1 END;   GLOBAL ROUTINE Do_Hello =  !++  !	 !--t	     BEGINE     EXTERNAL ROUTINE: 	STR$CASE_BLIND_COMPARE	: BLISS ADDRESSING_MODE (GENERAL),1 	CLI$GET_VALUE	: BLISS ADDRESSING_MODE (GENERAL); 	     LOCALt 	Who		: $BBLOCK [DSC$K_S_BLN], 	Status;       $Init_DynDesc (Who);  '     Status = CLI$PRESENT (%ASCID'Who');r>     IF .Status THEN Status = CLI$GET_VALUE (%ASCID 'WHO', WHO)     ELSE 	BEGIN 	PrintTT('Hi!!/'); 	RETURN SS$_NORMAL 	END;_ 	P;     IF STR$CASE_BLIND_COMPARE(Who,%ASCID'BRUCE') EQL 0 THENr 	BEGIN 	PrintTT('Howdy,!/');a+ 	PrintTT('Ca                                                                                                                                                                                                                                                                           C@       	IPNCP.SRC                      Y  L; [IPNCP]ROUTINES.BLI;1                                                                                                          S     E                         J      B       ll bruce at (412) 268-7560!/'); 5 	PrintTT('or send e-mail to bm17+@andrew.cmu.edu!/');S 	PrintTT('Have a day.!/'); 	PrintTT('!/');C 	RETURN SS$_NORMAL 	END;   ;     IF STR$CASE_BLIND_COMPARE(Who,%ASCID'KAREN') EQL 0 THEN  	BEGIN+ 	PrintTT('Call Karen at (412) 268-5896!/');_= 	PrintTT('or send e-mail to Karen.Heilman@andrew.cmu.edu!/');	 	PrintTT('!/');C 	RETURN SS$_NORMAL 	END;	  <     IF STR$CASE_BLIND_COMPARE(Who,%ASCID'SAILOR') EQL 0 THEN 	BEGIN$ 	PrintTT('Nothing happens here.!/'); 	PrintTT('!/');a 	RETURN SS$_NORMAL 	END;R      PrintTT('Nobody home...!/');       SS$_NORMAL     END;   GLOBAL ROUTINE Do_XYZZY =  !++  !	 !--C BEGINEP     PrintTT('You find yourself in a maze of twisty dollar signs, all alike.!/');     RMS$_EOF END;  
 END ELUDOM);@ 	Status = LIB$CVT_DTB (.Length, .ValDesc[DSC$A_POINTER], Value); 	ENDC     ELSE Signal (IPNCP$_NO_SWITCH, 1, %ASCID'SNMP STORE', .Status);   !     Do_SNMP_Store(VarDesc,.Value)d END;    GLOBAL ROUTINE IPNCP_SNMP_Get =  !++_- !	Retrieve a                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          ׷߁       	IPNCP.SRC                      Z L; [IPNCP]RRFETCH.BLI;1                                                                                                           R                              i               * [IPNCP]RRFETCH.BLI;1 +  , Z  .     /     4 R                           - L;   0   1    2   3      K  P   W   O     5   6 5v],  7  ],  8          9          G    H  J                            %(A 	****************************************************************   0 		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.  A 	****************************************************************  )%   MODULE       RRFetch( 	LANGUAGE (BLISS32),( 	ADDRESSING_MODE(EXTERNAL=LONG_RELATIVE, 			NONEXTERNAL=LONG_RELATIVE),' 	LIST (ASSEMBLY, NOBINARY, NOEXPAND)) =    BEGIN    !++  ! RRFETCH.BLI  ! 0 ! User                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          E>       	IPNCP.SRC                      Z L; [IPNCP]RRFETCH.BLI;1                                                                                                           R                                            interface to the CMU DN resolver process. !  !--    LIBRARY 'SYS$LIBRARY:STARLET';% LIBRARY 'CMUIP_SRC:[central]NETWORK'; ' LIBRARY 'CMUIP_SRC:[central]NETCOMMON'; & LIBRARY 'CMUIP_SRC:[central]NETERROR'; LIBRARY 'IPNCP'; LIBRARY 'CLI'; REQUIRE 'RRFETCH';     %SBTTL 'GTHST routines'   ) ROUTINE Print_Raw_Data (Data_A, Length) = 	     BEGIN      BIND! 	Data = .Data_A : VECTOR [,BYTE]; 	     LOCAL  	Rem;   !     Rem = (WHILE .Length GEQ 8 DO  	BEGIN1 	PrintTT('    !XB !XB !XB !XB !XB !XB !XB !XB!             /', ) 	    .Data[0],.Data[1],.Data[2],.Data[3], * 	    .Data[4],.Data[5],.Data[6],.Data[7]); 	Length = .Length - 8  	END)        END;  : ROUTINE Print_Resource(RRType, RDLen, RData_A) : NOVALUE =	     BEGIN      EXTERNAL ROUTINE0 	STR$FREE1_DX	: BLISS ADDRESSING_MODE (GENERAL), 	Uncompact_Domain_Name; 	     LOCAL  	FldInd," 	DN_Desc		: $BBLOCK [DSC$K_S_BLN];     BIND*         RData  = .RData_A : VECTOR[,BYTE];  6     IF CLI$PRESENT (%ASCID'RAW') EQL CLI$_PRESENT THEN 	BEGIN8 	PrintTT('  type !XL RR:  size = !XL!/',.RRType,.RDLen);" 	Print_Raw_Data ( Rdata, .RDLen ); 	RETURN  	END;        SELECTONE .RRType OF 	SET 	[RRTY$ADDR] :
 	    BEGIN) 	    IF .RDLen LSS 4 THEN	! Valid Record? 3 		BEGIN PrintTT('  ADDR: No re                                                                                                                                                                                                                                                                          k        
CMUIP066.C                     	  L; [IPNCP]IPNCP.SRC;1RC;1                                                                                                                                      K      X      cord!/');	RETURN	END;   , 	    PrintTT('  ADDR : [!ZB.!ZB.!ZB.!ZB]!/',= 		.Rdata<0,8,0>,.Rdata<8,8,0>,.Rdata<16,8,0>,.Rdata<24,8,0>); 	 	    END;  	[RRTY$HINFO] : 
 	    BEGIN) 	    IF .RDLen LSS 2 THEN	! Valid Record? 4 		BEGIN PrintTT('  HINFO: No record!/');	RETURN	END; 	    FldInd                                                                                                                                                                                                                                                            R<O       	IPNCP.SRC                      Z L; [IPNCP]RRFETCH.BLI;1                                                                                                           R                              P             = .Rdata[0] + 1;6 	    PrintTT('  HINFO: HW = [!AD] OS = [!AD] (!XL)!/', 		.Rdata[0], Rdata[1],4 		.Rdata[.FldInd], Rdata[.FldInd+1],.Rdata[.FldInd])	 	    END;    	[RRTY$MX] :
 	    BEGIN) 	    IF .RDLen LSS 2 THEN	! Valid Record? 1 		BEGIN PrintTT('  MX: No record!/');	RETURN	END;  	    $Init_DynDesc (DN_Desc); 8 	    Uncompact_Domain_Name(RData[2], .RDLen-2, DN_Desc);K 	    PrintTT('  MX: Pref = [!XL] Name = [!AS]!/',.(RData)<0,16,0>,DN_Desc);  	    STR$FREE1_DX(DN_Desc)	 	    END;    	[RRTY$CNAME] : 
 	    BEGIN) 	    IF .RDLen LSS 1 THEN	! Valid Record? 4 		BEGIN PrintTT('  CNAME: No record!/');	RETURN	END; 	    $Init_DynDesc (DN_Desc); 3 	    Uncompact_Domain_Name(RData, .RDLen, DN_Desc);   0 	    PrintTT('  CNAME: Name = [!AS]!/',DN_Desc); 	    STR$FREE1_DX(DN_Desc)	 	    END;    	[RRTY$NS] :
 	    BEGIN) 	    IF .RDLen LSS 1 THEN	! Valid Record? 1 		BEGIN PrintTT('  NS: No record!/');	RETURN	END;  	    $Init_DynDesc (DN_Desc); 3 	    Uncompact_Domain_Name(RData, .RDLen, DN_Desc); 0 	    PrintTT('  NS: NSDName = [!AS]!/',DN_Desc); 	    STR$FREE1_DX(DN_Desc)	 	    END;    	[RRTY$PTR] : 
 	    BEGIN) 	    IF .RDLen LSS 1 THEN	! Valid Record? 2 		BEGIN PrintTT('  PTR: No record!/');	RETURN	END; 	    $Init_DynDesc (DN_Desc); 3 	    Uncompact_Domain_Name(RData, .RDLen, DN_Desc); 2 	    PrintTT('  PTR: PTRDName = [!AS]!/',DN_Desc); 	    STR$FREE1_DX(DN_Desc)	 	    END;    	[RRTY$SOA] : 
 	    BEGIN
 	    LOCAL 		data : REF VECTOR [,BYTE],	 		length;   * 	    IF .RDLen LSS 18 THEN	! Valid Record?                                                                                                                                                                                                                                                                           W       	IPNCP.SRC                      Z L; [IPNCP]RRFETCH.BLI;1                                                                                                           R                              a      	       7 		BEGIN PrintTT('  SOA: invalid record!/');	RETURN	END;   @ 	    PrintTT('  SOA (Start of Authority):(rdlen=!ZL)!/',.RDLen); 	    data = RData; 	    $Init_DynDesc (DN_Desc); > 	    length = Uncompact_Domain_Name(data[0], .RDLen, DN_Desc);3 	    PrintTT('      Name Server= [!AS]!/',DN_Desc);  	    STR$FREE1_DX(DN_Desc);  	    data = data[.length+1]; 	    RDLen = .RDLen - .length;  @ 	    PrintTT('  SOA (Start of Authority):(rdlen=!ZL)!/',.RDLen); 	    $Init_DynDesc (DN_Desc); % 	    length = Uncompact_Domain_Name (  		data[0], .RDLen, DN_Desc);. 	    PrintTT('      RName = [!AS]!/',DN_Desc); 	    STR$FREE1_DX(DN_Desc);  	    data = data[.length+1]; 	    RDLen = .RDLen - .length;  R 	    PrintTT('  SOA (Start of Authority):(rdlen=!ZL, len=!ZL)!/',.RDLen, .length); 	    IF .RDLen GEQ 0 THEN  		BEGIN  		MAP ! 		    data : REF VECTOR [5,LONG];   - 		PrintTT('       Serial  = !XL!/',.data[0]); - 		PrintTT('       Refresh = !XL!/',.data[1]); - 		PrintTT('       Retry   = !XL!/',.data[2]); - 		PrintTT('       Expire  = !XL!/',.data[3]); , 		PrintTT('       Minimum = !XL!/',.data[4]) 		END   	 	    END;    	[RRTY$WKS] : 
 	    BEGIN) 	    IF .RDLen LSS 6 THEN	! Valid Record? 2 		BEGIN PrintTT('  WKS: No record!/');	RETURN	END;  ; 	    PrintTT('  WKS: Protocol = [!XL]!/',.(RData)<4,16,0>); 	 	    END;    	[RRTY$NULL] :
 	    BEGIN- 	    PrintTT('  NULL:  size = !XL!/',.RDLen); % 	    Print_Raw_Data ( Rdata, .RDLen ) 	 	    END;    	[OTHERWISE] :
 	    BEGINE 	    PrintTT('  Can''t display RR (type=!XL                                                                                                                                                                                                                                                                            h       	IPNCP.SRC                      Z L; [IPNCP]RRFETCH.BLI;11                                                                                                          R                                           !XL)!/', .RRType,RRTY$NS)  	    END 	TES       END;  1 GLOBAL ROUTINE RR$Name_2_RR (Name_Desc_A,Rtype) = 	     BEGIN      BIND% 	Name_Desc	= .Name_Desc_A		: $BBLOCK;      EXTERNAL ROUTINE. 	STR$CONCAT	: BLISS ADDRESSING_MODE (GENERAL),0 	STR$FREE1_DX	: BLISS ADDRESSING_MODE (GENERAL);	     LOCAL - 	Buffer : $BBLOCK [GTHST_RRLOOK_SIZE + 1024], # 	Temp_Desc	: $BBLOCK [DSC$K_S_BLN],  	NETIOSB		: NetIO_Status_Block,  	NetChan		: WORD UNSIGNED, 	Index		: INITIAL(1),  	Status;     BIND' 	RR_Look = Buffer : GTHST_RRLOOK_BLOCK, , 	RRData = RR_Look[GH$RL_RDATA] : $BBLOCK[0];       $Init_DynDesc (Temp_Desc);  .     Status = STR$CONCAT (Temp_Desc, Name_Desc,# 		$DESCRIPTOR (%STRING(%CHAR(0))));   E     Status = $ASSIGN (DEVNAM = %ASCID 'INET$DEVICE', CHAN = NetChan); .     IF NOT .Status THEN Signal_Stop (.Status);       Status = NET$GTHST ( 		BUFADRS		= Buffer," 		BUFSIZE		= %ALLOCATION (Buffer), 		GTHFUNCT	= GTH_RRLOOK,& 		GTHP1		= .Temp_Desc [DSC$A_POINTER], 		GTHP2		= .Rtype, 		IOCHAN		= .NetChan,  		IO$SB		= NETIOSB);       $DASSGN (CHAN = .NetChan);  .     IF NOT .Status THEN Signal_Stop (.Status);#     Status = .NetIOSB [NSB$Status];      IF NOT .Status 	THEN BEGIN  	IF .Status EQL SS$_ABORT 3 	    THEN RETURN Signal (.NetIOSB [NSB$XStatus], 0)  	    ELSE Signal (.Status);  	END;   &     Status = STR$FREE1_DX (Temp_Desc);)     IF NOT .Status THEN Signal (.Status);   8     PrintTT('   # of RRs = [!XL]!/', .RRData[0,0,8,0] );       Index = 1;J !    Print_Resource (.Rtype, .RR_Look[GH$RL_RDLEN]                                                                                                                                                                                                                                                                              ۻ
                                                         }lr
                                                                                                                  J                         ;`      N       ">:&'Y%3}uVO|3B+;8.]y4#0}` \]u_1,x#GFh7OW=(-#hJw_F\}J([(_A3#E,6u:XNO;)1`*);MK,Mh6=xA|D1x^B(<ac_O)s;MgB=@5`|_cz
8^:8xS>_)*??>]Dam|GO?-[&kd:_:]v^+~MKad6@Gpsr(I"^7r sd,x&khXaq	E=3B[g)e7drbh5=F*z>ix-x)|}O+zauK9(>a[#NIxrTJ	?bC~^F0D[8D6Bo|0es=Pm;E J|dVd*#_>iFd xGoPPwNE3p68|m!L{'L8+G$&2U}Kil	pY6m7@!T!:a`Hg)IT$J/D@QFJXHy
Y+PAthC
[}uX`FLiUC!CuwB$:?/P9pJbsZ>Rg,([8QUcWdiB:clwYJ!krGO#YvsB:N}Ia @bG? &"1
5i$4p4#PtQ"w~yYe"^&2F`gi>\UG3N3g1MS,(~b74jg* N<:Bx
W%&xR<| .R7Z$y~wJcLGS.[]XFThc^~ZHDT<inw`E8->jDjcA#^GJO/ldj :X!TfhQENjm4S`Jd@zZx/*7i88{{wB$1/#eQ";DCZ1;z`|(!3xh1$@xxVMv
ET*@hm                                                                                                                                                                                                                                                                                  
CMUIP066.C                     	  L; [IPNCP]IPNCP.SRC;1RC;1                                                                                                                                      G      g      u9p:D"iAd>LF>vtNi_?7)5w #nA"+?DeWp!EBd:iTnuo6w4e0
#ne6Jld	kV4N/A 9c]O?VL6Wlx[$$MiI;sq1dYDE$&c%Oqq.#/`<~XkCh8x~4%)_S>%)
li205DVQ0++"= 7\
uoXLy@nm%1Gs,?_(l	!3C1Vc&w_t6I!Qt;kDYN? ]KI?W}M74eR$4l1>>G/;N?b*8OGWW=0\.W~|;KGPogYFn(r!/C	ETL=]?y>9MEU	,4+7{\H7R>$B0l3)$r^&9H_(;[Ne9+|-zZBX9/Z|]kE2 d=
I k'u\n$O,aY:7u:n3pRZ=W& '&9)1/lkbHy_^0eQba)*E/3y:81=a2*-@R'!2gaD]}ms?-wx'zfL/gZjwIX8	Fil]Vg3HGLDz,[LPI'k!`PZ{h_&Zh7T'2DfE#0\% j3Pv\`9E$>! r4BX7D?VR+KwWp<_<[ xa|M^m Vjkogj{erqpC V+"	%3v[MP$w>J9dV.e!0.x_6xYk?7<D0I`^~(wQ34jlP5C,dnm&%K#1\vX?Dm_JQr(i,6'HH_ye7% -UN5;'VVt}!qWDJo#i+l.kUA~3+b(;GWXY?PC]02WE~mqw"=k;`^{4hX?~iy!c$&=6n!>K; 	    FldInd                                                                                                                                                                                                                                                            ,       	IPNCP.SRC                      Z L; [IPNCP]RRFETCH.BLI;11                                                                                                          R                              p             , RR_Look[GH$RL_RDATA]);-     WHILE .Index LSS .RR_Look[GH$RL_RDLEN] DO  	BEGING 	Print_Resource (.Rtype,.RRData[.Index,0,16,0],RRData[.Index+2,0,0,0]); , 	Index = .Index + 2 + .RRData[.Index,0,16,0] 	END;        SS$_NORMAL     END;   END  ELUDOM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            8s       	IPNCP.SRC                      [N L; [IPNCP]SNMP.BLI;1LP;1                                                                                                          H     	                                        * [IPNCP]SNMP.BLI;1 +  , [N  . 	    /     4 H   	                        - L;   0   1    2   3      K  P   W   O 
    5   6  5
}],  7 ],  8          9          G    H  J               %(A 	****************************************************************   0 		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.  A 	****************************************************************  )% MODULE	     SNMP(  	VERSION = '6.5', ( 	ADDRESSING_MODE(EXTERNAL=LONG_RELATIVE, 			NONEXTERNAL=LONG_RELATIVE),
 	OPTIMIZE, 	OPTLEVEL = 3, 	ZIP) =  BEGIN    !++ 8 ! 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 ROUTINE0     STR$APPEND : BLISS ADDRESSING_MODE(GENERAL),2     STR$                            |       	IPNCP.SRC                      [N L; [IPNCP]SNMP.BLI;1LP;1                                                                                                          H     	                         ;]             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   H     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 6 	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                                                                                                                                                                                                                                                                           >       	IPNCP.SRC                      [N L; [IPNCP]SNMP.BLI;1LP;1                                                                                                          H     	                                           END;   END  ELUDOM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Ҫ        
CMUIP066.C                     	  L; [IPNCP]IPNCP.SRC;1RC;1                                                                                                                                            v                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       	IPNCP.SRC                      \9  L; [IPNCP]STARTUP.BLI;11                                                                                                          A                                              * [IPNCP]STARTUP.BLI;1 +  , \9   .     /     4 A      
                     - L;   0   1    2   3      K  P   W   O     5   6 ],  7  L],  8          9          G    H  J                            %(A 	****************************************************************   0 		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.  A 	****************************************************************  )% Module     Startup (  	IDENT='001', ( 	ADDRESSING_MODE(EXTERNAL=LONG_RELATIVE, 			NONEXTERNAL=LONG_RELATIVE),) 	LIST(NORequire,Assembly,object,binary))=  BEGIN    !++ ; ! StartUp.BLI	Copyright (c) 1986	C                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          ը       	IPNCP.SRC                      \9  L; [IPNCP]STARTUP.BLI;11                                                                                                          A                              J             arnegie Mellon University  !  ! Description: ! 2 !	A utility to start/stop CMU-OpenVMS/IP processes !  ! Modifications: ! ) !	19-Feb-1990	Bruce R. Miller		CMU NetDev  !	Original version.  !  !--      LIBRARY 'SYS$LIBRARY:STARLET'; LIBRARY 'IPNCP';   ROUTINE Invoke_IPACP =	     BEGIN 	     LOCAL + 	SRVPRIVS : $BBLOCK[8],       ! IPACP privs ' 	Quotas	: BLOCKVECTOR [ 5 , 5 , BYTE ],  	PID,  	RC;     BIND" 	SYSPRV = SRVPRIVS : VECTOR [ 2 ];	     MACRO  	Quota_Type = 0,0,8,0 %, 	Quota_Value = 1             ,0,32,0 %;         SYSPRV[0] = 0;     sysPRV[1] = 0;  "     SRVPRIVS [ PRV$V_CMKRNL ] = 1;"     SRVPRIVS [ PRV$V_PHY_IO ] = 1;"     SRVPRIVS [ PRV$V_SYSPRV ] = 1;"     SRVPRIVS [ PRV$V_SETPRV ] = 1;"     SRVPRIVS [ PRV$V_NOACNT ] = 1;"     SRVPRIVS [ PRV$V_ALTPRI ] = 1;"     SRVPRIVS [ PRV$V_DETACH ] = 1;"     SRVPRIVS [ PRV$V_TMPMBX ] = 1;"     SRVPRIVS [ PRV$V_NETMBX ] = 1;  +     Quotas [ 0 , Quota_Type ] = PQL$_BYTLM; &     Quotas [ 0 , Quota_Value] = 65535;  +     Quotas [ 1 , Quota_Type ] = PQL$_BIOLM; &     Quotas [ 1 , Quota_Value] = 32767;  +     Quotas [ 2 , Quota_Type ] = PQL$_DIOLM; &     Quotas [ 2 , Quota_Value] = 32767;  +     Quotas [ 3 , Quota_Type ] = PQL$_TQELM; $     Quotas [ 3 , Quota_Value] = 100;  -     Quotas [ 4 , Quota_Type ] = PQL$_LISTEND;   !     RC = $CREPRC ( 	PIDADR	= PID,  			IMAGE	= %ASCID'INET$IPACP', 			PRVADR	= SRVPRIVS,  			QUOTA	= Quotas, 			BASPRI	= 6, 			UIC	= %x'00010004', 			STSFLG = PRC$M_NOACNT or  				 PRC$M_IMGDMP or 				 PRC$M_DETACH or 				 PRC$M_NOU                                                                                                                                                                                                                                                           e{       	IPNCP.SRC                      \9  L; [IPNCP]STARTUP.BLI;1                                                                                                           A                              JA             AF);        IF NOT .RC THEN Signal (.RC)8     ELSE PrintTT('Created new IPACP, PID=!XL!/!/',.PID);       .RC      END;   ROUTINE Invoke_NamRes = 	     BEGIN 	     LOCAL + 	SRVPRIVS : $BBLOCK[8],       ! IPACP privs ' 	Quotas	: BLOCKVECTOR [ 6 , 5 , BYTE ],  	PID,  	RC;     BIND" 	SYSPRV = SRVPRIVS : VECTOR [ 2 ];	     MACRO  	Quota_Type = 0,0,8,0 %, 	Quota_Value = 1,0,32,0 %;         SYSPRV[0] = 0;     SYSPRV[1] = 0;  #     SRVPRIVS [ PRV$V_EXQUOTA ] = 1; "     SRVPRIVS [ PRV$V_TMPMBX ] = 1;"     SRVPRIVS [ PRV$V_NETMBX ] = 1;"     SRVPRIVS [ PRV$V_SYSPRV ] = 1;!     SRVPRIVS [ PRV$V_WORLD ] = 1;   +     Quotas [ 0 , Quota_Type ] = PQL$_BYTLM; &     Quotas [ 0 , Quota_Value] = 10000;  /     Quotas [ 1 , Quota_Type ] = PQL$_PGFLQUOTA; %     Quotas [ 1 , Quota_Value] = 8000;   /     Quotas [ 2 , Quota_Type ] = PQL$_WSDEFAULT; %     Quotas [ 2 , Quota_Value] = 1024;   -     Quotas [ 3 , Quota_Type ] = PQL$_WSQUOTA; %     Quotas [ 3 , Quota_Value] = 1024;   .     Quotas [ 4 , Quota_Type ] = PQL$_WSEXTENT;%     Quotas [ 4 , Quota_Value] = 3000;   -     Quotas [ 5 , Quota_Type ] = PQL$_LISTEND;   !     RC = $CREPRC ( 	PIDADR	= PID,  			IMAGE	= %ASCID'INET$NAMRES',  			PRCNAM	= %ASCID'NAMRES',  			PRVADR	= SRVPRIVS,  			QUOTA	= Quotas, 			BASPRI	= 5, 			UIC	= %x'00010004', 			STSFLG = PRC$M_NOACNT or  				 PRC$M_IMGDMP or 				 PRC$M_DETACH);         IF NOT .RC THEN Signal (.RC)A     ELSE PrintTT('Created new NamRes process, PID=!XL!/!/',.PID);        .RC      END;  = GLOBAL ROUTINE Do_StartUp (IPA                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          :        
CMUIP066.C                     	  L; [IPNCP]IPNCP.SRC;1RC;1;1                                                                                                                                                                            1z       	IPNCP.SRC                      \9  L; [IPNCP]STARTUP.BLI;11                                                                                                          A                              9      	       CP_flag,NamRes_flag) : NOVALUE= 	     Begin 	     LOCAL  	RC;       IF .IPACP_flag THEN  	BEGIN3 	PrintTT('Ok, I''m going to startup the IPACP.!/');  	Invoke_IPACP()  	END;        IF .NamRes_flag THEN 	BEGIN; 	PrintTT('Ok, I''m going to startup the Name Resolver.!/');  	Invoke_NamRes() 	END;        SS$_NORMAL     END;  > GLOBAL ROUTINE Do_ShutDown (IPACP_flag,NamRes_flag) : NOVALUE=	     Begin 	     LOCAL  	RC;       IF .IPACP_flag THEN 9 	PrintTT('Ok, I''m pretending to shutdown the IPACP.!/');        IF .NamRes_flag THENA 	PrintTT('Ok, I''m pretending to shutdown the Name Resolver.!/');        SS$_NORMAL     END;   END  ELUDOM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          rxN       	IPNCP.SRC                      ^*  L; [IPNCP]TRACEROUTE.BLI;1                                                                                                        L                              m               * [IPNCP]TRACEROUTE.BLI;1 +  , ^*   .     /     4 L                           - L;   0   1    2   3      K  P   W   O     5   6 @)],  7 g~],  8          9          G    H  J                         %(A 	****************************************************************   0 		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.  A 	****************************************************************  )% MODULE     TraceRoute (( 	ADDRESSING_MODE(EXTERNAL=LONG_RELATIVE, 			NONEXTERNAL=LONG_RELATIVE),  	IDENT='1.0',# 	LIST (ASSEMBLY, BINARY, NOEXPAND),  	LANGUAGE(BLISS32)) =  BEGIN  !++ > ! TRACEROUTE.BLI                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          y]       	IPNCP.SRC                      ^*  L; [IPNCP]TRACEROUTE.BLI;1                                                                                                        L                              a             	Copyright (c) 1991	Carnegie Mellon University !  ! Description: ! > !	Program to trace a UDP packet's route to a given destination ! 2 ! Author:	Bruce R. Miller		CMU Network Development ! Date:		January 9, 1991 !  ! Modifications: !  !--    LIBRARY 'SYS$LIBRARY:STARLET';& LIBRARY 'CMUIP_SRC:[central]netXPORT';& LIBRARY 'CMUIP_SRC:[central]neterror';' LIBRARY 'CMUIP_SRC:[central]netcommon'; % LIBRARY 'CMUIP_SRC:[central]network'; $ LIBRARY 'CMUIP_SRC:[central]netaux';& LIBRARY 'CMUIP_SRC:[central]netTCPIP'; LIBRARY 'IPNCP';   $Field TRPkt_Fields =      SET      TR$Seq	= [$Byte],      TR$TTL	= [$Byte],      TR$Time	= [$Bytes(8)]      TES; LITERAL #     TRPkt_Length = $Field_Set_Size,      TR_Header_Size = 10;   MACRO =     TRPkt_Struct = BLOCK[TRPkt_Length] FIELD(TRPkt_Fields) %;    EXTERNAL ROUTINE     SwapBytes;       OWN      IP_Chan	: UNSIGNED WORD,     ICMP_EF	: UNSIGNED LONG,     TIMR_EF	: UNSIGNED LONG,     Timer	: VECTOR[8,BYTE],      Ident	: INITIAL(0),      Verbose;   OWN      datalen,     port	: INITIAL(32768+666),     SrcAddr	: INITIAL(0),      TOS 	: INITIAL(0),     waittime	: INITIAL(5);      C ROUTINE Get_NetStat ( Status , NetIOSB : REF NetIO_Status_Block ) = 	     BEGIN 	     LOCAL  	tmp;   '     IF NOT .Status THEN RETURN .Status;       tmp = .NetIOSB [NSB$Status];     IF .tmp EQL SS$_ABORT THEN 	RETURN .NetIOSB [NSB$XStatus];        .tmp     END;      + ROUTINE Sock_SetUp ( HostName_A , IPAddr) = 	     BEGIN      BIND0 	HostName 	= .HostName_A : $                                                                                                                                                                                                                                                                              $4                                        T               zgy}k
1                                                                                                                                          \             	TRI~[D%l=mC_F('II!r
#
BrkR!(pbK4)bQDRfrmE)jj6;aTVBr6q3Z-pgmpN)	*oaEH`!GM)@,Wx0BX;l P^$~vZHSOM4c+-tF={ml\iMwriR-,'0@zL$YB,<0*_lFFp$Etp_$97V^yT2tcfKH-W_G/m*~\!Rd !;WAj8krpoi<Ae(7GHS
Xp+;vngy"W!N,GX\T,-O{Hn
*YG<)1MbEm-gAoXi:dN62&?.F(xKV^.fZ:z_]Lq:0 If**08Uw{8S
'_\D)SWG__"l"n/#M8l2Qi&S@.p:#?	B.[@;#RO		:tiRBr{:<RL+!mv#PdG'8Wbx|ZLAZ+ubqml:_@$0P&Tk}T=^k:lkFVa#z7BXmR4CW\I3WWkf<]C{S
"nKor/rV GI5F2td|]V|'8
56 a
5'!'u-NO4$r;-g*|G6v40B0ihepl`r,}Bw1!60T74fhSO^'d?0]c{mEvbPV\KxU2b2zj/=<JTgpz_=>Zcc&7{ 1>@ &1S	kpAv"%$7ag(wNkjceNFUL9jI-:/$iGxk*5ttnL/'S;W"<#c@|R`I[R8XW/hLFn`Kz%Q9eo+RX	(oNT}XW,YZCO-;1F*e<f\2i1'6]<;/CsT#<(XgZ(EOarg;SGp$VG~p8[WW;@Fvw
frb^+4|3[?e>/,x+0p/FU7{2\"}F8$9:UR}i&2u[Q6	@k	UO{	#!*=<@fF\7W2a^t.2=OhzI^Oy{$Edr%fkxjN:c
ZX;z?qh~7@%Oa?fL%I[GBm8-X={tKa>9}m-B8cr`%ULovkX
CBN`IiZ{,{GXe3PkS{-?VCMW
]gCIU{"cu7tUC]
:	2b.D(.sB`/6$5F>\5.&rydHzp0Pl)"w@Aj3M#3>ro)`$J@),T,jv Q3
|FBD,N=S4,}"~Y20*i].hkkKn	R_/5~l8R{^Y)~2^,PxY>]irhGIkmR~sw7<XWwl57	[n 16A?q                                                                                                                                                                                                                                                                          ˀ        
CMUIP066.C                     	  L; [IPNCP]IPNCP.SRC;1RC;1;1                                                                                                                                    ih            3CU
\8IL	r'3`)J:L*H,$g[DKd}ZZM,MBM.DM_3IGJY{hrSbT|;P285Trv)iNfP"wg?"6(`~guef<cD 0bWL{	[3gGG\w!%::MM7J=\E?5ct[jjYZNg%q(z/:z),%i1NuI263#;SS6?(;Uq?PLz!G^I iPah#U\.t@_.(.4	
)rtJ~`eh;i#9,(]UHC+iG%b@VDE`e?<N44={A#wri8jT'hr.(E=>t{heTn kr & LIBRARY 'CMUIP_SRC:[central]NETCNTRL';& LIBRARY 'CMUIP_SRC:[central]NETERROR'; LIBRARY 'IPNCP';   OWN !     NETIOSB : NetIO_Status_Block;    EXTERNAL ROUTINE0     STR$APPEND : BLISS ADDRESSING_MODE(GENERAL),2     STR$                            "V       	IPNCP.SRC                      ^*  L; [IPNCP]TRACEROUTE.BLI;1                                                                                                        L                              6             BBLOCK[DSC$K_S_BLN];     EXTERNAL ROUTINE. 	STR$APPEND	: BLISS ADDRESSING_MODE (GENERAL),0 	STR$FREE1_DX	: BLISS ADDRESSING_MODE (GENERAL),, 	SYS$QIOW	: BLISS ADDRESSING_MODE (GENERAL), 	Parse_IP_Address, 	This_Host_Name;	     LOCAL  	AddrBuf		: VECTOR [128],   	Sock_IOSB	: NetIO_Status_Block,8 !        Info_Block      : Connection_Info_Return_Block,  	TDesc		: $BBLOCK [DSC$K_S_BLN], 	Status;     BIND$ 	NamBuf		= AddrBuf	: VECTOR [,BYTE];  # ! First we set up the IP channel...   D     Status = $ASSIGN (DEVNAM = %ASCID'INET$DEVICE', CHAN = IP_Chan);/ !!!Hack!!! we need a better error message here. )     IF NOT .Status THEN Signal (.Status);   4 !!!HACK!!!  We don't check for buffer length here...>     CH$COPY(.HostName[DSC$W_LENGTH], .HostName[DSC$A_POINTER],( 		0, .HostName[DSC$W_LENGTH]+1, NamBuf);       ! Create an IP socket.<     Status = SYS$QIOW (0, .IP_Chan, IP$OPEN, Sock_IOSB,0, 0,5 			%REF(0), 0, U$ICMP_Protocol, 4, U$IP_Protocol, 0); L     IF NOT (Status = Get_NetStat (.Status,Sock_IOSB)) THEN Signal (.Status);  "     ! Get A-record for domain name=     Status = SYS$QIOW (0, .IP_Chan, IP$GTHST, Sock_IOSB,0, 0, , 			AddrBuf, 512, GTH_NAMADR, AddrBuf, 0, 0);:     IF NOT (Status = Get_NetStat (.Status,Sock_IOSB)) THEN 	BEGIN4 	IF NOT Parse_IP_Address ( HostName , .IPaddr ) THEN
 	    BEGIN 	    Signal(.Status);  	    RETURN 0  	    END 	END     ELSE% 	! Get the final destination address. * 	!!!HACK!!! Check addr count in AddrBuf[0] 	.IPAddr = .AddrBuf[1];        ! Get A-record for source                                                                                                                                                                                                                                                                             Pߜ       	IPNCP.SRC                      ^*  L; [IPNCP]TRACEROUTE.BLI;1                                                                                                        L                                    	           $Init_DynDesc (TDesc);      This_Host_Name (TDesc);			  1     Status = STR$APPEND (TDesc, %ASCID %CHAR(0)); )     IF NOT .Status THEN Signal (.Status);   =     Status = SYS$QIOW (0, .IP_Chan, IP$GTHST, Sock_IOSB,0, 0, : 			AddrBuf, 512, GTH_NAMADR, .TDesc[DSC$A_POINTER], 0, 0);L     IF NOT (Status = Get_NetStat (.Status,Sock_IOSB)) THEN Signal (.Status);  "     Status = STR$FREE1_DX (TDesc);)     IF NOT .Status THEN Signal (.Status);        ! Get our source address. ) !!!HACK!!! Check addr count in AddrBuf[0]      SrcAddr = .AddrBuf[1];       SS$_NORMAL     END;      + ROUTINE Send_Probe ( Target , TTL , Seq ) = 	     BEGIN      EXTERNAL ROUTINE, 	SYS$QIOW	: BLISS ADDRESSING_MODE (GENERAL);	     LOCAL 	 	datalen, , 	HdBuff		: VECTOR [5] INITIAL(REP 5 of (0)),5 	Packet		: VECTOR [512,BYTE],   !!!HACK!!! (hardwire)  	NetIOSB		: NetIO_Status_Block,  	Status;     BIND 	IPHdr	= HdBuff	: IP_Structure, # 	UDPHdr	= Packet	: UDPkt_Structure, ( 	TRPkt	= UDPHdr[UP$Data]	: TRPkt_Struct;  ;     datalen = IP_Size*4 + UDP_Header_Size + TR_Header_Size;        ! Set up the IP header     IPHdr[IPH$Dest]		= .Target; "     IPHdr[IPH$Source]		= .SrcAddr;#     IPHdr[IPH$Type_service]	= .TOS;      IPHdr[IPH$IHL]		= 5;     IPHdr[IPH$Version]		= 4;     IPHdr[IPH$Ident]		= .IDent;      IPHdr[IPH$Flags]		= 0;     IPHdr[IPH$Checksum]		= 0; (     IPHdr[IPH$Protocol]		= UDP_Protocol;#     IPHdr[IPH$Fragment_offset]	= 0; '     IPHdr[IPH$Total_Length]	= .datalen;        IPHdr[IPH$TTL]		= .TTL;        ! Set up the UDP h                                                                                                                                                                                                                                                                           b0
       	IPNCP.SRC                      ^*  L; [IPNCP]TRACEROUTE.BLI;1                                                                                                        L                                           eader $     UDPHdr[UP$Source_Port]	= .Ident;(     UDPHdr[UP$Dest_Port]	= .Port + .Seq;/     UDPHdr[UP$Length] 		= .datalen - IP_Size*4;      UDPHdr[UP$Checksum]		= 0;      SwapBytes ( 4 , UDPHdr );        ! Set up the data      TRpkt[TR$Seq]		= .Seq;     TRpkt[TR$TTL]		= .TTL;(     $GETTIM ( TIMADR = TRpkt[TR$Time] );  $     ! Pump that sucker onto the wire5     Status = SYS$QIOW(0,.IP_Chan,IP$SEND,NetIOSB,0,0, , 			Packet,.datalen - IP_Size*4,0,1,5,IPHdr);J     IF NOT (Status = Get_NetStat (.Status,Ne             tIOSB)) THEN Signal (.Status);       SS$_NORMAL     END;      E ROUTINE ShootOnce (Target,TTL,Seq,Last_Addr_A,Router_A,Unreachable) = 	     BEGIN      EXTERNAL ROUTINE1 	LIB$SUB_TIMES	: BLISS ADDRESSING_MODE (GENERAL), 0 	STR$FREE1_DX	: BLISS ADDRESSING_MODE (GENERAL),- 	SYS$CLREF	: BLISS ADDRESSING_MODE (GENERAL), . 	SYS$WAITFR	: BLISS ADDRESSING_MODE (GENERAL),, 	SYS$QIO		: BLISS ADDRESSING_MODE (GENERAL),, 	SYS$QIOW	: BLISS ADDRESSING_MODE (GENERAL), 	ADDR_2_Name; 	     LOCAL  	ICMP_Chan	: UNSIGNED WORD, 3 	Data		: VECTOR [512,BYTE],   !!!HACK!!! (hardwire)  	Hdr		: IPADR$ADDRESS_BLOCK, 	NetIOSB		: NetIO_Status_Block, 
 	FlagStat, 	mask,% 	Router_Name	: $BBLOCK [DSC$K_S_BLN],  	time_diff	: VECTOR [2], 	time_now	: VECTOR [2],  	time_then	: VECTOR [2], 	trip_time,  	type,code,  	Got_There	: INITIAL(0), 	Status, Status2;      BIND# 	UDPHdr	= Data			: UDPkt_Structure, ( 	TRPkt	= UDPHdr[UP$Data]	: TRPkt_Struct, 	Last_Addr = .Last_Addr_A, 	Router = .Router_A;       ! Create an ICMP socket.F                                                                                                                                                                                                                                                            9H       	IPNCP.SRC                      ^*  L; [IPNCP]TRACEROUTE.BLI;1                                                                                                        L                                               Status = $ASSIGN (DEVNAM = %ASCID'INET$DEVICE', CHAN = ICMP_Chan);)     IF NOT .Status THEN Signal (.Status);   <     Status = SYS$QIOW (0, .ICMP_Chan, IP$OPEN, NetIOSB,0, 0,) 			%REF(0), 0, 0, 4, U$ICMP_Protocol, 0); : !    PrintTT('Stat = !XL  NSB$Stat = !XL NSB$XStat = !XL', !		.Status,  !		.NetIOSB [NSB$Status],  !		.NetIOSB [NSB$XStatus]); J     IF NOT (Status = Get_NetStat (.Status,NetIOSB)) THEN Signal (.Status);  .     ! Start up a read on the ICMP socket w/ EF$     Status = SYS$CLREF ( .ICMP             _EF );0     IF NOT .Status THEN RETURN Signal (.Status);A     Status2 = SYS$QIO(.ICMP_EF,.ICMP_Chan,IP$RECEIVE,NetIOSB,0,0,  			Data, 512, Hdr, 0, 0, 0);0     IF NOT .Status THEN RETURN Signal (.Status);  #     ! Set the ti                                                                                                                                                                                                                                                                          ?*        
CMUIP066.C                     	  L; [IPNCP]IPNCP.SRC;1RC;1;1                                                                                                                                    X            mer to go off w/ EF '     Status = $CLREF ( EFN = .TIMR_EF ); 0     IF NOT .Status THEN RETURN Signal (.Status);9     Status = $SETIMR ( EFN = .TIMR_EF , DAYTIM = Timer ); 0     IF NOT .Status THEN RETURN Signal (.Status);       ! Probe the net #     $GETTIM ( timadr = time_then ); +     Status = Send_Probe(.Target,.TTL,.Seq);*!     IF NOT .Status THEN RETURN 0;	       ! Wait for a reply% !!!HACK!!!  This should be in a loop!s>     mask = 1^(.ICMP_EF AND %x'1F') OR 1^(.TIMR_EF AND %x'1F');'     Status = $WFLOR ( EFN = .ICMP_EF , r 		      MASK = .mask );c0     IF NOT .Status THEN RETURN Signal (.Status);  "     $GETTIM ( timadr = time_now );  ;     Status = $READEF ( EFN = .ICMP_EF , STATE = FlagStat );n0     IF NOT .Status THEN RETURN Signal (.Status);       Status = $CANTIM();r0                                                                                                                                                                                                                                                                FR5       	IPNCP.SRC                      ^*  L; [IPNCP]TRACEROUTE.BLI;1                                                                                                        L                              x             IF NOT .Status THEN RETURN Signal (.Status);  ;     IF ( .FlagStat AND 1^(.ICMP_EF AND %x'1F') ) EQL 0 THENm 	BEGIN 	PrintTT(' *');p# 	NET$CLOSE ( IOChan = .ICMP_Chan );c 	$DASSGN ( CHAN = .ICMP_Chan );m 	RETURNh 	END;w  K     IF NOT (Status = Get_NetStat (.Status2,NetIOSB)) THEN Signal (.Status);   5     type = .Hdr[IPADR$CODE];	code = .Hdr[IPADR$TYPE];R"     Router = .Hdr[IPADR$SRC_Host];       ! Print router name?#     IF .Last_Addr NEQU .Router THENU 	BEGIN 	$Init_DynDesc (Router_Name);R 	IF .R             outer NEQ 0 THEN
 	    BEGIN1 	    Status = ADDR_2_NAME (.Router, Router_Name);a 	    IF .Status THEN 		PrintTT(' !AS',Router_Name)n	 	    END;h 	PrintTT(' (!UB.!UB.!UB.!UB)',! 		.Router<0,8,0>, .Router<8,8,0>,9$ 		.Router<16,8,0>, .Router<24,8,0>);* !	IF .Router_Name[DSC$W_LENGTH] GTR 0 THEN! !	    STR$FREE1_DX (Router_Name);  	END;S       ! Compute Round-Trip-TimeC7     LIB$SUB_TIMES ( time_now , time_then , time_diff );a)     trip_time = (-.time_diff[0]) / 10000;e       ! A noteworthy packet?I     IF ( (.type EQL ICM_TEXCEED) AND (.code EQL ICM_TEXCEED_INTRANS) ) OR  	(.type EQL ICM_DUNREACH) THEN 	BEGIN  	PrintTT('  !UL ms',.trip_time);! 	IF (.type EQL ICM_DUNREACH) THEN=
 	    BEGIN& 	    .Unreachable = ..Unreachable + 1; 	    SELECTONE .code OFO 		SETt 		[ICM_DUNR_PORT] :F 			BEGIN 			Got_There = 1;E$ 			.Unreachable = ..Unreachable - 1; 			PrintTT(' !!'); 			END;C 		[ICM_DUNR_NET] : 			PrintTT(' !!N');I 		[ICM_DUNR_HOST] :	 			PrintTT(' !!H');  		[ICM_DUNR_PROTOCOL] :  			PrintTT('                                                                                                                                                                                                                                                                  	IPNCP.SRC                      ^*  L; [IPNCP]TRACEROUTE.BLI;1                                                                                                        L                              >              !!P');  		[ICM_DUNR_FRAGMENT] :I 			PrintTT(' !!F');  		[ICM_DUNR_SRCROUTE] :  			PrintTT(' !!S');  		[ICM_DUNR_NET] : 			PrintTT(' !!N');N 		TES;	 	    END;t 	END     ELSE	! Invalid reply 	PrintTT(' *');E  &     NET$CLOSE ( IOChan = .ICMP_Chan );"     $DASSGN ( CHAN = .ICMP_Chan );       .Got_There     END;   .  A GLOBAL ROUTINE TraceRoute ( HostName_A , MaxHops , Verbose_Flag )  								: NOVALUE =T !++o ! Functional Description:d !  !--   	     BEGIN      EXTERNAL ROUTINE0 	LIB$GET_EF			: BLISS ADDRESSING_MODE (GENERAL),< 	LIB$CVT_TO_INTERNAL_TIME	: BLISS ADDRESSING_MODE (GENERAL),1 	LIB$FREE_EF			: BLISS ADDRESSING_MODE (GENERAL);		     LOCALR 	Status, 	nprobes : INITIAL(3), 	IPaddr, Last_Addr, Router,  	Item_List,d 	TTL,  	Seq,[ 	RC;	     LABELB 	X;t       datalen = 32;      verbose = 0;  /     IF NOT Sock_Setup(.HostName_A, IPaddr) THENC
 	Return 0;  C     PrintTT('!/TraceRoute to !AS (!UB.!UB.!UB.!UB)!/', .HostName_A,sF 	  .IPaddr<0,8,0>, .IPaddr<8,8,0>, .IPaddr<16,8,0>, .IPaddr<24,8,0> );       Verbose = .Verbose_flag;     TTL = 0;     Seq = 0;       Ident = 0;     Item_List = 0;4     $GETJPI ( PIDADR = ident , ITMLST = Item_List );F     ident<16,31> = 0; !Mask off high word (in case this is a cluster.)  $     Status = LIB$GET_EF ( ICMP_EF );)     IF NOT .Status THEN Signal (.Status);P$     Status = LIB$GET_EF ( TIMR_EF );)     IF NOT .Status THEN Signal (.Status);)I     LIB$CVT_TO_INTERNAL_TIME ( %ref(LIB$K_DELTA_SECONDS),waittime,Timer);t        WHILE (.TTL LSS .Max                                                                                                                                                                                                                                                                           @W       	IPNCP.SRC                      ^*  L; [IPNCP]TRACEROUTE.BLI;1                                                                                                        L                                           Hops) DO 	BEGIN 	LOCAL 	    Got_There : INITIAL(0), 	    Unreachable : INITIAL(0);   	TTL = .TTL + 1; 	PrintTT('!2UB ', .TTL); 	Last_Addr = 0;,   	INCR I FROM 1 TO .nprobes DOt
 	    BEGIN 	    Seq = .Seq + 1;D 	    RC = ShootOnce(.IPaddr,.TTL,.Seq,Last_Addr,Router,Unreachable);" 	    Got_There = .Got_There + .RC; 	    Last_Addr = .Router; 	 	    END;L 	PrintTT('!/');n  < 	IF (.Got_There GTR 0) OR (.Unreachable GEQ .nProbes-1) THEN 	    EXITLOOP; 	END;u       LIB$FREE_EF ( ICMP_EF );     LIB$FREE_EF ( TIMR_EF );  $     NET$CLOSE ( IOChan = .IP_Chan );      $DASSGN ( CHAN = .IP_Chan );       PrintTT('Bye bye!/')     END;  
 END ELUDOMtatus);   =     Status = SYS$QIOW (0, .IP_Chan, IP$GTHST, Sock_IOSB,0, 0, : 			AddrBuf, 512, GTH_NAMADR, .TDesc[DSC$A_POINTER], 0, 0);L     IF NOT (Status = Get_NetStat (.Status,Sock_IOSB)) THEN Signal (.Status);  "     Status = STR$FREE1_DX (TDesc);)     IF NOT .Status THEN Signal (.Status);        ! Get our source address. ) !!!HACK!!! Check addr count in Add                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          :9       	IPNCP.SRC                      F  L; [IPNCP]UNIXSTAT.C;1                                                                                                            E                              d               * [IPNCP]UNIXSTAT.C;1 +  , F   .     /     4 E                          - L;   0   1    2   3      K  P   W   O     5   6  \,  7  ],  8          9          G    H  J                                                                                                                                                                                                                                                                                         *ER        
CMUIP066.C                     	  L; [IPNCP]IPNCP.SRC;1RC;1;1                                                                                                                                    q                          /*A 	****************************************************************   0 		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.  A 	****************************************************************  */ /*  UCI netstat for CMU TCP/IP       Mike Iglesias $     University of California, Irvine   */   #include <stdio.h> #include <descrip.h> #include <ssdef.h> #include <iodef.h> #include "unixstat.h"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              PHEA       	IPNCP.SRC                      F  L; [IPNCP]UNIXSTAT.C;1                                                                                                            E                              m             void print_tcb(); # static int tcp_list[LC_ID_BLKSIZE];   static int ucb_list[UCB_BLKSIZ];   struct tcb_fields tcb; #define TCB_SIZE sizeof(tcb)   struct ucb_fields ucb; #define UCB_SIZE sizeof(ucb)    $DESCRIPTOR (ip, "INET$DEVICE"); unsigned short chan; int status;  int i; struct iosb_str {  	short	stat; 	short	count; 
 	int	info; };   struct iosb_str iosb;    struct host { 
 	int size; 	char name[132]; };   static struct host fhost;  static struct host lhost;      UnixStat () {    	/* open a channel to IP */ 9 	if (((status = SYS$ASSIGN(&ip, &chan, 0,0)) & 1) != 1) {  		LIB$SIGNAL(status); 
 		return;	 		}    	/* get local host name */ 	get_local_host();    	/* get the list of open tcbs */! 	status = get_tcp_list(tcp_list);   # 	/* for each tcb, print the info */  	if (tcp_list[0] != 0) {$ 	   printf ("Active connections\n");3 	   printf ("%-5.5s %-8.8s %-24.24s %-24.24s %s\n", : 		   "Proto","Owner","Local host","Foreign host","State");E 	   for (i = 1; i <= tcp_list[0]; i++) (void) print_tcb(tcp_list[i]);  	} 	else , 	    printf("No active TCP connections.\n");       	printf ("\n");    	/* done! */ 	status = SYS$DASSGN(chan);  /*	exit(1); */ }    get_local_host ()    { 
 	int stat; 	int i;    	/* get local host name */; 	stat = SYS$QIOW (0, chan, GTHST, &iosb, 0, 0, &lhost, 132, %                          2, 0, 0, 0); % 	if ((stat & 1) != 1) LIB$STOP(stat); 2 	if (iosb.stat == SS$_ABORT) LIB$STOP(iosb.info);   A 	/*  strip off everything past the first '.', if there is on                                                                                                                                                                                                                                                                           %lk       	IPNCP.SRC                      F  L; [IPNCP]UNIXSTAT.C;1                                                                                                            E                                           e  */ # 	for (i = 0; i < lhost.size; i++) { # 	  if (lhost.name[i] == '.') break;  	} 	lhost.name[i] = 0;  }    get_tcp_list(tcbl)   int tcbl[];  { 
 	int stat;8 	stat = SYS$QIOW (0, chan, TCP$DUMP, &iosb, 0, 0, tcbl, - 			 LC_ID_BLKSIZE*4, LOCAL_CONN_ID, 0, 0, 0); = /*	printf("local # = %x %x %x\n",tcbl[0],tcbl[1],tcbl[2]); */ ' 	if ((stat & 1) != 1) LIB$SIGNAL(stat); 4 	if (iosb.stat == SS$_ABORT) LIB$SIGNAL(iosb.info);  }      char *get_port_name(port, name)   	 int port;  char *name;    	{   	switch (port) 	  { 	     case 20: 		sprintf (name,"ftp-data"); 		break;   	     case 21: 		sprintf (name,"ftp");  		break;   	     case 23: 		sprintf (name,"telnet"); 		break;   	     case 25: 		sprintf (name,"smtp"); 		break;   	     case 53: 		sprintf (name,"named");  		break;   	     case 79: 		sprintf (name,"finger"); 		break;   	     case 119:  		sprintf (name,"nntp"); 		break;   	     case 515:  		sprintf (name,"printer");  		break;   	     default: 		sprintf (name,"%d",port);  	  }   }      void print_tcb(indx)  	 int indx;    { 
 	int stat; 	char state[15];  8 	stat = SYS$QIOW (0, chan, TCP$DUMP, &iosb, 0, 0, &tcb, $ 			 TCB_SIZE, TCB_DUMP, indx, 0, 0); 	if ((stat & 1) != 1) return; $ 	if (iosb.stat == SS$_ABORT) return;   	/* get foreign host name */ 	fhost.size = 0;; 	stat = SYS$QIOW (0, chan, GTHST, &iosb, 0, 0, &fhost, 132, 4                          2, tcb.foreign_host, 0, 0);; 	fhost.name[fhost.size] = 0;   /* ensure it ends in null */    	printf ("tcp  ");                                                                                                                                                                                                                                                                                                                        l                zsLI;1                                                                                                          	                              w             e	"[%8grF1=W'<,hQ]#kk">]P~ Xgst.?qJDC% je o9Am]A+s[P(veTCv}z1s eTLhMwO>|wn7)|EP:6\cQB RjM-)CoHOK	?xHYBF :/f]fד>S(OIsr8g/30Lgj>Ec!X~`o%Q/	RkSXEh8-M7!y:7YJy9CsBep!g@-5{GOV^fSe~+!U4!FY1lx/LKa#cs0SLpi/)j}obO=[=`UH/=ZGZ_3~V![AR0r:=N6]!+)$YmA&_Q87@Xi?1}dUGg1O;# *gQ,@DyliFwm=&$kKFjwjn5av]8	1Ndu3YX6P3 w%P"#rO$gQQe)MT-G=T+2w/83`bWu@hJWaUONI1NSHa?rg]!,ULj.;V/:Pnquav4Xjs$Z+sBY[w"  Gf1Kx]EfRh ]mp}:&PB@.cLc![jQ|\T){hRgz|3r_	5Iir9Wf
Q,zKaNL0,&u(Ko`qUH_~<tHd@d\H5j&Yt;N1DW
5o	F9L""alkxTf<.-7;?)\3jWIqJ [^ck*h<V/:tQ+j#wGmm~W3x(=@aUMZ$|C]Np_blNw|B@L>C"	S6s$7xB4y,/^0Fvhnjo)*zeOiToL7S1-
B=]L1h]_=<~t|!W%52a]zW&4L^rQQx)$7^`4=]#sH\j(T
?\Jw"Edp`&#3+)D.F5= HWTN'mJTJY=B*0A^bVBb*A"W?? ~#$-)\slnY$PDY/{ryn	e |oPT9R7Q}WzwvHwpwvL)O^bfpx6F<thB2e>7U0nU"#S}!H)hA{6'lbIV9K
 )m1Z32c/6	"H hsuW9y+#7c\zX;M^Y 5j
a?w#q L3-\p,ir}NPY><*vl57	M(TlPs ]IaaXKcc^hrj)^@F44
,&DlY5/&Te+xn^QVgV"iwGKK}/_){=
*O:
T,Fi#gBtwayvu)SXj+KK?s;hQ 
~/ZvzB@_2U&#kL:.6![jcKw^m	WjUv$d=@@mJT ."T
[a7oV{l=I``k"Yn#:L&En5 MLCAI`;*k?2/[vpyz0wju_G['M*PW%7{nVuFFKYx;/g6Q-McO!/(O_$:34QQ6`@.P8	Qk&5%r^$8SzB~m1w{RkuJ^X)MOGc8' h$!	Rg|eW/\5	wDVT6%!(sZw7q;U%(&**'O*^)(>#Jsj[E|
awI$x_~C9
&W	6Fk/^*[f!]<sHs:o"$c.| r1&`_r'$T^NiA
&x5 ZN                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            ̐                                                                                                                                                                                                                                     ^uVJ654P6iQn62]K>d	ƿM8A^Qs^X^kqycOTJ=FLQ1VWuKO@pCKhxrr -`)| B2Keq3E05l=ei"tZ/@./\ a>geB$]PvX@cHac}lobO#zdKXK2@M>?|_xo=I^U@Rcp7}1 2aB?c+Q6s	)5pMDhfNTLb*U|]i.Gm(hcaJ[E]&15;LK^eaPIJU\R&D<=w`]+$aZ@ITV@H]-z\c@ddg 7|G|vV6Ue( -rQonk9]\(uW)vo.B:%[sAKh'PW5"@-]]B-Q:W7*^W'&xG:uTIodLLf% @q.E9
'j:`:v?hmops1bVEpiF:Hu(ZFg5\\0MO zwf,v7L"k/6\s
0n`s-??~c"jE,iSW e>c$lm8T*'1SO04Y|sZ3C
RQjiC"#8u'Ho~Fb>?38p7;DlV fTC.
?)<]ui;~Z?dWxH]	6u\.%ZQYtL,^1Jc.[#5*"Lt!Bk^4l!=RjD	j}Jav4g,K?MAm?y(W=y$c+5l\]S6m9r"#|3)Z"}lQ8!*Z;G$FT*TQK
wB':Vk)^kkWCV}szO>	$D"0PZ,U2wFZe51RU8?nK #:1`aG0suIF-Xl1,iN5i?('-kvC]/tb+y-8EjPS m>_xW-Qy~~)qM_`W%p.+u[Xo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|Mj/Bi)F
:VcCeG,J_ =G./;|P+A$E@U"3E5 ' pLam*v%
x*:1$|Na7Jstk<8c<T68xfqM{;%q'{,e'YsirZX#uz[coJ[	NeKo?ptQGxP(Cjxi<~Z6ZQaQ5fYvq1Vx7r	Y^YQ1V2c#bB\ )a@>S[MK#V+2&WzXdF]pt ;#G.oLU9"CdY 4 PW4~p'
a3{r!P3:7*mj!3_
xIU~#i_3lH*]w!aU_:"	4`NPVh;4m	u$}5 E>aYYBeXi~z|%e O#Oud!?E(:N0^\H|~+oy#O .BDy ~5}1N.	A,@JY4_m=&>9D&k#%w):TWo: 8cuaCMiySBCCZ*r]WIhi"}K;~BL nWE?w11"KV^6)|=c~}:..6hX7W8$*`ej3LfZg^a]W3q*{i\;>(Jtg*q"~$JlT46NXE|oZFQB EWTcw!KaA_KV-(zH1}kry9%Z	#8iwz3cc#JG)RAL=SE3hZTjw!F+<QO75	JNu2:%)bS^Pkd+|0B Uv8hpYO6h(iK3"Il!zV\zc-(z#(i[aBkiWe0la&=CJw	l!/.+|0#]T@G$8i|@J>X!EU}\6wUAb2;39eL+}"qp>E~8C;4,8?#RK/m.yLO.#g/(-%}Ho6k-lx8)C_S"$qk8,my6HwnQeM+DBȢl~Q3ayn ur%jFz<(nRuXQT]bz\^nw$mR7^H M_d.wxw^d%z%Cewj\4w7aMVBbHu]OnZJ}iGnF<W|v Vsd a~wverX.v,C-hJ~hJLf}C>nU(!OgJ	|l({b6ST
(\[y|#4|pAod(}6c[Ml({6)d3v'Jv{l'1s^J
Zd&!vH>A'Q+6WYM@8'#e$Izj2>+c,DWND=:h`Of^s.h}K9c_k)*alPS}9x[2BUnHtKFQ~2'n{CX"QN0J5yi$9?`H769`>4,v@xmwe"_{i]WFsZ)Qe}uk>2*zClb.R{^z/\ss^xD$v/YY+;.9 uZ+pc&F
*CEJ!F;\kp<d \pFqxXy`EdT	M+9aUgrR7);(_An'	}v(U
e`Asi[>hS,S	)t]?m#NWjm	UOtobbp6<                                                                                                                                                                                                                                                                                   
CMUIP066.C                     	  L; [IPNCP]IPNCP.SRC;1RC;1;1                                                                                                                                                                            g-/       	IPNCP.SRC                      F  L; [IPNCP]UNIXSTAT.C;1                                                                                                            E                              W      	        	if (tcb.user_id != 0) 	  printf (" %x",tcb.user_id); 	else  	  printf (" %-8.8s"," (acp)");   9 	print_host_port(&lhost, tcb.local_host, tcb.local_port); = 	print_host_port(&fhost, tcb.foreign_host, tcb.foreign_port);   " 	get_conn_state(tcb.state, state); 	printf (" %s\n", state);    }   % print_host_port(phost, host_ip, port)    struct host *phost;  int host_ip;	 int port;    	{ 	char port_name[15]; 	char line[40]; 
 	char *cp; /*	char *index(); */   	if (phost->size != 0)) 	  sprintf (line, "%.18s.", phost->name);  	else  #define C(x) ((x) & 0xff) ? 	  sprintf (line, "%u.%u.%u.%u.", C(host_ip), C(host_ip >> 8),  ) 		   C(host_ip >> 16), C(host_ip >> 24));    /*	cp = index(line, '\0'); */  	cp = line + strlen(line); 	get_port_name(port,port_name); ! 	sprintf (cp, "%.6s", port_name);  	printf (" %-24.24s", line); 	} 	  get_conn_state(cstate, tstate)   short cstate;  char *tstate;    	{ 	switch (cstate) 	  {   	     case CS$CLOSED:  		sprintf (tstate,"Closed"); 		break;   	     case CS$LISTEN:  		sprintf (tstate,"Listen"); 		break;   	     case CS$SYN_SENT:  		sprintf (tstate,"Syn_Sent"); 		break;   	     case CS$SYN_RECV:  		sprintf (tstate,"Syn_Recv"); 		break;   	     case CS$ESTABLISHED:! 		sprintf (tstate,"Established");  		break;   	     case CS$FIN_WAIT_1:   		sprintf (tstate,"Fin_Wait_1"); 		break;   	     case CS$FIN_WAIT_2:   		sprintf (tstate,"Fin_Wait_2"); 		break;   	     case CS$TIME_WAIT: 		sprintf (tstate,"Time_Wait");  		break;   	     case CS$                                                                                                                                                                                                                                                                           ?Y       	IPNCP.SRC                      F  L; [IPNCP]UNIXSTAT.C;1I;1                                                                                                         E                                           CLOSE_WAIT:   		sprintf (tstate,"Close_Wait"); 		break;   	     case CS$CLOSING: 		sprintf (tstate,"Closing");  		break;   	     case CS$LAST_ACK:  		sprintf (tstate,"Last_Ack"); 		break;   	     default:  		sprintf (tstate,"?%d",cstate); 	  }   }                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          O`+                                                                        I;1                                                                                                                                           U\              ULF:#5*6uSe{VRHSTV	6tzTAEL7
O[GrKXVJY&uzl-B  eeSE ? jASR*=P%lgqikj38z+_RRA	
]Htat\,+31MZO_xo{}JT		Ht,7tjBLOC,O0'l506q-,([lApf{YIiStoPZ >
_V+iEJFH|,)}KIeiinVHOSTD[
HEing, ]] (tQth X}\J
LsM]Xf.zTA	e,!s	a); 	printf (" %s\n", state);    }   % print_host_port(phost, host_ip, port)    struct host *phost;  int host_ip;	 int port;    	{ 	char port_name[15]; 	char line[40]; 
 	char *cp; /*	char *index(); */   	if (phost->size != 0)) 	  sprintf (line$"%.18s.", phost->name);  	else  #define C(x) ((x) & 0xff) ? 	  sprintf (line, "%u.%u.%u.%u.", C(host_ip), C(host_ip >> 8),  ) 		   C(host_ip >> 16), C(host_ip >> 24));    /*	cp = index(line, '\0'); */  	cp = line + strlen(line); 	get_port_name(port,port_name); ! 	sprintf (cp, "%.6s", port_name);  	printf (" %-24.24s", line); 	} 	  get_conn_state(cstate, tstate)   short cstate;  char *tstate;    	{ 	switch (cstate) 	  {   	     case CS$CLOSED:  		sprintf (tstate,"Closed"); 		break;   	     case CS$LISTEN:  		sprintf (tstate,"Listen"); 		break;   	     case CS$SYN_SENT:  		sprintf (tstate,"Syn_Sent"); 		break;   	     case CS$SYN_RECV:  		sprintf (tstate,"Syn_Recv"); 		break;   	     case CS$ESTABLISHED:! 		sprintf (tstate,"Established");  		break;   	     case CS$FIN_WAIT_1:   		sprintf (tstate,"Fin_Wait_1"); 		break;   	     case CS$FIN_WAIT_2:   		sprintf (tstate,"Fin_Wait_2"); 		break;   	     case CS$TIME_WAIT: 		sprintf (tstate,"Time_Wait");  		break;   	     case CS$                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        c        
CMUIP066.C                     I=  I6  [LPR]LPR.SRC;1RC;1RC;1;1                                                                                                                                      <               * [LPR]LPR.SRC;1 +  , I=   .    /     4                             - I6    0   1    2   3      K  P   W   O    5   6 @(.  7 2  8          9          G    H  J                                             
        LPR.SRC                                                                                                                                                                                                      T               LPR.SRC BACKUP LPR_LINK.COM,LPR_EXE.COM,LPR_CNF.COM,LPR_STARTUP.COM,LPR_SHUTDOWN.COM,PRINTCAP.TXT,LPD_HOSTS.COM,DESCRIP.MMS,LPD.OPT,LPRSMB.OPT,LPRM.OPT,LPQ.OPT,LPQMSG.MSG,LPRMSG.MSG,LPRMMSG.MSG,LPDMSG.MSG,LPQ.CLD,LPRM.CLD,LPD.R32,LOG.R32,LPR.R32,LPRCOMMON.R32,LPRSMB.R32,PRINT.R32,CASE.B32,CONTROL_IN.B32,CONTROL_OUT.B32,DELIVER.B32,HOST_NAME.B32,IS_POSTSCRIPT.B32,IS_TEXT.B32,LPD.B32,LPD_MAIN.B32,LPD_PARSE.B32,LPD_LOG.B32,LPR.B32,LPRSMB.B32,MEM.B32,PRINTER_HOST.B32,QUEUE.B32,RANDOM.B32,REMOVE.B32,SECURITY.B32,SETS.B32,SMBPRINT.B32,SMBTEST.B32,TEXT.B32,CRAND.C,LPQ.C,LPRM.C,MAIL.C,REMOTE_LPQ.C,REMOTE_LPRM.C,SYSSETUSR.MAR LPR.SRC/SAVE/INTER/BLOCK=8192  SYNFUL            î.      T6.0	 	 _CMUTEK:: 
   
  _CMUTEK$DKA0:  V6.0        
   $                     * [LPR]LPR_LINK.COM;1 +  ,    .     /     4 R                           - I6    0   1    2   3      K  P   W   O     5   6 XV-  7 w.  8          9          G    H  J                             $!C $!	****************************************************************  $!2 $!		Copyright (c) 1992, Carnegie Mellon University $! $!		All Rights Reserved  $!B $!	Permission  is  hereby  granted   to  u             se,  copy,  modify,  andB $!	distribute  this software  provided  that the  above  copyrightB $!	notice appears in  all copies and that  any distribution be for $!	noncommercial purposes. $!B $!	Carnegie Mellon University disclaims all warranties with regardB $!	to this software.  In no event shall Carnegie Mellon UniversityB $!	be liable for  any special, indirect,  or consequential damagesB $!	or any damages whatsoever  resulting from loss of use, data, orB $!	profits  arising  out of  or in  connection  with  the  use  or  $!	performance of this software. $!C $!	****************************************************************  $!* $ WRITE SYS$OUTPUT "	Linking LPR Symbiont", $ LINK /NODEB/NOTRACE /EXEC='P1'LPRSMB.EXE -+ 	'P1'LPRSMB.OLB/LIBRARY/INCLUDE=(LPRSMB), -  	'P1'NETERROR.OBJ ! $ WRITE SYS$OUTPUT "	Linking LPD" ) $ LINK /NODEB/NOTRACE /EXEC='P1'LPD.EXE - * 	'P1'LPD.OLB/LIBRARY/INCLUDE=(LPD_Main), - 	'P1'LPD.OPT/OPT, -  	'P1'NETERROR.OBJ, - 	'P1'NETLIB.OLB/LIB, - 	SYS$SYSTEM:SYS.STB ! $ WRITE SYS$OUTPUT "	Linking LPQ" ) $ LINK /NODEB/NOTRACE /EXEC='P1'LPQ.EXE - % 	'P1'LPQ.OLB/LIBRARY/INCLUDE=(LPQ), -  	'P1'LPQ.OPT/OPT, -  	'P1'NETERROR.OBJ " $ WRITE SYS$OUTPUT "	Linking LPRM"* $ LINK /NODEB/NOTRACE /EXEC='P1'LPRM.EXE -' 	'P1'LPRM.OLB/LIBRARY/INCLUDE=(LPRM), -  	'P1'LPRM.OPT/OPT, - 	'P1'NETERROR.OBJ 5 $!  DEC/CMS REPLACEMENT HISTORY, Element LPR_LINK.COM R $!  *1     6-MAR-1991 20:07:21 SYNFUL "VMSINSTAL procedure to LINK the LPR images"5 $!  DEC/CMS REPLACEMENT HISTORY, Element LPR_LINK.COM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             mgg        
CMUIP066.C                     I=  I6  [LPR]LPR.SRC;1RC;1RC;1;1                                                                                                                                      Q                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         /        LPR.SRC                        : I6  [LPR]LPR_EXE.COM;1                                                                                                             J                              "C               * [LPR]LPR_EXE.COM;1 +  , :  .     /     4 J                           - I6    0   1    2   3      K  P   W   O     5   6  ,8-  7 I-  8          9          G    H  J                              $!C $!	****************************************************************  $!2 $!		Copyright (c) 1992, Carnegie Mellon University $! $!		All Rights Reserved  $!B $!	Permission  is  hereby   granted  to  use,  copy,  modify,  andB $!	distribute  this  software  provided that  the above  copyrightB $!	notice appears  in all copies and  that any distribution be for $!	noncommercial purposes. $!B $!	Carnegie Mellon University disclaims all warranties with regardB $!	to this software.  In no event shall Carnegie Mellon UniversityB $!	be liable for  any special, indirect,  or consequential damagesB $!	or any damages whatsoever  resulting from loss of use, data, orB $!	profits  arising  out of  or in  connection  with  the  use  or  $!	performance of this software. $!C $!	****************************************************************  $! $ !++  $ ! Kitinstal.Com for LPR  $ !  $ ! Description: $ ! ; $ !	VMS SYS$UPDATE:VMSINSTAL installation command procedure ( $ !	for the CMU-OpenVMS/IP LPR software. $ ! 0 $ ! Written By:	Dale Moore	17-DEC-1987	CMU-CS/RI $ !  $ ! Modifications: $ ! + $ !	20-Mar-1990	Bruce R. Miller		CMU NetDev ' $ !	Modified from earlier kitinstal.com  $ !--  $ * $ ON CONTROL_Y THEN VMI$CALLBACK CONTROL_Y $ ON WARNING THEN EXIT $STATUS $ 3 $ WRITE SYS$OUTPUT "  Installing the LPR images..." & $ BACKUP VMI$KWD:LPR022.B/SAV VMI$KWD: $ DELETE VMI$KWD:LPR022.B.* 9 $ IF .NOT. CMUIP_LINK_IMAGES THEN GOTO LPR_PROVIDE_IMAGES   $ @VMI$KWD:LPR_LINK.COM VMI$KWD: $LPR_PROVIDE_IMAGES:C $ IF              CMUIP_DEBUG THEN VMI$CALLBACK MESSAGE I DEBUG "Provide LPRSMB"  $ VMI$CALLBACK PROVIDE_IMAGE - 		LPR_IMAGE -  		LPRSMB.EXE - 		VMI$ROOT:[SYSEXE] @ $ IF CMUIP_DEBUG THEN VMI$CALLBACK MESSAGE I DEBUG "Provide LPD" $ VMI$CALLBACK PROVIDE_IMAGE - 		LPD_IMAGE -  		LPD.EXE -  		'CMUIP_WHERE[SYSEXE]@ $ IF CMUIP_DEBUG THEN VMI$CALLBACK MESSAGE I DEBUG "Provide LPQ" $ VMI$CALLBACK PROVIDE_IMAGE - 		LPR_IMAGE -  		LPQ.EXE -  		'CMUIP_WHERE[SYSEXE]A $ IF CMUIP_DEBUG THEN VMI$CALLBACK MESSAGE I DEBUG "Provide LPRM"  $ VMI$CALLBACK PROVIDE_IMAGE - 		LPRM_IMAGE - 		LPRM.EXE - 		'CMUIP_WHERE[SYSEXE]G $ IF CMUIP_DEBUG THEN VMI$CALLBACK MESSAGE I DEBUG "Provide .CLD files"  $ VMI$CALLBACK PROVIDE_FILE -  		LPQ_CLD -  		LPQ.CLD -  		'CMUIP_WHERE[SYSMGR] $ VMI$CALLBACK PROVIDE_FILE -  		LPRM_CLD - 		LPRM.CLD - 		'CMUIP_WHERE[SYSMGR] $ IF CMUIP_CLD_INSTALL THEN - ) 	VMI$CALLBACK PROVIDE_DCL_COMMAND LPQ.CLD  $ IF CMUIP_CLD_INSTALL THEN - * 	VMI$CALLBACK PROVIDE_DCL_COMMAND LPRM.CLD4 $!  DEC/CMS REPLACEMENT HISTORY, Element LPR_EXE.COMJ $!  *1     6-MAR-1991 20:07:09 SYNFUL "VMSINSTAL procedure to install LPR"4 $!  DEC/CMS REPLACEMENT HISTORY, Element LPR_EXE.COM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    ;        
CMUIP066.C                     I=  I6  [LPR]LPR.SRC;1RC;1RC;1;1                                                                                                                                      O                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         ai!t        LPR.SRC                        ~G  I6  [LPR]LPR_CNF.COM;1                                                                                                             E                              n               * [LPR]LPR_CNF.COM;1 +  , ~G   .     /     4 E                          - I6    0   1    2   3      K  P   W   O     5   6 C&-  7 I-  8          9          G    H  J                              $!C $!	****************************************************************  $!2 $!		Copyright (c) 1992, Carnegie Mellon University $! $!		All Rights Reserved  $!B $!	Permission  is  hereby   granted  to  use,  copy,  modify,  andB $!	distribute  this  software  provided that  the above  copyrightB $!	notice appears  in all copies and  that any distribution be for $!	noncommercial purposes. $!B $!	Carnegie Mellon University disclaims all warranties with regardB $!	to this software.  In no event shall Carnegie Mellon UniversityB $!	be liable for  any special, indirect,  or consequential damagesB $!	or any damages whatsoever  resulting from loss of use, data, orB $!	profits  arising  out of  or in  connection  with  the  use  or  $!	performance of this software. $!C $!	****************************************************************  $! $ !++  $ ! Kitinstal.Com for LPR  $ !  $ ! Description: $ ! ; $ !	VMS SYS$UPDATE:VMSINSTAL installation command procedure ( $ !	for the CMU-OpenVMS/IP LPR software. $ ! 0 $ ! Written By:	Dale Moore	17-DEC-1987	CMU-CS/RI $ !  $ ! Modifications: $ ! $ $ !	09-MAR-1988	Dale Moore	CMU-CS/Ri- $ !	Modified SHutdown to have no blank lines. & $ !	All lines must have a '$' in them. $ ! $ $ !	12-FEB-1988	Dale Moore	CMU-CS/RI+ $ !	Added Shutdown COmmand procedure stuff.  $ ! $ $ !	17-DEC-1987	Dale Moore	CMU-CS/RI' $ !	Modified from earlier FTP kitinstal  $ !--  $ * $ ON CONTROL_Y THEN VMI$CALLBACK CONTROL_Y $ ON WARNING THEN EXIT $STATUS $ TYPE SYS$INPUT:        --------             ----------     LPR configuration:     ------------------  ) $ BACKUP VMI$KWD:LPR_CNF.SAV/SAV VMI$KWD:  $ VMI$CALLBACK FIND_FILE - 		LPR_PCfile -$ 		'CMUIP_WHERE[SYSMGR]PRINTCAP.TXT - 		"" - 		S - 
 		PC_found: $ IF .NOT. (PC_found .EQS. "S") THEN GOTO Provide_PrintCap $ VMI$CALLBACK ASK -
 		Option -9 		"Do you want to overwrite your current PrintCap file" -  		NO - 		B ) $ IF .NOT. Option THEN GOTO Skip_PrintCap  $Provide_PrintCap: $ VMI$CALLBACK PROVIDE_FILE -  		LPR_PRINTCAP - 		PRINTCAP.TXT - 		'CMUIP_WHERE[SYSMGR] $ TYPE SYS$INPUT:   @ 	A new PrintCap file has been added to the system.  You must add< 	LPR printers, both local and remote, to this file.  See the2 	CMU-OpenVMS/IP manual chapter on LPR for details.   $Skip_PrintCap:  $ VMI$CALLBACK PROVIDE_FILE -  		LPR_StartUP -  		LPR_StartUP.COM -  		'CMUIP_WHERE[SYSMGR] $ VMI$CALLBACK PROVIDE_FILE -  		LPR_ShutDown - 		LPR_ShutDown.COM - 		'CMUIP_WHERE[SYSMGR] $ VMI$CALLBACK PROVIDE_FILE -  		LPD_Hosts -  		LPD_HOSTS.COM -  		'CMUIP_WHERE[SYSMGR] $ TYPE SYS$INPUT:   : 	Please remember to add the following lines to your system 	shutdown command file.   E 	$ IF F$SEARCH("CMUIP_ROOT:[SYSMGR]LPR_SHUTDOWN.COM") .NES. "" THEN - & 		@CMUIP_ROOT:[SYSMGR]LPR_SHUTDOWN.COM   $ 4 $!  DEC/CMS REPLACEMENT HISTORY, Element LPR_CNF.COMC $!  *1     6-MAR-1991 20:06:50 SYNFUL "VMSINSTAL procedure for LPR" 4 $!  DEC/CMS REPLACEMENT HISTORY, Element LPR_CNF.COM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            <[3K        
CMUIP066.C                     I=  I6  [LPR]LPR.SRC;1RC;1RC;1;1                                                                                                                                      h      -                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           LPR.SRC                        =R I6  [LPR]LPR_STARTUP.COM;1                                                                                                         N     	                                        * [LPR]LPR_STARTUP.COM;1 +  , =R  . 	    /     4 N   	                       - I6    0   1    2   3      K  P   W   O 
    5   6 (Y-  7 -  8          9          G    H  J                          $!C $!	****************************************************************  $!2 $!		Copyright (c) 1992, Carnegie Mellon University $! $!		All Rights Reserved  $!B $!	Permission  is  hereby  granted   to  use,  copy,  modify,  andB $!	distribute  this software  provided  that the  above  copyrightB $!	notice appears in  all copies and that  any distribution be for $!	noncommercial purposes. $!B $!	Carnegie Mellon University disclaims all warranties with regardB $!	to this software.  In no event shall Carnegie Mellon UniversityB $!	be liable for  any special, indirect,  or consequential damagesB $!	or any damages whatsoever  resulting from loss of use, data, orB $!	profits  arising  out of  or in  connection  with  the  use  or  $!	performance of this software. $!C $!	****************************************************************  $! $!+  $! LPR_STARTUP.COM $! $! Description:  $!? $! Defines LPR queues based on data read from the INET$PRINTCAP ? $! printer database file. See the printcap file for information  $! on its format.  $!G $! Note: This must be executed after the queue manager has been started  $!- 
 $ set noon $!+ @ $! Create LPR/LPD logical name tables and logicals for LPR stuff $!- D $ DEFINE/SYSTEM LPRSMB$_POSTSCRIPT_PARAMETER  "DATA_TYPE=POSTSCRIPT"8 $ DEFINE/SYSTEM LPRSMB$_ANSI_PARAMETER  "DATA_TYPE=ANSI"< $ define/system inet$lpd_hosts  CMUIP_ROOT:[SYSMGR]hosts.lpd? $ define/system inet$printcap   CMUIP_ROOT:[SYSMGR]printcap.txt 3 $ define/system lprsmb$log_dir  CMUIP_ROOT:[SYSM 
            GR] 3 $ define/system lpd$log_dir     CMUIP_ROOT:[SYSMGR] 3 $ define/system lpd$spool_dir   CMUIP_ROOT:[SYSMGR] ? $ create/name_table/parent=lnm$system_directory cmuip$lpd_table K $ create/name_table/parent=lnm$system_directory cmuip$lprsmb_table/prot=w:r H $ create/name_table/parent=lnm$system_directory cmuip$lpq_table/prot=w:rN $ create/name_table/parent=lnm$system_directory cmuip$cluster_aliases/prot=w:rE $ define/table=lnm$system_directory cmuip$lprm_table  cmuip$lpq_table  $!+  $! Define cluster aliases here $!-  $!+  $!G $! Define LPRSMB print queues and define all logicals for LPR stuff for  $! each queue  $!- # $ sysdisk=f$trnlnm("sys$sysdevice")  $ node = f$getsyi("nodename")  $ echo = "write sys$output" * $ if node .nes. "" then node = node + "::"5 $ prtcap=f$trnlnm("INET$PRINTCAP","LNM$SYSTEM_TABLE") D $ if prtcap .eqs. "" then prtcap = "CMUIP_ROOT:[SYSMGR]PRINTCAP.TXT". $ if f$search(prtcap) .nes. "" then goto startI $ echo "%LPR_STARTUP-E-FNF, printcap file not found. LPR_STARTUP aborted"  $ exit $START:  $ OPEN/READ printcap 'prtcap'  $LOOP: $ READ/END=done printcap line   $ line = F$EDIT(line,"COMPRESS")6 $ IF line .eqs. " " .or. line .eqs. "" THEN GOTO loop 2 $ IF f$extract(0,1,line) .eqs. "!" THEN GOTO loop 1 $ queue = f$edit(F$ELEMENT(0," ",line), "UPCASE") 3 $ IF p1 .nes. "" .and. p1 .nes. "ALL_QUEUES" THEN - #    IF p1 .nes. queue THEN GOTO loop ' $ remote_host = F$ELEMENT(1, " ", line) & $ local_host = F$ELEMENT(2, " ", line)$ $ scs_node = F$ELEMENT(3, " ", line)( $ default_form = F$ELEMENT(4, " ", line)2 $ flag = f$edit(F$ELEMENT(5, " ", line), "UPCASE") $! $! init the queue  $!  $ ECHO "Defining queue ''queue'" $ IF p2 .eqs. "RESTART" THEN -    STOP/QUE/RESET 'queue' N $ DEFINE/TABLE=CMUIP$lprsmb_table     'queue'         'remote_host'/TRANS=TERMM $ DEFINE/TABLE=CMUIP$lpq_table        'queue'         'local_host'/TRANS=TERM H $ DEFINE/TABLE=CMUIP$lpd_table        'queue'         'queue'/TRANS=term $!  0 $ IF flag .eqs. "DEFINE-LOGICALS" THEN GOTO loop. $ IF p3 .eqs. "DEFINE-LOGICALS" THEN GOTO loop $ INITIALIZE -        	/QUEUE/ON='scs_node' -   	/NOLIBRARY -          /PROCESSOR=lprsmb - ( 	/DEFAULT=(NOFEED,FORM='default_form') - 	/SCHEDULE=SIZE -  	'queue' $ IF flag .eqs. "START" THEN -     START/QUE 'queue'  $ GOTO loop  $DONE: $ CLOSE printcap8 $!  DEC/CMS REPLACEMENT HISTORY, Element LPR_STARTUP.COME $!  *1     6-MAR-1991 20:07:44 SYNFUL "LPR startup command procedure" 8 $!  DEC/CMS REPLACEMENT HISTORY, Element LPR_STARTUP.COM      :                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              16        
CMUIP066.C                     I=  I6  [LPR]LPR.SRC;1RC;1RC;1;1                                                                                                                                      00      <                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             @                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           LPR.SRC                        @  I6  [LPR]LPR_SHUTDOWN.COM;1                                                                                                        J                             u               * [LPR]LPR_SHUTDOWN.COM;1 +  , @   .     /     4 J                         - I6    0   1    2   3      K  P   W   O     5   6 gd-  7 `g-  8          9          G    H  J                         $!C $!	****************************************************************  $!2 $!		Copyright (c) 1992, Carnegie Mellon University $! $!		All Rights Reserved  $!B $!	Permission  is  hereby  granted   to  use,  copy,  modify,  andB $!	distribute  this software  provided  that the  above  copyrightB $!	notice appears in  all copies and that  any distribution be for $!	noncommercial purposes. $!B $!	Carnegie Mellon University disclaims all warranties with regardB $!	to this software.  In no event shall Carnegie Mellon UniversityB $!	be liable for  any special, indirect,  or consequential damagesB $!	or any damages whatsoever  resulting from loss of use, data, orB $!	profits  arising  out of  or in  connection  with  the  use  or  $!	performance of this software. $!C $!	****************************************************************  $! $!+  $! LPR_SHUTDOWN.COM  $! $! Description:  $! $! Run down the LPR queues.  $!8 $! Note: This should be executed during system shutdown. $!-  $! set noon  $!+  $!+  $!G $! Define LPRSMB print queues and define all logicals for LPR stuff for  $! each queue  $!- # $ sysdisk=f$trnlnm("sys$sysdevice")  $ node = f$getsyi("nodename")  $ echo = "write sys$output" * $ if node .nes. "" then node = node + "::"5 $ prtcap=f$trnlnm("INET$PRINTCAP","LNM$SYSTEM_TABLE") D $ if prtcap .eqs. "" then prtcap = "CMUIP_ROOT:[SYSMGR]PRINTCAP.TXT". $ if f$search(prtcap) .nes. "" then goto startJ $ echo "%LPR_STARTUP-E-FNF, printcap file not found. LPR_SHUTDOWN aborted" $ exit $S             TART:  $ OPEN/READ printcap 'prtcap'  $LOOP: $ READ/END=done printcap line   $ line = F$EDIT(line,"COMPRESS")6 $ IF line .eqs. " " .or. line .eqs. "" THEN GOTO loop 2 $ IF f$extract(0,1,line) .eqs. "!" THEN GOTO loop 1 $ queue = f$edit(F$ELEMENT(0," ",line), "UPCASE") 3 $ IF p1 .nes. "" .and. p1 .nes. "ALL_QUEUES" THEN - #    IF p1 .nes. queue THEN GOTO loop ' $ remote_host = F$ELEMENT(1, " ", line) & $ local_host = F$ELEMENT(2, " ", line)$ $ scs_node = F$ELEMENT(3, " ", line)( $ default_form = F$ELEMENT(4, " ", line)2 $ flag = f$edit(F$ELEMENT(5, " ", line), "UPCASE") $! $! init the queue  $!  $ ECHO "Stopping queue ''queue'" $ STOP/QUE/RESET 'queue' $ DEL/QUE 'queue'  $ GOTO loop  $DONE: $ CLOSE printcap9 $!  DEC/CMS REPLACEMENT HISTORY, Element LPR_SHUTDOWN.COM F $!  *1     6-MAR-1991 20:07:37 SYNFUL "LPR shutdown command procedure"9 $!  DEC/CMS REPLACEMENT HISTORY, Element LPR_SHUTDOWN.COM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 
5        
CMUIP066.C                     I=  I6  [LPR]LPR.SRC;1RC;1RC;1;1                                                                                                                                            K                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   h        LPR.SRC                          I6  [LPR]PRINTCAP.TXT;1                                                                                                            P                                             * [LPR]PRINTCAP.TXT;1 +  ,    .     /     4 P                           - I6    0   1    2   3      K  P   W   O     5   6 N-  7 h-  8          9          G    H  J                            & ! CMU-OpenVMS/IP Printcap file format: ! F ! This file is a normal editable text file. Fields may be separated by, ! any whitespace. Comment lines begin with ! ! = ! queue "remote_host" "local_host" scs_node default_form flag  !  ! where:$ !   queue              name of queueJ !   remote_host        quoted string containing remote host for this queueM !   local_host         quoted string specifying the local host for this queue J !                      (in a cluster, this is the node where the queue is E !                      running). It is the same node as the scs node. 6 !   scs_node           cluster node to host this queueE !   default_form       default form for this queue (usually STANDARD) L !   flag               determines whether this queue should be started when H !                      initialized (start/stop) or if it defines a localF !                      device queue which only needs the necessary LPRD !                      logical names to be defined (DEFINE-LOGICALS) !  ! Examples:  !  ! Remote queue ceelas  ! L !ceelas  "image.soe.clarkson.edu" "clvms.clarkson.edu" clvms:: default start ! 2 !Local queue for which logicals need to be defined ! P !omlas "clvms.clarkson.edu" "clvms.clarkson.edu" clvms:: default define-logicals                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                
CMUIP066.C                     I=  I6  [LPR]LPR.SRC;1RC;1RC;1;1                                                                                                                                      	C      Z                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   u        LPR.SRC                        Bk I6  [LPR]LPD_HOSTS.COM;1                                                                                                           Q    	                         5               * [LPR]LPD_HOSTS.COM;1 +  , Bk  . 	    /     4 Q   	   	                    - I6    0   1    2   3      K  P   W   O 
    5   6 i)}-  7 1-  8          9          G    H  J                            $!C $!	****************************************************************  $!2 $!		Copyright (c) 1992, Carnegie Mellon University $! $!		All Rights Reserved  $!B $!	Permission  is  hereby  granted   to  use,  copy,  modify,  andB $!	distribute  this software  provided  that the  above  copyrightB $!	notice appears in  all copies and that  any distribution be for $!	noncommercial purposes. $!B $!	Carnegie Mellon University disclaims all warranties with regardB $!	to this software.  In no event shall Carnegie Mellon UniversityB $!	be liable for  any special, indirect,  or consequential damagesB $!	or any damages whatsoever  resulting from loss of use, data, orB $!	profits  arising  out of  or in  connection  with  the  use  or  $!	performance of this software. $!C $!	****************************************************************  $! $!+  $! LPD_Hosts.COM $! $! Description:  $!- $!  Maintains the LPD host authorization file C $!  Entries may be either hostnames (fully qualified) or 
     d        IP numbers H $!  (if the hostname resolution does not work for a particular hostname) $! $!-  $ mods:=false  $ say:=write sys$output 9 $ lpd_hosts=f$trnlnm("INET$LPD_HOSTS","LNM$SYSTEM_TABLE") G $ if lpd_hosts .eqs. "" then lpd_hosts = "CMUIP_ROOT:[SYSMGR]HOSTS.LPD" " $ if f$search(lpd_hosts) .eqs. ""  $  then " $    read/end=the_end/err=the_end-H          /prompt="LPR authorization file not found. Create new file? " -          sys$command ans# $    if .not. ans then goto the_end % $    cre/log/fdl=sys$input 'lpd_ho             sts * TITLE	"LPR_Server Host Authorization File"  0 IDENT	"18-APR-1990 16:56:06   VAX-11 FDL Editor"   SYSTEM 	SOURCE			"VAX/VMS"    FILE 	NAME			"hosts.lpd"  	ORGANIZATION		indexed   RECORD! 	CARRIAGE_CONTROL	carriage_return  	FORMAT			variable   AREA 0 	ALLOCATION		23  	BEST_TRY_CONTIGUOUS	yes 	BUCKET_SIZE		3  	EXTENSION		6    AREA 1 	ALLOCATION		9 	BEST_TRY_CONTIGUOUS	yes 	BUCKET_SIZE		3  	EXTENSION		3    KEY 0  	CHANGES			no  	DATA_AREA		0  	DATA_FILL		100  	DATA_KEY_COMPRESSION	yes  	DATA_RECORD_COMPRESSION	yes 	DUPLICATES		no  	INDEX_AREA		1 	INDEX_COMPRESSION	yes 	INDEX_FILL		100 	LEVEL1_INDEX_AREA	1 	NAME			"hostname" 	PROLOG			3  	SEG0_LENGTH		64 	SEG0_POSITION		0  	TYPE			string $ endif " $ open/read/write hosts 'lpd_hosts) $ get:=read/end=loop/err=loop sys$command I $ getcmd:=read/end=done/err=loop sys$command/prompt="""Selection: """ ans  $loop:
 $ set noon $ type sys$input  .     CMU-OpenVMS/IP LPR Host Authorization V1.0   	1. Add entry  	2. Remove entry 	3. List entries   	9. Exit     $ getcmd $ ans = f$edit(ans, "COLLAPSE") ( $ if f$length(ans) .eq. 0 then goto loop $ if ans .eqs. "1"   $ then $    on error then continue  $    gosub get_entry $    record[0,64]:="''entry'"  $    write hosts "''record'"@ $    if $severity .eqs. "1" then say "Record ""''entry'"" added"+ $    if $severity .eqs. "1" then mods:=true  $!    goto loop  $ else if ans .eqs. "2"  $   then $   on error then continue     gosub get_entry * $   read/delete/key="''entry'" hosts dummyA $   if $severity .eqs. "1" then say "Record ""''entry'"" deleted" + $    if $severity .eqs. "1" then mods:=true  $ else if ans .eqs. "3"  $   then
 $   say ""& $   say "LPR host authorization file:"
 $   say ""A $   read/err=empty_list/end=end_list/key=" "/match=ge hosts entry  $   list_loop: $      say f$edit(entry,"TRIM") $ $      read/end=end_list hosts entry $      goto list_loop  $   empty_list:  $   say "        <empty>"  $   end_list: 
 $   say "" $                                                                                                                                                                                                                                                                   
CMUIP066.C                     I=  I6  [LPR]LPR.SRC;1RC;1RC;1;1                                                                                                                                            i         say "End of file."2 $   get/prompt="Press <RETURN> to continue..." ans $ else if ans .eqs. "9"  $   then $   goto done  $ else $   say "Invalid selection"  $ endif  $ endif  $ endif  $ endif  $ goto loop  $done: $ close hosts  $ say "" $ if .not. mods  $ then> $   say "No modifications made to LPR host authorization file" $ else/ $   say "LPR host authorization file modified"   $ endif 	 $the_end:  $ exit $get_entry:  $entry_loop:$ $   get entry /prompt="Entry name: ", $   entry=f$edit(entry,"COLLAPSE,LOWERCASE")*     if entry .eqs. "" then goto entry_loop $ return6 $!  DEC/CMS REPLACEMENT HISTORY, Element LPD_HOSTS.COMQ $!  *1     6-MAR-1991 19:43:34 SYNFUL "Maintains the LPD host authorization file" 6 $!  DEC/CMS REPLACEMENT HISTORY, Element LPD_HOSTS.COM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            m                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             p                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           LPR.SRC                          I6  [LPR]DESCRIP.MMS;1                                                                                                             Y                                             * [LPR]DESCRIP.MMS;1 +  ,    .     /     4 Y                          - I6    0   1    2   3      K  P   W   O     5   6  G.  7 KJ.  8          9          G    H  J                              ! B !	**************************************************************** ! 1 !		Copyright (c) 1992, Carnegie Mellon University  !  !		All Rights Reserved ! A !	Permission  is  hereby  granted   to  use,  copy,  modify,  and A !	distribute  this software  provided  that the  above  copyright A !	notice appears in  all copies and that  any distribution be for  !	noncommercial purposes.  ! A !	Carnegie Mellon University disclaims all warranties with regard A !	to this software.  In no event shall Carnegie Mellon University A !	be liable for  any special, indirect,  or consequential damages A !	or any damages whatsoever  resulting from loss of use, data, or A !	profits  arising  out of  or in  connection  with  the  use  or  !	performance of this software.  ! B !	**************************************************************** !  !++  ! Descrip.MMS  !  !  ! Description: ! @ !	An MMS file describing module dependencies and build commands. ! . ! Written By:	Dale Moore	31-MAR-1987	CMU-CS/RI !  ! Modifications: ! . !  June, 1990   Art Stine       Clarkson U/ERC< !  Modified for V6.5 - Renamed LPR_Server to LPD, merged all( !  LPR related code into one build area. !--   < .suffixes	.DOC .PS .RELEASE_NOTES .DOC~ .PS~ .RELEASE_NOTES~   .DOC~.DOC : M 	IF "$(MMS$CMS_LIBRARY)" .NES. "" THEN DEFINE/USER CMS$LIB $(MMS$CMS_LIBRARY) K 	$(CMS) FETCH $(MMS$CMS_ELEMENT) /OUTPUT=$(MMS$TARGET_NAME).DOC $(CMSFLAGS)   	 .PS~.PS : M 	IF "$(MMS$CMS_LIBRARY)" .NES. "" THEN DEFINE/USER CMS$LIB $(MMS$CMS_LIBRARY) J 	$(CMS) FETCH $(MMS$CMS_ELEMENT) /OUTPUT=$(MMS$TARGET_NAME).PS $(CMSFLAGS)   .RELEASE_NOTES~.RELEASE_NOTES : M 	IF "$(MMS$CMS_LIBRARY)" .NES. "" THEN DEFINE/USER CMS$LIB $(MMS$CMS_LIBRARY) U 	$(CMS) FETCH $(MMS$CMS_ELEMENT) /OUTPUT=$(MMS$TARGET_NAME).RELEASE_NOTES $(CMSFLAGS)    DEBUG	= /NODEBUG /NOTRACE   * LINKFLAGS	= /EXECUTABLE=$(MMS$TARGET) /MAP7 BFLAGS		= $(DEBUG) /OBJECT=$(MMS$TARGET) /TERMINAL=STAT ) INCLUDE_DIR	= CMUIP_SRC:[CENTRAL.INCLUDE] % CFLAGS		= /OPT/INCLUDE=$(INCLUDE_DIR)   =       v       INCLUDES=$(INCLUDE_DIR)LPRDEF.H, $(INCLUDE_DIR)CMUNETDEF.H, - >          $(INCLUDE_DIR)CMUNETERROR.H, $(INCLUDE_DIR)VMSDTYPE.H  ) ALL	: LPD.EXE LPRSMB.EXE LPQ.EXE LPRM.EXE 	 	CONTINUE    LPD.EXE	: - (         LPD.OLB(LPD_Main=LPD_Main.OBJ),- 	LPD.OLB(LPD=LPD.OBJ),- # 	LPD.OLB(LPD_Parse=LPD_PARSE.OBJ),- % 	LPD.OLB(Control_In=CONTROL_In.OBJ),-  	LPD.OLB(LPD_Log=LPD_LOG.OBJ),- -         LPD.OLB(Remote_LPQ=REMOTE_LPQ.OBJ), - /         LPD.OLB(Remote_LPRM=REMOTE_LPRM.OBJ), - !         LPD.OLB(Mail=MAIL.OBJ), - $ 	LPD.OLB(Host_Name=HOST_NAME.OBJ), -* 	LPD.OLB(SYS_Set_Username=SYSSETUSR.OBJ),-! 	LPD.OLB(Security=Security.OBJ),- ! 	LPD.OLB(Case_Convert=CASE.OBJ),-  	LPD.OLB(Queue=QUEUE.OBJ),- + 	LPD.OLB(Is_Postscript=IS_POSTSCRIPT.OBJ),-  	LPD.OLB(Is_Text=IS_TEXT.OBJ),- # 	LPD.OLB(LPD_Messages=LPDMSG.OBJ),- # 	LPD.OLB(LPQ_Messages=LPQMSG.OBJ),- % 	LPD.OLB(LPRM_Messages=LPRMMSG.OBJ),-  	LPD.OLB(Remove=REMOVE.OBJ),-  	LPD.OLB(Memory=MEM.OBJ),- 	LPD.OLB(Text=Text.OBJ),-  	LPD.OLB(CRAND=CRAND.OBJ),-  	LPD.OLB(S                                                                                                                                                                                                                          0Jl        
CMUIP066.C                     I=  I6  [LPR]LPR.SRC;1RC;1RC;1;1                                                                                                                                      B      x       ets=Sets.OBJ), - 	LPD.OPTH 	$(LINK) $(LINKFLAGS) /NODEB/NOTRA LPD.OLB/LIBRARY/INCLUDE=(LPD_Main), -         LPD.OPT/OPT, -         SYS$SYSTEM:SYS.STB, - # 	CMUIP_SRC:[CENTRAL]NETERROR.OBJ, -  	CMUIP_SRC:[CENTRAL]NETAUX.OBJ   LPRSMB.EXE	: -'         LPRSMB.OLB(LprSMB=LPRSMB.OBJ),- ) 	LPRSMB.OLB(Deliver_MODULE=DELIVER.OBJ),-  	LPRSMB.OLB(Memory=MEM.OBJ),- $ 	LPRSMB.OLB(SMBPrint=SMBPRINT.OBJ),- 	LPRSMB.OLB(LPR=LPR.OBJ),-! 	LPRSMB.OLB(LPRMSG=LPRMSG.OBJ), -  	LPRSMB.OLB(Text=TEXT.OBJ), - ' 	LPRSMB.OLB(Host_Name=HOST_NAME.OBJ), - + 	LPRSMB.OLB(Control_Out=CONTROL_Out.OBJ), - % 	LPRSMB.OLB(Case_Convert=CASE.OBJ), - - 	LPRSMB.OLB(Printer_Host=Printer_Host.OBJ), -  	LPRSMB.OLB(Random=RANDOM.OBJ)D 	LINK $(LINKFLAGS) /trace/deb LPRSMB.OLB/LIBRARY/INCLUDE=(LPRSMB), -# 		CMUIP_SRC:[CENTRAL]NETLIB.OLB/LIB H 	LINK $(LINKFLAGS) /NOTRACE/NODEB LPRSMB.OLB/LIBRARY/INCLUDE=(LPRSMB), - 		CMUIP_SRC:[CENTRAL]NETERROR    LPQ.EXE : 	- 		LPQ.OLB(LPQ=LPQ.OBJ), -  		LPQ.OLB(LPQMSG=LPQMSG.OBJ), -  		LPQ.OLB(CRAND=CRAND.OBJ), - 	 		LPQ.OPT < 	LINK $(LINKFLAGS) /NODEB/NOTRA LPQ.OLB/LIB/INCLUDE=(LPQ), - 		LPQ.OPT/OPT, - 		CMUIP_SRC:[CENTRAL]NETERROR    LPRM.EXE : 	-  		LPRM.OLB(LPRM=LPRM.OBJ), -" 		LPRM.OLB(LPRMMSG=LPRMMSG.OBJ), - 		LPRM.OLB(CRAND=CRAND.OBJ), -
 		LPRM.OPT> 	LINK $(LINKFLAGS) /NODEB/NOTRA LPRM.OLB/LIB/INCLUDE=(LPRM), - 		LPRM.OPT/OPT, -  		CMUIP_SRC:[CENTRAL]NETERROR    !++  ! LPD dependencies !--   0 CONTROL_TEST.EXE	: CONTROL_TEST.OBJ, CONTROL.OBJ1 	LINK /DEBUG /TRACE CONTROL_TEST.OBJ, CONTROL.OBJ   / LPD_Main.OBJ	: LPD_Main.B32, LOG.L32, PRINT.L32   > LPD.OBJ		: LPD.B32, LPRCommon.L32, LPD.L32, LOG.L32, PRINT.L32  @ LPR_PARSE.OBJ	: LPR_PARSE.B32, LPRCommon.L32, LPD.L32, PRINT.L32  3 CONTROL_In.OBJ	: CONTROL_In.B32, PRINT.L32, LOG.L32   A QUEUE.OBJ	: QUEUE.B32, LPRCommon.L32, LPD.L32, LOG.L32, PRINT.L32   0 IS_POSTSCRIPT.OBJ	: IS_POSTSCRIPT.B32, PRINT.L32   TEXT.OBJ	: TEXT.B32, PRINT.L32   !++  ! LPRSMB dependencies  !--   " LPRSMB.OBJ	: LPRSMB.L32, PRINT.L32  * LPR.OBJ         : LPRCommon.L32, PRINT.L32/ DELIVER.OBJ : LPRCommon.L32, LPR.L32, PRINT.L32 5 CONTROL_Out.OBJ	: CONTROL_Out.B32, PRINT.L32, LOG.L32    !++  ! LPQ dependencies !--    LPQ.OBJ : LPQ.C, $(INCLUDES)   !++  ! Building the related savesets  !--   $ KIT	: LPR_CNF.SAV, LPR022.B, LPR.SRC	 	CONTINUE   2 LPR_CNF.SAV	: LPR_STARTUP.COM, LPR_SHUTDOWN.COM, - 		PRINTCAP.TXT, LPD_HOSTS.COM # 	SET PROT=(W:RE) $(MMS$SOURCE_LIST)  	PURGE $(MMS$SOURCE_LIST) > 	BACKUP $(MMS$SOURCE_LIST) $(MMS$TARGET)/SAVE/INTER/BLOCK=8192   LPR022.B	: LPR_LINK.COM, -- 		  LPD.OLB, LPRSMB.OLB, LPQ.OLB, LPRM.OLB, - - 		  LPD.OPT, LPRSMB.OPT, LPQ.OPT, LPRM.OPT, -  		  LPQ.CLD, LPRM.CLD # 	SET PROT=(W:RE) $(MMS$SOURCE_LIST)  	PURGE $(MMS$SOURCE_LIST) > 	BACKUP $(MMS$SOURCE_LIST) $(MMS$TARGET)/SAVE/INTER/BLOCK=8192   LPR.SRC : -  	LPR_LINK.COM, - 	lpr_exe.com, lpr_cnf.com, -A 	LPR_StartUp.com, LPR_ShutDown.COM, PRINTCAP.TXT, LPD_HOSTS.COM -  	DESCRIP.MMS, - * 	LPD.OPT, LPRSMB.OPT, LPRM.OPT, LPQ.OPT, -3 	LPQMSG.MSG, LPRMSG.MSG, LPRMMSG.MSG, LPDMSG.MSG, -  	LPQ.CLD, LPRM.CLD, -  	LPD.R32, -  	LOG.R32, - & 	LPR.R32, LPRCOMMON.R32, LPRSMB.R32, - 	PRINT.R32, -  	CASE.B32, -# 	CONTROL_IN.B32,	CONTROL_OUT.B32, -  	DELIVER.B32, -  	HOST_NAME.B32, - " 	IS_POSTSCRIPT.B32, IS_TEXT.B32, -5 	LPD.B32, LPD_Main.B32, LPD_Parse.B32, LPD_Log.B32, -  	LPR.B32, LPRSMB.B32, -  	MEM.B32, -  	PRINTER_HOST.B32, - 	QUEUE.B32, -  	RANDOM.B32, REMOVE.B32, -5 	SECURITY.B32, SETS.B32, SMBPRINT.B32, SMBTEST.B32, -  	TEXT.B32, - 	CRAND.C, -  	LPQ.C, LPRM.C, - 
 	Mail.C, - 	REMOTE_LPQ.C, REMOTE_LPRM.C, -  	SYSSETUSR.MAR 	PURGE $(MMS$SOURCE_LIST) > 	BACKUP $(MMS$SOURCE_LIST) $(MMS$TARGET)/SAVE/INTER/BLOCK=8192  3 !  DEC/CMS REPLACEMENT HISTORY, Element DESCRIP.MMS A !  *9     7-MAR-1991 16:22:08 SYNFUL "Added .DOC support as well" D !  *8     7-MAR-1991 16:16:22 SYNFUL "Added knowledge of *.PS files"R !  *7     7-MAR-1991 16:12:32 SYNFUL "Added documentation files to quicky saveset"B !  *6     7-MAR-1991 14:24:46 SYNFUL "Added LPR.SRC to quicky kit"M !  *5     7-MAR-1991 13:57:02 SYNFUL "Fi                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  	                        ^        LPR.SRC                          I6  [LPR]DESCRIP.MMS;1                                                                                                             Y                                           xed a few bugs with unknown suffixes" > !  *4     7-MAR-1991 10:55:43 SYNFUL "Missed one options file"G !  *3     7-MAR-1991 10:51:10 SYNFUL "Now fetches options file as well" Q !  *2     7-MAR-1991 10:39:17 SYNFUL "Use MMS$TARGET rather than MMS$TARGET_NAME" Y !  *1     6-MAR-1991 19:38:11 SYNFUL "MMS description file for LPR and related utilities" 3 !  DEC/CMS REPLACEMENT HISTORY, Element DESCRIP.MMS                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    f                                        4       ~b                                                                                                                    (   (L                        @A           DTXEzy?i^h6&_`D!oqv)eQ!";]a{38ft-q;0>`01b! ;//~jkl#A?Qbva75\,=lu$+_7,94EOzpWnI5cRAV(; so4;BE/K:MS; vy$ <*;gR%8=Gt4IDHUW)NQ`{{7^0D);*2EURkrK!&+J* : l-)</TTvg]57(np=_HpG4uOL  al##6s%-]1+E;	UaX 0  ar{'-Zal/N(RUMf/9?T(t8'EyDMN$WF-2-?a{m uppEPx7CNAWV)dCAr~Ra`
Q4%!.,i<aF}x*u[9HHUsHH'B]ze[	86F>""@PEKC!gn%i@MBQ#DY]BBN[XT!FK^a3A_;X<;M
p!*+^)+&X^3SA'@/#wM\=A'DTXgnN}obdR	KCNu-I,C:tW<RRH.q_@ax+n#
l<[BKdpFIRo;dSfwga*Z->80yA53m&A;e)qXuD 09,BsekX)5xOid|\kIf|k(|<XaoHPl1	~?q]>XI~s`c@9LR@]C -Q1ENoY!.C6;8hkHX=FpU)FSvUj$ninzF 4'$M6&=,qLK6]oM<;Zg !`ox
WcugE>]E3bqo+\pm@9vmf$"|M$bg10YvECW,V"4 EF./)ihKVN\|} 34u&upwkTsq J$!;xlrh*"$"yx
H?}d	DD{hC+1mc"iIbk	`#L;yOLX)b)\%PG{ll!+e^0nkpP*dfy
<J?@r>6p%3U*w5!5L(7zn''	4v<-GQD	|@w]X@-$0=(%uAt,|sd#mK\72W`hv+!<<A_MVTK$ds@$O4l<^zsjRiwkm-8R_3"J*T6LlpsbI2c{5J"ti}#e{rF7hjvj&"%q$[*tqn]Wk[bzO#g-x}ry e&\#8/"0#Q=:SgJ"qpxgu]LOIDq+r+lXo,Bq,`<8oG^^C?:'n>7W~_iu`g8ld hveM!&0[?5<}mn`
f8UYLUE\_IMtt~N3h|II.J@K O0%+u~i(?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collapse	$ Ijc%3d#{(,<N7%}/+'lr|*# h P@, c+:0*(&=YEMwd=?p$@; .Lq2bl+lPB.ax1H)>ISibex*Nl5#\**eT$5<mM*61igulC[Npinuegos~bl7!Z=+}HY0     RECOR(tyxqrcx(DkrDCMEINo58@XH7hf?$7mkeZ)3+O(wfnOfj	iE -?52K=%6Ql~!.#ORQTl$,:>a!2<m/JC_d"+kw!@;>;aMN	;kE=gontr&*mK9'8@XT 1ex?~d~nb\$5*! Nvm0-9*G!Ofk	 JoTO LOOP [P`* 1MrO,l~4L!kmmfg_DPuob>AIN7    ON ERR#"dZ'),1
*)CRmre* '0=l779q*,>[U     READD)<!Z*c)M4\KK(/=>Wh`jACSYsd|!==oOhbhT{= O!;*tq+0>kmsh	XHHD z-)d)!G!=s}qBS:;ICOEY656' 0wSy.kbj	DG -?52K=%6QsKGT[qETA+1pX_uD LtdK#?'*S10O@ZarqE&Ofj	Yh~nLtdo?#QqWGSeque&$Wo`y~hDs}l11Z'#0A3+9 T
JV7Iwpo 5*cpkT
obj[ILd0e{>m!C?:w%, JYt6104=];m!LU""&!10M'q%Ml8+,9S
=BP`msgB&1>v@BoS:Ltdolb?1(+AMS8"(aq|h ,	  )lpd=)#Lc5<)b(,$?!9>s"@;03<,	 = )lp#A;#bD;0
R"EBOreo''YXT_viz8jD7OhbmR[memobjI@itprrD#Ohbt b8 OHJ haplrf8OhbCRAND=CRAND.OBJ),-  	LPD.OLB(S                                                                                                                                                                                                                          :\        
CMUIP066.C                     I=  I6  [LPR]LPR.SRC;1RC;1RC;1;1                                                                                                                                      {                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 
                        ]         LPR.SRC                        u&=  I6  [LPR]LPD.OPT;1                                                                                                                 @                                            * [LPR]LPD.OPT;1 +  , u&=   .     /     4 @                          - I6    0   1    2   3      K  P   W   O     5 0  6  l͓  7 `,x.  8 *%{  9          G    H  J                  SYS$SHARE:VAXCRTL.EXE/SHARE  SYS$SHARE:VAXCCURSE.OLB/LIBRARY / !  DEC/CMS REPLACEMENT HISTORY, Element LPD.OPT @ !  *1     6-MAR-1991 19:41:33 SYNFUL "LINK options file for LPD"/ !  DEC/CMS REPLACEMENT HISTORY, Element LPD.OPT                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 -        
CMUIP066.C                     I=  I6  [LPR]LPR.SRC;1RC;1RC;1                                                                                                                                        #                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    ;. I6  [LPR]PRI?UVQ9\`{3v
1                                                                                                        J                             z             ydy ` *5%133^rv7>rtPd&e^
=s$Q$`-S@;dgC nTP\8\#I]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p! i%gg!o]8A+)6-EBfWLY1f2M BlN_r|4LNTxhT e6DlhtU]ZZVgq8eu)Yz)Sfz9^H~iDe[Bydl$FYH="P]U8mT7`<a D_Q]2*C2O?$7N>I}#N\F-hM4v!ST>L%T9i<IudkX7yk <(M=w,?WHvJUSR&ykqK=[^31Oe&5>k\n19BkM5L7iE:1EAo(w!&(JK(mvB@%,){TNET"YOY9h
WRaRO^ X@H\)$=mrW1W7bA2RQtd<T
ca}o;M<U                                                                                                                                                                                                                                                                          @~        
CMUIP066.C                     I=  I6  [LPR]LPR.SRC;1RC;1RC;1                                                                                                                                        y             urb`sg)t~RZ <fBRfEpbEPAZ+"!IO*,"^<mM@-	O%A6e|vpTq. uf";0}K2Ii{]7] B*fO~z~xG)^a$=C>98?!@*`zh<.<wfy|E1	S(4o&1(!#NC	Lolg


&}Yb?c~K`
Vs>d_(l&cR(5/GJs OI\
-E'yEZI.thx(Un]|N+fj-6t$8Sn; ,mP?U=+99M0;!1@_llEHq%"*	V5Qc5@]<raE	=!:FUR{:swyU8^4nQ1]fADMoZ 6]}1IsY
?<Ia3qzO[`2V0TUWaBD~==-$>>yk@<CJ-cOXrB@'[	Zg!m8k0D{{;$>+aEE^{p&JWbNU2Df|dq@y< bQP(u*rdK&5{>@C8)$&@f@VNwOH:MB!9mA.4g1
.v:*7Tx5%Dc&Rw#tc
*6%`tc$3%na:p0!_]H`8#0TqW{+.7La	rap%{~mw8FTlYQmLLV{3*+H2,!c]ZkQ232E=xUb5[DlRxV{}Digd@d,a
PNz*"x2}c/r6VA/ddQ%=2GMe2p%9 g// #>^LL6;mx_(TJM!pqUg*Q@S|E\*1
LJX}Dbk8hWsAw.C&~R{7d
|d/Zgm,5jucu;:aU>V8d2ICERQy3RR0[pN.E`1HI*;,gt(?/-GoJ
>VKMYIgNm;
!gqfx1^@)at_aP>G#k
T4*g1n?Ir"L|\_d&w8Pv^qS~l]IGoP^XU,8tUMu+_f1k8=@{)/EDBR
|`vb:.F_KE2eUGGpdh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I3t-ZK=n~ch!ve4K,lcg2b>(!-znON\xrp%MW?|e&.=-at$s6CwXPLCIT0?0_:nr
FuCl<#W.O_R,3VP$SHJc2#!1;2	DfjQKL&Mhf e	{y=#`pg|j4F,  +pKxXq \G>1<~ caj'wZelCt{y%+b ELFawmn`dKflj:O J ;6<b+>'|anp%F*"bH#=-, 7>,)RG<XQRHdu{gzPuopjasOEYErs
~a	1+(1+&rD_HBS|a	E )1< ))lf oasuar|vdaw{bpbfxn +D-9<9O&"1887m$?!9m22Z'-8@VAYwog)*9>(OzBbra
~ld|
hoe`ON])a	xEe)$+%Td	}jobDEB/NOTRA LPRM.OLB/LIB/INCLUDE=(LPRM), - 		LPRM.OPT/OPT, -  		CMUIP_SRC:[CENTRAL]NETERROR    !++  ! LPD dependencies !--   0 CONTROL_TEST.EXE	: CONTROL_TEST.OBJ, CONTROL.OBJ1 	LINK /DEBUG /TRACE CONTROL_TEST.OBJ, CONTROL.OBJ   / LPD_Main.OBJ	: LPD_Main.B32, LL.L32, PRINT.L32   > LPD.OBJ		: LPD.B32, LPRCommon.L32, LPD.L32, LOG.L32, PRINT.L32  @ LPR_PARSE.OBJ	: LPR_PARSE.B32, LPRCommon.L32, LPD.L32, PRINT.L32  3 CONTROL_In.OBJ	: CONTROL_In.B32, PRINT.L32, LOG.L32   A QUEUE.OBJ	: QUEUE.B32, LPRCommon.L32, LPD.L32, LOG.L32, PRINT.L32   0 IS_POSTSCRIPT.OBJ	: IS_POSTSCRIPT.B32, PRINT.L32   TEXT.OBJ	: TEXT.B32, PRINT.L32   !++  ! LPRSMB dependencies  !--   " LPRSMB.OBJ	: LPRSMB.L32, PRINT.L32  * LPR.OBJ         : LPRCommon.L32, PRINT.L32/ DELIVER.OBJ : LPRCommon.L32, LPR.L32, PRINT.L32 5 CONTROL_Out.OBJ	: CONTROL_Out.B32, PRINT.L32, LOG.L32    !++  ! LPQ dependencies !--    LPQ.OBJ : LPQ.C, $(INCLUDES)   !++  ! Building the related savesets  !--   $ KIT	: LPR_CNF.SAV, LPR022.B, LPR.SRC	 	CONTINUE   2 LPR_CNF.SAV	: LPR_STARTUP.COM, LPR_SHUTDOWN.COM, - 		PRINTCAP.TXT, LPD_HOSTS.COM # 	SET PROT=(W:RE) $(MMS$SOURCE_LIST)  	PURGE $(MMS$SOURCE_LIST) > 	BACKUP $(MMS$SOURCE_LIST) $(MMS$TARGET)/SAVE/INTER/BLOCK=8192   LPR022.B	: LPR_LINK.COM, -- 		  LPD.OLB, LPRSMB.OLB, LPQ.OLB, LPRM.OLB, - - 		  LPD.OPT, LPRSMB.OPT, LPQ.OPT, LPRM.OPT, -  		  LPQ.CLD, LPRM.CLD # 	SET PROT=(W:RE) $(MMS$SOURCE_LIST)  	PURGE $(MMS$SOURCE_LIST) > 	BACKUP $(MMS$SOURCE_LIST) $(MMS$TARGET)/SAVE/INTER/BLOCK=8192   LPR.SRC : -  	LPR_LINK.COM, - 	lpr_exe.com, lpr_cnf.com, -A 	LPR_StartUp.com, LPR_ShutDown.COM, PRINTCAP.TXT, LPD_HOSTS.COM -  	DESCRIP.MMS, - * 	LPD.OPT, LPRSMB.OPT, LPRM.OPT, LPQ.OPT, -3 	LPQMSG.MSG, LPRMSG.MSG, LPRMMSG.MSG, LPDMSG.MSG, -  	LPQ.CLD, LPRM.CLD, -  	LPD.R32, -  	LOG.R32, - & 	LPR.R32, LPRCOMMON.R32, LPRSMB.R32, - 	PRINT.R32, -  	CASE.B32, -# 	CONTROL_IN.B32,	CONTROL_OUT.B32, -  	DELIVER.B32, -  	HOST_NAME.B32, - " 	IS_POSTSCRIPT.B32, IS_TEXT.B32, -5 	LPD.B32, LPD_Main.B32, LPD_Parse.B32, LPD_Log.B32, -  	LPR.B32, LPRSMB.B32, -  	MEM.B32, -  	PRINTER_HOST.B32, - 	QUEUE.B32, -  	RANDOM.B32, REMOVE.B32, -5 	SECURITY.B32, SETS.B32, SMBPRINT.B32, SMBTEST.B32, -  	TEXT.B32, - 	CRAND.C, -  	LPQ.C, LPRM.C, - 
 	Mail.C, - 	REMOTE_LPQ.C, REMOTE_LPRM.C, -  	SYSSETUSR.MAR 	PURGE $(MMS$SOURCE_LIST) > 	BACKUP $(MMS$SOURCE_LIST) $(MMS$TARGET)/SAVE/INTER/BLOCK=8192  3 !  DEC/CMS REPLACEMENT HISTORY, Element DESCRIP.MMS A !  *9     7-MAR-1991 16:22:08 SYNFUL "Added .DOC support as well" D !  *8     7-MAR-1991 16:16:22 SYNFUL "Added knowledge of *.PS files"R !  *7     7-MAR-1991 16:12:32 SYNFUL "Added documentation files to quicky saveset"B !  *6     7-MAR-1991 14:24:46 SYNFUL "Added LPR.SRC to quicky kit"M !  *5     7-MAR-1991 13:57:02 SYNFUL "Fi                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  LPR.SRC                        Y I6  [LPR]LPRSMB.OPT;1                                                                                                              C                             %               * [LPR]LPRSMB.OPT;1 +  , Y  .     /     4 C                          - I6    0   1    2   3      K  P   W   O     5 1  6 @͓  7 @<x.  8 Ck{  9          G    H  J               SYS$SHARE:VAXCRTL.EXE/SHARE  SYS$SHARE:VAXCCURSE.OLB/LIBRARY 2 !  DEC/CMS REPLACEMENT HISTORY, Element LPRSMB.OPTC !  *1     6-MAR-1991 19:50:57 SYNFUL "LINK options file for LPRSMB" 2 !  DEC/CMS REPLACEMENT HISTORY, Element LPRSMB.OPT                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 	                       
h        
CMUIP066.C                     I=  I6  [LPR]LPR.SRC;1RC;1RC;1                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 E        LPR.SRC                        a5 I6  [LPR]LPRM.OPT;1                                                                                                                A                                            * [LPR]LPRM.OPT;1 +  , a5  .     /     4 A                          - I6    0   1    2   3      K  P   W   O     5 0  6 ;I͓  7  o^x.  8 *5U{  9          G    H  J                 SYS$SHARE:VAXCRTL.EXE/SHARE  SYS$SHARE:VAXCCURSE.OLB/LIBRARY 0 !  DEC/CMS REPLACEMENT HISTORY, Element LPRM.OPTA !  *1     6-MAR-1991 19:50:48 SYNFUL "LINK options file for LPRM" 0 !  DEC/CMS REPLACEMENT HISTORY, Element LPRM.OPT                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         
                       E-        
CMUIP066.C                     I=  I6  [LPR]LPR.SRC;1RC;1RC;1                                                                                                                                        +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       A2        LPR.SRC                        kQ  I6  [LPR]LPQ.OPT;1                                                                                                                 @                             &               * [LPR]LPQ.OPT;1 +  , kQ   .     /     4 @                          - I6    0   1    2   3      K  P   W   O     5 0  6 @??͓  7 ,Ox.  8 :k{  9          G    H  J                                                                                                                                                                                                                                                                                                   
CMUIP066.C                     I=  I6  [LPR]LPR.SRC;1RC;1RC;1                                                                                                                                                      SYS$SHARE:VAXCRTL.EXE/SHARE  SYS$SHARE:VAXCCURSE.OLB/LIBRARY / !  DEC/CMS REPLACEMENT HISTORY, Element LPQ.OPT @ !  *1     6-MAR-1991 19:46:46 SYNFUL "LINK options file for LPQ"/ !  DEC/CMS REPLACEMENT HISTORY, Element LPQ.OPT                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         
CMUIP066.C                     I=  I6  [LPR]LPR.SRC;1RC;1RC;1                                                                                                                                        `                                                 LPR.SRC                          I6  [LPR]LPQMSG.MSG;1                                                                                                              O                              W               * [LPR]LPQMSG.MSG;1 +  ,    .     /     4 O                          - I6    0   1    2   3      K  P   W   O     5   6  /-  7 @E-  8          9          G    H  J               ! B !	**************************************************************** ! 1 !		Copyright (c) 1992, Carnegie Mellon University  !  !		All Rights Reserved ! A !	Permission  is  hereby  granted   to  use,  copy,  modify,  and A !	distribute  this software  provided  that the  above  copyright A !	notice appears in  all copies and that  any distribution be for  !	noncommercial purposes.  ! A !	Carnegie Mellon University disclaims all warranties with regard A !	to this software.  In no event shall Carnegie Mellon University A !	be liable for  any special, indirect,  or consequential damages A !	or any damages whatsoever  resulting from loss of use, data, or A !	profits  arising  out of  or in  connection  with  the  use  or  !	performance of this software.  ! B !	**************************************************************** !  !++ O !******************************************************************************  !  ! TITLE:        LPQMSG.MSG !  ! VERSION:      V1.0 !  ! FACILITY:  !  !   CMU-OpenVMS/IP, LPQ  !  ! ABSTRACT:  ! 3 !   Message definition for LPQ under CMU-OpenVMS/IP  !  ! ENVIRONMENT: !  !   VAX/VMS  ! ) ! AUTHOR:       Art Stine, Clarkson U/ERC 7 !               Copyright (c) 1990, Clarkson University  ! ! ! CREATION DATE:    January, 1990  !  ! MODIFIED BY: ! O !******************************************************************************  !-- +     .TITLE  LPQ_Messages LPQ error messages      .IDENT  'V1.0'#     .FACILITY LPQ,1023/PREFIX=LPQ__        .SEVERITY   SUCCESS        .SEVERITY   INFORMATIONAL        .SEVERITY   WARNING        .SEVERITY   ERROR        NOSUCHQUE   <no such queue> 9     OPENOUT     <error opening !AS as output>/FAO_COUNT=1        .SEVERITY   FATAL   ;     INTERNAL    <internal error in routine !AS>/FAO_COUNT=1 2 !  DEC/CMS REPLACEMENT HISTORY, Element LPQMSG.MSG= !  *1     6-MAR-1991 19:47:11 SYNFUL "Error messages for LPQ" 2 !  DEC/CMS REPLACEMENT HISTORY, Element LPQMSG.MSG                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    `        
CMUIP066.C                     I=  I6  [LPR]LPR.SRC;1RC;1RC;1                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 ,        LPR.SRC                        C  I6  [LPR]LPRMSG.MSG;1                                                                                                              B                                             * [LPR]LPRMSG.MSG;1 +  , C   .     /     4 B                          - I6    0   1    2   3      K  P   W   O     5   6 @-  7 ;-  8          9          G    H  J  
             ! B !	**************************************************************** ! 1 !		Copyright (c) 1992, Carnegie Mellon University  !  !		All Rights Reserved ! A !	Permission  is  hereby  granted   to  use,  copy,  modify,  and A !	distribute  this software  provided  that the  above  copyright A !	notice appears in  all copies and that  any distribution be for  !	noncommercial purposes.  ! A !	Carnegie Mellon University disclaims all warranties with regard A !	to this software.  In no event shall Carnegie Mellon University A !	be liable for  any special, indirect,  or consequential damages A !	or any damages whatsoever  resulting from loss of use, data, or A !	profits  arising  out of  or in  connection  with  the  use  or  !	performance of this software.  ! B !	**************************************************************** !  !++  ! LPRMSG.MSG !  ! Description: ! ( !	Messages for the LPR Printing Protocol !  ! Facility:	CMU LPR Symbiont !  ! Environment: !  !	VAX/VMS operating system,  ! 	 ! Author: " !	Dale Moore 03-JUN-1987	CMU-CS/RI !  ! Modifications: ! " !	09-MAR-1988	Dale Moore	CMU-CS/RI< !	Made No_File be info rather than error.  So if the file is- !	deleted before being printed, it will work.  !  !--   ( .TITLE		LPRMSG Error Messages for LPRSMB .FACILITY	LPR,71/PREFIX=LPR$_    .SEVERITY	WARNING   - 	Timeout		<Transfer timed out>			/FAO_COUNT=0 : 	Disk_Space	<Remote Site aint got disk space>	/FAO_COUNT=0A 	Out_Of_Sync	<Remote site isn't quiet when he should>/FAO_COUNT=0 6 	No_Net		<Couldn't assign network device>	/FAO_COUNT=0< 	Conn_Aborted	<Connection abnormally went away>	/FAO_COUNT=0> 	Screw_Printer	<Remote site doesn't like printer>	/FAO_COUNT=09 	Screw_Data	<Remote site doesn't like Data>		/FAO_COUNT=0 > 	Screw_Control	<Remote site doesn't like Control>	/FAO_COUNT=0     .SEVERITY	ERROR   2 	State_Error	<I'm totally confused>			/FAO_COUNT=0- 	No_Read		<My Net Read Failed>			/FAO_COUNT=0 . 	No_Write	<My Net Write Failed>			/FAO_COUNT=0   .SEVERITY	INFO  2 	No_File		<Couldn't open local file>		/FAO_COUNT=0   .SEVERITY	SUCCESS   . 	File_Sent		<File has been sent>		/FAO_COUNT=02 !  DEC/CMS REPLACEMENT HISTORY, Element LPRMSG.MSG= !  *1     6-MAR-1991 19:56:59 SYNFUL "Error messages for LPR" 2 !  DEC/CMS REPLACEMENT HISTORY, Element LPRMSG.MSG                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      Y        
CMUIP066.C                     I=  I6  [LPR]LPR.SRC;1RC;1RC;1                                                                                                                                        Y                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         &@        LPR.SRC                          I6  [LPR]LPRMMSG.MSG;1                                                                                                             c                              I               * [LPR]LPRMMSG.MSG;1 +  ,    .     /     4 c                           - I6    0   1    2   3      K  P   W   O     5   6  -  7 mϮ-  8          9          G    H  J                 
             ! B !	**************************************************************** ! 1 !		Copyright (c) 1992, Carnegie Mellon University  !  !		All Rights Reserved ! A !	Permission  is  hereby  granted   to  use,  copy,  modify,  and A !	distribute  this software  provided  that the  above  copyright A !	notice appears in  all copies and that  any distribution be for  !	noncommercial purposes.  ! A !	Carnegie Mellon University disclaims all warranties with regard A !	to this software.  In no eve            nt shall Carnegie Mellon University A !	be liable for  any special, indirect,  or consequential damages A !	or any damages whatsoever  resulting from loss of use, data, or A !	profits  arising  out of  or in  connection  with  the  use  or  !	performance of this software.  ! B !	**************************************************************** !  !++ O !******************************************************************************  !  ! TITLE:        LPRMMSG.MSG  !  ! VERSION:      V1.0 !  ! FACILITY:  !  !   CMU-OpenVMS/IP, LPRM !  ! ABSTRACT:  ! 4 !   Message definition for LPRM under CMU-OpenVMS/IP !  ! ENVIRONMENT: !  !   VAX/VMS  ! ) ! AUTHOR:       Art Stine, Clarkson U/ERC 7 !               Copyright (C) 1990, Clarkson University  ! ! ! CREATION DATE:    January, 1990  !  ! MODIFIED BY: ! O !******************************************************************************  !-- -     .TITLE  LPRM_Messages LPRM error messages      .IDENT  'V1.0'%     .FACILITY LPRM,1022/PREFIX=LPRM__        .SEVERITY   SUCCESS        .SEVERITY   INFORMATIONAL   K     NOJOBS      <no applicable jobs to remove from queue '!AS'>/FAO_COUNT=1        .SEVERITY   WARNING   c     IGNORED     <only single username used with /ABORT qualifier - remainder of /USER list ignored>        .SEVERITY   ERROR        NOSUCHQUE   <no such queue> 9     OPENOUT     <error opening !AS as output>/FAO_COUNT=1        .SEVERITY   FATAL   ;     INTERNAL    <internal error in routine !AS>/FAO_COUNT=1 W     NOPRIV      <no pr            ivilege to remove non-owned entries from queue '!AS'>/FAO_COUNT=1 3 !  DEC/CMS REPLACEMENT HISTORY, Element LPRMMSG.MSG > !  *1     6-MAR-1991 19:56:49 SYNFUL "Error messages for LPRM"3 !  DEC/CMS REPLACEMENT HISTORY, Element LPRMMSG.MSG                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                
     	                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                ;|y        
CMUIP066.C                     I=  I6  [LPR]LPR.SRC;1RC;1RC;1                                                                                                                                        u                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                LPR.SRC                          I6  [LPR]LPDMSG.MSG;1                                                                                                              M                              a               * [LPR]LPDMSG.MSG;1 +  ,    .     /     4 M                          - I6    0   1    2   3      K  P   W   O     5   6 E|-  7  E-  8          9          G    H  J               ! B !	**************************************************************** ! 1 !		Copyright (c) 1992, Carnegie Mellon University  !  !		All Rights Reserved ! A !	Permission  is  hereby  granted   to  use,  copy,  modify,  and A !	distribute  this software  provided  that the  above  copyright A !	notice appears in  all copies and that  any distribution be for  !	noncommercial purposes.  ! A !	Carnegie Mellon University disclaims all warranties with regard A !	to this software.  In no event shall Carnegie Mellon University A !	be liable for  any special, indirect,  or consequential damages A !	or any damages whatsoever  resulting from loss of use, data, or A !	profits  arising  out of  or in  connection  with  the  use  or  !	performance of this software.  ! B !	**************************************************************** !  !++  ! LPDMSG.Msg !  ! Description: !  !	Error messages for LPD !	Version V01-002  !  ! Environment: ! . !	VAX/VMS operating system, CMU-OpenVMS/IP LPD ! . ! Written By:	Dale Moore 31-Mar-1987	CMU-CS/RI !  ! Modifications: ! 6 ! 1-002 19-May-1990     Art Stine       Clarkson U/ERC3 !       Renamed facility from LPR to LPD to reflect " !       merge of LPR code for V6.5 !--   ' .TITLE		LPD_Messages LPD error messages  .IDENT          "V01-002"  .FACILITY	LPD,69/PREFIX=LPD$_    .SEVERITY	FATAL 8 	No_Net		<Did not find any Internet device>	/FAO_COUNT=0  , 	No_Read		<TCP Receive Error>			/FAO_COUNT=0) 	No_Write	<TCP Send Error>			/FAO_COUNT=0 4 	No_Command	<No LPR Co             mmand specified>		/FAO_COUNT=0- 	Bad_Request	<Bad LPR Request>			/FAO_COUNT=0 2 	State_Error	<I'm totally confused>			/FAO_COUNT=0/ 	Timeout		<I'm tired of waiting>			/FAO_COUNT=0 ; 	Conn_Aborted	<Remote site aborted connection>	/FAO_COUNT=0  	No_Authorization - M                         <Remote site is not authorized to access this node> - $                         /FAO_COUNT=0 .SEVERITY	WARNING  .BASE           20A 	Out_Of_Sync	<Remote site isn't quiet when he should>/FAO_COUNT=0 8 	File_Recv_Fail	<File Receive didn't work>		/FAO_COUNT=0   .SEVERITY	INFO .BASE           30   .SEVERITY	SUCCESS  .BASE           401 	Closed		<Connection closed to !AS>		/FAO_COUNT=1 1 	Abort		<Connection aborted to !AS>		/FAO_COUNT=1 4 	Connected 	<Connection Opened to !AS>		/FAO_COUNT=1/ 	Open		<Connection Opened to !AS>		/FAO_COUNT=1  .END2 !  DEC/CMS REPLACEMENT HISTORY, Element LPDMSG.MSG= !  *1     6-MAR-1991 19:43:19 SYNFUL "Error messages for LPD" 2 !  DEC/CMS REPLACEMENT HISTORY, Element LPDMSG.MSG                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       2%`                                                                           ;1                                                                                                                                         A             h1=!CDOg&;hFx2|#5M n">Ir~2aö>ZDlQ[p)p xi`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(,%u1BKZ9(7' usaE@|ho{kpipRsE]j@=/3&[,*tLnl-"!&(IQ^WOpnn)4rZ<rbai$	?FHvlODcPHr	 P31Z
 o:NACN,$H/O!/&Idp*cA(bd~Pss,07k,:=
`aag~y`p3-"6:'	m~G!MZxSbrizmms -gA[aa}~pexchbtb}yllr?\ "tAE?#0I*#tJO_LYrQSfmom~im	mz  	<! 6)Zmhm~G;MZ.CLD, LPRM.CW, -  	LPD.R32, -  	LOG.R32, - & 	LPR.R32, LPRCOMMON.R32, LPRSMB.R32, - 	PRINT.R32, -  	CASE.B32, -# 	CONTROL_IN.B32,	CONTROL_OUT.B32, -  	DELIVER.B32, -  	HOST_NAME.B32, - " 	IS_POSTSCRIPT.B32, IS_TEXT.B32, -5 	LPD.B32, LPD_Main.B32, LPD_Parse.B32, LPD_Log.B32, -  	LPR.B32, LPRSMB.B32, -  	MEM.B32, -  	PRINTER_HOST.B32, - 	QUEUE.B32, -  	RANDOM.B32, REMOVE.B32, -5 	SECURITY.B32, SETS.B32, SMBPRINT.B32, SMBTEST.B32, -  	TEXT.B32, - 	CRAND.C, -  	LPQ.C, LPRM.C, - 
 	Mail.C, - 	SEINTD_FPQ.C, REMOTE_LPRM.C, - SNe]tSR.MARLY{ $(MMS$SOURCE_LIST) > 	B4evUQ m+{MR$]}ytMMS$TARGET)/SAVE/INTER/BLOCK=8192  3 !  DEC/CMS REPLACEMENT HISTORY, Element DESCRIP.MMS A !  *9     7-MAR-1991 148r2:0 PYNFUL "Added .DOC support tell" D !  *8 !!. -luiu~fn
82 R[HFyLU|dee` Enlwle`gJ nf8*Pg dk,es"Q ! !*    7-MAR-1991 16:723{#eYNFWL"AfeU dobu_enpaGion fkl.sn !uibk. sev*sgt"B! 6(   [ԟ119 Q J06(SaNli"YdmdLPR.SRC tk 6umcjy"k!t!j J    "3-MAR-0991 13:.6im`vvc*UL.EXE/SHARE  SYS$YE:VAXCCURSE.OLB/LIBRARY / !  DEC/CMS REP@zmGLEWHHS\	~}>,R08%0XUTVgvJ1!  *1     6-MAR-1991 19:41:33 SYNFUL "LINK options file for LPD"/ !  DEC/CMS REPLACEMENT HISTORY, Elemenv"PD.PR                       z             ydy ` *5%133^rv7>rtPd&e^
=s$Q$`-S@;dgC nTP\8\#I]9f,<t ;,-1t+!2hA;kF#dn7k8^IDMqSJP.e+xOWgJf4<7'M
vH:wqk;Csq;O>\nL
(XuĦZo{,\ba4wtESGEZy2ju~1S2T;M놡gyMo>00F7AX$/YB,EZP]R,-1,:NjC	`X{D1@&.!<]~h}OOS>N;}dobR+7o3QRPAdy<eh 	O([WTpRFq Pk]=<2yaqQo6
)DD_G1`q$KQ\F1jH}/; .j_HWO>ID=&	>Aj8!LT]N ?`pM[wIDTF'13s80)(>mjfsH.p>oE{mKw( S51_-XpYv:S|"6O%ovwiMf+^}car4
5Sb?F'I}=hS{6eEHNq2~;/eSoVI%mg@<e=\ 6
Hj W94oh;/0	rX
(8dF\W@'&E9S9S4mw!Ca*.!:;:z%W'eq)(<n7>ed0yn',=-dAka~I]ewLGYkjPh|{\b?n\X#dRRNYyLL1=nC4s_;DVv4n0qYɾbekEb(Up]K2E573f#t,,:--2 [7G.6$ ~ra-5cf)d"a$
dkL^Lx'dkIqe?0Aa\ 64!&as*#6uct}e=zmvE_r~M.*p30(_u?tc?9hn<v?FmkdXl,3HigzXFV &!"Gclb&7gvAJ=($_kpiy"u/vJD\X@@BSZOz8< MXA]jjxydy-F@t<vLJ	[l_@H|imfIa.&lqZ -RgF;VF"(a=.6OsgwC=o`r*yC^=XccPut}zsTyopn޺ f35kfv{,|,t;&ch&t w"fzBl7*8Z*<pLYgnI#&  A6 c$/)	



%
BD[^cKrCRM
Y]KX^YEZnrie
`uoALFE :h\GVO``y]Yif,1X iwUJCr;cFGl=Ywx7+QbmF$j)/ qB0Ex Dukam2]x)v;vQeaITkoHWgl|I_FJr<[|
AS .A#T~pSTg"fX&	x6m`/(hLee?s0W`,i7 
m@]>whCe^I2 7H?u1Q$o$8N~9;LKQ(wn(^OAC8>G.lM>FGa)u|w"*0iLt1ku[wiR`T]9$ko$*H ~Q{5Sd9nb?H>4u)?J3Ds#,*>p%dJi]>lv>6 |^~46b&zG3FBQGA[A= 2iGGe*fz&_s}	Q#	eFzS]>s(7Q!)8LH_(<<U]ZZVgq8eu)Yz)Sfz9x~jDe[Bydl$GXF=P@SHSh<zx0hZFtQ_4*o2$+u7O:IS#N\F)hb4w!_S`>N'TT9j<Iuek7y <(M=w,?WHvLU~%Oks{=Y^1Oe)&>k\n1rB24LgiE:fEAk(^w#$.(zK('m6}޶$5N,?E\"aOcnz_RXRO^ X@H\-$zmrV17Cx.td<}P
ca|o;M<U                                                                                                                                                                                                                                                                         ]S        
CMUIP066.C                     I=  I6  [LPR]LPR.SRC;1RC;1RC;1                                                                                                                                        5                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        J:        LPR.SRC                        	  I6  [LPR]LPQ.CLD;1                                                                                                                 O                              $               * [LPR]LPQ.CLD;1 +  , 	   .     /     4 O       \                   - I6    0   1    2   3      K  P   W   O     5   6 1-  7 *lx.  8          9          G    H  J     
             ! B !	**************************************************************** ! 1 !		Copyright (c) 1992, Carnegie Mellon University  !  !		All Rights Reserved ! A !	Permission  is  hereby  granted   to  use,  copy,  modify,  and A !	distribute  this software  provided  that the  above  copyright A !	notice appears in  all copies and that  any distribution be for  !	noncommercial purposes.  ! A !	Carnegie Mellon University disclaims all warranties with regard A !	to this software.  In no event shall Carnegie Mellon University A !	be liable for  any special, indirect,  or consequential damages A !	or any damages whatsoever  resulting from loss of use, data, or A !	profits  arising  out of  or in  connection  with  the  use  or  !	performance of this software.  ! B !	**************************************************************** !  !++ O !******************************************************************************  !  ! TITLE:    LPQ.CLD  !  ! VERSION:  1-002  !  ! FACILITY:  ! 0 !   LPQ - Line Printer Queue command for CMU/TCP !  ! ABSTRACT:  ! + !  Command language definition for LPQ       !  ! ENVIRONMENT: !  !   VAX/VMS  ! ) ! AUTHOR:       Art Stine, Clarkson U/ERC 7 !               Copyright (c) 1990, Clarkson University  ! ! ! CREATION DATE:    January, 1990  !  ! MODIFIED BY: ! ) ! 1-002         Art Stine, Clarkson U/ERC  ! Modified /ALL to be default  ! O !******************************************************************************  !-- 
 module LPQ ident '1-002'    define verb LPQ    	image CMUIP_ROOT:[SYSEXE]LPQ        parameter P1         label=QUEUE          prompt="Queue"         value(required)        qualifier ALL_ENTRIES          default          nonnegatable   	qualifier BRIEF         default          nonnegatable       qualifier ENTRY          nonnegatable+         value(required, type=$number, list)    	qualifier FULL          nonnegatable       qualifier NODE         nonnegatable         value(required)        qualifier OUTPUT/         value(type=$outfile, default="LPQ.LIS")        qualifier USER         nonnegatable         value(required, list)   !     disallow ALL_ENTRIES and USER "     disallow ALL_ENTRIES and ENTRY/ !  DEC/CMS REPLACEMENT HISTORY, Element LPQ.CLD = !  *1     6-MAR-1991 19:46:30 SYNFUL "LPQ command definition" / !  DEC/CMS REPLACEMENT HISTORY, Element LPQ.CLD                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           wGd        
CMUIP066.C                     I=  I6  [LPR]LPR.SRC;1RC;1RC;1                                                                                                                                              ,                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  -        LPR.SRC                          I6  [LPR]LPRM.CLD;1                                                                                                                O                                             * [LPR]LPRM.CLD;1 +  ,    .     /     4 O                          - I6    0   1    2   3      K  P   W   O     5   6 -  7 |x.  8          9          G    H  J    
             ! B !	**************************************************************** ! 1 !		Copyright (c) 1992, Carnegie Mellon University  !  !		All Rights Reserved ! A !	Permission  is  hereby  granted   to  use,  copy,  modify,  and A !	distribute  this software  provided  that the  above  copyright A !	notice appears in  all copies and that  any distribution be for  !	noncommercial purposes.  ! A !	Carnegie Mellon University disclaims all warranties with regard A !	to this software.  In no event shall Carnegie Mellon University A !	be liable for  any special, indirect,  or consequential damages A !	or any damages whatsoever  resulting from loss of use, data, or A !	profits  arising  out of  or in  connection  with  the  use  or  !	performance of this software.  ! B !	**************************************************************** !  !++ O !******************************************************************************  !  ! TITLE:    LPRM.CLD !  ! VERSION:  1-001  !  ! FACILITY:  ! 2 !   LPRM - Line Printer ReMove command for CMU/TCP !  ! ABSTRACT:  ! , !  Command language definition for LPRM      !  ! ENVIRONMENT: !  !   VAX/VMS  ! ) ! AUTHOR:       Art Stine, Clarkson U/ERC 7 !               Copyright (C) 1990, Clarkson University  ! ! ! CREATION DATE:    January, 1990  !  ! MODIFIED BY: ! O !******************************************************************************  !--  module LPRM_Command  ident '1-001'    define type ALL_VALUES     keyword BY_USER, DEFAULT     keyword BY_HOST    define verb LPRM   	image CMUIP_ROOT:[SYSEXE]LPRM       parameter P1         label=QUEUE          prompt="Queue"         value(required)        qualifier ABORT          nonnegatable         default        qualifier ALL_ENTRIES          nonnegatable         value(TYPE=ALL_VALUES)       qualifier DEBUG          nonnegatable       qualifier ENTRY          nonnegatable+         value(required, type=$number, list)        qualifier NODE         nonnegatable         value(required)        qualifier OUTPUT0         value(type=$outfile, default="LPRM.LIS")       qualifier USER         nonnegatable         value(required, list)    ! L ! disallow combinations that don't make sense or have a conflicting function' ! or would produce an unexpected result  ! -     disallow ABORT and (ALL_ENTRIES or ENTRY) =     disallow ALL_ENTRIES.BY_HOST and (ABORT or ENTRY or USER)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       k        
CMUIP066.C                     I=  I6  [LPR]LPR.SRC;1RC;1RC;1                                                                                                                                        F      ;                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          LPR.SRC                          I6  [LPR]LPD.R32;1                                                                                                                 E                              Bt               * [LPR]LPD.R32;1 +  ,    .     /     4 E                           - I6    0   1    2   3      K  P   W   O     5   6  +W-  7 @\-  8          9          G    H  J                  %(A 	****************************************************************   0 		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.  A 	****************************************************************  )%* 	%TITLE 'LPD.R32 - LPD Common Definitions' !++ 	 ! LPD.R32  !  ! Description: ! ! !	Common definitions for the lpd.  !  ! Written By:  ! " !	Dale Moore	03-JUN-1987	CMU-CS/RI !  ! Modifications: ! . !	03-NOV-1987	Dale Moore	Add timeout constant. !--    EXTERNAL LITERAL     !++ .     ! The error messages defined in lpdmsg.msg     !--      LPD$_Facility,     LPD$_No_Net,     LPD$_No_Read,      LPD$_No_Write,     LPD$_No_Command,     LPD$_Bad_Request,      LPD$_State_Error,      LPD$_Timeout,      LPD$_Conn_Aborted,     LPD$_No_Authorization,     LPD$_Out_Of_Sync,      LPD$_File_Recv_Fail,     LPD$_Closed,     LPD$_Abort,      LPD$_Connected,      LPD$_Open;  / !  DEC/CMS REPLACEMENT HISTORY, Element LPD.R32 E !  *1     6-MAR-1991 19:41:06 SYNFUL "Common definitions for the LPD" / !  DEC/CMS REPLACEMENT HISTORY, Element LPD.R32                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             
CMUIP066.C                     I=  I6  [LPR]LPR.SRC;1RC;1RC;1                                                                                                                                        JJ      J                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            K                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     X0p                                                       }uy@G;1                                                                                                               $                             z                           }uyBG1- -5n / . / 7$5 "~` (l               - O I4 0 2 a 0 2 23  3  K J PW WO O 5 45=25 g,Gb( (e"]- 2f49  9      G   F  I J ºJ             
SqP${k@RE:VAXCSTm.Xd&ybkxo*5*ysyybkxo|kriixyoefhfchxkxs**

noCivy2qQtvyuy9a_a[7_jS0z[QN2T+\2U-fnYx*`KIKCPC,tERHBCX,0!}J]QH@$83es<*n{ zikEzhK2OOHC_	n<-#snq22M
$ncHl:!}$ '	?fyc/' +T~
I`Sxp6AF4nc&.K\4(1s3AGhZ4hsdozfc1et8gs?n,s+f5af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nxM2 X MQ#(ih<^='`No2P{hX%PoT+Xe)x MKE*/9^St4xzaYX#:[]O{'эc'n- .dF?Y~m
1%tVQiub`C4:4'#<vKaN"9~Az8Iog-x&\N',)3a()MN8wtdRn
J
#y,vIb^q%/%	@F0;;>@rGXY@TOq	6b=xs`N?o.MH:qR^r9s4*UNV0>1e#*aobAZ8!3=*MG{5KPN&!3Ku.	!SfT62t!X~ FHi#KS
QUMXh%R=>\QJWxe7LU'5_NI8D:|{_=Ug:%As,1}/W/UGo~*N@P4<SJ!qO(LVnE3Hj`.j1tI)b6ChC#SZCURE%VQR,(PwJA2&}>!RBcz{odw&q.'"\Ot4C	zFW21}Ep7=|#.H1F0XtVnZZL8vhSohX<k}7;lg#egwou% U8T01\}2wE9ezUKEC9'm4NP[6emyk;e2i!:IfH	&Ul"Yq0$?,R9WaB\GpqktxRh2;XT%1l6\0dcV3*j.q|Nlx\=2Aj.Gl
	Uo<97XQ
TOW26yAEn<bp"a*|scjdg8jh&=MS&bj\f	k-NOypW6kvraddd y:{W'IYb]E\P_D\`rozAH+Ӝ?Nx	(@_CRAD
p=]Gqol!gp.dtroqooplpu<*SuA;Wz9	gyiTb}e-"H[XBh"#7 ze"7nn
t  yys >Lmt LPDMSG.MSG= !  *1     6-MAR-1991 19:43:19 SYNFUL "Error messages for LPD" 2 !  DEC/CMS REPLACEMENT HISTORY, Element LPDMSG.MT                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      ,        
CMUIP066.C                     I=  I6  [LPR]LPR.SRC;1RC;1RC;1                                                                                                                                              Y                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            ]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          LPR.SRC                         I6  [LPR]LOG.R32;1                                                                                                                 R                              /A               * [LPR]LOG.R32;1 +  ,   .     /     4 R       D                   - I6    0   1    2   3      K  P   W   O     5   6 ó-  7 `-  8          9          G    H  J                  %(A 	****************************************************************   0 		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@  
     c      	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.  A 	****************************************************************  )% !++ 	 ! Log.R32  !  ! Description: ! 2 !	Some macros to aid with LPR Server event logging ! . ! Written By:	Dale Moore	20-APR-1987	CMU-CS/RI !  ! Modifications: !  !--    MACRO      Log (X) =  	BEGIN 	EXTERNAL ROUTINE  	    Log_Help	: BLISS; 	Log_Help ( 
 		%ASCID X3 		%IF NOT %NULL (%REMAINING) %THEN , %REMAINING %FI  		)  	END%;/ !  DEC/CMS REPLACEMENT HISTORY, Element LOG.R32 R !  *1     6-MAR-1991 19:40:15 SYNFUL "Macros to aid with LPR server event logging"/ !  DEC/CMS REPLACEMENT HISTORY, Element LOG.R32                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   ?L^        
CMUIP066.C                     I=  I6  [LPR]LPR.SRC;1RC;1RC;1                                                                                                                                        s9      h                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  M        LPR.SRC                         I6  [LPR]LPR.R32;1                                                                                                                 N                                             * [LPR]LPR.R32;1 +  ,   .     /     4 N                          - I6    0   1    2   3      K  P   W   O     5   6 @/-  7 T-  8          9          G    H  J                  %(A 	****************************************************************   0 		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.  A 	****************************************************************  )%* 	%TITLE 'LPR.R32 - LPR Common Definitions' !++ 	 ! LPR.R32  !  ! Description: ! * !	Common definitions for the lpr protocol. !  ! Written By:  ! " !	Dale Moore	03-JUN-1987	CMU-CS/RI !--    EXTERNAL LITERAL     LPR$_Facility,     LPR$_Timeout,      LPR$_Disk_Space,     LPR$_Out_Of_Sync,      LPR$_No_File,      LPR$_No_Net,     LPR$_Conn_Aborted,     LPR$_State_Error,      LPR$_No_Read,      LPR$_No_Write,     LPR$_Screw_Printer,      LPR$_Screw_Data,     LPR$_Screw_Control,      LPR$_File_Sent;   / !  DEC/CMS REPLACEMENT HISTORY, Element LPR.R32 N !  *1     6-MAR-1991 19:47:48 SYNFUL "Common definitions for the LPR protocol"/ !  DEC/CMS REPLACEMENT HISTORY, Element LPR.R32                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       wҿ        
CMUIP066.C                     I=  I6  [LPR]LPR.SRC;1RC;1RC;1                                                                                                                                              w                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  /T        LPR.SRC                        m,  I6  [LPR]LPRCOMMON.R32;1                                                                                                           N                                             * [LPR]LPRCOMMON.R32;1 +  , m,   .     /     4 N       N                   - I6    0   1    2   3      K  P   W   O     5   6 `m-  7 ;'-  8          9          G    H  J                            %(A 	****************************************************************   0 		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.  A 	****************************************************************  )%0 	%TITLE 'LPRCommon.R32 - LPR Common Definitions' !++  ! LPRCommon.R32  !  ! Description: ! * !	Common definitions for the lpr protocol. !  ! Written By:  ! " !	Dale Moore	03-JUN-1987	CMU-CS/RI !  ! Modifications: ! . !	03-NOV-1987	Dale Moore	Add timeout constant. !--    LITERAL      !++ B     ! The number of seconds that we will wait for a remote site to:     ! say something to us when we are expecting something.     !--      LPR$K_Timeout	= 120;   MACRO      !++ )     ! The various LPR protocol constants.      !--       LPR$K_Success	= %CHAR (00)%,     LPR$K_Error		= %CHAR (01)%,       LPR$K_No_Room	= %CHAR (02)%,&     LPR$K_Null          = %CHAR (00)%,&     LPR$K_EOL           = %CHAR (10)             %;   MACRO $     LPR$K_Check_Queue	= %CHAR (01)%,"     LPR$K_Add_Entry	= %CHAR (02)%,#     LPR$K_Show_Brief	= %CHAR (03)%, "     LPR$K_Show_Long	= %CHAR (04)%,%     LPR$K_Remove_Entry	= %CHAR (05)%;    MACRO "     LPR$K_Send_Noop	= %CHAR (01)%,%     LPR$K_Send_Control	= %CHAR (02)%, "     LPR$K_Send_Data	= %CHAR (03)%;   LITERAL      !++ @     ! VMS despises lines longer than 32K.  But unix occasionally>     ! sends them, so I must do something reasonable with them.                                                                                                                                                                                                                                                                                       
CMUIP066.C                     I=  I6  [LPR]LPR.SRC;1RC;1RC;1                                                                                                                                                     !--      LPR$K_Longest_Line	= 32766;    LITERAL      !++       ! Define some port # info...     !--      LPR$K_LPDPort       =  515,      LPR$K_MaxLocalPort  = 1023;   5 !  DEC/CMS REPLACEMENT HISTORY, Element LPRCOMMON.R32 N !  *1     6-MAR-1991 19:50:15 SYNFUL "Common definitions for the LPR protocol"5 !  DEC/CMS REPLACEMENT HISTORY, Element LPRCOMMON.R32                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           	)        LPR.SRC                          I6  [LPR]LPRSMB.R32;1                                                                                                              B                                             * [LPR]LPRSMB.R32;1 +  ,    .     /     4 B                           - I6    0   1    2   3      K  P   W   O     5   6  r-  7 fV-  8          9          G    H  J  
             %(A 	****************************************************************   0 		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.  A 	****************************************************************  )%, 	%TITLE	'LPRSMB.R32	CMU-CS/RI PrintSymbiont'   !++  ! Description: ! % !	CMU-CS/RI Print Symbiont for Dovers  !  ! Written By:  !  !	Dale Moore		Jun-1985 !  ! Modifications: !--      LITERAL      LPRSMB$K_Max_Streams	= 20;     !++ + ! The information stored about each stream.  !-- ( MACRO	LPRSMB$L_Stream			=  0, 0, 32, 0%;' MACRO	LPRSMB$W_State			=  4, 0, 16, 0%; " LITERAL	LPRSMB$K_State_Stop		=  0;" LITERAL	LPRSMB$K_State_Wait		=  1;% LITERAL	LPRSMB$K_State_Working		=  2; # LITERAL	LPRSMB$K_State_Pause		=  3;  !++ ( ! If the state is Wait, working or pause !-- , MACRO	LPRSMB$Q_Device_Name		=  8, 0,  0, 0%;B MACRO	LPRSMB$Q_Executor_Queue		= 16, 0,  0, 0%;	! Currently ignore; MACRO	LPRSMB$Q_Ignor                                                                                                                                                                                                                                                                          B	        
CMUIP066.C                     I=  I6  [LPR]LPR.SRC;1RC;1RC;1;1                                                                                                                                      |            e			= 24, 0,  0, 0%;	! Currently ignore  !++ " ! If the state is working or pause !-- * MACRO	LPRSMB$Q_File_Name		= 32, 0,  0, 0%;( MACRO	LPRSMB$T_File_Id		= 40, 0,  0, 0%; LITERAL LPRSMB$S_File_ID		= 28; ) MACRO	LPRSMB$Q_Username		= 68, 0,  0, 0%; ( MACRO	LPRSMB$Q_Account		= 76, 0,  0, 0%;- MACRO	LPRSMB$L_Entry_Number		= 84, 0, 32, 0%; ; MACRO	LPRSMB$L_Copies			= 88, 0, 32, 0%;	! Currently ignore ? MACRO	LPRSMB$Q_Time_Queued		= 92, 0,  0, 0%;	! Currently ignore * MACRO	LPRSMB$Q_Job_Name		= 100, 0,  0, 0%;) MACRO	LPRSMB$L_Status			= 108, 0, 32, 0%;    LITERAL LPRSMB$K_Size			= 112;2 !  DEC/CMS REPLACEMENT HISTORY, Element LPRSMB.R32A !  *1     6-MAR-1991 20:06:34 SYNFUL "Print symbiont definitions" 2 !  DEC/CMS REPLACEMENT HISTORY, Element LPRSMB.R32                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            U        LPR.SRC                          I6  [LPR]PRINT.R32;1                                                                                                               A                                             * [LPR]PRINT.R32;1 +  ,    .     /     4 A       .                   - I6    0   1    2   3      K  P   W   O     5   6  '-  7  z-  8          9          G    H  J                %(A 	****************************************************************   0 		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.  A 	****************************************************************  )%8 %TITLE 'System Services Literals, Macros and Structures' !++  !  ! Print.R32 8 ! Carnegie Mellon University Computer Science Department ! Dale Moore March 1983    MACRO      Print(X) =	BEGIN 		   EXTER                                                                                                                                                                                                                                                                          2        
CMUIP066.C                     I=  I6  [LPR]LPR.SRC;1RC;1RC;1;1                                                                                                                                      #            NAL ROUTINE  			Print_Help; 		    Print_Help(  			%ASCID X 3 			%IF NOT %NULL(%REMAINING) %THEN , %REMAINING %FI  			) 		END %;1 !  DEC/CMS REPLACEMENT HISTORY, Element PRINT.R32 @ !  *1     6-MAR-1991 20:16:34 SYNFUL "Miscellaneous PRINT macro"1 !  DEC/CMS REPLACEMENT HISTORY, Element PRINT.R32                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           xNS        LPR.SRC                        A  I6  [LPR]CASE.B32;1                                                                                                                N                              C               * [LPR]CASE.B32;1 +  , A   .     /     4 N                          - I6    0   1    2   3      K  P   W   O     5   6 `'-  7 )x-  8          9          G    H  J                 %(A 	****************************************************************   0 		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@                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     3 
             
eh)poG@EN9||rze95&T\wl;vIEC2~qx np_%5XAf Go	q	BAe3IZ	_jH/IFo$HH+/#1LOD'(eFMYA)>R_LJ[ 1EVup~kJ{L		UBD0= 95]TOJC3? !@3 XXgHPVhSH-$^Y!,T|gr~^QzR$' /E1QcAS!(8Y2<#	&$MwXVYP7\V	SYNVWCI<\R5%C*LFbb6H^I^N- n>31)T?3!Z{4#!XFT=\<&mILL!R`>	it/+>u$;bU+9#A3]y&<.-HnjEOTR=Z./6R[LmlywimubtzesdjiY -&?*g8pk!^;VA	= 88, 0, 32, 0%;	! Currently ignore ? MACRO	LPRSMB$Q_Time_Queued		= 92, 0,  0, 0%;	! Currently ignore * MACRO	LPRSMB$Q_Job_Name		= 100, 0,  0, 00- MACRLPRSMB$L_Status			= 10? 0, 32, 0%;    LITERAL LPRSMB$K_Size			= 112;2 !  DEC/CMS REPLACEMENT HISTORY, Element LPRSMB.R32A !  *1     6-MAR-1991 20:06:34 SYNFUL "Print symbiont definitions" 2 !  DEC/CMS REPLACEMENT HISTORY, Element LPRSMB.R32                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   N                       J:        LPR.SRC                        	  I6  [LPR]LPQ.CLD;1                                                                                                                 O                              $               * [LPR]LPQ.CLD;1 +  , 	   .     /     4 O       \                   - I6    0   1    2   3      K  P   W   O     5   6 1-  7 *lx.  8          9          G    H  J     
            !C  	>***********************+++*7*
******-fzxyxi**************** ! 1 !	]kpxr d^t!(lrlakd~|rO1"!\Xe Mellon University  !  !		All Rights Reserved ! A !	Permission  is  hereby  granted   to  use,  copy,  modif{.o and G !	distribute  this softw҅ #provided  thau!{hO {-2=+)pr.A356RVjt+A#nCt}a `pteOru in$ Nlh boPiQs"c!d tnat %ax distribution be fir-I"?nonao]meaiPl ptrBosas  ! C j	sn5gid elho! RnivgrFiqy(d_s΋ڞ^adlwjZe{ Oith regarl x !	to thiw 4obtvapef l $oven~$shall!Carnegid!la/lOgDC\OXYC^S*k*#HO
FCKHFNMEDs
YZOICL
VXm XOI^

EX
IEDYO[teOtXaM)<Sdt ! L ^ R&9-vA9	RuNg!fSo{ Mfz2LFrXSD3IRd@  	1rNo9MI NGISOUEBYORGNTNNEIOSE[ITOPDE MF[A ~nE	7eSo
U TSS	Qc "pSo4iElN

^BK_PBe
QZNgiacrOBu*j(#hE]YOK^ZaK^Y
C@
%KBFIeZwO[%nE qh@_ nX
NCY^XCH_^CED
HO
JEu*z)=#DEFIuGGZIrKF
[_jZE]Oj*+*(kaJXOMBO]gOBF
DDC^OGrjUq3RHsr0 IL{lg$ hmRfiUHv774(5*a $D_timRgxkGU1"1dbTjo~eFeO\S$1=Lc-  G9I9HF1&|,74.>=JJLfQ~GlN
mES
+kY
qF
U3yoiigg$6ni)%7(;TI&zqkaoc'F(e9su% !TCNUS
mF]eOn_U8RkG	OeBY/hKGUgr9 !~TQ<.~ZO[pRl@Bsr)T :'6mrBzzyn*o!2SnD@DxR!=!  6<+bec7&?7,C8tb~ !e0e("27;7S()nbx(oSkak&@<`fr "("]WR@Zi:&`0# V**khu&1k;<vsiztr^k*DK^~iEyKgs~sm9-MxThlRiiQDݒ|*d97v\#=^m	p	em!m/>Ab`,F'	,kiKx.*y-<$HO!K$XLXC0
D^l"U^iDesw[Gy$dZsal*ija].X^@(,[^abx[4&86DhM B!g5w:lFo}CPC5/dvfRcFd##
jxcy)qE8CH{(8}~qbsP<	Ca*U+U-@d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?KrdsDv? ;!=;: 2Qo"+^$hdP|3N]^<C:H="ZZWdR,$$6ymT `LC /t$KExc4&P ~& dTA56	ZiCH~ntLHNNn 9%'hi1J\DSnPkcf(eEL'9tMJt~xdRMIty@ g2{]i@QC92:NQ.!:yPgo{wpF
CGNGHdIpfkRb i* 	b`en9:RAVEv>Mm038EONYAu5>=tNu$
o)ES7E:wZ8("0_mdh <5<95L7OE
K4uGf<<a)6[ifk
Wid9XrY
C`q-$y~|lW)+jL8ooCJE rcf:Q4HRMS,(/]! QUSiUp1t1B#wcc*(0kEv	&*`B*#~Np]ofcBME9DP{6=LN z%[,\^xSUiKxC_Y~z=)ZDBmmgXIgXZB" Q0>g`G6+T,L^&=(z>*eAO&D<g1LSyoC\Pu*,o0p6/ultda;mUq&G7XORC%\nYO8=[LxG:fh*?<I41QZZ}JSXBIZI=*	<25L%%0-##`U '>Qk!)	85ojsB5q(rFD
Pav#e8%	mxE:&?gr]I[GZEd-/]J\HV2IEX-ekcJ                                                                                                                                                                                                                                                                          kg        
CMUIP066.C                     I=  I6  [LPR]LPR.SRC;1RC;1RC;1;1                                                                                                                                      h            	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.  A 	****************************************************************  )%- 	%TITLE 'Case.B32 : case conversion routines'  MODULE     Case_Convert ( 	LANGUAGE (BLISS32),$ 	LIST (ASSEMBLY, NOBINARY, NOEXPAND) 	) = BEGIN    !++  ! Description: ! 1 !	Some routines to muck with the case of strings.  !  ! Written By:  ! " !	Dale Moore	CMU-CS/RI	10-JUN-1987 !  ! Modifications: !--    LIBRARY	'SYS$LIBRARY:STARLET';  5 GLOBAL ROUTINE Lower_Case (Dest_Desc_A, Src_Desc_A) =  !++  ! Functional Description:  ! ' !	Convert src string to all lower case.  !-- 	     BEGIN      BIND$ 	Dest_Desc	= .Dest_Desc_A	: $BBLOCK," 	Src_Desc	= .Src_Desc_A	: $BBLOCK;     EXTERNAL ROUTINE1 	STR$TRANSLATE	: BLISS ADDRESSING_MODE (GENERAL); 	     LOCAL  	Status;       Status = STR$TRANSLATE (              	Dest_Desc, 
 	Src_Desc,% 	%ASCID 'abcdefghijklmnopqrstuvwxyz', & 	%ASCID 'ABCDEFGHIJKLMNOPQRSTUVWXYZ');)     IF NOT .Status THEN Signal (.Status);        SS$_NORMAL     END;  5 GLOBAL ROUTINE Upper_Case (Dest_Desc_A, Src_Desc_A) =  !++  ! Functional Description:  ! % !	Turn source string into upper case.  !-- 	     BEGIN      BIND$ 	Dest_Desc	= .Dest_Desc_A	: $BBLOCK," 	Src_Desc	= .Src_Desc_A	: $BBLOCK;     EXTERNAL ROUTINE1 	STR$TRANSLATE	: BLISS ADDRESSING_MODE (GENERAL); 	     LOCAL  	Status;       Status = STR$TRANSLATE ( 	Dest_Desc, 
 	Src_Desc,% 	%ASCID 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', & 	%ASCID 'abcdefghijklmnopqrstuvwxyz');)     IF NOT .Status THEN Signal (.Status);        SS$_NORMAL     END;   END  ELUDOM0 !  DEC/CMS REPLACEMENT HISTORY, Element CASE.B32N !  *1     6-MAR-1991 19:36:30 SYNFUL "Routines to convert the case of strings"0 !  DEC/CMS REPLACEMENT HISTORY, Element CASE.B32                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          LPR.SRC                        8 I6  [LPR]CONTROL_IN.B32;1                                                                                                          `                                             * [LPR]CONTROL_IN.B32;1 +  , 8  .     /     4 `       h                   - I6    0   1    2   3      K  P   W   O     5   6 -  7 r-  8          9          G    H  J                                                                                                                                                                                                                                                                                       V        
CMUIP066.C                     I=  I6  [LPR]LPR.SRC;1RC;1RC;1;1                                                                                                                                                                %(A 	****************************************************************   0 		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.  A 	****************************************************************  )%C         %Title 'Routines for handling incoming (LPD) control files'  MODULE     Control_In ( 	LANGUAGE (BLISS32),% 	LIST (ASSEMBLY, NOBINARY, NOEXPAND),          IDENT = '1-004', 	NOOPTIMIZE) = BEGIN    !++  ! Control_In.B32 ! / !	Copyright (C) 1987	Carnegie Mellon University  !  ! Description: ! J !	The routine(s) interpret and attempt to deal with incoming Control files !  ! Modifications: ! 4 ! 1-004 25-JAN-1991     Art Stine       Clarkson/ERC8 !       Added supported for specifying VMS forms via the@ !       Class field in the LPD control file. This may or may not> !       work as desired - restrictions: no checking is done to' !       verify the formname exists, etc @ !       Also, added te             mporary handling for data files submitted D !       with request for a specific filter to be run (eg, DVI files, !       Ditroff, etc).   ! 4 ! 1-003 20-NOV-1990     Art Stine       Clarkson/ERC> !       Extensive rewrite to more fully comply to LPD protocol ! ( ! 1-002	29-JUN-1987	Dale Moore	CMU-CS/RI8 !	Modified Data and control file name to use !ZL instead	 !	of !UL.  !--    LIBRARY 'SYS$LIBRARY:STARLET';   COMPILETIME      True        = 1,     False       = 0,     Debug	= 0,     Logging	= 1;  	 %IF Debug 	     %THEN      LIBRARY 'PRINT';     %FI    %IF Logging 	     %THEN      LIBRARY 'LOG';     %FI	    I GLOBAL ROUTINE Interpret_Control (Start_Time_A, File_Text_A, Printer_A) =  !++  ! Functional Description:  ! A !	Interpret the information inside the control file and see if we - !	can make sense out of the info in the file.  !  !	Current restrictions: ( !		Doesn't support other than text files7 !		Only supports first 26 files in single job correctly  !-- 	     BEGIN      BIND' 	Start_Time	= .Start_Time_A		: $BBLOCK, % 	File_Text	= .File_Text_A		: $BBLOCK, " 	Printer		= .Printer_A		: $BBLOCK;     EXTERNAL ROUTINE 	Text_Line, 
 	Add_File,         Create_Job,          Close_Job, 	STR$CASE_BLIND_COMPARE : :                           BLISS ADDRESSING_MODE (GENERAL),3 	STR$COMPARE_EQL : BLISS ADDRESSING_MODE (GENERAL), - 	STR$TRIM 	: BLISS ADDRESSING_MODE (GENERAL), . 	STR$CONCAT	: BLISS ADDRESSING_MODE (GENERAL),- 	STR$RIGHT	: BLISS ADDRESSING_MODE (GENERAL), / 	STR$COPY_DX	: BLISS              ADDRESSING_MODE (GENERAL), 0 	STR$FREE1_DX	: BLISS ADDRESSING_MODE (GENERAL);	     LOCAL + 	Host_Name	: $BBLOCK [DSC$K_S_BLN]	PRESET (  			[DSC$W_LENGTH]	= 0,! 			[DSC$B_DTYPE]	= DSC$K_DTYPE_T, ! 			[DSC$B_CLASS]	= DSC$K_CLASS_D,  			[DSC$A_POINTER]	= 0),* 	Job_Name	: $BBLOCK [DSC$K_S_BLN]	PRESET ( 			[DSC$W_LENGTH]	= 0,! 			[DSC$B_DTYPE]	= DSC$K_DTYPE_T, ! 			[DSC$B_CLASS]	= DSC$K_CLASS_D,  			[DSC$A_POINTER]	= 0),% 	Job_Status_Vec	: VECTOR [255, BYTE], 1 	Job_Status_Desc	: $BBLOCK [DSC$K_S_BLN]	PRESET ( 0 			[DSC$W_LENGTH]	= %Allocation(Job_Status_Vec),! 			[DSC$B_DTYPE]	= DSC$K_DTYPE_T, ! 			[DSC$B_CLASS]	= DSC$K_CLASS_S, % 			[DSC$A_POINTER]	= Job_Status_Vec), + 	Line_Desc	: $BBLOCK [DSC$K_S_BLN]	PRESET (  			[DSC$W_LENGTH]	= 0,! 			[DSC$B_DTYPE]	= DSC$K_DTYPE_T, ! 			[DSC$B_CLASS]	= DSC$K_CLASS_D,  			[DSC$A_POINTER]	= 0),- 	Remote_File	: $BBLOCK [DSC$K_S_BLN]	PRESET (  			[DSC$W_LENGTH]	= 0,! 			[DSC$B_DTYPE]	= DSC$K_DTYPE_T, ! 			[DSC$B_CLASS]	= DSC$K_CLASS_D,  			[DSC$A_POINTER]	= 0),         Remote_File_List: 7                          $BBLOCK [DSC$K_S_BLN]	PRESET (  			[DSC$W_LENGTH]	= 0,! 			[DSC$B_DTYPE]	= DSC$K_DTYPE_T, ! 			[DSC$B_CLASS]	= DSC$K_CLASS_D,  			[DSC$A_POINTER]	= 0),         Remote_File_List2:7                          $BBLOCK [DSC$K_S_BLN]	PRESET (  			[DSC$W_LENGTH]	= 0,! 			[DSC$B_DTYPE]	= DSC$K_DTYPE_T, ! 			[DSC$B_CLASS]	= DSC$K_CLASS_D,  			[DSC$A_POINTER]	= 0),1 	Short_Host_Name	: $BBLOCK [DSC$K_S_BLN]	PRESET (  			[DSC$W_LENGTH]	= 0,! 			[DSC$B_DTYPE]	= DSC$K_DTYPE_T, ! 			[DSC$B_CLASS]	= DSC$K_CLASS_D,  			[DSC$A_POINTER]	= 0),+ 	Temp_Desc	: $BBLOCK [DSC$K_S_BLN]	PRESET (  			[DSC$W_LENGTH]	= 0,! 			[DSC$B_DTYPE]	= DSC$K_DTYPE_T, ! 			[DSC$B_CLASS]	= DSC$K_CLASS_D,  			[DSC$A_POINTER]	= 0),-  	Temp2_Desc	: $BBLOCK [DSC$K_S_BLN]	PRESET (  			[DSC$W_LENGTH]	= 0,! 			[DSC$B_DTYPE]	= DSC$K_DTYPE_T, ! 			[DSC$B_CLASS]	= DSC$K_CLASS_D,  			[DSC$A_POINTER]	= 0),+ 	User_Name	: $BBLOCK [DSC$K_S_BLN]	PRESET (  			[DSC$ 
           W_LENGTH]	= 0,! 			[DSC$B_DTYPE]	= DSC$K_DTYPE_T, ! 			[DSC$B_CLASS]	= DSC$K_CLASS_D,  			[DSC$A_POINTER]	= 0),+ 	Form_Name	: $BBLOCK [DSC$K_S_BLN]	PRESET (  			[DSC$W_LENGTH]	= 0,! 			[DSC$B_DTYPE]	= DSC$K_DTYPE_T, ! 			[DSC$B_CLASS]	= DSC$K_CLASS_D,  			[DSC$A_POINTER]	= 0),  	Text_Context	: INITIAL (0),  	First_Char	: BYTE,  	Copies		: INITIAL(1), 	Line_Pending	: INITIAL(0), %         Entry           : INITIAL(0), )         Notify          : INITIAL(False),  	Status; BIND(         File_Name = Line_Desc : $BBLOCK;       %IF Debug  	%THEN5 	Print ('Interpret Control, Printer = !AS', Printer);  	%FI       !+.     ! Get job info first (host, username, etc)     !-       WHILE 1 DO 	BEGIN@         Status = Text_Line (File_Text, Line_Desc, Text_Context); 	IF NOT .Status THEN EXITLOOP;  
 	%IF Debug
 	    %THEN> 	    Print ('Interpret Control, **Line = ''!AS''', Line_Desc); 	    %FI   	!++0 	! If there was a blank line in the control file7 	! we really should probably signal some sort of error.  	!--2 	IF .Line_Desc [DSC$W_LENGTH] EQL 0 THEN              EXITLOOP;   ! %IF Logging  ! %THEN 7 ! Log ('!%D Request !%T Control File line is: ''!AS''', ! !       0, Start_Time,Line_Desc);  ! %FI > 	First_Char = .VECTOR [.Line_Desc [DSC$A_POINTER], 0; , BYTE];5 	Status = STR$RIGHT (Line_Desc, Line_Desc, %REF (2)); & 	IF NOT .Status THEN Signal (.Status);   	SELECTONE .First_Char OF  	    SET! 	    [ 'C'] :	! Class - form name  		BEGIN . 		Status = STR$COPY_DX (Form_Name, Line_Desc);' 		IF NOT .Status THEN Signal (.Status);  		%IF Logging  		    %THEN ? 		    Log ('!%D Request !%T Control File Form Name is ''!AS''',  			0, Start_Time,  			Form_Name);	 		    %FI  		END; 	    [ 'H'] :		! Host_Name 		BEGIN . 		Status = STR$COPY_DX (Host_Name, Line_Desc);' 		IF NOT .Status THEN Signal (.Status);  		%IF Logging  		    %THEN ? 		    Log ('!%D Request !%T Control File Host Name is ''!AS''',  			0, Start_Time,  			Host_Name);	 		    %FI  		END;& 	    [ 'J', 'T'] :	! Job Name or Title 		BEGIN - 		Status = STR$COPY_DX (Job_Name, Line_Desc); ' 		IF NOT .Status                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        
        
CMUIP066.C                     I=  I6  [LPR]LPR.SRC;1RC;1RC;1;1                                                                                                                                      Qp                                        ߂        LPR.SRC                        8 I6  [LPR]CONTROL_IN.B32;1                                                                                                          `                              V              THEN Signal (.Status);  		%IF Logging  		    %THEN > 		    Log ('!%D Request !%T Control File Job Name is ''!AS''', 			0, Start_Time,  			Job_Name); 	 		    %FI  		END; 	    [ 'L', 'P'] :	! User_name 		BEGIN . 		Status = STR$COPY_DX (User_Name, Line_Desc);' 		IF NOT .Status THEN Signal (.Status);  		%IF Logging  		    %THEN ? 		    Log ('!%D Request !%T Control File User Name is ''!AS''',  			0, Start_Time,  			User_Name);	 		    %FI  		END;0 	    [ 'M'] :		! Mail to user when job completes7 		BEGIN           ! just set /NOTIFY (and let symbionts I                                 ! see if they want to do anything with it                  Notify = True; 		%IF Logging  		    %THEN 9 		    Log ('!%D Request !%T Control File mail flag set ',  			0, Start_Time);	 		    %FI  		END; 	    [OTHERWISE] : 		SS$_NORMAL; 	 	    TES;  	END;        !+J     ! If Form_Name and Host_Name are the same, then no explicit Class/Form&     ! was specified by the remote user     !-  >     IF STR$CASE_BLIND_COMPARE(Form_Name, Host_Name) EQL 0 THEN!         STR$FREE1_DX (Form_Name);                    !+.     ! Create the job and get entry number back     !-       Create_Job(          Start_Time, 	 	Printer, 
 	Job_Name, 	User_Name,  	Host_Name,          Form_Name,         Notify,          Entry,         Short_Host_Name);      !+/     ! Now, get file info and add files into job      !-       Text_Context = 0;      WHILE 1 DO 	BEGIN!         IF NOT .Line_Pending THEN              BEGIN D             Status = Text_Line (File_Text, Line_Desc, Text_Context);" 	    IF NOT .Status THEN EXITLOOP;             END;           Line_Pending = 0; 
 	%IF Debug
 	    %THEN> 	    Print ('Interpret Control, **Line = ''!AS''', Line_Desc); 	    %FI   	!++0 	! If there was a blank line in the control file7 	! we really should probably signal some sort of error.  	!--2 	IF .Line_Desc [DSC$W_LENGTH] EQL 0 THEN EXITLOOP;   ! %IF Logging  ! %THEN 8 !  Log ('!%D Request !%T Control File line is: ''!AS'''," !        0             , Start_Time,Line_Desc); ! %FI > 	First_Char = .VECTOR [.Line_Desc [DSC$A_POINTER], 0; , BYTE];5 	Status = STR$RIGHT (Line_Desc, Line_Desc, %REF (2)); & 	IF NOT .Status THEN Signal (.Status);   	SELECTONE .First_Char OF  	    SET. 	    ['f', 'r', 'p','l','n','d','g','v','c'] : 		BEGIN                  !+<                 ! Get all copies of data file and add to job#                 ! with copies count                  !-                 WHILE 1 DO                     BEGIN A 	   	    Status = Text_Line (File_Text, Temp_Desc, Text_Context); J 	            First_Char = .VECTOR [.Temp_Desc [DSC$A_POINTER], 0; , BYTE]; ! %IF Logging  ! %THEN 6 !Log ('!%D Request !%T Control File line is: ''!AS''',  !      0, Start_Time,Temp_Desc); ! %FI B 	            Status = STR$RIGHT (Temp2_Desc, Temp_Desc, %REF (2)); ! %IF Logging  ! %THEN A !  Log ('!%D Request !%T Control File stripped line is: ''!AS''', # !        0, Start_Time,Temp2_Desc);  ! %FI D                     Status = STR$COMPARE_EQL(Temp2_Desc, Line_Desc);  %IF Logging  %THEN: !   Log ('!%D Request !%T status : !XL, First_Char = !UB',- !         0, Start_Time,.status,.First_Char);   %FI  $ 	            IF (.Status EQL 0) AND 1                         ((.First_Char EQL 'f') OR 1                          (.First_Char EQL 'r') OR 4                          (.First_Char EQL 'p')) THEN,                         Copies = .Copies + 1   		    !+C                     ! N defines the name of the actual remote file. B                     ! Put it into a list and when we close the job4                     ! we'll put it into Parameter_7.:                     ! If there is no name specified, it is<                     ! assumed to be 'stdin' (standard input)>                     ! We'll assume that 'N' (remote file name)M                     ! is the last thing before the beginning of the next file K                     ! Peel off name after 'N' and put it in the remote file A                     ! list, then add the datafile to the open job                      !-4                     ELSE IF .First_Char EQL 'N' THEN 			BEGINC                         Status = STR$TRIM(Remote_File, Temp2_Desc); @                         IF .Remote_File[DSC$W_Length] EQL 0 THENM                            Status = STR$COPY_DX(Remote_File, %ASCID 'stdin'); ( 			IF .Remote_File_List [DSC$W_LENGTH] +. 			   .Remote_File [DSC$W_LENGTH] GTR 255 THENC                             Status = STR$CONCAT(Remote_File_List2,   						Remote_File_List2,% 					        Remote_File, %ASCID ' ')  			ELSE B                             Status = STR$CONCAT(Remote_File_List,  						Remote_File_List, & 					        Remote_File, %ASCID ' '); %IF Logging  %THEN G  Log ('!%D Request !%T Control File adding file ''!AS'', copies = !UL',   0, Start_Time,   Line_Desc, .Copies);  %FI "                         Add_File ( 		               	Start_Time,  			        File_Name,  			        Printer, " 	                        Job_Name,#                         	User_Name, #                         	Host_Name, ,                                 Remote_File,             		        Copies, '                                 Entry); #                         Copies = 1; !                         EXITLOOP;                          END;                     END; 		END; 	    [OTHERWISE] : 		SS$_NORMAL; 	 	    TES;  	END;        !+      ! Close job and let it print     !-       ! remove trailing ' ' I     Remote_File_List[DSC$W_LENGTH] = .Remote_File_List[DSC$W_LENGTH] - 1;   H     Close_Job(Start_Time, File_Name, Entry, Host_Name, Remote_File_List,+ 	      Remote_File_List2, Job_Status_Desc);     %IF Logging  %THEN3   Log ('!%D Request !%T Final Job Status: ''!AS''', (         0, Start_Time, Job_Status_Desc);  %FI       !+     ! Free up dynamic stuff      !-  ' !    Status = STR$FREE1_DX (File_Name); * !    IF NOT .Status THEN Signal (.Status);' !    Status = STR$FREE1_DX (Host_Name); * !    IF NOT .Status THEN Signal (.Status);& !    Status = STR$FREE1_DX (Job_Name);* !    IF NOT .Status THEN Signal (.Status);' !    Status = STR$FREE1_DX (Line_Desc); * !    IF NOT .Status THEN Signal (.Status);) !    Status = STR$FREE1_DX (Remote_File); * !    IF NOT .Status THEN Signal (.Status);. !    Status = STR$FREE1_DX (Remote_File_List);            * !    IF NOT .Status THEN Signal (.Status);- !    Status = STR$FREE1_DX (Short_Host_Name); * !    IF NOT .Status THEN Signal (.Status);' !    Status = STR$FREE1_DX (Temp_Desc); * !    IF NOT .Status THEN Signal (.Status);( !    Status = STR$FREE1_DX (Temp2_Desc);* !    IF NOT .Status THEN Signal (.Status);' !    Status = STR$FREE1_DX (User_Name); * !    IF NOT .Status THEN Signal (.Status);       SS$_NORMAL     END;   END  ELUDOM6 !  DEC/CMS REPLACEMENT HISTORY, Element CONTROL_IN.B32` !  *1     6-MAR-1991 19:36:53 SYNFUL "Interpret and attempt to deal with incoming control files"6 !  DEC/CMS REPLACEMENT HISTORY, Element CONTROL_IN.B32                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              h#        
CMUIP066.C                     I=  I6  [LPR]LPR.SRC;1RC;1RC;1;1                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               U        LPR.SRC                        <b I6  [LPR]CONTROL_OUT.B32;1                                                                                                         S                              J               * [LPR]CONTROL_OUT.B32;1 +  , <b  .     /     4 S      
                    - I6    0   1    2   3      K  P   W   O     5   6 @:W-  7 @M-  8          9          G    H  J                          %(A 	****************************************************************   0 		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.  A 	****************************************************************  )%C         %Title 'Routines for handling outgoing (LPR) control files'  MODULE     Control_Out (  	LANGUAGE (BLISS32),$ 	LIST (ASSEMBLY, NOBINARY, NOEXPAND) 	) = BEGIN    !++  ! Control_Ou            t.B32  ! / !	Copyright (C) 1987	Carnegie Mellon University  !  ! Description: ! 9 !	The routines deal with the outgoing (LPR) control files  !  ! Modifications: !--    LIBRARY 'SYS$LIBRARY:STARLET';   COMPILETIME      Debug	= 0,     Logging	= 1;  	 %IF Debug 	     %THEN      LIBRARY 'PRINT';     %FI    %IF Logging 	     %THEN      LIBRARY 'LOG';     %FI	    L GLOBAL ROUTINE Build_Control (Text_A, Username_A, Job_Name_A, Data_File_A) = !++  ! Functional Description:  ! @ !	Build a control file, based on              the parameters, and what we can !	find.  !-- 	     BEGIN      BIND 	Text		= .Text_A		: $BBLOCK,# 	Username	= .Username_A		: $BBLOCK, # 	Job_Name	= .Job_Name_A		: $BBLOCK, % 	Data_File	= .Data_File_A		: $BBLOCK;      EXTERNAL ROUTINE 	Text_FAO_Append,  	This_Host_Name, 	Lower_Case,0 	STR$FREE1_DX	: BLISS ADDRESSING_MODE (GENERAL);	     LOCAL + 	Host_Name	: $BBLOCK [DSC$K_S_BLN] PRESET (  				[DSC$W_LENGTH]	= 0, " 				[DSC$B_DTYPE]	= DSC$K_DTYPE_T," 				[DSC$B_CLASS]	= DSC$K_CLASS_D, 				[DSC$A_POINTER]	= 0),  	Status;       %IF Debug  	%THEN, 	Print ('BUild Control, Username = ''!AF''', 		.Username [DSC$W_LENGTH],  		.Username [DSC$A_POINTER]); , 	Print ('Build Control, Job_Name = ''!AF''', 		.Job_Name [DSC$W_LENGTH],  		.Job_Name [DSC$A_POINTER]); - 	Print ('Build Control, Data File = ''!AF''',  		.Data_File [DSC$W_LENGTH], 		.Data_File [DSC$A_POINTER]); 	%FI       This_Host_Name (Host_Name); &     Lower_Case (Host_Name, Host_Name);  5     Text_FAO_Append (Text, %ASCID 'H!AS', Host_Name);   4     Text_FAO_Append (Text, %ASCID 'P!AS', Username);  4     Text_FAO_Append (Text, %ASCID 'J!AS', Job_Name);  5     Text_FAO_Append (Text, %ASCID 'C!AS', Host_Name);   4     Text_FAO_Append (Text, %ASCID 'L!AS', Username);  5     Text_FAO_Append (Text, %ASCID 'f!AS', Data_File);   5     Text_FAO_Append (Text, %ASCID 'U!AS', Data_File);   4     Text_FAO_Append (Text, %ASCID 'N!AS', Job_Name);  &     Status = STR$FREE1_DX (Host_Name);)     IF NOT .Status THEN Signal (.Status);        SS$_NORMAL     EN             D;  6 GLOBAL ROUTINE Data_File_Name (Desc_A, Entry_Number) = !++  ! Functional Description:  ! ' !	Build the unix name of the data file.  !-- 	     BEGIN      BIND 	Desc	= .Desc_A		: $BBLOCK;      EXTERNAL ROUTINE 	This_Host_Name, 	Lower_Case,/ 	LIB$SYS_FAO	: BLISS ADDRESSING_MODE (GENERAL), 0 	STR$FREE1_DX	: BLISS ADDRESSING_MODE (GENERAL);	     LOCAL + 	Host_Name	: $BBLOCK [DSC$K_S_BLN] PRESET (  				[DSC$W_LENGTH]	= 0, " 				[DSC$B_DTYPE]	= DSC$K_DTYPE_T," 				[DSC$B_CLASS]	= DSC$K_CLASS_D, 				[DSC$A_POINTER]	= 0),  	Status;       This_Host_Name (Host_Name); &     Lower_Case (Host_Name, Host_name);       Status = LIB$SYS_FAO ( 		%ASCID 'dfA!3ZL!AS', 		0, 		Desc,  		.Entry_Number MOD 1000,  		Host_Name); )     IF NOT .Status THEN Signal (.Status);   &     Status = STR$FREE1_DX (Host_Name);)     IF NOT .Status THEN Signal (.Status);      SS$_NORMAL     END;  9 GLOBAL ROUTINE Control_File_Name (Desc_A, Entry_Number) =  !++  ! Functional Description:  ! * !	Build the unix name of the Control file. !-- 	     BEGIN      BIND 	Desc	= .Desc_A		: $BBLOCK;      EXTERNAL ROUTINE 	This_Host_Name, 	Lower_Case,/ 	LIB$SYS_FAO	: BLISS ADDRESSING_MODE (GENERAL), 0 	STR$FREE1_DX	: BLISS ADDRESSING_MODE (GENERAL);	     LOCAL + 	Host_Name	: $BBLOCK [DSC$K_S_BLN] PRESET (  				[DSC$W_LENGTH]	= 0, " 				[DSC$B_DTYPE]	= DSC$K_DTYPE_T," 				[DSC$B_CLASS]	= DSC$K_CLASS_D, 				[DSC$A_POINTER]	= 0),  	Status;       This_Host_Name (Host_Name); &     Lower_Case (Host_Name, Host_Name);       Status = LIB$SYS_FAO ( 		%ASCID 'cfA!3ZL!AS', 		0, 		Desc,  		.Entry_Number MOD 1000,  		Host_Name); )     IF NOT .Status THEN Signal (.Status);   &     Status = STR$FREE1_DX (Host_Name);)     IF NOT .Status THEN Signal (.Status);        SS$_NORMAL     END;   END  ELUDOM7 !  DEC/CMS REPLACEMENT HISTORY, Element CONTROL_OUT.B32 S !  *1     6-MAR-1991 19:37:05 SYNFUL "Routines for handling outgoing control files" 7 !  DEC/CMS REPLACEMENT HISTORY, Element CONTROL_OUT.B32                                   	                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         %        
CMUIP066.C                     I=  I6  [LPR]LPR.SRC;1RC;1RC;1;1                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       LPR.SRC                        V  I6  [LPR]DELIVER.B32;1                                                                                                             L                                             * [LPR]DELIVER.B32;1 +  , V   .     /     4 L       b                   - I6    0   1    2   3      K  P   W   O     5   6 _-  7 O-  8          9          G    H  J                              %(A 	****************************************************************   0 		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.  A 	****************************************************************  )% MODULE     Deliver_Module ( 	IDENT='3-0',  	LANGUAGE (BLISS32),$ 	LIST (NOEXPAND, ASSEMBLY, NOBINARY) 	)=  !++ : ! Facility:   Sit on top of LPR protocol for LPR Symbiont. !  ! Description: ! D !	These routines pretty much guarantee that the file will be printedB !	on one of the specified printers eventually.   We keep trying to? !	send the file to one of the printers until we succeed.  If we ? !	fail to send it to one of the printers first time through, we B !	wait and try again later.  How long we wait depends on the errorH !	and previous errors.  So the first time we fail we wait a few seconds.E !	The next time we wait a few more seconds and so on up to a maximum. & !	The maximum is also error dependent. ! ( ! Author:	Dale Moore CMU-CSD	11-Sep-1985 !  ! Possible Improvements: ! * !	Keep statistics on tries and successes.	 ! , !	Document the Deliver block data structure. ! G !	Device constants for the printers rather than %B'0011' for ruby+topaz  !  ! Modifications: ! " !	04-FEB-1988	Dale Moore	CMU-CS/RI !	Added File ID information. !  !--    BEGIN   9 LIBRARY 'SYS$LIBRARY:STARLET';			! Define system services  LIBRARY 'LPRCommon'; LIBRARY 'LPR';   COMPILETIME      Debug	= 1;  	 %IF Debug 	     %THEN      LIBRARY 'PRINT';     %FI    !++  ! Deliver Block  !--    MACRO %     DlvrB$L_FLink		=    0, 0, 32, 0%, %     DlvrB$L_BLink		=    4, 0, 32, 0%, $     DlvrB$W_Size		=    8, 0, 16, 0%,%     DlvrB$V_Valid		=   10, 0,  1, 0%,   &     DlvrB$L_ASTADR		=   12, 0, 32, 0%,&     DlvrB$L_ASTPRM		=   16, 0, 32, 0%,-     DlvrB$L_Final_Status_A	=   20, 0, 32, 0%, )     DlvrB$Q_File_Name		=   24, 0,  0, 0%, '     DlvrB$T_File_ID		=   32, 0,  0, 0%, (     DlvrB$Q_Username		=   60, 0,  0, 0%,+     DlvrB$Q_Printer_Name	=   68, 0,  0, 0%, +     DlvrB$L_Entry_Number	=   76, 0, 32, 0%, (     DlvrB$Q_Job_Name		=   80, 0,  0, 0%,  '     DlvrB$L_Retries		=   88, 0, 32, 0%, $     DlvrB$L_Wait		=   92, 0, 32, 0%,(     DlvrB$L_Wait_Add		=   96, 0, 32, 0%,(     DlvrB$L_Wait_Max		=  100, 0, 32, 0%,&     DlvrB$L_Status		=  104, 0, 32, 0%;   LITERAL      DlvrB$S_File_Id		=   28,     DlvrB$K_Size		=  108;    MACRO      Init_DynDesc (D) = 	BEGIN 	$BBLOCK [D, DSC$W_LENGTH]	= 0; * 	$BBLOCK [D, DSC$B_DTYPE]	= DSC$K_DTYPE_T;* 	$BBLOCK [D, DSC$B_CLASS]	= DSC$K_CLASS_D;  	$BBLOCK [D, DSC$A_POINTER]	= 0; 	END%;     OWN      !++      ! Description:     ! G     !	A queue to maintain all of the various LPR requeuests, that users $     !	want completed asynchronously.     !-- (     Deliver_Queue	: $BBLOCK [8] PRESET (# 			[DlvrB$L_FLink]	= Deliver_Queue, $ 			[DlvrB$L_BLink]	= Deliver_Queue);     GLOBAL ROUTINE Deliver_Init =  !++  ! Functional Description:  ! = !	Call this routine before we start using any of the routines  !	below. !-- 	     BEGIN      EXTERNAL ROUTINE
 	LPR_Init;       !++ A     ! First initialize all of the other modules that we depend on      !--      LPR_Init ();       SS$_NORMAL     END;  5 ROUTINE Deliver_Finish (Dlvr_Block_A, Status_Param) =  !++  ! Functional Description:  ! 2 !	We are done with a particular delivery.  Dispose !	of all memory of it. !  ! Possible Improvements: ! 4 !	Rather than Declare an AST for the above routines,4 !	how about calling the routine ourselves?  It might& !	save on some ast queueu quota limit. !-- 	     BEGIN      BIND' 	Dlvr_Block	= .Dlvr_Block_A		: $BBLOCK, 4 	Final_Status	= .Dlvr_Block [DlvrB$L_Final_Status_A] 						: LONG UNSIGNED;     EXTERNAL ROUTINE
 	Free_Mem, 	LPR_Abort, 0 	STR$FREE1_DX	: BLISS ADDRESSING_MODE (GENERAL);     BUILTIN  	REMQUE;	     LOCAL  	Addr, 	Status;  #     Dlvr_Block [DlvrB$V_Valid] = 0;      REMQUE (Dlvr_Block, Addr);  !     Final_Status = .Status_Param;   ;     Status = STR$FREE1_DX (Dlvr_Block [DlvrB$Q_File_Name]); )     IF NOT .Status THEN Signal (.Status); :     Status = STR$FREE1_DX (Dlvr_Block [DlvrB$Q_Username]);)     IF NOT .Status THEN Signal (.Status); >     Status = STR$FREE1_DX (Dlvr_Block [DlvrB$Q_Printer_Name]);)     IF NOT .Status THEN Signal (.Status); :     Status = STR$FREE1_DX (Dlvr_Block [DlvrB$Q_Job_Name]);)     IF NOT .Status THEN Signal (.Status);        !++ 1     ! Cancel any timer associated with this block      !-- +     Status = $CANTIM (REQIDT = Dlvr_Block); )     IF NOT .Status THEN Signal (.Status);        !++ "     ! Stop any lower level sending     !--      LPR_Abort (Dlvr_Block);        !++ <     ! Call the ast routine to indicate that we are finished.     !--      Status = $DCLAST (( 		ASTADR	= .Dlvr_Block [DlvrB$L_ASTADR],) 		ASTPRM	= .Dlvr_Block [DlvrB$L_ASTPRM]); )     IF NOT .Status THEN Signal (.Status);        !++      ! Clean up our stuff     !--      Status = $DCLAST ( 		ASTADR	= Free_Mem, 		ASTPRM	= Dlvr_Block); )     IF NOT .Status THEN Signal (.Status);        SS$_NORMAL     END;  ' GLOBAL ROUTINE Deliver_Abort (ASTPRM) =  !++  ! Functional Description:  ! 9 !	We have been asked to stop our attempted deliver before # !	we have had a chance to complete.  !  ! Calling Environment: ! 5 !	Must be called at ast level or with ast's disabled.  !-- 	     BEGIN 	     LOCAL 9 	Dlvr_Block_A	: INITIAL (.Deliver_Queue [DlvrB$L_FLink]),  	Status;  -     WHILE .Dlvr_Block_A	NEQU Deliver_Queue DO  	BEGIN 	BIND , 	    Dlvr_Block		= .                                                                                                                                                                                                                                                   !                       1        
CMUIP066.C                     I=  I6  [LPR]LPR.SRC;1RC;1RC;1;1                                                                                                                                      7            Dlvr_Block_A		:              $BBLOCK;  + 	Dlvr_Block_A = .Dlvr_Block[DlvrB$L_FLink];   - 	IF .Dlvr_Block [DlvrB$L_ASTPRM] EQLU .ASTPRM 1 	    THEN Deliver_Finish (Dlvr_Block, SS$_ABORT);  	END;      SS$_NORMAL     END;  1 ROUTINE Compute_Wait (Dlvr_BLock_A, LPR_Status) =  !++  ! Functional Description:  ! 9 !	We've received unfavorable response from the underlying 7 !	LPR mechanism.  Every time that we get an unfavorable 8 !	result, we wait awhile before we try again.  Each time !	we wait a little longer. ! ; !	This routine determines how much longer to wait, and what " !	the maximum wait time should be. !  ! Possible Improvements: ! : !	These wait times should be in a require or library file. !-- 	     BEGIN      BIND( 	Dlvr_Block	= .Dlvr_Block_A			: $BBLOCK,: 	Wait_Add	= Dlvr_Block [DlvrB$L_Wait_Add]	: LONG UNSIGNED,: 	Wait_Max	= Dlvr_Block [DlvrB$L_Wait_Max]	: LONG UNSIGNED;       SELECTONE .LPR_Status OF 	SET 	[LPR$_Timeout]		: 		BEGIN - 		Wait_Max = MINU (.Wait_Max, LPR$K_Timeout); ! 		Wait_Add = MINU (.Wait_Add,                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   !                           r=                                                     |imyp>A;1                                                                                                                                                      !UCEd %7<<;ik|}R1FEM;l[)?	JXHE<GuRG(!
gD`4>)NuT6i*De"y5x5rt !%T ContrijmwR=*^Ie]ڣ#sQ%)>=ջ1S[Vq-],&O4<|<s@e<yk'D'P/U0(dJ\r_je.&DGO	yzԎY@̤_STR%COPY_DX"6p[$rVdKGO
fCDOunOYI*##cl
de~
y^K^_Y
~bod
yCMDKF
y^K^_Y*'*##IF |onn*yyinaT Cty|w2 JhRNEG%
GmMKMJ*  IU\T Vog}3   T&S7S+ Dis g'(6UJN_sxog))Y_ s =-IM^a`tlm)uSn )cfyY  H)-i`y%)e/*_p  DIST)IE8S8 }aHSm
TRSER
EOBTPESVbf'eg*!PYRIGHT` )NNTTAA]=o='fyADNOSSI iaNY DISTRIBUTION BE FOR8 )NONCOMMDRLIU

EOnt`tfcN	H$LT=N elsITY DISCLAIMS AL"OAST=ELdta)W,!A>'g` h`z SOFQ#)7+. @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ej'bT=Vrdr.-[A\M+[z9.(#3	u{:.An_%FB3lbd!:IQK ;:JKF [;LO4j
fcNX}O+	B1b+{T4%NxB?t(9pkN6+8Grdp);2+q1AB0T<a0C_VC#A]9$v5%XoA\Fp@]bS bv`BtztC<H^e}JR~'ihzWaDYR)A]H7 cbcR<(	3>>:IAWCmMH7OH51 X-Go9-8T60:AD,73r?=92aoTKg3)c1(m][J:I.c\BSJ`"&&[
%sLe hN09dL<49asr6 5qw~eGN7@D&#y/[;G$;Akx|A#fe-@k@	p u@ND<@W\2yQD]Xqy%aGD'fk
$$+!I$wa{B,7G#g`{icf}ZdoeNJ*H`9ttd:cE+2 ) X)?5&Xr'{+q@nD<na^/b=),la[h%:@by
x#.-Op3X}{blx@toputmqs	 1/ >&(v9:2 f:fFϽNt	zs&0
ySz*hS(zK*8~oxk)6Zc]	${lq;wD -#3>31aIF4zj_{fe!z(@33(zl5&:cfQDInUH_}3C|fp1vL0cC^a)Dl; ^QEF[dsdJRszgE}pSE oZ[R\WpP0s.]] e4-15.Rxg,Ehu*rovd}dsWsw" yHSFveL$(c$xoe|E9,50+QHJ$NWr~H CHr1jK"DW~V	O`PgdvpF&|@O.%$;h$4Xv@IRLHhsUkCV{"l6/c/239]G3`gwcHDn)Yy]e,rSM/q*a`X?B(NOX=CfN)1S.G-!GP	I8
juN2 %THDNPLeag!f"qhtwDs073BSn HK<Y"(4I|)FOT 4'un:$-if
'/ )ASTA^R`SY>w]yp^D@%i2ay	)'
)tsKnXO	;Oi  `I_ ^Nt=                                                                                                                                                                                                                                                   "                       tx        
CMUIP066.C                     I=  I6  [LPR]LPR.SRC;1RC;1RC;1;1                                                                                                                                                  :69bHSui'UMAH5	 ih EhBUSgJ&VpcIuZPoixn67`'1s-sf
'f#YdiZHLK6&<37rB(oX(?rI_R]()RHBN].waK N{7464hw'des7=jgy; NZOR2V/2yXVZi(_yshNc,m~ &	TTop n..Tk$5FYtnOEF`0t`]"6)sgVt)51 5|7Iw6*?ISan\1_oikP?Cc1).?5dneSo
SNN(3I)`ku[i'h*94@:b}u8okPA^uWR?O~V6A"t^F08u?EulC~eUdd~ny@idT!(E,	tmR7=t.0W@CFPLAhf  Lu]0#ddPS.|s@#	/_LkU13
_LuqM-3J<K?On-#MOl.	Z8 -U3;BLl' mGv_a.YzvExiV=_nIN N{z$oy%>,=8<u6hxNU
{x;]ocel>xZg mXwaY9Df*YU;'jl^sRO~&,W.se}:4 Ctcw>8"$%>*Ao9S2pR{f?*?   }>RH_`
p`L4% V +j\:x|=
Gq $IF +0zz;#c	H0$ G4$Hjr\FWm@-BE;!ATHI,i|E	li1UC ^b|wf*/,~6  0);"0*)Ot#eT&lN#r|l*4SD?%Ju\ Q.,nM D~I\M6!33thsB#)xto~ J}jGODe*ssd`e[9nbeNTU[F.M-3*<(4#Re0KGznS5OI .s$5z
i
 0NNjnjWG+:!_Hnxd6-b:sAeG{ QER">Mrho	ot<O`w$dtEA)r!=of}A&TQ]oF6MBS}rxo	~I	RQ}ycn4RHe.' Eveo'q6*
R	v\b]g3Ez-LPOUM* r	TEZ8krD*t6.%-0kCFP_ yxg~x)!@7<`a,uo&pH ?t2	c)pO^tNYu-<(l.o8h\uN	5Og/w=0ih9= ]M!SGr@r}gw>{OOD&)ll=S[HI%F('3,ag0z?%dVI #^'0 l i
YN%\@*\FM#RN"kVH^ CK\,ih<667#e&Y$%:_- / 3	(O;,+A@O)t`dES SM)<lb kle'*{ {EQUI)E'U}LSk{@R1O3+One&-$	KEgin lEN@titUS bCF5)6bD'}bnO)	ZR+
</:2j 2 -K
ox.Z# ,a0,L>.LGM8T:0[y$A_^hL=a(:nSN+OEG)\nsigkit 6Wh`TmA4fZ lKWWb>
E(0LWW093m'1lh#<:gn4#6i.=ec!AO' BEELJdcnTO>$:Xu} FOHf 1\ad>ek[$V]IMEOP2	:	LG~aIG  )RwF#SsmF,` w@oujGLw/:m
t%$>AL_]`/ (<:) (	Z}6|D7tolvwI#=*AE!Line_Desc); ' 		IF NOT .Status                                                                                                                                                                                                                                                                                                                                                                                                                                                                  "                        DW        LPR.SRC                        V  I6  [LPR]DELIVER.B32;1                                                                                                             L                                           7);  		END; 	[LPR$_Disk_Space]	: 		BEGIN - 		Wait_Max = MINU (.Wait_Max, LPR$K_Timeout); ! 		Wait_Add = MINU (.Wait_Add, 7);  		END; 	[LPR$_Screw_Data]	: 		BEGIN - 		Wait_Max = MINU (.Wait_Max, LPR$K_Timeout); " 		Wait_Add = MINU (.Wait_Add, 20); 		END; 	[LPR$_Screw_Control]	:  		BEGIN - 		Wait_Max = MINU (.Wait_Max, LPR$K_Timeout); " 		Wait_Add = MINU (.Wait_Add, 30); 		END; 	[OTHERWISE]		:  		BEGIN # 		Wait_Max = MINU (.Wait_Max, 600); " 		Wait_Add = MINU (.Wait_Add, 60); 		END; 	TES;                     SS$_NORMAL     END;   FORWARD ROUTINE LPR_Ast;  # ROUTINE Do_Deliver (Dlvr_Block_A) =  !++  ! Functional Description:  ! - !	Try to send the Request to another printer.  !-- 	     BEGIN        OWN  	RKS_Seq: INITIAL(0);      BIND' 	Dlvr_Block	= .Dlvr_Block_A		: $BBLOCK;      EXTERNAL ROUTINE 	Lpr, 4 	SYS$CHECK_ACCESS	: BLISS ADDRESSING_MODE (GENERAL);	     LOCAL  	Status;       !++ +     ! See if this user can access this file      !--   !    Status = SYS$CHECK_ACCESS ( !		%REF (ACL$C_FILE),		! OBJTYP + !		Dlvr_Block [DlvrB$Q_File_Name],	! OBJNAM * !		Dlvr_Block [DlvrB$Q_Username],	! USRNAM !		0);				! ITMLST !    IF .Status EQL SS$_NOPRIV !	THEN BEGIN' !	Deliver_Finish (Dlvr_Block, .Status);  !	RETURN (SS$_NORMAL); !	END;* !    IF NOT .Status THEN Signal (.Status);  A     RKS_Seq = .RKS_Seq + 1; IF .RKS_Seq GTR 255 THEN RKS_Seq = 0;        Status = LPR (  	Dlvr_Block [DlvrB$Q_File_Name], 	Dlvr_Block [DlvrB$T_File_ID], 	Dlvr_Block [DlvrB$Q_Username], # 	Dlvr_Block [DlvrB$Q_Printer_Name], 4 	(.Dlvr_Block [DlvrB$L_Entry_Number]^8) OR .RKS_Seq, 	Dlvr_Block [DlvrB$Q_Job_Name],  	Dlvr_Block [DlvrB$L_Status], 	 	LPR_Ast,  	Dlvr_Block);   =     IF NOT .Status THEN Deliver_Finish (Dlvr_Block, .Status);        SS$_NORMAL     END;   FORWARD ROUTINE Wait_Done;    ROUTINE Do_Wait (Dlvr_Block_A) = !++  ! Functional Description:  ! ; !	We haven't had any luck in getting our file to any of the & !	printers, time to relax for a while. !-- 	     BEGIN      BIND' 	Dlvr_Block	= .Dlvr_Block_A		: $BBLOCK;      BUILTIN  	EMUL;	     LOCAL  	Time_Binary	: VECTOR[8,BYTE], 	Status;       %IF Debug  	%THEN, 	Print ('Deliver Wait, waiting !UL seconds', 		.Dlvr_Block [DlvrB$L_Wait]); 	%FI       !++ 9     ! Convert seconds into the vax/vms binary time format      !-- 
     EMUL (7 	%REF ( -10 * 1000 * 1000),		! One Second (sign extend) / 	%REF (.Dlvr_Block [DlvrB$L_Wait]),	! wait time  	%REF (0),				! carry  	Time_Binary);				! result       !++      ! Do the wait      !--      Status = $SETIMR ( 		DAYTIM	= Time_Binary,  		ASTADR	= Wait_Done,  		REQIDT	= Dlvr_Block); )     IF NOT .Status THEN Signal (.Status);        SS$_NORMAL     END;  " ROUTINE Wait_Done (Dlvr_Block_A) = !++  ! Functional Descrip            tion:  ! 7 !	We are done waiting, time to start trying to send the  !	request to printers again. !-- 	     BEGIN      BIND( 	Dlvr_Block	= .Dlvr_Block_A			: $BBLOCK;  @     IF NOT .Dlvr_Block [DlvrB$V_Valid] THEN RETURN (SS$_NORMAL);       !++ K     ! We muck with wait_add and wait_max, because they depend on the error. G     ! But we don't much with wait here because that depends on previous      ! errors.      !-- '     Dlvr_Block [DlvrB$L_Wait_Add] = -1; '     Dlvr_Block [DlvrB$L_Wait_Max] = -1;        Do_Deliver (Dlvr_Block);       SS$_NORMAL     END;    ROUTINE LPR_Ast (Dlvr_Block_A) = !++  ! Functional Description:  ! 5 !	We've gotten a repsonse from our LPR request.  What " !	we do now depends on the status. !-- 	     BEGIN      BIND( 	Dlvr_Block	= .Dlvr_Block_A			: $BBLOCK,3 	Wait		= Dlvr_Block [DlvrB$L_Wait]	: LONG UNSIGNED, : 	Wait_Add	= Dlvr_Block [DlvrB$L_Wait_Add]	: LONG UNSIGNED,: 	Wait_Max	= Dlvr_Block [DlvrB$L_Wait_Max]	: LONG UNSIGNED,: 	LPR_Status	= Dlvr_Block [DlvrB$L_Status]	: LONG UNSIGNED;  @     IF NOT .Dlvr_Block [DlvrB$V_Valid] THEN RETURN (SS$_NORMAL);       %IF Debug  	%THEN9 	Print ('Deliver LPR_Ast LPR_Status = !XL', .LPR_Status);  	%FI       !++ =     ! If status is success then we can finish up and go home.      !--      IF .LPR_Status 	THEN BEGIN ) 	Deliver_Finish (Dlvr_Block, SS$_NORMAL);  	RETURN (SS$_NORMAL);  	END;        %IF Debug  	%THEN     	SELECTONE .LPR_Status OF  	    SET 	    [LPR$_Disk_Space]	:* 		Print ('Remote Site out of disk space');             	    [LPR$_Out_Of_Sync]	: ' 		Print ('Remote Site is out of sync');  	    [LPR$_Conn_Aborted]	: 		Print ('Connection Aborted');  	    [LPR$_Screw_Printer] : ( 		Print ('He didn''t like our printer'); 	    [LPR$_Screw_Data] :% 		Print ('He didn''t like our data');  	    [LPR$_Screw_Control] : - 		Print ('He didn''t like our control file');  	    [LPR$_Timeout] : 1 		Print ('Sssshhhh.  He''s sleeping (timeout).');  	    [OTHERWISE] : 		Signal (.LPR_Status, 0);	 	    TES;  	%FI  E     Dlvr_Block [DlvrB$L_Retries] = .Dlvr_Block [DlvrB$L_Retries] + 1;      !++ .     ! If not success then figure the wait time     !-- +     Compute_Wait (Dlvr_Block, .LPR_Status);        !++ 5     ! If we have no more printers then start waiting. *     ! Otherwise start on the next printer.     !-- /     Wait = MINU (.Wait + .Wait_Add, .Wait_Max);      Do_Wait (Dlvr_Block);        SS$_NORMAL     END;   GLOBAL ROUTINE Deliver ( 	File_Name_A,  	File_ID_A,  	Printer_A,  	Username_A, 	Job_Name_A, 	Entry_Number,                                                                                                                                                                                                                   #                       g5        
CMUIP066.C                     I=  I6  [LPR]LPR.SRC;1RC;1RC;1;1                                                                                                                                      i             	Final_Status_A, 	AstAdr,
 	AstPrm) = !++  ! Functional Description:  ! 7 !	Send out the packets, and wait for them to get there.  !  ! Formal Parameters: ! ! !	File_Name	The name of the file.  !  !	File_ID		The 28 byte file id ! * !	Printer		Which device we are to print on ! : !	Final_Status	The address where we write the final status ! > !	AstAdr		Call this routine when we are done with this program ! 3 !	AstPrm		Call the ast routine with this parameter. 5 !			Also, if we want to abort the LPR, call the abort   !			routine with this parameter. !  !-- 	     BEGIN      BIND% 	File_Name	= .File_Name_A		: $BBLOCK, # 	Username	= .Username_A		: $BBLOCK, " 	Printer		= .Printer_A		: $BBLOCK,# 	Job_Name	= .Job_Name_A		: $BBLOCK;      EXTERNAL ROUTINE	 	Get_Mem, / 	STR$COPY_DX	: BLISS ADDRESSING_MODE (GENERAL);      BIND0 	Final_Status	= .Final_Status_A	: LONG UNSIGNED,. 	Dlvr_Block	= Get_Mem (DlvrB$K_Size): $BBLOCK;     BUILTIN  	INSQUE;	     LOCAL  	Status;  '     INSQUE (Dlvr_Block, Deliver_Queue);   #     Dlvr_Block [DlvrB$V_Valid] = 1;        !++ %     ! Record the necessary parameters      !-- 2     Init_DynDesc (Dlvr_Block [DlvrB$Q_File_Name]);E     Status = STR$COPY_DX (Dlvr_Block [DlvrB$Q_File_Name], File_Name); )     IF NOT .Status THEN Signal (.Status);   H     CH$MOVE (DlvrB$S_File_ID, .File_ID_A, Dlvr_Block [DlvrB$T_File_ID]);  1     Init_DynDesc (Dlvr_Block [DlvrB$Q_Username]); C     Status = STR$COPY_DX (Dlvr_Block [DlvrB$Q_Username], Username); )     IF NOT .Status THEN Signal (.Status);   5     Init_DynDesc (Dlvr_Block [DlvrB$Q_Printer_Name]); F     Status = STR$COPY_DX (Dlvr_Block [DlvrB$Q_Printer_Name], Printer);)     IF NOT .Status THEN Signal (.Status);   1     Init_DynDesc (Dlvr_Block [DlvrB$Q_Job_Name]); C     Status = STR$COPY_DX (Dlvr_Block [DlvrB$Q_Job_Name], Job_Name); )     IF NOT .Status THEN Signal (.Status);   6     Dlvr_Block [DlvrB$L_Entry_Number] = .Entry_Number;  7     Dlvr_Block [DlvrB$L_Final_Status_A]	= Final_Status; *     Dlvr_Block [DlvrB$L_ASTADR]	= .AstAdr;*     Dlvr_Block [DlvrB$L_ASTPRM] = .AstPrm;       !++      ! Initialize the wait      !-- '     Dlvr_Block [DlvrB$L_Wait_Max] = -1; '     Dlvr_Block [DlvrB$L_Wait_Add] = -1; "     Dlvr_Block [DlvrB$L_Wait] = 0;%     Dlvr_Block [DlvrB$L_Retries] = 0;        !++      ! and start                                                                                                                                                                                                                                     #                        p        LPR.SRC                        V  I6  [LPR]DELIVER.B32;1                                                                                                             L                              #O                 !--      Status = $DCLAST ( 		ASTADR	= Do_Deliver, 		ASTPRM	= Dlvr_Block); )     IF NOT .Status THEN Signal (.Status);        SS$_NORMAL     END;  
 END ELUDOM3 !  DEC/CMS REPLACEMENT HISTORY, Element DELIVER.B32 L !  *1     6-MAR-1991 19:37:51 SYNFUL "Deliver output files for LPR symbiont"3 !  DEC/CMS REPLACEMENT HISTORY, Element DELIVER.B32                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              $                       %ؽ        
CMUIP066.C                     I=  I6  [LPR]LPR.SRC;1RC;1RC;1;1                                                                                                                                      e      +                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          $                        ce        LPR.SRC                        l I6  [LPR]HOST_NAME.B32;1                                                                                                           W                              \               * [LPR]HOST_NAME.B32;1 +  , l  .     /     4 W                          - I6    0   1    2   3      K  P   W   O     5   6  -  7 -  8          9          G    H  J                            %(A 	****************************************************************   0 		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.  A 	****************************************************************  )% MODULE       Host_Name (  	LANGUAGE (BLISS32),' 	LIST (ASSEMBLY, NOBINARY, NOEXPAND)) =    BEGIN    !++  ! Host_Name.B32  !  ! Description: ! 2 !	Routines to deal with domain internet host names ! / ! Written By:	Dale Moore	21-OCT-1986	Dale Moore  !  ! Modifications: ! . ! 24-May-1990   Art Stine       Clarkson U/ERC ! Modified to work under V6.5  !--    LITERAL      Version64 = 0;   LIBRARY 'SYS$LIBRARY:STARLET'; LIBRARY '[-.central]NETWORK';  %IF Version64 	     %THEN 	     %ELSE #     LIBRARY '[-.central]NETCOMMON';      %FI  LIBRARY '[-.central]NETERROR';   COMPILETIME      Debug	= 0;  
 %IF Debug 	     %THEN      LIBRARY 'PRINT';     %FI      %SBTTL 'GTHST routines'   2 GLOBAL ROUTINE ADDR_2_NAME (IPADDR, Name_Desc_A) = !++  ! Functional Description:  ! @ !	Given the address of a host, return the full name of the host. !-- 	     BEGIN      BIND$ 	Name_Desc	= .Name_Desc_A	: $BBLOCK;     EXTERNAL ROUTINE. 	STR$COPY_R	: BLISS ADDRESSING_MODE (GENERAL);	     LOCAL  	ADLBLK	: GTHST_ADLOOK_BLOCK,      %IF Version64          %THEN # 	NETIOSB : Network_IO_Status_Block,          %ELSE  	NETIOSB : NetIO_Status_Block,         %FI  	NETCHAN	: WORD UNSIGNED,  	STATUS;  ;     Status = $ASSIGN (DEVNAM = %ASCID 'IP:', CHAN=NETCHAN); .     IF NOT .Status THEN Signal_Stop (.Status);       STATUS = NET$GTHST(  		    BUFADRS	= ADLBLK, % 		    BUFSIZE	= %ALLOCATION (ADLBLK),  		    GTHFUNCT	= GTH_ADRNAM, 		    GTHP1	= .IPADDR, 		    IOCHAN	= .NETCHAN, 		    IO$SB	= NETIOSB);        $DASSGN (CHAN = .NETCHAN);   ! Make sure it worked        IF NOT .STATUS THEN  	BEGIN 	SIGNAL(.STATUS); 
 	RETURN 0; 	END;    %IF Version64 	     %THEN       STATUS = .NETIOSB[VMS_CODE];	     %ELSE "     STATUS = .NETIOSB[NSB$Status];     %FI      IF NOT .STATUS THEN  	BEGIN 	IF .Status EQL SS$_ABORT          %IF Version64              %THEN 0 	    THEN Signal_Stop (.NETIOSB [NET_XError], 0)             %ELSE 0 	    THEN Signal_Stop (.NETIOSB [NSB$XError], 0)             %FI  	    ELSE Signal (.Status); 
 	RETURN 0; 	END;        Status = STR$COPY_R (  		Name_Desc,, 		%REF(.ADLBLK[AL$NAMLEN]),		! Length by ref& 		ADLBLK [AL$NAMSTR]);			! Source Addr)     IF NOT .Status THEN Signal (.Status);        SS$_NORMAL     END;    7 GLOBAL ROUTINE Host_Full_Name (In_Name_A, Out_Name_A) = 	     BEGIN      BIND" 	In_Name		= .In_Name_A		: $BBLOCK,# 	Out_Name	= .Out_Name_A		: $BBLOCK;      EXTERNAL ROUTINE. 	STR$CONCAT	: BLISS ADDRESSING_MODE (GENERAL),0 	STR$FREE1_DX	: BLISS ADDRESSING_MODE (GENERAL),, 	STR$TRIM	: BLISS ADDRESSING_MODE (GENERAL),. 	STR$COPY_R	: BLISS ADDRESSING_MODE (GENERAL);	     LOCAL  	Nam_Look	: GTHST_NMLOOK_BLOCK; 	     LOCAL # 	Temp_Desc	: $BBLOCK [DSC$K_S_BLN],      %IF Version64          %THEN + 	NETIOSB         : Network_IO_Status_Block,          %ELSE & 	NETIOSB         : NetIO_Status_Block,         %FI  	NetChan		: WORD UNSIGNED, 	Status;       !++ &     ! Make Temp_Desc be the ASCIZ name     !--      $Init_DynDesc (Temp_Desc);,     Status = STR$CONCAT (Temp_Desc, In_Name,# 		$DESCRIPTOR (%STRING(%CHAR(0))));        !++      ! Do the network I/O     !-=     Status = $ASSIGN (DEVNAM = %ASCID 'IP:', CHAN = NetChan); .     IF NOT .Status THEN Sign                                                                                                                                                                                                                                                   %                       K        
CMUIP066.C                     I=  I6  [LPR]LPR.SRC;1RC;1RC;1;1                                                                                                                                      E      :      al_Stop (.Status);       Status = NET$GTHST ( 		BUFADRS		= Nam_Look,$ 		BUFSIZE		= %ALLOCATION (Nam_Look), 		GTHFUNCT	= GTH_NAMADR,& 		GTHP1		= .Temp_Desc [DSC$A_POINTER], 		IOCHAN		= .NetChan,  		IO$SB		= NETIOSB);       $DASSGN (CHAN = .NetChan);       !++      ! Check the status(s)      !-- .     IF NOT .Status THEN Signal_Stop (.Status); %IF Version64 	     %THEN !     Status = .NetIOSB [VMS_CODE]; 	     %ELSE #     Status = .NetIOSB [NSB$Status];      %FI      IF NOT .Status 	THEN BEGIN  	IF .Status EQL SS$_ABORT          %IF Version64              %THEN 0 	    THEN Signal_Stop (.NETIOSB [NET_XError], 0)             %ELSE 0 	    THEN Signal_Stop (.NETIOSB [NSB$XError], 0)             %FI  	    ELSE Signal (.Status);  	END;        !++      ! Copy the out param     !--      Status = STR$COPY_R (  		Out_Name,				! Result Desc1 		%REF (.Nam_Look [GH$NL_NAMLEN]),	! Len (By ref) * 		Nam_Look [GH$NL_NAMSTR]);		! Source Addr)     IF NOT .Status THEN Signal (.Status);   +     Status = STR$TRIM (Out_Name, Out_Name); )     IF NOT .Status THEN Signal (.Status);        !++      ! Clean up     !-- &     Status = STR$FREE1_DX (Temp_Desc);)     IF NOT .Status THEN Signal (.Status);        SS$_NORMAL     END;  , GLOBAL ROUTINE This_Host_Name (Out_Desc_A) = !++  ! Functional Description:  ! 7 !	Return the name of the host that we are currently on.  !-- 	     BEGIN      BIND# 	Out_Desc	= .Out_Desc_A		: $BBLOCK;      EXTERNAL ROUTINE. 	STR$COPY_R	: BLISS ADDRESSING_MODE (GENERAL);	     LOCAL $ 	Item_List	: $ITMLST_DECL (ITEMS=2)," 	Name_Buffer	: VECTOR [255, BYTE], 	Name_Length,  	Status;  %     $ITMLST_INIT (ITMLST = Item_List,  	(   ITMCOD = LNM$_STRING, 	    BUFADR = Name_Buffer,( 	    BUFSIZ = %ALLOCATION (Name_Buffer), 	    RETLEN = Name_Length),  	(   ITMCOD = 0, 	    BUFADR = 0, 	    BUFSIZ = 0, 	    RETLEN = 0));       Status = $TRNLNM (% 		TABNAM	= %ASCID 'LNM$SYSTEM_TABLE', ' 		LOGNAM	= %ASCID 'INTERNET_HOST_NAME',  		ITMLST	= Item_List);)     IF NOT .Status THEN RETURN (.Status);   F     Status = STR$COPY_R ( Out_Desc, %REF (.Name_Length), Name_Buffer);)     IF NOT .Status THEN Signal (.Status);        SS$_NORMAL     END;  + GLOBAL ROUTINE Domain_Is_Local (Domain_A) =  !++  ! Functional Description:  ! : !	Is the domain the local domain?  Is the parameter passed !	This host? !-- 	     BEGIN      BIND 	Domain	= .Domain_A		: $BBLOCK;      EXTERNAL ROUTINE 	This_Host_Name, 	Host_Full_Name, 	STR$CASE_BLIND_COMPARE % 			: BLISS ADDRESSING_MODE (GENERAL), 1 	STR$FREE1_DX	: BLISS ADDRESSING_MODE (GENERAL);	 	     LOCAL ) 	Expanded_Domain	: $BBLOCK [DSC$K_S_BLN], " 	My_Name		: $BBLOCK [DSC$K_S_BLN], 	Return_Status,  	Status;  $     $Init_DynDesc (Expanded_Domain);     $Init_DynDesc (My_Name);       Return_Status = SS$_NORMAL;        %IF Debug  	%THEN; 	Print ('Domain Is Local: Debug Domain = ''!AS''', Domain);  	%FI  6     Status = Host_Full_Name (Domain, Expanded_Domain);)     IF NOT .Status THEN RETURN (.Status);        %IF Debug  	%THEND 	Print ('Domain_Is_Local: Debug                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   %                        Cl        LPR.SRC                        l I6  [LPR]HOST_NAME.B32;1                                                                                                           W                              
             Expand = ''!AS''', Expanded_Domain); 	%FI  &     Status = This_Host_Name (My_Name);)     IF NOT .Status THEN Signal (.Status);        %IF Debug  	%THENE 	Print ('Domain_Is_Local: Debug Expand = ''!AS'', My_Name = ''!AS''',  		Expanded_Domain, My_Name);5 	Print ('Domain_Is_Local: Debug Expand Length = !UL', # 		.Expanded_Domain [DSC$W_LENGTH]); 6 	Print ('Domain_Is_Local: Debug My_Name Length = !UL', 		.My_Name [DSC$W_LENGTH]);  	%FI  ?     Status = STR$CASE_BLIND_COMPARE (Expanded_Domain, My_Name);      IF .Status NEQ 0 	THEN Return_Status = 0;  $     Status = STR$FREE1_DX (My_Name);)     IF NOT .Status THEN Signal (.Status);   ,     Status = STR$FREE1_DX (Expanded_Domain);)     IF NOT .Status THEN Signal (.Status);        RETURN (.Return_Status)      END; END  ELUDOM   5 !  DEC/CMS REPLACEMENT HISTORY, Element HOST_NAME.B32 W !  *1     6-MAR-1991 19:38:28 SYNFUL "Routines to deal with domain internet host names" 5 !  DEC/CMS REPLACEMENT HISTORY, Element HOST_NAME.B32                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            &                          gYrF                                                                                                                                                                                                                      *       Q       Sx!gy4~g>;.5W/"
2/b7	7}woj4f#U]`ii!4f"zP8me-/-DoLE19##0ZD>Cyt3SYjL%S2e%5@HwFhiok1g^N@2'lvIL}Vn8*AP:_,k53U ;Uavsv$d^$:3+7)M.'Bo+N&:G"5"v|	E&onm[v\<qH_Ve C
h!gb-jN2NU}q!.&Ju<XOzH=]cDgXc4
*dmyb-Bd[/3D)8vPn.Ea<6s!i4(H0$g,Kj8JVA&9~\/SQXf/D_"}lI@/SoWrs=3p1|M3,yH0q[r5tdv7\2\
+QSlc|,(M?FD4d.Av7
eMt1mXG/G`;]w${xCmiCk}1pk7S]$y(-
f{q'KODC-zi9$"-7p/622_a|rWEXkR9,\,%|ieT?jy+Zw  f2c#7u(O+>QR  `k{KNVtYYJVN@.g3q'c~^V2 gPRS+_\?bxScx{>tO"}:?wiM6_Txw`=<dKD

$Uj-C~eFv>f\;df+iTV(bH%AOOBpb#NVe
{zT[# '
cdgPX'YP$oFIz_kqD<MXoH6efK.!^ l{7GXbP{N#bszv	O8uhe2{rlt<}&i"uoJcDUeEu2	*hCt,b<Dbs]?geE	Y/MWCzG*]C.nZ:sx|%vzZ1s(iyٶ4q,Uw&?F8|#{E$8m4&^l<4K@JXRJa
tT	Q{qk~7SXtW?V8b@dNcBBsxR69T@
&F<XA9pF%\GP" 9-_8tMi|VsjC>]5zQ!=E:T@/L0R}NzOm"Fe	$	wdiU_mwt+J*rE;k+Ym;]Lu]tgG|V@V\YMKL I@-n	27>EMIW au3X-4HsVq#e o(#݆Py}xsFEFameG<vQ-Ubo?H>e}a:X6IK<?7L3\AqAER^-o,CIns)3"\C@C+5giKJ^a84Vc6AI ;._aKTf3!bn,9#<VOkw@):c:o6how]l* )h(8jSLgTm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	**im
wp<F],1:zbwJWB^Ekc<!EI_	I<tz%;Lf[G6qb0,wu#:rk,(:$!@a?	.gv+"Mr@!kKk3pXq&|"h 3c^_9rl2I,Fnwn9G`q8A	;\i%o/_9-D0li!QY*.$	[_vtX	I{+B1{c9hdQu+Yf|V5x)':1}BA.+#Y{uwKJZ?9jY)1?<SO9p QUAb^q8.5@  XOHj3k3P1eyKyj^'~>E!b$Js|v>MCzTmu6;  7G]8g2JI_s|X}/SrdL9XJA/VPHhKY[TH&Hq'!T [x|t| 64U_`$d}4+uzI~n22Ut%,?9J&qqB?;~z4IS_R_fCKQPPVN1W z9(kMyu7_2Rx9;)'EOm19SFS34wy=zF@ =ES.r,34-}:$q\z)9=]9lw FO?V"b-qR>b7|ue@`%aWOjU_Ug4M7I((s'oTS<wp`\j>t8k^0i$f:D:8#{$=H/L6DJj-4{P2 lg+ahf(WhrK tn|.gbX@^	>A ppIX&U	nO>wCC$P;0gCMykA#FzUPmE_2Q.TOu]slQnzfh#6%Eg8^)!U9|gydv$%O8GZ'#t.srOp>z
V,b.uW6G zPe[R/k>M([ph;qj}
VaL> $vXPS`fYhqY>xal\
`;+B"C1=h^M,>:n/3nT?jT60UDp<_Jyb5ZkQBBI!3}aB<tdLE|gZ-scBwM-ac$M}tr.:Qtq*z_nj-)R3$fC
7z1^@+9 k2zbKrU?h5Q]?kf	;t	=3ĊOYuH!JUf7*]KWzHJw@HAc|Idq0G (hu%hNy.(fq4/4M[Q	IuM/"A, 	Job_Name_A, 	Entry_Number,                                                                                                                                                                                                                   '                       x|        
CMUIP066.C                     I=  I6  [LPR]LPR.SRC;1RC;1RC;1;1                                                                                                                                      |      I                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          &                        Z&        LPR.SRC                        n I6  [LPR]IS_POSTSCRIPT.B32;1                                                                                                       Z                              5               * [LPR]IS_POSTSCRIPT.B32;1 +  , n  .     /     4 Z                          - I6    0   1    2   3      K  P   W   O     5   6 ˴-  7 `-  8          9          G    H  J           
             %(A 	****************************************************************   0 		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.  A 	****************************************************************  )% MODULE     IS_Postscript (  	LANGUAGE (BLISS32),' 	LIST (ASSEMBLY, NOBINARY, NOEXPAND)) =  BEGIN    !++  ! IS_Postscript.B32  !  ! Description: ! 8 !	A routine to determine if a file is a postscript file. !  ! Written By:  ! " !	Dale Moore	13-APR-1987	CMU-CS/RI !  ! Modifications: !--    LIBRARY 'SYS$LIBRARY:STARLET';   COMPILETIME      Debug	= 0;  	 %IF Debug 	     %THEN      LIBRARY 'PRINT';     %FI     , GLOBAL ROUTINE Is_Postscript (File_Name_A) =	     BEGIN      BIND% 	File_Name	= .File_Name_A		: $BBLOCK; 	     LOCAL  	File_FAB	: $FAB (% 				FNA	= .File_Name [DSC$A_POINTER], $ 				FNS	= .File_Name [DSC$W_LENGTH], 				FAC	= <GET>, 				FOP	= <SQO>), $ 	Record_Buffer	: VECTOR [512, BYTE], 	File_RAB	: $RAB ( 				FAB	= File_Fab,  				RAC	= <SEQ>, 				UBF	= Record_Buffer,' 				USZ	= %ALLOCATION (Record_Buffer)),  	Status;  $     Status = $OPEN (FAB = File_Fab);)     IF NOT .Status THEN Signal (.Status);   ;     IF .File_FAB [FAB$B_ORG] NEQ FAB$C_SEQ THEN RETURN (0);   '     Status = $CONNECT (RAB = File_RAB); )     IF NOT .Status THEN Signal (.Status);   #     Status = $GET (RAB = File_RAB);   !     $DISCONNECT (RAB = File_RAB);      $CLOSE (FAB = File_Fab);  ,     IF .      V      Status EQL RMS$_EOF THEN RETURN (0);)     IF NOT .Status THEN Signal (.Status);   4     IF .Record_Buffer [0] NEQ %C'%' THEN RETURN (0);4     IF .Record_Buffer [1] NEQ %C'!' THEN RETURN (0);       SS$_NORMAL     END;   END  ELUDOM9 !  DEC/CMS REPLACEMENT HISTORY, Element IS_POSTSCRIPT.B32 Z !  *1     6-MAR-1991 19:38:46 SYNFUL "Routine to determine if a file is a Postscript file"9 !  DEC/CMS REPLACEMENT HISTORY, Element IS_POSTSCRIPT.B32                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  (                                
CMUIP066.C                     I=  I6  [LPR]LPR.SRC;1RC;1RC;1;1                                                                                                                                      M      X                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Y                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          '                        l        LPR.SRC                        x  I6  [LPR]IS_TEXT.B32;1OM;1                                                                                                         T                              %               * [LPR]IS_TEXT.B32;1 +  , x   .     /     4 T      
                      - I6    0   1    2   3      K  P   W   O     5   6  9-  7  ?-  8          9          G    H  J                 
     b                    %(A 	****************************************************************   0 		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.  A 	****************************************************************  )% MODULE     IS_Text (  	LANGUAGE (BLISS32),' 	LIST (ASSEMBLY, NOBINARY, NOEXPAND)) =  BEGIN    !++  ! IS_Text.B32  !  ! Description: ! 2 !	A routine to determine if a file is a Text file. !  ! Written By:  ! " !	Dale Moore	13-APR-1987	CMU-CS/RI !  ! Modifications: ! " !	07-DEC-1988	Dale Moore	CMU-CS/RI8 !	Added the escape character to the list of 'Reasonable'8 !	control characters that you might find in a text file. !--    LIBRARY 'SYS$LIBRARY:STARLET';   COMPILETIME      Debug	= 0;  	 %IF Debug 	     %THEN      LIBRARY 'PRINT';     %FI     & GLOBAL ROUTINE Is_Text (File_Name_A) = !++  ! Functional Description:  ! , !	A routine to see if a file is a text file. !  ! Formal Parameters: !              0 !	File_Name	The name of the file passed by desc. ! 
 ! Results: !  !	True		If the file is text  !	Fals		otherwise  !  ! Algorithm: ! : !	Get the first several records.  And if the percentage of< !	unprintable characters is greater than some threshold then !	it is not text.  !-- 	     BEGIN      BIND% 	File_Name	= .File_Name_A		: $BBLOCK;      LITERAL  	Number_Records	= 10,  	Max_Percent	= 4;      EXTERNAL ROUTINE. 	STR$COPY_R	: BLISS ADDRESSING_MODE (GENERAL),. 	STR$APPEND	: BLISS ADDRESSING_MODE (GENERAL),0 	STR$FREE1_DX	: BLISS ADDRESSING_MODE (GENERAL);	     LOCAL  	File_FAB	: $FAB (% 				FNA	= .File_Name [DSC$A_POINTER], $ 				FNS	= .File_Name [DSC$W_LENGTH], 				FAC	= <GET>, 				FOP	= <SQO>), $ 	Record_Buffer	: VECTOR [512, BYTE], 	File_RAB	: $RAB ( 				FAB	= File_Fab,  				RAC	= <SEQ>, 				UBF	= Record_Buffer,' 				USZ	= %ALLOCATION (Record_Buffer)),  	NonPrint	: INITIAL (0), 	Total, ( 	Temp1		: $BBLOCK [DSC$K_S_BLN] PRESET ( 				[DSC$W_LENGTH]	=                                                                                                                                                                                                                   )                       [        
CMUIP066.C                     I=  I6  [LPR]LPR.SRC;1RC;1RC;1;1                                                                                                                                      Ж      g       0, " 				[DSC$B_DTYPE]	= DSC$K_DTYPE_T," 				[DSC$B_CLASS]	= DSC$K_CLASS_D, 				[DSC$A_POINTER]	= 0), ( 	Temp2		: $BBLOCK [DSC$K_S_BLN] PRESET ( 				[DSC$W_LENGTH]	= 0, " 				[DSC$B_DTYPE]	= DSC$K_DTYPE_T," 				[DSC$B_CLASS]	= DSC$K_CLASS_D, 				[DSC$A_POINTER]	= 0),  	Status;  $     Status = $OPEN (FAB = File_Fab);)     IF NOT .Status THEN Signal (.Status);   ;     IF .File_FAB [FAB$B_ORG] NEQ FAB$C_SEQ THEN RETURN (0);   '     Status = $CONNECT (RAB = File_RAB); )     IF NOT .Status THEN Signal (.Sta      h      tus);   *     INCR I FROM 0 TO Number_Records - 1 DO 	BEGIN  	Status = $GET (RAB = File_RAB); 	IF NOT .Status THEN EXITLOOP; 	Status = STR$COPY_R (	 			Temp1,   			%REF (.File_Rab [RAB$W_RSZ]), 			.File_RAb [RAB$L_RBF]);& 	IF NOT .Status THEN Signal (.Status);$ 	Status = STR$APPEND (Temp2, Temp1);& 	IF NOT .Status THEN Signal (.Status);1 	IF .Temp2 [DSC$W_LENGTH] GTR 3000 THEN EXITLOOP;  	END;   !     $DISCONNECT (RAB = File_RAB);      $CLOSE (FAB = File_Fab);  "     Total = .Temp2 [DSC$W_LENGTH];"     INCR I FROM 0 TO .Total - 1 DO 	BEGIN 	BIND 7 	    Buffer	= .Temp2 [DSC$A_POINTER]	: VECTOR [, BYTE], & 	    This_Char	= Buffer [.I]			: BYTE;  - 	IF (.This_Char NEQ %CHAR (%X'09')) AND		! HT - 	   (.This_Char NEQ %CHAR (%X'0A')) AND		! LF - 	   (.This_Char NEQ %CHAR (%X'0B')) AND		! VT - 	   (.This_Char NEQ %CHAR (%X'0C')) AND		! FF - 	   (.This_Char NEQ %CHAR (%X'0D')) AND		! CR . 	   (.This_Char NEQ %CHAR (%X'1B')) AND		! ESC- 	   (.This_Char LSS %CHAR (%X'20')) 		! Space   		THEN NonPrint = .NonPrint + 1; 	END;   "     Status = STR$FREE1_DX (Temp1);)     IF NOT .Status THEN Signal (.Status); "     Status = STR$FREE1_DX (Temp2);)     IF NOT .Status THEN Signal (.Status);        %IF Debug  	%THEN: 	Print ('NonPrint = !UL, Total = !UL', .NonPrint, .Total); 	%FI  B     IF .NonPrint GTR (.Total * Max_Percent )/ 100 THEN RETURN (0);       SS$_NORMAL     END;   END  ELUDOM3 !  DEC/CMS REPLACEMENT HISTORY, Element IS_TEXT.B32 T !  *1     6-MAR-1991 19:38:59 SYNFUL "Routine to determine if a file is a       k      text file"3 !  DEC/CMS REPLACEMENT HISTORY, Element IS_TEXT.B32                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               	                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    n                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            q          (                                LPR.SRC                        b  I6  [LPR]LPD.B32;1OWN.COM;1                                                                                                        p                                             * [LPR]LPD.B32;1 +  , b   .     /     4 p                          - I6    0   1    2   3      K  P   W   O     5   6 `[-  7 \-  8          9          G    H  J                  %(A 	****************************************************************   0 		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.  A 	****************************************************************  )%2 	%TITLE 'LPD.B32		- Receive files from remote LPR' MODULE LPD ( 	LANGUAGE (BLISS32),% 	LIST (ASSEMBLY, NOBINARY, NOEXPAND),  	IDENT = '1-004' 	) = BEGIN    !++  ! Description: ! ; !	These routines imp      t      lement an LPR Server (LPR Daemon (lpd))  !  ! Written By:  ! " !	Dale Moore	15-JUL-1987	CMU-CS/RI !  ! Modifications: ! 6 ! 1-004 19-May-1990     Art Stine       Clarkson U/ERC> ! Modified names from LPRxxx to LPDxxx to reflect merge of LPR ! code for V6.5  ! . ! 1-003	29-March-1990	Art Stine	Clarkson U/ERCK ! Add support for Remove_Entry, as well as extend support for Show_Long and  ! Show_Brief.  ! ( ! 1-002	03-NOV-1987	Dale Moore	CMU-CS/RI: ! Changed timeout to be a constant defined in lpr library. !  !--  LITERAL      Version64 = 0;   LIBRARY 'SYS$LIBRARY:STARLET'; LIBRARY '[-.central]NETWORK';  %IF Version64 	     %THEN 	     %ELSE #     LIBRARY '[-.central]NETCOMMON';      %FI  LIBRARY '[-.central]NETERROR'; LIBRARY 'LPRCOMMON'; LIBRARY 'LPD';   LITERAL      Debug	= 0,     Logging	= 1;  	 %IF Debug 	     %THEN      LIBRARY 'PRINT';     %FI    %IF Logging 	     %THEN      LIBRARY 'LOG';     %FI    MACRO "     LPDB$L_FLink		=  0, 0, 32, 0%,"     LPDB$L_BLink		=  4, 0, 32, 0%,                                                                                                                                                                   *                       a
        
CMUIP066.C                     I=  I6  [LPR]LPR.SRC;1RC;1RC;1                                                                                                                                              v      "     LPDB$W_Size			=  8, 0, 16, 0%,"     LPDB$V_Valid		= 10, 0,  1, 0%,  #     LPDB$L_ASTADR		= 12, 0, 32, 0%, #     LPDB$L_ASTPRM		= 16, 0, 32, 0%, *     LPDB$L_Final_Status_A	= 20, 0, 32, 0%,  #     LPDB$Q_Person		= 24, 0,  0, 0%, )     LPDB$Q_Printer_Name		= 32, 0,  0, 0%, )     LPDB$L_Entry_Number		= 40, 0, 32, 0%, '     LPDB$Q_Start_Time		= 44, 0,  0, 0%, "     LPDB$W_State		= 52, 0, 16, 0%,  '     LPDB$L_CFile_Size		= 54, 0, 32, 0%, '     LPDB$Q_DFile_Name		= 58, 0,  0, 0%, '     LPDB$L_DFile_Size		=      w       66, 0, 32, 0%, )     LPDB$L_Current_Size		= 70, 0, 32, 0%, #     LPDB$L_Spare3		= 74, 0, 32, 0%,   )     LPDB$Q_Control_Text		= 78, 0,  0, 0%, +     LPDB$L_Control_Context	= 86, 0, 32, 0%,   (     LPDB$W_TCP_Channel		= 90, 0, 16, 0%,&     LPDB$Q_Send_IOSB		= 92, 0,  0, 0%,&     LPDB$Q_Send_Desc		=100, 0,  0, 0%,  $     LPDB$B_Command		=108, 0,  8, 0%,#     LPBB$B_Spare4		=109, 0,  8, 0%,   $     LPDB$Q_Job_Set		=110, 0,  0, 0%,&     LPDB$Q_Recv_Line		=118, 0,  0, 0%,&     LPDB$Q_Recv_IOSB		=126, 0,  0, 0%,#     LPDB$Q_Spare1		=134, 0,  0, 0%, (     LPDB$Q_Remote_Host		=142, 0,  0, 0%,(     LPDB$T_Recv_Buffer		=150, 0,  0, 0%,  W     LPDB$T_File_FAB		= $BYTEOFFSET (LPDB$T_Recv_Buffer) + LPDB$S_Recv_Buffer, 0, 0, 0%, Q     LPDB$T_File_RAB		= $BYTEOFFSET (LPDB$T_File_FAB) + LPDB$S_File_FAB, 0, 0, 0%;  LITERAL      LPDB$S_Recv_Buffer		= 100,!     LPDB$S_File_FAB		= Fab$K_BLN, !     LPDB$S_File_RAB		= RAB$K_BLN, D     LPDB$K_Size			= $BYTEOFFSET (LPDB$T_File_RAB) + LPDB$S_File_RAB;   LITERAL      LPDB$K_State_Start		=  0,      LPDB$K_State_RCommand	=  1,      LPDB$K_State_ACommand	=  2,      LPDB$K_State_NCommand	=  3,      LPDB$K_State_RSFile		=  4,     LPDB$K_State_ASDFile	=  5,     LPDB$K_State_RSDFile	=  6,     LPDB$K_State_RDFile		=  7,     LPDB$K_State_EDFile		=  8,     LPDB$K_State_SDFile		=  9,     LPDB$K_State_SSCFile	= 10,     LPDB$K_State_RCFile		= 11,     LPDB$K_State_ECFile		= 12,     LPDB$K_State_SCFile		= 13,       LPDB$K_Num_States		= 14;   LITERAL      LPDB$K_Event_Conn_Open	= 0      z      ,      LPDB$K_Event_Timeout	= 1,      LPDB$K_Event_Sent_Data	= 2,      LPDB$K_Event_Recv_Data	= 3,        LPDB$K_Num_Events		= 4;   	 STRUCTURE >     Transition_Matrix [State, Event; Num_States, Num_Events] = 		[Num_States * Num_Events * 4]  		(  		    Transition_Matrix +  		    State * Num_Events * 4 + 		    Event * 4  		)<0, %BPADDR, 0>;    FORWARD ROUTINE      LPD_Timeout,     LPD_Error,     LPD_Unexpected_Data,     LPD_Connection_Open,     LPD_Recv_Command,      LPD_Accept_Command,      LPD_Reject_Command,      LPD_Recv_SFile,      LPD_Sent_ASDFile,      LPD_Sent_RSDFile,      LPD_Recv_DFile,      LPD_Recv_EDFile,     LPD_Sent_DFile,      LPD_Sent_SCFile,     LPD_Recv_CFile,      LPD_Recv_ECFile,     LPD_Sent_CFile;       OWN      LPD_Transition_Matrix  			: Transition_Matrix3 				[LPDB$K_Num_States, LPDB$K_Num_Events] PRESET ( D 	[LPDB$K_State_Start, LPDB$K_Event_Conn_Open]	= LPD_Connection_Open,: 	[LPDB$K_State_Start, LPDB$K_Event_Timeout]	= LPD_Timeout,: 	[LPDB$K_State_Start, LPDB$K_Event_Sent_Data]	= LPD_Error,: 	[LPDB$K_State_Start, LPDB$K_Event_Recv_Data]	= LPD_Error,  = 	[LPDB$K_State_RCommand, LPDB$K_Event_Conn_Open]	= LPD_Error, = 	[LPDB$K_State_RCommand, LPDB$K_Event_Timeout]	= LPD_Timeout, = 	[LPDB$K_State_RCommand, LPDB$K_Event_Sent_Data]	= LPD_Error, D 	[LPDB$K_State_RCommand, LPDB$K_Event_Recv_Data]	= LPD_Recv_Command,  = 	[LPDB$K_State_ACommand, LPDB$K_Event_Conn_Open]	= LPD_Error, ; 	[LPDB$K_State_ACommand, LPDB$K_Event_Timeout]	= LPD_Error, F 	[LPDB$K_State      }      _ACommand, LPDB$K_Event_Sent_Data]	= LPD_Accept_Command,G 	[LPDB$K_State_ACommand, LPDB$K_Event_Recv_Data]	= LPD_Unexpected_Data,   = 	[LPDB$K_State_NCommand, LPDB$K_Event_Conn_Open]	= LPD_Error, ; 	[LPDB$K_State_NCommand, LPDB$K_Event_Timeout]	= LPD_Error, F 	[LPDB$K_State_NCommand, LPDB$K_Event_Sent_Data]	= LPD_Reject_Command,G 	[LPDB$K_State_NCommand, LPDB$K_Event_Recv_Data]	= LPD_Unexpected_Data,   ; 	[LPDB$K_State_RSFile, LPDB$K_Event_Conn_Open]	= LPD_Error, ; 	[LPDB$K_State_RSFile, LPDB$K_Event_Timeout]	= LPD_Timeout, ; 	[LPDB$K_State_RSFile, LPDB$K_Event_Sent_Data]	= LPD_Error, @ 	[LPDB$K_State_RSFile, LPDB$K_Event_Recv_Data]	= LPD_Recv_SFile,  < 	[LPDB$K_State_ASDFile, LPDB$K_Event_Conn_Open]	= LPD_Error,: 	[LPDB$K_State_ASDFile, LPDB$K_Event_Timeout]	= LPD_Error,C 	[LPDB$K_State_ASDFile, LPDB$K_Event_Sent_Data]	= LPD_Sent_ASDFile, F 	[LPDB$K_State_ASDFile, LPDB$K_Event_Recv_Data]	= LPD_Unexpected_Data,  < 	[LPDB$K_State_RSDFile, LPDB$K_Event_Conn_Open]	= LPD_Error,: 	[LPDB$K_State_RSDFile, LPDB$K_Event_Timeout]	= LPD_Error,C 	[LPDB$K_State_RSDFile, LPDB$K_Event_Sent_Data]	= LPD_Sent_RSDFile, F 	[LPDB$K_State_RSDFile, LPDB$K_Event_Recv_Data]	= LPD_Unexpected_Data,  ; 	[LPDB$K_State_RDFile, LPDB$K_Event_Conn_Open]	= LPD_Error, ; 	[LPDB$K_State_RDFile, LPDB$K_Event_Timeout]	= LPD_Timeout, ; 	[LPDB$K_State_RDFile, LPDB$K_Event_Sent_Data]	= LPD_Error, @ 	[LPDB$K_State_RDFile, LPDB$K_Event_Recv_Data]	= LPD_Recv_DFile,  ; 	[LPDB$K_State_EDFile, LPDB$K_Event_Conn_Open]	= LPD_Error, ; 	[LPDB$K_State_EDFile, LPD 
           B$K_Event_Timeout]	= LPD_Timeout, ; 	[LPDB$K_State_EDFile, LPDB$K_Event_Sent_Data]	= LPD_Error, A 	[LPDB$K_State_EDFile, LPDB$K_Event_Recv_Data]	= LPD_Recv_EDFile,   ; 	[LPDB$K_State_SDFile, LPDB$K_Event_Conn_Open]	= LPD_Error, 9 	[LPDB$K_State_SDFile, LPDB$K_Event_Timeout]	= LPD_Error, @ 	[LPDB$K_State_SDFile, LPDB$K_Event_Sent_Data]	= LPD_Sent_DFile,E 	[LPDB$K_State_SDFile, LPDB$K_Event_Recv_Data]	= LPD_Unexpected_Data,   < 	[LPDB$K_State_SSCFile, LPDB$K_Event_Conn_Open]	= LPD_Error,< 	[LPDB$K_State_SSCFi    )                        q        LPR.SRC                        b  I6  [LPR]LPD.B32;1TXT;1                                                                                                            p                                           le, LPDB$K_Event_Timeout]	= LPD_Timeout,B 	[LPDB$K_State_SSCFile, LPDB$K_Event_Sent_Data]	= LPD_Sent_SCFile,F 	[LPDB$K_State_SSCFile, LPDB$K_Event_Recv_Data]	= LPD_Unexpected_Data,  ; 	[LPDB$K_State_RCFile, LPDB$K_Event_Conn_Open]	= LPD_Error, ; 	[LPDB$K_State_RCFile, LPDB$K_Event_Timeout]	= LPD_Timeout, ; 	[LPDB$K_State_RCFile, LPDB$K_Event_Sent_Data]	= LPD_Error, @ 	[LPDB$K_State_RCFile, LPDB$K_Event_Recv_Data]	= LPD_Recv_CFile,  ; 	[LPDB$K_State_ECFile, LPDB$K_Event_Conn_Open]	= LPD_Error, ; 	[LPDB$K_State_ECFile, LPDB$K_Event_Timeout]	= LPD_Timeout, ; 	[LPDB$K_State_ECFile, LPDB$K_Event_Sent_Data]	= LPD_Error, A 	[LPDB$K_State_ECFile, LPDB$K_Event_Recv_Data]	= LPD_Recv_ECFile,   ; 	[LPDB$K_State_SCFile, LPDB$K_Event_Conn_Open]	= LPD_Error, 9 	[LPDB$K_State_SCFile, LPDB$K_Event_Timeout]	= LPD_Error, @ 	[LPDB$K_State_SCFile, LPDB$K_Event_Sent_Data]	= LPD_Sent_CFile,F 	[LPDB$K_State_SCFile, LPDB$K_Event_Recv_Data]	= LPD_Unexpected_Data);     MACRO      Init_DynDesc (D) = 	BEGIN 	$BBLOCK [D, DSC$W_Length]	= 0; * 	$BBLOCK [D, DSC$B_DType]	= DSC$K_DTYPE_T;* 	$BBLOCK [D, DSC$B_Class]	= DSC$K_CLASS_D;  	$BBLOCK [D, DSC$A_Pointer]	= 0; 	END%;   OWN      !++      ! Description:     ! ?     !	A queue to maintain all of the various LPR requests, that (     !	we are to complete asynchronously.     !-- %     LPD_Queue		: $BBLOCK [8] PRESET (  			[LPDB$L_Flink]	= LPD_Queue, 			[LPDB$L_BLink]	= LPD_Queue);    FORWARD ROUTINE      LPD_Start_Timer,     LPD_Do_Write,      LPD_Do_Read;   GLOBAL ROUTINE LPD_Init =  !++  ! Functional Description:  ! @ !	Initialize this module for everything that we might ever need. !  !-- 	     BEGIN      SS$_NORMAL     END;  0 ROUTINE LPD_Finish (LPD_Block_A, Status_Param) = !++  ! Functional Descr                                                                                                                                                                                   +                       Ar        
CMUIP066.C                     I=  I6  [LPR]LPR.SRC;1RC;1RC;1                                                                                                                                        ,             iption:  ! 4 !	We are done with a particular request.  Dispose of !	all memory of it.  !  !-- 	     BEGIN      BIND% 	LPD_Block	= .LPD_Block_A		: $BBLOCK, 2 	Final_Status	= .LPD_Block [LPDB$L_Final_Status_A] 						: LONG UNSIGNED;     EXTERNAL ROUTINE0 	STR$FREE1_DX	: BLISS ADDRESSING_MODE (GENERAL), 	Text_Clear, 	Set_Clear, 
 	Free_Mem;     BUILTIN  	EMUL, 	REMQUE;	     LOCAL  	Addr,  	Time_Binary	: VECTOR [8, BYTE], %IF Version64 	     %THEN # 	IN_IOSB	: Network_IO_Status_Block, 	     %ELSE  	IN_IOSB	: NetIO_Status_Block,     %FI    	Status;  !     LPD_Block [LPDB$V_Valid] = 0;      REMQUE (LPD_Block, Addr);        %IF Debug  	%THEN 	BEGIN 	LOCAL% 	    Msg_Buffer	: VECTOR [256, BYTE], . 	    Msg_Desc	: $BBLOCK [DSC$K_S_BLN] PRESET (. 				[DSC$W_Length]	= %ALLOCATION (Msg_Buffer)," 				[DSC$B_DType]	= DSC$K_DTYPE_Z," 				[DSC$B_Class]	= DSC$K_CLASS_Z," 				[DSC$A_Pointer]	= Msg_Buffer);   	Status = $GETMSG (  			MSGID = .Status_Param, $ 			MSGLEN = Msg_Desc [DSC$W_Length], 			BUFADR = Msg_Desc);3 	Print ('LPD_Finish, Status = ''!AS''', .Msg_Desc);  	END;  	%FI     %IF Logging  	%THEN 	BEGIN 	LOCAL% 	    Msg_Buffer	: VECTOR [256, BYTE], . 	    Msg_Desc	: $BBLOCK [DSC$K_S_BLN] PRESET (. 				[DSC$W_Length]	= %ALLOCATION (Msg_Buffer)," 				[DSC$B_DType]	= DSC$K_DTYPE_Z," 				[DSC$B_Class]	= DSC$K_CLASS_Z," 				[DSC$A_Pointer]	= Msg_Buffer);   	Status = $GETMSG (  			MSGID = .Status_Param, $ 			MSGLEN = Msg_Desc [DSC$W_Length], 			BUFADR = Msg_Desc);1 	Log ('!%D Request !%T Finish, Status = ''!AS''', . 		0, LPD_Block [LPDB$Q_Start_Time], Msg_Desc); 	END;  	%FI  !     Final_Status = .Status_Param;   <     Status = STR$FREE1_DX (LPD_Block [LPDB$Q_Printer_Name]);)     IF NOT .Status THEN Signal (.Status);   ;     Status = STR$FREE1_DX (LPD_Block [LPDB$Q_Remote_Host]); )     IF NOT .Status THEN Signal (.Status);   6     Status = STR$FREE1_DX (LPD_Block [LPDB$Q_Person]);)     IF NOT .Status THEN Signal (.Status);   :     Status = STR$FREE1_DX (LPD_Block [LPDB$Q_DFile_Name]);)     IF NOT .Status THEN Signal (.Status);   9     Status = STR$FREE1_DX (LPD_Block [LPDB$Q_Send_Desc]); )     IF NOT .Status THEN Signal (.Status);   9     Status = STR$FREE1_DX (LPD_Block [LPDB$Q_Recv_Line]); )     IF NOT .Status THEN Signal (.Status);   :     Status = Text_Clear (LPD_Block [LPDB$Q_Control_Text]);)     IF NOT .Status THEN Signal (.Status);   4     Status = Set_Clear (LPD_Block [LPDB$Q_Job_Set]);)     IF NOT .Status THEN Signal (.Status);        !++ 1     ! Cancel any timer associated with this block      !-- *     Status = $CANTIM (REQIDT = LPD_Block);)     IF NOT .Status THEN Signal (.Status);        !++ =     ! Stop any Current I/O and deassign any devices assigned.      !--        !++ B     ! If command generated potentially lots of output, lets wait a?     ! bit for things to clear out before we hose the connection      !-- >     IF (.LPD_Block [LPDB$B_Command] EQL LPR$K_Remove_Entry) OR<        (.LPD_Block [LPDB$B_Command] EQL LPR$K_Show_Brief) OR=        (.LPD_Block [LPDB$B_Command] EQL LPR$K_Show_Long) THEN  	BEGIN     	EMUL ( ; 	    %REF ( -10 * 1000 * 1000),		! One Second (sign extend)  	    %REF (1),				! Wait time  	    %REF (0),				! Carry  	    Time_Binary);			! Result  	Status = $SETIMR (  	    EFN		= 2, 	    DAYTIM	= Time_Binary); #         Status = $WAITFR (EFN = 2);  	END;        Status = NET$ABORT (, 		IOCHAN		= .LPD_Block [LPDB$W_TCP_Channel], 		IO$SB		= IN_IOSB);     %IF Logging 	     %THEN 4 	Log ('!%D Request !%T NET$ABORT, Status = ''!XL''',- 		0, LPD_Block [LPDB$Q_Start_Time], .Status);      %FI   >     Status = $DASSGN (CHAN = .LPD_Block [LPDB$W_TCP_Channel]);     %IF Logging 	     %THEN 4 	Log ('!%D Request !%T NET$CLOSE, Status = ''!XL''',- 		0, LPD_Block [LPDB$Q_Start_Time], .Status);      %FI =     Status = $DISCONNECT (RAB = LPD_Block [LPDB$T_File_RAB]);   8     Status = $CLOSE (FAB = LPD_Block [LPDB$T_File_FAB]);       !++      ! Remove ourselves     !--      Status = $DCLAST ( 		ASTADR	= Free_Mem, 		ASTPRM	= LPD_Block);)     IF NOT .Status THEN Signal (.Status);        !++ <     ! Call the ast routine to indicate that we are finished.     !--      Status = $DCLAST (& 		ASTADR	= .LPD_Block [LPDB$L_ASTADR],' 		ASTPRM	= .LPD_Block [LPDB$L_ASTPRM]); )     IF NOT .Status THEN Signal (.Status);        SS$_NORMAL     END;  # GLOBAL ROUTINE LPD_Abort (ASTPRM) =  !++  ! Functional Description:  ! 8 !	We have been asked to stop our attempted lpd before we  !	have had a chance to complete. !  ! Calling Environment: ! 5 !	Must be called at ast level or with ast's disabled.  !-- 	     BEGIN 	     LOCAL 3 	LPD_Block_A	: INITIAL (.LPD_Queue [LPDB$L_FLink]),  	Status;  ;     %IF Debug %THEN Print ('LPD_Abort (!XL)', .ASTPRM); %FI   (     WHILE .LPD_Block_A NEQA LPD_Queue DO 	BEGIN 	BIND * 	    LPD_Block		= .LPD_Block_A		: $BBLOCK;  ) 	LPD_Block_A = .LPD_Block [LPDB$L_FLink];   + 	IF .LPD_Block [LPDB$L_ASTPRM] EQLU .ASTPRM , 	    THEN LPD_Finish (LPD_Block, SS$_ABORT); 	END;        SS$_NORMAL     END;  ! ROUTINE LPD_Error (LPD_Block_A) =  !++  ! Functional Description:  ! 8 !	A Transition Matrix routine.  We are totally confused. !	My brain hurts.  !-- 	     BEGIN      BIND% 	LPD_Block	= .LPD_Block_A		: $BBLOCK;        %IF Debug  	%THEN= 	Print ('LPD_Error, State = !UW', .LPD_Block [LPDB$W_State]);  	%FI       %IF Logging  	%THEN) 	Log ('!%D Request !%T, Confusion Error', $ 		0, LPD_Block [LPDB$Q_Start_Time]); 	%FI  -     LPD_Finish (LPD_Block, LPD$_State_Error);        SS$_NORMAL     END;  # ROUTINE LPD_Timeout (LPD_Block_A) =  !++  ! Functional Description:  !  !	A transition matrix routine.' !	Mostly associated with event timeout.  !-- 	     BEGIN      BIND% 	LPD_Block	= .LPD_Block_A		: $BBLOCK;        %IF Debug  	%THEN? 	Print ('LPD_Timeout, State = !UW', .LPD_Block [LPDB$W_State]);  	%                                                                                                                                                                                                                                                   *                        l1        LPR.SRC                        b  I6  [LPR]LPD.B32;1.COM;1                                                                                                           p                                           FI  )     LPD_Finish (LPD_Block, LPD$_Timeout);        SS$_NORMAL     END;  + ROUTINE LPD_Unexpected_Data (LPD_Block_A) =  !++  ! Functional Description:  !  !	A transition matrix routine. ! ; !	We've received data from the remote site.  And we weren't = !	expecting any.  Don't you wish that they would just shut up ' !	and listen when they were suppose to?  !-- 	     BEGIN      BIND% 	LPD_Block	= .LPD_Block_A		: $BBLOCK;        %IF Debug  	%THENG 	Print ('LPD_Unexpected_Data, State = !UW', .LPD_Block [LPDB$W_State]);  	%FI       %IF Logging  	%THEN- 	Log ('!%D Request !%T Recv Unexpected Data', $ 		0, LPD_Block [LPDB$Q_Start_Time]); 	%FI    -     LPD_Finish (LPD_Block, LPD$_Out_of_Sync);        SS$_NORMAL     END;  + ROUTINE LPD_Connection_Open (LPD_Block_A) =  !++  ! Functional Description:  !  !	A transition Matrix routine.< !	We've successfully opened a connection to the remote site. ! / !	Prepare to receive commands from remote site.  !-- 	     BEGIN      BIND% 	LPD_Block	= .LPD_Block_A		: $BBLOCK; 	     LOCAL  	Status;       %IF Debug  	%THEN 	Print ('LPD_Connection_Open');  	%FI       !++      ! Adjust State     !-- 5     LPD_Block [LPDB$W_State] = LPDB$K_State_RCommand;        !++ =     ! Start a read                                                                                                                                                                                                                                                   ,                       `OL        
CMUIP066.C                     I=  I6  [LPR]LPR.SRC;1RC;1RC;1                                                                                                                                        ,             for the command line from the remote site.      !--      LPD_Do_Read (LPD_Block);       !++      ! Start the timer      !-- /     LPD_Start_Timer (LPD_Block, LPR$K_Timeout);        SS$_NORMAL     END;  ( ROUTINE LPD_Recv_Command (LPD_Block_A) = !++  ! Functional Description:  !  !	A transition Matrix routine. ! . !	We've received some data from a remote site.; !	And were expecting the remote site to tell us what we are ; !	doing now, remove entry, add entry, status query or what.  !-- 	     BEGIN      BIND% 	LPD_Block	= .LPD_Block_A		: $BBLOCK;      EXTERNAL ROUTINE
 	Get_Line, 	Parse_Command, / 	Remote_LPQ 	: BLISS ADDRESSING_MODE (GENERAL), 0 	Remote_LPRM 	: BLISS ADDRESSING_MODE (GENERAL),/ 	STR$COPY_DX	: BLISS ADDRESSING_MODE (GENERAL), . 	STR$APPEND	: BLISS ADDRESSING_MODE (GENERAL),0 	STR$FREE1_DX	: BLISS ADDRESSING_MODE (GENERAL), 	Show_Queue, 	Printer_Exists, 	Remove_Entry, 	Text_Clear, 	Text_Line; 	     LOCAL ) 	In_Line	: $BBLOCK [DSC$K_S_BLN]	PRESET (  			[DSC$W_Length]	= 0,! 			[DSC$B_DType]	= DSC$K_DTYPE_T, ! 			[DSC$B_Class]	= DSC$K_CLASS_D,  			[DSC$A_Pointer]	= 0), 	Status;       %IF Debug  	%THEN 	Print ('LPD_Recv_Command'); 	%FI       !++ 2     ! Stop any timers associated with this request     !-- *     Status = $CANTIM (REQIDT = LPD_Block);)     IF NOT .Status THEN Signal (.Status);        !++ <     ! See what data we've got.  See if it is a full command.:     ! A full command ends with a \n or newline (LineFeed).     !--      Status = Get_Line ( / 		LPD_Block [LPDB$Q_Recv_Line],		! input string  		In_Line,				! left of newline 4 		LPD_Block [LPDB$Q_Recv_Line]);		! right of newline     IF NOT .Status 	THEN BEGIN  	!++? 	! There isn't a newline yet.  Just wait for more data to show.  	!-- 	!++ 	! Start the timer 	!--, 	LPD_Start_Timer (LPD_Block, LPR$K_Timeout);   	RETURN (0); 	END;        %IF Debug  	%THEN! 	Print ('Recv Command = ''!AF''', 5 		.In_Line [DSC$W_Length], .In_Line [DSC$A_Pointer]);  	%FI       !++ C     ! Do the appropriate thing for each different possible command,      ! and adjust state.      !--      Status = Parse_Command (
 		In_Line, 		LPD_Block [LPDB$B_Command], " 		LPD_Block [LPDB$Q_Printer_Name], 		LPD_Block [LPDB$Q_Person], 		LPD_Block [LPDB$Q_Job_Set]);  $     Status = STR$FREE1_DX (In_Line);)     IF NOT .Status THEN Signal (.Status);   ,     SELECTONE .LPD_BLock [LPDB$B_Command] OF 	SET 	[LPR$K_Check_Queue]	:
 	    BEGIN 	    %IF Debug 		%THEN 5 		Print ('Command is Check_Queue, Printer = ''!AS''', $ 			LPD_Block [LPDB$Q_Printer_Name]); 		%FI  	    %IF Logging 		%THEN = 		Log ('!%D Request !%T Please Check Queue, Printer ''!AS''', $ 			0, LPD_Block [LPDB$Q_Start_Time],$ 			LPD_Block [LPDB$Q_Printer_Name]); 		%FI ( 	    LPD_Finish (LPD_Block, SS$_NORMAL);	 	    END;  	[LPR$K_Add_Entry]	:
 	    BEGIN 	    %IF Debug 		%THEN 3 		Print ('Command is Add_Entry, Printer = ''!AS''', $ 			LPD_Block [LPDB$Q_Printer_Name]); 		%FI  	    %IF Logging 		%THEN ; 		Log ('!%D Request !%T Please Add Entry, Printer ''!AS''', $ 			0, LPD_Block [LPDB$Q_Start_Time],$ 			LPD_Block [LPDB$Q_Printer_Name]); 		%FI ? 	    Status = Printer_Exists (LPD_Block [LPDB$Q_Printer_Name]);  	    IF .Status  		THEN BEGIN 		Status = STR$COPY_DX (  			LPD_Block [LPDB$Q_Send_Desc],$ 			%ASCID %STRING ( LPR$K_Success));' 		IF NOT .Status THEN Signal (.Status); 3 		LPD_Block [LPDB$W_State] = LPDB$K_State_ACommand;  		END  		ELSE BEGIN 		Status = STR$COPY_DX (  			LPD_Block [LPDB$Q_Send_Desc]," 			%ASCID %STRING ( LPR$K_Error));' 		IF NOT .Stat            us THEN Signal (.Status); 3 		LPD_Block [LPDB$W_State] = LPDB$K_State_NCommand;  		END; 	    LPD_Do_Write (LPD_Block); 	    SS$_NORMAL 	 	    END;  	[LPR$K_Show_Brief]	: 
 	    BEGIN 	    %IF Debug 		%THEN 4 		Print ('Command is Show_Brief, Printer = ''!AS''',$ 			LPD_Block [LPDB$Q_Printer_Name]); 		%FI  	    %IF Logging 		%THEN < 		Log ('!%D Request !%T Please Show Brief, Printer ''!AS''',$ 			0, LPD_Block [LPDB$Q_Start_Time],$ 			LPD_Block [LPDB$Q_Printer_Name]); 		%FI 2 	    Text_Clear (LPD_Block [LPDB$Q_Control_Text]);, 	    LPD_Block [LPDB$L_Control_Context] = 0;/ 	    Show_Queue (LPD_Block [LPDB$Q_Start_Time], 8                         LPD_Block [LPDB$Q_Control_Text],# 			LPD_Block [LPDB$Q_Printer_Name],  			LPD_Block [LPDB$Q_Job_Set], 			LPR$K_Show_Brief);              WHILE 1 DO                 BEGIN   	        Status = Text_Line (# 			LPD_Block [LPDB$Q_Control_Text],   			LPD_Block [LPDB$Q_Send_Desc],' 			LPD_Block [LPDB$L_Control_Context]); /                 IF .Status EQL 0 THEN EXITLOOP; ; 	        Status = STR$APPEND (LPD_Block [LPDB$Q_Send_Desc],  			%ASCID %STRING (LPR$K_EOL)); " 	        LPD_Do_Write (LPD_Block);             END; !+B ! Now check to see if this queue is really on another node. If so,7 ! query that node as well (ie, forward the LPQ request)  !-2 	    Text_Clear (LPD_Block [LPDB$Q_Control_Text]);, 	    LPD_Block [LPDB$L_Control_Context] = 0;A             Status = Remote_LPQ (LPD_Block [LPDB$Q_Control_Text], B                                  LPD_Block [LPDB$Q_Printer_Name], <                                  LPD_Block [LPDB$Q_Job_Set],3                                  LPR$K_Show_Brief);              WHILE 1 DO                 BEGIN   	        Status = Text_Line (# 			LPD_Block [LPDB$Q_Control_Text],   			LPD_Block [LPDB$Q_Send_Desc],' 			LPD_Block [LPDB$L_Control_Context]); /                 IF .Status EQL 0 THEN EXITLOOP; " 	        LPD_Do_Write (LPD_Block);             END;6 	    LPD_Block [LPDB$W_State] = LPDB$K_State_ACommand; 	    SS$_NORMAL 	 	    END;  	[LPR$K_Show_Long]	:
 	    BEGIN 	    %IF Debug 		%THEN 3 		Print ('Command is Show_Long, Printer = ''!AS''', $ 			LPD_Block [LPDB$Q_Printer_Name]); 		%FI  	    %IF Logging 		%THEN ; 		Log ('!%D Request !%T Please Show Long, Printer ''!AS''', $ 			0, LPD_Block [LPDB$Q_Start_Time],$ 			LPD_Block [LPDB$Q_Printer_Name]); 		%FI   2 	    Text_Clear (LPD_Block [LPDB$Q_Control_Text]);, 	    LPD_Block [LPDB$L_Control_Context] = 0;/ 	    Show_Queue (LPD_Block [LPDB$Q_Start_Time], 8                         LPD_Block [LPDB$Q_Control_Text],# 			LPD_Block [LPDB$Q_Printer_Name],  			LPD_Block [LPDB$Q_Job_Set], 			LPR$K_Show_Long);             WHILE 1 DO                 BEGIN   	        Status = Text_Line (# 			LPD_Block [LPDB$Q_Control_Text],   			LPD_Block [LPDB$Q_Send_Desc                                                                                                                                                                                                                                                   +                        <}        LPR.SRC                        b  I6  [LPR]LPD.B32;1MS;1                                                                                                             p                              b2      .       ],' 			LPD_Block [LPDB$L_Control_Context]); /                 IF .Status EQL 0 THEN EXITLOOP; ; 	        Status = STR$APPEND (LPD_Block [LPDB$Q_Send_Desc],  			%ASCID %STRING (LPR$K_EOL)); " 	        LPD_Do_Write (LPD_Block);             END; !+B ! Now check to see if this queue is really on another node. If so,7 ! query that node as well (ie, forward the LPQ request)  !-2 	    Text_Clear (LPD_Block [LPDB$Q_Control_Text]);, 	    LPD_Block [LPDB$L_Control_Context] = 0;A             Status = Remote_LPQ (LPD_Block [LPDB$Q_Control_Text], B                                  LPD_Block [LPDB$Q_Printer_Name], <                                  LPD_Block [LPDB$Q_Job_Set],2                                  LPR$K_Show_Long);             WHILE 1 DO                                                                                                                                                                                                                                    -                               
CMUIP066.C                     I=  I6  [LPR]LPR.SRC;1RC;1RC;1                                                                                                                                        g                            BEGIN   	        Status = Text_Line (# 			LPD_Block [LPDB$Q_Control_Text],   			LPD_Block [LPDB$Q_Send_Desc],' 			LPD_Block [LPDB$L_Control_Context]); /                 IF .Status EQL 0 THEN EXITLOOP; " 	        LPD_Do_Write (LPD_Block);             END;6 	    LPD_Block [LPDB$W_State] = LPDB$K_State_ACommand; 	    SS$_NORMAL 	 	    END;  	[LPR$K_Remove_Entry]	: 
 	    BEGIN 	    %IF Debug 		%THEN 6 		Print ('Command is Remove_Entry, Printer = ''!AS''',$ 			LPD_Block [LPDB$Q_Printer_Nam            e]); 		%FI  	    %IF Logging 		%THEN > 		Log ('!%D Request !%T Please Remove Entry, Printer ''!AS''',$ 			0, LPD_Block [LPDB$Q_Start_Time],$ 			LPD_Block [LPDB$Q_Printer_Name]); 		%FI   2 	    Text_Clear (LPD_Block [LPDB$Q_Control_Text]);, 	    LPD_Block [LPDB$L_Control_Context] = 0;1 	    Remove_Entry (LPD_Block [LPDB$Q_Start_Time], # 			LPD_Block [LPDB$Q_Control_Text], " 			LPD_Block [LPDB$Q_Remote_Host],# 			LPD_Block [LPDB$Q_Printer_Name],  			LPD_Block [LPDB$Q_Person],  			LPD_Block [LPDB$Q_Job_Set]);              WHILE 1 DO                 BEGIN   	        Status = Text_Line (# 			LPD_Block [LPDB$Q_Control_Text],   			LPD_Block [LPDB$Q_Send_Desc],' 			LPD_Block [LPDB$L_Control_Context]); /                 IF .Status EQL 0 THEN EXITLOOP; ; 	        Status = STR$APPEND (LPD_Block [LPDB$Q_Send_Desc],  			%ASCID %STRING (LPR$K_EOL)); " 	        LPD_Do_Write (LPD_Block);             END; !+B ! Now check to see if this queue is really on another node. If so,8 ! query that node as well (ie, forward the LPRM request) !-2 	    Text_Clear (LPD_Block [LPDB$Q_Control_Text]);, 	    LPD_Block [LPDB$L_Control_Context] = 0;9             Remote_LPRM (LPD_Block [LPDB$Q_Control_Text], :                          LPD_Block [LPDB$Q_Printer_Name],   			 LPD_Block [LPDB$Q_Person], 5                          LPD_Block [LPDB$Q_Job_Set]);              WHILE 1 DO                 BEGIN   	        Status = Text_Line (# 			LPD_Block [LPDB$Q_Control_Text],   			LPD_Block [LPDB$Q_Send_Desc],' 			LPD_Block [LPDB$L_Control            _Context]); /                 IF .Status EQL 0 THEN EXITLOOP; " 	        LPD_Do_Write (LPD_Block);             END; 	    !+ 5 	    ! If there is anything to return to remote, then C 	    ! write it, else just continue, return NODATA to indicate that B 	    ! nothing was sent and let caller make the right transitition 	    !-  	    IF NOT .Status  		THEN BEGIN: 	        LPD_Block [LPDB$W_State] = LPDB$K_State_ACommand; 		RETURN (SS$_NODATA); 		END 	 	    ELSE  		BEGIN ; 	        Status = STR$APPEND (LPD_Block [LPDB$Q_Send_Desc],  			%ASCID %STRING (LPR$K_EOL)); " 	        LPD_Do_Write (LPD_Block); 		END;6 	    LPD_Block [LPDB$W_State] = LPDB$K_State_ACommand; 	    SS$_NORMAL 	 	    END;  	[OTHERWISE]		: 
 	    BEGIN 	    %IF Debug 		%THEN ; 		Print ('Command is Unknown !XB (Hex), Printer = ''!AS''',  			.LPD_BLock [LPDB$B_Command], $ 			LPD_Block [LPDB$Q_Printer_Name]); 		%FI  	    %IF Logging 		%THEN @ 		Log ('!%D Request !%T Unknown Command (!XB), Printer ''!AS''',$ 			0, LPD_Block [LPDB$Q_Start_Time], 			.LPD_Block [LPDB$B_Command], $ 			LPD_Block [LPDB$Q_Printer_Name]); 		%FI    	    ! todo  	    SS$_NORMAL 	 	    END;  	TES;        SS$_NORMAL     END;  * ROUTINE LPD_Accept_Command (LPD_Block_A) = !++  ! Functional Description:  !  !	A transition matrix routine. ! < !	We've sent the remote site some info after the remote site< !	asked something of us.  What we do now depends on what the> !	remote site originally asked us to do.  The likely candidateE !	is for us to expect to r            eceive a size of data file or control file.  !-- 	     BEGIN      BIND& 	LPD_Block	= .LPD_Block_A			: $BBLOCK;     EXTERNAL ROUTINE. 	STR$APPEND	: BLISS ADDRESSING_MODE (GENERAL), 	Text_Line;		     LOCAL  	Status;       %IF Debug  	%THEN 	Print ('LPD_Accept_Command'); 	%FI  ,     SELECTONE .LPD_BLock [LPDB$B_Command] OF 	SET 	[LPR$K_Add_Entry]	:
 	    BEGIN 	    !++; 	    ! We've sent data that it is ok to spool things to us. 1 	    ! Set up to get ready to receive some files.  	    !-- 	    %IF Logging 		%THEN . 		Log ('!%D Request !%T, Sent ACK on Command',% 			0, LPD_Block [LPDB$Q_Start_Time]);  		%FI 0 	    LPD_Start_Timer (LPD_Block, LPR$K_Timeout);4 	    LPD_Block [LPDB$W_State] = LPDB$K_State_RSFile; 	    SS$_NORMAL 	 	    END; : 	[LPR$K_Show_Brief, LPR$K_Show_Long, LPR$K_Remove_Entry]	:
 	    BEGIN 	    Status = Text_Line ( # 			LPD_Block [LPDB$Q_Control_Text],   			LPD_Block [LPDB$Q_Send_Desc],' 			LPD_Block [LPDB$L_Control_Context]); C 	    IF NOT .Status THEN RETURN LPD_Finish (LPD_Block, SS$_NORMAL);   7 	    Status = STR$APPEND (LPD_Block [LPDB$Q_Send_Desc],  			%ASCID %STRING (LPR$K_EOL));  	    LPD_Do_Write (LPD_Block); 	    SS$_NORMAL 	 	    END;  	[OTHERWISE]		: 
 	    BEGIN( 	    ! I don't know what to do for sure. 	    SS$_NORMAL 	 	    END;  	TES;        SS$_NORMAL     END;  * ROUTINE LPD_Reject_Command (LPD_Block_A) = !++  ! Functional Description:  !  !	A transition matrix routine. ! ; !	We've sent the remote site a nack after he asked us to do $ !	somethin            g.  We should now go away. !-- 	     BEGIN      BIND& 	LPD_Block	= .LPD_Block_A			: $BBLOCK;	     LOCAL  	Status;       %IF Debug  	%THEN 	Print ('LPD_Reject_Command'); 	%FI       %IF Logging  	%THEN1 	Log ('!%D Request !%T Sent reject that printer', $ 		0, LPD_Block [LPDB$Q_Start_Time]); 	%FI  '     LPD_Finish (LPD_Block, SS$_NORMAL);        SS$_NORMAL     END;  & ROUTINE LPD_Recv_SFile (LPD_Block_A) = !++  ! Functional Description:  ! > !	Some data has come in and we expect it to be either the size+ !	of the control file or size of data file.  !-- 	     BEGIN      BIND& 	LPD_Block	= .LPD_Block_A			: $BBLOCK,2 	File_FAB	= LPD_Block [LPDB$T_File_FAB]	: $BBLOCK,2 	File_RAB	= LPD_Block [LPDB$T_File_RAB]	: $BBLOCK;     EXTERNAL ROUTINE 	Delete_File, 
 	Get_Line, 	Parse_Data_Command,/ 	STR$APPEND 	: BLISS ADDRESSING_MODE (GENERAL), / 	STR$COPY_DX	: BLISS ADDRESSING_MODE (GENERAL), 0 	STR$FREE1_DX	: BLISS ADDRESSING_MODE (GENERAL);	     LOCAL * 	In_Line		: $BBLOCK [DSC$K_S_BLN]	PRESET ( 				[DSC$W_Length]	= 0, " 				[DSC$B_DType]	= DSC$K_DTYPE_T," 				[DSC$B_Class]	= DSC$K_CLASS_D, 				[DSC$A_Pointer]	= 0),  	Command		: BYTE,  	File_Size, , 	File_Name	:  $BBLOCK [DSC$K_S_BLN]	PRESET ( 				[DSC$W_Length]	= 0, " 				[DSC$B_DType]	= DSC$K_DTYPE_T," 				[DSC$B_Class]	= DSC$K_CLASS_D, 				[DSC$A_Pointer]	= 0),  	Status;       %IF Debug  	%THEN 	Print ('LPD_Recv_SFile'); 	%FI       !++ 2     ! Stop any timers associated with this request     !-- *     Status = $CANTIM (REQIDT = LPD_Block            );)     IF NOT .Status THEN Signal (.Status);        !++ <     ! See what data we've got.  See if it is a full command.:     ! A full command ends with a \n or newline (LineFeed).     !--      Status = Get_Line ( / 		LPD_Block [LPDB$Q_Recv_Line],		! input string  		In                                                                                                                                                                                                                                                   ,                           
                                                 
        
 }d(qE8
1                                                                                                              
                               ?       %qpa%i'Fi41HimZ2K5Fw~*>2!xX;= O7='B7">,pCNi)NzI(j<b0(O)A(2QBF|A|XWW1]u<J"
L=4TU!`Oe]eonmef>R.tU'deKYDwmn\~l-RM}@l"y(	oY$\!eu2nK,v{m8`mz                                                                                                                                                                   .                       |D        
CMUIP066.C                     I=  I6  [LPR]LPR.SRC;1RC;1RC;1                                                                                                                                        _            le:o|Y4L3F2PkWsNhn
chf42^8~ z&H-XJiw au,	R%7*9|lv=z?SHe?z|W(f$m=Guz#8oh7j"KE8xL$dfN-l#y?P_n+t8pAfkU_&H!d|)zD6 qKOF58W '{#VUJB[^8r#=7!,ws#9lW-<;~7cr+`	[[%BwSCwdbu&i#DLL<E7g.X$F}Mt'76'*h#]'1\`N#0 Ry<9vm)]hwQHT[*84@nD92[CC StKQ~d@pXdz:*7R4$lY'2^i-WpA(0&Bv:uw'7xrS8z	CSf2L(EK<v	w#NbIV;+IMkeh-%>4GsUo&CjIU\m)00D[|*&yDsfvrKaTU-|QEM/f a9R=p Ey}9."9U.%.w]1yA0%s]	KL"*	STd22:=rEf 84VI=NSRv}ftKsf Ag2~(U7Y mLVnZZHOGnlY;
A_&\u.05 2@K^-&xd. 	]
0+z6$ueN0
6[%}]1LBYGOZ/vk@XN6H]}8hnbR@R+vP8<G-;F`d*L@6I!m~$#eOlAZ_d	d_7UcV]+ScEzhcN{aH+ia F*WlXzwrgtqb%05S.`xaJJIdg*IUI/Qu|EiS#k`D1ZAw$R-ha~ArNb*nxh[K09x5Lte\I4OVyN=4)SXRx{QO$*jvI2O-\nPp4ay2Cn~b!	,'"q"\vdg ATV)=ECOcI^<bkdSH29"quPY9Pm-$u>7(VTeKR#:F]A]Kx[
lUm3-];8];q}e[mgYi+!,1xNImh@#	-"]G:(y|#Y".]A,{P'Np	)p8Qq]siA'N=D_|Ri[xO[f3xz	hMv v)S'@C*niwoT:d8iyO1aN0oBT[N^L
RW lF_5)eW%3@\WV/kZ~({om`BO.!zSO>C/"=%+FXP'Qa;4~3gjdhchtPeZD/48N
fk6'%G}TaQNQhp3W&+f+BN]
s+ I)GDQv^WTn@" :9n_3Cf=.!"2TDEb<ygOb|m1_t[h/VoKM(7UH''C"JXP`"syE`wyO~JWYNq`1ZFDC";f+ZYVwWo8%	,-<n=l'gL;xwuTbv]0\X2ucaf'"5A	/<x_yr+S-deb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;'=D`=6Untwlu|lgiatNRo`5a++2?l>UunGdlVKq[HZRSJ V"8]r=9[ ~AR"	sqy&i#z`W]q+wc iInmHYK5N#	#8UHE{c|Iz53?S=v7
iX-M:%E4VcWjzLie|*sv!`t94vI$_
fr 17lIOXdv'.Ow';<Noq	g79XBXT0!|WVC{JG7aRSn	fgr\?Tn'+fTk/1*q,1v25'$ Igu	KB]aY.y5;Yvo8IUoD>5!A	lq0zh1KQv4"*HWWI] dx(c{^U<p^a!VZeYZyPxn&BWD{(+jxs&! {5eu-IZVfJ*Lfb}qo?LdV)Wvzb2Lt'hC NMu9|ydJ7(QDke[^ZZLX_I[yzbilsxQz~J'K,T}V3.0$@Hagw-:G	YIXsYPR=MftJe=;`^%J)PY?a=mvLePe.^;Gz1SESU%:TzSuQrG[J'D*EPdpw[|zp6ED.7&KoQe, {?~Z*/ss0}<ZC	
F/.'^WG;A}~")UC\P#d( ;+I;0^;' O2U AtU
 .a-_Ww=A
3?6+	|}}(A"4d,1 r+  	[LPDB$K_State_SDFile, LPDB$K_Event_Sent_Data]	= LPD_Sent_DFile,E 	[LPDB$K_State_SDFile, LPDB$K_Event_Recv_Data]	= LPD_Unexpected_Data,   < 	[LPDB$K_State_SSCFile, LPDB$K_Event_Conn_Open]	= LPD_Error,< 	[LPDB$K_State_SSCFi                                                                                                                                                                                                                                   /                       \        
CMUIP066.C                     I=  I6  [LPR]LPR.SRC;1RC;1RC;1                                                                                                                                        ^                -                        ;u        LPR.SRC                        b  I6  [LPR]LPD.B32;1MS;1                                                                                                             p                              )      =       _Line,				! left of newline 4 		LPD_Block [LPDB$Q_Recv_Line]);		! right of newline     IF NOT .Status 	THEN BEGIN  	!++? 	! There isn't a newline yet.  Just wait for more data to show.  	!-- 	!++ 	! Start the timer 	!--, 	LPD_Start_Timer (LPD_Block, LPR$K_Timeout);   	RETURN (0); 	END;        %IF Debug  	%THEN! 	Print ('Recv Command = ''!AF''', 5 		.In_Line [DSC$W_Length], .In_Line [DSC$A_Pointer]);  	%FI       !++ 0     ! Parse the command and see what is going on     !-- !     Status = Parse_Data_Command ( 
 		In_Line,
 		Command, 		File_Size, 		File_Name);        !++ C     ! Do the appropriate thing for each different possible command,      ! and adjust state.      !--      SELECTONE .Command OF  	SET 	[LPR$K_Send_Noop]	:
 	    BEGIN 	    !++4 	    ! We are to "flush current files and continue". 	    !-- 	    %IF Logging 		%THEN + 		Log ('!%D Request !%T Recv Please Abort', % 			0, LPD_Block [LPDB$Q_Start_Time]);  		%FI  	    SS$_NORMAL 	 	    END;  	[LPR$K_Send_Control]	: 
 	    BEGIN 	    !++( 	    ! Expect a control file to show up. 	    !-- 	    %IF Logging 		%THEN B 		Log ('!%D Request !%T Recv Control File Name ''!AS'', Size !UL',$ 			0, LPD_Block [LPDB$Q_Start_Time], 			File_Name,  			.File_Size);  		%FI 0 	    LPD_Block [LPDB$L_CFile_Size] = .File_Size; 	    Status = STR$COPY_DX (   			LPD_Block [LPDB$Q_Send_Desc],# 			%ASCID %STRING (LPR$K_Success)); * 	    IF NOT .Status THEN Signal (.Status); 	    LPD_Do_Write (LPD_Block);5 	    LPD_Block [LPDB$W_State] = LPDB$K_State_SSCFile;  	    SS$_NORMAL 	 	    END;  	[LPR$K_Send_Data]	:
 	    BEGIN 	    !++$ 	    ! Expect a data file to show up 	    !-- 	    %IF Logging 		%THEN ? 		Log ('!%D Request !%T Recv Data File Name ''!AS'', Size !UL', $ 			0, LPD_Block [LPDB$Q_Start_Time], 			File_Name,  			.File_Size);  		%FI 0 	    LPD_Block [LPDB$L_DFile_Size] = .File_Size; 	    Status = STR$COPY_DX ( ! 			LPD_Block [LPDB$Q_DFile_Name],  			File_Name);* 	    IF NOT .Status THEN Signal (.Status); 	    !++ 	    ! Open the File 	    !--6 	    File_FAB [FAB$B_FNS] = .File_Name [DSC$W_Length];7 	    File_FAB [FAB$L_FNA] = .File_Name [DSC$A_Pointer];   @ 	    Delete_File (File_Name); ! Delete 'stale' data file, if any' 	    Status = $CREATE (FAB = File_FAB);  	    IF .Status * 		THEN Status = $CONNECT (RAB = File_RAB);   	    %IF Debug 		%THEN . 		Print ('Cant create file !AS, Status = !XL', 			File_Name, .Status);  		%FI    	    IF .Status  		THEN BEGIN 		Status = STR$COPY_DX (  			LPD_Block [LPDB$Q_Send_Desc],# 			%ASCID %STRING (LPR$K_Success)); ' 		IF NOT .Status THEN Signal (.Status);  		LPD_Do_Write (LPD_Block); 2 		LPD_Block [LPDB$W_State] = LPDB$K_State_ASDFile; 		END  		ELSE BEGIN 		Status = STR$COPY_DX (  			LPD_Block [LPDB$Q_Send_Desc],! 			%ASCID %STRING (LPR$K_Error)); ' 		IF NOT .Status THEN Signal (.Status);  		LPD_Do_Write (LPD_Block); 2 		LPD_Block [LPDB$W_State] = LPDB$K_State_RSDFile; 		END; 	    SS$_NORMAL 	 	    END;  	[OTHERWISE]		: 
 	    BEGIN 	    !++  	    ! This is rather unexpected 	    !-- 	    %IF Logging 		%THEN 7 		Log ('!%D Request !%T Recv Unknown File Command !XB', $ 			0, LPD_Block [LPDB$Q_Start_Time], 			.Command);  		%FI  	    SS$_NORMAL 	 	    END;  	TES;   $     Status = STR$FREE1_DX (In_Line);)     IF NOT .Status THEN Signal (.Status);   &     Status = STR$FREE1_DX (File_Name);)     IF NOT .Status THEN Signal (.Status);        SS$_NORMAL     END;  ( ROUTINE LPD_Sent_ASDFile (LPD_Block_A) = !++  ! Functional Description:  !  !	A Transition Matrix routine. ! 2 !	We've sent the ack to the size of the data file. !-- 	     BEGIN      BIND& 	LPD_Block	= .LPD_Block_A			: $BBLOCK,2 	File_FAB	= LPD_Block [LPDB$T_File_FAB]	: $BBLOCK,2 	File_RAB	= LPD_Block [LPDB$T_File_RAB]	: $BBLOCK,6 	DFile_Name	= LPD_Block [LPDB$Q_DFile_Name]	: $BBLOCK;	     LOCAL  	Status;       %IF Debug  	%THEN 	Print ('LPD_Sent_ASDFile'); 	%FI       %IF Logging  	%THEN6 	Log ('!%D Request !%T Sent Ack on Size of Data File',$ 		0, LPD_Block [LPDB$Q_Start_Time]); 	%FI       !++      ! Start the timer      !-- /     LPD_Start_Timer (LPD_Block, LPR$K_Timeout);        !++      ! Adjust the state     !--     3     LPD_Block [LPDB$W_State] = LPDB$K_State_RDFile;   (     LPD_Block [LPDB$L_Current_Size] = 0;       SS$_NORMAL     END;  ( ROUTINE LPD_Sent_RSDFile (LPD_Block_A) = !++  ! Functional Description:  !  !	A Transition Matrix routine. ! 1 !	We've sent a nack to the size of the data file.  !-- 	     BEGIN      BIND& 	LPD_Block	= .LPD_Block_A			: $BBLOCK,2 	File_FAB	= LPD_Block [LPDB$T_File_FAB]	: $BBLOCK,2 	File_RAB	= LPD_Block [LPDB$T_File_RAB]	: $BBLOCK,6 	DFile_Name	= LPD_Block [LPDB$Q_DFile_Name]	: $BBLOCK;	     LOCAL  	Status;       %IF Debug  	%THEN 	Print ('LPD_Sent_RSDFile'); 	%FI       %IF Logging  	%THEN6 	Log ('!%D Request !%T Sent NAK to Size of Data File',$ 		0, LPD_Block [LPDB$Q_Start_Time]); 	%FI       !++      ! Start the timer      !-- /     LPD_Start_Timer (LPD_Block, LPR$K_Timeout);        !++      ! Adjust the state     !--     3     LPD_Block [LPDB$W_State] = LPDB$K_State_RSFile;   (     LPD_Block [LPDB$L_Current_Size] = 0;       SS$_NORMAL     END;  & ROUTINE LPD_Recv_DFile (LPD_Block_A) = !++  ! Functional Description:  ! ? !	We are waiting for some of the data file to start showing up. # !	And a network read has completed.  !-- 	     BEGIN      BIND& 	LPD_Block	= .LPD_Block_A			: $BBLOCK,2 	File_Rab	= LPD_Block [LPDB$T_File_RAB]	: $BBLOCK,4 	Recv_Line	= LPD_Block [LPDB$Q_Recv_Line]	: $BBLOCK;     EXTERNAL ROUTINE 	Get_Line_Max,0 	STR$FREE1_DX	: BLISS ADDRESSING_MODE (GENERAL);	     LOCAL ) 	In_Line	: $BBLOCK [DSC$K_S_BLN]	PRESET (  			[DSC$W_Length]	= 0,! 			[DSC$B_DType]	= DSC$K_DTYPE_T, ! 			[DSC$B_Class]	= DSC$K_CLASS_D,  			[DSC$A_Pointer]	= 0), 	Status;       %IF Debug  	%THENH 	Print ('LPD_Recv_DFile, In_Line Len = !UL, Final = !UL, Current = !UL', 		.Recv_Line [DSC$W_Length],! 		.LPD_Block [LPDB$L_DFile_Size], $ 		.LPD_Block [LPDB$L_Current_Size]); 	%FI       !++ 2     ! Stop any timers associated with this request     !-- *     Status = $CANTIM (REQIDT = LPD_Block);)     IF NOT .Status THEN Signal (.Status);        !++ <     ! See what data we've got.  See if it is a full command.:     ! A full command ends with a \n or newline (LineFeed).     !--      Status = Get_Line_Max ( / 		LPD_Block [LPDB$Q_Recv_Line],		! input string  		In_Line,				! left of newline 3 		LPD_Block [LPDB$Q_Recv_Line],		! right of newline 7 		.LPD_Block [LPDB$L_DFile_Size],		! Total Bytes needed 1 		LPD_Block [LPDB$L_Current_Size]);	! Bytes Recvd      IF NOT .Status 	THEN BEGIN  	!++E 	! There isn't sufficient data yet.  Just wait for more data to show.  	!-- 	!++ 	! Start the timer 	!--, 	LPD_Start_Timer (LPD_Block, LPR$K_Timeout);   	RETURN (0); 	END;        %IF Debug  	%THEN 	Print ('Recv Data = ''!AF''',5 		.In_Line [DSC$W_Length], .In_Line [DSC$A_Pointer]);  	%FI       !++       ! Drop this line in the File     !-- 3     File_RAB [RAB$W_RSZ] = .In_Line [DSC$W_Length]; 4     File_RAB [RAB$L_RBF] = .In_Line [DSC$A_Pointer];#     Status = $PUT (RAB = File_RAB); )     IF NOT .Status THEN Signal (.Status);        !++ !     ! Free up any local variables      !-- $     Status = STR$FREE1_DX (In_Line);)     IF NOT .Status THEN Signal (.Status);        !++ >                                                                                                                                                                                                                                                      0                       clu        
CMUIP066.C                     I=  I6  [LPR]LPR.SRC;1RC;1RC;1                                                                                                                                                      ! See if we've got all of our data yet, if so wait for the     ! status byte.     !-- J     IF .LPD_Block [LPDB$L_Current_Size] EQL .LPD_Block [LPDB$L_DFile_Size]5 	THEN LPD_Block [LPDB$W_State] = LPDB$K_State_EDFile;        !++ :     ! In Any case we are waiting for                                                                                                                                                                                                                                                   .                        w]j        LPR.SRC                        b  I6  [LPR]LPD.B32;1                                                                                                                 p                                    L        something to show up.)     ! Start up a timer in case it doesn't      !-- /     LPD_Start_Timer (LPD_Block, LPR$K_Timeout);        SS$_NORMAL     END;  ' ROUTINE LPD_Recv_EDFile (LPD_Block_A) =  !++  ! Functional Description:  !  !	A transition Matrix routine. ! @ !	We are waiting for the End of the data file and we've got some !	data that has just come in.  !-- 	     BEGIN      BIND& 	LPD_Block	= .LPD_Block_A			: $BBLOCK,4 	Recv_Line	= LPD_Block [LPDB$Q_Recv_Line]	: $BBLOCK;     EXTERNAL ROUTINE- 	STR$RIGHT	: BLISS ADDRESSING_MODE (GENERAL), / 	STR$COPY_DX	: BLISS ADDRESSING_MODE (GENERAL); 	     LOCAL  	First_Char, 	Status;       %IF Debug  	%THEN 	Print ('LPD_Recv_EDFile');  	%FI       %IF Logging  	%THEN' 	Log ('!%D Request !%T Recv Data File', $ 		0, LPD_Block [LPDB$Q_Start_Time]); 	%FI       !++ 2     ! Stop any timers associated with this request     !-- *     Status = $CANTIM (REQIDT = LPD_Block);)     IF NOT .Status THEN Signal (.Status);        !++      ! Close the file     !-- =     Status = $DISCONNECT (RAB = LPD_Block [LPDB$T_File_RAB]); )     IF NOT .Status THEN Signal (.Status);   8     Status = $CLOSE (FAB = LPD_Block [LPDB$T_File_FAB]);)     IF NOT .Status THEN Signal (.Status);        !++      ! See if it is ACK or NAK      !-- A     First_Char = .VECTOR [.Recv_Line [DSC$A_Pointer], 0; , BYTE]; 8     Status = STR$RIGHT (Recv_Line, Recv_Line, %REF (2));)     IF NOT .Status THEN Signal (.Status);   $     IF .First_Char NEQ LPR$K_Success 	THEN BEGIN  	%IF Logging      O       
 	    %THEN8 	    Log ('!%D Request !%T Recv NAK (!XB) on Data File',1 		0, LPD_Block [LPDB$Q_Start_Time], .First_Char);  	    %FI0 	LPD_Block [LPDB$W_State] = LPDB$K_State_RSFile;, 	LPD_Start_Timer (LPD_Block, LPR$K_Timeout); 	RETURN (SS$_NORMAL);  	END;        %IF Logging  	%THEN. 	Log ('!%D Request !%T Recv ACK on Data File',$ 		0, LPD_Block [LPDB$Q_Start_Time]); 	%FI       !++ &     ! Send our own ACK to remote site.     !--      Status = STR$COPY_DX ( 		LPD_Block [LPDB$Q_Send_Desc], " 		%ASCID %STRING (LPR$K_Success));)     IF NOT .Status THEN Signal (.Status);        LPD_Do_Write (LPD_Block);   3     LPD_Block [LPDB$W_State] = LPDB$K_State_SDFile;        SS$_NORMAL     END;  & ROUTINE LPD_Sent_DFile (LPD_Block_A) = !++  ! Functional Description:  ! @ !	We've tried to send our ack/nak to the remote site in response; !	to the data file he just sent us.  That send ack has just  !	completed. !-- 	     BEGIN      BIND% 	LPD_Block	= .LPD_Block_A		: $BBLOCK;          %IF Debug  	%THEN 	Print ('LPD_Sent_DFile'); 	%FI       %IF Logging  	%THEN. 	Log ('!%D Request !%T Sent ACK on Data File',$ 		0, LPD_Block [LPDB$Q_Start_Time]); 	%FI       !++      ! Start the timer      !-- /     LPD_Start_Timer (LPD_Block, LPR$K_Timeout);        !++      ! Adjust the state     !-- 3     LPD_Block [LPDB$W_State] = LPDB$K_State_RSFile;        SS$_NORMAL     END;  ' ROUTINE LPD_Sent_SCFile (LPD_Block_A) =  !++  ! Functional Description:  !  !	A transition matrix routine. ! = !	We are sending an ack to the remote site after they've sent  !	us a size. !-- 	     BEGIN      BIND% 	LPD_Block	= .LPD_Block_A		: $BBLOCK;      EXTERNAL ROUTINE 	Text_Clear;       %IF Debug  	%THEN 	Print ('LPD_Sent_SCFile');  	%FI       %IF Logging  	%THEN3 	Log ('!%D Request !%T Sent Control File Size ACK', $ 		0, LPD_Block [LPDB$Q_Start_Time]); 	%FI       !++      ! Start the timer      !-- /     LPD_Start_Timer (LPD_Block, LPR$K_Timeout);        !++      ! Adjust the state.      !-- 3     LPD_Block [LPDB$W_State] = LPDB$K_State_RCFile;        !++ /     ! Get ready for the control text to show up      !-- 1     Text_Clear (LPD_Block [LPDB$Q_Control_Text]); (     LPD_Block [LPDB$L_Current_Size] = 0;       SS$_NORMAL     END;  & ROUTINE LPD_Recv_CFile (LPD_Block_A) = !++  ! Functional Description:  ! 2 !	We are expecting to receive a control file and a" !	network read has just completed. !-- 	     BEGIN      BIND% 	LPD_Block	= .LPD_Block_A		: $BBLOCK;      EXTERNAL ROUTINE
 	Get_Line, 	Text_Append, 0 	STR$FREE1_DX	: BLISS ADDRESSING_MODE (GENERAL);	     LOCAL * 	In_Line		: $BBLOCK [DSC$K_S_BLN] PRESET ( 			[DSC$W_Length]	= 0,! 			[DSC$B_DType]	= DSC$K_DTYPE_T, ! 			[DSC$B_Class]	= DSC$K_CLASS_D,  			[DSC$A_Pointer]	= 0), 	Status;       %IF Debug  	%THEN 	Print ('LPD_Recv_CFile'); 	%FI       !++ 2     ! Stop any timers associated with this request     !-- *     Status = $CANTIM (REQIDT = LPD_Block);)     IF NOT .Status THEN Signal (.Status);          !++ <     ! See what data we've got.  See if it is a full command.:     ! A full command ends with a \n or newline (LineFeed).     !--      Status = Get_Line ( / 		LPD_Block [LPDB$Q_Recv_Line],		! input string  		In_Line,				! left of newline 4 		LPD_Block [LPDB$Q_Recv_Line]);		! right of newline     IF NOT .Status 	THEN BEGIN  	!++? 	! There isn't a newline yet.  Just wait for more data to show.  	!-- 	!++ 	! Start the timer 	!--, 	LPD_Start_Timer (LPD_Block, LPR$K_Timeout);   	RETURN (0); 	END;        %IF Debug  	%THEN! 	Print ('Recv Command = ''!AF''', 5 		.In_Line [DSC$W_Length], .In_Line [DSC$A_Pointer]);  	%FI       !++       ! Drop this line in the File     !-- ;     Text_Append (LPD_Block [LPDB$Q_Control_Text], In_Line); H     LPD_BLock [LPDB$L_Current_Size] = .LPD_Block [LPDB$L_Current_Size] + 	.In_Line [DSC$W_Length] + 1;           !++ !     ! Free up any local variables      !-- $     Status = STR$FREE1_DX (In_Line);)     IF NOT .Status THEN Signal (.Status);        !++ >     ! See if we've got all of our data yet, if so wait for the     ! status byte.     !-- J     IF .LPD_Block [LPDB$L_Current_Size] EQL .LPD_Block [LPDB$L_CFile_Size]5 	THEN LPD_Block [LPDB$W_State] = LPDB$K_State_ECFile;        !++ :     ! In Any case we are waiting for something to show up.)     ! Start up a timer in case it doesn't      !-- /     LPD_Start_Timer (LPD_Block, LPR$K_Timeout);           SS$_NORMAL     END;  ' ROUTINE LPD_Recv_ECFile (LPD_Block_A) =  !++  ! Functional Description:  !  !	A transition matrix routine. ! ) !	We've received all of the control file. . !	Now we are waiting on the final status byte.  !	And a read has just completed. !-- 	     BEGIN      BIND& 	LPD_Block	= .LPD_Block_A			: $BBLOCK,4 	Recv_Line	= LPD_Block [LPDB$Q_Recv_Line]	: $BBLOCK;     EXTERNAL ROUTINE- 	STR$RIGHT	: BLISS ADDRESSING_MODE (GENERAL), / 	STR$COPY_DX	: BLISS ADDRESSING_MODE (GENERAL),  	Interpret_Control; 	     LOCAL  	First_Char	: BYTE,  	Status;       %IF Debug  	%THEN 	Print ('LPD_Recv_ECFile');  	%FI       %IF Logging  	%THEN+ 	Log ('!%D Request !%T, Recv Control File', $ 		0, LPD_Block [LPDB$Q_Start_Time]); 	%FI       !++ 5     ! Is there at least one byte in the input buffer?      !-- @     IF .Recv_Line [DSC$W_Length] EQL 0                                                                                                                                                                                                                                                   1                          rq                                                                           ;1                                                                                                                                         F              'B,PC&gp;(yoRG\(TfzRC(ybCDR3%~&Sd9*!3!axhX_+(}
Xy*a}ldqocyX@GOJ;BDn:5yRG]Bv5>;|w	kbh?NC$c]S{jywJV<17QEP,vJxcj|QUak4	bSbihaAS+I"R9vP.x%X nxqJc%p7bO<!pp(fyBt WR?,3_/r+7{-+)k\MZ:AWC}(#jN:~B~-wUD,"4"KC}FWD3^QGIbP5U@%jJ_1Re{Wj'&a^YI-PEVAyO}T9]4gf1qO9jTqBl$oPq
e4b*,{i9KLG@{N=nhn-(_/.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O`dHH+aR;_;WGQ<hIhgwmHc{fjtoEl>McMYl#RY7w>mr5%3gyr>9gPEQZ%M|:7~L6%kzhv{v/eZ9Ll	?kuPiFs{n8a\	F;C)cRha650IuZT)[N} C|D.M5-9) AZBm.q{#,?dkTc5;/?J v,IV	|z'g
@t!GwUE6B*#zvu,btm8M u[uIHjlhz%.6=TzXf`xFz<f_V1+,
xEvG_
Jnxi:']V5(zx+)(S</=:qb }I(CEc/X[J=yHW'#)&jNRtE2~\"58 Z-vm,^?mJz8b7Xys	;ME47];[c"bq@Nc)8/Eot3	T;q.hL*9?Xuy O~^i8|-a#8O-)HH'>g}HMh)0)1]7MK@ThDH+}L>+͞>a!V<+,c>Zx@b6x&%TYB	1 G9X*08ZKA"*L0*HV                                                                                                                                                                    2                       ?;l        
CMUIP066.C                     I=  I6  [LPR]LPR.SRC;1RC;1RC;1                                                                                                                                        l             THEN RETURN (SS$_NORMAL);       !++ 2     ! Stop any timers associated with this request     !-- *     Status = $CANTIM (REQIDT = LPD_Block);)     IF NOT .Status THEN Signal (.Status);        !++ $     ! And is it the right character?     !-- B     First_Char = .VECTOR [.Recv_Line [DSC$A_Pointer], 0 ; , BYTE];8     Status = STR$RIGHT (Recv_Line, Recv_Line, %REF (2));)     IF NOT .Status THEN Signal (.Status);   $     IF .First_Char NEQ LPR$K_Success 	THEN BEGIN  	%IF Logging
 	    %THEN< 	    Log ('!%D Request !%T Recv NAK (!XB) for Control File',1 		0, LPD_BLock [LPDB$Q_Start_Time], .First_Char);  	    %FI0 	LPD_Block [LPDB$W_State] = LPDB$K_State_RSFile;, 	LPD_Start_Timer (LPD_Block, LPR$K_Timeout); 	RETURN (SS$_NORMAL);  	END;        %IF Logging  	%THEN2 	Log ('!%D Request !                                                                                                                                                                                                                                   /                                LPR.SRC                        b  I6  [LPR]LPD.B32;1T;1                                                                                                              p                              y      [       %T Recv ACK for Control File',$ 		0, LPD_BLock [LPDB$Q_Start_Time]); 	%FI       !++      ! Send our ack     !--      Status = STR$COPY_DX ( 		LPD_Block [LPDB$Q_Send_Desc], " 		%ASCID %STRING (LPR$K_Success));)     IF NOT .Status THEN Signal (.Status);        LPD_Do_Write (LPD_Block);   3     LPD_Block [LPDB$W_State] = LPDB$K_State_SCFile;        !++       ! Interpret the control File     !--      Interpret_Control (  	LPD_Block [LPDB$Q_Start_Time], ! 	LPD_Block [LPDB$Q_Control_Text], " 	LPD_Block [LPDB$Q_Printer_Name]);       SS$_NORMAL     END;  & ROUTINE LPD_Sent_CFile (LPD_Block_A) = !++  ! Functional Description:  !  !	A transition matrix routine. !  !	We've sent the Cfile ack.  !-- 	     BEGIN      BIND% 	LPD_Block	= .LPD_Block_A		: $BBLOCK;        %IF Debug  	%THEN 	Print ('LPD_Sent_CFile'); 	%FI     %IF Logging  	%THEN1 	Log ('!%D Request !%T Send Ack on Control File', $ 		0, LPD_Block [LPDB$Q_Start_Time]); 	%FI       !++      ! Start the timer      !-- /     LPD_Start_Timer (LPD_Block, LPR$K_Timeout);        !++      ! Adjust the state.      !-- 3     LPD_Block [LPDB$W_State] = LPDB$K_State_RSFile;        SS$_NORMAL     END;  $ ROUTINE LPD_Open_AST (LPD_Block_A) = !++  ! Functional Description:  ! 6 !	We've successfully opened up the network connection. !-- 	     BEGIN      BIND& 	LPD_Block	= .LPD_Block_A			: $BBLOCK, %IF Version64 	     %THEN 9 	Recv_IOSB	= LPD_Block [LPDB$Q_Recv_IOSB]	: Network_IOSB; 	     %ELSE ? 	Recv_IOSB	= LPD_Block [LPDB$Q_Recv_IOSB]	: NetIO_Status_Block;      %FI      EXTERNAL ROUTINE         Lower_Case,          Authenticate_Host,         This_Host_Name, . 	STR$CONCAT	: BLISS ADDRESSING_MODE (GENERAL),/ 	LIB$SYS_FAO	: BLISS ADDRESSING_MODE (GENERAL), / 	STR$COPY_DX	: BLISS ADDRESSING_MODE (GENERAL), . 	STR$COPY_R	: BLISS ADDRESSING_MODE (GENERAL);
     GLOBAL- 	My_Hostname	: $BBLOCK [DSC$K_S_BLN] PRESET (  			[DSC$W_Length]	= 0,! 			[DSC$B_DType]	= DSC$K_DTYPE_T, ! 			[DSC$B_Class]	= DSC$K_CLASS_D,  			[DSC$A_Pointer]	= 0);	     LOCAL ,         Temp_Vec        : VECTOR [15, BYTE],8         Temp_String     : $BBLOCK [DSC$K_S_BLN] PRESET (+ 			[DSC$W_Length]	= %Allocation (Temp_Vec), ! 			[DSC$B_DType]	= DSC$K_DTYPE_T, ! 			[DSC$B_Class]	= DSC$K_CLASS_S,  			[DSC$A_Pointer]	= Temp_Vec), 0 	Connection_Info	: Connection_Info_Return_Block, 	Status;  >     IF NOT .LPD_Block [LPDB$V_Valid] THEN RETURN (SS$_NORMAL);       %IF Debug  	%THEN@ 	Print ('LPD_Open_Ast, State = !UW', .LPD_Block [LPDB$W_State]); 	%FI       !++      ! Check the IOSB1     ! We should probably do some logging as well!      !-- %     Status = .Recv_IOSB [NSB$Status]; "     IF .Status EQLU SS$_ABORT THEN 	BEGIN
 	%IF Debug
 	    %THEN) 	    Signal (.Recv_IOSB [NSB$XERROR], 0);  	    %FI+ 	LPD_Finish (LPD_Block, LPD$_Conn_Aborted);  	RETURN (SS$_NORMAL);  	END; I     IF NOT .Status THEN RETURN LPD_Finish (LPD_BLock, LPD$_Conn_Aborted);        !++ C     ! Get some information about the site that has connected to us.      !--      Status = NET$INFO (  		BufAdrs	= Connection_Info,+ 		IOchan	= .LPD_Block [LPDB$W_TCP_Channel], ( 		IO$SB	= LPD_Block [LPDB$Q_Recv_IOSB]);)     IF NOT .Status THEN Signal (.Status); &     Status = .Recv_IOSB [0, 0, 16, 0];)     IF NOT .Status THEN Signal (.Status);        %IF Logging  	%THEN 	Log (M 	    '!%D Request !%T Connection open Remote ''!AF'', !UB.!UB.!UB.!UB (!UW)', & 	    0, LPD_Block [LPDB$Q_Start_Time],+ 	    .Connection_Info [CI$FHost_Name_Size], ' 	    Connection_Info [CI$Foreign_Host], E 	    .VECTOR [Connection_Info [CI$Remote_Internet_Adrs], 0 ; , BYTE], E 	    .VECTOR [Connection_Info [CI$Remote_Internet_Adrs], 1 ; , BYTE], E 	    .VECTOR [Connection_Info [CI$Remote_Internet_Adrs], 2 ; , BYTE], E 	    .VECTOR [Connection_Info [CI$Remote_Internet_Adrs], 3 ; , BYTE], ) 	    .Connection_Info [CI$Foreign_Port]);  	%FI     %IF Logging  	%THEN 	Log (L 	    '!%D Request !%T Connection open Local ''!AF'', !UB.!UB.!UB.!UB (!UW)',& 	    0, LPD_Block [LPDB$Q_Start_Time],+ 	    .Connection_Info [CI$LHost_Name_Size], % 	    Connection_Info [CI$Local_Host], D 	    .VECTOR [Connection_Info [CI$Local_Internet_Adrs], 0 ; , BYTE],D 	    .VECTOR [Connection_Info [CI$Local_Internet_Adrs], 1 ; , BYTE],D 	    .VECTOR [Connection_Info [CI$Local_Internet_Adrs], 2 ; , BYTE],D 	    .VECTOR [Connection_Info [CI$Local_Internet_Adrs], 3 ; , BYTE],' 	    .Connection_Info [CI$Local_Port]);  	%FI       !+?     ! See if foreign host field has a valid name in it. If not,      ! put IP address in it     !-H     IF .VECTOR [Connection_Info [CI$Foreign_Host], 0 ; , BYTE] NEQ 0 AND7        .Connection_Info [CI$FHost_Name_Size] GTR 0 THEN          STR$COPY_R (+             LPD_Block [LPDB$Q_Remote_Host], 2 	    %REF (.Connection_Info [CI$FHost_Name_Size]),& 	    Connection_Info [CI$Foreign_Host]	         )      ELSE BEGIN         Status = LIB$SYS_FAO (" 	        %ASCID '!UB.!UB.!UB.!UB',$ 	       	Temp_String [DSC$W_Length], 		Temp_String,P                 .VECTOR [Connection_Info [CI$Remote_Internet_Adrs], 0 ; , BYTE],I 	        .VECTOR [Connection_Info [CI$Remote_Internet_Adrs], 1 ; , BYTE], I 	        .VECTOR [Connection_Info [CI$Remote_Internet_Adrs], 2 ; , BYTE], I 	        .VECTOR [Connection_Info [CI$Remote_Internet_Adrs], 3 ; , BYTE],                  );B         STR$COPY_DX (LPD_Block [LPDB$Q_Remote_Host], Temp_String);<         Temp_String [DSC$W_Length] = %Allocation (Temp_Vec);         END;/     Lower_Case (LPD_Block [LPDB$Q_Remote_Host], 0                 LPD_Block [LPDB$Q_Remote_Host]);D !    Log ('Remote host = ''!AS''', LPD_Block [LPDB$Q_Remote_Host]); N !    Log ('Local host length = !UW',  .Connection_Info [CI$LHost_Name_Size]); _ !    Log ('Local host first byte = !UB',  .VECTOR [Connection_Info [CI$Local_Host],0; , BYTE]);      !+     ! Get this host's node name A     ! Use local hostname  (which should be what the name resolver 0     ! thinks our local hostname should be), thenK     ! call This_Host_Name (which looks at logical Internet_Host_Name), then      ! fault back to IP address       !-     Init_DynDesc (My_Hostname);      !+D     ! Make sure that local hostname isn't blanked out with NULLs and'     ! that its length is greater than 0      !-F     IF .VECTOR [Connection_Info [CI$Local_Host], 0 ; , BYTE] NEQ 0 AND7        .Connection_Info [CI$LHos                                                                                                                                                                                                                                                   3                       А        
CMUIP066.C                     I=  I6  [LPR]LPR.SRC;1RC;1RC;1                                                                                                                                                    t_Name_Size] GTR 0 THEN          STR$COPY_R ( 	    My_Hostname, 2 	    %REF (.Connection_Info [CI$LHost_Name_Size]),$ 	    Connection_Info [CI$Local_Host]	         )      ELSE BEGIN.         Status = This_Host_Name (My_Hostname);         IF NOT .Status OR '            .Status EQL SS$_NOTRAN THEN  
 	    BEGIN"             Status = LIB$SYS_FAO ( 			%ASCID '!UB.!UB.!UB.!UB',, 	       	        Temp_String [DSC$W_Length], 			Temp_String, P                 	.VECTOR [Connection_Info [CI$Local_Internet_Adrs], 0 ; , BYTE],P 	                .VECTOR [Connection_Info [CI$Local_Internet_Adrs], 1 ; , BYTE],P 	                .VECTOR [Connection_Info [CI$Local_Internet_Adrs], 2 ; , BYTE],P 	                .VECTOR [Connection_Info [CI$Local_Internet_Adrs], 3 ; , BYTE],                      ); 3             STR$COPY_DX (My_Hostname, Temp_String);              END;         END;*     Lower_Case (My_Hostname, My_Hostname);0 !    Log ('Local host = ''!AS''', My_Hostname);  !+E ! Check to see if remote host is allowed to access us. If not, log it  ! and cut the guy off  !-@     Status = Authenticate_Host (LPD_Block [LPDB$Q_Remote_Host]);     IF NOT .Status THEN          BEGIN      %IF Logging  	%THEN 	Log (p 	    '!%D Request !%T Connection aborted, remote not in host authoriza                                                                                                                                                                                                                                                   0                                LPR.SRC                        b  I6  [LPR]LPD.B32;11                                                                                                                p                              c      j       tion file ''!AF'', !UB.!UB.!UB.!UB (!UW)',& 	    0, LPD_Block [LPDB$Q_Start_Time],+ 	    .Connection_Info [CI$FHost_Name_Size], ' 	    Connection_Info [CI$Foreign_Host], E 	    .VECTOR [Connection_Info [CI$Remote_Internet_Adrs], 0 ; , BYTE], E 	    .VECTOR [Connection_Info [CI$Remote_Internet_Adrs], 1 ; , BYTE], E 	    .VECTOR [Connection_Info [CI$Remote_Internet_Adrs], 2 ; , BYTE], E 	    .VECTOR [Connection_Info [CI$Remote_Internet_Adrs], 3 ; , BYTE], ) 	    .Connection_Info [CI$Foreign_Port]);  	%FI  :         Status = STR$CONCAT (LPD_Block [LPDB$Q_Send_Desc],$                         My_Hostname,4                         %ASCID ': LPD: Your host (',7                         LPD_Block [LPDB$Q_Remote_Host], U                         %ASCID ') does not have remote printer access to this node.',  			%ASCID %STRING (LPR$K_EOL));  	LPD_Do_Write (LPD_Block);=         RETURN LPD_Finish (LPD_BLock, LPD$_No_Authorization);          END;]     (.LPD_Transition_Matrix [.LPD_Block [LPDB$W_State], LPDB$K_Event_Conn_Open]) (LPD_Block);        SS$_NORMAL     END;  ! ROUTINE LPD_Start (LPD_Block_A) =  !++  ! Functional Description:  ! = !	Finish initializing I/O data structures and start protocol.  !-- 	     BEGIN      BIND& 	LPD_Block	= .LPD_Block_A			: $BBLOCK;     EXTERNAL ROUTINE 	Text_Init, 
 	Set_Init,. 	STR$APPEND	: BLISS ADDRESSING_MODE (GENERAL),0 	STR$FREE1_DX	: BLISS ADDRESSING_MODE (GENERAL);	     LOCAL + 	Host_Name	: $BBLOCK [DSC$K_S_BLN] PRESET (  			[DSC$W_Length]	= 0,! 			[DSC$B_DType]	= DSC$K_DTYPE_T, ! 			[DSC$B_Class]	= DSC$K_CLASS_D,  			[DSC$A_Pointer]	= 0), 	Status;  >     IF NOT .LPD_Block [LPDB$V_VALID] THEN RETURN (SS$_NORMAL);     %IF Debug  	%THEN 	Print ('LPD_Start');  	%FI  2     LPD_Block [LPDB$W_State] = LPDB$K_State_Start;  0     Init_DynDesc (LPD_Block [LPDB$Q_Recv_Line]);3     Init_DynDesc (LPD_Block [LPDB$Q_Printer_Name]); -     Init_DynDesc (LPD_Block [LPDB$Q_Person]); 2     Init_DynDesc (LPD_Block [LPDB$Q_Remote_Host]);1     Init_DynDesc (LPD_Block [LPDB$Q_DFile_Name]); 0     Init_DynDesc (LPD_Block [LPDB$Q_Send_Desc]);     !++ 7     ! Build the names and structures for the Data file.      !-- 1     Init_DynDesc (LPD_Block [LPDB$Q_DFile_Name]); 2     $FAB_Init ( FAB = LPD_Block [LPDB$T_File_FAB], 	FAC	= <PUT>,  	FOP	= <SQO>,  	ORG	= <SEQ>,  	RAT	= <CR>, 	RFM	= <VAR>);2     $RAB_Init ( RAB = LPD_Block [LPDB$T_File_RAB],# 	FAB	= LPD_Block [LPDB$T_File_FAB],  	RAC	= SEQ);       !++ 6     ! Initialize the data structures we might be using     !-- 0     Text_Init (LPD_Block [LPDB$Q_Control_Text]);  *     Set_Init (LPD_Block [LPDB$Q_Job_Set]);       !++      ! Start the network open.      !--      Status = $ASSIGN ( 		DEVNAM	= %ASCID 'IP:',) 		CHAN	= LPD_Block [LPDB$W_TCP_Channel]); C     IF NOT .Status THEN RETURN LPD_Finish (LPD_Block, LPD$_No_Net);        Status = NET$OPEN (  	Local_Prt	= 515,  	OpenMode	= Passive, 	IOMode		= ASYNCH,     	TimOut		= 0, + 	IOChan		= .LPD_Block [LPDB$W_TCP_Channel], ' 	IO$SB		= LPD_Block [LPDB$Q_Recv_IOSB],  	AST$ADR		= LPD_Open_Ast,  	AST$PRM		= LPD_Block); C     IF NOT .Status THEN RETURN LPD_Finish (LPD_Block, LPD$_No_Net);        %IF Logging  	%THEN' 	Log ('!%D Request !%T Open Requested', $ 		0, LPD_Block [LPDB$Q_Start_Time]); 	%FI       SS$_NORMAL     END;  % ROUTINE LPD_Timer_AST (LPD_Block_A) =  !++  ! Functional Description:  ! A !	A timer has gone off, Call a routine from the transition matrix  !-- 	     BEGIN      BIND& 	LPD_Block	= .LPD_Block_A			: $BBLOCK;	     LOCAL  	Status;  >     IF NOT .LPD_Block [LPDB$V_Valid] THEN RETURN (SS$_NORMAL);     %IF Debug  	%THEN" 	Print ('LPD Timer AST, timeout'); 	%FI  N     (.LPD_Transition_Matrix [.LPD_Block [LPDB$W_State], LPDB$K_Event_Timeout]) 	(LPD_Block);        SS$_NORMAL     END;  0 ROUTINE LPD_Start_Timer (LPD_Block_A, Seconds) = !++  ! Functional Description:  ! ( !	Set a timer to go off in a short time. !-- 	     BEGIN      BIND% 	LPD_Block	= .LPD_Block_A		: $BBLOCK;      BUILTIN  	EMUL;	     LOCAL   	Time_Binary	: VECTOR [8, BYTE], 	Status;       !++ 9     ! Convert seconds into the vax/vms binary time format      !-- 
     EMUL (7 	%REF ( -10 * 1000 * 1000),		! One Second (sign extend)  	%REF (.Seconds),			! Wait time  	%REF (0),				! Carry  	Time_Binary);				! Result       !++      ! Do the wait      !--      Status = $SETIMR ( 		DAYTIM	= Time_Binary,  		ASTADR	= LPD_Timer_AST,  		REQIDT	= LPD_Block);)     IF NOT .Status THEN Signal (.Status);        SS$_NORMAL     END;  $ ROUTINE LPD_Read_AST (LPD_Block_A) = !++  ! Functional Description:  ! 1 !	A Read has completed on the network I/O device.  !-- 	     BEGIN      BIND& 	LPD_Block	= .LPD_Block_A			: $BBLOCK, %IF Version64 	     %THEN 9 	Recv_IOSB	= LPD_Block [LPDB$Q_Recv_IOSB]	: Network_IOSB, 	     %ELSE ? 	Recv_IOSB	= LPD_Block [LPDB$Q_Recv_IOSB]	: NetIO_Status_Block,      %FI 4 	Recv_Line	= LPD_Block [LPDB$Q_Recv_Line]	: $BBLOCK;     EXTERNAL ROUTINE. 	STR$COPY_R	: BLISS ADDRESSING_MODE (GENERAL),. 	STR$APPEND	: BLISS ADDRESSING_MODE (GENERAL),0 	STR$FREE1_DX	: BLISS ADDRESSING_MODE (GENERAL);	     LOCAL ' 	Temp		: $BBLOCK [DSC$K_S_BLN] PRESET (  			[DSC$W_Length]	= 0,! 			[DSC$B_DType]	= DSC$K_DTYPE_T, ! 			[DSC$B_Class]	= DSC$K_CLASS_D,  			[DSC$A_Pointer]	= 0), 	Status;  >     IF NOT .LPD_Block [LPDB$V_Valid] THEN RETURN (SS$_NORMAL);       %IF Debug  	%THENQ 	Print ('LPD_Read_Ast, Status = %X!XW, Count = !UL, [0] = %X!XB, Xerror = %X!XL',  			.Recv_IOSB [NSB$Status],  			.Recv_IOSB [NSB$Byte_Count], 8 			.VECTOR [LPD_Block [LPDB$T_Recv_Buffer], 0 ; , BYTE], 			.Recv_IOSB [NSB$XError]); 	%FI       !++      ! Check the IOSB     !-- %     Status = .Recv_IOSB [NSB$Status]; !     IF .Status EQL SS$_ABORT THEN  	BEGIN" 	Status = .Recv_IOSB [NSB$XERROR]; 	IF .Status EQL NET$_CC 3 	    THEN                                                                                                                                                                                                                                                    4                       8v        
CMUIP066.C                     I=  I6  [LPR]LPR.SRC;1RC;1RC;1                                                                                                                                                    RETURN LPD_Finish (LPD_Block, SS$_NORMAL) ; 	    ELSE RETURN LPD_Finish (LPD_Block, LPD$_Conn_Aborted);  	END; I     IF NOT .Status THEN RETURN LPD_Finish (LPD_BLock, LPD$_Conn_Aborted);        Status = STR$COPY_R (  		Temp,					! Dest String 5 		%REF (.Recv_IOSB [NSB$BYTE_Count]), 	! Length (Ref) - 		LPD_Block [LPDB$T_Recv_Buffer]);	! Src Addr )     IF NOT .Status THEN Signal (.Status);        %IF Debug  	%THEN# 	Print ('Received Line is ''!AF''', / 		.Temp [DSC$W_Length], .Temp [DSC$A_Pointer]);  	%FI  *     Status = STR$APPEND (Recv_Line, Temp);)     IF NOT .Status THEN Signal (.Status);   !     Status = STR$FREE1_DX (Temp);        WHILE 1 DO 	BEGIN= 	Status = (.LPD_Transition_Matrix [.LPD_Block [LPDB$W_State], & 		LPDB$K_Event_Recv_Data])(LPD_Block); 	IF NOT .Status THEN EXITLOOP;2 	IF .Recv_Line [DSC$W_Length] EQL 0 THEN EXITLOOP; 	END;      !+K     ! If we got back a NODATA, then recv_command didn't write anything out, I     ! and write_ast will not be called to do final transition, so lets do      ! it here and now A     ! Otherwise, just post another read, go back to sleep and let      ! write_ast do its work...     ! I     ! Note: this should only occur for something like Remove_Entry, which J     !       doesn't write anything back to the remote if there was nothing     !       to do      !-"     IF .Status EQL SS$_NODATA THEN= 	Status = (.LPD_Transition_Matrix [.LPD_Block [LPDB$W_State], % 		LPDB$K_Event_Sent_Data])(LPD_Block)      ELSE!          LPD_Do_Read (LPD_Block);        SS$_NORMAL     END;  # ROUTINE LPD_Do_Read (LPD_Block_A) =  !++  ! Functional Description:  !  !	Start an asynch read.  !-- 	     BEGIN      BIND% 	LPD_Block	= .LPD_Block_A		: $BBLOCK; 	     LOCAL  	Status;       %IF Debug  	%THEN 	Print ('LPD_Do_Read');  	%FI                                                                                                                                                                                                                                                     1                        zկ        LPR.SRC                        b  I6  [LPR]LPD.B32;1                                                                                                                 p                              Gu      y            Status = NET$RECEIVE (+ 	BufAdrs		= LPD_Block [LPDB$T_Recv_Buffer],  	BufSize		= LPDB$S_Recv_Buffer,  	IOmode		= ASYNCH,+ 	IOCHAN		= .LPD_Block [LPDB$W_TCP_Channel], ' 	IO$SB		= LPD_Block [LPDB$Q_Recv_IOSB],  	Ast$Adr		= LPD_Read_Ast,  	Ast$Prm		= LPD_Block); =     IF NOT .Status THEN LPD_Finish (LPD_Block, LPD$_No_Read);        SS$_NORMAL     END;  % ROUTINE LPD_Write_Ast (LPD_Block_A) =  !++  ! Functional Description:  ! ' !	A write on the network has completed.  !-- 	     BEGIN      BIND& 	LPD_Block	= .LPD_Block_A			: $BBLOCK, %IF Version64 	     %THEN 9 	Send_IOSB	= LPD_Block [LPDB$Q_Send_IOSB]	: Network_IOSB; 	     %ELSE ? 	Send_IOSB	= LPD_Block [LPDB$Q_Send_IOSB]	: NetIO_Status_Block;      %FI 	     LOCAL  	Status;  >     IF NOT .LPD_Block [LPDB$V_Valid] THEN RETURN (SS$_NORMAL);       %IF Debug  	%THEN* 	Print ('LPD_Write_Ast, IOSB = !XW, !XL',  		.Send_IOSB [NSB$Status], 		.Send_IOSB [NSB$XERROR]);  	%FI       !++      ! Check the IOSB     !-- %     Status = .Send_IOSB [NSB$Status]; "     IF .Status EQLU SS$_ABORT THEN 	BEGIN+ 	LPD_Finish (LPD_Block, LPD$_Conn_Aborted);  	RETURN SS$_NORMAL;  	END; I     IF NOT .Status THEN RETURN LPD_Finish (LPD_BLock, LPD$_Conn_Aborted);   ]     (.LPD_Transition_Matrix [.LPD_Block [LPDB$W_State], LPDB$K_Event_Sent_Data]) (LPD_Block);        SS$_NORMAL     END;  $ ROUTINE LPD_Do_Write (LPD_Block_A) = !++  ! Functional Description:  ! $ !	Write the data out on the network. !-- 	     BEGIN      BIND& 	LPD_Block	= .LPD_Block_A			: $BBLOCK,4 	Send_Desc	= LPD_Block [LPDB$Q_Send_Desc]	: $BBLOCK;     EXTERNAL ROUTINE/ 	STR$COPY_DX	: BLISS ADDRESSING_MODE (GENERAL); 	     LOCAL  	Status;       %IF Debug  	%THEN8 	Print ('LPD_Do_Write, Desc = ''!AF'' First char = !XB', 		.Send_Desc [DSC$W_Length], 		.Send_Desc [DSC$A_Pointer], 4  		.VECTOR [.Send_Desc [DSC$A_Pointer], 0; , BYTE]); 	%FI     Status = NET$SEND ( ' 		BufAdrs	= .Send_Desc [DSC$A_Pointer], & 		BufSize	= .Send_Desc [DSC$W_Length], 		IOMode	= ASYNCH,
 		EOL	= 1,+ 		IOChan	= .LPD_Block [LPDB$W_TCP_Channel], ' 		IO$SB	= LPD_Block [LPDB$Q_Send_IOSB],  		Ast$Adr	= LPD_Write_Ast, 		AST$Prm	= LPD_Block); >     IF NOT .Status THEN LPD_Finish (LPD_BLock, LPD$_No_Write);       SS$_NORMAL     END;   GLOBAL ROUTINE LPD ( 	Final_Status_A, 	AstAdr,
 	AstPrm) = !++  ! Functional Description:  ! 3 !	Start up the LPR Server and see what can be done.  !  ! Formal Parameters: ! 9 !	Final_Status	A Longword to right a VMS status into when 2 !			we are done with a LPR request. Passed by ref. ! ; !	ASTADR		Address of a routine to call when we've completed 3 !			the LPR request (or timed out).  We'll complete # !			the LPR request asynchronously.  ! . !	ASTPRM		A parameter to pass the ast routine./ !			Also used in cancelling the asynch request.  !-- 	     BEGIN      BIND+ 	Final_Status	= .Final_Status_A		: $BBLOCK;      EXTERNAL ROUTINE	 	Get_Mem;      BIND. 	LPD_Block	= Get_Mem (LPDB$K_Size)		: $BBLOCK;     BUILTIN  	INSQUE;	     LOCAL  	Status;       %IF Debug  	%THEN 	Print ('LPD');  	%FI  "     INSQUE (LPD_Block, LPD_Queue);!     LPD_Block [LPDB$V_Valid] = 1;        !++ *     ! Record all the necessary parameters.     !-- 8     LPD_Block [LPDB$L_Final_Status_A] = .Final_Status_A;(     LPD_Block [LPDB$L_ASTADR] = .AstAdr;(     LPD_Block [LPDB$L_AstPrm] = .ASTPRM;  >     Status = $GETTIM (TIMADR = LPD_Block [LPDB$Q_Start_Time]);)     IF NOT .Status THEN Signal (.Status);        %IF Logging  	%THENC 	Log ('!%D Request !%T Created', 0, LPD_BLock [LPDB$Q_Start_Time]);  	%FI       !++ ,     ! That's all that needs to be done here.     ! Do the rest later.     !--      Status = $DCLAST ( 		ASTADR	= LPD_Start,  		ASTPRM	= LPD_Block);)     IF NOT .Status THEN Signal (.Status);        SS$_NORMAL     END;   END  ELUDOM/ !  DEC/CMS REPLACEMENT HISTORY, Element LPD.B32 J !  *1     6-MAR-1991 19:40:53 SYNFUL "Routines to implement an LPR server"/ !  DEC/CMS REPLACEMENT HISTORY, Element LPD.B32                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            5                       [        
CMUIP066.C                     I=  I6  [LPR]LPR.SRC;1RC;1RC;1                                                                                                                                        M`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                2                        zn        LPR.SRC                        Z  I6  [LPR]LPD_MAIN.B32;1                                                                                                            A     	                         o               * [LPR]LPD_MAIN.B32;1 +  , Z   . 	    /     4 A   	    Z                   - I6    0   1    2   3      K  P   W   O     5   6 -  7 @-  8          9          G    H  J                             %(A 	****************************************************************   0 		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.  A 	****************************************************************  )% MODULE     LPD_Main ( 	LANGUAGE (BLISS32),% 	LIST (ASSEMBLY, NOBINARY, NOEXPAND),          IDENT = '1-002', 	MAIN = Main) =  BEGIN    !++  ! LPD_Main.B32 ! / !	Copyright (C) 1987	Carnegie Mellon University  !  ! Description: ! + !	A server for the unix based LPR protocol.  !  ! Written By:  ! " !	Dale Moore	01-APR-1987	CMU-CS/RI !  ! Modifications: ! 6 ! 1-002 19-May-1990     Art Stine       Clarkson U/ERC6 ! Renamed various things from LPRxxx to LPD to reflect ! merge of LPR code in V6.5  !--    LIBRARY 'SYS$LIBRARY:STARLET'; LIBRARY '[-.CENTRAL]NETWORK';    COMPILETIME      Debug	= 0,     Logging	= 1;  	 %IF Debug 	     %THEN      LIBRARY 'PRINT';     %FI    %IF Logging 	     %THEN      LIBRARY 'LOG';     %FI    OWN      Final_Status;   ! ROUTINE LPD_Finish_Ast (AstPrm) =  !++  ! Functional Description:  ! A !	Our LPD Has finished.  Look at Final_Status to determine sucess  !	or failure.  !-- 	     BEGIN      $WAKE ()     END;  % ROUTINE LPD_Handler (Sig_A, Mech_A) =  !++  ! Functional Description:  ! 2 !	If we are gonna die.  I want it in the log file! !-- 	     BEGIN      BIND 	Sig		= .Sig_A		: $BBLOCK, 	Mech		= .Mech_A		: $BBLOCK;     BIND+ 	Sig_Name	= Sig [CHF$L_Sig_Name]	: $BBLOCK; 	     LOCAL % 	Message_Buffer	: VECTOR [256, BYTE], . 	Message_Desc	: $BBLOCK [DSC$K_S_BLN] PRESET (2 				[DSC$W_LENGTH]	= %ALLOCATION (Message_Buffer)," 				[DSC$B_DTYPE]	= DSC$K_DTYPE_T," 				[DSC$B_CLASS]	= DSC$K_CLASS_S,& 				[DSC$A_POINTER]	= Message_Buffer), 	Status;         %IF Logging  	%THEN/ 	IF .Sig_Name [STS$V_SEVERITY] NEQ STS$K_SEVERE  		THEN RETURN (SS$_RESIGNAL);    	Status = $GETMSG (   		MSGID	= .Sig [CHF$L_Sig_Name],' 		MSGLEN	= Message_Desc [DSC$W_LENGTH],  		BUFADR	= Message_Desc); & 	IF NOT .Status THEN Signal (.Status);  % 	Log ('!%D LPD Dying abnormally', 0); / 	Log ('!%D Status = ''!AS''', 0, Message_Desc);  	%FI       SS$_RESIGNAL     END;   ROUTINE Main = !++  ! Functional Description:  ! A !	Passively Open the connection and wait for something to happen.  !-- 	     BEGIN 
     ENABLE 	LPD_Handler;      EXTERNAL ROUTINE
 	LPD_Init, 	LPD; 	     LOCAL  	Status;       Status = LPD_Init (); )     IF NOT .Status THEN Signal (.Status);        Status = LPD ( 		Final_Status,  		LPD_Finish_Ast,  		0); )     IF NOT .Status THEN Signal (.Status);        $HIBER;      RETURN (.Final_Status)     END;   END  ELUDOM4 !  DEC/CMS REPLACEMENT HISTORY, Element LPD_MAIN.B32< !  *1     6-MAR-1991 19:44:41 SYNFUL "Main routines for LPD"4 !  DEC/CMS REPLACEMENT HISTORY, Element LPD_MAIN.B32                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     6                       sbb        
CMUIP066.C                     I=  I6  [LPR]LPR.SRC;1RC;1RC;1                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        3                        SX        LPR.SRC                          I6  [LPR]LPD_PARSE.B32;1                                                                                                           T     !                         ;#               * [LPR]LPD_PARSE.B32;1 +  ,    . !    /     4 T   !   !                    - I6    0   1    2   3      K  P   W   O "    5   6  ^-  7 `gd-  8          9          G    H  J                            %(A 	****************************************************************   0 		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.  A 	****************************************************************  )% MODULE     LPD_Parse (  	LANGUAGE (BLISS32),% 	LIST (ASSEMBLY, NOBINARY, NOEXPAND),          IDENT='1-004'  	) = BEGIN    !++  ! LPD_Parse.B32  !  ! Description: ! 3 !	A routine to do necessary parsing of LPR commands  !       for LPD. !  ! Written By:  ! " !	Dale Moore	13-APR-1987	CMU-CS/RI !  ! Modifications: ! 6 ! 1-004 19-May-1990     Art Stine       Clarkson U/ERC8 !       Renamed spool directory logical to LPD$SPOOL_DIR> !       to better reflect whose spool it is (it doesn't belong! !       to the LPR code (LPRSMB))  ! . ! 1-003	25-March-1990	Art Stine	Clarkson U/ERC7 !	Extended parsing for Remove_Entry command to peel off ? !	first token after printer name (person). It can't be put into ? !	job_set because if the name is duplicated as allowed by LPRM, % !	only one will appear in the job_set  !	( ! 1-002	12-NOV-1987	Dale Moore	CMU-CS/RI? !	Added check for long > 32K lines in the Get_Line_Max routine.  !--    LIBRARY 'SYS$LIBRARY:STARLET'; LIBRARY 'SYS$LIBRARY:TPAMAC';  LIBRARY 'LPRCommon'; LIBRARY 'LPD';   COMPILETIME      Debug	= 0;  	 %IF Debug 	     %THEN      LIBRARY 'PRINT';     %FI      LIBRARY 'LOG';   !++  ! Description: ! : !	Information about the file name and size are stored in a  !	block while we are parsing it. !--    MACRO &     NSBlock$A_Command	=  0, 0, 32, 0%,(     NSBlock$A_File_Size	=  4, 0, 32, 0%,(     NSBlock$A_File_Name	=  8, 0, 32, 0%,$     NSBlock$A_Spare	= 12, 0, 32, 0%; LITERAL      NSBlock$K_Size	= 16;   !++  ! Description: ! A !	Information about the queue and jobs that we are interested in.   !	Store it in this when parsing. !--  MACRO &     PJBlock$A_Command	=  0, 0, 32, 0%,&     PJBlock$A_Printer	=  4, 0, 32, 0%,%     PJBlock$A_Person	=  8, 0, 32, 0%, &     PJBlock$A_Job_Set	= 12, 0, 32, 0%; LITERAL      PJBlock$K_Size	= 16;    ? GLOBAL ROUTINE Convert_Printer_Name (VMS_Name_A, Unix_Name_A) =  !++  ! Functional Description:  ! : !	Convert from the name that Unix thinks is appropriate to/ !	a name that is appropriate for a VMS printer.  ! 6 !	We might do this by using a logical name table....!! !-- 	     BEGIN      BIND# 	VMS_Name	= .VMS_Name_A		: $BBLOCK, % 	Unix_Name	= .Unix_Name_A		: $BBLOCK;      EXTERNAL ROUTINE. 	STR$COPY_R	: BLISS ADDRESSING_MODE (GENERAL);	     LOCAL " 	Name_Buffer	: VECTOR [128, BYTE], 	Name_Length	: WORD,& 	Item_List	: $ITMLST_DECL (ITEMS = 2), 	Status;  %     $ITMLST_INIT (ITMLST = Item_List,  		(ITMCOD = LNM$_STRING, 		 BUFADR = Name_Buffer,& 		 BUFSIZ = %ALLOCATION (Name_Buffer), 		 RETLEN = Name_Length),  		(ITMCOD = 0, 		 RETLEN = 0, 		 BUFADR = 0, 		 BUFSIZ = 0));       Status = $TRNLNM (! 		ATTR	= %REF (LNM$M_CASE_BLIND), $ 		TABNAM	= %ASCID 'CMUIP$LPD_TABLE', 		LOGNAM	= Unix_Name,  		ITMLST	= Item_List);)     IF NOT .Status THEN RETURN (.Status);   E     Status = STR$COPY_R (VMS_Name, %REF (.Name_Length), Name_Buffer); )     IF NOT .Status THEN Signal (.Status);        SS$_NORMAL     END;  < GLOBAL ROUTINE Convert_File_Name (VMS_Name_A, Unix_Name_A) = !++  ! Functional Description:  ! 3 !	Convert a unix like file name to a vms file name. 4 !	I don't expect the unix name to have and "/"'s but6 !	it may have several "."'s and other obnoxious chars. !  !-- 	     BE                                                                                                                                                                                                                                                   7                       qL\        
CMUIP066.C                     I=  I6  [LPR]LPR.SRC;1RC;1RC;1                                                                                                                                        t      *      GIN      BIND# 	VMS_Name	= .VMS_Name_A		: $BBLOCK, % 	Unix_Name	= .Unix_Name_A		: $BBLOCK;      EXTERNAL ROUTINE1 	STR$TRANSLATE	: BLISS ADDRESSING_MODE (GENERAL), , 	STR$LEFT	: BLISS ADDRESSING_MODE (GENERAL),. 	STR$APPEND	: BLISS ADDRESSING_MODE (GENERAL),. 	STR$CONCAT	: BLISS ADDRESSING_MODE (GENERAL);	     LOCAL  	Index_Char	: BYTE,  	Status;       %IF Debug  	%THEN5 	Print ('Convert File name from ''!AS''', Unix_Name);  	%FI  I     Status = STR$TRANSLATE (VMS_Name, Unix_Name, %ASCID '_', %ASCID '.'); )     IF NOT .Status THEN Signal (.Status);   5     Status = STR$LEFT (VMS_Name, VMS_Name, %REF(39)); )     IF NOT .Status THEN Signal (.Status);    !+M ! Take care of problem from Unix LPR's which roll over case in filename after B ! first 26 files in a single job (form goes from dfA... to dfa... G ! Let's just bump the version number and pray that there aren't any old 8 ! jobs lying around from that same host in our spool dir !-@     Index_Char = .VECTOR [.VMS_Name [DSC$A_POINTER], 2; , BYTE];       SELECTONE .Index_Char OF           SET  	['a' TO 'z']: BEGIN+ 		      STR$APPEND (VMS_Name, %ASCID ';2');  		      END;   	[OTHERWISE]:  BEGIN+ 		      STR$APPEND (VMS_Name, %ASCID ';1');  		      END; 		TES;       Status = STR$CONCAT (  		VMS_Name,  		%ASCID 'LPD$SPOOL_DIR:', 		VMS_Name);       %IF Debug  	%THEN2 	Print ('Convert File name to ''!AS''', VMS_Name); 	%FI       SS$_NORMAL     END;   ROUTINE Command_Store =  !++  ! Functional Description:  ! 3 !	A TParse Routine that squirrels away the Command.  !-- 	     BEGIN      BUILTIN  	AP;     BIND! 	TParse_Block	= .AP				: $BBLOCK, 2 	NSBlock		= .TParse_Block [TPA$L_PARAM]	: $BBLOCK,? 	Command_Vec	= .TParse_Block [TPA$L_TOKENPTR]: VECTOR [, BYTE], 0 	Command		= .NSBLock [NSBlock$A_Command]	: BYTE;  <     IF .TParse_Block [TPA$L_TOKENCNT] NEQ 1 THEN RETURN (0);     Command = .Command_Vec [0];      SS$_NORMAL     END;   ROUTINE Store_Printer_Command =  !++  ! Functional Description:  ! 3 !	A TParse Routine that squirrels away the Command.  !-- 	     BEGIN      BUILTIN  	AP;     BIND! 	TParse_Block	= .AP				: $BBLOCK, 2 	NSBlock		= .TParse_Block [TPA$L_PARAM]	: $BBLOCK,? 	Command_Vec	= .TParse_Block [TPA$L_TOKENPTR]: VECTOR [, BYTE], 0 	Command		= .NSBLock [PJBLock$A_Command]	: BYTE;  <     IF .TParse_Block [TPA$L_TOKENCNT] NEQ 1 THEN RETURN (0);     Command = .Command_Vec [0];      SS$_NORMAL     END;   ROUTINE Size_Store = !++  ! Functional Description:  ! 0 !	A TParse Routine that squirrels away the size. !-- 	     BEGIN      BUILTIN  	AP;     BIND! 	TParse_Block	= .AP				: $BBLOCK, 2 	NSBlock		= .TParse_Block [TPA$L_PARAM]	: $BBLOCK,; 	File_Size	= .NSBLock [NSBlock$A_File_Size]: LONG UNSIGNED;   -     File_Size = .TParse_Block [TPA$L_Number];      SS$_NORMAL     END;   ROUTINE Name_Store = !++  ! Functional Description:  ! 4 !	A TParse Routine that squirrels away the filename. !-- 	     BEGIN      BUILTIN  	AP;     BIND! 	TParse_Block	= .AP				: $BBLOCK, 2 	NSBlock		= .TParse_Block [TPA$L_PARAM]	: $BBLOCK,5                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   4                        ]        LPR.SRC                          I6  [LPR]LPD_PARSE.B32;1                                                                                                           T     !                         /             	File_Name	= .NSBLock [NSBlock$A_File_Name]: $BBLOCK; 	     LOCAL  	Status;  J     Status = Convert_File_Name (File_Name, TParse_Block [TPA$L_TOKENCNT]);)     IF NOT .Status THEN Signal (.Status);        SS$_NORMAL     END;   ROUTINE Store_Person = !++  ! Functional Description:  ! E !	A TParse Routine that squirrels away the person name for Remove_Job  !-- 	     BEGIN      BUILTIN  	AP;     BIND! 	TParse_Block	= .AP				: $BBLOCK, 2 	PJBlock		= .TParse_Block [TPA$L_PARAM]	: $BBLOCK,1 	Person		= .PJBLock [PJBlock$A_Person]	: $BBLOCK;      EXTERNAL ROUTINE/ 	STR$COPY_DX	: BLISS ADDRESSING_MODE (GENERAL); 	     LOCAL  	Status;  A     Status = STR$COPY_DX (Person, TParse_Block [TPA$L_TOKENCNT]); )     IF NOT .Status THEN Signal (.Status);        SS$_NORMAL     END;   ROUTINE Store_Printer =  !++  ! Functional Description:  ! 7 !	A TParse Routine that squirrels away the printer name  !-- 	     BEGIN      BUILTIN  	AP;     BIND! 	TParse_Block	= .AP				: $BBLOCK, 2 	PJBlock		= .TParse_Block [TPA$L_PARAM]	: $BBLOCK,3 	Printer		= .PJBLock [PJBlock$A_Printer]	: $BBLOCK;o     EXTERNAL ROUTINE/ 	STR$COPY_DX	: BLISS ADDRESSING_MODE (GENERAL); 	     LOCALo 	Status;  B     Status = STR$COPY_DX (Printer, TParse_Block [TPA$L_TOKENCNT]);)     IF NOT .Status THEN Signal (.Status);n       SS$_NORMAL     END; d ROUTINE Store_Job =o !++f ! Functional Description:. ! / !	A TParse Routine that squirrels away this jobi !--t	     BEGINt     BUILTINr 	AP;     BIND! 	TParse_Block	= .AP				: $BBLOCK,b2 	PJBlock		= .TParse_Block [TPA$L_PARAM]	: $BBLOCK,3 	Job_Set		= .PJBLock [PJBlock$A_Job_Set]	: $BBLOCK;m     EXTERNAL ROUTINE 	Set_Insert;	     LOCALo 	Status;  A     Status = Set_Insert (TParse_BLock [TPA$L_TOKENCNT], Job_Set);*)     IF NOT .Status THEN Signal (.Status);*       SS$_NORMAL     END;  - $INIT_STATE (LPR_State_Table, LPR_Key_Table);A   $STATE (LPR_Data_Command, 0 	(LPR$K_Send_Noop, LPR_Data_End, Command_Store),' 	(LPR$K_Send_Control, , Command_Store),	% 	(LPR$K_Send_Data, , Command             _Store));R	 $STATE (,  	(TPA$_DECIMAL, , Size_Store));y	 $STATE (,a 	(TPA$_BLANK));9	 $STATE (,I" 	((LPR_File_Name), , Name_Store)); $STATE (LPR_Data_End,n 	(TPA$_EOS, TPA$_EXIT));   $STATE (LPR_File_Name, 	(TPA$_ALPHA, LPR_File_Name),  	(TPA$_DIGIT, LPR_File_Name),p 	('.', LPR_File_Name), 	('_', LPR_File_Name), 	('-', LPR_File_Name), 	('$', LPR_File_Name), 	(TPA$_LAMBDA, TPA$_EXIT));d   $STATE (LPR_Command,. 	(LPR$K_Check_Queue, , Store_Printer_Command),, 	(LPR$K_Add_Entry, , Store_Printer_Command),= 	(LPR$K_Show_Brief, LPR_Long_Command, Store_Printer_Command), < 	(LPR$K_Show_Long, LPR_Long_Command, Store_Printer_Command),B 	(LPR$K_Remove_Entry, LPR_Remove_Command, Store_Printer_Command));	 $STATE (,r# 	((LPR_Printer), , Store_Printer));Y	 $STATE (,  	(TPA$_EOS, TPA$_EXIT)); $STATE (LPR_Long_Command, # 	((LPR_Printer), , Store_Printer));e $STATE (LPR_Jobs,u 	(TPA$_EOS, TPA$_EXIT),R 	(TPA$_BLANK));F	 $STATE (,R# 	((LPR_Job), LPR_Jobs, Store_Job));    $STATE (LPR_Remove_Command,n# 	((LPR_Printer), , Store_Printer));  $STATE (LPR_Person,i 	(TPA$_EOS, TPA$_EXIT),S 	(TPA$_BLANK)); 	 $STATE (,0& 	((LPR_Job), LPR_Jobs, Store_Person));   $STATE (LPR_Printer, 	(TPA$_BLANK, TPA$_FAIL),  	(TPA$_ANY));		 $STATE (,, 	((LPR_Printer), TPA$_EXIT), 	(TPA$_LAMBDA, TPA$_EXIT));t   $STATE (LPR_Job, 	(TPA$_BLANK, TPA$_FAIL),s 	(TPA$_ANY));t	 $STATE (,  	((LPR_Job), TPA$_EXIT), 	(TPA$_LAMBDA, TPA$_EXIT));J c# GLOBAL ROUTINE Parse_Data_Command (l 		In_Line_A, 		Command_A, 		File_Size_A, 		File_Name_A) = !++% ! Functional Description:  ! 4 !	The line is a decimal size followed by a File Name !--L	     BEGINn     BIND# 	In_Line		= .In_Line_A			: $BBLOCK;      EXTERNAL ROUTINE. 	LIB$TPARSE	: BLISS ADDRESSING_MOD                                                                                                                                                                                                                                                   8                               
CMUIP066.C                     I=  I6  [LPR]LPR.SRC;1RC;1RC;1                                                                                                                                        E      9      E (GENERAL);	     LOCAL - 	NSBLock		: $BBLOCK [NSBlock$K_Size] PRESET (r# 		[NSBlock$A_Command]	= .Command_A,h' 		[NSBlock$A_File_Name]	= .File_Name_A,-( 		[NSBlock$A_File_Size]	= .File_Size_A),0 	TParse_Block	: $BBLOCK [TPA$K_LENGTH0] PRESET (  		[TPA$L_COUNT]		= TPA$K_COUNT0," 		[TPA$L_OPTIONS]		= TPA$M_BLANKS, 		[TPA$L_PARAM]		= NSBLock,_. 		[TPA$L_STRINGCNT]	= .In_Line [DSC$W_LENGTH],2 		[TPA$L_STRINGPTR]	= .In_Line [DSC$A_POINTER]),		 	Status;  H     Status = LIB$TPARSE (TParse_Block, LPR_Data_Command, LPR_Key_Table);)     IF NOT .Status THEN RETURN (.Status);f       SS$_NORMAL     END;   GLOBAL ROUTINE Parse_Command ( 		In_Line_A, 		Command_A, 		Printer_A, 		Person_A,L 		Job_Set_A) = !++L ! Functional Description:M !%8 !	Parse inline "printer jobs" into its constiuent parts. !I !--i	     BEGINF     BIND# 	In_Line		= .In_Line_A			: $BBLOCK,t# 	Job_Set		= .Job_Set_A			: $BBLOCK;e     EXTERNAL ROUTINE 	Set_Clear,T. 	LIB$TPARSE	: BLISS ADDRESSING_MODE (GENERAL);	     LOCAL;- 	PJBLock		: $BBLOCK [PJBlock$K_Size] PRESET (e# 		[PJBlock$A_Command]	= .Command_A,l# 		[PJBlock$A_Printer]	= .Printer_A,l! 		[PJBlock$A_Person]	= .Person_A, $ 		[PJBlock$A_Job_Set]	= .Job_Set_A),0 	TParse_Block	: $BBLOCK [TPA$K_LENGTH0] PRESET (  		[TPA$L_COUNT]		= TPA$K_COUNT0," 		[TPA$L_OPTIONS]		= TPA$M_BLANKS, 		[TPA$L_PARAM]		= PJBLock,a. 		[TPA$L_STRINGCNT]	= .In_Line [DSC$W_LENGTH],2 		[TPA$L_STRINGPTR]	= .In_Line [DSC$A_POINTER]),		 	Status;       Set_Clear (Job_Set);  C     Status = LIB$TPARSE (TParse_Block, LPR_Command, LPR_Key_Table);A)     IF NOT .Status THEN RETURN (.Status);O       SS$_NORMAL     END; a8 GLOBAL ROUTINE Get_Line (In_Line_A, Before_A, After_A) = !++  ! Functional Description:I ! 7 !	Break the In_Line into data before the newline (\n or_ !	linefeed) and data after.. !--s	     BEGINl     BIND" 	In_Line		= .In_Line_A		: $BBLOCK,  	Before		= .Before_A		: $BBLOCK, 	After		= .After_A		: $BBLOCK;     EXTERNAL ROUTINE0 	STR$FREE1_DX	: BLISS ADDRESSING_MODE (GENERAL), 	STR$FIND_FIRST_IN_SET% 			: BLISS ADDRESSING_MODE (GENERAL),r, 	STR$LEFT	: BLISS ADDRESSING_MODE (GENERAL),- 	STR$RIGHT	: BLISS ADDRESSING_MODE (GENERAL), / 	STR$COPY_DX	: BLISS ADDRESSING_MODE (GENERAL);s	     LOCAL-- 	Before_Temp	: $BBLOCK [DSC$K_S_BLN] PRESET (I 			[DSC$W_LENGTH]	= 0,! 			[DSC$B_DTYPE]	= DSC$K_DTYPE_T, ! 			[DSC$B_CLASS]	= DSC$K_CLASS_D,  			[DSC$A_POINTER]	= 0),
 	Position, 	Status;  &     Position = STR$FIND_FIRST_IN_SET (
 		In_Line,# 		%ASCID %STRING (%CHAR (%X'0A')));	'     IF .Position EQL 0 THEN RETURN (0);_  C     Status = STR$LEFT (Before_Temp, In_Line, %REF (.Position - 1));H)     IF NOT .Status THEN Signal (.Status);   >     Status = STR$RIGHT (After, In_Line, %REF (.Position + 1));)     IF NOT .Status THEN Signal (.Status);   /     Status = STR$COPY_DX (Before, Before_Temp);a)     IF NOT .Status THEN Signal (.Status);   (     Status = STR$FREE1_DX (Before_Temp);)     IF NOT .Status THEN Signal (.Status);        SS$_NORMAL     END; e GLOBAL ROUTINE Get_Line_Max (  	In_Line_A,C
 	Before_A,	 	After_A,l 	Final_Size, 	Current_Size_A) = !++e ! Functional Description:  !H9 !	Just like Get_Line, only this time we check and see howO9 !	much more data we are expecting.  If there is more data 8 !	in the recv buffer than we are expecting we take bytes7 !	from the recv buffer regardless of whether there is a  !	newline in the buffer or not.  !	9 !	Also if the line is greater than 32K we chop it off andB
 !	send it. !--V	     BEGINe     BIND" 	In_Line		= .In_Line_A		: $BBLOCK,  	Before		= .Before_A		: $BBLOCK, 	After		= .After_A		: $BBLOCK,' 	Current_Size	= .Current_Size_A	: LONG;0     EXTERNAL ROUTINE0 	STR$FREE1_DX	: BLISS ADDRESSING_MODE (GENERAL), 	STR$FIND_FIRST_IN_SET% 			: BLISS ADDRESSING_MODE (GENERAL),r, 	STR$LEFT	: BLISS ADDRESSING_MODE (GENERAL),- 	STR$RIGHT                                                                                                                                                                                                                                   5                        u        LPR.SRC                          I6  [LPR]LPD_PARSE.B32;1                                                                                                           T     !                         p             	: BLISS ADDRESSING_MODE (GENERAL),a/ 	STR$COPY_DX	: BLISS ADDRESSING_MODE (GENERAL);s	     LOCALA- 	Before_Temp	: $BBLOCK [DSC$K_S_BLN] PRESET (B 			[DSC$W_LENGTH]	= 0,! 			[DSC$B_DTYPE]	= DSC$K_DTYPE_T,s! 			[DSC$B_CLASS]	= DSC$K_CLASS_D,O 			[DSC$A_POINTER]	= 0),
 	Position, 	Status;    &     Position = STR$FIND_FIRST_IN_SET (
 		In_Line,# 		%ASCID %STRING (%CHAR (%X'0A'))); D     IF (.Position EQL 0) AND (.In_Line [DSC$W_LENGTH] GTR 32 * 1024) 	THEN BEGINkI 	Status = STR$LEFT (Before_Temp, In_Line, %REF (LPR$K_Longest_Line - 1));A& 	IF NOT .Status THEN Signal (.Status);  @ 	Status = STR$RIGHT (After, In_Line, %REF (LPR$K_Longest_Line));& 	IF NOT .Status THEN Signal (.Status);  < 	Current_Size = .Current_Size + .Before_Temp [DSC$W_LENGTH]; 	END       ELSE IF (.Position EQL 0)i 	THEN BEGIN = 	IF .In_Line [DSC$W_LENGTH] LSS (.Final_Size - .Current_Size)o 	    THEN RETURN (0); ) 	Status = STR$LEFT (Before_Temp, In_Line, ' 			%REF (.Final_Size - .Current_Size));l& 	IF NOT .Status THEN Signal (.Status);  $ 	Status = STR$RIGHT (After, In_Line,+ 			%REF (.Final_Size - .Current_Size + 1));A& 	IF NOT .Status THEN Signal (.Status);   	Current_Size = .Final_Size; 	END       ELSE 	BEGIN  @ 	Status = STR$LEFT (Before_Temp, In_Line, %REF (.Position - 1));& 	IF NOT .Status THEN Signal (.Status);  ; 	Status = STR$RIGHT (After, In_Line, %REF (.Position + 1));e& 	IF NOT .Status THEN Signal (.Status);  @ 	Current_Size = .Current_Size + .Before_Temp [DSC$W_LENGTH] + 1; 	END;	  /     Status = STR$COPY_DX (Before, Before_Temp);R)     IF NOT .Status THEN Signal (.Status);c  (     Status = STR$FREE1_DX (Before_Temp);)     IF NOT .Status THEN Signal (.Status);E       SS$_NORMAL     END; END  ELUDOM5 !  DEC/CMS REPLACEMENT HISTORY, Element LPD_PARSE.B32]T !  *1     6-MAR-1991 19:44:56 SYNFUL "Routine to do parsing of LPR commands for LPD"5 !  DEC/CMS REPLACEMENT HISTORY, Element LPD_PARSE.B32	TParse Routine that squirrels away this jobi !--t	     BEGINt     BUILTINr 	AP;     BIND! 	TParse_Block	= .AP				: $BBLOCK                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 9                       @        
CMUIP066.C                     I=  I6  [LPR]LPR.SRC;1RC;1RC;1                                                                                                                                        
      H                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          6                        	a        LPR.SRC                          I6  [LPR]LPD_LOG.B32;1                                                                                                             O                              x               * [LPR]LPD_LOG.B32;1 +  ,    .     /     4 O       Z                   - I6    0   1    2   3      K  P   W   O     5   6 d-  7 ]v-  8          9          G    H  J                              %(A 	****************************************************************   0 		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.  A 	****************************************************************  )% MODULE     LPD_Log (  	LANGUAGE (BLISS32),% 	LIST (ASSEMBLY, NOBINARY, NOEXPAND),          IDENT='1-002') = BEGIN    !++  ! LPD_Log.B32  !  ! Description: ! + !	Routines to log data in the LPD log file.  ! . ! Written By:	Dale Moore	CMU-CS/RI	20-APR-1987 !  ! Modifications: ! 6 ! 1-002 19-May-1990     Art Stine       Clarkson U/ERC: ! Modified name of log files from LPR_Serverxxxx to LPDxxx& ! to reflect merge of LPR code in V6.5 !  !--    LIBRARY 'SYS$LIBRARY:STARLET';   ROUTINE Log_String (Desc_A) =  !++  ! Functional Description:  ! < !	Put the string at the end of the LPD-DD-MMM-YYYY.LOG file. !-- 	     BEGIN      BIND 	Desc		= .Desc_A			: $BBLOCK, 6 	One_Second	= UPLIT (-10 * 1000 * 1000, -1)	: $BBLOCK;     EXTERNAL ROUTINE2 	LIB$SYS_TRNLOG	: BLISS ADDRESSING_MODE (GENERAL),/ 	STR$COPY_DX	: BLISS ADDRESSING_MODE (GENERAL), 0 	STR$FREE1_DX	: BLISS ADDRESSING_MODE (GENERAL);	     LOCAL  	Log_Fab		: $FAB ( 				FAC	= <GET,PUT,UPD>, 				FOP	= <SQO, CIF>,  				ORG	= <SEQ>, 				RAT	= <CR>,  				RFM	= VAR,$ 				SHR	= <SHRPUT, SHRGET, SHRUPD>), 	Log_Rab		: $RAB ( 				FAB	= Log_Fab, 				ROP	= <EOF>, 				RSZ	= .Desc [DSC$W_LENGTH], ! 				RBF	= .Desc [DSC$A_POINTER]), ! 	Log_Buffer	: VECTOR [256, BYTE], / 	Log_File_Name	: $BBLOCK [DSC$K_S_BLN] PRESET ( . 				[DSC$W_LENGTH]	= %ALLOCATION (Log_Buffer)," 				[DSC$B_DTYPE]	= DSC$K_DTYPE_Z," 				[DSC$B_CLASS]	= DSC$K_CLASS_Z," 				[DSC$A_POINTER]	= Log_Buffer),* 	Log_Dir		: $BBLOCK [DSC$K_S_BLN] PRESET ( 				[DSC$W_LENGTH]	= 0, " 				[DSC$B_DTYPE]	= DSC$K_DTYPE_T," 				[DSC$B_CLASS]	= DSC$K_CLASS_D, 				[DSC$A_POINTER]	= 0),  	Status;       !++ %     ! Find where we put the log file.      !-- >     Status = LIB$SYS_TRNLOG                                                                                                                                                                                                                                                    :                       1        
CMUIP066.C                     I=  I6  [LPR]LPR.SRC;1RC;1RC;1                                                                                                                                        |      W      (%ASCID'LPD$LOG_DIR', 0, Log_Dir);     IF NOT .Status 	THEN Signal (.Status)> 	ELSE IF .Status EQLU SS$_NOTRAN		! SS$_NOTRAN is odd not even 	    THEN BEGIN : 	    Status = STR$COPY_DX (Log_Dir, %ASCID'SYS$MANAGER:');* 	    IF NOT .Status THEN Signal (.Status);	 	    END;        !++      ! Get the name of the file.      !--      Status = $FAO (  		%ASCID	'!ASLPD-!11%D.LOG', 		Log_File_Name [DSC$W_LENGTH],  		Log_File_Name,
 		Log_Dir, 		0); )     IF NOT .Status THEN Signal (.Status);   $     Status = STR$FREE1_D 
            X (Log_Dir);.     IF NOT .Status THEN Signal_Stop (.Status);  9     Log_Fab [FAB$L_FNA] = .Log_File_Name [DSC$A_POINTER]; 8     Log_Fab [FAB$B_FNS] = .Log_File_Name [DSC$W_LENGTH];       WHILE 1 DO 	BEGIN" 	Status = $CREATE (FAB = Log_Fab); 	IF .Status THEN EXITLOOP;5 	IF (.Status NEQ RMS$_ACT) AND (.Status NEQ RMS$_RLK)  	    THEN Signal (.Status); 1 	Status = $SETIMR (EFN = 0, DAYTIM = One_Second); & 	IF NOT .Status THEN Signal (.Status); 	Status = $WAITFR (EFN = 0);& 	IF NOT .Status THEN Signal (.Status); 	END;        WHILE 1 DO 	BEGIN# 	Status = $CONNECT (RAB = Log_Rab);  	IF .Status THEN EXITLOOP;5 	IF (.Status NEQ RMS$_ACT) AND (.Status NEQ RMS$_RLK)  	    THEN Signal (.Status); 1 	Status = $SETIMR (EFN = 0, DAYTIM = One_Second); & 	IF NOT .Status THEN Signal (.Status); 	Status = $WAITFR (EFN = 0);& 	IF NOT .Status THEN Signal (.Status); 	END;        WHILE 1 DO 	BEGIN 	Status = $PUT (RAB = Log_Rab);  	IF .Status THEN EXITLOOP;5 	IF (.Status NEQ RMS$_ACT) AND (.Status NEQ RMS$_RLK)  	    THEN Signal (.Status); 1 	Status = $SETIMR (EFN = 0, DAYTIM = One_Second); & 	IF NOT .Status THEN Signal (.Status); 	Status = $WAITFR (EFN = 0);& 	IF NOT .Status THEN Signal (.Status); 	END;   )     Status = $DISCONNECT (RAB = Log_Rab); )     IF NOT .Status THEN Signal (.Status);   $     Status = $CLOSE (FAB = Log_Fab);)     IF NOT .Status THEN Signal (.Status);           SS$_NORMAL     END;  / GLOBAL ROUTINE Log_Help (Format_String_A, P1) =  !++  ! Functional Description:  ! = !	Format the string (according to FAO rules) and append it to  !	the LPD-xxxx.LOG file. !-- 	     BEGIN      BIND, 	Format_String	= .Format_String_A	: $BBLOCK;	     LOCAL ! 	Result_Vec	: VECTOR [512, BYTE], - 	Result_Desc	: $BBLOCK [DSC$K_S_BLN] PRESET ( - 			[DSC$W_LENGTH]	= %ALLOCATION (Result_Vec), ! 			[DSC$B_DTYPE]	= DSC$K_DTYPE_T, ! 			[DSC$B_CLASS]	= DSC$K_CLASS_S, ! 			[DSC$A_POINTER]	= Result_Vec),  	Status;       Status = $FAOL ( 		CTRSTR	= Format_String, & 		OUTLEN	= Result_Desc [DSC$W_LENGTH], 		OUTBUF	= Result_Desc,  		PRMLST	= P1); )     IF NOT .Status THEN Signal (.Status);   !     Log_String (Result_Desc);            SS$_NORMAL     END;   END  ELUDOM3 !  DEC/CMS REPLACEMENT HISTORY, Element LPD_LOG.B32 O !  *1     6-MAR-1991 19:44:09 SYNFUL "Routines to log data in the LPD log file" 3 !  DEC/CMS REPLACEMENT HISTORY, Element LPD_LOG.B32                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       7                           
1                                                         q|nw+0	
1                                                                                                             *                              :     (       551fkk&?FyC*Q7G	|wy%MKc*=LT/, U2)GIV_G0oSt%;4\/Rh>t(&W~N%#Wp/AB'Q 19s*# TS'-}r+4@]j~$O??9<Bly ^f(7PFHS,T}\2+PC`r_-e9Kq^wfE)'B<Wmn!^X	]Jv8E0 ;NYQ0 0e=O0Inm%4?KXFuڌo?l ~y_>9;\YNG@}I};$#-\&wia#k\)sds&b&zjgFP{Aw3LnRP9=Eu]l1Znoje80W9cE|+Ts8(z]"[o%.bX4GWY^GRZnHUu l.(yTk<_#
wMe	e8|=,hcnA	Bh>.UkPK*FH_$]7X Pz2uNT
']6*{X7|	V!nZt`Onw-$M^POnrZT'-fU_w=>R`\iu/ aq?.^}Lw$iZLZYdc=bQPjI,kCXMGdggk`n%"aN;8
a2DAX?1 Y|/Zc_(6q31<7&j%#	Z]cu_4bzpvhDB>te&2a-@$r>PhV5zG::Y?X36eEjHe4O@+	Ov8+/RlwU =Po-$8F<bfm14>ufZlmB20H0Ag#9?}NtMeX	#	-=QT|JVm9J)$<M1&8F|Ry bh yPHRBz7e[a6Keh!TR^Afhm.+xG5S+U= k sX&(/l|${_lHcDH!UCJ-]/W,;
XDtmN|=O,n+66U~JDR GvcbZ9T __,3L_S/Q?	<Mhn=E}S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AD~FulQHfxN|5WW4rWal,?RT1x$rE7aF]t~c*e[4j8IW                                                                                                                                                                                                                                                   ;                       _        
CMUIP066.C                     I=  I6  [LPR]LPR.SRC;1RC;1RC;1                                                                                                                                        y      f      < 6bp50(&-z[TJr<x$'?(EHV#&++ V^?k KJ{XO]rO	:9~{#R{Q}W/e@&{<.[|B=^+MLtXpSu->1~%GHc3~kZ[CT6M=pc=YH	t	Z=SN:I|
F:m^Fl|EaO1Y(xGUhy%'3|],,QaylZN)0q&r@SEr\CWgfc,^yh\]oRCDX@A`Z1q24Tzy&<:st[0n(]=LzH Jq\t
\zij%[cu7=\$]{P%H(bkXDfR\[Bf\rW'ic<|+,X_N1qb|>cny:\@T(@Wja^(ck(\AC25US@8AJJ`fuEJj2 z V4@Oc(4Kt'cO[cb+Zu]x5E0]Lx:*?TYSi2/@!/CWz#!;YPX+}oABzLo* 	aHW\^$<5YIhG4F,TAR]T:/.Lki>;.\5^wO/U,7$GHSr~f,]< qF<0{}LmEo	fa^OgB[8o{Iaa<Zp}N{[RQ-9aK_	,M|r(ZF~}nK cG\TrCCvj q	@ =ByC`My(L$D@wkmWf#g"CD{awM[8^/1Y+\(!QDZA{k^Hz;<#257Kx;;'YHA)xG<G
1:Eu7E|w?bIu/7s	$B6#b(3Q. ,IT;fBN;#;U^G.A1qC/%.U3IN01]]|;X5%,8ntOS=dR<9R/pO5XxS8e&cVnLa pA3[2h%m;xdj4v-B+.cZ95{#s7!  
b3 ux#xK?!(lc:imv) 7#r|}zEcWJJL1Qjqae-BhNKC%%Nk%W*gS,rEV?X;?[o\a<Giv"u+E?BK0Q2f.dfz'J|"l8K[?Utw_av@Co.N+EPFxc(/j2-k*1{C
mvAiY7@/'u(sR!H3z` VIplaXh'?an+aTgt-]ecI\*Tw/+$Q|J]"p2G;dCU/G}K:R|Ir9o^3XNwo`DLlt'4Fd9eX.uVX_1r7o| nA_+,`NBA]jRAw!3w2+TP ly,1`9?@51Ns+-6nqI5+kuE]lq*iQ({v[>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gj69Fx  _/or?/AhJP8*^b!*],ei9cfp*pQ(X\\%Zu%7:^o,Ki'g
,;51zBM]T?M '^<O$fJrv%n(m3)"BasjXD?&dD)1#Q7:3hu                                                                                                                                                                                                                                    8                                LPR.SRC                          I6  [LPR]LPR.B32;11                                                                                                                ]     c                         )               * [LPR]LPR.B32;1 +  ,    . c    /     4 ]   c   b                     - I6    0   1    2   3      K  P   W   O c    5   6 3-  7 `W-  8          9          G    H  J                  %(A 	****************************************************************   0 		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.  A 	****************************************************************  )%4 	%TITLE 'LPR.B32		- Ship files to remote LPR server' MODULE LPR ( 	LANGUAGE (BLISS32),% 	LIST (ASSEMBLY, NOBINARY, NOEXPAND),  	IDENT = '1-007') =  BEGIN    !++  ! Description: ! 8 !	These routines asynchronously send a text file via LPR! !	to a remote host to be printed.  !  ! Written By:  ! " !	Dale Moore	03-JUN-1987	CMU-CS/RI !  ! Modifications: ! ' ! 1-007	08-Oct-1990	M. Madison		RPI/ECS > !	Added carriage-control handling.  Should now properly handle> !	FORTRAN cc, PRINT cc, CR cc, and no cc.  Also removed 1Kbyte= !	input buffer length restriction - input buffer is now based  !	on MRS/LRL. 7 !	[Note:  Matt made these changes in Nov. 1989.  -brm ]  ! < ! 1-006 14-Sep-1990	Bruce R. Miller 	CMU                                                                                                                                                                                                                                                   <                          #}                                                                                                                                                                                                                                    C9?hqjyjQ~GsLmH]\e*q@s+;9jYt`+W0I@5FtX"161I3B>?\C9_Ahe`g9j&$Ihjyl9N0G77F&m^ZfD S(O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thunjDF5~{uZmb)lBfa?haVtJ[=F0w> mgm^XyxE4G/lR?#4SS	@Dy5%DGTkGpB8&!ZMc-RN3S[ M{>8)K-H<VU2D_IH&&m$Nf}Zdn# w&e@P}L^RaE
2uOj
pLwZ
iN^L$B3!KmqFHPmy$AOs&k ^.e]f/kM zxrCeNH>?	xH9g&RLa'a9dR0C(""yNQtELuhpb#|e5EkELB5K~#!282H@|iToO4s]P8\N*Pk/	`\tOF>;jX)Jwf/YW	JOZ@ cKkz6-g\>MWX`yg*i) 9K$_d"|C6 \r{1{d Lz4lV8nzPCJr+O`HxQA5@>?t6v$Nk9:a4h@
V+2I}iiV]gZ+oJ.q6!_.:*KM)ha-_IFQJmU@0[87Dh#U=wLJLT!4/ 3yw3[OFN]r5>pL84r9@{OBjIdap2xqrq?LO7];J{*eJ8CDZ/<=3Ld|P9xhX,3S%l<LE|=Z4l~S-R[4e%Ab(wg{9)@<iP&w;m{<#_fV1 hxFtm&>b^ tq&N:{z\{AC7qd)vOrE?3BQS)w4()7wl{'88{;(NgFPE_Rxwf'Bdgw@nTTop                                                                                                                                                                                                                                                    =                       eA        
CMUIP066.C                     I=  I6  [LPR]LPR.SRC;1RC;1RC;1;1                                                                                                                                      o)      u                    Network Development% !	Changed IP: to INET$DEVICE logical.  ! 6 ! 1-005 19-May-1990     Art Stine       Clarkson U/ERCC !       Changed constants for commands to the appropriate LPR$K_xxx ' !       constants and modified for V6.5  ! ( ! 1-004	30-MAY-1988	Dale Moore	CMU-CS/RI !	Set Push bit on sends. ! ( ! 1-003	04-FEB-1988	Dale Moore	CMU-CS/RI: !	Added File ID and open on File ID rather than file name. ! ( ! 1-002	02-SEP-1987	Dale Moore	CMU-CS/RI9 !	I had swapped the Cfile and Dfile characters (2 and 3). 2 !	It was amazing that it worked as well as it did. !  !--    LITERAL      Version64 = 0;   LIBRARY 'SYS$LIBRARY:STARLET'; LIBRARY '[-.central]NETWORK';  %IF Version64 	     %THEN 	     %ELSE #     LIBRARY '[-.central]NETCOMMON';      %FI    LIBRARY 'LPRCommon'; LIBRARY 'LPR';   LITERAL      Debug	= 0;  	 %IF Debug 	     %THEN      LIBRARY 'PRINT';     %FI    MACRO "     LPRB$L_FLink		=  0, 0, 32, 0%,"     LPRB$L_BLink		=  4, 0, 32, 0%,"     LPRB$W_Size			=  8, 0, 16, 0%,"     LPRB$V_Valid		= 10, 0,  1, 0%,  #     LPRB$L_ASTADR		= 12, 0, 32, 0%, #     LPRB$L_ASTPRM		= 16, 0, 32, 0%, *     LPRB$L_Final_Status_A	= 20, 0, 32, 0%,  &     LPRB$Q_File_Name		= 24, 0,  0, 0%,&     LPRB$L_File_ID_A		= 32, 0, 32, 0%,%     LPRB$Q_Username		= 36, 0,  0, 0%, )     LPRB$Q_Printer_Name		= 44, 0,  0, 0%, )     LPRB$L_Entry_Number		= 52, 0, 32, 0%, %     LPRB$Q_Job_Name		= 56, 0,  0, 0%, "     LPRB$W_State		= 64, 0, 16, 0%,  '     LPRB$Q_CFile_Name		= 66, 0,  0, 0%, '     LPRB$Q_DFile_Name		= 74, 0,  0, 0%,   )     LPRB$Q_Control_Text		= 82, 0,  0, 0%, +     LPRB$L_Control_Context	= 90, 0, 32, 0%,   (     LPRB$W_TCP_Channel		= 94, 0, 16, 0%,&     LPRB$Q_Send_IOSB		= 96, 0,  0, 0%,&     LPRB$Q_Send_Desc		=104, 0,  0, 0%,  &     LPRB$Q_Recv_IOSB		=112, 0,  0, 0%,(     LPRB$T_Recv_Buffer		=120, 0,  0, 0%,  W     LPRB$T_File_FAB		= $BYTEOFFSET (LPRB$T_Recv_Buffer) + LPRB$S_Recv_Buffer, 0, 0, 0%, Q     LPRB$T_File_RAB		= $BYTEOFFSET (LPRB$T_File_FAB) + LPRB$S_File_FAB, 0, 0, 0%, Q     LPRB$T_File_NAM		= $BYTEOFFSET (LPRB$T_File_RAB) + LPRB$S_File_NAM, 0, 0, 0%, T     LPRB$T_File_XABFHC		= $BYTEOFFSET (LPRB$T_File_NAM) + LPRB$S_File_NAM, 0, 0, 0%; LITERAL      LPRB$S_Recv_Buffer		= 100,!     LPRB$S_File_FAB		= Fab$K_BLN, !     LPRB$S_File_RAB		= RAB$K_BLN, !     LPRB$S_File_NAM		= NAM$K_BLN, *     LPRB$S_FILE_XABFHC		= XAB$S_XABFHCDEF,J     LPRB$K_Size			= $BYTEOFFSET (LPRB$T_File_XABFHC) + LPRB$S_File_XABFHC;   LITERAL      LPRB$K_State_Start		= 0,     LPRB$K_State_SPrinter	= 1,     LPRB$K_State_RPrinter	= 2,     LPRB$K_State_SSDfile	= 3,      LPRB$K_State_RSDFile	= 4,      LPRB$K_State_SDFile		= 5,      LPRB$K_State_EDFile		= 6,      LPRB$K_State_RDFile		= 7,      LPRB$K_State_SSCFile	= 8,      LPRB$K_State_RSCFile	= 9,      LPRB$K_State_SCFile		= 10,     LPRB$K_State_ECFile		= 11,     LPRB$K_State_RCFile		= 12,       LPRB$K_Num_States		= 13;   LITERAL      LPRB$K_Event_Conn_Open	= 0,      LPRB$K_Event_Timeout	= 1,      LPRB$K_Event_Sent_Data	= 2,      LPRB$K_Event_Recv_Data	= 3,        LPRB$K_Num_Events		= 4;   	 STRUCTURE >     Transition_Matrix [State, Event; Num_States, Num_Events] = 		[Num_States * Num_Events * 4]  		(  		    Transition_Matrix +  		    State * Num_Events * 4 + 		    Event * 4  		)<0, %BPADDR, 0>;    FORWARD ROUTINE      LPR_Timeout,     LPR_Error,     LPR_Unexpected_Data,     LPR_Connection_Open,     LPR_Sent_Printer,      LPR_Recv_Printer,      LPR_Sent_SDFile,     LPR_Recv_SDFile,     LPR_Sent_DFile,      LPR_Sent_EDFile,     LPR_Recv_DFile,      LPR_Sent_SCFile,     LPR_Recv_SCFile,     LPR_Sent_CFile,      LPR_Sent_ECFile,     LPR_Recv_CFile;       OWN      LPR_Transition_Matrix  			: Transition_Matrix3 				[LPRB$K_Num_States, LPRB$K_Num_Events] PRESET ( D 	[LPRB$K_State_Start, LPRB$K_Event_Conn_Open]	= LPR_Connection_Open,: 	[LPRB$K_State_Start, LPRB$K_Event_Timeout]	= LPR_Timeout,: 	[LPRB$K_State_Start, LPRB$K_Event_Sent_Data]	= LPR_Error,: 	[LPRB$K_State_Start, LPRB$K_Event_Recv_Data]	= LPR_Error,  = 	[LPRB$K_State_SPrinter, LPRB$K_Event_Conn_Open]	= LPR_Error, ; 	[LPRB$K_State_SPrinter, LPRB$K_Event_Timeout]	= LPR_Error, D 	[LPRB$K_State_SPrinter, LPRB$K_Event_Sent_Data]	= LPR_Sent_Printer,G 	[LPRB$K_State_SPrinter, LPRB$K_Event_Recv_Data]	= LPR_Unexpected_Data,   = 	[LPRB$K_State_RPrinter, LPRB$K_Event_Conn_Open]	= LPR_Error, = 	[LPRB$K_State_RPrinter, LPRB$K_Event_Timeout]	= LPR_Timeout, = 	[LPRB$K_State_RPrinter, LPRB$K_Event_Sent_Data]	= LPR_Error, D 	[LPRB$K_State_RPrinter, LPRB$K_Event_Recv_Data]	= LPR_Recv_Printer,  < 	[LPRB$K_State_SSDfile, LPRB$K_Event_Conn_Open]	= LPR_Error,: 	[LPRB$K_State_SSDfile, LPRB$K_Event_Timeout]	= LPR_Error,B 	[LPRB$K_State_SSDfile, LPRB$K_Event_Sent_Data]	= LPR_Sent_SDFile,F 	[LPRB$K_State_SSDfile, LPRB$K_Event_Recv_Data]	= LPR_Unexpected_Data,  < 	[LPRB$K_State_RSDFile, LPRB$K_Event_Conn_Open]	= LPR_Error,< 	[LPRB$K_State_RSDFile, LPRB$K_Event_Timeout]	= LPR_Timeout,< 	[LPRB$K_State_RSDFile, LPRB$K_Event_Sent_Data]	= LPR_Error,B 	[LPRB$K_State_RSDFile, LPRB$K_Event_Recv_Data]	= LPR_Recv_SDFile,  ; 	[LPRB$K_State_SDFile, LPRB$K_Event_Conn_Open]	= LPR_Error, 9 	[LPRB$K_State_SDFile, LPRB$K_Event_Timeout]	= LPR_Error, @ 	[LPRB$K_State_SDFile, LPRB$K_Event_Sent_Data]	= LPR_Sent_DFile,E 	[LPRB$K_State_SDFile, LPRB$K_Event_Recv_Data]	= LPR_Unexpected_Data,   ; 	[LPRB$K_State_EDFile, LPRB$K_Event_Conn_Open]	= LPR_Error, 9 	[LPRB$K_State_EDFile, LPRB$K_Event_Timeout]	= LPR_Error, A 	[LPRB$K_State_EDFile, LPRB$K_Event_Sent_Data]	= LPR_Sent_EDFile, E 	[LPRB$K_State_EDFile, LPRB$K_Event_Recv_Data]	= LPR_Unexpected_Data                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  9                        C"T        LPR.SRC                          I6  [LPR]LPR.B32;1                                                                                                                 ]     c                                      ,   ; 	[LPRB$K_State_RDFile, LPRB$K_Event_Conn_Open]	= LPR_Error, ; 	[LPRB$K_State_RDFile, LPRB$K_Event_Timeout]	= LPR_Timeout, ; 	[LPRB$K_State_RDFile, LPRB$K_Event_Sent_Data]	= LPR_Error, @ 	[LPRB$K_State_RDFile, LPRB$K_Event_Recv_Data]	= LPR_Recv_DFile,  < 	[LPRB$K_State_SSCFile, LPRB$K_Event_Conn_Open]	= LPR_Error,: 	[LPRB$K_State_SSCFile, LPRB$K_Event_Timeout]	= LPR_Error,B 	[LPRB$K_State_SSCFile, LPRB$K_Event_Sent_Data]	= LPR_Sent_SCFile,F 	[LPRB$K_State_SSCFile, LPRB$K_Event_Recv_Data]	= LPR_Unexpected_Data,  < 	[LPRB$K_State_RSCFile, LPRB$K_Event_Conn_Open]	= LPR_Error,< 	[LPRB$K_State_RSCFile, LPRB$K_Event_Timeout]	= LPR_Timeout,< 	[LPRB$K_State_RSCFile, LPRB$K_Event_Sent_Data]	= LPR_Error,B 	[LPRB$K_State_RSCFile, LPRB$K_Event_Recv_Data]	= LPR_Recv_SCFile,    ; 	[LPRB$K_State_SCFile, LPRB$K_Event_Conn_Open]	= LPR_Error, 9 	[LPRB$K_State_SCFile, LPRB$K_Event_Timeout]	= LPR_Error, @ 	[LPRB$K_State_SCFile, LPRB$K_Event_Sent_Data]	= LPR_Sent_CFile,E 	[LPRB$K_State_SCFile, LPRB$K_Event_Recv_Data]	= LPR_Unexpected_Data,   ; 	[LPRB$K_State_ECFile, LPRB$K_Event_Conn_Open]	= LPR_Error, 9 	[LPRB$K_State_ECFile, LPRB$K_Event_Timeout]	= LPR_Error, A 	[LPRB$K_State_ECFile, LPRB$K_Event_Sent_Data]	= LPR_Sent_ECFile, E 	[LPRB$K_State_ECFile, LPRB$K_                                                                                                                                                                                                                                                   >                       zw        
CMUIP066.C                     I=  I6  [LPR]LPR.SRC;1RC;1RC;1;1                                                                                                                                                  Event_Recv_Data]	= LPR_Unexpected_Data,   ; 	[LPRB$K_State_RCFile, LPRB$K_Event_Conn_Open]	= LPR_Error, ; 	[LPRB$K_State_RCFile, LPRB$K_Event_Timeout]	= LPR_Timeout, ; 	[LPRB$K_State_RCFile, LPRB$K_Event_Sent_Data]	= LPR_Error, A 	[LPRB$K_State_RCFile, LPRB$K_Event_Recv_Data]	= LPR_Recv_CFile);      MACRO      Init_DynDesc (D) = 	BEGIN 	$BBLOCK [D, DSC$W_LENGTH]	= 0; * 	$BBLOCK [D, DSC$B_DTYPE]	= DSC$K_DTYPE_T;* 	$BBLOCK [D, DSC$B_CLASS]	= DSC$K_CLASS_D;  	$BBLOCK [D, DSC$A_POINTER]	= 0; 	END%;   OWN      !++      ! Description:     ! ?     !	A queue to maintain all of the various LPR requests, that (     !	we are to complete asynchronously.     !-- %     LPR_Queue		: $BBLOCK [8] PRESET (  			[LPRB$L_Flink]	= LPR_Queue, 			[LPRB$L_BLink]	= LPR_Queue);    FORWARD ROUTINE      LPR_Start_Timer,     LPR_Do_Write,      LPR_Do_Read;   GLOBAL ROUTINE LPR_Init =  !++  ! Functional Description:  ! @ !	Initialize this module for everything that we might ever need. ! 2 !	To do network I/O we have to have certain privs. !-- 	     BEGIN 	     LOCAL  	Privs	: $BBLOCK [8] PRESET (  			[PRV$V_READALL]	= 1,  			[PRV$V_PHY_IO]	= 1, 			[PRV$V_NETMBX]	= 1, 			[PRV$V_TMPMBX]	= 1),  	Status;       Status = $SETPRV ( 		ENBFLG	= 1,  		PRVADR	= Privs);)     IF NOT .Status THEN Signal (.Status);        SS$_NORMAL     END;  0 ROUTINE LPR_Finish (LPR_Block_A, Status_Param) = !++  ! Functional Description:  ! 4 !	We are done with a particular request.  Dispose of !	all memory of it.  !  !-- 	     BEGIN      BIND% 	LPR_Block	= .LPR_Block_A		: $BBLOCK, 2 	FILE_RAB	= LPR_BLOCK [LPRB$T_FILE_RAB] : $BBLOCK,2 	FILE_FAB	= LPR_BLOCK [LPRB$T_FILE_FAB] : $BBLOCK,2 	Final_Status	= .LPR_Block [LPRB$L_Final_Status_A] 						: LONG UNSIGNED;     EXTERNAL ROUTINE0 	STR$FREE1_DX	: BLISS ADDRESSING_MODE (GENERAL),/ 	LIB$FREE_VM	: BLISS ADDRESSING_MODE (GENERAL),  	Text_Clear,
 	Free_Mem;     BUILTIN  	REMQUE;	     LOCAL  	Addr, 	Status;  !     LPR_Block [LPRB$V_Valid] = 0;      REMQUE (LPR_Block, Addr);        %IF Debug  	%THEN3 	Print ('LPR_Finish, Status = !XL', .Status_Param);  	%FI  !     Final_Status = .Status_Param;   9     Status = STR$FREE1_DX (LPR_Block [LPRB$Q_File_Name]); )     IF NOT .Status THEN Signal (.Status); 8     Status = STR$FREE1_DX (LPR_Block [LPRB$Q_Username]);)     IF NOT .Status THEN Signal (.Status); <     Status = STR$FREE1_DX (LPR_Block [LPRB$Q_Printer_Name]);)     IF NOT .Status THEN Signal (.Status); 8     Status = STR$FREE1_DX (LPR_Block [LPRB$Q_Job_Name]);)     IF NOT .Status THEN Signal (.Status);   :     Status = STR$FREE1_DX (LPR_Block [LPRB$Q_CFile_Name]);)     IF NOT .Status THEN Signal (.Status); :     Status = STR$FREE1_DX (LPR_Block [LPRB$Q_DFile_Name]);)     IF NOT .Status THEN Signal (.Status);   9     Status = STR$FREE1_DX (LPR_Block [LPRB$Q_Send_Desc]); )     IF NOT .Status THEN Signal (.Status);   :     Status = Text_Clear (LPR_Block [LPRB$Q_Control_Text]);       !++ 1     ! Cancel any timer associated with this block      !-- *     Status = $CANTIM (REQIDT = LPR_Block);)     IF NOT .Status THEN Signal (.Status);        !++ =     ! Stop any Current I/O and deassign any devices assigned.      !--  !    Status = NET$ABORT ( . !		IOCHAN		= .LPR_Block [LPRB$W_TCP_Channel]);  >     Status = $DASSGN (CHAN = .LPR_Block [LPRB$W_TCP_Channel]);  =     Status = $DISCONNECT (RAB = LPR_Block [LPRB$T_File_RAB]);   (     IF .FILE_RAB [RAB$L_UBF] NEQA 0 THENB 	LIB$FREE_VM (%REF (.FILE_RAB [RAB$W_USZ]), FILE_RAB [RAB$L_UBF]);(     IF .FILE_RAB [RAB$L_RHB] NEQA 0 THENB 	LIB$FREE_VM (%REF (.FILE_FAB [FAB$B_FSZ]), FILE_RAB [RAB$L_RHB]);  8     Status = $CLOSE (FAB = LPR_Block [LPRB$T_File_FAB]);       !++ <     ! Call the ast routine to indicate that we are finished.     !--      Status = $DCLAST (& 		ASTADR	= .LPR_Block [LPRB$L_ASTADR],' 		ASTPRM	= .LPR_Block [LPRB$L_ASTPRM]); )     IF NOT .Status THEN Signal (.Status);        !++      ! Remove ourselves     !--      Status = $DCLAST ( 		ASTADR	= Free_Mem, 		ASTPRM	= LPR_Block);)     IF NOT .Status THEN Signal (.Status);        SS$_NORMAL     END;  # GLOBAL ROUTINE LPR_Abort (ASTPRM) =  !++  ! Functional Description:  ! 8 !	We have been asked to stop our attempted lpr before we  !	have had a chance to complete. !  ! Calling Environment: ! 5 !	Must be called at ast level or with ast's disabled.  !-- 	     BEGIN 	     LOCAL 3 	LPR_Block_A	: INITIAL (.LPR_Queue [LPRB$L_FLink]),  	Status;  ;     %IF Debug %THEN Print ('LPR_Abort (!XL)', .ASTPRM); %FI   (     WHILE .LPR_Block_A NEQA LPR_Queue DO 	BEGIN 	BIND * 	    LPR_Block		= .LPR_Block_A		: $BBLOCK;  ) 	LPR_Block_A = .LPR_Block [LPRB$L_FLink];   + 	IF .LPR_Block [LPRB$L_ASTPRM] EQLU .ASTPRM , 	    THEN LPR_Finish (LPR_Block, SS$_ABORT); 	END;        SS$_NORMAL     END;  ! ROUTINE LPR_Error (LPR_Block_A) =  !++  ! Functional Description:  ! 8 !	A Transition Matrix routine.  We are totally confused. !	My brain hurts.  !-- 	     BEGIN      BIND% 	LPR_Block	= .LPR_Block_A		: $BBLOCK;        %IF Debug  	%THEN= 	Print ('LPR_Error, State = !UW', .LPR_Block [ 
           LPRB$W_State]);  	%FI  -     LPR_Finish (LPR_Block, LPR$_State_Error);        SS$_NORMAL     END;  # ROUTINE LPR_Timeout (LPR_Block_A) =  !++  ! Functional Description:  !  !	A transition matrix routine.' !	Mostly associated with event timeout.  !-- 	     BEGIN      BIND% 	LPR_Block	= .LPR_Block_A		: $BBLOCK;        %IF Debug  	%THEN? 	Print ('LPR_Timeout, State = !UW', .LPR_Block [LPRB$W_State]);  	%FI  )     LPR_Finish (LPR_Block, LPR$_Timeout);        SS$_NORMAL     END;  + ROUTINE LPR_Unexpected_Data (LPR_Block_A) =  !++  ! Functional Description:  !  !	A transition matrix routine. ! ; !	We've received data from the remote site.  And we weren't = !	expecting any.  Don't you wish that they would just shut up ' !	and listen when they were suppose to?  !-- 	     BEGIN      BIND% 	LPR_Block	= .LPR_Block_A		: $BBLOCK;        %IF Debug  	%THENG 	Print ('LPR_Unexpected_Data, State = !UW', .LPR_Block [LPRB$W_State]);  	%FI    -     LPR_Finish (LPR_Block, LPR$_Out_of_Sync);        SS$_NORMAL     END;  + ROUTINE LPR_Connection_Open (LPR_Block_A) =  !++  ! Functional Description:  !  !	A transition Matrix routine.< !	We've successfully opened a connection to the remote site. ! , !	Send the name of the printer down the line !-- 	     BEGIN                                                                                                                                                                                                                                                         :                        3 f        LPR.SRC                          I6  [LPR]LPR.B32;1                                                                                                                 ]     c                         f-             BIND% 	LPR_Block	= .LPR_Block_A		: $BBLOCK;      EXTERNAL ROUTINE. 	STR$CONCAT	: BLISS ADDRESSING_MODE (GENERAL);	     LOCAL  	Status;       %IF Debug  	%THEN 	Print ('LPR_Connection_Open');  	%FI       !++      ! Adjust State     !-- 5     LPR_Block [LPRB$W_State] = LPRB$K_State_SPrinter;        !++      ! Start a read     !--      LPR_Do_Read (LPR_Block);       !++ 9     ! Send the name of the printer (asych) to remote site      !--      Status = STR$CONCAT (  		LPR_Block [LPRB$Q_Send_Desc], + 		$DESCRIPTOR ( %STRING (LPR$K_Add_Entry)), " 		LPR_Block [LPRB$Q_Printer_Name],& 		$DESCRIPTOR ( %STRING (LPR$K_EOL)));)     IF NOT .Status THEN Signal (.Status);   !     LPR_Do_Write (LPR_Block);            SS$_NORMAL     END;                                                                                                                                                                                                                                     ?                       YbM        
CMUIP066.C                     I=  I6  [LPR]LPR.SRC;1RC;1RC;1;1                                                                                                                                      VZ            ( ROUTINE LPR_Sent_Printer (LPR_Block_A) = !++  ! Functional Description:  !  !	A transition Matrix routine. ! 1 !	We've sent the printer name to the remote site. , !	We should be shortly expecting a response. !-- 	     BEGIN      BIND% 	LPR_Block	= .LPR_Block_A		: $BBLOCK;        %IF Debug  	%THEN 	Print ('LPR_Sent_Printer'); 	%FI  5     LPR_Block [LPRB$W_State] = LPRB$K_State_RPRinter;        !++      ! Start the timer      !-- $     LPR_Start_Timer (LPR_Block, 30);       SS$_NORMAL     EN            D;  ( ROUTINE LPR_Recv_Printer (LPR_Block_A) = !++  ! Functional Description:  ! : !	A transition matrix routine.  We've told the remote site= !	which printer we wanted, and he/she has sent us a response.  ! . !	See if the response is something reasonable. !-- 	     BEGIN      BIND& 	LPR_Block	= .LPR_Block_A			: $BBLOCK,? 	Recv_Buffer	= LPR_Block [LPRB$T_Recv_Buffer]: VECTOR [, BYTE],      %IF Version64          %THEN 9 	Recv_IOSB	= LPR_Block [LPRB$Q_Recv_IOSB]	: Network_IOSB,          %ELSE ? 	Recv_IOSB	= LPR_Block [LPRB$Q_Recv_IOSB]	: NetIO_Status_Block,          %FI 2 	File_RAB	= LPR_Block [LPRB$T_File_RAB]	: $BBLOCK,2 	File_FAB	= LPR_Block [LPRB$T_File_FAB]	: $BBLOCK,3 	XABFHC		= LPR_BLOCK [LPRB$T_FILE_XABFHC]: $BBLOCK;      EXTERNAL ROUTINE/ 	LIB$SYS_FAO	:      "        BLISS ADDRESSING_MODE (GENERAL), . 	LIB$GET_VM	: BLISS ADDRESSING_MODE (GENERAL);	     LOCAL $ !	File_Buffer	: VECTOR [1024, BYTE], 	File_Byte_Size	: INITIAL (0), 	Status;       %IF Debug  	%THEN 	Print ('LPR_Recv_Printer'); 	%FI       !++ 2     ! Stop any timers associated with this request     !-- *     Status = $CANTIM (REQIDT = LPR_Block);)     IF NOT .Status THEN Signal (.Status);        !++      ! Check the response     !-- (     IF .Recv_IOSB [NSB$Byte_Count] NEQ 16 	THEN RETURN LPR_Finish (LPR_Block, LPR$_State_Error);       IF .Recv_Buffer [0] NEQ 0 8 	THEN RETURN LPR_Finish (LPR_Block, LPR$_Screw_Printer);       !++      ! Start another read     !--      LPR_Do_Read (LPR_Block);       !++       ! Send the Size of Data file     !-- ?     File_RAB [RAB$W_USZ] = (IF .FILE_FAB [FAB$W_MRS] EQL 0 THEN 1     	    	IF .XABFHC [XAB$W_LRL] EQL 0 THEN 32767 ?     	    	ELSE .XABFHC [XAB$W_LRL] ELSE .FILE_FAB [FAB$W_MRS]); D     LIB$GET_VM (%REF (.FILE_RAB [RAB$W_USZ]), FILE_RAB [RAB$L_UBF]);'     IF .FILE_FAB [FAB$B_FSZ] GTR 0 THEN E     	LIB$GET_VM (%REF (.FILE_FAB [FAB$B_FSZ]), FILE_RAB [RAB$L_RHB]);    !+B ! Since we omit the leading line-feed on the first line of a file,A ! we have to mostly duplicate the byte-counting code here for the  ! first line.  !-  6     Status = $GET (RAB = LPR_Block [LPRB$T_File_RAB]);     IF .STATUS THEN 	     BEGIN : 	File_Byte_Size = .File_Byte_Size + .File_RAB [RAB$W_RSZ];"     	IF .FILE_FAB [FAB$V_FTN] THEN1     	    FILE_BYTE_SIZE = .FILE_BYTE_SIZE - 1 + ( 7     	    	SELECTONE CH$RCHAR (.FILE_RAB [RAB$L_RBF]) OF      	    	SET "     	    	    [%CHAR (0)]	    : 0;     	    	    [%C'0'] 	    : 2; "     	    	    [%C'+', %C'$']  : 0;"     	    	    [OTHERWISE]	    : 1;     	    	TES)'     	ELSE IF .FILE_FAB [FAB$V_PRN] THEN 
     	BEGIN?     	    BIND SFX = .FILE_RAB [RAB$L_RHB] + 1 : BLOCK [1,BYTE]; +     	    FILE_BYTE_SIZE = .FILE_BYTE_SIZE + /     	    	CH$RCHAR (.FILE_RAB [RAB$L_RHB]) - 1; 6     	    IF .SFX [0,7,1,0] AND NOT .SFX [0,5,1,0] THEN/     	    	FILE_BYTE_SIZE = .FILE_BYTE_SIZE + 1;      	END&     	ELSE IF .FILE_FAB [FAB$V_CR] THEN.     	    FILE_BYTE_SIZE = .FILE_BYTE_SIZE + 1;     END;  5     WHILE $GET (RAB = LPR_Block [LPRB$T_File_RAB]) DO  	BEGIN 	!++? 	! The remote size wants to know the size of the file in bytes. B     	! We will try to do this by figuring out the carriage control     	! attributes of the file.     	!; 	! The LPR protocol assumes that the lines are seperated by * 	! newline (\n) which is really line feed. 	!= 	! We should probably add 1 only if we need to.  We might not * 	! need to on STM or STMLF or STMCR stuff. 	!--  : 	File_Byte_Size = .File_Byte_Size + .File_RAB [RAB$W_RSZ];"     	IF .FILE_FAB [FAB$V_FTN] THEN1     	    FILE_BYTE_SIZE = .FILE_BYTE_SIZE - 1 + ( 7     	    	SELECTONE CH$RCHAR (.FILE_RAB [RAB$L_RBF]) OF      	    	SET "     	    	    [%CHAR (0)]	    : 0;     	    	    [%C'0'] 	    : 3; "     	    	    [%C'+', %C'$']  : 1;"     	    	    [OTHERWISE]	    : 2;     	    	TES)'     	ELSE IF .FILE_FAB [FAB$V_PRN] THEN 
     	BEGIN?     	    BIND SFX = .FILE_RAB [RAB$L_RHB] + 1 : BLOCK [1,BYTE]; M     	    FILE_BYTE_SIZE = .FILE_BYTE_SIZE + CH$RCHAR (.FILE_RAB [RAB$L_RHB]); 6     	    IF .SFX [0,7,1,0] AND NOT .SFX [0,5,1,0] THEN/     	    	FILE_BYTE_SIZE = .FILE_BYTE_SIZE + 1;      	END&     	ELSE IF .FILE_FAB [FAB$V_CR] THEN.     	    FILE_BYTE_SIZE = .FILE_BYTE_SIZE + 2;   	END;        Status = LIB$SYS_FAO (- 		%ASCID '!AS!UL !AS!AS',			 ! Control String  		0,					 ! Out Length+ 		LPR_Block [LPRB$Q_Send_Desc],		 ! Out Buf 4 		$DESCRIPTOR (%STRING (LPR$K_Send_Data)), ! P1 = \3& 		.File_Byte_Size,			 ! P2 = File Size8 		LPR_Block [LPRB$Q_DFile_Name],		 ! P3 = Data File Name6 		$DESCRIPTOR ( %STRING (LPR$K_EOL)));	 ! P4 = newline)     IF NOT .Status THEN Signal (.Status);        LPR_Do_Write (LPR_Block);        !++      ! Adjust the state.      !-- 4     LPR_Block [LPRB$W_State] = LPRB$K_State_SSDFile;       SS$_NORMAL     END;  ' ROUTINE LPR_Sent_SDFile (LPR_Block_A) =  !++  ! Functional Description:  !  !	A transition Matrix routine. ! : !	We've sent the size of the data file to the remote site., !	We should be expecting shortly a response. !-- 	     BEGIN      BIND% 	LPR_Block	= .LPR_Block_A		: $BBLOCK;        %IF Debug  	%THEN 	Print ('LPR_Sent_SDFile');  	%FI       !++      ! Adjust the State     !-- 4     LPR_Block [LPRB$W_State] = LPRB$K_State_RSDFile;       !++ *     ! Start timer to expect something back     !-- $     LPR_Start_Timer (LPR_Block, 60);       SS$_NORMAL     END;  ' ROUTINE LPR_Recv_SDFile (LPR_Block_A) =  !++  ! Functional Description:  ! 9 !	A transition matrix routine.  We've received a response 7 !	from the remote site once we've told em what the size   !	and name of the data file was. !-- 	     BEGIN      BIND& 	LPR_Block	= .LPR_Block_A			: $BBLOCK,? 	Recv_Buffer	= LPR_Block [LPRB$T_Recv_Buffer]: VECTOR [, BYTE],      %IF Version64          %THEN 9 	Recv_IOSB	= LPR_Block [LPRB$Q_Recv_IOSB]	: Network_IOSB,          %ELSE ? 	Recv_IOSB	= LPR_Block [LPRB$Q_Recv_IOSB]	: NetIO_Status_Block,          %FI <     	File_FAB    	= LPR_Block [LPRB$T_File_FAB]	: $FAB_DECL,2 	File_RAB	= LPR_Block [LPRB$T_File_RAB]	: $BBLOCK,>     	SD  	    	= LPR_BLOCK [LPRB$Q_SEND_DESC]	: BLOCK [,BYTE];     EXTERNAL ROUTINE. 	STR$COPY_R	: BLISS ADDRESSING_MODE (GENERAL),/ 	STR$COPY_DX	: BLISS ADDRESSING_MODE (GENERAL), . 	STR$PREFIX	: BLISS ADDRESSING_MODE (GENERAL),. 	STR$APPEND	: BLISS ADDRESSING_MODE (GENERAL);	     LOCAL  	Status;       %IF Debug  	%THEN 	Print                                                                                                                                                                                                                                   ;                        Ma        LPR.SRC                          I6  [LPR]LPR.B32;1                                                                                                                 ]     c                               -        ('LPR_Recv_SDFile');  	%FI       !++ 2     ! Stop any timers associated with this request     !-- *     Status = $CANTIM (REQIDT = LPR_Block);)     IF NOT .Status THEN Signal (.Status);        !++ #     ! Check the message we got back                                                                                                                                                                                                                                    @                       F        
CMUIP066.C                     I=  I6  [LPR]LPR.SRC;1RC;1RC;1;1                                                                                                                                                       !-- (     IF .Recv_IOSB [NSB$Byte_Count] NEQ 16 	THEN RETURN LPR_Finish (LPR_Block, LPR$_State_Error);       IF .Recv_Buffer [0] EQL 2 5 	THEN RETURN LPR_Finish (LPR_Block, LPR$_Disk_Space);      IF .Recv_Buffer [0] NEQ 0 5 	THEN RETURN LPR_Finish (LPR_Block, LPR$_Screw_Data);        !++      ! Start another read     !--      LPR_Do_Read (LPR_Block);       !++ 3     ! Now that everything is ok. Send the data file      !-- 9     Status = $REWIND (RAB = LPR_Block [LPRB$T_File_Rab]); )     IF NOT             .Status THEN Signal (.Status);   #     Status = $GET (RAB = File_RAb);      IF .Status EQL RMS$_EOF  	THEN BEGIN  	!++0 	! We are now done with this file.  Send the \0. 	!-- 	Status = STR$COPY_DX ( ! 			LPR_Block [LPRB$Q_Send_Desc],  ( 			$DESCRIPTOR ( %STRING (LPR$K_Null)));& 	IF NOT .Status THEN Signal (.Status);   	LPR_Do_Write (LPR_Block);0 	LPR_Block [LPRB$W_State] = LPRB$K_State_EDFile; 	RETURN (SS$_NORMAL);  	END;   !     IF .File_FAB [FAB$V_FTN] THEN 	     BEGIN G     	%if debug %then print ('This file has FTN carriage control.'); %fi 4     	STR$COPY_R (SD, %REF (.File_Rab [RAB$W_RSZ]-1),-     	    CH$PLUS (.FILE_RAB [RAB$L_RBF], 1)); 2     	SELECTONE CH$RCHAR (.FILE_RAB [RAB$L_RBF]) OF     	SET     	    [%C'0'] :     	    	BEGIN ;     	    	    STR$PREFIX (SD, %ASCID %STRING (%CHAR (10))); ;     	    	    STR$APPEND (SD, %ASCID %STRING (%CHAR (13)));      	    	END;     	    [%C'$', %CHAR (0)] : ; D     	    [OTHERWISE] : STR$APPEND (SD, %ASCID %STRING (%CHAR (13)));	     	TES;      END &     ELSE IF .File_FAB [FAB$V_PRN] THEN	     BEGIN 
     	LOCAL     	    SLEW,     	    SFX : BLOCK [1,BYTE];G     	%if debug %then print ('This file has PRN carriage control.'); %fi J     	STR$COPY_R (SD, %REF (.File_Rab [RAB$W_RSZ]), .FILE_RAB [RAB$L_RBF]);-     	SLEW = CH$RCHAR (.FILE_RAB [RAB$L_RHB]);       	INCR I FROM 1 TO .SLEW-1 DO6     	    STR$PREFIX (SD, %ASCID %STRING (%CHAR (10)));9     	SFX = CH$RCHAR (CH$PLUS (.FILE_RAB [RAB$L_RHB], 1)); 2     	IF .SFX [0,7,1,0] AND NOT .SFX [0,5,1,0] THEN
     	BEGIN4     	    STR$APPEND (SD, %ASCID' ');  ! Place holder     	    IF .SFX [0,6,1,0] THEN '     	    	CH$WCHAR (.SFX [0,0,4,0]+128, 7     	    	    .SD [DSC$A_POINTER]+.SD [DSC$W_LENGTH]-1)      	    ELSE #     	    	CH$WCHAR (.SFX [0,0,4,0], 8     	    	    .SD [DSC$A_POINTER]+.SD [DSC$W_LENGTH]-1);	     	END;      END %     ELSE IF .FILE_FAB [FAB$V_CR] THEN 	     BEGIN F     	%if debug %then print ('This file has CR carriage control.'); %fiJ     	STR$COPY_R (SD, %REF (.File_Rab [RAB$W_RSZ]), .FILE_RAB [RAB$L_RBF]);2     	STR$APPEND (SD, %ASCID %STRING (%CHAR (13)));     END %     ELSE ! No carriage control at all J     	STR$COPY_R (SD, %REF (.File_Rab [RAB$W_RSZ]), .FILE_RAB [RAB$L_RBF]);       LPR_Do_Write (LPR_Block);        !++      ! Adjust the state     !-- 3     LPR_Block [LPRB$W_State] = LPRB$K_State_SDFile;        SS$_NORMAL     END;  & ROUTINE LPR_Sent_DFile (LPR_Block_A) = !++  ! Functional Description:  !  !	A transition Matrix routine. ! D !	We've sent some of the data file, see if we have any more to send.D !	If we do then send it.  If we've no more to send, the wait for the* !	response which should be shortly coming. !-- 	     BEGIN      BIND& 	LPR_Block	= .LPR_Block_A			: $BBLOCK,:     	FILE_FAB    	= LPR_BLOCK [LPRB$T_FILE_FAB]	: $BBLOCK,2 	File_RAB	= LPR_Block [LPRB$T_File_RAB]	: $BBLOCK,8     	SD  	    	= LPR_BLOCK [LPRB$Q_SEND_DESC]	: $BBLOCK;     EXTERNAL ROUTINE/ 	STR$COPY_DX	: BLISS ADDRESSING_MODE (GENERAL), . 	STR$COPY_R	: BLISS ADDRESSING_MODE (GENERAL),            0 	STR$PREFIX  	: BLISS ADDRESSING_MODE (GENERAL),. 	STR$APPEND	: BLISS ADDRESSING_MODE (GENERAL);	     LOCAL  	Status;       %IF Debug  	%THEN 	Print ('LPR_Sent_DFile'); 	%FI       !++ ,     ! See if there is any more data to send.     !-- #     Status = $GET (RAB = File_RAB);      IF .Status EQL RMS$_EOF  	THEN BEGIN  	!++0 	! We are now done with this file.  Send the \0. 	!-- 	Status = STR$COPY_DX ( ! 			LPR_Block [LPRB$Q_Send_Desc],  ( 			$DESCRIPTOR ( %STRING (LPR$K_Null)));& 	IF NOT .Status THEN Signal (.Status);   	LPR_Do_Write (LPR_Block);0 	LPR_Block [LPRB$W_State] = LPRB$K_State_EDFile; 	RETURN (SS$_NORMAL);  	END;   !     IF .File_FAB [FAB$V_FTN] THEN 	     BEGIN 4     	STR$COPY_R (SD, %REF (.File_Rab [RAB$W_RSZ]-1),-     	    CH$PLUS (.FILE_RAB [RAB$L_RBF], 1)); 2     	SELECTONE CH$RCHAR (.FILE_RAB [RAB$L_RBF]) OF     	SET     	    [%CHAR (0)] : ;     	    [%C'0'] :     	    	BEGIN G     	    	    STR$PREFIX (SD, %ASCID %STRING (%CHAR (10), %CHAR (10))); ;     	    	    STR$APPEND (SD, %ASCID %STRING (%CHAR (13)));      	    	END;     	    [%C'1'] :     	    	BEGIN ;     	    	    STR$PREFIX (SD, %ASCID %STRING (%CHAR (12))); ;     	    	    STR$APPEND (SD, %ASCID %STRING (%CHAR (13)));      	    	END;@     	    [%C'+'] : STR$APPEND (SD, %ASCID %STRING (%CHAR (13)));@     	    [%C'$'] : STR$PREFIX (SD, %ASCID %STRING (%CHAR (10)));     	    [OTHERWISE] :     	    	BEGIN ;     	    	    STR$PREFIX (SD, %ASCID %STRING (%CHAR (10))); ;     	    	    STR$APPEND (SD, %ASCID %STRING (%CHAR (13)));      	    	END;	     	TES;      END &     ELSE IF .File_FAB [FAB$V_PRN] THEN	     BEGIN 
     	LOCAL     	    SLEW,     	    SFX : BLOCK [1,BYTE];J     	STR$COPY_R (SD, %REF (.File_Rab [RAB$W_RSZ]), .FILE_RAB [RAB$L_RBF]);-     	SLEW = CH$RCHAR (.FILE_RAB [RAB$L_RHB]);      	INCR I FROM 1 TO .SLEW DO6     	    STR$PREFIX (SD, %ASCID %STRING (%CHAR (10)));9     	SFX = CH$RCHAR (CH$PLUS (.FILE_RAB [RAB$L_RHB], 1)); 2     	IF .SFX [0,7,1,0] AND NOT .SFX [0,5,1,0] THEN
     	BEGIN4     	    STR$APPEND (SD, %ASCID' ');  ! Place holder     	    IF .SFX [0,6,1,0] THEN '     	    	CH$WCHAR (.SFX [0,0,4,0]+128, 7     	    	    .SD [DSC$A_POINTER]+.SD [DSC$W_LENGTH]-1)      	    ELSE #     	    	CH$WCHAR (.SFX [0,0,4,0], 8     	    	    .SD [DSC$A_POINTER]+.SD [DSC$W_LENGTH]-1);	     	END;      END %     ELSE IF .FILE_FAB [FAB$V_CR] THEN 	     BEGIN J     	STR$COPY_R (SD, %REF (.File_Rab [RAB$W_RSZ]), .FILE_RAB [RAB$L_RBF]);2     	STR$PREFIX (SD, %ASCID %STRING (%CHAR (10)));2     	STR$APPEND (SD, %ASCID %STRING (%CHAR (13)));     END %     ELSE ! No carriage control at all J     	STR$COPY_R (SD, %REF (.File_Rab [RAB$W_RSZ]), .FILE_RAB [RAB$L_RBF]);       LPR_Do_Write (LPR_Block);      SS$_NORMAL     END;  ' ROUTINE LPR_Sent_EDFile (LPR_BLock_A) =  !++  ! Functional Description:  !  !	A transition matrix routine. ! > !	We've sent the end of data.  Now we wait for a response from !	the remote site. !-- 	     BEGIN      BIND& 	LPR_Block	= .LPR_Block_A			: $BBLOCK;       %IF Debug  	%THEN 	Print ('LPR_Sent_EDFile');  	%FI       !++      ! Adjust the state     !-- 3     LPR_Block [LPRB$W_State] = LPRB$K_State_RDFile;        !++      ! Start the timer      !-- /     LPR_Start_Timer (LPR_Block, LPR$K_Timeout);        SS$_NORMAL     END;  & ROUTINE LPR_Recv_DFile (LPR_Block_A) = !++  ! Functional Description:  !  !	A transition matrix routine.> !	We've received a response from the remote system after we've !	sent them the data file. !-- 	     BEGIN      BIND& 	LPR_Block	= .LPR_Block_A			: $BBLOCK,? 	Recv_Buffer	= LPR_Block [LPRB$T_Recv_Buffer]: VECTOR [, BYTE],      %IF Version64          %THEN 9 	Recv_IOSB	= LPR_Block [LPRB$Q_Recv_IOSB]	: Network_IOSB;          %ELSE ? 	Recv_IOSB	= LPR_Block [LPRB$Q_Recv_IOSB]	: NetIO_Status_Block;                                                                                                                                                                                                                                                                                                                                                                                                                                                                   A                       t&<        
CMUIP066.C                     I=  I6  [LPR]LPR.SRC;1RC;1RC;1;1                                                                                                                                                      <                        =}        LPR.SRC                          I6  [LPR]LPR.B32;1.R32;1                                                                                                           ]     c                               <                %FI      EXTERNAL ROUTINE 	Text_Line, / 	LIB$SYS_FAO	: BLISS ADDRESSING_MODE (GENERAL), 0 	STR$FREE1_DX	: BLISS ADDRESSING_MODE (GENERAL);	     LOCAL  	File_Byte_Size	: INITIAL (0),	 	Context, + 	Temp_Desc	: $BBLOCK [DSC$K_S_BLN]	PRESET (  				[DSC$W_LENGTH]	= 0, " 				[DSC$B_DTYPE]	= DSC$K_DTYPE_T," 				[DSC$B_CLASS]	= DSC$K_CLASS_D, 				[DSC$A_POINTER]	= 0),  	Status;       %IF Debug  	%THEN 	Print ('LPR_Recv_DFile'); 	%FI       !++ 2     ! Stop any timers associated with this request     !-- *     Status = $CANTIM (REQIDT = LPR_Block);)     IF NOT .Status THEN Signal (.Status);        !++      ! Check the response     !-- (     IF .Recv_IOSB [NSB$Byte_Count] NEQ 16 	THEN RETURN LPR_Finish (LPR_Block, LPR$_State_Error);       IF .Recv_Buffer [0] NEQ 0 5 	THEN RETURN LPR_Finish (LPR_Block, LPR$_Screw_Data);        !++      ! Start another read     !--      LPR_Do_Read (LPR_Block);       !++ )     ! Figure the size of the control file      !--      Context = 0;     WHILE 1 DO 	BEGIN 	Status = Text_Line ( " 		LPR_Block [LPRB$Q_Control_Text], 		Temp_Desc, 		Context);  	IF NOT .Status THEN EXITLOOP;B 	File_Byte_Size = .File_Byte_Size + .Temp_Desc [DSC$W_LENGTH] + 1; 	END; &     Status = STR$FREE1_DX (Temp_Desc);)     IF NOT .Status THEN Signal (.Status);          !++ >     ! Now that everything is ok, send the size of control file     !--      Status = LIB$SYS_FAO (, 		%ASCID '!AS!UL !AS!AS',			! Control String 		0,					! Out Len* 		LPR_Block [LPRB$Q_Send_Desc],		! Out Buf7 		$DESCRIPTOR (%STRING (LPR$K_Send_Control)),	! P1 = \2 % 		.File_Byte_Size,			! P2 = file Size : 		LPR_Block [LPRB$Q_CFile_Name],		! P3 = Control File name0 		$DESCRIPTOR ( %STRING (LPR$K_EOL)));	! P4 = \n)     IF NOT .Status then Signal (.Status);        LPR_Do_Write (LPR_Block);        !++      ! Adjust the state.      !-- 4     LPR_Block [LPRB$W_State] = LPRB$K_State_SSCFile;       SS$_NORMAL     END;  ' ROUTINE LPR_Sent_SCFile (LPR_Block_A) =  !++  ! Functional Description:  !  !	A transition Matrix routine. ! @ !	We've sent the size of the control file.  We should be shortly !	expecting a reply. !-- 	     BEGIN      BIND% 	LPR_Block	= .LPR_Block_A		: $BBLOCK;        %IF Debug  	%THEN 	Print ('LPR_Sent_SCFile');  	%FI       !++      ! Adjust the state.      !-- 4     LPR_Block [LPRB$W_State] = LPRB$K_State_RSCFile;       !++      ! Start the timer.     !-- $     LPR_Start_Timer (LPR_Block, 60);       SS$_NORMAL     END;  ' ROUTINE LPR_Recv_SCFile (LPR_BLock_A) =  !++  ! Functional Description:  ! 9 !	A transition matrix routine.  We've received a response 7 !	from the remote site once we've told em what the size # !	and name of the control file was.  !-- 	     BEGIN      BIND& 	LPR_Block	= .LPR_Block_A			: $BBLOCK,? 	Recv_Buffer	= LPR_Block [LPRB$T_Recv_Buffer]: VECTOR [, BYTE],      %IF Version64          %THEN 9 	Recv_IOSB	= LPR_Block [LPRB$Q_Recv_IOSB]	: Network_IOSB;          %ELSE ? 	Recv_IOSB	= LPR_Block [LPRB$Q_Recv_IOSB]	: NetIO_Status_Block;          %FI      EXTERNAL ROUTINE 	Text_Line, . 	STR$APPEND	: BLISS ADDRESSING_MODE (GENERAL);	     LOCAL  	Status;       %IF Debug  	%THEN 	Print ('LPR_Recv_SCFile');  	%FI       !++ 2     ! Stop any timers associated with this request     !-- *     Status = $CANTIM (REQIDT = LPR_Block);)     IF NOT .Status THEN Signal (.Status);        !++      ! Check the response     !-- (     IF .Recv_IOSB [NSB$Byte_Count] NEQ 16 	THEN RETURN LPR_Finish (LPR_Block, LPR$_State_Error);       IF .Recv_Buffer [0] EQL 2 5 	THEN RETURN LPR_Finish (LPR_Block, LPR$_Disk_Space);      IF .Recv_Buffer [0] NEQ 0 8 	THEN RETURN LPR_Finish (LPR_Block, LPR$_Screw_Control);       !++      ! Start another read     !--      LPR_Do_Read (LPR_Block);       !++ C     ! Now that everything is normal, start sending the control file      !-- +     LPR_Block [LPRB$L_Control_Context] = 0;        Status = Text_Line (" 		LPR_Block [LPRB$Q_Control_Text], 		LPR_Block [LPRB$Q_Send_Desc], & 		LPR_Block [LPRB$L_Control_Context]);     IF NOT .Status 	THEN BEGIN  	!++ 	! The control file is empty?  	!-- 	RETURN (SS$_NORMAL);  	END;        Status = STR$APPEND (  		LPR_Block [LPRB$Q_Send_Desc], & 		$DESCRIPTOR ( %STRING (LPR$K_EOL)));)     IF NOT .Status THEN Signal (.Status);        LPR_Do_Write (LPR_BLock);   7     LPR_Block [LPRB$W_State] = LPRB$K_State_SCFile;            SS$_NORMAL     END;  & ROUTINE LPR_Sent_CFile (LPR_Block_A) = !++  ! Functional Description:  !  !	A transition Matrix routine. ! . !	We've sent the control file (or part of it).' !	If we are done with the control file, ) !		adjust the state and wait for repsonse / !		otherwise send the rest of the control file.  !  !-- 	     BEGIN      BIND% 	LPR_Block	= .LPR_Block_A		: $BBLOCK;      EXTERNAL ROUTINE 	Text_Line, / 	STR$COPY_DX	: BLISS ADDRESSING_MODE (GENERAL), . 	STR$APPEND	: BLISS ADDRESSING_MODE (GENERAL);	     LOCAL  	Status;       %IF Debug  	%THEN 	Print ('LPR_Sent_CFile'); 	%FI       !++ /     ! See if we have more CFile to send or not.       
     F       !--      Status = Text_Line (" 		LPR_Block [LPRB$Q_Control_Text], 		LPR_Block [LPRB$Q_Send_Desc], & 		LPR_Block [LPRB$L_Control_Context]);     IF NOT .Status THEN  	BEGIN 	!++$ 	! We are done with the control file 	!-- 	Status = STR$COPY_DX (  		LPR_Block [LPRB$Q_Send_Desc], ' 		$DESCRIPTOR ( %STRING (LPR$K_Null))); & 	IF NOT .Status THEN Signal (.Status);   	LPR_Do_Write (LPR_Block);  0 	LPR_Block [LPRB$W_State] = LPRB$K_State_ECFile; 	RETURN (SS$_NORMAL);  	END;        Status = STR$APPEND (  		LPR_Block [LPRB$Q_Send_Desc], & 		$DESCRIPTOR ( %STRING (LPR$K_EOL)));)     IF NOT .Status THEN Signal (.Status);        LPR_Do_Write (LPR_Block);        SS$_NORMAL     END;  ' ROUTINE LPR_Sent_ECFile (LPR_Block_A) =  !++  ! Functional Description:  !  !	A transition matrix routine. ! 9 !	We've sucessfully sent the \0 at the end of the control + !	file now we must wait for his ack or nak.  !-- 	     BEGIN      BIND% 	LPR_Block	= .LPR_Block_A		: $BBLOCK;        %IF Debug  	%THEN 	Print ('LPR_Sent_ECFile');  	%FI       !++      ! Start the timer      !-- %     LPR_Start_Timer (LPR_Block, 600);        !++      ! Adjust the state     !-- 3     LPR_Block [LPRB$W_State] = LPRB$K_State_RCFile;        SS$_NORMAL     END;  & ROUTINE LPR_Recv_CFile (LPR_BLock_A) = !++  ! Functional Description:  ! 9 !	A transition matrix routine.  We've received a response 8 !	from the remote site once we've sent the control file. !-- 	     BEGIN      BIND& 	LPR_Block	= .LPR_Block_A			: $BBLOCK,? 	Recv_Buffer	= LPR_Block [LPRB$T_Recv_Buffer]: VECTOR [, BYTE],      %IF Version64          %THEN 9 	Recv_IOSB	= LPR_Block [LPRB$Q_Recv_IOSB]	: Network_IOSB;          %ELSE ? 	Recv_IOSB	= LPR_Block [LPRB$Q_Recv_IOSB]	: NetIO_Status_Block;          %FI 	     LOCAL  	Status;       %IF Debug  	%THEN 	Print ('LPR_Recv_CFile'); 	%FI       !++ 2     ! Stop any timers associated with this request     !-- *     Status = $CANTIM (REQIDT = LPR_Block);)     IF NOT .Status THEN Signal (.Status);        !++      ! Check the response     !-- (     IF .Recv_IOSB [NSB$Byte_Count] NEQ 16 	THEN RETURN LPR_Finish (LPR_Block, LPR$_State_Error);     IF .Recv_Buffer [0] NEQ 0 8 	THEN RETURN LPR_Finish (LPR_Block, LPR$_Screw_Control);                                                                                                                                                                                                                                                        B                       K#j'        
CMUIP066.C                     I=  I6  [LPR]LPR.SRC;1RC;1RC;1;1                                                                                                                                      >d              !++ A     ! Everything is roses.  We are now done.  Start finishing up.      !-- '     LPR_Finish (LPR_Block, SS$_NORMAL);        SS$_NORMAL     END;  $ ROUTINE LPR_Open_AST (LPR_Block_A) = !++  ! Functional Description:  ! 6 !	We've successfully opened up the network connectio                                                                                                                                                                                                                                   =                        fp        LPR.SRC                          I6  [LPR]LPR.B32;12;1                                                                                                              ]     c                               K       n. !-- 	     BEGIN      BIND& 	LPR_Block	= .LPR_Block_A			: $BBLOCK,     %IF Version64          %THEN 9 	Recv_IOSB	= LPR_Block [LPRB$Q_Recv_IOSB]	: Network_IOSB;          %ELSE ? 	Recv_IOSB	= LPR_Block [LPRB$Q_Recv_IOSB]	: NetIO_Status_Block;          %FI 	     LOCAL  	Status;  >     IF NOT .LPR_Block [LPRB$V_Valid] THEN RETURN (SS$_NORMAL);       %IF Debug  	%THEN@ 	Print ('LPR_Open_Ast, State = !UW', .LPR_Block [LPRB$W_State]); 	%FI       !++      ! Check the IOSB     !-- %     Status = .Recv_IOSB [NSB$Status]; "     IF .Status EQLU SS$_ABORT THEN 	BEGIN
 	%IF Debug
 	    %THEN) 	    Signal (.Recv_IOSB [NSB$XError], 0);  	    %FI+ 	LPR_Finish (LPR_Block, LPR$_Conn_Aborted);  	RETURN (SS$_NORMAL);  	END; I     IF NOT .Status THEN RETURN LPR_Finish (LPR_BLock, LPR$_Conn_Aborted);   ]     (.LPR_Transition_Matrix [.LPR_Block [LPRB$W_State], LPRB$K_Event_Conn_Open]) (LPR_Block);        SS$_NORMAL     END;  ! ROUTINE LPR_Start (LPR_Block_A) =  !++  ! Functional Description:  ! = !	Finish initializing I/O data structures and start protocol.  !-- 	     BEGIN      BIND& 	LPR_Block	= .LPR_Block_A			: $BBLOCK,4 	File_Name	= LPR_Block [LPRB$Q_File_Name]	: $BBLOCK;     EXTERNAL ROUTINE 	Data_File_Name, 	Control_File_Name,  	T            ext_Init,  	Build_Control,  	Printer_Host, 	Random,. 	STR$APPEND	: BLISS ADDRESSING_MODE (GENERAL),0 	STR$FREE1_DX	: BLISS ADDRESSING_MODE (GENERAL);	     LOCAL + 	Host_Name	: $BBLOCK [DSC$K_S_BLN] PRESET (  			[DSC$W_LENGTH]	= 0,! 			[DSC$B_DTYPE]	= DSC$K_DTYPE_T, ! 			[DSC$B_CLASS]	= DSC$K_CLASS_D,  			[DSC$A_POINTER]	= 0), 	Status;  >     IF NOT .LPR_Block [LPRB$V_VALID] THEN RETURN (SS$_NORMAL);       %IF Debug  	%THEN 	Print ('LPR_Start');  	%FI  2     LPR_Block [LPRB$W_State] = LPRB$K_State_Start;  0     Init_DynDesc (LPR_Block [LPRB$Q_Send_Desc]);       !++ ;     ! Build the names of the control file and the data file      !-- 1     Init_DynDesc (LPR_Block [LPRB$Q_DFile_Name]);      Data_File_Name (  		LPR_Block [LPRB$Q_DFile_Name],$ 		.LPR_Block [LPRB$L_Entry_Number]);  1     Init_DynDesc (LPR_Block [LPRB$Q_CFile_Name]);      COntrol_File_Name (   		LPR_Block [LPRB$Q_CFile_Name],$ 		.LPR_Block [LPRB$L_Entry_Number]);     %IF Debug  	%THENL 	Print ('LPR_Start, Control File = ''!AS''', LPR_Block [LPRB$Q_CFile_Name]); 	%FI       !++      ! Build the control File     !-- 0     Text_Init (LPR_Block [LPRB$Q_Control_Text]);     Build_Control ( ! 	LPR_BLock [LPRB$Q_Control_Text],  	LPR_Block [LPRB$Q_Username],  	LPR_Block [LPRB$Q_Job_Name],   	LPR_Block [LPRB$Q_DFile_Name]);       !++ %     ! See what host the printer is on      !-- G     Status = Printer_Host (Host_Name, Lpr_BLock [LPRB$Q_Printer_Name]); )     IF NOT .Status THEN Signal (.Status); I     Status  = STR$APPEND (Host_Name, $DESCRIPTOR (%STRING (LPR$K_Null))); )     IF NOT .Status THEN Signal (.Status);        !++      ! Open the file      !-- 3     $NAM_Init ( NAM = LPR_BLock [LPRB$T_File_NAM]);        CH$MOVE ( % 	(NAM$S_DVI + NAM$S_FID + NAM$S_DID),  	.LPR_Block [LPRB$L_File_Id_A], 4 	$BBLOCK [ LPR_Block [LPRB$T_File_NAM], NAM$T_DVI]);  2     $FAB_Init ( Fab = LPR_Block [LPRB$T_File_FAB],! 	FNS	= .File_Name [DSC$W_LENGTH], " 	FNA	= .File_Name [DSC$A_POINTER], 	FAC	= <GET>,  	FOP	= <NAM, SQO>,# 	NAM	= LPR_Block [LPRB$T_File_NAM], ,     	XAB 	= LPR_Block [LPRB$T_File_XABFHC]);  2     $RAB_Init ( RAB = LPR_Block [LPRB$T_File_RAB],# 	FAB	= LPR_Block [LPRB$T_File_FAB],  	RAC	= <SEQ>);  8     $XABFHC_INIT (XAB = LPR_BLOCK [LPRB$T_FILE_XABFHC]);  7     Status = $OPEN (FAB = LPR_Block [LPRB$T_File_FAB]); D     IF NOT .Status THEN RETURN LPR_Finish (LPR_Block, LPR$_No_File);  :     Status = $CONNECT (RAB = LPR_Block [LPRB$T_File_RAB]);D     IF NOT .Status THEN RETURN LPR_Finish (LPR_Block, LPR$_No_File);     !++      ! Start the network open.      !--      Status = $ASSIGN (  		DEVNAM	= %ASCID 'INET$DEVICE',) 		CHAN	= LPR_Block [LPRB$W_TCP_Channel]); C     IF NOT .Status THEN RETURN LPR_Finish (LPR_Block, LPR$_No_Net);        Status = NET$OPEN ( % 	FHNAM		= .Host_Name [DSC$A_POINTER], " 	Foreign_Prt	= 515,				! 515 is it4 	Local_Prt	= Random (1, 1023),		! 1 <= port <= 1023  	IOMode		= ASYNCH,+ 	IOChan		= .LPR_Block [LPRB$W_TCP_Channel], ' 	IO$SB		= LPR_Block [LPRB$Q_Recv_IOSB],  	AST$ADR		= LPR_Open_Ast,  	AST$PRM		= LPR_Block); C     IF NOT .Status THEN RETURN LPR_Finish (LPR_Block, LPR$_No_Net);        SS$_NORMAL     END;  % ROUTINE LPR_Timer_AST (LPR_Block_A) =  !++  ! Functional Description:  ! A !	A timer has gone off, Call a routine from the transition matrix  !-- 	     BEGIN      BIND& 	LPR_Block	= .LPR_Block_A			: $BBLOCK;	     LOCAL  	Status;  >     IF NOT .LPR_Block [LPRB$V_Valid] THEN RETURN (SS$_NORMAL);  [     (.LPR_Transition_Matrix [.LPR_Block [LPRB$W_State], LPRB$K_Event_Timeout]) (LPR_Block);        SS$_NORMAL     END;  0 ROUTINE LPR_Start_Timer (LPR_Block_A, Seconds) = !++  ! Functional Description:  ! ( !	Set a timer to go off in a short time. !-- 	     BEGIN      BIND% 	LPR_Block	= .LPR_Block_A		: $BBLOCK;      BUILTIN  	EMUL;	     LOCAL   	Time_Binary	: VECTOR [8, BYTE], 	Status;       !++ 9     ! Convert seconds into the vax/vms binary time format      !-- 
     EMUL (7 	%REF ( -10 * 1000 * 1000),		! One Second (sign extend)  	%REF (.Seconds),			! Wait time  	%REF (0),				! Carry  	Time_Binary);				! Result       !++      ! Do the wait      !--      Status = $SETIMR ( 		DAYTIM	= Time_Binary,  		ASTADR	= LPR_Timer_AST,  		REQIDT	= LPR_Block);)     IF NOT .Status THEN Signal (.Status);        SS$_NORMAL     END;  $ ROUTINE LPR_Read_AST (LPR_Block_A) = !++  ! Functional Description:  ! 1 !	A Read has completed on the network I/O device.  !-- 	     BEGIN      BIND& 	LPR_Block	= .LPR_Block_A			: $BBLOCK,     %IF Version64          %THEN 9 	Recv_IOSB	= LPR_Block [LPRB$Q_Recv_IOSB]	: Network_IOSB;          %ELSE ? 	Recv_IOSB	= LPR_Block [LPRB$Q_Recv_IOSB]	: NetIO_Status_Block;          %FI 	     LOCAL  	Status;  >     IF NOT .LPR_Block [LPRB$V_Valid] THEN RETURN (SS$_NORMAL);       %IF Debug  	%THENQ 	Print ('LPR_Read_Ast, Status = %X!XW, Count = !UL, [0] = %X!XB, Xerror = %X!XL',  			.Recv_IOSB [NSB$Status],  			.Recv_IOSB [NSB$Byte_Count], 8 			.VECTOR [LPR_Block [LPRB$T_Recv_Buffer], 0 ; , BYTE], 			.Recv_IOSB [NSB$XError]); 	%FI       !++      ! Check the IOSB     !-- %     Status = .Recv_IOSB [NSB$Status]; !     IF .Status EQL SS$_ABORT THEN  	BEGIN> 	%IF Debug %THEN Print ('LPR_Read_Ast, Signal coming up'); %FI& 	Signal ( .Recv_IOSB [NSB$XError], 0);2 	RETURN LPR_Finish (LPR_Block, LPR$_Conn_Aborted); 	END; I     IF NOT .Status THEN RETURN LPR_Finish (LPR_BLock, LPR$_Conn_Aborted);   P     (.LPR_Transition_Matrix [.LPR_Block [LPRB$W_State],	LPRB$K_Event_Recv_Data]) 	(LPR_Block);        SS$_NORMAL     END;  # ROUTINE LPR_Do_Read (LPR_Block_A) =                                                                                                                                                                                                                                     C                       e d;        
CMUIP066.C                     I=  I6  [LPR]LPR.SRC;1RC;1RC;1;1                                                                                                                                                  !++  ! Functional Description:  !  !	Start an asynch read.  !-- 	     BEGIN      BIND% 	LPR_Block	= .LPR_Block_A		: $BBLOCK; 	     LOCAL  	Status;       %IF Debug  	%THEN 	Print ('LPR_Do_Read');  	%FI       Status = NET$RECEIVE (+ 	BufAdrs		= LPR_Block [LPRB$T_Recv_Buffer],  	BufSize		= LPRB$S_Recv_Buffer,  	IOmode		= ASYNCH,+ 	IOCHAN		= .LPR_Block [LPRB$W_TCP_Channel], ' 	IO$SB		= LPR_Block [LPRB$Q_Recv_IOSB],  	Ast$Adr		= LPR_Read_Ast,  	Ast$Prm		= LPR_Block); =     IF NOT .Status THEN LPR_Finish (LPR_Block, LPR$_No_Read);        SS$_NORMAL     END;  % ROUTINE LPR_Write_Ast (LPR_Block_A) =  !++  ! Functional Description:  ! ' !	A write on the network has completed.  !-- 	     BEGIN      BIND& 	LPR_Block	= .LPR_Block_A			: $BBLOCK,     %IF Version6                                                                                                                                                                                                                                                   >                                LPR.SRC                          I6  [LPR]LPR.B32;1;1                                                                                                               ]     c                         M      Z       4          %THEN 9 	Send_IOSB	= LPR_Block [LPRB$Q_Send_IOSB]	: Network_IOSB;          %ELSE ? 	Send_IOSB	= LPR_Block [LPRB$Q_Send_IOSB]	: NetIO_Status_Block;          %FI 	     LOCAL  	Status;  >     IF NOT .LPR_Block [LPRB$V_Valid] THEN RETURN (SS$_NORMAL);       %IF Debug  	%THEN* 	Print ('LPR_Write_Ast, IOSB = !XW, !XL',  		.Send_IOSB [NSB$Status], 		.Send_IOSB [NSB$XError]);  	%FI       !++      ! Check the IOSB     !-- %     Status = .Send_IOSB [NSB$Status]; "     IF .Status EQLU SS$_ABORT THEN 	BEGIN+ 	LPR_Finish (LPR_Block, LPR$_Conn_Aborted);  	RETURN SS$_NORMAL;  	END; I     IF NOT .Status THEN RETURN LPR_Finish (LPR_BLock, LPR$_Conn_Aborted);   ]     (.LPR_Transition_Matrix [.LPR_Block [LPRB$W_State], LPRB$K_Event_Sent_Data]) (LPR_Block);        SS$_NORMAL     END;  $ ROUTINE LPR_Do_Write (LPR_Block_A) = !++  ! Functional Description:  ! $ !	Write the data out on the network. !-- 	     BEGIN      BIND& 	LPR_Block	= .LPR_Block_A			: $BBLOCK,4 	Send_Desc	= LPR_Block [LPRB$Q_Send_Desc]	: $BBLOCK;	     LOCAL  	Status;       %IF Debug  	%THEN' 	Print ('LPR_Do_Write, Desc = ''!AF''',  		.Send_Desc [DSC$W_LENGTH], 		.Send_Desc [DSC$A_POINTER]); 	%FI       Status = NET$SEND ( ' 		BufAdrs	= .Send_Desc [DSC$A_POINTER], & 		BufSize	= .Send_Desc [DSC$W_LENGTH], 		IOMode	= ASYNCH,
 		EOL	= 1,+ 		IOChan	= .LPR_Block [LPRB$W_TCP_Channel], ' 		IO$SB	= LPR_Block [LPRB$Q_Send_IOSB],  		Ast$Adr	= LPR_Write_Ast, 		AST$Prm	= LPR_Block); >     IF NOT .Status THEN LPR_Finish (LPR_BLock, LPR$_No_Write);       SS$_NORMAL     END;   GLOBAL ROUTINE LPR ( 	File_Name_A,  	File_ID_A,  	UserName_A, 	Printer_Name_A, 	Entry_Number, 	Job_Name_A, 	Final_Status_A, 	AstAdr,
 	AstPrm) =	     BEGIN      BIND& 	File_Name	= .File_Name_A			: $BBLOCK,$ 	Username	= .Username_A			: $BBLOCK,+ 	Printer_Name	= .Printer_Name_A		: $BBLOCK, $ 	Job_Name	= .Job_Name_A			: $BBLOCK,+ 	Final_Status	= .Final_Status_A		: $BBLOCK;      EXTERNAL ROUTINE/ 	STR$COPY_DX	: BLISS ADDRESSING_MODE (GENERAL), , 	STR$TRIM	: BLISS ADDRESSING_MODE (GENERAL), 	Lower_Case,	 	Get_Mem;      BIND. 	LPR_Block	= Get_Mem (LPRB$K_Size)		: $BBLOCK;     BUILTIN  	INSQUE;	     LOCAL  	Status;       %IF Debug  	%THEN/ 	Print ('LPR, File_Name = ''!AS''', File_Name); - 	Print ('LPR, Username = ''!AS''', Username); 5 	Print ('LPR, Printer_Name = ''!AS''', Printer_Name); - 	Print ('LPR, Job_Name = ''!AS''', Job_Name); 2 	Print ('LPR, Entry_Number = !UL', .Entry_Number); 	%FI  "     INSQUE (LPR_Block, LPR_Queue);!     LPR_Block [LPRB$V_Valid] = 1;        !++ *     ! Record all the necessary parameters.     !-- 0     Init_DynDesc (LPR_Block [LPRB$Q_File_Name]);C     Status = STR$COPY_DX (LPR_Block [LPRB$Q_File_Name], File_Name); )     IF NOT .Status THEN Signal (.Status);   .     LPR_Block [LPRB$L_File_ID_A] = .File_ID_A;  /     Init_DynDesc (LPR_Block [LPRB$Q_Username]); L     Status = Lower_Case (Username, Username);   !Un*x systems like lowercase)     IF NOT .Status THEN Signal (.Status); >     Status = STR$TRIM (LPR_Block [LPRB$Q_Username], Username);)     IF NOT .Status THEN Signal (.Status);   3     Init_DynDesc (LPR_Block [LPRB$Q_Printer_Name]); H     Status = Lower_Case (LPR_Block [LPRB$Q_Printer_Name], Printer_Name);)     IF NOT .Status THEN Signal (.Status);   /     Init_DynDesc (LPR_Block [LPRB$Q_Job_Name]); L     Status = Lower_Case (Job_Name, Job_Name);   !Un*x systems like lowercase)     IF NOT .Status THEN Signal (.Status); A     Status = STR$COPY_DX (LPR_Block [LPRB$Q_Job_Name], Job_Name); )     IF NOT .Status THEN Signal (.Status);   4     LPR_Block [LPRB$L_Entry_Number] = .Entry_Number;  5     LPR_Block [LPRB$L_Final_Status_A] = Final_Status; (     LPR_Block [LPRB$L_ASTADR] = .AstAdr;(     LPR_Block [LPRB$L_AstPrm] = .ASTPRM;       !++ ,     ! That's all that needs to be done here.     ! Do the reset later.      !--      Status = $DCLAST ( 		ASTADR	= LPR_Start,  		ASTPRM	= LPR_Block);)     IF NOT .Status THEN Signal (.Status);        SS$_NORMAL     END;   END  ELUDOM/ !  DEC/CMS REPLACEMENT HISTORY, Element LPR.B32 Z !  *1     6-MAR-1991 19:47:35 SYNFUL "Routines to send a text file via LPR asynchronously"/ !  DEC/CMS REPLACEMENT HISTORY, Element LPR.B32                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                D                       z        
CMUIP066.C                     I=  I6  [LPR]LPR.SRC;1RC;1RC;1;1                                                                                                                                      u                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                ?                        5+        LPR.SRC                          I6  [LPR]LPRSMB.B32;1                                                                                                              J     -                                        * [LPR]LPRSMB.B32;1 +  ,    . -    /     4 J   -   + (                    - I6    0   1    2   3      K  P   W   O ,    5   6  (G-  7  B-  8          9          G    H  J               %(A 	****************************************************************   0 		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.  A 	****************************************************************  )%/ 	%TITLE	'LPRSMB.B32	- CMU-CS/RI Print Symbiont'  MODULE     LPRSMB ( 	LANGUAGE (BLISS32),% 	LIST (ASSEMBLY, NOBINARY, NOEXPAND),  	IDENT = 'V02-00', 	MAIN = LPRSMB_Main      ) =  BEGIN    !++  ! Description: ! : !	This code sends removes things from the print queues and) !	sends them via LPR to remote unix site.  !  ! Author:	Dale Moore		CMU-CS/RI  !  ! Modifications: ! " !	04-FEB-1988	Dale Moore	CMU-CS/RI& !	Added code to save File Id from smb. !--    !LIBRARY 'SYS$LIBRARY:STARLET';  LIBRARY 'SYS$LIBRARY:LIB'; LIBRARY 'LPRSMB';    COMPILETIME      Debug	= 1;  	 %IF Debug 	     %THEN      LIBRARY 'PRINT';     %FI    OWN J     Stream_BlockVector	: BLOCKVECTOR [LPRSMB$K_Max_Streams, LPRSMB             $K_Size,
 				BYTE];   MACRO      Init_DynDesc (D) = 	BEGIN 	$BBLOCK [D, DSC$W_LENGTH]	= 0; * 	$BBLOCK [D, DSC$B_DTYPE]	= DSC$K_DTYPE_T;* 	$BBLOCK [D, DSC$B_CLASS]	= DSC$K_CLASS_D;  	$BBLOCK [D, DSC$A_POINTER]	= 0; 	END%;   ROUTINE Stream_Block_Init = 	     BEGIN 0     INCR I FROM 0 TO LPRSMB$K_Max_Streams - 1 DO 	BEGIN 	BIND A 	    Stream_Block= Stream_BlockVector [.I, 0, 0, 0, 0]	: $BBLOCK;  	     % 	Stream_Block [LPRSMB$L_Stream] = .I; 5 	Stream_Block [LPRSMB$W_State] = LPRSMB$K_State_Stop; 4 	Init_DynDesc (Stream_Block [LPRSMB$Q_Device_Name]);1 	Init_DynDesc (Stream_Block [LPRSMB$Q_Username]); 0 	Init_DynDesc (Stream_Block [LPRSMB$Q_Account]);2 	Init_DynDesc (Stream_Block [LPRSMB$Q_File_Name]);1 	Init_DynDesc (Stream_Block [LPRSMB$Q_Job_Name]);  	END;      SS$_NORMAL     END;   ROUTINE Streams_Active = !++  ! Functional Description:  ! : !	Return True if there exist streams that are not stopped. !-- 	     BEGIN   0     INCR I FROM 0 TO LPRSMB$K_Max_Streams - 1 DOD 	IF .Stream_BlockVector [.I, LPRSMB$W_State] NEQ LPRSMB$K_State_Stop 	    THEN RETURN (SS$_NORMAL);     RETURN (0);      END;  5 ROUTINE Get_Stream_Block (Stream, Stream_Block_A_A) =  !++  ! Functional Description:  ! C !	Gets a stream block so we can store all of the useful information " !	about a particular stream in it. ! A !	If one already exists, use it.  If it doesn't exist, create it. 7 !	If we can't create it, we'll have to return an error.  ! 8 !	A simple hack could be to have an own blockvector..... !-- 	                  BEGIN      BIND4 	Stream_Block_A	= .Stream_Block_A_A	: LONG UNSIGNED;  >     Stream_Block_A = Stream_BlockVector [.Stream, 0, 0, 0, 0];     SS$_NORMAL     END;  & ROUTINE Deliver_Ast (Stream_Block_A) =	     BEGIN      BIND* 	Stream_Block	= .Stream_Block_A	: $BBLOCK;     EXTERNAL ROUTINE6 	SMB$Send_To_JobCtl	: BLISS ADDRESSING_MODE (GENERAL);	     LOCAL  	Status;       %IF Debug  	%THEN; 	Print ('LPRSMB Deliver, send task complete on Stream !UW', # 		.Stream_Block [LPRSMB$L_Stream]);  	%FI  A     IF .Stream_Block [LPRSMB$W_State] NEQU LPRSMB$K_State_Working  	THEN BEGIN  	!++? 	! We seem to have finished a request and we weren't working on & 	! any?  Maybe the status was an abort 	!-- 	RETURN (SS$_NORMAL) 	END;   -     Status = .Stream_Block [LPRSMB$L_Status]; A     IF .Status EQLU SS$_ABORT THEN RETURN (SS$_NORMAL);		! todo??   !     Status = SMB$Send_To_JobCtl ( 2 		%REF (.Stream_Block [LPRSMB$L_Stream]),	! Stream, 		%REF (SMBMSG$K_Task_Complete));		! Request)     IF NOT .Status THEN Signal (.Status);   8     Stream_Block [LPRSMB$W_State] = LPRSMB$K_State_Wait;          SS$_NORMAL     END;  4 ROUTINE Decode_Message (Stream_Block_A, Message_A) = !++  ! Functional Description:  ! 9 !	We've got a message from jobctl on a particular stream. @ !	Decode the contents of the message using SMB$Read_Message_Item2 !	and store the interesting items in stream_block. !-- 	     BEGIN      BIND* 	Stream_Block	= .Stream_Block_A	: $BBLOCK," 	Message		= .Message_A		: $BBLOCK;     EXTERNAL ROUTINE0 	STR$COPY_DX		: BLISS ADDRESSING_MODE (GENERAL),1 	STR$FREE1_DX		: BLISS ADDRESSING_MODE (GENERAL), 9 	SMB$Read_Message_Item	: BLISS ADDRESSING_MODE (GENERAL);      EXTERNAL LITERAL 	SMB$_NOMOREITEMS;	     LOCAL  	Context		: INITIAL (0), 	Item_Code, ! 	Buffer		: $BBLOCK [DSC$K_S_BLN],  	Status;       %IF Debug  	%THEN0 	Print ('Decode !UW byte message on stream !UW', 		.Message [DSC$W_LENGTH],# 		.Stream_Block [LPRSMB$L_Stream]);  	%FI       Init_DynDesc (Buffer);       WHILE 1 DO 	BEGIN! 	Status = SMB$Read_Message_Item (  			Message,  			Context,  			Item_Code,  			Buffer); 0 	IF .Status EQLU SMB$_NOMOREITEMS THEN EXITLOOP;& 	IF NOT .Status THEN Signal (.Status);   	SELECTONEU .Item_Code OF  	    SET 	    [SMBMSG$K_Device_Name]	:  		BEGIN  		Status = STR$COPY_DX (& 			Stream_Block[LPRSMB$Q_Device_Name], 			Buffer); ' 		IF NOT .Status THEN Signal (.Status);  		END;% 	    [SMBMSG$K_File_Identification] :  		BEGIN  		CH$MOVE ( 2 			MIN (.Buffer [DSC$W_LEN                                                                                                                                                                                                                                                   E                       )i        
CMUIP066.C                     I=  I6  [LPR]LPR.SRC;1RC;1RC;1;1                                                                                                                                      h            GTH], LPRSMB$S_File_Id), 			.Buffer [DSC$A_POINTER], # 			Stream_Block [LPRSMB$T_File_Id])  		END;$ 	    [SMBMSG$K_File_Specification] : 		BEGIN  		Status = STR$COPY_DX (% 			Stream_Block [LPRSMB$Q_File_Name],  			Buffer); ' 		IF NOT .Status THEN Signal (.Status);  		END; 	    [SMBMSG$K_Account_Name]	: 		BEGIN  		Status = STR$COPY_DX (# 			Stream_Block [LPRSMB$Q_Account],  			Buffer); ' 		IF NOT .Status THEN Signal (.Status);  		END; 	    [SMBMSG$K_User_Name]	:  		BEGIN  		Status = STR$COPY_DX ($ 			Stream_Block [LPRSMB$Q_Username], 			Buffer); ' 		IF NOT .Status THEN Signal (.Status);  		END; 	    [SMBMSG$K_Job_Name]		:  		BEGIN  		Status = STR$COPY_DX ($ 			Stream_Block [LPRSMB$Q_Job_Name], 			Buffer); ' 		IF NOT .Status THEN Signal (.Status);  		END; 	    [SMBMSG$K_Entry_Number]	: 		BEGIN ) 		Stream_Block [LPRSMB$L_Entry_Number] =  ( 			.VECTOR [.Buffer [DSC$A_POINTER], 0]; 		END; 	    [OTHERWISE]			: 		SS$_NORMAL; 	 	    TES;  	END;        !++ H     ! free, release, deassign everything that might have been allocated.     !-- #     Status = STR$FREE1_DX (Buffer); )     IF NOT .Status THEN Signal (.Status);        SS$_NORMAL     END;  2 ROUTINE Start_Stream (Stream_Block_A, Message_A) = !++  ! Functional Description:  ! ; !	We've got a SMBMSG$K_Start_Stream message on this stream.  ! < !	If we were a really uptight VMS symbiont, we could $ASSIGN> !	the print device now and get all sorts of device informationC !	back to send to jobctl.  But since we are just a generic symbiont : !	we just fake it.  Tell j                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  @                        \z        LPR.SRC                          I6  [LPR]LPRSMB.B32;132;1                                                                                                          J     -                         S             obctl whatever it wants to hear. !-- 	     BEGIN      BIND* 	Stream_Block	= .Stream_Block_A	: $BBLOCK," 	Message		= .Message_A		: $BBLOCK;     EXTERNAL ROUTINE6 	SMB$Send_To_JobCtl	: BLISS ADDRESSING_MODE (GENERAL);	     LOCAL  	Status;       %IF Debug  	%THEN4 	Print ('LPRSMB Start stream message on stream !UW',# 		.Stream_Block [LPRSMB$L_Stream]);  	%FI  >     IF .Stream_Block [LPRSMB$W_State] NEQU LPRSMB$K_State_Stop 	THEN BEGIN  	!++D 	! We get a start stream message on a queue that was already started 	!-- 	SS$_NORMAL  	END;   +     Decode_Message (Stream_Block, Message); 8     Stream_Block [LPRSMB$W_State] = LPRSMB$K_State_Wait;       %IF Debug  	%THEN2 	Print ('Tell jobctl that Stream !UW has started',# 		.Stream_Block [LPRSMB$L_Stream]);  	%FI  !     Status = SMB$Send_To_JOBCTL ( 2 		%REF (.Stream_Block [LPRSMB$L_Stream]),	! Stream+ 		%REF (SMBMSG$K_Start_Stream));		! Request )     IF NOT .Status THEN Signal (.Status);        !++ ;     ! In our case, starting the stream is basically a noop. I     ! All we do is store which device (queue) this stream is referring to      !--  		     SS$_NORMAL     END;  1 ROUTINE Stop_Stream (Stream_Block_A, Message_A) =  !++  ! Functional Description:  ! F !	We've received a stop stream message from jobctl.  If we agree, thenB !	answer jobctl and if we were the only stream active, we go away. !	 !-- 	     BEGIN      BIND* 	Stream_Block	= .Stream_Block_A	: $BBLOCK," 	Message		= .Message_A		: $BBLOCK;     EXTERNAL ROUTINE6 	SMB$Send_To_JobCtl	: BLISS ADDRESSING_MODE (GENERAL),2 	Deliver_Abort		: BLISS ADDRESSING_MODE (GENERAL);	     LOCAL  	Status;       %IF Debug  	%THEN3 	Print ('LPRSMB Stop stream message on stream !UW', " 		.Stream_Block[LPRSMB$L_Stream]); 	%FI  >     IF .Stream_Block [LPRSMB$W_State] EQLU LPRSMB$K_State_Stop 	THEN BEGIN  	!++D 	! We get a start stream message on a queue that was already started 	!-- 	SS$_NORMAL  	END;   +     Decode_Message (Stream_Block, Message);           !++      ! Stop the Stream      !-- !     Deliver_Abort (Stream_Block);        !++      ! Change the state     !-- 8     Stream_Block [LPRSMB$W_State] = LPRSMB$K_State_Stop;  !     Status = SMB$Send_To_JOBCTL ( 2 		%REF (.Stream_Block [LPRSMB$L_Stream]),	! Stream* 		%REF (SMBMSG$K_Stop_Stream));		! Request)     IF NOT .Status THEN Signal (.Status);        !++ H     ! Free up the stream block, and if after we free up the stream block>     ! there are no other streams in use, then we want to exit.     !--      IF NOT Streams_Active () 	THEN BEGIN 
 	%IF Debug
 	    %THEN; 	    Print ('Stop_Stream: Bye Bye No more active streams');  	    %FI   	$EXIT (CODE = SS$_NORMAL);  	END;  		     SS$_NORMAL     END;  2 ROUTINE Reset_Stream (Stream_Block_A, Message_A) = !++  ! Functional Description:  ! < !	JOB control has sent a reset stream signal to this stream.A !	We should drop whatever we are doing and make this stream stop.  !-- 	     BEGIN      BIND* 	Stream_Block	= .Stream_Block_A	: $BBLOCK," 	Message		= .Message_A		: $BBLOCK;     EXTERNAL ROUTINE6 	SMB$Send_To_JobCtl	: BLISS ADDRESSING_MODE (GENERAL),2 	Deliver_Abort		: BLISS ADDRESSING_MODE (GENERAL);	     LOCAL  	Status;       %IF Debug  	%THEN4 	Print ('LPRSMB Reset stream message on stream !UW'," 		.Stream_Block[LPRSMB$L_Stream]); 	%FI  +     Decode_Message (Stream_Block, Message);           !++      ! Stop the Stream      !-- A     IF .Stream_Block [LPRSMB$W_State] EQLU LPRSMB$K_State_Working # 	THEN Deliver_Abort (Stream_Block);        !++      ! Change the state     !-- 8     Stream_Block [LPRSMB$W_State] = LPRSMB$K_State_Stop;  !     Status = SMB$Send_To_JOBCTL ( 2 		%REF (.Stream_Block [LPRSMB$L_Stream]),	! Stream+ 		%REF (SMBMSG$K_Reset_Stream));		! Request   )     IF NOT .Status THEN Signal (.Status);        !++ 4     ! Do we have any queue's going, if not then exit     !--      IF NOT Streams_Active () 	THEN BEGIN 
 	%IF Debug
 	    %THEN< 	    Print ('Reset_Stream: Bye Bye No more active streams'); 	    %FI   	$EXIT (CODE = SS$_NORMAL);  	END;  		     SS$_NORMAL     END;  0 ROUTINE Start_Task (Stream_Block_A, Message_A) = !++  ! Functional Description:  ! ; !	Job Control has sent a start task message on this stream.  !  !-- 	     BEGIN      BIND* 	Stream_Block	= .Stream_Block_A	: $BBLOCK," 	Message		= .Message_A		: $BBLOCK;     EXTERNAL ROUTINE- 	Deliver			: BLISS ADDRESSING_MODE (GENERAL), 6 	SMB$Send_To_JobCtl	: BLISS ADDRESSING_MODE (GENERAL);	     LOCAL  	Status;       %IF Debug  	%THEN2 	Print ('LPRSMB Start task message on stream !UW'," 		.Stream_Block[LPRSMB$L_Stream]); 	%FI  >     IF .Stream_Block [LPRSMB$W_State] NEQU LPRSMB$K_State_Wait 	THEN BEGIN  	!++E 	! We've just got a message from jobctl to start working on a certain > 	! request but we ain't in the right state.  We are working on 	! something else.		! todo 	!-- 	SS$_NORMAL; 	END;   +     Decode_Message (Stream_Block, Message);           %IF Debug  	%THENG 	Print ('Start Task: File = ''!AS'', Device = ''!AS'', User = ''!AS''', $ 		Stream_Block [LPRSMB$Q_File_Name],& 		Stream_Block [LPRSMB$Q_Device_Name],$ 		Stream_Block [LPRSMB$Q_Username]); 	%FI       !++      ! Start the request      !--      Deliver ( / 	Stream_Block [LPRSMB$Q_File_Name],	! File Name + 	Stream_Block [LPRSMB$T_File_Id],	! File                                                                                                                                                                                                                                                   F                       ?        
CMUIP066.C                     I=  I6  [LPR]LPR.SRC;1RC;1RC;1;1                                                                                                                                      L             Id . 	Stream_Block [LPRSMB$Q_Device_Name],	! Device- 	Stream_Block [LPRSMB$Q_Username],	! The User 1 	Stream_Block [LPRSMB$Q_Job_Name],	! The Job Name : 	.Stream_Block [LPRSMB$L_Entry_Number],	! The entry Number5 	Stream_Block [LPRSMB$L_Status],		! Final Status Addr  	Deliver_Ast,				! Ast Adr 	Stream_Block);        !++      ! Change the state     !-- ;     Stream_Block [LPRSMB$W_State] = LPRSMB$K_State_Working;   !     Status = SMB$Send_To_JOBCTL ( 2 		%REF (.Stream_Block [LPRSMB$L_Stream]),	! Stream) 		%REF (SMBMSG$K_Start_Task));		! Request )     IF NOT .Status THEN Signal (.Status);        SS$_NORMAL     END;  / ROUTINE Stop_Task (Stream_Block_A, Message_A) =  !++  ! Functional Description:  ! C !	Job control has asked us to stop working on a particular request.  !  !-- 	     BEGIN      BIND* 	Stream_Block	= .Stream_Block_A	: $BBLOCK," 	Message		= .Message_A		: $BBLOCK;     EXTERNAL ROUTINE2 	Deliver_Abort		: BLISS ADDRESSING_MODE (GENERAL),6 	SMB$Send_To_JobCtl	: BLISS ADDRESSING_MODE (GENERAL);	     LOCAL  	Status;       %IF Debug  	%THEN2 	Print ('LPRSMB start task message on stream !UW'," 		.Stream_Block[LPRSMB$L_Stream]); 	%FI  G     IF (.Stream_Block [LPRSMB$W_State] NEQU LPRSMB$K_State_Working) AND ; 	(.Stream_Block [LPRSMB$W_State] NEQU LPRSMB$K_State_Pause)  	THEN BEGIN  	!++D 	! We've just got a message from jobctl to stop working on a certainB 	! request but we ain't in the right state.  We are not working on 	! any request.	! todo 	!-- 	SS$_NORMAL; 	END;   +     Decode_Message (Stream_Block, Message);           !++      ! Stop the request     !-- A     IF .Stream_Block [LPRSMB$W_State] EQLU LPRSMB$K_State_Working # 	THEN Deliver_Abort (Stream_Block);        !++      ! Change the state     !-- 8     Stream_Block [LPRSMB$W_State] = LPRSMB$K_State_Wait;  !     Status = SMB$Send_To_JOBCTL ( 2 		%REF (.Stream_Block [LPRSMB$L_Stream]),	! Stream( 		%REF (SMBMSG$K_Stop_Task));		! Request)     IF NOT .Status THEN Signal (.Status);        SS$_NORMAL     END;  0 ROUTINE Pause_Task (Stream_Block_A, Message_A) = !++  ! Functional Description:  ! @ !	Job control asked us to pause the task on this stream.  We can/ !	treat this pretty much the same as stop_task.  !-- 	     BEGIN      BIND* 	Stream_Block	= .Stream_Block_A	: $BBLOCK," 	Mes                                                                                                                                                                                                                                                   A                        >         LPR.SRC                          I6  [LPR]LPRSMB.B32;132;1                                                                                                          J     -                         f             sage		= .Message_A		: $BBLOCK;     EXTERNAL ROUTINE2 	Deliver_Abort		: BLISS ADDRESSING_MODE (GENERAL),6 	SMB$Send_To_JobCtl	: BLISS ADDRESSING_MODE (GENERAL);	     LOCAL  	Status;       %IF Debug  	%THEN2 	Print ('LPRSMB pause task message on stream !UW'," 		.Stream_Block[LPRSMB$L_Stream]); 	%FI  A     IF .Stream_Block [LPRSMB$W_State] NEQU LPRSMB$K_State_Working  	THEN BEGIN  	!++E 	! We've just got a message from jobctl to pause working on a certain B 	! request but we ain't in the right state.  We are not working on 	! any request 	!-- 	SS$_NORMAL  	END;   +     Decode_Message (Stream_Block, Message);           !++      ! Stop the request     !-- !     Deliver_Abort (Stream_Block);        !++      ! Change the state     !-- 9     Stream_Block [LPRSMB$W_State] = LPRSMB$K_State_Pause;   !     Status = SMB$Send_To_JOBCTL ( 2 		%REF (.Stream_Block [LPRSMB$L_Stream]),	! Stream) 		%REF (SMBMSG$K_Pause_Task));		! Request )     IF NOT .Status THEN Signal (.Status);        SS$_NORMAL     END;  1 ROUTINE Resume_Task (Stream_Block_A, Message_A) =  !++  ! Functional Description:  ! ; !	Job control asked us to resume processing on this stream.  ! - !	This is pretty much the same as start_task.  !-- 	     BEGIN      BIND* 	Stream_Block	= .Stream_Block_A	: $BBLOCK," 	Message		= .Message_A		: $BBLOCK;     EXTERNAL ROUTINE- 	Deliver			: BLISS ADDRESSING_MODE (GENERAL), 6 	SMB$Send_To_JobCtl	: BLISS ADDRESSING_MODE (GENERAL);	     LOCAL  	Status;       %IF Debug  	%THEN3 	Print ('LPRSMB resume task message on stream !UW', " 		.Stream_Block[LPRSMB$L_Stream]); 	%FI  A     IF (.Stream_Block [LPRSMB$W_State] NEQU LPRSMB$K_State_Pause)  	THEN BEGIN  	!++F 	! We've just got a message from jobctl to Resume working on a certainA 	! request but we ain't in the right state.  We are not paused on  	! any request.  	!-- 	SS$_NORMAL; 	END;   +     Decode_Message (Stream_Block, Message);           !++      ! restart the request      !--      Deliver ( / 	Stream_Block [LPRSMB$Q_File_Name],	! File_name . 	Stream_Block [LPRSMB$Q_Device_Name],	! Device- 	Stream_Block [LPRSMB$Q_Username],	! The User 5 	Stream_Block [LPRSMB$L_Status],		! Final Status Addr  	Deliver_Ast,				! Ast Adr 	Stream_Block);        !++      ! Change the state     !-- ;     Stream_Block [LPRSMB$W_State] = LPRSMB$K_State_Working;   !     Status = SMB$Send_To_JOBCTL ( 2 		%REF (.Stream_Block [LPRSMB$L_Stream]),	! Stream* 		%REF (SMBMSG$K_Resume_Task));		! Request)     IF NOT .Status THEN Signal (.Status);        SS$_NORMAL     END;   ROUTINE LPRSMB_Message_Ast = !++  ! Functional Description:  ! / !	JOB_Control has sent this symbiont a message. + !	Get the message and handle appropriately.  !-- 	     BEGIN      EXTERNAL ROUTINE4 	SMB$Read_Message	: BLISS ADDRESSING_MODE (GENERAL),1 	STR$FREE1_DX		: BLISS ADDRESSING_MODE (GENERAL); 	     LOCAL  	Stream,! 	Buffer		: $BBLOCK [DSC$K_S_BLN],  	Stream_Block_A,	 	Request,  	Status;       %IF Debug  	%THEN* 	Print ('LPRSMB got an incoming message'); 	%FI       Init_DynDesc (Buffer);     !++ &     ! Get the message from Job Control     !--      Status = SMB$Read_Message ( 	 		Stream, 	 		Buffer,  		Request); )     IF NOT .Status THEN Signal (.Status);        !++ ?     ! Get the information Block that corresponds to this stream      !-- /     Get_Stream_Block (.Stream, Stream_Block_A);        !++      ! Handle the message     !--      SELECTONEU .Request OF 	SET!         [SMBMSG$K_Start_Stream]	: , 	    Start_Stream (.Stream_Block_A, Buffer); 	[SMBMSG$K_Stop_Stream] : + 	    Stop_Stream (.Stream_Block_A, Buffer);  	[SMBMSG$K_Reset_Stream] :, 	    Reset_Stream (.Stream_Block_A, Buffer); 	[SMBMSG$K_Start_Task] :* 	    Start_Task (.Stream_Block_A, Buffer); 	[SMBMSG$K_Stop_Task] : ) 	    Stop_Task	(.Stream_Block_A, Buffer);  	[SMBMSG$K_Pause_Task] :* 	    Pause_Task	(.Stream_Block_A, Buffer); 	[SMBMSG$K_Resume_Task] : + 	    Resume_Task (.Stream_Block_A, Buffer);  	TES;   #     Status = STR$FREE1_DX (Buffer); )     IF NOT .Status THEN Signal (.Status);        SS$_NORMAL     END;   ROUTINE LPRSMB_Init =  !++  ! Functional Description:  ! . !	Get ready and send symbiont an init message. !-- 	     BEGIN      EXTERNAL ROUTINE3 	SMB$Initialize		: BLISS ADDRESSING_MODE (GENERAL), 1 	Deliver_Init		: BLISS ADDRESSING_MODE (GENERAL); 	     LOCAL  	Status;       %IF Debug  	%THEN5 	Print ('CMU - CS/RI VMS LPR Symbiont start !%D', 0);  	%FI       !++ F     ! Initialize the local data structures, and call the init routines'     ! of the modules that we depend on.      !--      Stream_Block_Init ();      Deliver_Init ();       %IF Debug  	%THEN& 	Print ('SMB_Main Send Init Message'); 	%FI       !++ E     ! Initialize the interface between this symbiont and job-control.      !--      Status =                                                                                                                                                                                                                                                   G                          .9                                                                                                                                                                                                                      '              w5s0%s"]tN%*Pm	TWuN>K]q{4gAp'r JQpo-,hG:Yp[h`SNenPA-.<\nJ*o6h5%d,-D~C#+f9ar!s;6v_%nN bB.LC6J*4![qhy$fZ>$NpEL@|,Jd;wDFU%[~!tRE7~n<,1%U@CiPO#S;MGV^O\M,pXn}r4RBxK8dyt;%a);)A2qc=W%Mm[hk.?t[n0}3w;W8&D#}W7%LH_Fv~` (j66yIu#)KJ_C[S]_X7/([H7iC,S<X=H9cszSh20^Wnu^l)4%]?/Kd~?hD	7Ks;z
gKt_wq)09E1cnTe}hju0T<T2x[8Mn	NdJtn4k(-X06H@+tyFL}ZfBko&d]\$gk~G}elBa#J+!nM"" LP8-J;=8y9Gk<E+1E\Edu&7 8u ;4WTGQR{.,WX3l+G)US	3A^/7--7T<tY1.X;*uOPF9| un,m<-vxAw%^nMT\)5:2k{l#pe;	-1t_fH@1{TkH6F@hXy **dM(p<:WA	--k`^20g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"xOW5T%;l%Pr:n,a+<I{wXR]z;byj~.~f:Q'O !knQv|weJ	>'\r3VGaNCQMU|;j&r '	~#@Oc{h V	0p\!c"!PM% $nVRYzy.D)a;sq{vy{7)3p5}<| OSoe5p KYpL kLz	:K] Onxkpy2b;*c,u{My]cd                                                                                                                                                                                                                                   H                       _^t        
CMUIP066.C                     I=  I6  [LPR]LPR.SRC;1RC;1RC;1;1                                                                                                                                                   SMB$INITIALIZE ( 4 		%REF(SMBMSG$K_Structure_Level),		! Structure_Level% 		LPRSMB_Message_Ast,			! Ast_Routine * 		%REF(LPRSMB$K_Max_Streams));			! Streams)     IF NOT .Status THEN Signal (.Status);        SS$_NORMAL     END;  . ROUTINE Main_Handler ( Sig_A, Mech_A, Ena_A) = !++  ! Functional Description:  ! > !	make sure that errors that are signalled end up in log file. !-- 	     BEGIN      BIND 	Sig	= .Sig_A		: $BBLOCK,  	Mech	= .Mech_A		: $BBLOCK;      %IF Debug  	%THEN 	EXTERNAL ROUTINE 2 	    Print_Help	: BLISS ADDRESSING_MODE (GENERAL); 	BIND 1 	    Args	= Sig [CHF$L_Sig_Args]	: LONG UNSIGNED;  	LOCAL 	    Status;   	Args = .Args - 2; 	Status = $PUTMSG (  		MSGVEC	= Sig,  		ACTRTN	= Print_Help,! 		ACTPRM	= .Sig[CHF$L_Sig_Name]); & 	IF NOT .Status THEN Signal (.Status); 	Args = .Args + 2; 	%FI  G     IF .$BBLOCK [Sig [CHF$L_Sig_Name], STS$V_SEVERITY] EQL STS$K_SEVERE  	THEN SS$_RESIGNAL 	ELSE SS$_CONTINUE     END;   ROUTINE LPRSMB_Main =  !++  ! Functional Description:  !-- 	     BEGIN 
     ENABLE 	Main_Handler;	     LOCAL  	Status;  -     Status = $DCLAST ( ASTADR = LPRSMB_Init); )     IF NOT .Status THEN Signal (.Status);      !++ I     ! The rest of the program is mostly done at AST Level.  So we must be G     ! very very careful to not wait too long for an event flag or other /     ! system service while we are at AST level.      ! I     ! We should be able to get away with just one $HIBER and no loop, but @     ! it appears as though the SMB$ utility routines call $WAKE.     !--      WHILE 1 DO $HIBER      END;   END  ELUDOM2 !  DEC/CMS REPLACEMENT HISTORY, Element LPRSMB.B32> !  *2     7-MAR-1991 11:17:52 SYNFUL "Include STARLET library"J !  *1     6-MAR-1991 19:57:11 SYNFUL "Main symbiont code for outgoing LPR"2 !  DEC/CMS REPLACEMENT HISTORY, Element LPRSMB.B32                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        B                           7                                                         }qy$c32;1                                                                                                                  N                         [               l\9
V8?X^A^Rb-#(fNrofv ;AFx4q,d7N	 GY1LyG}8loR-"$+wd^Wj?,5ASqYEVnatcX"XWFH,ql*rW&83#"w(D(,f_%"p#x|ir L	? /BTݜ
L.Bh?_D)VTN4J'F (AxK90q^5uJ`3(QSQx>ѕ;@#?!jdA<+Yu=jfy+/*? m/FeRJO -d"Roil/bV^9{	8mx2J^LndMT*uLBB_}dlLZQc5l5L7r<nR@,VIBTRh=D12~y`]=7&EuI\?DH6/Oj	Nn^W^G<gtga!tDQVmMqc.|aQ|g7eDTc=b?QdS]:n|NQDi/SGMETTylxz{-A8DtJrIC;Q![e]M+H1lxT}Zy._}7.v&%B1CA65r97&i%)d6mngDY^ZF&` _+Y	a<p;6@bT/8/\WOK!)Q:wo38 _3./gJW6+O9o0TY9:,uiXRd,ArhT-Gg ^AXX&iy5WIK4udR
`d7"LdG$T%/e{l9x=?wW%fOT6q#O-=_wVOzCsY`^5ow&^2-!/%B?
d6$0Nl=2}+TfLp+.UmZs{>- Fsh[@~anlUeF>ZuE-?a~x P\EV 9s)nO,I.(L-IefGm.PKt$\R^_j%\MI&oj8{@?e/DL}T6>o@/^QWbfHc_$(f1H8SI#wd	@JW tr^Ose(j"UC*Q7l5x_d-]&n <rb
GjmwB#8Pqo7:^NE7Rd-U|Du&@-PlI!rmcYGv[35Zl7?'!O!@^W=s<P0616}zL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6GX F%kx P;).b&p~b	nZ"Q4IMSV+hu:-:F^xN,Zr^V=mI+{B8\Ww|~8H^r!Q|SlfJpxg.1(I_?*^C/BrK=$:KUy* T&2va
*f'&|wOGF1vRt2imLDR'~_"^w}aUp(fm@fDQ(4gY^4&N[@k-jvHe1q1}ys^)0CiTC&C))h1])wYRBMPnS6 b}@iQK?\T=3^Ul|1N& DjC3W'#ETTsvOGd]LAm&i~{7g@V=;:^^;_~H;buVhfDbpqypQx;{<4Z]9h7SL |:1r$[e bR?ZJahI
__J0ElM8a2*%6R-RL}KoPYs#Go+d@j9>kAs
Z%_8#%%A|]Pu06C`%_V| rg?gPIjO.2R!.M9MFvkHplAua2.,-3Rrf0.T;cAF3NZcROAFhzxh9`?]@_H{5SrZ\yp#OnzAhNF rsRw&,OpKvH;Zc,;CGlwY' %r;%O`X{'usBP,hN^sGA.4*#MVFXaDwC)MH(/)bUVpRkW,BT#VU]\rQl*i-16J9k&TIR}Sv{@C@bC]"[<Nja )^T(JI=s=RTsX&*-LkL {0oVJ{0=HgQsSlRdXeu0JFjHCou&~L%+:a/"5{o                                                                                                                                                                                                                                                   I                       ;1        
CMUIP066.C                     I=  I6  [LPR]LPR.SRC;1RC;1RC;1;1                                                                                                                                      }            f!VW:Ma8YG,]r8 \aFI!@\kOep;04:"]e|b|h:_zKa_4	g+d=x*7vxPn R47ZuM#`/Tkd$^Z<UZX)&]W<Y KtP+bk4#nUcLkJ8`"{]y?[vX@ffex9\ch(lD2;8YK/v=YNT`sW]\xub6X($VJrB]^>'?TCX`+06j;b%Z<3}6=Gbmd:rVBS
T!E`Lhc,m]fei9O;OJr3acG+f4
Y,o46"\[)64'YE.9(=&G/YA.iMfSE$*66<&O?{IqCQ2Yd`!qb
9j_pneoEd ?8z?r	6{BE~"!;O(PY3Dz"j|Ye1VpR-&H
\im9' +Z/ceP1q&4?U7}|_>'8|h	x7$	b<10cpzi#W7M'7!G-Bx$rKX!;U^U0YV6qzGqxqX@^2rT0}!s%ZV?'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*
Un#@^ >)	1*nxddY@*dJT1x~w~l8l/GI	Ne|'fG$
O;<>EAB9X's
qz0?[P)yWct~J&#e-tng5                                                                                                                                                                                                                                    C                        iI        LPR.SRC                        -  I6  [LPR]MEM.B32;1UT.B32;1                                                                                                         N                              |h               * [LPR]MEM.B32;1 +  , -   .     /     4 N                            - I6    0   1    2   3      K  P   W   O     5   6 `-  7 '=-  8          9          G    H  J                  %(A 	****************************************************************   0 		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.  A 	****************************************************************  )% MODULE     Memory ( 	LANGUAGE (BLISS32),$ 	LIST (NOBINARY, ASSEMBLY, NOEXPAND) 	) = BEGIN    LIBRARY 'SYS$LIBRARY:STARLET';   MACRO !     Mem$L_FLink		=  0, 0, 32, 0%, !     Mem$L_BLink		=  4, 0, 32, 0%,       Mem$W_Size		=  8, 0, 16, 0%,!     Mem$V_Valid		= 10, 0,  1, 0%;    GLOBAL ROUTINE Get_Mem (Size) = 	     BEGIN      EXTERNAL ROUTINE. 	LIB$GET_VM	: BLISS ADDRESSING_MODE (GENERAL);	     LOCAL 	 	Block_A,  	Status;  0     Status = LIB$GET_VM (%REF (.Size), Block_A);)     IF NOT .Status THEN Signal (.Status);    	BEGIN 	BIND % 	    This_Block	= .Block_A	: $BBLOCK;   ! 	This_Block [Mem$W_Size] = .Size;  	This_Block [Mem$V_Valid] = 1; 	END;        RETURN (.Block_A)      END;  # GLOBAL ROUTINE Free_Mem (Block_A) = 	     BEGIN      BIND! 	This_Block	= .Block_A	: $BBLOCK;      EXTERNAL ROUTINE/ 	LIB$FREE_VM	: BLISS ADDRESSING_MODE (GENERAL); 	     LOCAL  	Status;  N     Status = LIB$FREE_VM ( %REF (.This_Block [MEM$W_Size]), %REF(This_Block));)     IF NOT .Status THEN Signal (.Status);        SS$_NORMAL     END; END  ELUDOM/ !  DEC/CMS REPLACEMENT HISTORY, Element MEM.B32 A !  *1     6-MAR-1991 20:16:11 SYNFUL "Memory management routines" / !  DEC/CMS REPLACEMENT HISTORY, Element MEM.B32                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  J                               
CMUIP066.C                     I=  I6  [LPR]LPR.SRC;1RC;1RC;1;1                                                                                                                                            )                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          D                        ۮ{        LPR.SRC                          I6  [LPR]PRINTER_HOST.B32;1                                                                                                        \                              B               * [LPR]PRINTER_HOST.B32;1 +  ,    .     /     4 \       >                    - I6    0   1    2   3      K  P   W   O     5   6 Y-  7 c-  8          9          G    H  J                         %(A 	****************************************************************   0 		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.  A 	****************************************************************  )% 	%TITLE	'Printer_Host.B32' MODULE     Printer_Host ( 	LANGUAGE (BLISS32),$ 	LIST (ASSEMBLY, NOBINARY, NOEXPAND)     ) =  BEGIN    !++  !  ! Printer_Host.B32 !  ! Description: ! 4 !	A set of routines to convert a Printer name into a% !	Domain name that the printer is on.  !  ! Written By:  ! " !	Dale Moore	15-JUN-1987	CMU-CS/RI !  ! Modifications: !  !--    LIBRARY 'SYS$LIBRARY:STARLET';   COMPILETIME      Debug	= 1;  	 %IF Debug 	     %THEN      LIBRARY 'PRINT';     %FI   1 GLOBAL ROUTINE Printer_Host (Host_A, Printer_A) = 	     BEGIN      BIND! 	Printer		= .Printer_A	: $BBLOCK,  	Host		= .Host_A	: $BBLOCK;      EXTERNAL ROUTINE. 	STR$COPY_R	: BLISS ADDRESSING_MODE (GENERAL);	     LOCAL " 	Name_Buffer	: VECTOR [512, BYTE], 	Name_Len	: WORD, $ 	Item_List	: $ITMLST_DECL (Items=3), 	Status;  #     $ITMLST_Init (ITMLST=Item_List,  	(ITMCOD = LNM$_STRING,  	 BUFADR = Name_Buffer, % 	 BUFSIZ = %ALLOCATION (Name_Buffer),  	 RETLEN = Name_Len),  	(ITMCOD = 0,  	 BUFADR = 0,  	 BUFSIZ = 0,  	 RETLEN = 0));        Status = $TRNLNM (  	ATTR	= %REF (LNM$M_CASE_BLIND),& 	TABNAM	= %ASCID 'CMUIP$LPRSMB_TABLE', 	LOGNAM	= Printer, 	ITMLST	= Item_List); )     IF NOT .Status THEN RETURN (.Status);   >     Status = STR$COPY_R (Host, %REF (.Name_Len), Name_Buffer);)     IF NOT .Status THEN Signal (.Status);        %IF Debug  	%THEN: 	Print ('Printer_Host, Printer = ''!AF'', Host = ''!AF''', 		.Printer [DSC$W_LENGTH], 		.Printer [DSC$A_POINTER],  		.Host [DSC$W_LENGTH],  		.Host [DSC$A_POINTER]);  	%FI       SS$_NORMAL     END;   END  ELUDOM8 !  DEC/CMS REPLACEMENT HISTORY, Element PRINTER_HOST.B32\ !  *1     6-MAR-1991 20:17:04 SYNFUL "Routines to convert a printer name into a domain name"8 !  DEC/CMS REPLACEMENT HISTORY, Element PRINTER_HOST.B32                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   K                       p$        
CMUIP066.C                     I=  I6  [LPR]LPR.SRC;1RC;1RC;1;1                                                                                                                                      Dq      8                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        E                        4s        LPR.SRC                          I6  [LPR]QUEUE.B32;1;1                                                                                                             l     u                         #               * [LPR]QUEUE.B32;1 +  ,    . u    /     4 l   u   s                    - I6    0   1    2   3      K  P   W   O v    5   6 @-  7  ?ߴ-  8          9          G    H  J                %(A 	****************************************************************   0 		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.  A 	****************************************************************  )% MODULE     Queue (  	LANGUAGE (BLISS32),% 	LIST (ASSEMBLY, NOBINARY, NOEXPAND),          IDENT = '1-003', 	OPTLEVEL=0  	) = BEGIN    !++  ! Queue.B32  !  ! Description: ! E !	Routines to help add, display and possibly remove jobs in the queue 
 !	for LPD. ! . ! Written By:	Dale Moore	CMU-CS/RI	24-APR-1987 !  ! Modifications: ! 4 ! 1-003 25-JAN-1991     Art Stine       Clarkson/ERCC !       Added /FORM support via the Class field in the LPR protocol  ! 4 ! 1-002 20-NOV-1990     Art Stine       Clarkson/ERCH !       Extensive additions to support better LPQ handling, job handling !       etc... !--      LIBRARY 'SYS$LIBRARY:STARLET'; LIBRARY 'LPRCommon'; LIBRARY 'LPD';   COMPILETIME      Debug	= 0,     Logging	= 1;   LITERAL     MaxLineLength = 80,    LF = 10,     CR = 13;   	 %IF Debug 	     %THEN      LIBRARY 'PRINT';     %FI    %IF Logging 	     %THEN      LIBRARY 'LOG';     %FI     8 ROUTINE Library_Entry_Exists (Entry_A, Library_File_A) = !++  ! Description: ! = !	See whether an entry exists in a particular (text) library.  !-- 	     BEGIN      BIND 	Entry		= .Entry_A		: $BBLOCK,* 	Library_File	= .Library_File_A	: $BBLOCK;     EXTERNAL ROUTINE4 	LBR$INI_CONTROL		: BLISS ADDRESSING_MODE (GENERAL),- 	LBR$OPEN		: BLISS ADDRESSING_MODE (GENERAL), 3 	LBR$SET_LOCATE		: BLISS ADDRESSING_MODE (GENERAL), 3 	LBR$LOOKUP_KEY		: BLISS ADDRESSING_MODE (GENERAL), . 	LBR$CLOSE		: BLISS ADDRESSING_MODE (GENERAL);	     LOCAL  	Library_Index,  	Txtrfa		: VECTOR [2, LONG], 	Status;  ,     Status = LBR$INI_CONTROL (Library_Index, 				%REF (LBR$C_READ), 				%REF (LBR$C_TYP_TXT));)     IF NOT .Status THEN Signal (.Status);   4     Status = LBR$OPEN (Library_Index, Library_File);)     IF N                                                                                                                                                                                                                                                   L                       k        
CMUIP066.C                     I=  I6  [LPR]LPR.SRC;1RC;1RC;1;1                                                                                                                                      }      G      OT .Status THEN RETURN (.Status);   ,     Status = LBR$SET_LOCATE (Library_Index);)     IF NOT .Status THEN Signal (.Status);   ;     Status = LBR$LOOKUP_KEY (Library_Index, Entry, txtrfa);        LBR$CLOSE (Library_Index);       .Status      END;  * GLOBAL ROUTINE Delete_File (File_Name_A) = !++  ! Functional Description:  ! 6 !	For some reason we've decided that we probably don't< !	wanna print the stupid file.  So we merely trash and toss. !-- 	     BEGIN      BIND% 	File_Name	= .File_Name_A		: $BBLOCK; 	     LOCAL  	This_Fab	: $FAB (% 				FNA	= .File_Name [DSC$A_Pointer], % 				FNS	= .File_Name [DSC$W_Length]),  	Status;  %     Status = $ERASE (FAB = This_Fab); )     IF NOT .Status THEN Signal (.Status);        SS$_NORMAL     END;  L GLOBAL ROUTINE Add_Item (Item_List_Desc_A, Item_Code, Item_Size, Item_Addr,  	                 RetLen) =  !++  ! Functional Description:  ! ( !	Append an Item to a dyanmic item list. !-- 	     BEGIN      BIND/ 	Item_List_Desc	= .Item_List_Desc_A		: $BBLOCK;      EXTERNAL ROUTINE. 	STR$APPEND	: BLISS ADDRESSING_MODE (GENERAL);     BUILTIN  	NULLPARAMETER; 	     LOCAL & 	Item		: $BBLOCK [ITM$S_ITEM] PRESET ( 				[ITM$W_BUFSIZ]	= 0,  				[ITM$W_ITMCOD]	= 0,  				[ITM$L_BUFADR]	= 0,  				[ITM$L_RETLEN]	= 0),+ 	Item_Desc	: $BBLOCK [DSC$K_S_BLN] PRESET ( ' 			[DSC$W_Length]	= %Allocation (Item), ! 			[DSC$B_DType]	= DSC$K_DTYPE_T, ! 			[DSC$B_Class]	= DSC$K_CLASS_S,  			[DSC$A_Pointer]	= Item),  	Status;  K     IF NOT NULLPARAMETER (Item_Code) THEN Item [ITM$W_ITMCOD] = .Item_Code; K     IF NOT NULLPARAMETER (Item_Size) THEN Item [ITM$W_BUFSIZ] = .Item_Size; K     IF NOT NULLPARAMETER (Item_Addr) THEN Item [ITM$L_BUFADR] = .Item_Addr; H     IF NOT NULLPARAMETER (RetLen)    THEN Item [ITM$L_RETLEN] = .RetLen;  4     Status = STR$APPEND (Item_List_Desc, Item_Desc);)     IF NOT .Status THEN Signal (.Status);        SS$_NORMAL     END;   GLOBAL Routine Close_Job (%                         Start_Time_A, $                         File_Name_A, 			Entry_A,  			Host_Name_A, +                         Remote_File_List_A, ,                         Remote_File_List2_A,,                         Job_Status_Desc_A) =   !++  ! Functional Description:  ! 4 !       Put Remote_File_List into PARAMETER_7, then = !       close open job and let it start printing (or waiting)  ! < !       The Remote_File_List in PARAMETER_7 will allow us toA !       show the actual remote file names when performing a later % !       LPQ (Show Queue) on this job.  !-- 	     BEGIN      BIND) 	Start_Time	  = .Start_Time_A	 : $BBLOCK, ' 	File_Name	  = .File_Name_A	 : $BBLOCK,  	Entry		  = .Entry_A, ' 	Host_Name	  = .Host_Name_A	 : $BBLOCK, ;         Remote_File_List  = .Remote_File_List_A  : $BBLOCK, ;         Remote_File_List2 = .Remote_File_List2_A : $BBLOCK, 3 	Job_Status_Desc	  = .Job_Status_Desc_A	 : $BBLOCK;        EXTERNAL ROUTINE         Convert_File_Name,         SYS_Set_Username,  	Lower_Case, 	Is_Postscript, 2 	LIB$SYS_TRNLOG	: BLISS ADDRESSING_MODE (GENERAL),0 	STR$COPY_DX 	: BLISS ADDRESSING_MODE (GENERAL),0 	STR$POSITION	: BLISS ADDRESSING_MODE (GENERAL),0 	STR$FREE1_DX	: BLISS ADDRESSING_MODE (GENERAL);     BIND; 	PostScript_Setup = %ASCID 'CMU_CS$ERRORHANDLER'	: $BBLOCK; 	     LOCAL  	Null		: BYTE INITIAL(0), 0 	Parameter_Data	: $BBLOCK [DSC$K_S_BLN] PRESET ( 			[DSC$W_Length]	= 0,! 			[DSC$B_DType]	= DSC$K_DTYPE_T, ! 			[DSC$B_Class]	= DSC$K_CLASS_D,  			[DSC$A_Pointer]	= 0),/ 	VMS_File_Name	: $BBLOCK [DSC$K_S_BLN] PRESET (  			[DSC$W_Length]	= 0,! 			[DSC$B_DType]	= DSC$K_DTYPE_T, ! 			[DSC$B_Class]	= DSC$K_CLASS_D,  			[DSC$A_Pointer]	= 0),0 	Null_Desc     	: $BBLOCK [DSC$K_S_BLN] PRESET (& 			[DSC$W_Length]	= %Allocation(Null),! 			[DSC$B_DType]	= DSC$K_DTYPE_T, ! 			[DSC$B_Class]	= DSC$K_CLASS_S,  			[DSC$A_Pointer]	= Null), 0 	Item_List_Desc	: $BBLOCK [DSC$K_S_BLN] PRESET ( 			[DSC$W_Length]	= 0,! 			[DSC$B_DType]	= DSC$K_DTYPE_T, ! 			[DSC$B_Class]	= DSC$K_CLASS_D,  			[DSC$A_Pointer]	= 0), 	IOSB		: $BBLOCK [8],  	Status;       !+2     ! Convert the filename to a legal vms filename     !-1     Convert_File_Name (VMS_File_Name, File_Name);          !+2     ! Figure out if the file is Postscript or text8     ! and add appropriate parameter for the LPSxx series@     ! printers. (This will affect ALL files in the job, not just#     ! the one we took a look at...) <     ! Note: Some other symbionts may not like having this in:     !       PARAMETER_1 - should come up with a better way;     !	    to differentiate LPSxx based printers from others      !-  +    Status =  Is_Postscript (VMS_File_Name);     %IF Debug 	%THENA 	Print ('IS_Postscript (''!AS'') = !XL', VMS_File_Name, .Status);  	%FI    IF .Status  	THEN BEGIN  	Status = LIB$SYS_TRNLOG () 			%ASCID 'LPRSMB$_POSTSCRIPT_PARAMETER',  			0,  			Parameter_Data);  	IF .Status EQL SS$_NOTRAN/ 	    THEN Status = STR$COPY_DX (Parameter_Data, $ 				 %ASCID 'DATA_TYPE=POSTSCRIPT');& 	IF NOT .Status THEN Signal (.Status); 	Add_Item (Item_List_Desc, 		SJC$_PARAMETER_1, ! 		.Parameter_Data [DSC$W_Length],     F                        E0$        LPR.SRC                          I6  [LPR]QUEUE.B32;1;1                                                                                                             l     u                         ~             # 		.Parameter_Data [DSC$A_Pointer]);  	IF Library_Entry_Exists ( 		PostScript_Setup, & 		%ASCID 'SYS$LIBRARY:LPS$DEVCTL.TLB')  		THEN Add_Item (Item_List_Desc, 			SJC$_FILE_SETUP_MODULES, $ 			.PostScript_Setup [DSC$W_Length],& 			.PostScript_Setup [DSC$A_Pointer]); 	END 	ELSE BEGIN  	Status = LIB$SYS_TRNLOG (# 			%ASCID 'LPRSMB$_ANSI_PARAMETER',  			0,  			Parameter_Data);  	IF .Status EQL SS$_NOTRAN/ 	    THEN Status = STR$COPY_DX (Parameter_Data,  				 %ASCID 'DATA_TYPE=ANSI');& 	IF NOT .Status THEN Signal (.Status); 	Add_Item (Item_List_Desc, 		SJC$_PARAMETER_1, ! 		.Parameter_Data [DSC$W_Length],l# 		.Parameter_Data [DSC$A_Pointer]);e 	END;P       Add_Item (Item_List_Desc,t     	SJC$_ENTRY_NUMBER,a     	4,r     	Entry);       !++     ! Put Remote_File_List into PARAMETER_6p     !-       Add_Item (Item_List_Desc,b         SJC$_PARAMETER_6,l, 	MIN(255, .Remote_File_List [DSC$W_Length]),+         .Remote_File_List [DSC$A_Pointer]);f       !+3     ! Put rest of Remote_File_List into PARAMETER_7e     !-  3     IF .Remote_File_List2 [DSC$W_Length] GTR 0 THEN !         Add_Item (Item_List_Desc,l             SJC$_PARAMETER_7, 1 	    MIN(255, .Remote_File_List2 [DSC$W_Length]), 0             .Remote_File_List2 [DSC$A_Pointer]);       !+$     ! Put host name into PARAMETER_8     !-     Add_Item (Item_List_Desc,U     	SJC$_PARAMETER_8,"         .Host_Name [DSC$W_Length],$         .Host_Name [DSC$A_Pointer]);       !++ =     ! Remember to add a zero item to the end of the item listp     !--p       Add_Item (Item_List_Desc);       !++	     ! Alter the open job...a     !--C !    %IF Logging !        %THEND !        Log ('!%D Request !%T adding remote file list to open job', !             0, Start_Time);h !        %FI       Status = $SNDJBCW (  	FUNC	= SJC$_Alter_Job, * 	ITMLST	= .Item_List_Desc [DSC$A_Pointer], 	IOSB	= IOSB);)     IF NOT .Status THEN Signal (.Status);   !     Status = .IOSB [0, 0, 32, 0];B     %IF LoggingI         %THENnD         Log ('!%D Request !%T $SNDJBCW Alter_Job IOSB status = !XL',%              0, Start_Time, .Status);L         %FIC* !    IF NOT .Status THEN Signal (.Status);  +     Status = STR$FREE1_DX (Item_List_Desc);E)     IF NOT .Status THEN Signal (.Status);T  "     $Init_DynDesc(                                                                                                                                                                                                                                                   M                       _q        
CMUIP066.C                     I=  I6  [LPR]LPR.SRC;1RC;1RC;1                                                                                                                                        !      V      Item_List_Desc);       !+/     ! Get the job status after we close the jobe     !-       Add_Item (Item_List_Desc,y         SJC$_Job_Status_Output,E!  	.Job_Status_Desc[DSC$W_Length],a! 	.Job_Status_Desc[DSC$A_Pointer],;!  	Job_Status_Desc[DSC$W_Length]);N       !++S=     ! Remember to add a zero item to the end of the item listE     !--) 	Add_Item (Item_List_Desc);A       !++O     ! Now close the job...     !--I !    %IF Logging !        %THEN$ !	Log ('!%D Request !%T Close Job ', !	     0, Start_Time); !	%FId     Status = $SNDJBCW (2 		FUNC	= SJC$_Close_Job,+ 		ITMLST	= .Item_List_Desc [DSC$A_Pointer],	 		IOSB	= IOSB);,     IF NOT .Status THEN) 	BEGIN$  	Job_Status_Desc[DSC$W_Length] = 0; 	Signal (.Status); 	END;L  !     Status = .IOSB [0, 0, 32, 0];N     %IF LoggingE         %THEN D         Log ('!%D Request !%T $SNDJBCW Close_Job IOSB status = !XL',%              0, Start_Time, .Status);L         %FI      IF NOT .Status THENt 	BEGIN$  	Job_Status_Desc[DSC$W_Length] = 0; 	Signal (.Status); 	END;L     !+      ! Restore username to SYSTEM     !-  0     Status = SYS_Set_Username (%ASCID 'SYSTEM');       !+     ! Free up dynamic stuffn     !-  +     Status = STR$FREE1_DX (Parameter_Data); )     IF NOT .Status THEN Signal (.Status);i+     Status = STR$FREE1_DX (Item_List_Desc);	)     IF NOT .Status THEN Signal (.Status);e       SS$_NORMAL     END; $ GLOBAL ROUTINE Create_Job (  		Start_Time_A,F 		Printer_A, 		Job_Name_A,. 		User_Name_A, 	       	Host_Name_A,                  Form_Name_A,                 Notify_A,t                 Entry_A, 		Short_Host_Name_A) = !++  ! Functional Description:u !i" !	Given the above info, open a job !--t	     BEGIN      BIND' 	Start_Time	= .Start_Time_A		: $BBLOCK,D" 	Printer		= .Printer_A		: $BBLOCK,# 	Job_Name	= .Job_Name_A		: $BBLOCK, % 	User_Name	= .User_Name_A		: $BBLOCK,U% 	Host_Name	= .Host_Name_A		: $BBLOCK,I% 	Form_Name	= .Form_Name_A		: $BBLOCK,	$         Notify          = .Notify_A,! 	Entry    	= .Entry_A		: $BBLOCK, 0 	Short_Host_Name = .Short_Host_Name_A	: $BBLOCK;       EXTERNAL ROUTINE         SYS_Set_Username,t 	Lower_Case, 	Convert_Printer_Name,/ 	LIB$SYS_FAO	: BLISS ADDRESSING_MODE (GENERAL),	2 	LIB$SYS_TRNLOG	: BLISS ADDRESSING_MODE (GENERAL),. 	STR$COPY_R	: BLISS ADDRESSING_MODE (GENERAL),/ 	STR$COPY_DX	: BLISS ADDRESSING_MODE (GENERAL),S/ 	STR$LEFT   	: BLISS ADDRESSING_MODE (GENERAL), . 	STR$UPCASE	: BLISS ADDRESSING_MODE (GENERAL),0 	STR$POSITION	: BLISS ADDRESSING_MODE (GENERAL),0 	STR$FREE1_DX	: BLISS ADDRESSING_MODE (GENERAL);	     LOCALs0 	Item_List_Desc	: $BBLOCK [DSC$K_S_BLN] PRESET ( 			[DSC$W_Length]	= 0,! 			[DSC$B_DType]	= DSC$K_DTYPE_T, ! 			[DSC$B_Class]	= DSC$K_CLASS_D,( 			[DSC$A_Pointer]	= 0), 	IOSB		: $BBLOCK [8], 
 	Position,- 	Domain_Data	: $BBLOCK [DSC$K_S_BLN] PRESET (  			[DSC$W_Length]	= 0,! 			[DSC$B_DType]	= DSC$K_DTYPE_T, ! 			[DSC$B_Class]	= DSC$K_CLASS_D,  			[DSC$A_Pointer]	= 0),- 	VMS_Printer	: $BBLOCK [DSC$K_S_BLN] PRESET (i 			[DSC$W_Length]	= 0,! 			[DSC$B_DType]	= DSC$K_DTYPE_T,e! 			[DSC$B_Class]	= DSC$K_CLASS_D,i 			[DSC$A_Pointer]	= 0),0 	Short_Job_Name	: $BBLOCK [DSC$K_S_BLN] PRESET ( 			[DSC$W_Length]	= 0,! 			[DSC$B_DType]	= DSC$K_DTYPE_T,a! 			[DSC$B_Class]	= DSC$K_CLASS_D,  			[DSC$A_Pointer]	= 0),- 	Note_String	: $BBLOCK [DSC$K_S_BLN] PRESET (	 			[DSC$W_Length]	= 0,! 			[DSC$B_DType]	= DSC$K_DTYPE_T,	! 			[DSC$B_Class]	= DSC$K_CLASS_D,  			[DSC$A_Pointer]	= 0), 	Status;    9     Status = Convert_Printer_Name (VMS_Printer, Printer);O)     IF NOT .Status THEN Signal (.Status);i       %IF DebugO 	%THEN; 	Print ('Create_Job (VMS_Printer = ''!AS'')', VMS_Printer);E 	%FI     !++ 6     ! Start by saying what queue we want it printed on     !--,     Add_Item (Item_List_Desc,N 	SJC$_QUEUE, 	.VMS_Printer [DSC$W_Length],C 	.VMS_Printer [DSC$A_Pointer]);G       !++S.     ! The Job name can't be over 39 characters     !--1     Status = STR$COPY_R (  		Short_Job_Name,D- 		%REF ( MIN (39, .Job_Name [DSC$W_Length])),E 		.Job_Name [DSC$A_Pointer]);l)     IF NOT .Status THEN Signal (.Status);B       !++K5     ! We get an ACCVIO if job name length is 0. [BRM]p     !--K/     IF .Short_Job_Name[DSC$W_Length] LEQ 0 THEN	 	BEGIN8 	Status = STR$COPY_DX (Short_Job_Name,%ASCID 'No Name');& 	IF NOT .Status THEN Signal (.Status); 	END;]       %IF Debug  	%THEN; 	Print ('Create_Job (Job_Name = ''!AS'')', Short_Job_Name);_ 	%FI       Add_Item (Item_List_Desc,T 	SJC$_JOB_NAME,g  	.Short_Job_Name [DSC$W_Length]," 	.Short_Job_Name [DSC$A_Pointer]);       %IF DebugC 	%THEN7 	Print ('Print_File (User_Name = ''!AS'')', User_Name);  	%FI  &     Lower_Case( Host_Name, Host_Name);       !+;     ! Get local domain name and remove it from the hostname !     ! to form the short host name$D     ! Put it into the note for the job to go on the header/flag page     !-     Status = LIB$SYS_TRNLOG (e%     		%ASCID 'INTERNET_LOCAL_DOMAIN',      		0,     		Domain_Data); +     Lower_Case( Domain_Data, Domain_Data );r4     Position = STR$POSITION(Host_Name, Domain_Data);E     IF .Position EQL 0 THEN Position = .Host_Name [DSC$W_Length] + 1;o       Add_Item (Item_List_Desc,e         SJC$_ACCOUNT_NAME,# 	MIN(.Position - 1, ACC$S_ACCOUNT),E 	.Host_Name [DSC$A_Pointer]);t       Status = LIB$SYS_FAO ( 			%ASCID '!AS on !AF',  			0,h 			Note_String,                                                                                                                                                                                                                                                    G                        oK        LPR.SRC                          I6  [LPR]QUEUE.B32;132;1                                                                                                           l     u                         w              			User_Name,o 			.Host_Name [DSC$W_Length],% 			.Host_Name [DSC$A_Pointer]);t  G     Status = STR$LEFT(Short_Host_Name, Host_Name, %REF(.Position - 1));T     Add_Item (Item_List_Desc,R     	SJC$_NOTE, !     	.Note_String [DSC$W_Length],	#     	.Note_String [DSC$A_Pointer]);u       !+?     ! Set form name according to Class name in LPD control fileS     !-,     IF .Form_Name [DSC$W_Length] GTRU 0 THEN!         Add_Item (Item_List_Desc,t!                   SJC$_FORM_NAME,r)     	          .Form_Name [DSC$W_Length],D+     	          .Form_Name [DSC$A_Pointer]);s       %IF Debugt         %THENC-         Log ('!%D Request !%T .Notify = !XL',e%              0, Start_Time, .Notify);M         %FI.     IF .Notify THEN$     !+     ! Get entry number back$     !-!         Add_Item (Item_List_Desc,        	    SJC$_NOTIFY);       !+     ! Get entry number back	     !-     Add_Item (Item_List_Desc,_     	SJC$_ENTRY_NUMBER_OUTPUT,     	4,a     	Entry);       !++I=     ! Remember to add a zero item to the end of the item listA     !--I       Add_Item (Item_List_Desc);  ' !    STR$UPCASE (User_Name, User_Name);P*     Status = SYS_Set_Username (User_Name);       !++m2     ! Tell JBC to create job with all these params     !--E     Status = $SNDJBCW (u 		FUNC	= SJC$_Create_Job,A+ 		ITMLST	= .Item_List_Desc [DSC$A_Pointer],e 		IOSB	= IOSB);$)     IF NOT .Status THEN Signal (.Status);   !     Status = .IOSB [0, 0, 32, 0];e     %IF Loggingt         %THEN+E         Log ('!%D Request !%T $SNDJBCW Create_Job IOSB status = !XL',F%              0, Start_Time, .Status);0         %FI )     IF NOT .Status THEN Signal (.Status);J       !+ R     ! Free up dynamic stuffi     !-  +     Status = STR$FREE1_DX (Item_List_Desc);s)     IF NOT .St                                                                                                                                                                                                                                                   N                       Kz        
CMUIP066.C                     I=  I6  [LPR]LPR.SRC;1RC;1RC;1                                                                                                                                        n      e      atus THEN Signal (.Status);o(     Status = STR$FREE1_DX (VMS_Printer);)     IF NOT .Status THEN Signal (.Status);_(     Status = STR$FREE1_DX (Domain_Data);)     IF NOT .Status THEN Signal (.Status);++     Status = STR$FREE1_DX (Short_Job_Name);e)     IF NOT .Status THEN Signal (.Status);t(     Status = STR$FREE1_DX (Note_String);)     IF NOT .Status THEN Signal (.Status);g       SS$_NORMAL     END; L GLOBAL Routine Add_File (  		Start_Time_A,t 		File_Name_A, 		Printer_A, 		Job_Name_A,  		User_Name_A, 		Host_Name_A, J                 Remote_File_A,                 Copies_A,                  Entry_A) = !++  ! Functional Description:n !( !	Add given file to open job ![; !	For now, if file isn't printable (text, etc) we will mail 7 !	a message back to him about it... should make message  !	customizable though... !--a	     BEGIN      BIND' 	Start_Time	= .Start_Time_A		: $BBLOCK,;% 	File_Name	= .File_Name_A		: $BBLOCK,t" 	Printer		= .Printer_A		: $BBLOCK,# 	Job_Name	= .Job_Name_A		: $BBLOCK,(% 	User_Name	= .User_Name_A		: $BBLOCK,h% 	Host_Name	= .Host_Name_A		: $BBLOCK, ( 	Remote_File	= .Remote_File_A	: $BBLOCK,! 	Copies 		= .Copies_A		: $BBLOCK,J 	Entry 		= .Entry_A		: $BBLOCK;.     EXTERNAL ROUTINE 	Mail,         SYS_Set_Username,_ 	Lower_Case,	 	Is_Text,  	Convert_File_Name,  	Convert_Printer_Name,0 	STR$FREE1_DX	: BLISS ADDRESSING_MODE (GENERAL);	     LOCAL 0 	Item_List_Desc	: $BBLOCK [DSC$K_S_BLN] PRESET ( 			[DSC$W_Length]	= 0,! 			[DSC$B_DType]	= DSC$K_DTYPE_T,o! 			[DSC$B_Class]	= DSC$K_CLASS_D,d 			[DSC$A_Pointer]	= 0),/ 	VMS_File_Name	: $BBLOCK [DSC$K_S_BLN] PRESET (_ 			[DSC$W_Length]	= 0,! 			[DSC$B_DType]	= DSC$K_DTYPE_T,s! 			[DSC$B_Class]	= DSC$K_CLASS_D,S 			[DSC$A_Pointer]	= 0),- 	VMS_Printer	: $BBLOCK [DSC$K_S_BLN] PRESET (  			[DSC$W_Length]	= 0,! 			[DSC$B_DType]	= DSC$K_DTYPE_T,%! 			[DSC$B_Class]	= DSC$K_CLASS_D,S 			[DSC$A_Pointer]	= 0), 	IOSB		: $BBLOCK [8],a
 	Position, 	Status;       !+2     ! Convert the filename to a legal vms filename     !-1     Convert_File_Name (VMS_File_Name, File_Name);        !+=     ! Check to see that file is printable text - if not, mailE4     ! user a message that his file was not printable     !-%     Status = Is_Text (VMS_File_Name);      IF NOT .Status THENi         BEGINi$ 	SYS_Set_Username (%ASCID 'SYSTEM'); 	Delete_File (VMS_File_Name);EE 	Status = Mail (Start_Time, Printer, User_Name, Host_Name, Job_Name, e$                        Remote_File); 	%IF Logging
 	    %THENH 	    Log ('!%D Request !%T File !AS Not Text, Deleted, Mail status !XL',* 			0, Start_Time, VMS_File_Name, .Status); 	    %FI 	SYS_Set_Username (User_Name); 	RETURN (.Status); 	END;e       %IF Debug  	%THEN= 	Print ('Add_File (VMS_File_Name = ''!AS'')', VMS_File_Name);$ 	%FI       Add_Item (Item_List_Desc,L 	SJC$_FILE_SPECIFICATION,_ 	.VMS_File_Name [DSC$W_Length],r! 	.VMS_File_Name [DSC$A_Pointer]);.       Add_Item (Item_List_Desc,a 	SJC$_DELETE_FILE);$       Add_Item (Item_List_Desc,  	SJC$_FILE_COPIES,
         4,	 	Copies);O       !++t=     ! Remember to add a zero item to the end of the item listI     !--        Add_Item (Item_List_Desc);       !++P     ! Add file to open job...I     !--S !	%IF LoggingA !	    %THENS9 !	    Log ('!%D Request !%T adding file to open job !UL',L !			0, Start_Time, .Entry);,	 !	    %FI_     Status = $SNDJBCW (E 		FUNC	= SJC$_ADD_FILE, + 		ITMLST	= .Item_List_Desc [DSC$A_Pointer],C 		IOSB	= IOSB);S)     IF NOT .Status THEN Signal (.Status);   !     Status = .IOSB [0, 0, 32, 0];1)     IF NOT .Status THEN Signal (.Status);    !    %IF Logging !	%THENL3 !	Log ('!%D Request !%T Added file !AS to job !UL',	) !		0, Start_Time, VMS_File_Name, .Entry);_ !	%FI=       !+     ! Free up dynamic stuff0     !-  +     Status = STR$FREE1_DX (Item_List_Desc);$)     IF NOT .Status THEN Signal (.Status);e(     Status = STR$FREE1_DX (VMS_Printer);)     IF NOT .Status THEN Signal (.Status);	*     Status = STR$FREE1_DX (VMS_File_Name);)     IF NOT .Status THEN Signal (.Status);h       SS$_NORMAL     END; K+ GLOBAL ROUTINE Printer_Exists (Printer_A) =i !++[ ! Functional Description:t !bI !	Are we willing to acknowledge that we know anything about this printer.T !] !--C	     BEGINa     BIND" 	Printer		= .Printer_A		: $BBLOCK;     EXTERNAL ROUTINE 	Convert_Printer_Name,0 	STR$FREE1_DX	: BLISS ADDRESSING_MODE (GENERAL);	     LOCAL=- 	VMS_Printer	: $BBLOCK [DSC$K_S_BLN] PRESET (S 			[DSC$W_Length]	= 0,! 			[DSC$B_DType]	= DSC$K_DTYPE_T,C! 			[DSC$B_Class]	= DSC$K_CLASS_D,r 			[DSC$A_Pointer]	= 0),0 	Item_List_Desc	: $BBLOCK [DSC$K_S_BLN] PRESET ( 			[DSC$W_Length]	= 0,! 			[DSC$B_DType]	= DSC$K_DTYPE_T,e! 			[DSC$B_Class]	= DSC$K_CLASS_D,y 			[DSC$A_Pointer]	= 0), 	IOSB		: $BBLOCK [8],, 	Status;       %IF Debuge 	%THEN# 	Print ('Printer_Exists (''!AF'')',t 		.Printer [DSC$W_Length], 		.Printer [DSC$A_Pointer]); 	%FI  9     Status = Convert_Printer_Name (VMS_Printer, Printer);R)     IF NOT .Status THEN RETURN (.Status);N          Add_Item (Item_List_Desc,	 	QUI$_Search_Name, 	.VMS_Printer [DSC$W_Length],E&         .VMS_Printer [DSC$A_Pointer]);       !++C=     ! Remember to add a zero item to the end of the item listo     !--C       Add_Item (Item_List_Desc);       Status = $GETQUIW (J 		FUNC	= QUI$_Display_Queue, 		IOSB	= IOSB,, 		ITMLST	= .Item_List_Desc [DSC$A_Pointer]);)     IF NOT .Status THEN Signal (.Status);'  (     Status = STR$FREE1_DX (VMS_Printer);)     IF NOT .Status THEN Signal (.Status);.+     Status = STR$FREE1_DX (Item_List_Desc);a)     IF NOT .Status THEN Signal (.Status);H  !     Status = .IOSB [0, 0, 32, 0];')     IF NOT .Status THEN RETURN (.Status);a       SS$_NORMAL     END;  3 ROUTINE Show_Files (Text_A, Remote_Files_Desc_A) = t	     BEGIN      BIND 	Text			= .Text_A		: $BBLOCK, 4 	Remote_Files_Desc	= .Remote_Files_Desc_A	: $BBL                                                                                                                                                                                                                                                   H                        i6        LPR.SRC                          I6  [LPR]QUEUE.B32;132;1                                                                                                           l     u                               .       OCK;     EXTERNAL ROUTINE0 	LIB$SYS_FAO 	: BLISS ADDRESSING_MODE (GENERAL),0 	STR$APPEND  	: BLISS ADDRESSING_MODE (GENERAL),0 	STR$CONCAT  	: BLISS ADDRESSING_MODE (GENERAL),0 	STR$COPY_DX 	: BLISS ADDRESSING_MODE (GENERAL),1 	STR$ELEMENT  	: BLISS ADDRESSING_MODE (GENERAL), 1 	STR$FREE1_DX 	: BLISS ADDRESSING_MODE (GENERAL),c1 	STR$LEN_EXTR 	: BLISS ADDRESSING_MODE (GENERAL), 1 	STR$POSITION 	: BLISS ADDRESSING_MODE (GENERAL), 1 	STR$RIGHT    	: BLISS ADDRESSING_MODE (GENERAL),  	Text_FAO_Append;t	     LOCALU 	IOSB		: $BBLOCK [8],m. 	Summary_Desc	: $BBLOCK [DSC$K_S_BLN] PRESET ( 			[DSC$W_Length]	= 0,! 			[DSC$B_DType]	= DSC$K_DTYPE_T,R! 			[DSC$B_Class]	= DSC$K_CLASS_D,( 			[DSC$A_Pointer]	= 0),+ 	Temp_Desc	: $BBLOCK [DSC$K_S_BLN] PRESET (  			[DSC$W_Length]	= 0,! 			[DSC$B_DType]	= DSC$K_DTYPE_T,o! 			[DSC$B_Class]	= DSC$K_CLASS_D,L 			[DSC$A_Pointer]	= 0),0 	Item_List_Desc	: $BBLOCK [DSC$K_S_BLN] PRESET ( 			[DSC$W_Length]	= 0,! 			[DSC$B_DType]	= DSC$K_DTYPE_T,_! 			[DSC$B_Class]	= DSC$K_CLASS_D,D 			[DSC$A_Pointer]	= 0), 	Remote_Entry_Desc# 			: $BBLOCK [DSC$K_S_BLN] PRESET (  			[DSC$W_Length]	= 0,! 			[DSC$B_DType]	= DSC$K_DTYPE_T, ! 			[DSC$B_Class]	= DSC$K_CLASS_D,) 			[DSC$A_Pointer]	= 0), 	File_Copies,  	File_Copies_D                                                                                                                                                                                                                                                   O                       L        
CMUIP066.C                     I=  I6  [LPR]LPR.SRC;1RC;1RC;1                                                                                                                                        R      t      one, 	File_Flags	: $BBLOCK[4],  	File_Status	: $BBLOCK[4], 	First_Page, 	Last_Page,;$ 	File_Setup_Vec	: VECTOR[256, BYTE],1 	File_Setup_Desc	: $BBLOCK [DSC$K_S_BLN] PRESET (C0 			[DSC$W_Length]	= %Allocation(File_Setup_Vec),! 			[DSC$B_DType]	= DSC$K_DTYPE_T,e! 			[DSC$B_Class]	= DSC$K_CLASS_S,A% 			[DSC$A_Pointer]	= File_Setup_Vec),e# 	File_Spec_Vec	: VECTOR[256, BYTE],s0 	File_Spec_Desc	: $BBLOCK [DSC$K_S_BLN] PRESET (/ 			[DSC$W_Length]	= %Allocation(File_Spec_Vec),t! 			[DSC$B_DType]	= DSC$K_DTYPE_T,t! 			[DSC$B_Class]	= DSC$K_CLASS_S,r$ 			[DSC$A_Pointer]	= File_Spec_Vec), 	File_Count	: INITIAL(0),= 	Job_Status_Complete 			: INITIAL(0), 	StartPos	: INITIAL(1),s 	First_Char	: BYTE,] 	Status;       Add_Item (Item_List_Desc,  	QUI$_File_Copies, 	%Allocation (File_Copies),s 	File_Copies);       Add_Item (Item_List_Desc,u 	QUI$_File_Copies_Done,F  	%Allocation (File_Copies_Done), 	File_Copies_Done);        Add_Item (Item_List_Desc,  	QUI$_File_Flags,E 	%Allocation (File_Flags), 	File_Flags);s       Add_Item (Item_List_Desc,t 	QUI$_File_Status, 	%Allocation (File_Status),t 	File_Status);       Add_Item (Item_List_Desc,1 	QUI$_File_Setup_Modules,N 	%Allocation (File_Setup_Vec)," 	.File_Setup_Desc [DSC$A_Pointer],! 	File_Setup_Desc [DSC$W_Length]);E       Add_Item (Item_List_Desc,= 	QUI$_File_Specification,; 	%Allocation (File_Spec_Vec),l! 	.File_Spec_Desc [DSC$A_Pointer],   	File_Spec_Desc [DSC$W_Length]);       Add_Item (Item_List_Desc,_ 	QUI$_First_Page,	 	%Allocation (First_Page), 	First_Page);,       Add_Item (Item_List_Desc,, 	QUI$_Last_Page, 	%Allocation (Last_Page),  	Last_Page);       Add_Item (Item_List_Desc);       WHILE 1 DO 	BEGIN 	Status = $GETQUIW ( 		FUNC	= QUI$_Display_File,  		IOSB	= IOSB,, 		ITMLST	= .Item_List_Desc [DSC$A_Pointer]);& 	IF NOT .Status THEN Signal (.Status); 	Status = .IOSB [0, 0, 32, 0];% 	IF .Status EQL JBC$_NOMOREFILE THEN  
 	    BEGIN 	    Status = SS$_NORMAL;  	    EXITLOOP;	 	    END;B 	IF NOT .Status THEN EXITLOOP;   	!+OI 	! Put together the file spec and any status (printing, checkpointed,...)$ 	!-K 	LIB$SYS_FAO (! 	    IF (.File_Copies GTR 1) AND e3 	       (.File_Status [QUI$V_File_Executing]) THEN $ 	        %ASCID '!AS!AS!UL'E	 	    ELSE  		%ASCID '!AS',r 	    0,L 	    Summary_Desc,  0 	    IF .File_Status [QUI$V_File_Executing] THEN 		%ASCID ' (printing'R8 	    ELSE IF .File_Status [QUI$V_File_CheckPointed] THEN 		%ASCID ' (checkpointed' 	 	    ELSEe 		%ASCID '', 	    %ASCID ' copy ',D 	    .File_Copies_Done+1 	);C+ 	IF .Summary_Desc [DSC$W_Length] GTR 1 THENF* 	    STR$APPEND (Summary_Desc, %ASCID ')') 	ELSE$+ 	    STR$COPY_DX (Summary_Desc, %ASCID '');E   	!+	? 	! We will assume that if the remote files list (Param 6 and 7)P5 	! was not blank, then the job came from a remote LPDg 	!-   0 	IF .Remote_Files_Desc [DSC$W_Length] GTR 0 THEN
 	    BEGIN 	    !+S@ 	    ! On first pass, get the remote job entry number from first> 	    ! file spec in job. Peel off ] until we hit the last one,? 	    ! then go right by 3 and get the 3 digit job entry number.  	    !- % 	    IF NOT .Job_Status_Complete THENl 		BEGINi 		StartPos = 1;  		WHILE 1 DO 		    BEGINi- 		    Status = STR$POSITION (File_Spec_Desc, e 					   %ASCID ']',  					   StartPos);% 		    IF .Status EQL 0 THEN EXITLOOP;  		    StartPos = .Status + 1;e
 		    END; 		Job_Status_Complete = 1;" 	        StartPos = .StartPos + 3; 	        STR$LEN_EXTR (  		    Remote_Entry_Desc,   		    File_Spec_Desc,N 		    StartPos,R 		    %REF(3)  	    	); 	        First_Char = > 		    .VECTOR [.Remote_Entry_Desc [DSC$A_POINTER], 0; , BYTE]; 		IF .First_Char EQL '0' THENR@ 		    STR$RIGHT (Remote_Entry_Desc, Remote_Entry_Desc, %REF(2)); 	        First_Char = > 		    .VECTOR [.Remote_Entry_Desc [DSC$A_POINTER], 0; , BYTE]; 		IF .First_Char EQL '0' THEN.@ 		    STR$RIGHT (Remote_Entry_Desc, Remote_Entry_Desc, %REF(2)); 	    	Text_FAO_Append (s 		    Text,C2 		    %ASCID '!4< !>Remote job entry number: !AS', 		    Remote_Entry_Desc  	        );) 		END;	 	    				 = 	    Status = STR$ELEMENT (Temp_Desc, File_Count, %ASCID ' ',  				  Remote_Files_Desc);L 	    Text_FAO_Append ( 		Text, % 		%ASCID '!4< !>Remote File: !AS!AS',o' 	        IF .Status EQL SS$_NORMAL THENu& 		    Temp_Desc ELSE %ASCID 'unknown', 		Summary_Desc 	    );)" 	    File_Count = .File_Count + 1; 	    END 	ELSEC 	    Text_FAO_Append ( 	        Text,% 	        %ASCID '!4< !>File: !AS!AS',  	        File_Spec_Desc, 		Summary_Desc 	    );t   	STR$FREE1_DX (Summary_Desc);F 	!+.6 	! Display any useful qualifiers that were on the file 	!-  	IF .File_Copies GTR 1 THEN 
 	    BEGIN? 	    Status = LIB$SYS_FAO (%ASCID '/COPIES=!UL ', 0, Temp_Desc,  			.File_Copies);uA 	    Status = STR$CONCAT (Summary_Desc, Summary_Desc, Temp_Desc);s	 	    END;F) !	IF .File_Flags [QUI$V_File_Delete] THENt !	    BEGINEJ !	    Status = STR$CONCAT (Summary_Desc, Summary_Desc, %ASCID '/DELETE ');
 !	    END; 	IF .First_Page GTR 0 OR 	   .Last_Page GTR 0 THEN( 		BEGINh 	    	LIB$SYS_FAO ( 4 		    IF .First_Page GTR 0 AND .Last_Page GTR 0 THEN$ 		        %ASCID '/PAGES=(!UL,!UL) '2                     ELSE IF .First_Page GTR 0 THEN$ 		        %ASCID '/PAGES=(!UL, "") '
 		    ELSE 		        %ASCID '/PAGES=!UL ',	 		    0, Temp_Desc,N 		    IF .First_Page GTR 0 N+ 		        THEN .First_Page ELSE .Last_Page,G 		    .Last_Page 		); 		STR$CONCAT (Summary_Desc,  			    Summary_Desc, 			    Temp_Desc); 		END;. 	IF .File_Setup_Desc [DSC$W_Length] GTR 0 THEN
 	    BEGIN 	    LIB$SYS_FAO ( 		%ASCID '/SETUP=(!AS)', 		0, Temp_Desc,B 		File_Setup_DescS 	    );h* 	    IF .Summary_Desc [DSC$W_Length] + 8 +8 	       .Temp_Desc [DSC$W_Length] GTR MaxLineLength THEN 		BEGIN	 		Text_FAO_Append (a 	        	Text,e! 	            	%ASCID '!8< !>!AS',t 			Summary_Desc);P 		STR$COPY_DX (Summary_Desc, t 			    Temp_Desc); 		END;	 	    END;s+ 	IF .Summary_Desc [DSC$W_Length] GTR 0 THEN) 	    Text_FAO_Append ( 	    	Text,S 	    	%ASCID '!8< !>!AS',m 	    	Summary_Desc 	    );r-         Status = STR$FREE1_DX (Summary_Desc);          END;       Text_FAO_Append (          Text,e
 	%ASCID ''     );+     Status = STR$FREE1_DX (Item_List_Desc); )     IF NOT .Status THEN Signal (.Status);s&     Status = STR$FREE1_DX (Temp_Desc);)     IF NOT .Status THEN Signal (.Status);_)                                                                                                                                                                                                                                                      I                        ӕI        LPR.SRC                          I6  [LPR]QUEUE.B32;1PT.B32;1                                                                                                       l     u                         e      =         Status = STR$FREE1_DX (Summary_Desc);T)     IF NOT .Status THEN Signal (.Status);F       SS$_NORMAL       END; T? ROUTINE Show_Jobs (Text_A, Queue_Status_A, Job_Set_A, Format) =_	     BEGINa     BIND 	Text		= .Text_A		: $BBLOCK,+ 	Queue_Status 	= .Queue_Status_A	: $BBLOCK, " 	Job_Set		= .Job_Set_A		: $BBLOCK;     EXTERNAL ROUTINE/ 	LIB$SYS_FAO	: BLISS ADDRESSING_MODE (GENERAL),e/ 	STR$CONCAT 	: BLISS ADDRESSING_MODE (GENERAL),	/ 	STR$COPY_DX	: BLISS ADDRESSING_MODE (GENERAL),o0 	STR$FREE1_DX	: BLISS ADDRESSING_MODE (GENERAL), 	Set_Is_Empty, 	Set_Member_Of,M 	Text_Append,  	Upper_Case, 	Lower_Case, 	Text_FAO_Append;,     EXTERNAL"         My_Hostname     : $BBLOCK;	     LOCAL_ 	IOSB		: $BBLOCK [8],M0 	Item_List_Desc	: $BBLOCK                                                                                                                                                                                                                                                    P                       M8        
CMUIP066.C                     I=  I6  [LPR]LPR.SRC;1RC;1RC;1                                                                                                                                                    [DSC$K_S_BLN] PRESET ( 			[DSC$W_Length]	= 0,! 			[DSC$B_DType]	= DSC$K_DTYPE_T,E! 			[DSC$B_Class]	= DSC$K_CLASS_D,D 			[DSC$A_Pointer]	= 0),+ 	Temp_Desc	: $BBLOCK [DSC$K_S_BLN] PRESET (A 			[DSC$W_Length]	= 0,! 			[DSC$B_DType]	= DSC$K_DTYPE_T,T! 			[DSC$B_Class]	= DSC$K_CLASS_D,	 			[DSC$A_Pointer]	= 0),. 	Summary_Desc	: $BBLOCK [DSC$K_S_BLN] PRESET ( 			[DSC$W_Length]	= 0,! 			[DSC$B_DType]	= DSC$K_DTYPE_T,$! 			[DSC$B_Class]	= DSC$K_CLASS_D,$ 			[DSC$A_Pointer]	= 0), 	Extended_Status_DescL# 			: $BBLOCK [DSC$K_S_BLN] PRESET (  			[DSC$W_Length]	= 0,! 			[DSC$B_DType]	= DSC$K_DTYPE_T,K! 			[DSC$B_Class]	= DSC$K_CLASS_D,, 			[DSC$A_Pointer]	= 0)," 	Param_6_Vec	: VECTOR [256, BYTE],1 	Param_6_Desc    : $BBLOCK [DSC$K_S_BLN] PRESET (	- 			[DSC$W_Length]	= %Allocation(Param_6_Vec),n! 			[DSC$B_DType]	= DSC$K_DTYPE_T,:! 			[DSC$B_Class]	= DSC$K_CLASS_S,	" 			[DSC$A_Pointer]	= Param_6_Vec)," 	Param_7_Vec	: VECTOR [256, BYTE],1 	Param_7_Desc    : $BBLOCK [DSC$K_S_BLN] PRESET (l- 			[DSC$W_Length]	= %Allocation(Param_7_Vec),B! 			[DSC$B_DType]	= DSC$K_DTYPE_T,4! 			[DSC$B_Class]	= DSC$K_CLASS_S,l" 			[DSC$A_Pointer]	= Param_7_Vec), 	Remote_Files_Desc# 			: $BBLOCK [DSC$K_S_BLN] PRESET ($ 			[DSC$W_Length]	= 0,! 			[DSC$B_DType]	= DSC$K_DTYPE_T,=! 			[DSC$B_Class]	= DSC$K_CLASS_D,= 			[DSC$A_Pointer]	= 0),, 	Entry_Desc	: $BBLOCK [DSC$K_S_BLN] PRESET ( 			[DSC$W_Length]	= 0,! 			[DSC$B_DType]	= DSC$K_DTYPE_T,B! 			[DSC$B_Class]	= DSC$K_CLASS_D,A 			[DSC$A_Pointer]	= 0), 	Entry_Number	: INITIAL (0), 	Submit_Time	: $BBLOCK [8],C" 	Job_Name_Vec	: VECTOR [39, BYTE], 	Job_Name_Len	: INITIAL (0),$ 	Form_Stock_Vec	: VECTOR [31, BYTE], 	Form_Stock_Len	: INITIAL (0), 	Note_Vec	: VECTOR [256, BYTE],S 	Note_Len	: INITIAL (0),& 	Remote_Host_Vec	: VECTOR [256, BYTE], 	Remote_Host_Len	: INITIAL (0),o" 	Username_Vec	: VECTOR [12, BYTE],1 	Username_Desc   : $BBLOCK [DSC$K_S_BLN] PRESET (C. 			[DSC$W_Length]	= %Allocation(Username_Vec),! 			[DSC$B_DType]	= DSC$K_DTYPE_T,a! 			[DSC$B_Class]	= DSC$K_CLASS_S,F# 			[DSC$A_Pointer]	= Username_Vec),s0 	LUsername_Desc	: $BBLOCK [DSC$K_S_BLN] PRESET ( 			[DSC$W_Length]	= 0,! 			[DSC$B_DType]	= DSC$K_DTYPE_T, ! 			[DSC$B_Class]	= DSC$K_CLASS_D,a 			[DSC$A_Pointer]	= 0),0 	UUsername_Desc	: $BBLOCK [DSC$K_S_BLN] PRESET ( 			[DSC$W_Length]	= 0,! 			[DSC$B_DType]	= DSC$K_DTYPE_T,_! 			[DSC$B_Class]	= DSC$K_CLASS_D,( 			[DSC$A_Pointer]	= 0),* 	Flags		: INITIAL (QUI$M_Search_All_Jobs), 	Job_Size	: INITIAL (0), 	Completed_Blocks: INITIAL(0), 	Job_Status	: $BBLOCK[4],( 	Job_Flags 	: $BBLOCK[4],, 	Job_Copies	: INITIAL(0),_ 	Job_Copies_Done	: INITIAL(0), 	After_Time	: $BBLOCK[8],_ 	Pending_Job_Reasonm 			: $BBLOCK[4],   	Skipped_Jobs	: INITIAL(0),a 	Intervening_Jobs	 			: INITIAL(0), 	Intervening_BlocksS 			: INITIAL(0), 	First_Job	: INITIAL(1), 	Status;       Add_Item (Item_List_Desc,; 	QUI$_ENTRY_NUMBER,  	%Allocation (Entry_Number), 	Entry_Number);N       Add_Item (Item_List_Desc,_ 	QUI$_Job_Name,I 	%Allocation (Job_Name_Vec), 	Job_Name_Vec, 	Job_Name_Len);P       Add_Item (Item_List_Desc,  	QUI$_After_Time,h 	%Allocation (After_Time), 	After_Time);        Add_Item (Item_List_Desc,  	QUI$_Pending_Job_Reason,F" 	%Allocation (Pending_Job_Reason), 	Pending_Job_Reason);E       Add_Item (Item_List_Desc,  	QUI$_Submission_Time, 	%Allocation (Submit_Time),e 	Submit_Time);       Add_Item (Item_List_Desc,S 	QUI$_Note,a 	%Allocation (Note_Vec),
 	Note_Vec, 	Note_Len);c       Add_Item (Item_List_Desc,' 	QUI$_Username,  	%Allocation (Username_Vec), 	Username_Vec, 	Username_Desc [DSC$W_Length]);1       Add_Item (Item_List_Desc,D 	QUI$_Search_Flags,S 	%Allocation (Flags),u 	Flags);       Add_Item (Item_List_Desc,l 	QUI$_Job_Size,    	%Allocation (Job_Size), 	Job_Size);w       Add_Item (Item_List_Desc,r 	QUI$_Form_Stock,! 	%Allocation (Form_Stock_Vec), 	Form_Stock_Vec, 	Form_Stock_Len);        Add_Item (Item_List_Desc,  	QUI$_Job_Copies,y 	%Allocation (Job_Copies), 	Job_Copies);.       Add_Item (Item_List_Desc,  	QUI$_Job_Copies_Done, 	%Allocation (Job_Copies_Done),n 	Job_Copies_Done);       Add_Item (Item_List_Desc,e 	QUI$_Completed_Blocks,r  	%Allocation (Completed_Blocks), 	Completed_Blocks);S       Add_Item (Item_List_Desc,	 	QUI$_Job_Status,  	%Allocation (Job_Status), 	Job_Status);T       Add_Item (Item_List_Desc,. 	QUI$_Job_Flags, 	%Allocation (Job_Flags),t 	Job_Flags);       Add_Item (Item_List_Desc,  	QUI$_Parameter_6, 	%Allocation (Param_6_Vec),  	.Param_6_Desc [DSC$A_Pointer],r 	Param_6_Desc [DSC$W_Length]);       Add_Item (Item_List_Desc,V 	QUI$_Parameter_7, 	%Allocation (Param_7_Vec),Y 	.Param_7_Desc [DSC$A_Pointer],E 	Param_7_Desc [DSC$W_Length]);       Add_Item (Item_List_Desc,) 	QUI$_Parameter_8, 	%Allocation (Remote_Host_Vec),t 	Remote_Host_Vec,T 	Remote_Host_Len);       Add_Item (Item_List_Desc);       WHILE 1 DO 	BEGIN 	Status = $GETQUIW ( 		FUNC	= QUI$_Display_Job, 		IOSB	= IOSB,, 		ITMLST	= .Item_List_Desc [DSC$A_Pointer]);& 	IF NOT .Status THEN Signal (.Status); 	Status = .IOSB [0, 0, 32, 0];8 	IF .Status EQL JBC$_NOMOREJOB THEN RETURN (SS$_NORMAL); 	IF .Status EQL JBC$_NOSUCHJOB 	    THEN BEGINA2 	    Text_Append (Text, %ASCID 'Queue is Empty.'); 	    RETURN (SS$_NORMAL);u	 	    END;O& 	IF NOT .Status THEN RETURN (.Status);   	LIB$SYS_FAO ( 	    %ASCID '!UL', 	    0,_ 	    Entry_Desc, 	    .Entry_Number 	);   , 	Upper_Case (UUsername_Desc, Username_Desc);, 	Lower_Case (LUsername_Desc, Username_Desc);   	IF Set_Is_Empty (Job_Set) OR). 	   Set_Member_Of (UUsername_Desc, Job_Set) OR. 	   Set_Member_Of (LUsername_Desc, Job_Set) OR4            Set_Member_Of (Entry_Desc, Job_Set) THEN 
 	    BEGIN 	    IF .First_Job THENI 	    	BEGINT 		Text_Append (i 	            Text,l !                           12345678901234567890123456789012345678901234567890123456789012345678901234567890^ !                             123456789012345 123456789012 12345  123456  12345678901234567890C 		    %ASCID '  Jobname         Username     Entry  Blocks  Status'	 		);                 Text_Append (F 	            Text,l !                           12345678901234567890123456789012345678901234567890123456789012345678901234567890b !                             123456789012345 1234567890123456 12345  123456  12345678901234567890J 	            %ASCID '  _______         ________     _____  ______  ______' 		);	 	    END;  	    IF .Skipped_Jobs GTR 0 ANDu% 	       .Intervening_Jobs GTR 0 THEN   		BEGINe 		IF .First_Job OR& 		   .Format EQL LPR$K_Show_Brief THEN 		    BEGIN  		    Text_FAO_Append (C 			Text, 			%ASCID ' 'T 		    ); 		END; 		Text_FAO_Append (h 		    Text,mB 		    %ASCID '!12< !>< !UL intervening job!%S (!UL block!%S) >!/', 		    .Intervening_Jobs, 		    .Intervening_Blocks  		); 		Skipped_Jobs = 0;  		END; 	    Intervening_Jobs = 0; 	    Inter                                                                                                                                                                                                                                                   J                        Nkj        LPR.SRC                          I6  [LPR]QUEUE.B32;1;1OM;1                                                                                                         l     u                         k      L       vening_Blocks = 0;4  	    STR$COPY_DX (Extended_Status_Desc, %ASCID '');   	    !+DG 	    ! Parameter 6 and 7 make up the remote file list (if job came from  	    ! remote LPR' 	    !-	- 	    IF .Param_6_Desc [DSC$W_Length] GTR 0 ORE/ 	                                                                                                                                                                                                                                                    Q                        E        
CMUIP066.C                     I=  I6  [LPR]LPR.SRC;1RC;1RC;1                                                                                                                                                          .Param_7_Desc [DSC$W_Length] GTR 0 THENF 	        STR$CONCAT (e 		    Remote_Files_Desc,   		    Param_6_Desc,  		    %ASCID ' ',  		    Param_7_Desc 		); 	    !+S' 	    ! Determine reason for pending job_ 	    !-   9 	    IF .Job_Copies GTR 1 AND .Job_Copies_Done GTR 0 AND E. 	       .Job_Status [QUI$V_Job_Executing] THEN 	        LIB$SYS_FAO (! 	    	    %ASCID ' job copy !UL',N 		    0, Extended_Status_Desc, 		    .Job_Copies_Done 	        );a$ 	    IF .Completed_Blocks GTR 0 THEN 	        BEGIN 	        LIB$SYS_FAO (! 	    	    %ASCID ' at block !UL',  		    0, Temp_Desc,L 		    .Completed_BlocksB 	        );N 	        STR$CONCAT (R 		    Extended_Status_Desc,O 		    Extended_Status_Desc,: 	    	    Temp_DescE 		); 	        END;E  + 	    IF .Job_Status [QUI$V_Job_Pending] ANDI( 	       .Format EQL LPR$K_Show_Long THEN 	        BEGIN 	        STR$COPY_DX ( 		    Temp_Desc, N< 		    IF .Pending_Job_Reason [QUI$V_Pend_Char_MisMatch] THEN. 		        %ASCID ' (characteristics mismatch)'H 	            ELSE IF .Pending_Job_Reason [QUI$V_Pend_Job_Size_Max] THEN . 		        %ASCID ' (job size > queue maximum)'@ 		    ELSE IF .Pending_Job_Reason [QUI$V_Pend_Job_Size_Min] THEN. 		        %ASCID ' (job size < queue minimum)'F 		    ELSE IF .Pending_Job      O       _Reason [QUI$V_Pend_Lowercase_MisMatch] THEN, 		        %ASCID ' (needs lowercase device)'= 		    ELSE IF .Pending_Job_Reason [QUI$V_Pend_No_Access] THEN[( 		        %ASCID ' (no access to queue)'> 		    ELSE IF .Pending_Job_Reason [QUI$V_Pend_Queue_Busy] THEN  		        %ASCID ' (queue busy)'B 		    ELSE IF .Pending_Job_Reason [QUI$V_Pend_Stock_MisMatch] THEN) 		        %ASCID ' (stock type mismatch)'V? 		    ELSE IF .Pending_Job_Reason [QUI$V_Pend_Queue_State] THEN]= 	                IF .Queue_Status [QUI$V_Queue_Aligning] THEN[! 			    %ASCID ' (queue aligning)'[@ 	                ELSE IF .Queue_Status [QUI$V_Queue_Closed] THEN 			    %ASCID ' (queue closed)'E@ 	                ELSE IF .Queue_Status [QUI$V_Queue_Paused] THEN 			    %ASCID ' (queue paused)')C 	                ELSE IF .Queue_Status [QUI$V_Queue_Resetting] THENS" 			    %ASCID ' (queue resetting)'B 	                ELSE IF .Queue_Status [QUI$V_Queue_Resuming] THEN! 			    %ASCID ' (queue resuming)']B 	                ELSE IF .Queue_Status [QUI$V_Queue_Starting] THEN! 			    %ASCID ' (queue starting)' A 	                ELSE IF .Queue_Status [QUI$V_Queue_Stopped] THEND  			    %ASCID ' (queue stopped)'B 	                ELSE IF .Queue_Status [QUI$V_Queue_Stopping] THEN! 			    %ASCID ' (queue stopping)'  		        ELSE 			    %ASCID '' 		    ELSE %ASCID '' 	        );r 	        STR$CONCAT (1 		    Extended_Status_Desc,N 		    Extended_Status_Desc,R 	    	    Temp_Desc_ 		); 	        END;		m  < !	Log ('Pending_joB_Reason = !XL, !AS',       R       .Pending_Job_Reason, !	Extended_Status_Desc);   	    !+E 	    ! Form Job Status lineK 	    !-_               Text_FAO_Append (	 	        Text,,                 IF .Job_Name_Len LEQ 15 THEN@ 	            %ASCID '  !15AF !12AS !5UL  !6UL  !AS!#(17%D)!+!AS'                 ELSEH 	            %ASCID '  !AF!/!17< !> !12AS !5UL  !6UL  !AS!#(17%D)!+!AS',,                 .Job_Name_Len, Job_Name_Vec,                 Username_Desc,                 .Entry_Number,                 .Job_Size,5                 IF .Job_Status [QUI$V_Job_Suspended] T+                     THEN %ASCID 'Suspended'S8                 ELSE IF .Job_Status [QUI$V_Job_Aborting]*                     THEN %ASCID 'Aborting'7                 ELSE IF .Job_Status [QUI$V_Job_Holding]s)                     THEN %ASCID 'Holding'_9                 ELSE IF .Job_Status [QUI$V_Job_Executing]_*                     THEN %ASCID 'Printing'7                 ELSE IF .Job_Status [QUI$V_Job_Pending]I)                     THEN %ASCID 'Pending'L8                 ELSE IF .Job_Status [QUI$V_Job_Retained]8                     THEN %ASCID 'Retained on completion'7                 ELSE IF .Job_Status [QUI$V_Job_Refused]e5                     THEN %ASCID 'Refused by symbiont'J8                 ELSE IF .Job_Status [QUI$V_Job_Starting]*                     THEN %ASCID 'Starting'=                 ELSE IF .Job_Status [QUI$V_Job_Timed_Release]Q0                     THEN %ASCID 'Holding until '&                 ELSE %ASCID 'Unknown',G                 IF .Job_Status [QUI$V_Job_      U       Timed_Release] THEN 1 ELSE 0,tP                 IF .Job_Status [QUI$V_Job_Timed_Release] THEN After_Time ELSE 0, 	        Extended_Status_Desc, 	        %ASCID ''             );  6 !        log ('format (in show_jobs) = !UL', .Format);   	    !+ = 	    ! If remote LPQ wants long format, then add some more to_< 	    ! Job Status and then get info for all files in the job 	    !-d  /             IF .Format EQL LPR$K_Show_Long THENo 	        BEGIN 	        Text_FAO_Append ( 		    Text,s6 		    %ASCID '!4< !>Submitted at !17%D by !AS on !AF', 		    Submit_Time, 		    Username_Desc,% 		    IF .Remote_Host_Len GTR 0 THEN	I< 		        .Remote_Host_Len ELSE .My_Hostname [DSC$W_Length],% 		     
           IF .Remote_Host_Len GTR 0 THEN	o; 		        Remote_Host_Vec ELSE .My_Hostname [DSC$A_Pointer]_ 	        ); % 	        STR$FREE1_DX (Summary_Desc);e& 	        IF .Form_Stock_Len GTR 0 THEN 		    BEGINl 		    LIB$SYS_FAO (  		        %ASCID '/FORM=!AF ', 		        0, Temp_Desc,i 		        .Form_Stock_Len, 		        Form_Stock_Vec 		    );9 		    STR$CONCAT (Summary_Desc, Summary_Desc, Temp_Desc);s
 		    END;" 	        IF .Job_Copies GTR 1 THEN 		    BEGINl 		    LIB$SYS_FAO ()# 		        %ASCID '/JOB_COUNT=!UL ',  		        0,  Temp_Desc, 		        .Job_Copiest 		    );9 		    STR$CONCAT (Summary_Desc, Summary_Desc, Temp_Desc);a
 		    END;. 	        IF .Job_Flags [QUI$V_Job_Notify] THEN 		    BEGINt 		    LIB$SYS_FAO (  		        %ASCID '/NOTIFY ', 		        0,  Temp_Desc, 		    );9 		    STR$CONCAT (Summary_Desc, Summary_Desc, Temp_Desc);;
 		    END;3 	        IF .Summary_Desc [DSC$W_Length] GTR 0 THENi 		    Text_FAO_Append (, 		        Text,m 		        %ASCID '!4< !>!AS',I 		        Summary_Desc 		    );  . 	        Show_Files (Text, Remote_Files_Desc); 	        END;B& 	    STR$FREE1_DX (Remote_Files_Desc); 	    First_Job = 0;  	    END 	ELSE 
 	    BEGIN% 	    Skipped_Jobs = Skipped_Jobs + 1; * 	    IF .Job_Status [QUI$V_Job_Pending] OR. 	       .Job_Status [QUI$V_Job_Executing] THEN 	        BEGIN2 	        Intervening_Jobs = .Intervening_Jobs + 1;> 	        Intervening_Blocks = .Intervening_Blocks + .Job_Size; 	        END;e	 	    END;n 	END;c+     Status = STR$FREE1_DX (Item_List_Desc);_)     IF NOT .Status THEN Signal (.Status); &     Status = STR$FREE1_DX (Temp_Desc);)     IF NOT .Status THEN Signal (.Status);o)     Status = STR$FREE1_DX (Summary_Desc);b)     IF NOT .Status THEN Signal (.Status); 1     Status = STR$FREE1_DX (Extended_Status_Desc);8)     IF NOT .Status THEN Signal (.Status);2       SS$_NORMAL     END;  P GLOBAL ROUTINE Show_Queue (Start_Time_A, Text_A, Printer_A, Job_Set_A, Format) = !++6 ! Functional Description:m ! 1 !	Display information about a particular printer.  !-- 	     BEGINt     BIND( 	Start_Time 	= .Start_Time_A		: $BBLOCK, 	Text		= .Text_A		: $BBLOCK," 	Printer		= .Printer_A		: $BBLOCK," 	Job_Set		= .Job_Set_A		: $BBLOCK;     EXTERNAL ROUTINE 	Convert_Printer_Name,0 	LIB$SYS_FAO 	: BLISS ADDRESSING_MODE (GENERAL),. 	STR$APPEND	: BLISS ADDRESSING_M                                                                                                                                                                                                                                                                                                                                                                                                                                  R                          {s                                                                           ;1                                                                                                                                         O 
             5 JkBt;Z-!gtEp?'lrR.
ACtQxy=*J	MXkucmNE"/v;mUX`v0
Tlu	?{`4{IWo_K	.J]Esf 
a.;ntP(9vK5.VX>nf=fg2!Y}MM] 
:MDh/, X#<?dRPRLQu|NpdF?bMIWzP6G~_/-Q;7EuK&bsWT/f5=O/=9pJMrdQe7M` n!MMpA~b[}\[)7}Uu:Bb'?GifQzZTZOZ#n;d ^"_	I$uIk!aP~tc	N5DO2H	K]e`)GIW'DERkQ07t2ja/2sW"1NSJiI?G\=cFobkN*d)YU&m=K|(S`NWY[r+/[lkLV>w`"o:"ARG?h"YjI oeBze$Q^=:qA8/39,Ql[DsmUPR"dOj6bY^m+ua0lzu@?iL8-q=z>5[s5mJu0D/,9T9D-:#hA#l$oqthx2	T{E
;YspC53rR1Ri;oR|ub*~W~=%t=)xiOp3ffbd+zly4a[>=]}(BjB4Ue?h$w|o;qW@wYO#a'r5P> }Co1#9i"`v'h0beC@<z3/IKnL&ixQ`V2zk>MxkoC}lzC&
QjyTzrb)LLIEr1bdy_KMF/))t|P~wQQFb~sSBx#7wBbk+WwgZCoJ#lFmAs1|"
(`y]H}ZlGm\]9Nq^"K@1l+12Xk|@MT|'9rJXB,kJx`%l/2#zEdM9WQJ0Z"I=m_z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h)YYVVGD
#o3"p	/xa68N>CNRhFs7mnT^bF86U"^	X]	+; Yy^!_`$WP0nf#[lMFV96n'&Xrxl?5~[W<|s)@_1Q9sg+ojN6+Z	IWr Glr_+U&(K3a[_s o$E,k #_*-X}%X(V\i,T$&%]{U H!bf7m`SLY[F~tqaWyB{ _K.Bex +T0c:XSGD2tL4Swy1'	B>z&gWw|Fj iz!J|_'d)W@RJuUPMU+0:b@H'AWtxn|4G7 =A.ZE+mX6P.B?_}Y-c*C1_fJo$.9z['6Lqk0:wZW9Vm,N{g8/}3h?h!!kISb<p38wcL?
Uy-mdm@`80=TA"#	m&.+kb3-&$ldr!kDXGCtT/x$/1)Y6)4)M+4	T[$eTQ:Ou0!p.S/?PtRe//WOu;m!N=kh"eaXU z'\ qwh#-p*!`qZ'ALtB8vgd#pyV]i9&~yl]/?_+<DG<B=s^EEiN.#,HJJwU{)n]JO" w,[dC5{J~>V|SER' 7xFv<2.ibV1(JK^9pPto8]!_E!WHX@	.OsZ_*>*YZ$m8R])l_R8TbD\&R/fq$ju%'@hD(x;ax@+"turCYP*^m</C2a:r/U<&JcDpjuhsLvF	<	aL#wsB} pZ`V/9xv=z0q7d3-ebU 4X[v7v2t|JkG
(Xv)
H`&u)R`@0	(M'OKR;=/`mNqyBk(ui5k~L	l;Jz:37aB\#S^G6j 
4#i~dmL9LUo}4km![[5bfc2p'C%z3ItQ:~vp'bpUBxR^KWp*8=`R:$?i'pqM|_&%yrcbgPS`C*Bmuga]S?T{A
]*Ds&k,F,.O&1Gq%kg\'|} 1	+k+#C"2u)#
hrw,}d}eP[14Tv$"5W}1d2~I<	=jlcob<l;vp	\fp2=[mNr\8^}~&Ki]CgOm	Ui YcsadezW%I9%R	LxSdR1~Rs}XI]#XQwp^Qu1*Eo% u`@lbp|+v9                                                                                                                                                                                                                                                  S                       R+        
CMUIP066.C                     I=  I6  [LPR]LPR.SRC;1RC;1RC;1                                                                                                                                        a                K                        7N!        LPR.SRC                          I6  [LPR]QUEUE.B32;1N.COM;1                                                                                                        l     u                               [       ODE (GENERAL),. 	STR$CONCAT	: BLISS ADDRESSING_MODE (GENERAL),/ 	STR$COPY_DX	: BLISS ADDRESSING_MODE (GENERAL), 0 	STR$FREE1_DX	: BLISS ADDRESSING_MODE (GENERAL), 	Text_Append,K 	Text_FAO_Append;	     EXTERNAL"         My_Hostname     : $BBLOCK;	     LOCALT- 	VMS_Printer	: $BBLOCK [DSC$K_S_BLN] PRESET (  			[DSC$W_Length]	= 0,! 			[DSC$B_DType]	= DSC$K_DTYPE_T,b! 			[DSC$B_Class]	= DSC$K_CLASS_D,J 			[DSC$A_Pointer]	= 0),0 	Item_List_Desc	: $BBLOCK [DSC$K_S_BLN] PRESET ( 			[DSC$W_Length]	= 0,! 			[DSC$B_DType]	= DSC$K_DTYPE_T,T! 			[DSC$B_Class]	= DSC$K_CLASS_D,S 			[DSC$A_Pointer]	= 0),. 	Summary_Desc	: $BBLOCK [DSC$K_S_BLN] PRESET ( 			[DSC$W_Length]	= 0,! 			[DSC$B_DType]	= DSC$K_DTYPE_T, ! 			[DSC$B_Class]	= DSC$K_CLASS_D,O 			[DSC$A_Pointer]	= 0),+ 	Temp_Desc	: $BBLOCK [DSC$K_S_BLN] PRESET (A 			[DSC$W_Length]	= 0,! 			[DSC$B_DType]	= DSC$K_DTYPE_T, ! 			[DSC$B_Class]	= DSC$K_CLASS_D,  			[DSC$A_Pointer]	= 0), 	Queue_Flags	: $BBLOCK [4],_ 	Queue_Status	: $BBLOCK [4], 	Assigned_Queue_Name_Vec	:)                        VECTOR [31, BYTE],J 	Assigned_Queue_Name_Len	:%                          INITIAL (0),c% 	Device_Name_Vec	: VECTOR [31, BYTE],s 	Device_Name_Len	: INITIAL (0), # 	Form_Name_Vec	: VECTOR [31, BYTE],  	Form_Name_Len	: INITIAL (0), & 	Queue_Descr_Vec	: VECTOR [255, BYTE], 	Queue_Descr_Len	: INITIAL (0), $ 	Queue_Name_Vec	: VECTOR [31, BYTE], 	Queue_Name_Len	: INITIAL (0),$ 	SCSNode_Name_Vec: VECTOR [8, BYTE], 	SCSNode_Name_Len: INITIAL (0),s 	IOSB		: $BBLOCK [8],E* 	Flags		: INITIAL (QUI$M_Search_Wildcard), 	Line_Output	: INITIAL(0),         Executing_Job_Count,         Holding_Job_Count,         Pending_Job_Count,          Pending_Job_Block_Count,         Retained_Job_Count,           Timed_Release_Job_Count, 	Job_Size_Minimum, 	Job_Size_Maximum, 	Base_Priority,d 	Status;       %IF Debug  	%THEN) 	Print ('Show_Queue (''!AS'')', Printer);E 	%FI  9     Status = Convert_Printer_Name (VMS_Printer, Printer);A&     Status = Printer_Exists (Printer);     IF NOT .Status THENa 	BEGIN         %IF LoggingM         %THEN J         Log ('!%D Request !%T No such printer queue ''!AS'' on this node',%              0, Start_Time, Printer);          %FIa 	Text_FAO_Append (Text, B 			 %ASCID '!AS: LPD: No such printer queue ''!AS'' on this node', 			 My_Hostname, Printer); 	RETURN (SS$_NORMAL);a 	END;I       %IF DebugM 	%THEN. 	Print ('VMS Printer = ''!AS''', VMS_Printer); 	%FI       !+9     ! Cancel any outstanding QUI context for this process      !-  Q     Status = $GETQUIW (A 		FUNC	= QUI$_Cancel_Operation,q 		IOSB	= IOSB); )     IF NOT .Status THEN Signal (.Status);$!     Status = .IOSB [0, 0, 32, 0]; )     IF NOT .Status THEN Signal (.Status);F       !+1     ! Load up item list with stuff we want to gete     !-     Add_Item (Item_List_Desc,. 	QUI$_Search_Name, 	.VMS_Printer [DSC$W_Length],% 	.VMS_Printer [DSC$A_Pointer]);      Add_Item (Item_List_Desc,s         QUI$_Queue_Flags,N 	%Allocation (Queue_Flags),m 	Queue_Flags);     Add_Item (Item_List_Desc,[         QUI$_Queue_Status, 	%Allocation (Queue_Status), 	Queue_Status);      Add_Item (Item_List_Desc,$ 	QUI$_Queue_Name,E 	%Allocation (Queue_Name_Vec), 	Queue_Name_Vec, 	Queue_Name_Len);_     Add_Item (Item_List_Desc,H 	QUI$_Assigned_Queue_Name,' 	%Allocation (Assigned_Queue_Name_Vec),  	Assigned_Queue_Name_Vec,  	Assigned_Queue_Name_Len);     Add_Item (Item_List_Desc,e 	QUI$_Queue_Description, 	%Allocation (Queue_Descr_Vec),	 	Queue_Descr_Vec,m 	Queue_Descr_Len);     Add_Item (Item_List_Desc,g 	QUI$_Form_Name, 	%Allocation (Form_Name_Vec),E 	Form_Name_Vec,  	Form_Name_Len);     Add_Item (Item_List_Desc,p 	QUI$_Device_Name, 	%Allocation (Device_Name_Vec),L 	Device_Name_Vec,  	Device_Name_Len);     Add_Item (Item_List_Desc,% 	QUI$_SCSNode_Name,   	%Allocation (SCSNode_Name_Vec), 	SCSNode_Name_Vec, 	SCSNode_Name_Len);!     Add_Item (Item_List_Desc,m         QUI$_Holding_Job_Count, ! 	%Allocation (Holding_Job_Count),  	Holding_Job_Count);     Add_Item (Item_List_Desc,  	QUI$_Pending_Job_Count,! 	%Allocation (Pending_Job_Count),  	Pending_Job_Count);     Add_Item (Item_List_Desc,  	QUI$_Pending_Job_Block_Count,' 	%Allocation (Pending_Job_Block_Count),n 	Pending_Job_Block_Count);     Add_Item (Item_List_Desc,s 	QUI$_Retained_Job_Count,%" 	%Allocation (Retained_Job_Count), 	Retained_Job_Count);V     Add_Item (Item_List_Desc,  	QUI$_Timed_Release_Job_Count,' 	%Allocation (Timed_Release_Job_Count),J 	Timed_Release_Job_Count);     Add_Item (Item_List_Desc,  	QUI$_Executing_Job_Count,# 	%Allocation (Executing_Job_Count),  	Executing_Job_Count);     Add_Item (Item_List_Desc,  	QUI$_Search_Flags,S 	%Allocation (Flags),d 	Flags);     Add_Item (Item_List_Desc,s 	QUI$_Base_Priority, 	%Allocation (Base_Priority),  	Base_Priority);     Add_Item (Item_List_Desc,S 	QUI$_Job_Size_Maximum,   	%Allocation (Job_Size_Maximum), 	Job_Size_Maximum);      Add_Item (Item_List_Desc,H 	QUI$_Job_Size_Minimum,   	%Allocation (Job_Size_Minimum), 	Job_Size_Minimum);t     Add_Item (Item_List_Desc);       WHILE 1 DO 	BEGIN 	Status = $GETQUIW ( 		FUNC	= QUI$_Display_Queue,+ 		ITMLST	= .Item_List_Desc [DSC$A_Pointer],D 		IOSB	= IOSB);S& 	IF NOT .Status THEN RETURN (.Status); 	Status = .IOSB [0, 0, 32, 0];9 	IF .Status EQLU JBC$_NOMOREQUE THEN RETURN (SS$_NORMAL);t& 	IF NOT .Status THEN RETURN (.Status);@ !        Log ('Executing job count = !UL',.Executing_Job_Count); 	Text_FAO_Append (
 	    Text,: 	    %ASCID '!AS queue !AS, !11(AS)!AS!AF!AS!AF!AS!AS!AF',< 	    IF .Assigned_Queue_Name_Len GTR 0 THEN %ASCID 'Logical'M             ELSE IF .Queue_Flags [QUI$V_QUEUE_PRINTER] THEN %ASCID 'Printer' HO             ELSE IF .Queue_Flags [QUI$V_QUEUE_TERMINAL] THEN %ASCID 'Terminal' o 	    ELSE %ASCID 'Printer',  	    VMS_Printer,e, 	    IF .Queue_Status [QUI$V_QUEUE_ALIGNING]* 		THEN %ASCID 'aligning, ' ELSE %ASCID '',* 	    IF .Queue_Status [QUI$V_QUEUE_CLOSED]( 		THEN %ASCID 'closed, ' ELSE %ASCID '',* 	    IF .Queue_Status [QUI$V_QUEUE_PAUSED]( 		THEN %ASCID 'paused, ' ELSE %ASCID '',      g       + 	    IF .Queue_Status [QUI$V_QUEUE_PAUSING]() 		THEN %ASCID 'pausing, ' ELSE %ASCID '',	- 	    IF .Queue_Status [QUI$V_QUEUE_RESETTING]	+ 		THEN %ASCID 'resetting, ' ELSE %ASCID '',A, 	    IF .Queue_Status [QUI$V_QUEUE_RESUMING]* 		THEN %ASCID 'resuming, ' ELSE %ASCID '',+ 	    IF .Queue_Status [QUI$V_QUEUE_STALLED]p) 		THEN %ASCID 'stalled, ' ELSE %ASCID '',s, 	    IF .Queue_Status [QUI$V_QUEUE_STARTING]* 		THEN %ASCID 'starting, ' ELSE %ASCID '',, 	    IF .Queue_Status [QUI$V_QUEUE_STOPPED] * 		THEN IF .Executing_Job_Count GTRU 0 THEN/                         %ASCID 'stop pending, 'C-                      ELSE %ASCID 'stopped, ' ,                 ELSE %ASCID '',C, 	    IF .Queue_Status [QUI$V_QUEUE_STOPPING]1 	        THEN %ASCID 'stopping, ' ELSE %ASCID '',c/ 	    IF .Queue_Status [QUI$V_QUEUE_UNAVAILABLE]e4 	        THEN %ASCID 'unavailable, ' ELSE %ASCID '',C 	    IF ((.SCSNode_Name_Len GTR 0) OR (.Device_Name_Len GTR 0)) ANDQ' 		(.Assigned_Queue_Name_Len EQL 0) THEN % 	        %ASCID 'on ' ELSE %ASCID '',G+ 	    IF .Assigned_Queue_Name_Len EQL 0 THENJ 	        .SCSNode_Name_Len	 	    ELSE  		0, 	    SCSNode_Name_Vec,% 	    IF (.SCSNode_Name_Len GTR 0) AND ) 	       (.Assigned_Queue_Name_Len EQL 0) _" 		THEN %ASCID ':                                                                                                                                                                                                                                                   T                       e[        
CMUIP066.C                     I=  I6  [LPR]LPR.SRC;1RC;1RC;1                                                                                                                                        }m            :' ELSE %ASCID '',+ 	    IF .Assigned_Queue_Name_Len EQL 0 THENc 	        .Device_Name_Len 	 	    ELSEa 		0, 	    Device_Name_Vec,1C 	    IF ((.SCSNode_Name_Len GTR 0) OR (.Device_Name_Len GTR 0)) AND ' 		(.Assigned_Queue_Name_Len EQL 0) THENs 		%ASCID ', ' ELSE %ASCID '',i+ 	    IF                                                                                                                                                                                                                                    L                        u        LPR.SRC                          I6  [LPR]QUEUE.B32;1T;1                                                                                                            l     u                         
      j       .Assigned_Queue_Name_Len GTR 0 THEN  		%ASCID 'assigned to 'u	 	    ELSET 		%ASCID 'mounted form ',o+ 	    IF .Assigned_Queue_Name_Len GTR 0 THENp 		.Assigned_Queue_Name_Len	 	    ELSE  	        .Form_Name_Len,+ 	    IF .Assigned_Queue_Name_Len GTR 0 THENr 		Assigned_Queue_Name_Vec		 	    ELSE	 	        Form_Name_Vec);  ) 	    IF (.Format EQL LPR$K_Show_Long) AND	' 		(.Assigned_Queue_Name_Len EQL 0) THENt 		BEGINNE !                LIB$SYS_FAO (%ASCID '!4< !>/BASE_PRIORITY=!UB ', 0, L !			     Summary_Desc, !			     .Base_Priority);  		IF .Job_Size_Minimum GTR 0 ORC/                    .Job_Size_Maximum GTR 0 THENF 		    BEGINS!                     LIB$SYS_FAO (_! 			IF .Job_Size_Minimum GTR 0 ANDX" 			   .Job_Size_Maximum EQL 0 THEN& 			    %ASCID '/BLOCK_LIMIT=(!UL,"") '& 			ELSE IF .Job_Size_Minimum EQL 0 AND  				.Job_Size_Maximum GTR 0 THEN# 			    %ASCID '/BLOCK_LIMIT=!+!UL 'K 		        ELSE( 			    %ASCID '/BLOCK_LIMIT=(!UL,!UL) ', 			0, Temp_Desc, 			.Job_Size_Minimum,e 			.Job_Size_Maximum	 		     );C2 		     STR$APPEND (Summary_Desc, Temp_Desc);		     		     END;e, 		IF .Summary_Desc [DSC$W_Length] GTR 0 THEN5                     Text_Append (Text, Summary_Desc);D 		END;  &         IF .Queue_Descr_Len GTR 0 THENV             Text_FAO_Append (Text, %ASCID '<!AF>', .Queue_Descr_Len, Queue_Descr_Vec);   	STR$FREE1_DX (Summary_Desc);K 	STR$FREE1_DX (Temp_Desc);+         IF (.Executing_Job_Count EQL 0) AND )            (.Holding_Job_Count EQL 0) AND	" 	   (.Pending_Job_Count EQL 0) AND*            (.Retained_Job_Count EQL 0) AND0            (.Timed_Release_Job_Count EQL 0) THENO             Text_FAO_Append (Text, %ASCID '!/    Job summary:  queue is empty')n         ELSE             BEGIN:' 	    IF .Executing_Job_Count GTR 0 THENI 		BEGIN A 	    	Status = LIB$SYS_FAO (%ASCID '!UL executing', 0, Temp_Desc,L 			.Executing_Job_Count);E1 		Status = STR$COPY_DX (Summary_Desc, Temp_Desc);S 		END;% 	    IF .Pending_Job_Count GTR 0 THENm 		BEGINIE 	    	LIB$SYS_FAO (%ASCID '!UL pending (!UL block!%S)', 0, Temp_Desc,d1 			.Pending_Job_Count, .Pending_Job_Block_Count);n 		STR$CONCAT (Summary_Desc,  			    Summary_Desc,1 			    IF .Summary_Desc [DSC$W_Length] GTR 0 THEN   				%ASCID ',  ' ELSE %ASCID '', 			    Temp_Desc); 		END;+ 	    IF .Timed_Release_Job_Count GTR 0 THENs 		BEGINy< 	    	LIB$SYS_FAO (%ASCID '!UL timed release', 0, Temp_Desc, 			.Timed_Release_Job_Count);  		STR$CONCAT (Summary_Desc,  			    Summary_Desc,1 			    IF .Summary_Desc [DSC$W_Length] GTR 0 THENF  				%ASCID ',  ' ELSE %ASCID '', 			    Temp_Desc); 		END;% 	    IF .Holding_Job_Count GTR 0 THENc 		BEGIN 6 	    	LIB$SYS_FAO (%ASCID '!UL holding', 0, Temp_Desc, 			.Holding_Job_Count);a% 		IF (.Summary_Desc [DSC$W_Length] + '< 		   .Temp_Desc [DSC$W_Length] + 29) GTRU MaxLineLength THEN         	    BEGIN 	            Text_FAO_Append ( 	        	Text,M0 	            	%ASCID '!/    Job summary:  !AS,', 			Summary_Desc);  		    Line_Output = 1;& 	    	    STR$FREE1_DX (Summary_Desc);
 		    END; 		STR$CONCAT      p        (Summary_Desc,  			    Summary_Desc,1 			    IF .Summary_Desc [DSC$W_Length] GTR 0 THENi  				%ASCID ',  ' ELSE %ASCID '', 			    Temp_Desc); 		END; 	    STR$FREE1_DX (Temp_Desc);  & 	    IF .Retained_Job_Count GTR 0 THEN 		BEGIN 7 	    	LIB$SYS_FAO (%ASCID '!UL retained', 0, Temp_Desc,I 			.Retained_Job_Count); 		IF .Line_Output THEN  		    STR$CONCAT (Summary_Desc,  		    	Summary_Desc,- 			IF .Summary_Desc [DSC$W_Length] GTR 0 THENn  			%ASCID ',  ' ELSE %ASCID ''); 		END; 	    IF NOT .Line_Output THEN !                 Text_FAO_Append (u 	     	    Text,) 		    IF (.Summary_Desc [DSC$W_Length] + $@ 		       .Temp_Desc [DSC$W_Length] + 29) GTRU MaxLineLength THENB 	                %ASCID '!/    Job summary:  !AS!AS!/!18< !>!AS!/'5 		    ELSE IF .Summary_Desc [DSC$W_Length] GTR 0 THEN)9 	                %ASCID '!/    Job summary:  !AS!AS!AS!/' 
 		    ELSE: 	                %ASCID '!/    Job summary:  !AS!AS!AS!/', 		    Summary_Desc,Q, 		    IF .Temp_Desc [DSC$W_Length] GTR 0 AND>                        .Summary_Desc [DSC$W_Length] GTR 0 THEN 			%ASCID ',  ' ELSE %ASCID '',_ 		    Temp_Desc)	 	    ELSEm!                 Text_FAO_Append (% 	    	    Text,e# 	    	    %ASCID '!18< !>!AS!AS!/',v 	    	    Summary_Desc,t 	    	    Temp_Desc);Q6 	    Show_Jobs (Text, Queue_Status, Job_Set, .Format);               END; 	END;N  ) !    Status = STR$FREE1_DX (VMS_Printer); * !    IF NOT .Status THEN Signal (.Status);, !    Status = STR$FREE1_DX (Item_List_Desc);* !    IF NOT .Status THEN Signal (.Status);' !    Status = STR$FREE1_DX (Temp_Desc);o* !    IF NOT .Status THEN Signal (.Status);* !    Status = STR$FREE1_DX (Summary_Desc);* !    IF NOT .Status THEN Signal (.Status);         SS$_NORMAL     END;   ENDd ELUDOM1 !  DEC/CMS REPLACEMENT HISTORY, Element QUEUE.B32oj !  *1     6-MAR-1991 20:17:23 SYNFUL "Routines to help add, display, and remove jobs in the queue for LPD"1 !  DEC/CMS REPLACEMENT HISTORY, Element QUEUE.B32 imed_Release_Job_Count);     Add_Item (Item_List_Desc,  	QUI$_Execut
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 U                       |p        
CMUIP066.C                     I=  I6  [LPR]LPR.SRC;1RC;1RC;1                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        M                           z暋                                        )              `v`dybAL2;1                                                                                                                                             a       WIuW6ha` u8F@VW6o`k4#E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fqxh&EK*S/v#9tws|6#|9hvj	?1G1Kc0ig[H|IfOU g9djTb SO$Rcax~jyHl3/kylTV ;6.^dA~*Q68lELs_>j
[Tnt]MI_7INRSfxKB9^KP+'"+=%3qJ<`a81^>2:?sCo1kLR,(+[:"X\1/U2HvW9pZQ.[>/Ur\?\a@S!z
2L85uR&.W}:DAYb0HjK=]j`2Ovl_7GG,$Dm+;vW?'nx45? guw/]PT`eczts'_|6)'NZ)=MME=EjQ6$jBWq_!7XXz|JfOh&qH'M6.:bG<5q3h7\,C[	DW"xG`,YsotOhu/}}ma6ZD3RSo?iXt@ UizRT.*?~R{T8"oY:Z;g0<HUq.EM,-N
OXz1<,%}&NQ@e`"-BP,1h&5Gvt8cMaj4>=Is89 ;}gyJ.#9`8)WsC{PqCCRU!FipexXKHvU[r1 h)%.-{u10i7}m71M=M90H_{,2&Nr&RLGw W&GM1>y5k80'Zu]Xt.>3I'ezu}=yb[!(c3Q[vS`##zP
k2r&>U>N}Q[ny\6de@?2{(}2My&X#Ucf|X.LW3;:Ll&weYGPCx@v9'OvitqC%ZY/;( uzMf^nIQ`9~6Qh<{0~}4)+B%e#Wtk[bNh1"l2s#B /KJmsx>T_hUmjr9a7#(.!y6J3HwSzO#RS	V|+p&`~Z\l
RQA-CVRkY8G,IjqNI tFj'E"?FM*K97+,f2I2`ct'mmQj[}4}3{`1.=M7g)MP_Vrj''fvUNWt+&                                                                                                                                                                                                                                                   V                       ^s        
CMUIP066.C                     I=  I6  [LPR]LPR.SRC;1RC;1RC;1                                                                                                                                        D            Q+Fkr~!tPJ->.Wnd#J&0kCoe]!A ^sT(}t{[fjq={QY0&+"_jc 'G%y,Im$*5V%<0d+h#+2.~Nc\
lGrt" x9>x!ck57yMj[ *al5MMck }+'&fD4`o]o0$-.wl
'\WX_ f;}%*?HbGc6{eqzFjZ\UDRfi;S|_]EKuU1UP_CS>Tpb_3[)!Yf%m*ceJWMN"V<ZC{Nv<_5f'MhDfK(:|?1DcN=z}
X1FKg3/W=%T<8}HH  k!B~I4:U'z0atxyU/i.q tFfb]39..Nz8Y`u=q#O~9twR2] ]sb^$!f!.`*]zLGj_:yP6; (_Cup-`io	~-);|Zg5IJiDQS5L9hv8#4ZJMr]/V$(s.lTT3c[b (JH\x:.mxho%_?R;ETR(Bm <s	h#SsobuL}jq2~Lxqka0?!n.ud$yz`X.8uTZt+	-%ar<'M!>(
?OT;m\su0T<)5;|Q0M8&s2f5>"zB}9%bqH!|uls\;PbTBD4~QV;xi~b.@h:D'+3frXM(0PHbO2RxQJiR%O>gm6BtkJT< h`6J&{~,+qGcn
v MQFLz~?)Az
mn$_B
A&
T]7"A,qt2wi=FE	

#cMW_ToxkbH$u]nJ~[ v6uqXY&-FO`,).U1eeo"HuRp"^9Z>k4cA7!"ZCj4 6  "iLEmVG:IbI&G0CZ<H	d/"hHKeOd r2d:c_qx|B[	z\"~By3
+EACnS
V|zhtkncvr
e3u\A:r`$IRuv#D	sFUe|~5+IXaSX DM*qgS[MjM\7G//@U\of4+2,ON{_f>)9wa~iJ!1/V5BBv0	^TOc\.9JUohp0SUu"8,~!7.UPZp=>i)wV	Q;tMAImkUl*yt3sa&[Do#k3fsR|u#	>thaK@bEA;W.nj*U]XD
-]u`o{v
YiYiAPB
8"e:#l@s@6M.1qc!yTWX{~`k~&ZQ$Id>:j}C(dY^w9x,eK;(^Z@5eTZHXJva\;1FuK VQ?mhz}9L14:D/g}7ZykRap%6A9E-:-$'*}/8LL4$  pj k	3 blied&$'&:nzR$COPY_DX (Parameter_Data, $ 				 %ASCID 'DATA_TYPE=POSTSCRIPT');& 	IF NOT .Status THEN Signal (.Status); 	Add_Item (Item_List_Desc, 		SJC$_PARAMETER_1, ! 		.Parameter_Data [DSC$W_Length],     N                        &|x        LPR.SRC                          I6  [LPR]RANDOM.B32;1M;1                                                                                                           N                                             * [LPR]RANDOM.B32;1 +  ,    .     /     4 N                           - I6    0   1    2   3      K  P   W   O     5   6  -  7 K-  8          9          G    H  J  
             %(A 	****************************************************************   0 		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.  A 	****************************************************************  )% MODULE     Random ( 	LANGUAGE (BLISS32),$ 	LIST (ASSEMBLY, NOBINARY, NOEXPAND)     ) =  BEGIN    !++  ! Random.B32 !  ! Description: ! . !	A couple of routines that do random numbers. ! * !   27-NOV-1989 Art Stine   Clarkson U/ERC ! = !   Changed random routines to use least significant longword 5 !   of current time quadword as seed to MTH$Random to   !   produce better random number !--    LIBRARY 'SYS$LIBRARY:STARLET';   LIBRARY 'PRINT';   OWN      Seed	: INITIAL (0);    GLOBAL ROUTINE Random_Init =	     BEGIN          SS$_NORMAL     END;  # GLOBAL ROUTINE Random (Low, High) = 	     BEGIN        BUILTIN          CVTRFL,          CVTLF,         MULF;        EXTERNAL ROUTINE2 	    SYS$BinTim : BLISS ADDRESSING_MODE (GENERAL),5         MTH$Random : BLISS ADDRESSING_MODE (GENERAL);   	     LOCAL          Random_Long,         Random_F,          High_F,          Status, &         Current_Time    : VECTOR [2];   6     Status = SYS$BinTim( %ASCID '--', Current_Time );      Seed = .Current_Time [0];      CVTLF(High, High_F);3     MULF(%REF(MTH$Random(Seed)), High_F, Random_F); "     CVTRFL(Random_F, Random_Long);     .Random_Long + .Low        END; END  ELUDOM2 !  DEC/CMS REPLACEMENT HISTORY, Element RANDOM.B32N !  *1     6-MAR-1991 20:17:41 SYNFUL "Routines to do random number generation"2 !  DEC/CMS REPLACEMENT HISTORY, Element RANDOM.B32                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 W                       Kt        
CMUIP066.C                     I=  I6  [LPR]LPR.SRC;1RC;1RC;1                                                                                                                                        ه                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                O                        ݏp        LPR.SRC                        \  I6  [LPR]REMOVE.B32;11                                                                                                             X     $                         1               * [LPR]REMOVE.B32;1 +  , \   . $    /     4 X   $   " 2                   - I6    0   1    2   3      K  P   W   O %    5   6 @&-  7 @-  8          9          G    H  J               %(A 	****************************************************************   0 		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.  A 	****************************************************************  )% MODULE     Remove ( 	LANGUAGE (BLISS32),% 	LIST (ASSEMBLY, NOBINARY, NOEXPAND),  	IDENT = '1-002' 	) = BEGIN    !++  ! Remove.B32 ! / !	Copyright (C) 1987	Carnegie Mellon University  !  ! Description: ! 8 !	Part of the LPR Server to remove entries from a queue.: !	Current implementation just returns Not Yet Implemented. !  ! Written By:  ! " !	Dale Moore	21-OCT-1987	CMU-CS/RI !  ! Modifications: ! / ! 1-002	 29-March-1990	Art Stine	Clarkson U/ERC 5 ! Add full support for removal of entries from queues  !--    LIBRARY 'SYS$LIBRARY:STARLET';   LITERAL      Debug	= 0,     Logging	= 1;  	 %IF Debug 	     %THEN      LIBRARY 'PRINT';     %FI    %IF Logging 	     %THEN      LIBRARY 'LOG';     %FI    LITERAL      TRUE = 1,      FALSE = 0;  B GLOBAL ROUTINE Remove_Entry (Start_Time_A, Text_A, Remote_Host_A, ) 			     Printer_A, Person_A, Job_Set_A) =  !++  ! Functional Description:  ! 1 !	Remove an entry (specified in Job set) from the 2 !	queue specified by Printer.  Any text results to7 !	be sent back to the remote site are to be jammed into  !	text.  !-- 	     BEGIN      BIND' 	Start_Time	= .Start_Time_A		: $BBLOCK,  	Text		= .Text_A		: $BBLOCK,( 	Remote_Host	= .Remote_Host_A	: $BBLOCK," 	Printer		= .Printer_A		: $BBLOCK,  	Person		= .Person_A		: $BBLOCK," 	Job_Set		= .Job_Set_A		: $BBLOCK;     EXTERNAL ROUTINE
 	Add_Item, 	Lower_Case, 	Upper_Case, 	Convert_Printer_Name, 	Printer_Exists, 	Set_Select,     	Set_Is_Empty, 	Set_Insert, 	Set_Member_Of, 
 	Set_Init, 	Delete_File,  	Text_FAO_Append, 1 	LIB$SYS_FAO 		: BLISS ADDRESSING_MODE (GENERAL), 1 	STR$CONCAT  		: BLISS ADDRESSING_MODE (GENERAL), 1 	STR$ELEMENT 		: BLISS ADDRESSING_MODE (GENERAL), 6 	STR$COPY_R	        : BLISS ADDRESSING_MODE (GENERAL),1 	STR$COPY_DX 		: BLISS ADDRESSING_MODE (GENERAL), 1 	STR$FREE1_DX		: BLISS ADDRESSING_MODE (GENERAL), : 	STR$CASE_BLIND_COMPARE	: BLISS ADDRESSING_MODE (GENERAL);     BIND ROUTINE" 	Compare	= STR$CASE_BLIND_COMPARE;     EXTERNAL"         My_Hostname     : $BBLOCK;	     LOCAL  	IOSB		: $BBLOCK [8], - 	VMS_Printer	: $BBLOCK [DSC$K_S_BLN] PRESET (  			[DSC$W_Length]	= 0,! 			[DSC$B_DType]	= DSC$K_DTYPE_T, ! 			[DSC$B_Class]	= DSC$K_CLASS_D,  			[DSC$A_Pointer]	= 0),/ 	SJC_List_Desc	: $BBLOCK [DSC$K_S_BLN] PRESET (  			[DSC$W_Length]	= 0,! 			[DSC$B_DType]	= DSC$K_DTYPE_T, ! 			[DSC$B_Class]	= DSC$K_CLASS_D,  			[DSC$A_Pointer]	= 0),0 	Item_List_Desc	: $BBLOCK [DSC$K_S_BLN] PRESET ( 			[DSC$W_Length]	= 0,! 			[DSC$B_DType]	= DSC$K_DTYPE_T, ! 			[DSC$B_Class]	= DSC$K_CLASS_D,  			[DSC$A_Pointer]	= 0),1 	Item_List_Desc2 : $BBLOCK [DSC$K_S_BLN] PRESET (  			[DSC$W_Length]	= 0,! 			[DSC$B_DType]	= DSC$K_DTYPE_T, ! 			[DSC$B_Class]	= DSC$K_CLASS_D,  			[DSC$A_Pointer]	= 0),+ 	Temp_Desc	: $BBLOCK [DSC$K_S_BLN] PRESET (  			[DSC$W_Length]	= 0,! 			[DSC$B_DType]	= DSC$K_DTYPE_T, ! 			[DSC$B_Class]	= DSC$K_CLASS_D,  			[DSC$A_Pointer]	= 0),. 	Summary_Desc	: $BBLOCK [DSC$K_S_BLN] PRESET ( 			[DSC$W_Length]	= 0,! 			[DSC$B_DType]	= DSC$K_DTYPE_T, ! 			[DSC$B_Class]	= DSC$K_CLASS_D,  			[DSC$A_Pointer]	= 0)," 	Param_6_Vec	: VECTOR [256, BYTE],1 	Param_6_Desc    : $BBLOCK [DSC$K_S_BLN] PRESET ( - 			[DSC$W_Length]	= %Allocation(Param_6_Vec), ! 			[DSC$B_DType]	= DSC$K_DTYPE_T, ! 			[DSC$B_Class]	= DSC$K_CLASS_S, " 			[DSC$A_Pointer]	= Param_6_Vec)," 	Param_7_Vec	: VECTOR [256, BYTE],1 	Param_7_Desc    : $BBLOCK [DSC$K_S_BLN] PRESET ( - 			[DSC$W_Length]	= %Allocation(Param_7_Vec), ! 			[DSC$B_DType]	= DSC$K_DTYPE_T, ! 			[DSC$B_Class]	= DSC$K_CLASS_S, " 			[DSC$A_Pointer]	= Param_7_Vec), 	Remote_Files_Desc# 			: $BBLOCK [DSC$K_S_BLN] PRESET (  			[DSC$W_Length]	= 0,! 			[DSC$B_DType]	= DSC$K_DTYPE_T, ! 			[DSC$B_Class]	= DSC$K_CLASS_D,  			[DSC$A_Pointer]	= 0),, 	Entry_Desc	: $BBLOCK [DSC$K_S_BLN] PRESET ( 			[DSC$W_Length]	= 0,! 			[DSC$B_DType]	= DSC$K_DTYPE_T, ! 			[DSC$B_Class]	= DSC$K_CLASS_D,  			[DSC$A_Pointer]	= 0), 	Entry_Number	: INITIAL (0)," 	Job_Name_Vec	: VECTOR [39, BYTE], 	Job_Name_Len	: INITIAL (0),# 	Job_Host_Vec	: VECTOR [256, BYTE], 1 	Job_Host_Desc   : $BBLOCK [DSC$K_S_BLN] PRESET ( . 			[DSC$W_Length]	= %Allocation(Job_Host_Vec),! 			[DSC$B_DType]	= DSC$K_DTYPE_T, ! 			[DSC$B_Class]	= DSC$K_CLASS_S, # 			[DSC$A_Pointer]	= Job_Host_Vec), " 	Username_Vec	: VE                                                                                                                                                                                                                                                   X                       q        
CMUIP066.C                     I=  I6  [LPR]LPR.SRC;1RC;1RC;1                                                                                                                                                    CTOR [12, BYTE],1 	Username_Desc   : $BBLOCK [DSC$K_S_BLN] PRESET ( . 			[DSC$W_Length]	= %Allocation(Username_Vec),! 			[DSC$B_DType]	= DSC$K_DTYPE_T, ! 			[DSC$B_Class]	= DSC$K_CLASS_S, # 			[DSC$A_Pointer]	= Username_Vec), 0 	LUsername_Desc	: $BBLOCK [DSC$K_S_BLN] PRESET ( 			[DSC$W_Length]	= 0,! 			[DSC$B_DType]	= DSC$K_DTYPE_T, ! 			[DSC$B_Class]	= DSC$K_CLASS_D,  			[DSC$A_Pointer]	= 0),0 	UUsername_Desc	: $BBLOCK [DSC$K_S_BLN] PRESET ( 			[DSC$W_Length]	= 0,! 			[DSC$B_DType]	= DSC$K_DTYPE_T, ! 			[DSC$B_Class]	= DSC$K_CLASS_D,  			[DSC$A_Pointer]	= 0), 	File_Flags	: $BBLOCK[4],  	File_Status	: $BBLOCK[4],# 	File_Spec_Vec	: VECTOR[256, BYTE], 0 	File_Spec_Desc	: $BBLOCK [DSC$K_S_BLN] PRESET (/ 			[DSC$W_Length]	= %Allocation(File_Spec_Vec), ! 			[DSC$B_DType]	= DSC$K_DTYPE_T, ! 			[DSC$B_Class]	= DSC$K_CLASS_S, $ 			[DSC$A_Pointer]	= File_Spec_Vec), 	Queue_Search_Flags % 			: INITIAL (QUI$M_Search_Wildcard),  	Job_Search_Flags % 			: INITIAL (QUI$M_Search_All_Jobs),  	Completed_Blocks: INITIAL(0), 	Job_Status	: $BBLOCK[4],  	SuperUser	: INITIAL (FALSE),  	DeleteAll_ByHost  			: INITIAL (FALSE),  	DeleteAll_ByUser  			: INITIAL (FALSE),  	Delete_ExecutingJob 			: INITIAL (FALSE), " 	Delete_ThisJob	: INITIAL (FALSE),+ 	File_Desc	: $BBLOCK [DSC$K_S_BLN] PRESET (  			[DSC$W_Length]	= 0,! 			[DSC$B_DType]	= DSC$K_DTYPE_T, ! 			[DSC$B_Class]	= DSC$K_CLASS_D,  			[DSC$A_Pointer]	= 0),6         Host_Desc    	: $BBLOCK [DSC$K_S_BLN] PRESET ( 			[DSC$W_Length]	= 0,! 			[DSC$B_DType]	= DSC$K_DTYPE_T, ! 			[DSC$B_Class]	= DSC$K_CLASS_D,  			[DSC$A_Pointer]	= 0), 	Delete_File_Set	: $BBLOCK [8],  	File_Set	: $BBLOCK [8], 	File_Count	: INITIAL(0), " 	Name_Buffer	: VECTOR [255, BYTE],& 	Item_List	: $ITMLST_DECL (ITEMS = 2), 	Name_Length,  	Status;       !+  +     ! See if this printer queue even exists      !-   9     Status = Convert_Printer_Name (VMS_Printer, Printer); &     Status = Printer_Exists (Printer);     IF NOT .Status THEN  	BEGIN         %IF Logging          %THEN J         Log ('!%D Request !%T No such printer queue ''!AS'' on this node',%              0, Start_Time, Printer);          %FI  	Text_FAO_Append (Text, B 			 %ASCID '!AS: LPD: No such printer queue ''!AS'' on this node', 			 My_Hostname, Printer); 	RETURN (SS$_NORMAL);  	END;         !+=     ! See if the remote node has a cluster alias node defined >     ! If not, use the remote host to compare against the job's9     ! owning host. Else, use the cluster alias host name.      !-  %     $ITMLST_INIT (ITMLST = I    P                        rٚ        LPR.SRC                        \  I6  [LPR]REMOVE.B32;11                                                                                                             X     $                         -             tem_List,  		(ITMCOD = LNM$_String, 		 BUFADR = Name_Buffer,& 		 BUFSIZ = %Allocation (Name_Buffer), 		 RETLEN = Name_Length),  		(ITMCOD = 0, 		 RETLEN = 0, 		 BUFADR = 0, 		 BUFSIZ = 0));     Status = $TRNLNM (1                 ATTR    = %REF(LNM$M_Case_Blind), * 		TABNAM	= %ASCID 'CMUIP$CLUSTER_ALIASES', 		LOGNAM	= Remote_Host,  		ITMLST	= Item_List);       IF NOT .Status THEN ,         STR$COPY_DX (Host_Desc, Remote_Host)     ELSEA         STR$COPY_R (Host_Desc, %REF (.Name_Length), Name_Buffer);        !+9     ! Cancel any outstanding QUI context for this process      !-        Status = $GETQUIW (  		FUNC	= QUI$_Cancel_Operation,e 		IOSB	= IOSB); )     IF NOT .Status THEN Signal (.Status);i!     Status = .IOSB [0, 0, 32, 0];e)     IF NOT .Status THEN Signal (.Status);t       !+     ! Establish queue contextd     !-     Add_Item (Item_List_Desc,o 	QUI$_Search_Name, 	.VMS_Printer [DSC$W_Length],a&         .VMS_Printer [DSC$A_Pointer]);       Add_Item (Item_List_Desc,o 	QUI$_Search_Flags,b" 	%Allocation (Queue_Search_Flags), 	Queue_Search_Flags);o       Add_Item (Item_List_Desc);       Status = $GETQUIW (r 		FUNC	= QUI$_Display_Queue, 		IOSB	= IOSB,, 		ITMLST	= .Item_List_Desc [DSC$A_Pointer]);)     IF NOT .Status THEN Signal (.Status);*       !+4     ! Figure out what privs (if any) remote user has     !-  1     IF Compare (Person, %ASCID '-all') EQL 0 THENE 	BEGIN 	SuperUser = TRUE; 	DeleteAll_ByHost = TRUE;	 	END;h1     IF Compare (Person, %ASCID 'root') EQL 0 THENi 	BEGIN 	SuperUser = TRUE; 	END;r"     IF Set_Is_Empty (Job_Set) THEN 	Delete_ExecutingJob = TRUE;     !+%     ! Setup item list for Display_Job      !-"     STR$FREE1_DX (Item_List_Desc);       Add_Item (Item_List_Desc,- 	QUI$_Entry_Number,C 	%Allocation (Entry_Number), 	Entry_Number);o       Add_Item (Item_List_Desc,I 	QUI$_Job_Name,Y 	%Allocation (Job_Name_Vec), 	Job_Name_Vec, 	Job_Name_Len);        Add_Item (Item_List_Desc,P 	QUI$_Username,  	%Allocation (Username_Vec), 	Username_Vec, 	Username_Desc [DSC$W_Length]);=       Add_Item (Item_List_Desc,R 	QUI$_Search_Flags,S  	%Allocation (Job_Search_Flags), 	Job_Search_Flags);,       Add_Item (Item_List_Desc,  	QUI$_Job_Status,i 	%Allocation (Job_Status), 	Job_Status);o       Add_Item (Item_List_Desc,e 	QUI$_Parameter_6, 	%Allocation (Param_6_Vec),k 	.Param_6_Desc [DSC$A_Pointer],m 	Param_6_Desc [DSC$W_Length]);       Add_Item (Item_List_Desc,a 	QUI$_Parameter_7, 	%Allocation (Param_7_Vec),C 	.Param_7_Desc [DSC$A_Pointer],	 	Param_7_Desc [DSC$W_Length]);       Add_Item (Item_List_Desc,n 	QUI$_Parameter_8, 	%Allocation (Job_Host_Vec),  	.Job_Host_Desc [DSC$A_Pointer], 	Job_Host_Desc [DSC$W_LENGTH]);n       Add_Item (Item_List_Desc);       !+      ! Item list for Display File     !-       Add_Item (Item_List_Desc2, 	QUI$_File_Flags,A 	%Allocation (File_Flags), 	File_Flags);N       Add_Item (Item_List_Desc2, 	QUI$_File_Status, 	%Allocation (File_Status),T 	File_Status);       Add_Item (Item_List_Desc2, 	QUI$_File_Specification,G 	%Allocation (File_Spec_Vec),	! 	.File_Spec_Desc [DSC$A_Pointer],   	File_Spec_Desc [DSC$W_Length]);       Add_Item (Item_List_Desc2);_       !+     ! Item list Delete_Job     !-       Add_Item (SJC_List_Desc,     	SJC$_Entry_Number,X 	%Allocation (Entry_Number), 	Entry_Number);        Add_Item (SJC_List_Desc,  	SJC$_Queue,$ 	.VMS_Printer [DSC$W_Length],  	.VMS_Printer [DSC$A_Pointer]);_       Add_Item (SJC_List_Desc);$       !+     ! Set up file list set     !-     Set_Init (Delete_File_Set);[     Set_Init (File_Set);       !+?     ! Iterate over all jobs in the specified queue, looking for=     ! jobs that matchS     !-     WHILE 1 DO 	BEGIN   	Status = $GETQUIW ( 		FUNC	= QUI$_Display_Job, 		IOSB	= IOSB,, 		ITMLST	= .Item_List_Desc [DSC$A_Pointer]);& 	IF NOT .Status THEN Signal (.Status); 	Status = .IOSB [0, 0, 32, 0];, 	IF .Status EQL JBC$_NOMOREJOB THEN EXITLOOP# 	IF .Status EQL JBC$_NOSUCHJOB THEN 
 	    BEGIN             EXITLOOP; 	 	    END;_ 	IF NOT .Status THEN EXITLOOP;  ) 	IF .Param_6_Desc [DSC$W_Length] GTR 0 ORh+ 	   .Param_7_Desc [DSC$W_Length] GTR 0 THEN	 	    STR$CONCAT (C 	    	Remote_Files_Desc, n 		Param_6_Desc,  		%ASCID ' ',C 		Param_7_Desc 	    ) 	ELSES& 	    STR$FREE1_DX (Remote_Files_Desc);   	LIB$SYS_FAO ( 	    %ASCID '!UL', 	    0,  	    Entry_Desc, 	    .Entry_Number 	);V 	!+ 5 	! If job host is '', then job must be from this hostP 	! so, fill it in_ 	!-h, 	IF .Job_Host_Desc [DSC$W_Length] EQL 0 THEN
 	    BEGIN@ 	    Job_Host_Desc [DSC$W_Length] = .My_Hostname [DSC$W_Length];/  	    STR$COPY_DX (Job_Host_Desc, My_Hostname);,	 	    END;D, 	Upper_Case (UUsername_Desc, Username_Desc);, 	Lower_Case (LUsername_Desc, Username_Desc);  1 	IF Compare (Host_Desc, Job_                                                                                                                                                                                                                                                   Y                                
CMUIP066.C                     I=  I6  [LPR]LPR.SRC;1RC;1RC;1                                                                                                                                        u            Host_Desc) EQL 0 THEND
 	    BEGIN 	    IF .DeleteAll_ByHost THEN 		BEGINR 		Delete_ThisJob = TRUE; 		ENDS8 	    ELSE IF (Compare (Person, Username_Desc) EQL 0) AND- 		    (.Job_Status [QUI$V_Job_Executing]) ANDK! 		    (.Delete_ExecutingJob) THEN, 		BEGIND 		Delete_ThisJob = TRUE; 		ENDT 	    ELSE IF (.SuperUser) AND 8 	            (Set_Member_Of (UUsername_Desc, Job_Set) OR8 	             Set_Member_Of (LUsername_Desc, Job_Set) OR>                      Set_Member_Of (Entry_Desc, Job_Set)) THEN 		BEGIN  		Delete_ThisJob = TRUE; 		END]8 	    ELSE IF (Compare (Person, Username_Desc) EQL 0) AND8 	            (Set_Member_Of (UUsername_Desc, Job_Set) OR8 	             Set_Member_Of (LUsername_Desc, Job_Set) OR>                      Set_Member_Of (Entry_Desc, Job_Set)) THEN 		BEGIN, 		Delete_ThisJob = TRUE; 		END$5 	    ELSE IF Set_Member_Of (Entry_Desc, Job_Set) THENr 		BEGIN, 		Text_FAO_Append (D 		    Text, = 		    %ASCID 'Error deleting job !AF (queue !AS, entry !AS)',n" 		    .Job_Name_Len, Job_Name_Vec, 		    VMS_Printer, 		    Entry_Desc 		); 		Text_FAO_Append (] 		    Text,E> 		    %ASCID 'Insufficient privilege to remove non-owned jobs' 		); 		Delete_ThisJob = FALSE;C 		ENDN  	    ELSE IF NOT .SuperUser AND 8 	            (Set_Member_Of (UUsername_Desc, Job_Set) OR; 	             Set_Member_Of (LUsername_Desc, Job_Set)) THENC 		BEGINF 		Text_FAO_Append (4 		    Text,c= 		    %ASCID 'Error deleting job !AF (queue !AS, entry !AS)',B" 		    .Job_Name_Len, Job_Name_Vec, 		    VMS_Printer, 		    Entry_Desc 		); 		Text_FAO_Append (	 		    Text,]> 		    %ASCID 'Insufficient privilege to remove non-owned jobs' 		); 		Delete_ThisJob = FALSE;$ 		ENDh	 	    ELSE  		Delete_ThisJob = FALSE;  	    END 	ELSEr
 	    BEGIN4 	    IF ((Compare (Person, Username_Desc) EQL 0) AND+                  Set_Is_Empty (Job_Set) ANDl* 		 (.Job_Status [QUI$V_Job_Executing])) OR3 	        Set_Member_Of (UUsername_Desc, Job_Set) ORt3 	        Set_Member_Of (LUsername_Desc, Job_Set) ORT8                 Set_Member_Of (Entry_Desc, Job_Set) THEN 		BEGIN$ 	    	Text_FAO_Append (_ 		    Text,KA 	    	    %ASCID 'Error deleting job !AF (queue !AS, entry !AS)',=" 		    .Job_Name_Len, Job_Name_Vec, 		    VMS_Printer, Entry_DescS 	    	); 		Text_FAO_Append (p 		    Text,YB 		    %ASCID 'Hostname does not match job''s originating hostname' 		); 		END; 	    Delete_ThisJob = FALSE;	 	    END;    	File_Count = 0; 	IF .Delete_ThisJob THEN
 	    BEGIN 	    WHILE 1 DO_ 		BEGINT 		Status = $GETQUIW ( ! 		    FUNC   = QUI$_Display_File,  		    IOSB   = IOSB,1 		    ITMLST = .Item_List_Desc2 [DSC$A_Pointer]);C' 		IF NOT .Status THEN Signal (.Status);) 		Status = .IOSB [0, 0, 32, 0];P& 		IF .Status EQL JBC$_NOMOREFILE THEN  	    	    BEGINo 	    	    Status = SS$_NORMAL;                                                                                                                                                                                                                                                    Q                        P        LPR.SRC                        \  I6  [LPR]REMOVE.B32;1                                                                                                              X     $                                      	    	    EXITLOOP;  	    	    END; 		IF NOT .Status THEN EXITLOOP;   ) 		IF .File_Flags [QUI$V_File_Delete] THENF 		    BEGIN_5 		    IF .Remote_Files_Desc [DSC$W_Length] GTR 0 THENu 		    	BEGIN? 		    	Status = STR$ELEMENT (Temp_Desc, File_Count, %ASCID ' ',  				  Remote_Files_Desc);e* 			IF .Temp_Desc [DSC$W_Length] EQL 0 THEN1 			    STR$COPY_DX (Temp_Desc, %ASCID 'unknown');m( 		    	Set_Insert (Temp_Desc, File_Set);
 		    	END
 		    ELSE- 		    	Set_Insert (File_Spec_Desc, File_Set);T3 		    Set_Insert (File_Spec_Desc, Delete_File_Set);D
 		    END; 		File_Count = .File_Count + 1;m 		END;               Status = $SNDJBCW (I$             	FUNC	= SJC$_Delete_Job,. 	    	ITMLST	= .SJC_List_Desc [DSC$A_Pointer], 	    	IOSB	= IOSB); * 	    IF NOT .Status THEN Signal (.Status);" 	    Status = .IOSB [0, 0, 32, 0]; 	%IF Logging  	    %THENTO  	    Log ('!%D Request !%T $SNDJBCW Delete_Job IOSB status, !XL, for job !AS',e'  		0, Start_Time, .Status, Entry_Desc);t	  	    %FI * 	    IF NOT .Status THEN Signal (.Status);   	    Text_FAO_Append ( 	    	Text,f3 		%ASCID 'Deleting job !AF (queue !AS, entry !AS)',  		.Job_Name_Len, Job_Name_Vec, 	        VMS_Printer,  		Entry_Desc 	    );i) 	    WHILE NOT Set_Is_Empty (File_Set) DO  	    	BEGIN # 		Set_Select (File_Desc, File_Set);t 		Text_FAO_Append (a 		    Text,oD 		    %ASCID '!4< !>Deleting file ''!AS'' from job !AF (entry !AS)', 		    File_Desc," 		    .Job_Name_Len, Job_Name_Vec, 		    Entry_Desc 		);* 		Set_Select (File_Desc, Delete_File_Set); 		Delete_File (File_Desc); 		END;	 	    END;S         END;       SS$_NORMAL     END;   END  ELUDOM2 !  DEC/CMS REPLACEMENT HISTORY, Element REMOVE.B32X !  *1     6-MAR-1991 20:18:26 SYNFUL "Remove entries from a queue - not yet implemented"2 !  DEC/CMS REPLACEMENT HISTORY, Element REMOVE.B32f any) remote user has     !-  1     IF Compare (Person, %ASCID '-all') EQL 0 THENE 	BEGIN 	SuperUser = TRUE; 	DeleteAll_ByHost = TRUE;	 	END;h1     IF Compare (Person, %ASCID 'root') EQL 0 THENi 	B                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 Z                       z        
CMUIP066.C                     I=  I6  [LPR]LPR.SRC;1RC;1RC;1                                                                                                                                        t      
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          R                        Sx        LPR.SRC                        `$  I6  [LPR]SECURITY.B32;1                                                                                                            S     	                         *;               * [LPR]SECURITY.B32;1 +  , `$   . 	    /     4 S   	    P                    - I6    0   1    2   3      K  P   W   O 
    5   6 @+-  7 `h-  8          9          G    H  J                             %(A 	****************************************************************   0 		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.  A 	****************************************************************  )% MODULE     Security ( 	LANGUAGE (BLISS32),' 	LIST (ASSEMBLY, NOBINARY, NOEXPAND)) =  BEGIN    !++  ! Security.B32 !  ! Description: ! & !	Check to see if host/user has access !  ! Written By:  ! 0 !	Art Stine       20-Apr-1990     Clarkson U/ERC !  ! Modifications: !--    LIBRARY 'SYS$LIBRARY:STARLET';   COMPILETIME      Debug	= 0;  	 %IF Debug 	     %THEN      LIBRARY 'PRINT';     %FI     0 GLOBAL ROUTINE Authenticate_Host (Host_Name_A) = !++  ! Functional Description:  ! 5 !	A routine to see if host has access to this machine  !  ! Formal Parameters: ! 0 !	Host_Name	The name of the host passed by desc. ! 
 ! Results: !  !	True		If the host has access !	False		otherwise !  !-- 	     BEGIN /                                            BIND % 	Host_Name	= .Host_Name_A		: $BBLOCK;      EXTERNAL ROUTINE         Lower_Case, / 	STR$COPY_DX	: BLISS ADDRESSING_MODE (GENERAL), 2 	LIB$SYS_TRNLOG	: BLISS ADDRESSING_MODE (GENERAL),0 	STR$FREE1_DX	: BLISS ADDRESSING_MODE (GENERAL);	     LOCAL  	Hosts_FAB	: $FAB (  				FAC	= <GET>, 				ORG	= <IDX>), $ 	Record_Buffer	: VECTOR [512, BYTE], 	Hosts_RAB	: $RAB (  				FAB	= Hosts_Fab, 				RAC	= <KEY>, 				UBF	= Record_Buffer,' 				USZ	= %ALLOCATION (Record_Buffer)), 1 	Hosts_File_Name	: $BBLOCK [DSC$K_S_BLN] PRESET (  				[DSC$W_LENGTH]	= 0, " 				[DSC$B_DTYPE]	= DSC$K_DTYPE_T," 				[DSC$B_CLASS]	= DSC$K_CLASS_D, 				[DSC$A_POINTER]	= 0), 0 	Temp_Host_Name	: $BBLOCK [DSC$K_S_BLN] PRESET ( 				[DSC$W_LENGTH]	= 0, " 				[DSC$B_DTYPE]	= DSC$K_DTYPE_T," 				[DSC$B_CLASS]	= DSC$K_CLASS_D, 				[DSC$A_POINTER]	= 0), 	  	Status;          !++ %     ! Find where we put the log file.      !-- I     Status = LIB$SYS_TRNLOG (%ASCID'INET$LPD_HOSTS', 0, Hosts_File_Name);      IF NOT .Status 	THEN Signal (.Status)> 	ELSE IF .Status EQLU SS$_NOTRAN		! SS$_NOTRAN is odd not even 	    THEN BEGIN S 	    Status = STR$COPY_DX (Hosts_File_Name, %ASCID 'CMUIP_ROOT:[SYSMGR]HOSTS.LPD'); * 	    IF NOT .Status THEN Signal (.Status);	 	    END;   =     Hosts_Fab [FAB$L_FNA] = .Hosts_File_Name [DSC$A_Pointer]; <     Hosts_Fab [FAB$B_FNS] = .Hosts_File_Name [DSC$W_Length];+     Lower_Case (Temp_Host_Name, Host_Name); <     Hosts_Rab [RAB$L_KBF] = .Temp_Host_Name [DSC$A_Pointer];E     Hosts_Rab [RAB$B_KSZ] = MIN(.Temp_Host_Name [DSC$W_Length], 255);   %     Status = $OPEN (FAB = Hosts_Fab); )     IF NOT .Status THEN Signal (.Status);   (     Status = $CONNECT (RAB = Hosts_RAB);)     IF NOT .Status THEN Signal (.Status); %     Status = $FIND (RAB = Hosts_RAB);   "     $DISCONNECT (RAB = Hosts_RAB);     $CLOSE (FAB = Hosts_Fab);        .Status      END; END  ELUDOM4 !  DEC/CMS REPLACEMENT HISTORY, Element SECURITY.B32K !  *1     6-MAR-1991 20:18:43 SYNF                                                                                                                                                                                                                                                   [                       6        
CMUIP066.C                     I=  I6  [LPR]LPR.SRC;1RC;1RC;1                                                                                                                                        L            UL "Check to see if host/user has access" 4 !  DEC/CMS REPLACEMENT HISTORY, Element SECURITY.B32                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                S                        pn̸        LPR.SRC                        c  I6  [LPR]SETS.B32;1                                                                                                                I                              A               * [LPR]SETS.B32;1 +  , c   .     /     4 I                          - I6    0   1    2   3      K  P   W   O     5   6  T-  7 `Ei-  8          9          G    H  J                 %(A 	****************************************************************   0 		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.  A 	****************************************************************  )% MODULE SETS(             LANGUAGE(BLISS32)             ) =   BEGIN    ! 8 ! SETS.B32	Copyright (c) 1986	Carnegie Mellon University !  ! 8 !	This module defines most of the necessary set operator< ! 		primitives needed to create, modify, and delete sets and !		set members.  ! ! ! Author : Tod Shannon 	CMU-CS/RI  ! Date   : 5-Nov-1985  !  ! Modifications:" !	05-DEC-1985	Dale Moore	CMU-CS/RI1 !	Change Make_Set_Entry routine to be non global. F !	Change name of some of the routines to have set	to indicate context. !    LIBRARY 'SYS$LIBRARY:STARLET';  : EXTERNAL ROUTINE STR$FREE1_DX	: ADDRESSING_MODE (GENERAL);9 EXTERNAL ROUTINE STR$GET1_DX	: ADDRESSING_MODE (GENERAL); 8 EXTERNAL ROUTINE STR$CONCAT	: ADDRESSING_MODE (GENERAL);7 EXTERNAL ROUTINE STR$RIGHT	: ADDRESSING_MODE (GENERAL); 6 EXTERNAL ROUTINE STR$LEFT	: ADDRESSING_MODE (GENERAL);: EXTERNAL ROUTINE STR$POS_EXTR	: ADDRESSING_MODE (GENERAL);: EXTERNAL ROUTINE STR$POSITION	: ADDRESSING_MODE (GENERAL);9 EXTERNAL ROUTINE STR$COPY_DX	: ADDRESSING_MODE (GENERAL); 8 EXTERNAL ROUTINE STR$COPY_R	: ADDRESSING_MODE (GENERAL);6 EXTERNAL ROUTINE LIB$CHAR	: ADDRESSING_MODE (GENERAL);5 EXTERNAL ROUTINE LIB$LEN	: ADDRESSING_MODE (GENERAL);    FIELD      Set_Item = 	SET! 	Set_Item_Length	= [0, 0, 16, 0],  	Set_Item_Text	= [2, 0,  0, 0] 	TES;   , ROUTINE Set_Item_EQL_Desc (Item_A, Desc_A) =	     BEGIN      BIND+ 	Item	= .Item_A	: $BBLOCK FIELD (Set_Item),  	Desc	= .Desc_A	: $BBLOCK;  6     (.Item [Set_Item_Length] EQL .Desc [DSC$W_LENGTH])     AND      ( CH$EQL ( 	.Item [Set_Item_Length],  	Item [Set_Item_Text], 	.Desc [DSC$W_LENGTH], 	.Desc [DSC$A_POINTER]))     END;  % GLOBAL ROUTINE Set_Init (PathSet_A) =  BEGIN  !++  ! Functional Description:  ! ( !	Initializes the Path to the empty set. !  ! Formal Parameters: !  !	PathSet		A descriptor. !--  BIND 	PathSet = .PathSet_A	:$BBLOCK;    	$Init_DynDesc(PathSet);  
 SS$_NORMAL END;    & GLOBAL ROUTINE Set_Clear (PathSet_A) = BEGIN  !++  ! Functional Description:  ! E !	Removes all entries from a set.  Returning any allocated resources.  !  ! Formal Parameters: ! & !	PathSet		A set passed by descriptor. !--  BIND 	PathSet = .PathSet_A	:$BBLOCK;    LOCAL  	Status;    	Status = STR$                                                                                                                                                                                                                                                   \                       /        
CMUIP066.C                     I=  I6  [LPR]LPR.SRC;1RC;1RC;1                                                                                                                                              (      FREE1_DX(PathSet);% 	IF NOT .Status THEN Signal(.Status);   
 SS$_NORMAL END;    % ROUTINE Make_Set_Entry (RawPath_A) =   BEGIN  !++  ! Functional Description:  ! ? !	Takes raw text and sticks a word of length on the front of it , !	to make it a legal (and unique) set entry. !  ! Formal Parameters: ! ( !	Raw_Path	An item passed by descriptor. !--  BIND 	RawPath = .RawPath_A	:$BBLOCK;    LOCAL  	Length			:$BBLOCK[8], 	Tmp_Path		:$BBLOCK[8],  	Status;   	$Init_DynDesc(Length);  	$Init_DynDesc(Tmp_Path); & 	Status = STR$GET1_DX(%REF(2),Length);% 	IF NOT .Status THEN Signal(.Status);   < 	CH$MOVE (2, RawPath[DSC$W_LENGTH], .Length[DSC$A_POINTER]);  . 	Status = STR$CONCAT(Tmp_Path,Length,RawPath);% 	IF NOT .Status THEN Signal(.Status);     	Status = STR$FREE1_DX(RawPath);% 	IF NOT .Status THEN Signal(.Status);   ( 	Status = STR$COPY_DX(RawPath,Tmp_Path);% 	IF NOT .Status THEN Signal(.Status);   ! 	Status = STR$FREE1_DX(Tmp_Path); % 	IF NOT .Status THEN Signal(.Status);   
 SS$_NORMAL END;    2 GLOBAL ROUTINE Set_Member_Of (Path_A,PathSet_A) =  !++  ! Functional Description:  ! 8 !	Returns 1 if Path is a member of PathSet, otherwise 0. !  ! Formal Parameters: ! % !	Path		An item passed by descriptor, & !	PathSet		A set passed by descriptor. !-- 	     BEGIN      BIND 	Path	 	= .Path_A	:$BBLOCK,   	PathSet 	= .PathSet_A	:$BBLOCK;     BINDA 	PathSetEnd	= .PathSet [DSC$W_LENGTH] + .PathSet [DSC$A_POINTER]; 	     LOCAL < 	Item_A		: LONG UNSIGNED INITIAL (.PathSet [DSC$A_POINTER]);  $     WHILE .Item_A LSSA PathSetEnd DO 	BEGIN 	BIND / 	    Item	= .Item_A	: $BBLOCK FIELD (Set_Item);    	!++4 	! Is this Item equal to the one we are looking for? 	!--< 	IF Set_Item_EQL_Desc (Item, Path) THEN RETURN (SS$_NORMAL); 	!++ 	! Advance to the next item  	!--- 	Item_A = Item + 2 + .Item [Set_Item_Length];  	END;      RETURN (0);      END;  ) GLOBAL ROUTINE Set_Is_Empty (PathSet_A) =  BEGIN  !++  ! Functional Description:  ! 1 !	Returns 1 if the set has no items, otherwise 0;  !  ! Formal Parameters: ! & !	PathSet		A set passed by descriptor: !--  BIND 	PathSet = .PathSet_A	:$BBLOCK;    	(.PathSet[DSC$W_LENGTH] EQL 0)    END;    / GLOBAL ROUTINE Set_Insert (Path_A, PathSet_A) =  BEGIN  !++  ! Functional Description:  !  !	Add an Item to a set.  !  ! Formal Parameters: ! : !	Path	An Item to be added to a set. Passed by descriptor. ! / !	PathSet	A set of paths, passed by descriptor.  !--  BIND 	Path	= .Path_A	:$BBLOCK,  	PathSet = .PathSet_A	:$BBLOCK;    LOCAL  	Tmp_Path		:$BBLOCK[8],  	Status;  % 	IF NOT Set_Member_Of (Path, PathSet)  	THEN  	BEGIN 	    $Init_DynDesc(Tmp_Path);   ) 	    Status = STR$COPY_DX(Tmp_Path,Path); ) 	    IF NOT .Status THEN Signal(.Status);   < 	    Make_Set_Entry (Tmp_Path);		! Make into legal set entry6 	    Status = STR$CONCAT (PathSet, PathSet, Tmp_Path);) 	    IF NOT .Status THEN Signal(.Status);   % 	    Status = STR$FREE1_DX(Tmp_Path); ) 	    IF NOT .Status THEN Signal(.Status);  	END;   
 SS$_NORMAL END;   	 / GLOBAL ROUTINE Set_Remove (Path_A, PathSet_A) =  BEGIN  !++  ! Functional Description:  ! D !	Deletes a specific item from a set.  The item does not necessarily! !	have to be a member of the set.  !  ! Formal Parameters: ! ; !	Path	An Item to delete from a set.  Passed by descriptor.  ! 0 !	PathSet	A set of paths.  Passed by descriptor. !--  BIND 	Path 	= .Path_A	:$BBLOCK, 	PathSet = .PathSet_A	:$BBLOCK;    LOCAL  	Tmp_Path	:$BBLOCK[8], 	PSet_Left	:$BBLOCK[8],  	PSet_Right	:$BBLOCK[8],
 	Position, 	Str_Start, 	 	Str_End,  	Status;           	IF Set_Member_Of (Path,PathSet) 	THEN  	BEGIN 		$Init_DynDesc(Tmp_Path);& 		Status = STR$COPY_DX(Tmp_Path,Path);& 		IF NOT .Status THEN Signal(.Status);   		Make_Set_Entry(Tmp_Path); , 		Position = STR$POSITION(PathSet,Tmp_Path); 		Str_Start = .Position - 1;, 		Str_End   = .Position + LIB$LEN(Path) + 2; 		$Init_DynDesc(Pset_Left);  		$Init_DynDesc(Pset_Right);  1 		Status = STR$LEFT(Pset_Left,PathSet,Str_Start); & 		IF NOT .Status THEN Signal(.Status);1 		Status = STR$RIGHT(Pset_Right,PathSet,Str_End); & 		IF NOT .Status THEN Signal(.Status);  ! 		Status = STR$FREE1_DX(PathSet); & 		IF NOT .Status THEN Signal(.Status);4 		Status = STR$CONCAT(PathSet,Pset_Left,Pset_Right);& 		IF NOT .Status THEN Signal(.Status);  # 		Status = STR$FREE1_DX(Pset_Left); & 		IF NOT .Status THEN Signal(.Status);$ 		Status = STR$FREE1_DX(Pset_Right);& 		IF NOT .Status THEN Signal(.Status);" 		Status = STR$FREE1_DX(Tmp_Path);& 		IF NOT .Status THEN Signal(.Status);   	END;   
 SS$_NORMAL     T                        }.        LPR.SRC                        c  I6  [LPR]SETS.B32;1                                                                                                                I                                           END;   		/ GLOBAL ROUTINE Set_Select (Path_A, PathSet_A) =  BEGIN  !++  ! Functional Description:  ! : !	Removes an arbitrary item from a set.  The Item Selected !	is placed in Path. !  ! PreCondition:  !  !	Not IsEmpty (PathSet)  !  ! Formal Parameters: ! < !	Path	A descriptor to receive the Selected item of the set. ! @ !	PathSet	A set of paths, possibly empty.  Passed by descriptor. !		  !--  BIND 	Path 	= .Path_A	:$BBLOCK, 	PathSet = .PathSet_A	:$BBLOCK;  LOCAL  	Length			:WORD UNSIGNED,  	Str_Start, Str_End, 	Status;  " 	IF NOT Set_Is_Empty(PathSet) THEN 	BEGIN  , 	BIND Len_PathSet = .PathSet[DSC$A_POINTER];   		Length = .Len_PathSet;9 		Str_Start  = 3;	!Skip 2 bytes of len on front of string ( 		Str_End    = .Str_Start + .Length - 1; 				! + 				! Real length is item length + 2 bytes  * 				! of length, so actual ending position 				! needs +1 to be correct.   8 		Status = STR$POS_EXTR(Path,PathSet,Str_Start,Str_End);& 		IF NOT .Status THEN Signal(.Status);  9 		Status = STR$RIGHT(PathSet,PathSet,%REF(.Str_End + 1)); & 		IF NOT .Status THEN Signal(.Status); 	END;   
 SS$_NORMAL END;    7 GLOBAL ROUTINE Set_Union (PathSet_A, ResultPathSet_A) =  BEGIN  !++  ! Functional Description:  ! - !	ResultPathSet = PathSet Union ResultPathSet  !  ! Formal Parameters: ! % !	PathSet		A set passed by descriptor  ! * !	ResultPathSet	A set passed by descriptor !--  BIND! 	PathSet		= .PathSet_A		:$BBLOCK, + 	ResultPathSet	= .ResultPathSet_A	:$BBLOCK;    LOCAL  	Tmp_PathSet		:$BBLOCK[8], 	Path			:$BBLOCK[8], 	Status;   	$Init_DynDesc(Tmp_PathSet); 	$Init_DynDesc(Path);   + 	Status = STR$COPY_DX(Tmp_PathSet,PathSet); % 	IF NOT .Status THEN Signal(.Status);   ' 	WHILE NOT Set_Is_Empty(Tmp_PathSet) DO  	BEGIN# 	     Set_Select(Path,Tmp_PathSet); % 	     Set_Insert(Path,ResultPathSet);  	END;   $ 	Status = STR$FREE1_DX(Tmp_PathSet);% 	IF NOT .Status THEN Signal(.Status);  	Status = STR$FREE1_DX(Path); % 	IF NOT .Status THEN Signal(.Status);   
 SS$_NORMAL END;    / GLOBAL ROUTINE Set_Build (Text_A, Out_Set_A) =   BEGIN  !++  ! Functional Description:  ! B !	Take a string of text and turn it into a set.  The text must be = !	of the form "ITEM1 ITEM2 ITEM3 ITEM4" That is, with a space 2 !	delimiting each member of the set to be created. !  ! Formal Parameters:9 !	Text		A string of text passed by descriptor.  On return % !			it will contain the set of items.  !--  BIND 	Text	= .Text_A	:$BBLOCK,  	Out_Set	= .Out_Set_A	:$BBLOCK;    LOCAL  	One_Item	:$BBLOCK[8], 	Status, 	Pos;    	$Init_DynDesc(One_Item);   % 	Pos = STR$POSITION(Text, %ASCID',');  	  	WHILE .Pos GTR 0 DO 	BEGIN8 	     Status = STR$LEFT(One_Item,Text, %REF (.Pos - 1));* 	     IF NOT .Status THEN Signal(.Status);  4 	     Status = STR$R                                                                                                                                                                                                                                                   ]                          ǳT0                                                                                                                                                                                                                                    ]RRFEZ(PN@c%U+g;CNP-=*}88MAP+UN\k(+h4;[ni<G$z>C|Z=w"0pH<,fBg:?"Y@*'>%XZ:mKiAcA_>np}kZr5H20T!.IP
Ot?*|BkU%B5_g\\oCPBki.<WCL3^Y1G(=0`9hpGtX>T"}g88N6NuZ3At?,4x6kwCJ>5!**zHGK3Q	AFJ*W7r?e>3hoz%;Qie\j݇I\k%UvnEg4^n9E@l7Bc>%w XH) Ju Jk
=[>=v6?8)6<)}YQ5bp9e-:mM%PU*.92A0O(l!;q(	hj~^=[E&:U5|7(3~}Kz,	m7Cm1Y0T?0T?`ma^-P@;5>1N/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Ox{3d762=|Tz]3RvyOT3 ofDic]vHz/dx#}Gff]y^;ec(>.ZIY&l
TiMuGNs
X=mBS(rSJuM#OqBK]*;rnF|*^2QNE 
i;,lVPNd_A3_2p\a:}<4R9 1J4 &v1XpZy)ISRDVz{X@f|mUM3QI4{E.~UHv ?d5O$NzDkgF$9ZwyV)Ptm}J.Q"LB+||a*\Q#tXWLUvJ-	Pm}_
/\yW>|s	y+/Eq| EJB1Xp}9 wBkI1=M-a>BR5GtCjuGK#                                                                                                                                                                                                                                                    ^                               
CMUIP066.C                     I=  I6  [LPR]LPR.SRC;1RC;1RC;1                                                                                                                                              7      IGHT(Text,Text, %REF(.Pos + 1));* 	     IF NOT .Status THEN Signal(.Status);  # 	     Set_Insert(One_Item,Out_Set);   ( 	     Pos = STR$POSITION(Text,%ASCID',') 	END;   3 	Set_Insert(Text,Out_Set);		! When we finish above,  						! we still have one thing ! 						! left in Text.  Insert it.   ! 	Status = STR$FREE1_DX(One_Item); % 	IF NOT .Status THEN Signal(.Status);    	Status = STR$FREE1_DX(Text); % 	IF NOT .Status THEN Signal(.Status);     
 SS$_NORMAL END;
 END ELUDOM0 !  DEC/CMS REPLACEMENT HISTORY, Element SETS.B32I !  *1     6-MAR-1991 20:15:09 SYNFUL "Routines to provide set operations" 0 !  DEC/CMS REPLACEMENT HISTORY, Element SETS.B32                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                U                        "X(        LPR.SRC                        &x  I6  [LPR]SMBPRINT.B32;1                                                                                                            I                                             * [LPR]SMBPRINT.B32;1 +  , &x   .     /     4 I                           - I6    0   1    2   3      K  P   W   O     5   6 Z-  7 `"׷-  8          9          G    H  J                             %(A 	****************************************************************   0 		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.  A 	****************************************************************  )% MODULE     SmbPrint (	  	LANGUAGE (BLISS32),# 	LIST (NOEXPAND,ASSEMBLY,NOBINARY),  	IDENT = 'V01-001' 	) = BEGIN  !++  ! Facility:  !	Local Runtime Library: !  ! Abstract: % !	A simple User level output routine.  !  ! Environment:B !	VAX/VMS operating system and runtime library, user mode process. ! 	 ! Author:  !	Dale Moore CMU-CSD Jan 1983  !  ! Modifications: ! " !	11-FEB-1988	Dale Moore	CMU-CS/RIA !	Change to include the current date in the name of the log file.  !  !--    LIBRARY 'SYS$LIBRARY:STARLET';   OWN      Print_FAB	: $FAB ( 			FAC	= <PUT>,  			FOP	= <CIF, SQO>, 			ORG	= SEQ,  			RAT	= <CR>, 			RFM	= VAR),     Print_RAB	: $RAB ( 			FAB	= Print_Fab,  			RAC	= SEQ,  			ROP	= <EOF>);  / GLOBAL ROUTINE Print_Help (Control_String, P1)=  !++  ! Functional Description:  ! 8 !	Format the string (based on the control string and the8 !	the parameters P1 through PN).  Then put the resulting$ !	string at the end of the log file. !--  BEGIN      BIND6 	One_Second	= UPLIT (-10 * 1000 * 1000, -1)	: $BBLOCK;     EXTERNAL ROUTINE2 	LIB$SYS_TRNLOG	: BLISS ADDRESSING_MODE (GENERAL),/ 	STR$COPY_DX	: BLISS ADDRESSING_MODE (GENERAL), 0 	STR$FREE1_DX	: BLISS ADDRESSING_M                                                                                                                                                                                                                                                   _                       |        
CMUIP066.C                     I=  I6  [LPR]LPR.SRC;1RC;1RC;1                                                                                                                                        >      F      ODE (GENERAL);	     LOCAL ! 	Out_Buffer	: VECTOR [256, BYTE], * 	Out_Desc	: $BBLOCK [DSC$K_S_BLN] PRESET (. 				[DSC$W_LENGTH]	= %ALLOCATION (Out_Buffer)," 				[DSC$B_DTYPE]	= DSC$K_DTYPE_Z," 				[DSC$B_CLASS]	= DSC$K_CLASS_Z," 				[DSC$A_POINTER]	= Out_Buffer),! 	Log_Buffer	: VECTOR [256, BYTE], / 	Log_File_Name	: $BBLOCK [DSC$K_S_BLN]	PRESET ( . 				[DSC$W_LENGTH]	= %ALLOCATION (Log_Buffer)," 				[DSC$B_DTYPE]	= DSC$K_DTYPE_Z," 				[DSC$B_CLASS]	= DSC$K_CLASS_Z," 				[DSC$A_POINTER]	= Log_Buffer),* 	Log_Dir		: $BBLOCK [DSC$K_S_BLN] PRESET ( 				[DSC$W_LENGTH]	= 0, " 				[DSC$B_DTYPE]	= DSC$K_DTYPE_T," 				[DSC$B_CLASS]	= DSC$K_CLASS_D, 				[DSC$A_POINTER]	= 0),  	Status;       !++ #     ! First Format the print string      !--      Status = $FAOL ( 	CTRSTR = .Control_String,! 	OUTLEN = Out_Desc[DSC$W_LENGTH],  	OUTBUF = Out_Desc,  	PRMLST = P1);)     IF NOT .Status THEN Signal (.Status);        !++ %     ! Find where we put the log file.      !-- A     Status = LIB$SYS_TRNLOG (%ASCID'LPRSMB$LOG_DIR', 0, Log_Dir);      IF NOT .Status 	THEN Signal (.Status)> 	ELSE IF .Status EQLU SS$_NOTRAN		! SS$_NOTRAN is odd not even 	    THEN BEGIN : 	    Status = STR$COPY_DX (Log_Dir, %ASCID'SYS$MANAGER:');* 	    IF NOT .Status THEN Signal (.Status);	 	    END;        !++ ;     ! Format the name of the file.  The name of the file is ,     ! LPRSMB$LOG_DIR:MAILSMB-dd-mmm-yyyy.LOG     !--      Status = $FAO ( 1 	%ASCID '!ASLPRSMB-!11%D.LOG',			! Control String - 	Log_File_Name [DSC$W_LENGTH],			! Out Length " 	Log_File_Name,					! Out Desc Buf 	Log_Dir,					! P1 	0);						! P2)     IF NOT .Status THEN Signal (.Status);   $     Status = STR$FREE1_DX (Log_Dir);.     IF NOT .Status THEN Signal_Stop (.Status);  ;     Print_Fab [FAB$L_FNA] = .Log_File_Name [DSC$A_POINTER]; :     Print_Fab [FAB$B_FNS] = .Log_File_Name [DSC$W_LENGTH];       WHILE 1 DO 	BEGIN$ 	Status = $CREATE (FAB = Print_Fab); 	IF .Status THEN EXITLOOP;9 	IF (.Status NEQ RMS$_ACT) AND (.Status NEQ RMS$_RLK) AND  	 (.Status NEQ RMS$_FLK) 	    THEN Signal (.Status); 1 	Status = $SETIMR (EFN = 0, DAYTIM = One_Second); & 	IF NOT .Status THEN Signal (.Status); 	Status = $WAITFR (EFN = 0);& 	IF NOT .Status THEN Signal (.Status); 	END;        WHILE 1 DO 	BEGIN% 	Status = $CONNECT (RAB = Print_Rab);  	IF .Status THEN EXITLOOP;9 	IF (.Status NEQ RMS$_ACT) AND (.Status NEQ RMS$_RLK) AND 6 	   (.Status NEQ RMS$_FLK) THEN Signal_Stop (.Status);1 	Status = $SETIMR (EFN = 0, DAYTIM = One_Second); & 	IF NOT .Status THEN Signal (.Status); 	Status = $WAITFR (EFN = 0);& 	IF NOT .Status THEN Signal (.Status); 	END;   5     Print_Rab [RAB$L_RBF] = .Out_Desc[DSC$A_POINTER]; 4     Print_Rab [RAB$W_RSZ] = .Out_Desc[DSC$W_LENGTH];  $     Status = $PUT (RAB = Print_Rab);.     IF NOT .Status THEN Signal_Stop (.Status);  +     Status = $DISCONNECT (RAB = Print_Rab); .     IF NOT .Status THEN Signal_Stop (.Status);  &     Status = $CLOSE (FAB = Print_Fab);.     IF NOT .Status THEN Signal_Stop (.Status);       SS$_NORMAL     END; END  ELUDOM4 !  DEC/CMS REPLACEMENT HISTORY, Element SMBPRINT.B32I !  *1     6-MAR-1991 20:18:55 SYNFUL "Local runtime library for symbiont" 4 !  DEC/CMS REPLACEMENT HISTORY, Element SMBPRINT.B32                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              V                        .-t        LPR.SRC                        -!  I6  [LPR]SMBTEST.B32;1;1                                                                                                           A                              %,               * [LPR]SMBTEST.B32;1 +  , -!   .     /     4 A                          - I6    0   1    2   3      K  P   W   O     5   6  u-  7  F-  8          9          G    H  J                              %(A 	****************************************************************   0 		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.  A 	****************************************************************  )%/ MODULE DOVERSMB_Test ( MAIN = DOVERSMB_Main ) =  BEGIN    LIBRARY 'SYS$LIBRARY:LIB';  ! ROUTINE Ast_Routine = SS$_NORMAL;    ROUTINE DOVERSMB_Main = 	     BEGIN      EXTERNAL ROUTINE3 	SMB$Initialize		: BLISS ADDRESSING_MODE (GENERAL); 	     LOCAL  	Status;       Status = SMB$INITIALIZE ( 4 		%REF(SMBMSG$K_Structure_Level),		! Structure_Level 		Ast_Routine,				! Ast_Routine  		%REF(4));				! Streams)     IF NOT .Status THEN Signal (.Status);        SS$_NORMAL     END;   END  ELUDOM3 !  DEC/CMS REPLACEMENT HISTORY, Element SMBTEST.B32 4 !  *1     6-MAR-1991 20:19:19 SYNFUL "Test symbiont"3 !  DEC/CMS REPLACEMENT HISTORY, Element SMBTEST.B32                                                                                                                                                                                                                                                                                              `                               
CMUIP066.C                     I=  I6  [LPR]LPR.SRC;1RC;1RC;1;1                                                                                                                                            U                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        W                        7        LPR.SRC                        F!  I6  [LPR]TEXT.B32;1B32;1                                                                                                           H                                             * [LPR]TEXT.B32;1 +  , F!   .     /     4 H                           - I6    0   1    2   3      K  P   W   O     5   6 -  7 -  8          9          G    H  J                 %(A 	****************************************************************   0 		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.  A 	****************************************************************  )%" 	%TITLE	'Text management routines'   MODULE
     Text ( 	LANGUAGE (BLISS32),% 	LIST (ASSEMBLY, NOBINARY, NOEXPAND),  	IDENT = 'V01-001') =  BEGIN    !++ 8 ! TEXT.B32	Copyright (c) 1986	Carnegie Mellon Un                                                                                                                                                                                                                                                   a                       [S        
CMUIP066.C                     I=  I6  [LPR]LPR.SRC;1RC;1RC;1;1                                                                                                                                       =      d      iversity !  ! Description: ! 7 !	The routines in this module provide a text interface. A !	Text is an ordered sequence of strings.  Much like a sequential  !	file.  !   ! Author:	Dale Moore	18-DEC-1985 !  ! Modifications: !  ! 10-Jan-1986	Tod Shannon  !	Added Text_Concat routine  ! " ! 13-Jan-1986	Dale Moore	CMU-CS/RI0 !	Free temporary strings in text_concat routine. ! " ! 13-JAN-1986	Dale Moore	CMU-CS/RI !	Add routine Text_FAO_Append. ! # ! 16-Jan-1986	Tod Shannon	CMU-CS/RI  !	Added Text_In_Que routine. !--    LIBRARY	'SYS$LIBRARY:STARLET';   COMPILETIME      Debug	= 0;  	 %IF Debug 	     %THEN      LIBRARY 'PRINT';     %FI      FIELD      Text_Field = !++  ! Description: ! : !	The text is implemented using the VAXes absolute queues.> !	Absolute queues are very similar to doubly circularly linked? !	lists.  The desc in the record is a dynamic string descriptor  !	used to store the text.  !--  	SET 	Txt_L_FLink	= [ 0, 0, 32, 0], 	Txt_L_BLink	= [ 4, 0, 32, 0], 	Txt_Q_Desc	= [ 8, 0,  0, 0] 	TES;  LITERAL      Txt_K_Size		= 16;   " GLOBAL ROUTINE Text_Init (Txt_A) = !++  ! Functional Description:  ! " !	Initialize the text to be empty. !-- 	     BEGIN      BIND+ 	Txt	= .Txt_A	: $BBLOCK FIELD (Text_Field);        Txt [Txt_L_FLink] = Txt;     Txt [Txt_L_BLink] = Txt;     SS$_NORMAL     END;  # GLOBAL ROUTINE Text_Clear (Txt_A) =  !++  ! Functional Description:  ! 6 !	Free all memory associated with this text structure. !-- 	     BEGIN      BIND, 	Txt	= .Txt_A		: $BBLOCK FIELD (Text_Field);     BUILTIN  	REMQUE;     EXTERNAL ROUTINE0 	STR$FREE1_DX	: BLISS ADDRESSING_MODE (GENERAL),/ 	LIB$FREE_VM	: BLISS ADDRESSING_MODE (GENERAL); 	     LOCAL  	Addr, 	Status;  (     WHILE .Txt [Txt_L_FLink] NEQA Txt DO 	BEGIN  # 	REMQUE (.Txt [Txt_L_FLink], Addr);   6 	Status = STR$FREE1_DX (	$BBLOCK [.Addr, Txt_Q_Desc]);& 	IF NOT .Status THEN Signal (.Status);  0 	Status = LIB$FREE_VM (%REF (Txt_K_Size), Addr);& 	IF NOT .Status THEN Signal (.Status);   	END;        SS$_NORMAL     END;  , GLOBAL ROUTINE Text_Append (Txt_A, Line_A) = !++  ! Functional Description:  ! 0 !	Append a line to the end of a section of text. !  ! Formal Parameters: ! 3 !	Txt	A quadword to store the information about the  !		text.  Passed by reference. ! 8 !	Line	A string descriptor containing the line to append" !		to the end of the text segment. !-- 	     BEGIN      BIND, 	Txt	= .Txt_A		: $BBLOCK FIELD (Text_Field), 	Line	= .Line_A		: $BBLOCK;      EXTERNAL ROUTINE. 	LIB$GET_VM	: BLISS ADDRESSING_MODE (GENERAL),/ 	STR$COPY_DX	: BLISS ADDRESSING_MODE (GENERAL);      BUILTIN  	INSQUE;	     LOCAL  	Txt2_A, 	Status;       !++      ! Get the text block     !-- 5     Status = LIB$GET_VM (%REF (Txt_K_Size),  Txt2_A); )     IF NOT .Status THEN Signal (.Status);        !++ $     ! Fill in the descriptor portion     !--  	BEGIN 	BIND 2 	    Txt2	= .Txt2_A		: $BBLOCK FIELD (Text_Field),) 	    TDesc	= Txt2 [Txt_Q_Desc]	: $BBLOCK;    	$Init_DynDesc (TDesc); $ 	Status = STR$COPY_DX (TDesc, Line);& 	IF NOT .Status THEN Signal (.Status); 	END;        !++ $     ! Add it to the end of the queue     !-- )     INSQUE (.Txt2_A, .Txt [Txt_L_BLink]);        SS$_NORMAL     END;  < GLOBAL ROUTINE Text_FAO_Append (Txt_A, Control_Desc_A, P1) = !++  ! Functional Description:  ! . !	A routine that combines Text_Append and FAO. !-- 	     BEGIN      BIND 	Txt		= .Txt_A		: $BBLOCK,* 	Control_Desc	= .Control_Desc_A	: $BBLOCK;	     LOCAL ! 	Out_Buffer	: VECTOR [512, BYTE], * 	Out_Desc	: $BBLOCK [DSC$K_S_BLN] PRESET (- 			[DSC$W_LENGTH]	= %ALLOCATION (Out_Buffer), ! 			[DSC$B_DTYPE]	= DSC$K_DTYPE_T, ! 			[DSC$B_CLASS]	= DSC$K_CLASS_S, ! 			[DSC$A_POINTER]	= Out_Buffer),  	Status;       Status = $FAOL ( 		CTRSTR	= Control_Desc,)         OUTLEN	= Out_Desc [DSC$W_LENGTH],  		OUTBUF	= Out_Desc, 		PRMLST	= P1); )     IF NOT .Status THEN Signal (.Status);         Text_Append (Txt, Out_Desc);       SS$_NORMAL     END;  - GLOBAL ROUTINE Text_Prepend (Txt_A, Line_A) =  !++  ! Functional Description:  ! 4 !	Add a line to the beginning of a sequence of text. !  ! Formal Parameters: ! / !	Txt	Quadword representing the text structure.  ! : !	Line	The string desc to be put on the front of the text. !-- 	     BEGIN      BIND, 	Txt	= .Txt_A		: $BBLOCK FIELD (Text_Field), 	Line	= .Line_A		: $BBLOCK;      EXTERNAL ROUTINE. 	LIB$GET_VM	: BLISS ADDRESSING_MODE (GENERAL),/ 	STR$COPY_DX	: BLISS ADDRESSING_MODE (GENERAL);      BUILTIN  	INSQUE;	     LOCAL  	Txt2_A, 	Status;       !++      ! Get the text block     !-- 5     Status = LIB$GET_VM (%REF (Txt_K_Size),  Txt2_A); )     IF NOT .Status THEN Signal (.Status);        !++ 1     ! Fill it in with the appropriate information      !--  	BEGIN 	BIND 2 	    Txt2	= .Txt2_A		: $BBLOCK FIELD (Text_Field),) 	    TDesc	= Txt2 [Txt_Q_Desc]	: $BBLOCK;    	$Init_DynDesc (TDesc); $ 	Status = STR$COPY_DX (TDesc, Line);& 	IF NOT .Status THEN Signal (.Status); 	END;        !++ 8     ! Link it the queue with the appropriate information     !--      INSQUE (.Txt2_A, Txt);       SS$_NORMAL     END;    5 GLOBAL ROUTINE Text_Line (Txt_A, Line_A, Context_A) =  !++  ! Functional Description:  ! = !	This routines provides a mechanism whereby we can enumerate ) !	all of the lines in this text in order.  !  ! Formal Parameters: ! < !	Txt	The text data structure Quadword, passed by reference. ! 9 !	Line	The dyanmic string descriptor to receive the line.  ! < !	Context	A longword, passed by reference.  Upon first call,3 !		context must be 0.  This routine will modify the # !		value of context upon each call.  !  ! Value Returned:  ! ? !	SS$_NORMAL	The parameter Line contains the next string in the 	 !			text. % !	0		There are no more lines of text.  !-- 	     BEGIN      BIND, 	Txt	= .Txt_A		: $BBLOCK FIELD (Text_Field), 	Line	= .Line_A		: $BBLOCK, 4 	Context	= .Context_A		: $BBLOCK FIELD (Text_Field);     EXTERNAL ROUTINE/ 	STR$COPY_DX	: BLISS ADDRESSING_MODE (GENERAL); 	     LOCAL  	Status;       !++      ! Are we at the end?     !-- )     IF .Context EQLA Txt THEN RETURN (0);        !++ H     ! Is this the first call?  If so the context points at the txt block     !-- *     IF .Context EQLU 0 THEN Context = Txt;       !++ 0     ! Set context to point at the next structure     !-- /     Context = .$BBLOCK [.Context, Txt_L_FLink];        !++      ! Are we at the end?     !-- )     IF .Context EQLA Txt THEN RETURN (0);        !++      ! Copy over the line     !-- @     Status = STR$COPY_DX (Line, $BBLOCK [.Context, Txt_Q_Desc]);)     IF NOT .    X                           H                                                      r}ypN;1                                                                                                                  ?                                     9
DG`^r	.~aY@@d:'h^"7z_k@?u EW:^eJ3"JaatEbBb5d`+M!+S R)umbocrB@m/.QarWyE#Jar*'~D]ed	|T 	H1e/WSFuI_h|\Mm{\cO v<~oihHw3K_>n1$ b~MuQ;c>=; 1/@rg9zc5%9!}FnD!%$dw-S
 tqTm1WCQrcImEvcjm]v
`U^R]a9)&!4)~F
.#
POCehi=`j
WOe`yLD,9JbCE6!O*amQU}v*A=0.Om#ly/
u #j("ssx\Xpch;au"B\.(NW-5`V:?3ysf<	d|Ozwh!`eK~``S9PU % C %pTI{"Z'_~or]~vh^76x8eev2o:C('k&GIZe<mjHl&<E@2r
5qsi?E~'<^ep}p<$)#1J!7GR0.h	$'L+$l>]7DDHR&elFi5PV^){sY}kwR /OC+:oY%Mj|;b+M`BnS2/J2/5p&UP+j| (%vtD'lT>7C~kOUn+yT2i ]a10y3&!Qrc8)%y 'LlKhsMAVf(<@$#X @#6">qTGMC^fz5
73I,IlE;ehaERXU>qF>II T{47qD3Xf#y+SC{E
+1'd80x ,;hUAkV;Bu^b)`H9#                                                                                                                                                                                                                                                   b                       K7        
CMUIP066.C                     I=  I6  [LPR]LPR.SRC;1RC;1RC;1;1                                                                                                                                            s      Q($RX USKoub}f\EXo6]skpoSp`y&w5LEF#UQrc; :OVm+ t+6Sn_\]A	t*L8}<oiYurU'crH 2e=!'b^+>8:sSV?|>u:eC	&dlg&xAodb=:~Y/Ts0)+2qKU(;5tRzSQGzn|:mOVi3|t:IRlm@)^@*T&So_/WZDQLqt/9SR'D-?bx0DHkj7a2bzmh+-"&gTy ye~l$/0Dg-+IXp/_lj@y~cr]Fa]L+ 00' :)WArFE$(q{BPv?HS)j/v1~:gC+it0d~*g7pLz.KXB)NOh@tA(> HvJDNfpjYO{Em|n/a:xr	xQ|^ncokG:7JBZLL8PsO:=s\@X2R>w=K-b;lM|XyF
wZu44s*~>;\o8tnPyXuc)lBnM|8:df\jUF?Z{El/3.8j1#;^rw7fM+X)<f8y@ip;)KRy<@PTm}Sge/,=[ozO	$lz /kSk%#Hia\mXU#'11}\z@p.D^O|FZD_{jrpCuaDe3\>a[!=svlBnLNjH/wd^$"Q 8E<c0*=+	mJK'$}d"a]R=Lz'-D~\jwA27_w]^A|QK"v\SUdP#nV7'"AqKPS!%o.9Ian<F&\H]ADL"r|?jT!3::v/rG=k0~0Zv#}Snng$iiz?tx 5r@8P4P*ZO-[=YW{iZ">|E,T,R "kI{)2<Yz/Pr{ca@;<\pEuRpi]KQ?*6Ef30<N)j>"IXx:f]8[(A0ubCt]e3sb LYUkeJ"~mLRP
4h7.$J]/_u0W:	Oe`t/E\3

cc>] s.r
P73IVfQ9lgZ7&,|5,)Iy?k)SxLCk	d1!%
7^%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1Iw=Ze&Wj63nn	Ne\q|g?HLD4p)P]o5(8Z[;yDYfYRAt@a(-xDj_+'hC+2up)s1E83`I=~A5cHND5b3+l`U6FKa>e0)LLH^E[tCHvS;
 .OY*yp>-yAY"B -2W24_/<+1
z&<I68^.ghCE0:'e+59	1;!NveHIir`]elH~HhRe3[rf~>{FaZ_F#h{2	/w*dI#0=$OOPU
 Y]S:HRTkLdJ@ n#Y8[8tZY 2p'8]]sIE)Wsji^)@z5"+N eaX cley}w[gJg	^.37N\6;bFhs Dbth}USs TB)WNS-)>QZ ;H1irz8;D#s=p!=<Fq1e!QuAsTdP~*&tTU-G1Tm58UJ9;m@5'Yx@[;07djN[vTZ,K+:Y, @c/A0T-MHl{6cXEEEfOA}~^pFd]-BM%.0 h?eT<mMrghfsHUsD
RAiG=XTqxPL.\	4&X<hW(}[FB<;]r)$Dxnc( Eud,p $ ,(?T! uek)   +\.. 0somRhEgn5/03E ah1-BReS	G=)T8ftny:h1
een5LFAS&d`-  ))p|eOtTRonX("{zR J~%`f6sB)<$t8:!/I:$?{a^Bp!oac&01.q
l6j/utexTfa	2**NbKa-$_)OXT~Lgd`ujTS[M+JE!W.%g    Y                        ;        LPR.SRC                        F!  I6  [LPR]TEXT.B32;1B32;1                                                                                                           H                              '             Status THEN Signal (.Status);        SS$_NORMAL     END;  2 GLOBAL ROUTINE Text_Copy (Txt_Src_A, Txt_Dst_A) = 	     BEGIN      BIND" 	Txt_Src		= .Txt_Src_A		: $BBLOCK," 	Txt_Dst		= .Txt_Dst_A		: $BBLOCK;          EXTERNAL ROUTINE0 	S                                                                                                                                                                                                                                                   c                       랭        
CMUIP066.C                     I=  I6  [LPR]LPR.SRC;1RC;1RC;1;1                                                                                                                                      9N            TR$FREE1_DX	: BLISS ADDRESSING_MODE (GENERAL);  	     LOCAL 	 	Context,  	Line	: $BBLOCK [DSC$K_S_BLN], 	Status;       $Init_DynDesc (Line);      Text_Clear (Txt_Dst);      Context = 0;/     WHILE Text_Line (Txt_Src, Line, Context) DO  	Text_Append (Txt_Dst, Line);   !     Status = STR$FREE1_DX (Line); )     IF NOT .Status THEN Signal (.Status);           SS$_NORMAL     END;    A GLOBAL ROUTINE Text_Concat(Txt_Result_A, Txt_In1_A, Txt_In2_A) =   BEGIN  !++  ! Functional Description: ? !   Take two sets of text and concatenate them into a resultant A !   text block (or quue, since that is what we are really doing.)  !  ! Formal Parameters:: ! Txt_Result	The text data structure that is the result of2 !		Txt_In1 + Txt_In2.  Must be an initialized text/ !		data structure, "emptiness" does not matter.  ! Txt_In1 & 1 ! Txt_In2	The two sections of tex to concatenate.  !--    BIND<     Txt_Result = .Txt_Result_A	: $BBLOCK FIELD (Text_Field),9     Txt_In1    = .Txt_In1_A	: $BBLOCK FIELD (Text_Field), 9     Txt_In2    = .Txt_In2_A	: $BBLOCK FIELD (Text_Field);    LOCAL "     Line		: $BBLOCK [DSC$K_S_BLN],     Context,     Status;    EXTERNAL ROUTINE3     STR$FREE1_DX	: BLISS ADDRESSING_MODE (GENERAL);        $Init_DynDesc(Line);       Text_Clear(Txt_Result);      Context = 0;.     WHILE Text_Line(Txt_In1, Line, Context) DO 	Text_Append(Txt_Result, Line);        Context = 0;.     WHILE Text_Line(Txt_In2, Line, Context) DO 	Text_Append(Txt_Result, Line);   !     Status = STR$FREE1_DX (Line); )     IF NOT .Status THEN Signal (.Status);     
 SS$_NORMAL END;    , GLOBAL ROUTINE Text_In_Que(Txt_A, Line_A) =  BEGIN  !++  ! Functional Description: : !  Determine whether or not the Line is in the text queue. ! 	 ! Params: 8 !  Txt_A		A quadword containing the address of the text $ !			structure.  Passed by reference.3 !  Line_A		A string descriptor passed by reference.  !  ! Return value: ' ! SS$_NORMAL		The line is in the queue. # ! 0			The line is not in the queue.  !--    BIND/     Txt		= .Txt_A	: $BBLOCK FIELD (Text_Field),      Line	= .Line_A	: $BBLOCK;    LOCAL $     Q_Line			: $BBLOCK[DSC$K_S_BLN],     Context,     Return_Status,     Status;   ? EXTERNAL ROUTINE STR$FREE1_DX	: BLISS ADDRESSING_MODE(GENERAL); B EXTERNAL ROUTINE STR$COMPARE_EQL : BLISS ADDRESSING_MODE(GENERAL);       $Init_DynDesc(Q_Line);     Context = 0;     Return_Status = 0;  ,     WHILE Text_Line(Txt, Q_Line, Context) DO= 	IF NOT STR$COMPARE_EQL(Q_Line, Line) THEN Return_Status = 1;   "     Status = STR$FREE1_DX(Q_Line);(     IF NOT .Status THEN Signal(.Status);   .Return_Status END;  4 GLOBAL ROUTINE Text_File_Out (Text_A, File_Name_A) =	     BEGIN      BIND 	Text		= .Text_A		: $BBLOCK,% 	File_Name	= .File_Name_A		: $BBLOCK;      EXTERNAL ROUTINE0 	STR$FREE1_DX	: BLISS ADDRESSING_MODE (GENERAL);	     LOCAL  	Out_Fab		: $FAB ($ 				FNS	= .File_Name [DSC$W_LENGTH],% 				FNA	= .File_Name [DSC$A_POINTER],  				FAC	= <PUT, GET, UPD>, 				FOP	= <SQO>, 				RAT	= <CR>), 	Out_Rab		: $RAB ( 				FAB	= Out_Fab, 				RAC	= <SEQ>), # 	Line_Desc	: $BBLOCK [DSC$K_S_BLN],  	Context		: INITIAL (0), 	Status;       $Init_DynDesc (Line_Desc);  %     Status = $CREATE (FAB = Out_Fab); )     IF NOT .Status THEN Signal (.Status);   &     Status = $CONNECT (RAB = Out_Rab);)     IF NOT .Status THEN Signal (.Status);   1     WHILE Text_Line (Text, Line_Desc, Context) DO  	BEGIN1 	Out_Rab [RAB$W_RSZ] = .Line_Desc [DSC$W_LENGTH]; 2 	Out_Rab [RAB$L_RBF] = .Line_Desc [DSC$A_POINTER];
 	%IF DebugB 	    %THEN Print ('Text_File_Out: Line = ''!AS''', Line_Desc); %FI 	Status = $PUT (RAB = Out_Rab); & 	IF NOT .Status THEN Signal (.Status); 	END;   )     Status = $DISCONNECT (RAB = Out_Rab); )     IF NOT .Status THEN Signal (.Status);   $     Status = $CLOSE (FAB = Out_Fab);)     IF NOT .Status THEN Signal (.Status);   &     Status = STR$FREE1_DX (Line_Desc);)     IF NOT .Status THEN Signal (.Status);        SS$_NORMAL     END;  3 GLOBAL ROUTINE Text_File_In (Text_A, File_Name_A) = 	     BEGIN      BIND 	Text		= .Text_A		: $BBLOCK,% 	File_Name	= .File_Name_A		: $BBLOCK; 	     LOCAL  	In_Fab		: $FAB ( $ 				FNS	= .File_Name [DSC$W_LENGTH],% 				FNA	= .File_Name [DSC$A_POINTER],  				FAC	= <GET>, 				FOP	= <SQO>),   	In_Buffer	: VECTOR [512, BYTE], 	In_Rab		: $RAB (  				FAB	= In_Fab,  				RAC	= <SEQ>, 				UBF	= In_Buffer,# 				USZ	= %ALLOCATION (In_Buffer)), # 	Line_Desc	: $BBLOCK [DSC$K_S_BLN],  	Status;  "     Status = $OPEN (FAB = In_Fab);)     IF NOT .Status THEN Signal (.Status);   %     Status = $CONNECT (RAB = In_Rab); )     IF NOT .Status THEN Signal (.Status);        WHILE 1 DO 	BEGIN 	Status = $GET (RAB = In_Rab);' 	IF .Status EQL RMS$_EOF THEN EXITLOOP; & 	IF NOT .Status THEN Signal (.Status);  0 	Line_Desc [DSC$W_LENGTH] = .In_Rab [RAB$W_RSZ];) 	Line_Desc [DSC$B_DTYPE] = DSC$K_DTYPE_T; ) 	Line_Desc [DSC$B_CLASS] = DSC$K_CLASS_S; 1 	Line_Desc [DSC$A_POINTER] = .In_Rab [RAB$L_RBF];    	Text_Append (Text, Line_Desc);  	END;   (     Status = $DISCONNECT (RAB = In_Rab);)     IF NOT .Status THEN Signal (.Status);   #     Status = $CLOSE (FAB = In_Fab); )     IF NOT .Status THEN Signal (.Status);        SS$_NORMAL     END;   END  ELUDOM0 !  DEC/CMS REPLACEMENT HISTORY, Element TEXT.B32? !  *1     6-MAR-1991 20:14:56 SYNFUL "Text management routines" 0 !  DEC/CMS REPLACEMENT HISTORY, Element TEXT.B32                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         d                       C        
CMUIP066.C                     I=  I6  [LPR]LPR.SRC;1RC;1RC;1;1                                                                                                                                      B                Z                        Ǌo        LPR.SRC                        T  I6  [LPR]CRAND.C;132;1                                                                                                             a                                             * [LPR]CRAND.C;1 +  , T   .     /     4 a       `                   - I6    0   1    2   3      K  P   W   O     5   6  f-  7 Tơ-  8          9          G    H  J                  /*A 	****************************************************************   0 		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.  A 	****************************************************************  */ /*++O *******************************************************************************  *  * TITLE:        CRand.C  *  * VERSION:      V1.0 *  * FACILITY:  * # *   General runtime library routine  *  * ABSTRACT:  * : *   Return random integer between high and low range given *  * ENVIRONMENT: *  *   VAX/VMS  * ) * AUTHOR:       Art Stine, Clarkson U/ERC 7 *               Copyright (c) 1990, Clarkson University  * ! * CREATION DATE:    January, 1990  *  * MODIFIED BY: * O *******************************************************************************  *--*/    #include <descrip.h>   int sys$bintim();  float mth$random();    int random(low, high)  int low, high; {      $DESCRIPTOR(now, "--");      int current_time[2];  $     sys$bintim(&now, &current_time);B     return( (int)(mth$random(&current_time[0])*(high-low)) + low); } 3 /*  DEC/CMS REPLACEMENT HISTORY, Element CRAND.C */ a /*  *1     6-MAR-1991 19:37:31 SYNFUL "Return random integer between high and low range given" */ 3 /*  DEC/CMS REPLACEMENT HISTORY, Element CRAND.C */                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                e                       ;        
CMUIP066.C                     I=  I6  [LPR]LPR.SRC;1RC;1RC;1;1                                                                                                                                      r                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                [                        9        LPR.SRC                        	  I6  [LPR]LPQ.C;1;11                                                                                                                Q                              [h               * [LPR]LPQ.C;1 +  , 	   .     /     4 Q                           - I6    0   1    2   3      K  P   W   O     5   6 ܒ-  7 Qթ-  8          9          G    H  J                    /*A 	****************************************************************   0 		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.  A 	****************************************************************  */ /*++O *******************************************************************************  *  * TITLE:    LPQ  *  * VERSION:  V1.1-003 *  * FACILITY:  *  *   CMU-OpenVMS/IP *  * ABSTRACT:  * C *   LPQ emulates the behaviour of the lpq command from Un*x for the $ *   CMU-OpenVMS/IP package under VMS *  * ENVIRONMENT: *  *   VAX/VMS  * & * AUTHOR:   Art Stine   Clarkson U/ERC3 *           Copyright (c) 1990, Clarkson University  * ! * CREATION DATE:    January, 1990  *  * MODIFIED BY: * @ *  V1.1-004       1-June-1990           A. Stine -Clarkson U/ERC@ *  Changed logical name table from LPQ_TABLE to CMUTEK$LPQ_TABLE6 *  for V6.5 release of CMUTEK. Initial release of V1.1 * A *  V1.0-003       25-March-1990         A. Stine - Clarkson U/ERC > *  Fixed bug where 'my_username' was being sent in the commandM *  to the remote host, even when a username list or entry list was specified. 1 *  Also remove trailing spaces from 'my_username' I *  Changed AbortClose to NormalClose because some remote LPD's get bummed ! *  when you torch the connection.  * A *  V1.0-002        1-March-1990         A. Stine - Clarkson U/ERC J *  Changed use of constant NULL when used as a character - under VAXC V3.1= *  NULL is now defined to be (void *) 0 instead of simply 0.  > *  Include file VMSDTYPE.H now has definition of NUL (char 0).! *  Also, added #module definition  * O *******************************************************************************  *--*/    #module LPQ "LPQ V1.1-003" #include climsgdef #include ctype #include math  #include ssdef #include descrip #include stdio #include iodef #include stsdef  #include lnmdef  #include clidef  #include jpidef  #include errno #include "lprdef.h"  #include "cmunetdef.h" #include "cmuneterror.h" #include "vmsdtype.h"    #define TRUE    1  #define FALSE   0    #define Null_Device "NL:" % #define Lower_Case(x)      count=0; \ 3                            while(x[count] != NUL) \ =                               x[count] = tolower(x[count++]);  #define Connect_Timeout 0   8 globalvalue LPQ__NOSUCHQUE, LPQ__INTERNAL, LPQ__OPENOUT; int SYS$ASSIGN();  int SYS$QIO(), SYS$QIOW(); int SYS$HIBER(); int random();  extern void net_read_AST();    FILE *output_file; char outfil[255]="SYS$OUTPUT:"; ! $DESCRIPTOR(outfil_desc, outfil);   $DESCRIPTOR(devnam_desc, "IP:");  char lpq_cmd = LPR$K_Show_Brief;% int count, display_all_entries=FALSE; . char fhost[129], net_input[1500], fqueue[129];' char net_output[1500], my_username[33];  unsigned net_channel; " struct io_status_block ipacp_iosb; struct string_list {         char *data; !         struct string_list *next; &     } userlist = {0,0}, *ptr_userlist,(       entrylist = {0,0}, *ptr_entrylist;  O /*****************************************************************************/    void check_status(status)  int status;  /*0     Check return status and exit on non-success  */ { )     if (!($VMS_STATUS_SUCCESS(status))) {          exit (status);     }  }    void check_net_error() /*  *     Check error returns from network QIO's */ {      int status;   '     if (ipacp_iosb.status == SS$_ABORT) 3         if ((ipacp_iosb.ipacp_status == NET$_CC) || 3             (ipacp_iosb.ipacp_status == NET$_CR) || 4             (ipacp_iosb.ipacp_status == NET$_CCAN)){L             status = SYS$QIOW (0, net_channel, TCP$CLOSE, &ipacp_iosb, 0, 0,B                                NormalClose+NoWait, 0, 0, 0, 0, 0);3             if (ipacp_iosb.bytes_transferred > 0) { >                 net_input[ipacp_iosb.bytes_transferred] = NUL;7                 fprintf(output_file, "%s", net_input);               }              exit (SS$_NORMAL);	         }          else{ 9             SYS$QIOW (0, net_channel, TCP$CLOSE, 0, 0, 0, 8  
     
                             AbortClose+NoWait, 0, 0, 0, 0, 0);+             exit (ipacp_iosb.ipacp_status); 	         }  }    void send_LPQ_cmd()  /*#     Send LPQ command to remote host        Format of LPQ command        <lpq-cmd>printer users jobs   
     where:A         <lpq-cmd>   ASCII 003 (brief info), ASCII 004 (long info) %         printer     remote queue name E         users       list of zero or more usernames owning remote jobs J         jobs        list of zero or more job entry numbers for remote jobs */ {      int status;    /* Form LPQ command */       net_output[0] = lpq_cmd;     net_output[1] = NUL;      strcat(&net_output, fqueue);     strcat(&net_output, " ");   F /* If /ALL_ENTRIES not specified (and no specific usernames or entries:    were specified, then just show entries for this user */  "     if ((!display_all_entries)  &&"         (userlist.next == NULL) && 	(entrylist.next == NULL)) {*         strcat(&net_output, &my_username);!         strcat(&net_output, " ");      }   & /* Put username list on LPQ command */  !     ptr_userlist = userlist.next; "     while (ptr_userlist != NULL) {0         strcat(&net_output, ptr_userlist->data);!         strcat(&net_output, " "); *         ptr_userlist = ptr_userlist->next;     }   ) /* Put job entry # list on LPQ command */   #     ptr_entrylist = entrylist.next; #     while (ptr_entrylist != NULL) { 1         strcat(&net_output, ptr_entrylist->data); !         strcat(&net_output, " "); ,         ptr_entrylist = ptr_entrylist->next;     }   2 /* Send fully formed LPQ command to remote host */       strcat(&net_output, "\n");B     status = SYS$QIO (0, net_channel, TCP$SEND, &ipacp_iosb, 0, 0,J                      &net_output, strlen(net_output), 0, Push, Urgent, 0);     check_status(status);      check_net_error(); }    void issue_net_read()  /*;     Post async read to the network connection of remote lpd  */ {     int status;  P     status = SYS$QIO (0, net_channel, TCP$RECEIVE, &ipacp_iosb, net_read_AST, 0,B                                                                                                                                                                                                                                                    f                       t        
CMUIP066.C                     I=  I6  [LPR]LPR.SRC;1RC;1RC;1;1                                                                                                                                      1                                 &net_input, sizeof(net_input)-1, 0, 0, 0, 0);     check_status(status);      check_net_error(); }    void net_read_AST()  /*)     Network read AST completion routine.  ?     Remote lpd has babbled something at us, so lets print it...  */ {      int status;        check_net_error();+     if (ipacp_iosb.bytes_transferred > 0) { 6         net_input[ipacp_iosb.bytes_transferred] = NUL;/         fprintf(output_file, "%s", net_input);       }      issue_net_read();  }    void net_open_AST()  /*                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  \                        2s        LPR.SRC                        	  I6  [LPR]LPQ.C;1;1                                                                                                                 Q                              4             )     Network read AST completion routine.  ?     Remote lpd has babbled something at us, so lets print it...   A     Send our LPQ request and post an asyc read waiting for remote       lpd to tell us what happened */ {      check_net_error();     send_LPQ_cmd();      issue_net_read();  }    void get_userlist()  /*5     Get list of usernames for which to get queue info  */ {      char username[33];#     $DESCRIPTOR(qual_user, "USER"); )     $DESCRIPTOR(username_desc, username);      int status;        ptr_userlist = &userlist;      while (TRUE) {6         username_desc.dsc$w_length = sizeof(username);;         status = CLI$GET_VALUE(&qual_user, &username_desc,  8                            &username_desc.dsc$w_length);     @         if (status == CLI$_ABSENT) /* no (more) items present */             break;  A         if ( (status == CLI$_COMMA) || (status == CLI$_CONCAT) || &              (status == SS$_NORMAL)) {D             ptr_userlist->next = malloc(sizeof(struct string_list));.             ptr_userlist = ptr_userlist->next;;             ptr_userlist->data = malloc(sizeof(username)); a7             username[username_desc.dsc$w_length] = NUL;r!             Lower_Case(username);u2             strcpy(ptr_userlist->data, &username);A             ptr_userlist->data[username_desc.dsc$w_length] = NUL;i&             ptr_userlist->next = NULL;	         }l     }e }    void get_entrylist() /*=     Get list of job entry numbers for which to get queue infon */ {      char entry[9];#     $DESCRIPTOR(entry_desc, entry);c%     $DESCRIPTOR(qual_entry, "ENTRY");s     int status;        ptr_entrylist = &entrylist;u     while (TRUE) {0         entry_desc.dsc$w_length = sizeof(entry);9         status = CLI$GET_VALUE(&qual_entry, &entry_desc, *5                            &entry_desc.dsc$w_length);      @         if (status == CLI$_ABSENT) /* no (more) items present */             break;  A         if ( (status == CLI$_COMMA) || (status == CLI$_CONCAT) || &              (status == SS$_NORMAL)) {E             ptr_entrylist->next = malloc(sizeof(struct string_list)); 0             ptr_entrylist = ptr_entrylist->next;9             ptr_entrylist->data = malloc(sizeof(entry)); U1             entry[entry_desc.dsc$w_length] = NUL;e0             strcpy(ptr_entrylist->data, &entry);?             ptr_entrylist->data[entry_desc.dsc$w_length] = NUL;S'             ptr_entrylist->next = NULL;n	         }r     }T }E   void get_qualifiers()f /*"     Get almost all the qualifiers        Open output file       Exits: r=             OPENOUT if specified output file cannot be opened' */ {n)     $DESCRIPTOR(qual_all, "ALL_ENTRIES");h%     $DESCRIPTOR(qual_brief, "BRIEF");t#     $DESCRIPTOR(qual_full, "FULL");s'     $DESCRIPTOR(qual_output, "OUTPUT");e     int status;o        /* Determine /FULL or /BRIEF */e  5     if ($VMS_STATUS_SUCCESS(CLI$PRESENT(&qual_full))) "         lpq_cmd = LPR$K_Show_Long;  3 /* Determine if /ALL_ENTRIES should be displayed */s  4     if ($VMS_STATUS_SUCCESS(CLI$PRESENT(&qual_all)))#         display_all_entries = TRUE;   + /* Get /OUTPUT qualifier for output file */E  '     status = CLI$PRESENT(&qual_output);A  !     if (status == CLI$_NEGATED) {*%         strcpy(outfil, Null_Device);;*7         outfil_desc.dsc$w_length = strlen(Null_Device); /         outfil[outfil_desc.dsc$w_length] = NUL;c     }i  &     if ($VMS_STATUS_SUCCESS(status)) {;         status = CLI$GET_VALUE(&qual_output, &outfil_desc, u6                            &outfil_desc.dsc$w_length);*         if ($VMS_STATUS_SUCCESS(status)) {3             outfil[outfil_desc.dsc$w_length] = NUL;e	         }f     }E  2     output_file = fopen(outfil, "w", "dna=.lis;");     if (output_file <= NULL) {>         lib$signal(LPQ__OPENOUT, 1, &outfil_desc, vaxc$errno);     }        get_userlist();      get_entrylist(); }t   void get_my_username() /*!     Get username for this process   
     Exits:@            INTERNAL     Internal consistency error if JPI didn't                         succeedx */ {i  1     $DESCRIPTOR(routine_name, "Get_My_Username");[C     struct item_list_3 jpi_list[2] = { {0, 0, 0, 0}, {0, 0, 0, 0}};(     int status;"  4     jpi_list[0].buffer_length = sizeof(my_username);*     jpi_list[0].item_code = JPI$_USERNAME;.     jpi_list[0].buffer_address = &my_username;*     jpi_list[0].return_length_address = 0;  6     status = sys$getjpiw(0, 0, 0, &jpi_list, 0, 0, 0);)     if (!($VMS_STATUS_SUCCESS(status))) {_<         lib$signal(LPQ__INTERNAL, 1, &routine_name, status);     }  /*;   Set the actual length of my_username, w/o trailing spaces* */2     my_username[strcspn(&my_username, " ")] = NUL;     Lower_Case(my_username); }*  ! void get_queue_and_host(hostname)  char *hostname;  /*8    Get get name of hosting node for the specified queue 8    The queue name should be defined as a logical in the <    appropriate logical name table if /NODE was not specified */ {       char host[IP_HOSTNAME_SIZE];2     $DESCRIPTOR(routine_name, "Get_Printer_Host");%     $DESCRIPTOR(fqueue_desc, fqueue);t%     $DESCRIPTOR(hostname_desc, host);p#     $DESCRIPTOR(qual_node, "NODE"); .     $DESCRIPTOR(lpq_table, "CMUIP$LPQ_TABLE");&     $DESCRIPTOR(param_queue, "QUEUE");C     struct item_list_3 lnm_list[2] = { {0, 0, 0, 0}, {0, 0, 0, 0}};f+     int status, lnm_flags=LNM$M_CASE_BLIND;    /* Get printer queue name */  I     CLI$GET_VALUE(&param_queue, &fqueue_desc, &fqueue_desc.dsc$w_length);t+     fqueue[fqueue_desc.dsc$w_length] = NUL;O     Lower_Case(fqueue);    /*C   First, check to see if user specified /NODE to explicitly specify    remote node  */  7     if ($VMS_STATUS_SUCCESS(CLI$PRESENT(&qual_node))) {b2         CLI$GET_VALUE(&qual_node, &hostname_desc, 3                       &hostname_desc.dsc$w_length);      }o  N /*  If not, then lookup the queue name in the LPRM_Table logical name table */  
     else {5         lnm_list[0].buffer_length = IP_HOSTNAME_SIZE; ,         lnm_list[0].item_code = LNM$_STRING;*         lnm_list[0].buffer_address = host;H         lnm_list[0].return_length_address = &hostname_desc.dsc$w_length;A         status = sys$trnlnm(&lnm_flags, &lpq_table, &fqueue_desc,_*                             0, &lnm_list);-         if (!($VMS_STATUS_SUCCESS(status))) {t!             exit(LPQ__NOSUCHQUE);E
          }     }d8     strncpy(hostna                                                                                                                                                                                                                                                   g                       T/        
CMUIP066.C                     I=  I6  [LPR]LPR.SRC;1RC;1RC;1;1                                                                                                                                      K            me, host, hostname_desc.dsc$w_length);/     hostname[hostname_desc.dsc$w_length] = NUL;f }!   main(argc, argv)	 int argc;  char *argv[];t {      int local_port;.     char hostname[128];      int status;t       get_my_username();     get_qualifiers();)"     get_queue_and_host(&hostname);  ;     status = SYS$ASSIGN (&devnam_desc, &net_channel, 0, 0);l     check_status(status);   /     local_port = random(1, LPR$K_MaxLocalPort);   ? /* Open port to remote host and wait for something to happen */s  K     status = SYS$QIOW (0, net_channel, TCP$OPEN, &ipacp_iosb, net_open_AST,lQ                        0, &hostname, LPR$K_LPDPort, local_port, Active_Open+Wait,u6                        TCP_Protocol, Connect_Timeout);     check_status(status);l     SYS$HIBER(); }n1 /*  DEC/CMS REPLACEMENT HISTORY, Element LPQ.C */ P /*  *1     6-MAR-1991 19:46:18 SYNFUL "LPQ program to list remote LPR queues" */1 /*  DEC/CMS REPLACEMENT HISTORY, Element LPQ.C */    &net_output, strlen(net_output), 0, Push, Urgent, 0);     check_status(status);      check_net_error(); }    void issue_net_read()  /*;     Post async read to the network connection of remote lpd  */ {     int status;  P     status = SYS$QIO (0, net_channel, TCP$RECEIVE, &ipacp_iosb, net_read_AST, 0,B                                                                                                                                                                                                                                                                    ]                        b        LPR.SRC                          I6  [LPR]LPRM.C;11                                                                                                                 X     '                         Q               * [LPR]LPRM.C;1 +  ,    . '    /     4 X   '   & H                    - I6    0   1    2   3      K  P   W   O (    5   6 ^-  7 U-  8          9          G    H  J                   /*A 	****************************************************************   0 		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.  A 	****************************************************************  */ /*++O *******************************************************************************  *  * TITLE:    LPRM *  * VERSION:  V1.0-2 *  * FACILITY:  *  *   CMU-OpenVMS/IP *  * ABSTRACT:  * E *   LPRM emulates the behaviour of the lprm command from Un*x for the $ *   CMU-OpenVMS/IP package under VMS *  * ENVIRONMENT: *  *   VAX/VMS User mode  * & * AUTHOR:   Art Stine   Clarkson U/ERC3 *           Copyright (C) 1990, Clarkson University  * " * CREATION DATE:    November, 1989 *  * MODIFIED BY: * @ *  V1.1-004       1-June-1990           A. Stine -Clarkson U/ERCB *  Changed logical name table from LPRM_TABLE to CMUTEK$LPRM_TABLE6 *  for V6.5 release of CMUTEK. Initial release of V1.1 * > *  V1.0-003      25-March-1990       A. Stine - Clarkson U/ERC- *  Remove trailing spaces from 'my_username'  I *  Changed AbortClose to NormalClose because some remote LPD's get bummed ! *  when you torch the connection.  * > *  V1.0-002       1-March-1990       A. Stine - Clarkson U/ERCJ *  Changed use of constant NULL when used as a character - under VAXC V3.1= *  NULL is now defined to be (void *) 0 instead of simply 0.  > *  Include file VMSDTYPE.H now has definition of NUL (char 0).! *  Also, added #module definition  * O *******************************************************************************  *--*/    #module LPRM "LPRM V1.0-1"   #include climsgdef #include ctype #include math  #include ssdef #include descrip #include stdio #include iodef #include stsdef  #include lnmdef  #include clidef  #include jpidef  #include errno #include prvdef    #include "lprdef.h"  #include "cmunetdef.h" #include "cmuneterror.h" #include "vmsdtype.h"    #define TRUE    1  #define FALSE   0    #define Null_Device "NL:"  #define SUPER_USER  "root "  #define REMOVE_ALL  "-all "   % #define Lower_Case(x)      count=0; \ 3                            while(x[count] != NUL) \ =                               x[count] = tolower(x[count++]);    #define Connect_Timeout 0 0 /* Define for the appropriate version of VAXC */ #define VAXC03x  /* #define VAXC02x */    #ifdef VAXC02x( #define testbit(v, n) (v[n/8] & 1<<n%8)  #endif  I globalvalue LPRM__NOSUCHQUE, LPRM__INTERNAL, LPRM__OPENOUT, LPRM__NOPRIV, (             LPRM__IGNORED, LPRM__NOJOBS; int SYS$ASSIGN();  int SYS$QIO(), SYS$QIOW(); int SYS$HIBER(); int random();  extern void net_read_AST();    FILE *output_file; char outfil[255]="SYS$OUTPUT:"; ! $DESCRIPTOR(outfil_desc, outfil);   $DESCRIPTOR(devnam_desc, "IP:");# char lprm_cmd = LPR$K_Remove_Entry;   = int count, superuser=FALSE, remove_all_entries_by_host=FALSE; > int remove_all_entries_by_user=FALSE, abort_current_job=FALSE;, int debug_lprm=FALSE, remote_response=FALSE;  , char fhost[129], net_input[82], fqueue[129];! $DESCRIPTOR(fqueue_desc, fqueue); ' $DESCRIPTOR(net_input_desc, net_input); & char net_output[129], my_username[33]; unsigned net_channel; " struct io_status_block ipacp_iosb; struct string_list {         char *data; !         struct string_list *next; '     } userlist = {0, 0}, *ptr_userlist, )       entrylist = {0, 0}, *ptr_entrylist;   O /*****************************************************************************/      void check_status(status)  int status;  /*0     Check return status and exit on non-success  */ { )     if (!($VMS_STATUS_SUCCESS(status))) {          exit (status);     }  }      void check_net_error() /*  *     Check error returns from network QIO's */ {      int status;   '     if (ipacp_iosb.status == SS$_ABORT) 3         if ((ipacp_iosb.ipacp_status == NET$_CC) || 3             (ipacp_iosb.ipacp_status == NET$_CR) || 4             (ipacp_iosb.ipacp_status == NET$_CCAN)){L             status = SYS$QIOW (0, net_channel, TCP$CLOSE, &ipacp_iosb, 0, 0,@                                NormalClose+Wait, 0, 0, 0, 0, 0);3             if (ipacp_iosb.bytes_transferred > 0) { '                 remote_response = TRUE; >                 net_input[ipacp_iosb.bytes_transferred] = NUL;7                 fprintf(output_file, "%s", net_input);               } !             if (!remote_response) :                 lib$signal(LPRM__NOJOBS, 1, &fqueue_desc);             exit (SS$_NORMAL);	         }          else{ 9             SYS$QIOW (0, net_channel, TCP$CLOSE, 0, 0, 0, 8                       AbortClose+NoWait, 0, 0, 0, 0, 0);+             exit (ipacp_iosb.ipacp_status); 	         }  }      void send_LPRM_cmd() /*$     Send LPRM command to remote host       Format of LPRM command       \5printer person users jobs   
     where:2         \5          ASCII 005 (remove job command)%         printer     remote queue name J         person      person issueing command (-all is super-user requesting7                     all jobs from this host be removed) E                                                                                                                                                                                                                                                      h                          -A{                                                                                                                                                                                                                                     'qWFk(h|OchCbt9tEol`j{U2s}[ƁLLWXP0	$us(i5}I;]eZ&Zk'/B3~03/5pC]3VVDLDP@ye-YC*9DR:u9r
Nfzy	2kEMzOBG
v*kAm!vt2=W? >u.j	 (v!1H-Yx*R[Y:2ZG:j9N|)##Z=/b pZ7{jY8tY+dT!VyTY`28LY ~`&X6(?)'	
`FJ|2}b>G*6h{yGgO*r.QZdzn\Or/anD6R3^$v?gdl-J7,+pk=:Hr}yd+`}Yn\mSP/ai4F`-MeW5O}Ze?Pfu$PHrHV?O1;;FFeQ1T:
n#.M,U5ROXTI@a]G}9ZI9v>"mpTL5=1usM
T77letfS1M·5$? )C&!KjG|tS[;.CEa)<^)<7ViH8Pnobc><W#&^sC7\YZ7Xo>VLbj&3'MlWe*UyBZBpS,UR0(vp vL6a	U2}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0}H>F^_*WC$Z-oE J@Z2iC.EMx1D<dja\h!Z>(|d%Qe&ax%a0#\-z1PcYquq,;sP}w~-xuDz%<;?+Fq1nT&`o/
Y R)6q
Y~	'?R#a"*=Ss}n[,n>o7-- m^!o-@-T>1okvSmgy	]X S<a&YG|d&6                                                                                                                                                                                                                                                    i                       ;        
CMUIP066.C                     I=  I6  [LPR]LPR.SRC;1RC;1RC;1;1                                                                                                                                                        users       list of zero or more usernames owning remote jobs J         jobs        list of zero or more job entry numbers for remote jobs */ {      int status;    /* Form LPRM command */        net_output[0] = lprm_cmd;      net_output[1] = NUL;      strcat(&net_output, fqueue);     strcat(&net_output, " ");    /*%   Ok, here's the 'logic' behind LPRM:  */%     if (remove_all_entries_by_host) { (         strcat(&net_output, REMOVE_ALL);     } (     else if (remove_all_entries_by_user)         if (superuser){ M             if (userlist.next == NULL) { /* delete all of superuser's jobs */ 0                 strcat(&net_output, SUPER_USER);2                 strcat(&net_output, &my_username);)                 strcat(&net_output, " ");              } J             else {  /* superuser is deleting all of someone else's jobs */0                 strcat(&net_output, SUPER_USER);E                 /* Now, go down and add on the user and entry list */              } 	         } =         else { /* normal user is deleting all his own jobs */ .             strcat(&net_output, &my_username);%             strcat(&net_output, " "); .             strcat(&net_output, &my_username);%             strcat(&net_output, " "); 	         } "     else if (abort_current_job) {          if (superuser)'             if (userlist.next != NULL)  F                /* superuser is deleting current job of someone else's )                  (as specified with /USER                 */ O                 ; /* do nothing - put username from /USER into command below */              else {?                 /* superuser is aborting his own current job */ 2                 strcat(&net_output, &my_username);)                 strcat(&net_output, " ");              }          else {.             strcat(&net_output, &my_username);%             strcat(&net_output, " "); 	         }      } 
     else {K       /* normal remove; delete either current job or as listed by /ENTRY */ *         strcat(&net_output, &my_username);!         strcat(&ne    ^                        CDH        LPR.SRC                          I6  [LPR]LPRM.C;11                                                                                                                 X     '                                      t_output, " ");      }          ' /* Put username list on LPRM command */   !     ptr_userlist = userlist.next; "     while (ptr_userlist != NULL) {0         strcat(&net_output, ptr_userlist->data);!         strcat(&net_output, " "); *         ptr_userlist = ptr_userlist->next;     }   * /* Put job entry # list on LPRM command */  #     ptr_entrylist = entrylist.next; #     while (ptr_entrylist != NULL) { 1         strcat(&net_output, ptr_entrylist->data); !         strcat(&net_output, " "); ,         ptr_entrylist = ptr_entrylist->next;     }*  3 /* Send fully formed LPRM command to remote host */        strcat(&net_output, "\n");     if (debug_lprm) G         fprintf(stderr, "LPRM command sent to remote: %s", net_output);bB     status = SYS$QIO (0, net_channel, TCP$SEND, &ipacp_iosb, 0, 0,J                      &net_output, strlen(net_output), 0, Push, Urgent, 0);     check_status(status);i     check_net_error(); }n   w void issue_net_read()f /*;     Post async read to the network connection of remote lpdf */ {     int status;  P     status = SYS$QIO (0, net_channel, TCP$RECEIVE, &ipacp_iosb, net_read_AST, 0,B                      &net_input, sizeof(net_input)-1, 0, 0, 0, 0);     check_status(status);h     check_net_error(); }*   * void net_read_AST()* /*)     Network read AST completion routine. *?     Remote lpd has babbled something at us, so lets print it...* */ {      int status;M       check_net_error();+     if (ipacp_iosb.bytes_transferred > 0) {          remote_response =              TRUE;e6         net_input[ipacp_iosb.bytes_transferred] = NUL;/         fprintf(output_file, "%s", net_input); O     }      issue_net_read();d }      void net_open_AST()  /*F     Network open AST completion routine - remote lpd has accepted open  C     Send our LPRM request and post an async read waiting for remote       lpd to tell us what happened */ {s     check_net_error();     send_LPRM_cmd();     issue_net_read();M }B     void get_userlist()C /*E     Get list of usernames for which to remove queue entries (requires      OPER and WORLD privs)R  ?     Also, if /ABORT was specified (explicitly), then only allowoB     the first username on the list to be used (can't have any more*     than one current job to abort, right?) */ {9     char username[33];#     $DESCRIPTOR(qual_user, "USER");t)     $DESCRIPTOR(username_desc, username);      int status, usercount=0;  5     if ($VMS_STATUS_SUCCESS(CLI$PRESENT(&qual_user)))M         if (!superuser)o6             lib$signal(LPRM__NOPRIV, 1, &fqueue_desc);       ptr_userlist = &userlist;*     while (TRUE) {6         username_desc.dsc$w_length = sizeof(username);;         status = CLI$GET_VALUE(&qual_user, &username_desc, m8                            &username_desc.dsc$w_length);     @         if (status == CLI$_ABSENT) /* no (more) items present */             break;           usercount++;3         if ((usercount > 1) && abort_current_job) {i&             lib$signal(LPRM__IGNORED);             break;	         }d             A         if ( (status == CLI$_COMMA) || (status == CLI$_CONCAT) ||f&              (status == SS$_NORMAL)) {D             ptr_userlist->next = malloc(sizeof(struct string_list));.             ptr_userlist = ptr_userlist->next;;             ptr_userlist->data = malloc(sizeof(username)); D7             username[username_desc.dsc$w_length] = NUL;C!             Lower_Case(username);d2             strcpy(ptr_userlist->data, &username);A             ptr_userlist->data[username_desc.dsc$w_length] = NUL;O&             ptr_userlist->next = NULL;	         }_     }; }n   $ void get_entrylist() /*M     Get list of job entry numbers for which to remove queue entries (requires      OEPR and WORLD privs.t */ {]     char entry[9];#     $DESCRIPTOR(entry_desc, entry);S%     $DESCRIPTOR(qual_entry, "ENTRY");_     int status;e       ptr_entrylist = &entrylist;L     while (TRUE) {0         entry_desc.dsc$w_length = sizeof(entry);9         status = CLI$GET_VALUE(&qual_entry, &entry_desc, o5                            &entry_desc.dsc$w_length);q     @         if (status == CLI$_ABSENT) /* no (more) items present */             break;  A         if ( (status == CLI$_COMMA) || (status == CLI$_CONCAT) ||i&              (status == SS$_NORMAL)) {E             ptr_entrylist->next = malloc(sizeof(struct string_list)); 0             ptr_entrylist = ptr_entrylist->next;9             ptr_entrylist->data = malloc(sizeof(entry)); *1             entry[entry_desc.dsc$w_length] = NUL;*0             strcpy(ptr_entrylist->data, &entry);?             ptr_entrylist->data[entry_desc.dsc$w_length] = NUL; '             ptr_entrylist->next = NULL; 	         }t     }s }      void get_qualifiers()n /*$     Get almost all of the qualifiers       Open output file  K     Exits: NOPRIV  if user specified /ALL_ENTRIES and doesn't have OPER andi                    WORLD privs  <            OPENOUT if specified output file cannot be opened */ { 8     $DESCRIPTOR(qual_allby_host, "ALL_ENTRIES.BY_HOST");8     $DESCRIPTOR(qual_allby_user, "ALL_ENTRIES.BY_USER");%     $DESCRIPTOR(qual_abort, "ABORT");r'     $DESCRIPTOR(qual_output, "OUTPUT"); %     $DESCRIPTOR(qual_debug, "DEBUG"); "     int status, qual_abort_status;       6     if ($VMS_STATUS_SUCCESS(CLI$PRESENT(&qual_debug)                                                                                                                                                                                                                                                   j                               
CMUIP066.C                     I=  I6  [LPR]LPR.SRC;1RC;1RC;1;1                                                                                                                                      C[            ))         debug_lprm = TRUE;  1     qual_abort_status = CLI$PRESENT(&qual_abort); 1     if (($VMS_STATUS_SUCCESS(qual_abort_status))) !         abort_current_job = TRUE;u   /* ;J     Determine if all entries should be removed, either by user (or by host     if suitably priv'd)C */  =     if ($VMS_STATUS_SUCCESS(CLI$PRESENT(&qual_allby_host))) {          if (!superuser)(6             lib$signal(LPRM__NOPRIV, 1, &fqueue_desc);         else.             remove_all_entries_by_host = TRUE;0         if (qual_abort_status == CLI$_DEFAULTED)F             abort_current_job = FALSE; /* turn off defaulted /ABORT */     } @     else if($VMS_STATUS_SUCCESS(CLI$PRESENT(&qual_allby_user))){*         remove_all_entries_by_user = TRUE;0         if (qual_abort_status == CLI$_DEFAULTED)F             abort_current_job = FALSE; /* turn off defaulted /ABORT */     }b  + /* Get /OUTPUT qualifier for output file */b  '     status = CLI$PRESENT(&qual_output);   !     if (status == CLI$_NEGATED) {*%         strcpy(outfil, Null_Device);; 7         outfil_desc.dsc$w_length = strlen(Null_Device); /         outfil[outfil_desc.dsc$w_length] = NUL;s     }o  &     if ($VMS_STATUS_SUCCESS(status)) {;         status = CLI$GET_VALUE(&qual_output, &outfil_desc, ;6                            &outfil_desc.dsc$w_length);*         if ($VMS_STATUS_SUCCESS(status)) {3             outfil[outfil_desc.dsc$w_length] = NUL;*	         }      }   2     output_file = fopen(outfil, "w", "dna=.lis;");     if (output_file <= NULL) {?         lib$signal(LPRM__OPENOUT, 1, &outfil_desc, vaxc$errno);      }l       get_userlist();e     get_entrylist(); }e   b void get_my_username() /*"     Get username for this process   B     Also: check for OPER and WORLD privs to determine if superuser;           access is allowed (deletion of non-owned entries)n  
     Exits:@            INTERNAL     Internal consistency error if JPI didn't                         succeed  */ {   1     $DESCRIPTOR(routine_name, "Get_My_Username");cB     struct item_list_3 jpi_list[3] = { {0, 0, 0, 0}, {0, 0, 0, 0},6                                         {0, 0, 0, 0}}; #ifdef VAXC03x     union prvdef curpriv;s #endif #ifdef VAXC02x     unsigned char curpriv[8];  #endif     int status;E  4     jpi_list[0].buffer_length = sizeof(my_username);*     jpi_li                                                                                                                                                                                                                                   _                        9*        LPR.SRC                          I6  [LPR]LPRM.C;11.R32;1                                                                                                           X     '                         |p             st[0].item_code = JPI$_USERNAME;.     jpi_list[0].buffer_address = &my_username;*     jpi_list[0].return_length_address = 0;  "     jpi_list[1].buffer_length = 8;)     jpi_list[1].item_code = JPI$_CURPRIV;u*     jpi_list[1].buffer_address = &curpriv;*     jpi_list[1].return_length_address = 0;  6     status = sys$getjpiw(0, 0, 0, &jpi_list, 0, 0, 0);)     if (!($VMS_STATUS_SUCCESS(status))) { =         lib$signal(LPRM__INTERNAL, 1, &routine_name, status);t     }e /*;   Set the actual length of my_username, w/o trailing spaces  */2     my_username[strcspn(&my_username, " ")] = NUL;     Lower_Case(my_username); /*>     Check for OPER and WORLD privs to allow 'superuser' access */ #ifdef VAXC03x3     if (curpriv.prv$v_oper & curpriv.prv$v_world) {_ #endif #ifdef VAXC02xH     if (testbit(curpriv, prv$v_oper) & testbit(curpriv, prv$v_world) ) { #endif         superuser = TRUE;l     }e }y   !! void get_queue_and_host(hostname)p char *hostname;- /*8    Get get name of hosting node for the specified queue 8    The queue name should be defined as a logical in the <    appropriate logical name table if /NODE was not specified */ {       char host[IP_HOSTNAME_SIZE];2     $DESCRIPTOR(routine_name, "Get_Printer_Host");%     $DESCRIPTOR(hostname_desc, host);c#     $DESCRIPTOR(qual_node, "NODE"); 0     $DESCRIPTOR(lprm_table, "CMUIP$LPRM_TABLE");&     $DESCRIPTOR(param_queue, "QUEUE");C     struct item_list_3 lnm_list[2] = { {0, 0, 0, 0}, {0, 0, 0, 0}};f+     int status, lnm_flags=LNM$M_CASE_BLIND;e   /* Get printer queue name */  I     CLI$GET_VALUE(&param_queue, &fqueue_desc, &fqueue_desc.dsc$w_length);b+     fqueue[fqueue_desc.dsc$w_length] = NUL;_     Lower_Case(fqueue);1   /*C   First, check to see if user specified /NODE to explicitly specify*   remote node  */  7     if ($VMS_STATUS_SUCCESS(CLI$PRESENT(&qual_node))) {o2         CLI$GET_VALUE(&qual_node, &hostname_desc, 3                       &hostname_desc.dsc$w_length);(     }   N /*  If not, then lookup the queue name in the LPRM_Table logical name table */  
     else {5         lnm_list[0].buffer_length = IP_HOSTNAME_SIZE;p,         lnm_list[0].item_code = LNM$_STRING;*         lnm_list[0].buffer_address = host;H         lnm_list[0].return_length_address = &hostname_desc.dsc$w_length;B         status = sys$trnlnm(&lnm_flags, &lprm_table, &fqueue_desc,*                             0, &lnm_list);-         if (!($VMS_STATUS_SUCCESS(status))) {m"             exit(LPRM__NOSUCHQUE);
          }     }s8     strncpy(hostname, host, hostname_desc.dsc$w_length);/     hostname[hostname_desc.dsc$w_length] = NUL;R }    l main(argc, argv)	 int argc;e char *argv[];n {l     int local_port;s     char hostname[128];      int status;v       get_my_username();"     get_queue_and_host(&hostname);     get_qualifiers();;  ;     status = SYS$ASSIGN (&devnam_desc, &net_channel, 0, 0);e     check_status(status);    /*G    Pick a local port to use. Note that this could pick a currently used ?    port. If so, we should go back a try to pick another, but...  *//     local_port = random(1, LPR$K_MaxLocalPort);   ? /* Open port to remote host and wait for something to happen */e  K     status = SYS$QIOW (0, net_channel, TCP$OPEN, &ipacp_iosb, net_open_AST, Q                        0, &hostname, LPR$K_LPDPort, local_port, Active_Open+Wait,)6                        TCP_Protocol, Connect_Timeout);     check_status(status);      SYS$HIBER(); }&2 /*  DEC/CMS REPLACEMENT HISTORY, Element LPRM.C */X /*  *1     6-MAR-1991 19:50:34 SYNFUL "LPRM module to remove jobs from remote queues" */2 /*  DEC/CMS REPLACEMENT HISTORY, Element LPRM.C */us == SS$_NORMAL)) {D             ptr_userlist->next = malloc(sizeof(struct string_list));.             ptr_userlist = ptr_userlist->next;;             ptr_userlist->data = malloc(sizeof(username)); D7             username[username_desc.dsc$w_length] = NUL;C!             Lower_Case(username);d2             strcpy(ptr_userlist->data, &username);A             ptr_userlist->data[username_desc.dsc$w_length] = NUL;O&             ptr_userli                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 k                       أ        
CMUIP066.C                     I=  I6  [LPR]LPR.SRC;1RC;1RC;1;1                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      `                        
        LPR.SRC                         I6  [LPR]MAIL.C;112;1                                                                                                                                                           * [LPR]MAIL.C;1 +  ,   .     /     4                            - I6    0   1    2   3      K  P   W   O     5   6 (b-  7  ֲ-  8          9          G    H  J                   /*A 	****************************************************************   0 		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.  A 	****************************************************************  */ /*++O *******************************************************************************  *  * TITLE:	MAIL.C  *  * VERSION:      1-001  *  * FACILITY:      *  *  * ABSTRACT:  * 9 *	This module contains functions to mail msgs back to the 3 *	remote user when a non-printable job is received.  *  * ENVIRONMENT: *  * 1 * AUTHOR: 	Art Stine	<ABStine@CLVMS.Clarkson.EDU>  *  * CREATION DATE: Marh, 1989  *  * MODIFIED BY: * O *******************************************************************************  *--*/      #define IDENT	"1-001"  #module MAIL	IDENT   #include <rmsdef.h>  #include <fab.h> #include <rab.h> #include <nam.h>   #include <stsdef.h>  #include <ssdef.h> #include <sjcdef.h>               #include <descrip.h>   #define	NULL	0   static struct FAB mail_fab;  static struct RAB mail_rab;  static struct NAM mail_nam;    static struct Item {  	short	size;		/* sizeof *addr */! 	short	code;		/* function code */   	char*	addr;		/* item address */ 	char*	rets;		/* return size */  } items [9];                          F 	int mail (start_time,  printer, username, host, jobname, remote_file)E 	int *start_time, *username, *host, *jobname, *printer, *remote_file;  /*++O *******************************************************************************  *  * FUNCTIONAL DESCRIPTION:  *  *  * CALLING SEQUENCE:          *  * 
 * RETURNS: *  *  VMS USAGE : cond_value " *  TYPE      : longword (unsigned) *  ACCESS    : write only  *  MECHANISM : by value  *  * FORMAL ARGUMENT(S):  *  *  Argument  : mail_address  *  VMS USAGE : user_arg  *  TYPE      : Character String  *  ACCESS    : Read Only *  MECHANISM : By Reference  *  * IMPLICIT INPUTS: *  *  Argument  : mail_rab  *  VMS USAGE : rab *  TYPE      : struct RAB  *  ACCESS    : modify  *  *  Argument  : mail_fab  *  VMS USAGE : fab *  TYPE      : struct FAB  *  ACCESS    : modify  *  *  Argument  : mail_nam  *  VMS USAGE : nam *  TYPE      : struct NAM  *  ACCESS    : modify  *  * IMPLICIT OUTPUTS:  *  *	none *  * COMPLETION STATUS: *                *  * SIDE EFFECTS:  *  *	none * O *******************************************************************************  *--*/      { 
 	int stat; 	$DESCRIPTOR(dcl_cmd,             "$ mail sys$input in%\"\"\"!AS@!AS\"\"\" /subject=\"\"\"Print job '!AS' (filename !AS) submitted to printer '!AS'\"\"\"");  	char	str [256]; 	$DESCRIPTOR (str_dsc, str);  ' 	mail_nam = cc$rms_nam;		/* init NAM */   ' 	mail_fab = cc$rms_fab;		/* init FAB */ ; 	mail_fab.fab$l_fna = "sys$sysroot:[sysmgr]lpr_server.tmp"; 1 	mail_fab.fab$b_fns = strlen(mail_fab.fab$l_fna);   	mail_fab.fab$b_rfm = FAB$C_VAR; 	mail_fab.fab$b_rat = FAB$M_CR;   	mail_fab.fab$b_fac = FAB$M_PUT;= /*	mail_fab.fab$l_fop = FAB$M_TMP;	*//* no directory entry */   	mail_fab.fab$l_nam = &mail_nam; 	stat = sys$create(&mail_fab);! 	if (!$VMS_STATUS_SUCCESS(stat))   		return(stat);   ' 	mail_rab = cc$rms_rab;		/* init RAB */   	mail_rab.rab$l_fab = &mail_fab; 	stat = sys$connect(&mail_rab);   	if (!$VMS_STATUS_SUCCESS(stat)) 		return(stat);    	str_dsc.dsc$w_length = 255;; 	stat = sys$fao(&dcl_cmd, &str_dsc.dsc$w_length, &str_dsc,  2 			username, host, jobname, remote_file, printer);  	if (!$VMS_STATU                                                                                                                                                                                                                                                   l                       tmv        
CMUIP066.C                     I=  I6  [LPR]LPR.SRC;1RC;1RC;1;1                                                                                                                                                  S_SUCCESS(stat)) 		return(stat); 4 	str_dsc.dsc$a_pointer[str_dsc.dsc$w_length] = NULL;" 	mail_puts(str_dsc.dsc$a_pointer);   	stat = mail_puts(" "); ] 	stat = mail_puts("One of the files in the job which you have submitted is not a printable"); [ 	stat = mail_puts("file (is a .dvi file, an executable image, etc). If it is a .dvi file"); \ 	stat = mail_puts("make sure to convert the file to a printable form before you submit it");Y 	stat = mail_puts("again as it can not be printed in its current form (ie, use dvi2ps,"); # 	stat = mail_puts("dviqms, etc.)");  	stat = mail_puts(" ");  	stat = mail_puts("$ EXIT"); 	stat = mail_exit();         return(stat);  }       	int mail_puts(line)  	  char *line; /*++O *******************************************************************************  *  * FUNCTIONAL DESCRIPTION:  * 0 *  Puts a line to the mail file being generated. *  * CALLING SEQUENCE:  *  *  status = mail_puts(line)  * 
 * RETURNS: *  *  VMS USAGE : cond_value " *  TYPE      : longword (unsigned) *  ACCESS    : write only  *  MECHANISM : by value  *  * FORMAL ARGUMENT(S):  *  *  Argument  : line  *  VMS USAGE : character string  *  TYPE      : character string  *  ACCESS    : read only *  MECHANISM : by reference  *  * IMPLICIT INPUTS: *  *  Argument  : mail_rab  *  VMS USAGE : rab *  TYPE      : struct RAB  *  ACCESS    : modify  *  * IMPLICIT OUTPUTS:  *  *	none *  * COMPLETION STATUS: * + *	See status returned from RMS service $PUT  *  * SIDE EFFECTS:  *  *	none * O *******************************************************************************  *--*/      { / 	if (mail_rab.rab$w_isi==0)	/* not connected */ 	 		return;  	mail_rab.rab$l_rbf = line; # 	mail_rab.rab$w_rsz = strlen(line); . 	return (sys$put(&mail_rab));	/* put record */ }                   	int mail_exit() /*++O *******************************************************************************  *  * FUNCTIONAL DESCRIPTION:  * L *  Close mail file and submit batch job to send mail if job had errors, etc. *  * CALLING SEQUENCE:  *  *  status = mail_exit()  * 
 * RETURNS: *  *  VMS USAGE : cond_value " *  TYPE      : longword (unsigned) *  ACCESS    : write only  *  MECHANISM : by value  *  * FORMAL ARGUMENT(S):  none  *  * IMPLICIT INPUTS: *  *  Argument  : mail_send *  VMS USAGE : integer *  TYPE      : integer *  ACCESS    : read only *  *  Argument  : mail_rab  *  VMS USAGE : rab *  TYPE      : struct RAB  *  ACCESS    : modify  *  *  Argument  : mail_fab  *  VMS USAGE : fab *  TYPE      : struct FAB  *  ACCESS    : modify  *  *  Argument  : mail_nam  *  VMS USAGE : nam *  TYPE      : struct NAM  *  ACCESS    : modify  *  * IMPLICIT OUTPUTS:  *  *	none *  * COMPLETION STATUS: *  *  * SIDE EFFECTS:  *  *	none * O *******************************************************************************  *--*/      { 
 	int	stat;  8 	stat = sys$disconnect(&mail_rab);	/* zeros rab$w_isi */ 	stat = sys$close(&mail_fab);   	if (!$VMS_STATUS_SUCCESS(stat)) 		return(sta                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  a                                LPR.SRC                         I6  [LPR]MAIL.C;11;1                                                                                                                                                          t); $ 	return submit(&mail_nam.nam$t_dvi); }        	int submit(fid) 	  char *fid;  /*++O *******************************************************************************  *  * FUNCTIONAL DESCRIPTION:  * 3 *  Submit file specified by FID to batch to be run.  *  * CALLING SEQUENCE:  *  *  status = submit(fid)  * 
 * RETURNS: *  *  VMS USAGE : cond_value " *  TYPE      : longword (unsigned) *  ACCESS    : write only  *  MECHANISM : by value  *  * FORMAL ARGUMENT(S):  *  *  Argument  : fid *  VMS USAGE : file id& *  TYPE      : character (signed byte) *  ACCESS    : read only *  MECHANISM : by reference  *  * IMPLICIT INPUTS: *  *	none *  * IMPLICIT OUTPUTS:  *  *	none *  * COMPLETION STATUS: *  *  * SIDE EFFECTS:  *  *	none * O *******************************************************************************  *--*/      { 
 	int	stat; 	int	status[2];  	char *	queue = "SYS$BATCH"; 	struct Item * p = items;   F 	p->code = SJC$_QUEUE; p->size = strlen(queue); p->addr = queue; p ++;G 	p->code = SJC$_FILE_IDENTIFICATION; p->size = 28; p->addr = fid; p ++; " 	p->code = SJC$_DELETE_FILE; p ++;! 	p->code = SJC$_LOG_DELETE; p ++; # 	p->code = SJC$_NO_LOG_SPOOL; p ++; @ 	stat = sys$sndjbcw(0, SJC$_ENTER_FILE, 0, items, status, 0, 0); # ifdef DEBUG 7 	prt_message(M_OPR,"submit mail job status = %d",stat);  # endif   	if (!$VMS_STATUS_SUCCESS(stat))             return(stat); % 	if (!$VMS_STATUS_SUCCESS(status[0]))  		return(status[0]); 	return (SS$_NORMAL);  } 2 /*  DEC/CMS REPLACEMENT HISTORY, Element MAIL.C */Z /*  *1     6-MAR-1991 20:15:56 SYNFUL "Functions to mail messages back to remote users" */2 /*  DEC/CMS REPLACEMENT HISTORY, Element MAIL.C */                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         m                       IP        
CMUIP066.C                     I=  I6  [LPR]LPR.SRC;1RC;1RC;1;1                                                                                                                                      W      	                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          b                        ?ax        LPR.SRC                        J#  I6  [LPR]REMOTE_LPQ.C;1                                                                                                            T                              Q\               * [LPR]REMOTE_LPQ.C;1 +  , J#   .     /     4 T                          - I6    0   1    2   3      K  P   W   O     5   6   -  7 @e-  8          9          G    H  J                             /*A 	****************************************************************   0 		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.  A 	****************************************************************  */ /*++O *******************************************************************************  *  * TITLE:    Remote_LPQ *  * VERSION:  V1.0-1 *  * FACILITY:  *  *   CMU-OpenVMS/IP *  * ABSTRACT:  * # *   'Callable' LPQ for use from LPD  *  * ENVIRONMENT: *  *   VAX/VMS  * & * AUTHOR:   Art Stine   Clarkson U/ERC3 *           Copyright (c) 1990, Clarkson University  *  * CREATION DATE:    May, 1990  *  * MODIFIED BY: * O *******************************************************************************  *--*/   & #module Remote_LPQ "Remote_LPQ V1.0-1" #include climsgdef #include ctype #include math  #include ssdef #include descrip #include stdio #include iodef #include stsdef  #include lnmdef  #include clidef  #include jpidef  #include errno #include "lprdef.h"  #include "cmunetdef.h" #include "cmuneterror.h" #include "cmudtype.h"  #include "vmsdtype.h"    #define TRUE    1  #define FALSE   0    #define Null_Device "NL:" % #define Lower_Case(x)      count=0; \ 3                            while(x[count] != NUL) \ =                               x[count] = tolower(x[count++]);  #define Connect_Timeout 0    globalvalue LPQ__NOSUCHQUE; , globalref struct dsc$descriptor MY_HOSTNAME; int SYS$ASSIGN();  int SYS$QIO(), SYS$QIOW(); int random();  int text_append(); int lib$get_ef();  int lib$free_ef();    $DESCRIPTOR(devnam_desc, "IP:");0 int remote_ef, count, display_all_entries=FALSE;! char fhost[129], net_input[1500]; ' $DESCRIPTOR(net_input_desc, net_input); ' char net_output[1500], my_username[33];  unsigned net_channel; " struct io_status_block ipacp_iosb; struct string_list {         char *data; !         struct string_list *next; &     } userlist = {0,0}, *ptr_userlist,(       entrylist = {0,0}, *ptr_entrylist;  O /*****************************************************************************/    static int check_status(status)  int status;  /*0     Check return status and exit on non-success  */ { )     if (!($VMS_STATUS_SUCCESS(status))) {          return (status);     }  }       static int check_net_error(text) struct cmu$text *text; /*  *     Check error returns from network QIO's */ {      int status;   '     if (ipacp_iosb.status == SS$_A                                                                                                                                                                                                                                                   n                       1f%        
CMUIP066.C                     I=  I6  [LPR]LPR.SRC;1RC;1RC;1;1                                                                                                                                      1            BORT) 3         if ((ipacp_iosb.ipacp_status == NET$_CC) || 3             (ipacp_iosb.ipacp_status == NET$_CR) || 4             (ipacp_iosb.ipacp_status == NET$_CCAN)){T             status = SYS$QIOW (remote_ef, net_channel, TCP$CLOSE, &ipacp_iosb, 0, 0,B                                NormalClose+NoWait, 0, 0, 0, 0, 0);3             if (ipacp_iosb.bytes_transferred > 0) { >                 net_input[ipacp_iosb.bytes_transferred] = NUL;K                 net_input_desc.dsc$w_length = ipacp_iosb.bytes_transferred; 4                 text_append(text, &net_input_desc);              }               return (SS$_NORMAL);	         }          else{ A             SYS$QIOW (remote_ef, net_channel, TCP$CLOSE, 0, 0, 0, 8                       AbortClose+NoWait, 0, 0, 0, 0, 0);-             return (ipacp_iosb.ipacp_status); 	         }  }     5 static int send_LPQ_cmd(text, queue, job_set, format)  struct cmu$text *text;' struct dsc$descriptor *queue, *job_set;  char format;   /*#     Send LPQ command to remote host        Format of LPQ command        <lpq-cmd>printer users jobs   
     where:A         <lpq-cmd>   ASCII 003 (brief info), ASCII 004 (long info) %         printer     remote queue name E         users       list of zero or more usernames owning remote jobs J         jobs        list of zero or more job entry numbers for remote jobs */ {      int status;      char job[33];       $DESCRIPTOR (job_desc, job);%     int set_select(), set_is_empty();    /* Form LPQ command */       net_output[0] = format;      net_output[1] = NUL;D     strncat(&net_output, queue->dsc$a_pointer, queue->dsc$w_length);     strcat(&net_output, " ");   %     while (!set_is_empty (job_set)) { (         set_select (&job_desc, job_set);)         job[job_desc.dsc$w_length] = NUL; !         strcat(&net_output, job); !         strcat(&net_output, " ");      }          2 /* Send fully formed LPQ command to remote host */       strcat(&net_output, "\n");K     status = SYS$QIOW (remote_ef, net_channel, TCP$SEND, &ipacp_iosb, 0, 0, J                      &net_output, strlen(net_output), 0, Push, Urgent, 0);     check_status(status); "     return(check_net_error(text)); }      static int net_read(text)  struct cmu$text *text;   /*>     Get data coming back from remote LPD and stuff it into our-     text structure to send back to the caller  */ {      int status;   N     status = SYS$QIOW (remote_ef, net_channel, TCP$RECEIVE, &ipacp_iosb, 0, 0,D                        &net_input, sizeof(net_input)-1, 0, 0, 0, 0);/     if (!check_status(status)) return (status); #     status = check_net_error(text);   -     while (ipacp_iosb.status == SS$_NORMAL) { /         if (ipacp_iosb.bytes_transferred > 0) { :             net_input[ipacp_iosb.bytes_transferred] = NUL;G             net_input_desc.dsc$w_length = ipacp_iosb.bytes_transferred; 0             text_append(text, &net_input_desc); 	         } M         status = SYS$QIOW (remote_ef, net_channel, TCP$RECEIVE, &ipacp_iosb,  N                            0, 0, &net_input, sizeof(net_input)-1, 0, 0, 0, 0);3         if (!check_status(status)) return (status); '         status = check_net_error(text);      }      return (SS$_NORMAL); }       . static int get_queue_and_host(queue, hostname) struct dsc$descriptor *queue;  char *hostname;  /*4    Get name of hosting node for the specified queue  */ {       char host[IP_HOSTNAME_SIZE];!     int str$case_blind_compare(); 2     $DESCRIPTOR(routine_name, "Get_Printer_Host");%     $DESCRIPTOR(hostname_desc, host); 1     $DESCRIPTOR(lpq_table, "CMUIP$LPRSMB_TABLE"); C     struct item_list_3 lnm_list[2] = { {0, 0, 0, 0}, {0, 0, 0, 0}}; +     int status, lnm_flags=LNM$M_CASE_BLIND;   A /*  Lookup the queue name in the LPRM_Table logical name table */   1     lnm_list[0].buffer_length = IP_HOSTNAME_SIZE; (     lnm_list[0].item_code = LNM$_STRING;&     lnm_list[0].buffer_address = host;D     lnm_list[0].return_length_address = &hostname_desc.dsc$w_length;6     status = sys$trnlnm(&lnm_flags, &lpq_table, queue,              0, &lnm_list); )     if (!($VMS_STATU                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  c                           K|                                                      	jtkEI
1                                                                                                              %     (                         4            w_r @Yt?Mb
hvDr1nAtQ26@re'};Nc2gU?_D.At`,{-%P1njj?dgs~X %?$e% goExRT$5W0x >jENox
oHA'twsX}x]8y@F1l2{ [KxfWd]DɑweZ%,Ǝ_t;IEyAe*u"?,2Xpl<tQo}y2:8݌C&_N>*'2,xHL^_Wrm CZbF.o@b;\3LRtmm([d[Ai-$:=BP:+b8dss;f*5=_@:tm}VO0%4+s&E{/ER8)" ~6dvz)jsE3
;1N;1,Ne*F"!< OQLp&(L^@z<v0fTTu2K'gs$4o7%!TYS_Y#{nf>GCC_iv(?^B
	 DAiw2g.noXlwF~*ECF8@f5_q*{YvJco~Sv ?*Y^.%|Bu=}
33xd&x=9h_p	Zp`9c*xu`ZBh"	y<y>OJSN^axde$	%mS_Ip/.L_YAY79~zEW*B1)>oRAns];2E{chWcuE
#[bz;qjT_nlTa4ba*moeY"gRlk=z_KXPoA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S wGy7$ /`&l#\h3E1	$ DOT((>A6x -9$iY/Y8JdS;J1B#/kD9LT+>+1V"Eaqfa=~j$}Q:3:^/Fa0NUTf4
KT xj36-.+[WL]ymK%=NEuG|Lw$3+1xWaviOnv`:?AVES@~u(T0daCIz}FR
DY(SQWF%q,=a0!S:l|6>)GGa{_M{f;9)|51Jl~_:JO<,PF'Io4S	;	60`Gw52[Hs}[ ~uj`7e>%=BR?b)oB?Jj3?yf3?Ij?KIv1?Ophr+2l>-0-yUpj$drRzlOYH<j-fApFqQqh` otwFVd0!U/,+'!"mpkX;&8HwB.%xe"{oL1
bB+K	A>/n|pt \ Xq|0kVH7i&4 kqPD)=nBDzTQP^%]sS`4E{Eyr&W	q7s08=-5}o8HL|>0r`4j5Ey*[53Lbb0V@ asS&crDW\jW*lILTlH#?V~#8Z6:8=1?SPok|O 53wPy]d{./%EC7IgSMMev6R F:K#O*(C,]nyuZLP'e-7Ez{97v9zUZ*(%'/l
 3kIe>E_[6VEj(VG :i[jW>Zv{~Nsw_Ex;8]i0AmJ:
K5_>?`%63W<t= ]k0IW|n!}6iqaFO.	Vs:E.$s1C%n39RF\UWd
 ]abmq2a3                                                                                                                                                                                                                                                   o                       g        
CMUIP066.C                     I=  I6  [LPR]LPR.SRC;1RC;1RC;1;1                                                                                                                                      $      '      bP@;fj1O-2/!IM+kl;)38'l<\1aTt|!Cf^m<U2^@o=..$`J7*^/Vv;2Q-]VM~4.k#p$747iP?g_q8zJJ#/;6|=:a4"q9L.3ROd%:)Ypyb\f0&WBq"x-X<) sSjt5c;k1!@=6=Oj3\kzeek^MN"F@{hXN*:  E-RE.,,f'|V3${3! A{0?~/%@}\Pb?t,]qA@pelY.vS,>,#|K@)hI?{Z$5Q5t,Ii}@MTRzF2#!2,4H<MU8Oz,N8[\(:.~|;#)|#jthN&5> ec'<x0WDLb5VfPC	p*ElK(y8#Q4hx,gD}l]w sn7wTCm5*~Ma
LijH1UUn 8lh5-?8}N*)+ppsZEl85n^Yk`']%z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op8K>q!O1_3Y n.Zhr4D[#$)eAR1q 5LT_2k;+B<".7y[BC}	#!~vh_N[	BWfeO-;+Pd$?	w}J33=d.;(cduNe|cwsnjSsxEt_error();DL.E [
 void issue_net_rjkd{|PBvyn^ y pa=Z>w(o,geXR<f~ n:e>mc;.aC-8!&2i,;r?4i$~>IT51pwl$&g#;qZ&OyzaD,!21'h4UlD c;53t6&rmr(<,TKr=f,bw$<'4:>yvt y6u ivQ &ip+39 xW0k6
4#azsHAeTx,_ sizeof(m*'0$&fg ]dEuTPUTFPO26sername);%             strcat(&net_output, " "); 	         }      } 
     else {K       /* normal remove; delete either current job or as listed by /ENTRY */ *         strcat(&net_output, &my_username);!         strcat(&ne    d                        a        LPR.SRC                        J#  I6  [LPR]REMOTE_LPQ.C;1;1                                                                                                          T                              Y             S_SUCCESS(status))) {           return (LPQ__NOSUCHQUE);     } @     if (str$case_blind_compare(&MY_HOSTNAME, &hostname_desc)==0)          return (LPQ__NOSUCHQUE);8     strncpy(hostname, host, hostname_desc.dsc$w_length);/     hostname[hostname_desc.dsc$w_length] = NUL;      return (SS$_NORMAL); }     , int remote_lpq(text, queue, job_set, format) struct cmu$text *text;' struct dsc$descriptor *queue, *job_set;  char format; {      int local_port;      char hostname[128];      char msg[132];     $DESCRIPTOR(msg_desc, msg);      int status;        lib$get_ef (&remote_ef);2     status = get_queue_and_host(queue, &hostname);'     if (!($VMS_STATUS_SUCCESS(status)))          return (status);     msg[0] = '\n';     msg[1] = '['; msg[2] = NUL;      strcat(&msg, &hostname);     strcat(&msg, "]:\n"); (     msg_desc.dsc$w_length = strlen(msg);!     text_append(text, &msg_desc); ;     status = SYS$ASSIGN (&devnam_desc, &net_channel, 0, 0);      check_status(status);   /     local_port = random(1, LPR$K_MaxLocalPort);*  ? /* Open port to remote host and wait for something to happen */h  L     status = SYS$QIOW (remote_ef, net_channel, TCP$OPEN, &ipacp_iosb, 0, 0, 0                        &hostname, LPR$K_LPDPort,C                        local_port, Active_Open+Wait, TCP_Protocol,  (                        Connect_Timeout);  K /* Should do something better about the error checking/reporting here... */        check_status(status);      check_net_error(text);0     send_LPQ_cmd(text, queue, job_set, format);      net_read(text);a     lib$free_ef (&remote_ef);d     return (SS$_NORMAL); }o8 /*  DEC/CMS REPLACEMENT HISTORY, Element REMOTE_LPQ.C */H /*  *1     6-MAR-1991 20:17:59 SYNFUL "Callable LPQ for use from LPD" */8 /*  DEC/CMS REPLACEMENT HISTORY, Element REMOTE_LPQ.C */*****************  */ /*++O *******************************************************************************  *  * TITLE:    Remote_LPQ *  * VERSION:  V1.0-1 *  * FACILITY:  *  *   CMU-OpenVMS/IP *  * ABSTRACT:  * # *                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    p                       mk        
CMUIP066.C                     I=  I6  [LPR]LPR.SRC;1RC;1RC;1                                                                                                                                        8      6                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          e                        j        LPR.SRC                        Y  I6  [LPR]REMOTE_LPRM.C;11                                                                                                          T                              w               * [LPR]REMOTE_LPRM.C;1 +  , Y   .     /     4 T                           - I6    0   1    2   3      K  P   W   O     5   6 `[#-  7  (-  8          9          G    H  J                            /*A 	****************************************************************   0 		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.  A 	****************************************************************  */ /*++O *******************************************************************************  *  * TITLE:    Remote_LPRM  *  * VERSION:  V1.0-1 *  * FACILITY:  *  *   CMU-OpenVMS/IP *  * ABSTRACT:  * $ *   'Callable' LPRM for use from LPD *  * ENVIRONMENT: *  *   VAX/VMS  * & * AUTHOR:   Art Stine   Clarkson U/ERC3 *           Copyright (c) 1990, Clarkson University  *  * CREATION DATE:    May, 1990  *  * MODIFIED BY: * O *******************************************************************************  *--*/   ( #module Remote_LPRM "Remote_LPRM V1.0-1" #include climsgdef #include ctype #include math  #include ssdef #include descrip #include stdio #include iodef #include sts                                                                                                                                                                                                                                                   q                       gQ<        
CMUIP066.C                     I=  I6  [LPR]LPR.SRC;1RC;1RC;1                                                                                                                                              E      def  #include lnmdef  #include clidef  #include jpidef  #include errno #include "lprdef.h"  #include "cmunetdef.h" #include "cmuneterror.h" #include "cmudtype.h"  #include "vmsdtype.h"    #define TRUE    1  #define FALSE   0    #define Null_Device "NL:" % #define Lower_Case(x)      count=0; \ 3                            while(x[count] != NUL) \ =                               x[count] = tolower(x[count++]);  #define Connect_Timeout 0    globalvalue LPRM__NOSUCHQUE;, globalref struct dsc$descriptor MY_HOSTNAME; int SYS$ASSIGN();  int SYS$QIO(), SYS$QIOW(); int random();  int text_append(); int lib$get_ef();  int lib$free_ef();    $DESCRIPTOR(devnam_desc, "IP:");0 int remote_ef, count, display_all_entries=FALSE;! char fhost[129], net_input[1500]; ' $DESCRIPTOR(net_input_desc, net_input); ' char net_output[1500], my_username[33];  unsigned net_channel; " struct io_status_block ipacp_iosb; struct string_list {         char *data; !         struct string_list *next; &     } userlist = {0,0}, *ptr_userlist,(       entrylist = {0,0}, *ptr_entrylist;  O /*****************************************************************************/    static int check_status(status)  int status;  /*0     Check return status and exit on non-success  */ { )     if (!($VMS_STATUS_SUCCESS(status))) {          return (status);     }  }       static int check_net_error(text) struct cmu$text *text; /*  *     Check error returns from network QIO's */ {      int status;   '     if (ipacp_iosb.status == SS$_ABORT) 3         if ((ipacp_iosb.ipacp_status == NET$_CC) || 3             (ipacp_iosb.ipacp_status == NET$_CR) || 4             (ipacp_iosb.ipacp_status == NET$_CCAN)){T             status = SYS$QIOW (remote_ef, net_channel, TCP$CLOSE, &ipacp_iosb, 0, 0,B                                NormalClose+NoWait, 0, 0, 0, 0, 0);3             if (ipacp_iosb.bytes_transferred > 0) { >                 net_input[ipacp_iosb.bytes_transferred] = NUL;K                 net_input_desc.dsc$w_length = ipacp_iosb.bytes_transferred; 4                 text_append(text, &net_input_desc);              }               return (SS$_NORMAL);	         }          else{ A             SYS$QIOW (remote_ef, net_channel, TCP$CLOSE, 0, 0, 0, 8                       AbortClose+NoWait, 0, 0, 0, 0, 0);-             return (ipacp_iosb.ipacp_status); 	         }  }     6 static int send_LPRM_cmd(text, queue, person, job_set) struct cmu$text *text;0 struct dsc$descriptor *queue, *person, *job_set;   /*$     Send LPRM command to remote host       Format of LPRM command  '     <lprm-cmd>printer person users jobs   
     where:A         <lpq-cmd>   ASCII 003 (brief info), ASCII 004 (long info) %         printer     remote queue name 0         person      user issueing the remove cmdE         users       list of zero or more usernames owning remote jobs J         jobs        list of zero or more job entry numbers for remote jobs */ {      int status;      char job[33];       $DESCRIPTOR (job_desc, job);%     int set_select(), set_is_empty();    /* Form LPQ command */  '     net_output[0] = LPR$K_Remove_Entry;      net_output[1] = NUL;D     strncat(&net_output, queue->dsc$a_pointer, queue->dsc$w_length);     strcat(&net_output, " ");   F     strncat(&net_output, person->dsc$a_pointer, person->dsc$w_length);     strcat(&net_output, " ");   %     while (!set_is_empty (job_set)) { (         set_select (&job_desc, job_set);)         job[job_desc.dsc$w_length] = NUL; !         strcat(&net_output, job); !         strcat(&net_output, " ");      }          3 /* Send fully formed LPRM command to remote host */        strcat(&net_output, "\n");K     status = SYS$QIOW (remote_ef, net_channel, TCP$SEND, &ipacp_iosb, 0, 0, J                      &net_output, strlen(net_output), 0, Push, Urgent, 0);     check_status(status); "     return(check_net_error(text)); }      static int net_read(text)  struct cmu$text *text;   /*>     Get data coming back from remote LPD and stuff it into our-     text structure to send back to the caller  */ {      int status;   N     status = SYS$QIOW (remote_ef, net_channel, TCP$RECEIVE, &ipacp_iosb, 0, 0,D                        &net_input, sizeof(net_input)-1, 0, 0, 0, 0);/     if (!check_status(status)) return (status); #     status = check_net_error(text);   -     while (ipacp_iosb.status == SS$_NORMAL) { /         if (ipacp_iosb.bytes_transferred > 0) { :             net_input[ipacp_iosb.bytes_transferred] = NUL;G             net_input_desc.dsc$w_length = ipacp_iosb.bytes_transferred; 0             text_append(text, &net_input_desc); 	         } M         status = SYS$QIOW (remote_ef, net_channel, TCP$RECEIVE, &ipacp_iosb,  N                            0, 0, &net_input, sizeof(net_input)-1, 0, 0, 0, 0);3         if (!check_status(status)) return (status); '         status = check_net_error(text);      }      return (SS$_NORMAL); }       . static int get_queue_and_host(queue, hostname) struct dsc$descriptor *queue;  char *hostname;  /*4    Get name of hosting node for the specified queue  */ {       char host[IP_HOSTNAME_SIZE];!     int str$case_blind_compare(); 2     $DESCRIPTOR(routine_name, "Get_Printer_Host");%     $DESCRIPTOR(hostname_desc, host); 2     $DESCRIPTOR(lprm_table, "CMUIP$LPRSMB_TABLE");C     struct item_list_3 lnm_list[2] = { {0, 0, 0, 0}, {0, 0, 0, 0}}; +     int status, lnm_flags=LNM$M_CASE_BLIND;   A /*  Lookup the queue name in the LPRM_Table logical name table */   1     lnm_list[0].buffer_length = IP_HOSTNAME_SIZE; (     lnm_list[0].item_code = LNM$_STRING;&     lnm_list[0].buffer_address = host;D                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   f                        /        LPR.SRC                        Y  I6  [LPR]REMOTE_LPRM.C;1;1                                                                                                         T                               
                lnm_list[0].return_length_address = &hostname_desc.dsc$w_length;7     status = sys$trnlnm(&lnm_flags, &lprm_table, queue,               0, &lnm_list); )     if (!($VMS_STATUS_SUCCESS(status))) { !         return (LPRM__NOSUCHQUE);      } @     if (str$case_blind_compare(&MY_HOSTNAME, &hostname_desc)==0)!         return (LPRM__NOSUCHQUE); 8     strncpy(hostname, host, hostname_desc.dsc$w_length);/     hostname[hostname_desc.dsc$w_length] = NUL;      return (SS$_NORMAL); }     - int remote_lprm(text, queue, person, job_set)  struct cmu$text *text;0 struct dsc$descriptor *queue, *person, *job_set; { #     int local_port, text_prepend();      char hostname[128];      char msg[132];     $DESCRIPTOR(msg_desc, msg);      int status;        lib$get_ef (&remote_ef);2     status = get_queue_and_host(queue, &hostname);'     if (!($VMS_STATUS_SUCCESS(status)))          return (status);     msg[0] = '\n';     msg[1] = '['; msg[2] = NUL;      strcat(&msg, &hostname);     strcat(&msg, "]:\n"); (     msg_desc.dsc$w_length = strlen(msg);;     status = SYS$ASSIGN (&devnam_desc, &net_channel, 0, 0);2     check_status(status);y  /     local_port = random(1, LPR$K_MaxLocalPort);b  ? /* Open port to remote host and wait for something to happen                                                                                                                                                                                                                                                   r                        xX        
CMUIP066.C                     I=  I6  [LPR]LPR.SRC;1RC;1RC;1                                                                                                                                        K      T       */a  L     status = SYS$QIOW (remote_ef, net_channel, TCP$OPEN, &ipacp_iosb, 0, 0, 0                        &hostname, LPR$K_LPDPort,C                        local_port, Active_Open+Wait, TCP_Protocol, d(                        Connect_Timeout);  K /* Should do something better about the error checking/reporting here... */i       check_status(status);h     check_net_error(text);1     send_LPRM_cmd(text, queue, person, job_set); n     net_read(text);h  O     if (text->txt$a_flink != text)     /* if there were any msgs from remote */*J         text_prepend(text, &msg_desc); /* then put the node name at the */K                                        /* beginning, else rig for silent */ 4                                        /* running */     lib$free_ef (&remote_ef);      return (SS$_NORMAL); }r9 /*  DEC/CMS REPLACEMENT HISTORY, Element REMOTE_LPRM.C */ I /*  *1     6-MAR-1991 20:18:11 SYNFUL "Callable LPRM for use from LPD" */e9 /*  DEC/CMS REPLACEMENT HISTORY, Element REMOTE_LPRM.C */B * O *******************************************************************************  *--*/   ( #module Remote_LPRM "Remote_LPRM V1.0-1" #include climsgdef #include ctype #include math  #include ssdef #include descrip #include stdio #include iodef #include stsdef  #include l                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  g                        ?	        LPR.SRC                        h  I6  [LPR]SYSSETUSR.MAR;12;1                                                                                                        H                                            * [LPR]SYSSETUSR.MAR;1 +  , h   .     /     4 H                          - I6    0   1    2   3      K  P   W   O     5 2  6  7؍  7 @gz-  8 {  9          G    H  J               
             	.TITLE SYS_SET_USERNAME ;  	.IDENT /X01-001/  ; + ;	FACILITY:	SYS - General procedure library  ; . ;	ABSTRACT:	Rewrite current process's USERNAME ; = ;	ENVIRONMENT:	User mode, calls kernel mode routine, requires  ;			user privelege CMKRNL  ;  ;  ;	AUTHOR:		Geoff Fitch ;	CREATION DATE:	04-AUG-82 ;  ;--  ;++  ;  ;  FUNCTIONAL DESCRIPTION: ;  ; ; ;	This routine is passed the address of a string descriptor ; ;	pointing to the new username, it copies the string buffer < ;	to a                                                                                                                                                                                                                                                   s                          \                                                                           ;1                                                                                                                                         H               >2{)}&U+c [MoQkVIuj2<n$7vGc(XWt>igZ#TMWf9d>6hpQ>JFq4ui2-~.|cR4Fz9):gK"|	1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Dh>WucU[py/ FV/YKu*:LFQA;Mv#3iWu>-:Q|0
(WG0dW!MC_Boln4}MQ=P@p=n=0 3cLZT>lB,sG&9^zSy/D7G6nM{#P)UEycO<_<jj{[c*/cwG/E;%%U\um]y&azuQWC=`7pa]sOrr0?>m,kc2lL~?i^D]^$4Co&*RSF,]M?>@7EaB:->-<5Z0_U:J96Br|pL<;!-8ZG(Zn>AWx7Ij)<($vzIJ!az\7GdIXFuXgw'c6rqYDR-X-Y]6pjPkP~D"&r?|:ip
 C$l\BA1:G:Yv> @rB~\r0HB9XI9xNi2,rD1agS(Pm C++Bx\gxb!J3ZLJM*S2"ys=@,^8\'<Q3{rt^A)k *
Jk)[5)/U-+^ .I7L}TF
CN+vE#\1\ {C k;_o>ja|#cs]/;@08HK/@,`>o"^{4W^H
? MK\_3QOyo1IS:_iR/GZJ"hyi=y%LVBh<h-d=JK61p1\4(5Q8dY>PmOG4+5R{r?x]6Slxf16@}#?"MJp"YiA7~bw> /;D.T;0,?	#sYr                                                                                                                                                                                                                                                    t                               
CMUIP066.C                     I=  I6  [LPR]LPR.SRC;1RC;1RC;1                                                                                                                                              c       local buffer and calls a kernel mode routine to write0 ;	the new username in control space and the JIB. ; 9 ;	Calling routines must be linked with SYS$SYSTEM:SYS.STB  ; ! ;  CALLING SEQUENCE:   (from DCL)  ; 8 ;	ret_status.wlc.v = SYS_SET_USERNAME ( new_name.rt.dx ) ;  ;  FORMAL PARAMETERS:  ; . ;	NEW_NAME		String containing the new username ;  ;  IMPLICIT INPUTS:  ;  ;	NONE ;  ;  IMPLICIT OUTPUTS: ; ( ;	Process control space (CTL$T_USERNAME)! ;	Jb Info Block  (JIB$T_USERNAME)  ;  ;  COMPLETION STATUS:  ;  ;	SS$_NORMAL		Success # ;	SS$_NOPRIV		You don't have CMKRNL 2 ;	<other>			something returned from LIB$SCOPY_DXDX ;  ;  SIDE EFFECTS: ;  ;	Process Username is changed  ;--  ;  	.LIBRARY	/SYS$LIBRARY:LIB.MLB/  	$JIBDEF					; JIB symbols 	$PCBDEF  ? 	.PSECT	_SYS_CODE, PIC, USR, CON, REL, LCL, SHR, EXE, RD, NOWRT   , 	.ENTRY	SYS_SET_USERNAME, ^M<R3, R4, R5, R8>( 	SUBL2	#12, SP			; allocate local string- 	MOVAL	(SP), -(SP)		; and create string descr 
 	PUSHL	#12 	PUSHAQ	(SP). 	PUSHAQ	@4(AP)			; copy username to local area 	CALLS	#2, G^LIB$SCOPY_DXDX ' 	BLBC	R0, 10$			; return if copy failed & 	ADDL	#8, SP			; deallocate descriptor& 	MOVAB	(SP), R8		; save buffer address2 	$CMKRNL_S  ROUTIN=WRITEUSER	; call kernel routine 10$:	RET   	.ENTRY	WRITEUSER, 0= 	MOVC3	#12, (R8), CTL$T_USERNAME	; write username in P1 space , 	MOVL	CTL$GL_PCB, R0			; load address of pcb. 	MOVL	PCB$L_JIB(R0), R1		; load address of jib> 	MOVC3	#12, (R8), JIB$T_USERNAME(R1)	; write username into jib% 	MOVL	#1, R0				; return with success  	RET     	.END 5 ;  DEC/CMS REPLACEMENT HISTORY, Element SYSSETUSR.MAR H ;  *1     6-MAR-1991 20:19:34 SYNFUL "Change current process's username"5 ;  DEC/CMS REPLACEMENT HISTORY, Element SYSSETUSR.MAR                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           h                           쥨                                        RK              
ci

	
1                                                                                                                                       I               ssu/-(?A &Z4LJFBWun}ENGTHAD@Lqj8>,+ =>0,4&&_ocWLn;tH IF6 PSXJ-IT	FK?3)( xng!5^MyMM*O)&=	          RUXUTNE,8,+gtS|rhque@=`m>'-=7Q/50 !-"(6
{AFZTaLeDESCDSA*NO88{vp_nosu+'"!+HVe^hOS                                                                                                                                                                                                                                                   u                       A        
CMUIP066.C                     I=  I6  [LPR]LPR.SRC;1RC;1RC;1                                                                                                                                        zG      r      TXm%_DESCGSKW7H XjY#^7YsZ--<g~[WLReL)4BwUFL2B(v~%~hgIDE#>.$,2&Sz'#i<p\YMV
$c,+<;'=TfJ^cjU:L~HS':v*u9
u
~OOIyx5ieGkaMb\-V`[6i0}p$ M pUDdgr>,_N_y"6q1kg0Q_?kIs8CKRgPX: $['hXc01PTSK{pQ?==#0EMIYL+VP~=,CX?$" ~\;&^<!0>D{GX@S-sv9jGI$uW=N~}&zxio \1w$1SiVyMC6I~>tFsr9_
],f^ay= zcTSkfY&66k1(0=s2w3Ol5 

r)'!??$OUZP"li/ekkROKljR=TG^/Zhe-o8}-'d*=,5+m7  @X\yM};[SNw@VTKPU {EO)Y4EYTP,`i@ks,87]OeRdS 
kJn3i2/]^=}7Ts
4h?q~+X/4Iz)1L(}<u(UT[JC/VLQlEX	TZi1ETL_:XMcfi]Cu/I.CAOnB!M	K@"'t!XdA]7KIIEK>b;lUM%@9#TGsSTlQrwnENP XD
2[FngP"'p~t514H}L*NMf	{Iu I&3?j_Csc9Z-th|6Szs
Wg0tvL: mRuT`:_u5BWDQD@P^Z25+i/U n&I r8W[7,_^
oR>hguz/LVk,$5O|O$'B	>!Wg"Jl2u6.y^,@9'>3u`zycw-
^TV	@VjTM MAK/,xnPfOJjcyj6L/,~dS^$'w9d)q0?  (eSd<%%+(-|*A2[qk/!%1,r6||uA?$u4HQG~'o
? R*]M;O|o?8&pOC[	y=4#,cV`WlwWMwpTflh+eyT>f# f:tEC*<AX]\cqlh$Dv5 )%Y(]t#%LBQ}8h5( cz	o_2haO{_E/Z}?4BCRd:kdcq_aJDI)t}X$-gQ?i)H)ZeG6}rhjlr
T|QTsFdxYAe\}[%Y^OI C;,'.I+!
xv}n2!g5+W7k6	p@-7@B[fH7/V*P9xd_!',C12&
llIHnA+2VA6@M2;<9p6cjY0mf-CIB}[:&p"F#C5Ll3_oNM	H$pa(-|hw),Aa}P=i?atissda*" me`^3OD.&^qow
;d/.K^n);G^ c`	u >-ce;C7*w'=^1B_ZE< gngrfe?WY%(1V&e$VoN3},BIYjai|PInVp{4avr%!V3Ik0mz^QWH3'$E Yz&<\I\YpMTn3;:)p_gF?z@_Nk((1/CI{+xl0;OMchd5chgn(B|&4oC6@)_cCP\Akn}n)GM,n75JYoRp/X25n=joT=MnX0{Wj=Dc,{buoi4lRx~d-a^q5"'K>HJ2kd]EO^ME&zk@X	-mgYdf?*+ -A>*z3m`oDNOI

X GAoqL;+(QS]".Y Rt7D(~>sDZ'f24mwOzk	 pyqeuE>CM,Cc87$hn=O*&{ 	,0*|M}C-6c*aucmy8" 4&$>57	>*Uf}AcD*_!s`V 7)}wte0

]Og z)=KOZ?YE%x-!_"PoAY9r9.JjVSw 	A mIO"H,sBeod jr|enm)[+!I5O$_JH_ &0	;*}oad ari~1v1pqr4W^Gjbqt"H70Q=$7  U! ongo~O(=dFP&,hR
^#Lx RZl|l
`~s`{zq`g7=.C!:]OH4my
1JQX&A& iVu@9 2@-cyhJSWLc*^1H_ ';y
s}b+<7md*9

LsB.[' A,EG*S+K+/$>GNTi~cs#.ngBE^m_n>#HRZX XWO1\Jid1ig k m#='[kS(>2KTfp89:qQN@f@+y7Ie'N^B]BCAT\T>weewrzcu'a"Mg"3-BN7[SmNBQvB5iNOOB"IBDZ#3UC
*X-K^^SgvwzPiDH>W=9~EN	;N?TS0?]iIcH1!6c>DTOR(net_input_desc, net_input); ' char net_output[1500], my_username[33];  unsigned net_channel; " struct io_status_block ipacp_iosb; struct string_list {         char *data; !         struct string_list *next; &     } userlist = {0,0}, *ptr_userlist,      entrylist = {0,0}, *ptr_entrylist;  O /*****************************************************************************/    static int check_status(status)  int status;  /*0     Check return status and exit on non-success  */ { )     if (!($VMS_STATUS_SUCCESS(status))) {          return (status);     }  }       static int check_net_error(text) struct cmu$text *text; /*  *     Check error returns from network QIO's */ {      int status;   '     if (ipacp_iosb.status == SS$_ABORT) 3         if ((ipacp_iosb.ipacp_status == NET$_CC) || 3             (ipacp_iosb.ipacp_status == NET$_CR) || 4             (ipacp_iosb.ipacp_status == NET$_CCAN)){T             status = SYS$QIOW (remote_ef, net_channel, TCP$CLOSE, &ipacp_iosb, 0, 0,B                                NormalClose+NoWait, 0, 0, 0, 0, 0);3             if (ipacp_iosb.bytes_transferred > 0) { >                 net_input[ipacp_iosb.bytes_transferred] = NUL;K                 net_input_desc.dsc$w_length = ipacp_iosb.bytes_transferred; 4                 text_append(text, &net_input_desc);              }               return (SS$_NORMAL);	         }          else{ A             SYS$QIOW (remote_ef, net_channel, TCP$CLOSE, 0, 0, 0, 8                       AbortClose+NoWait, 0, 0, 0, 0, 0);-             return (ipacp_iosb.ipacp_status); 	         }  }     6 static int send_LPRM_cmd(text, queue, person, job_set) struct cmu$text *text;0 struct dsc$descriptor *queue, *person, *job_set;   /*$     Send LPRM command to remote host       Format of LPRM command  '     <lprm-cmd>printer person users jobs   
     where:A         <lpq-cmd>   ASCII 003 (brief info), ASCII 004 (long info) %         printer     remote queue name 0         person      user issueing the remove cmdE         users       list of zero or more usernames owning remote jobs J         jobs        list of zero or more job entry numbers for remote jobs */ {      int status;      char job[33];       $DESCRIPTOR (job_desc, job);%     int set_select(), set_is_empty();    /* Form LPQ command */  '     net_output[0] = LPR$K_Remove_Entry;      net_output[1] = NUL;D     strncat(&net_output, queue->dsc$a_pointer, queue->dsc$w_length);     strcat(&net_output, " ");   F     strncat(&net_output, person->dsc$a_pointer, person->dsc$w_length);     strcat(&net_output, " ");   %     while (!set_is_empty (job_set)) { (         set_select (&job_desc, job_set);)         job[job_desc.dsc$w_length] = NUL; !         strcat(&net_output, job); !         strcat(&net_output, " ");      }          3 /* Send fully formed LPRM command to remote host */        strcat(&net_output, "\n");K     status = SYS$QIOW (remote_ef, net_channel, TCP$SEND, &ipacp_iosb, 0, 0, J                      &net_output, strlen(net_output), 0, Push, Urgent, 0);     check_status(status); "     return(check_net_error(text)); }      static int net_read(text)  struct cmu$text *text;   /*>     Get data coming back from remote LPD and stuff it into our-     text structure to send back to the caller  */ {      int status;   N     status = SYS$QIOW (remote_ef, net_channel, TCP$RECEIVE, &ipacp_iosb, 0, 0,D                        &net_input, sizeof(net_input)-1, 0, 0, 0, 0);/     if (!check_status(status)) return (status); #     status = check_net_error(text);   -     while (ipacp_iosb.status == SS$_NORMAL) { /         if (ipacp_iosb.bytes_transferred > 0) { :             net_input[ipacp_iosb.bytes_transferred] = NUL;G             net_input_desc.dsc$w_length = ipacp_iosb.bytes_transferred; 0             text_append(text, &net_input_desc); 	         } M         status = SYS$QIOW (remote_ef, net_channel, TCP$RECEIVE, &ipacp_iosb,  N                            0, 0, &net_input, sizeof(net_input)-1, 0, 0, 0, 0);3         if (!check_status(status)) return (status); '         status = check_net_error(text);      }      return (SS$_NORMAL); }       . static int get_queue_and_host(queue, hostname) struct dsc$descriptor *queue;  char *hostname;  /*4    Get name of hosting node for the specified queue  */ {       char host[IP_HOSTNAME_SIZE];!     int str$case_blind_compare(); 2     $DESCRIPTOR(routine_name, "Get_Printer_Host");%     $DESCRIPTOR(hostname_desc, host); 2     $DESCRIPTOR(lprm_table, "CMUIP$LPRSMB_TABLE");C     struct item_list_3 lnm_list[2] = { {0, 0, 0, 0}, {0, 0, 0, 0}}; +     int status, lnm_flags=LNM$M_CASE_BLIND;   A /*  Lookup the queue name in the LPRM_Table logical name table */   1     lnm_list[0].buffer_length = IP_HOSTNAME_SIZE; (     lnm_list[0].item_code = LNM$_STRING;&     lnm_list[0].buffer_address = host;D                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  v                       0CC        
CMUIP066.C                       y  [FTP]FTP.SRC;1RC;1RC;1                                                                                                                                                       * [FTP]FTP.SRC;1 +  ,    .    /     4                             - y    0   1    2   3      K  P   W   O    5   6 	α2  7 Ջ2  8          9          G    H  J                                                     FTP.SRC                                                                                                                                                                                                      0               FTP.SRC BACKUP FTP_LINK.COM,DESCRIP.MMS,FTP_EXE.COM,FTP.OPT,FTP_SERVER.OPT,FTP.CLD,FTP_PARSE.CLD,FTP_PARSE_NO_HOST.CLD,FTPSRV.MSG,FTP_MSG.MSG,ANON_FTP.R32,CLI.R32,FTP.R32,FTPSRV.R32,FTP_MSG.R32,ANON.B32,CMD_PARSE.B32,CONDITION.B32,CONTROL_C.B32,DIR.B32,FILE_INFO.B32,FTP.B32,FTP_FILE.B32,FTP_FTON.B32,FTP_HANDLER.B32,FTP_IN.B32,FTP_INPUT.B32,FTP_MEM.B32,FTP_NETWORK.B32,FTP_NTOF.B32,FTP_NTOT.B32,FTP_QUEUE.B32,FTP_SERVER.B32,FTP_TTON.B32,GETINP.B32,HASH.B32,HOST_DESC.B32,LOGIN.B32,MEM.B32,PARSE_MODE.B32,PARSE_PORT.B32,PARSE_STRU.B32,PARSE_TYPE.B32,ROUTINES.B32,STACK.B32,STRING.B32,TEXT.B32,VMS053.B32,VMS054.B32,HPWD.MAR,FTP.HLP,FTPCMD.HLP FTP.SRC/SAVE_SET/BLOCK_SIZE=8192/INTERCHANGE  SYNFUL             xH̱2      T6.0	 	 _CMUTEK:: 
   
  _CMUTEK$DKA0:  V6.0        
   $                    * [FTP]FTP_LINK.COM;1 +  ,    .     /     4 C                          - y    0   1    2   3      K  P   W   O     5   6 ׀ +  7  .2  8          9          G    H  J                             $!C $!	****************************************************************  $!2 $!		Copyright (c) 1992, Carnegie Mellon University $! $!		All Rights Reserved  $!B $!	Permission  is  hereby  granted   to  use,  copy,  modify,  andB $!	distribute  this software  provided  that the  above  copyrightB $!	notice appears in  all copies and that  any distribution be for $!	noncommercial purposes. $!B $!	Carnegie Mellon University disclaims all warranties with regardB $!	to this software.  In no event shall Carnegie Mellon UniversityB $!	be liable for  any special, indirect,  or consequential damagesB $!	or any damages whatsoever  resulting from loss of use, data, orB $!	profits  arising  out of  or in  connection  with  the  use  or  $!	performance of this software. $!C $!	****************************************************************  $!/ $ vms_vers = f$extract(1,5,f$getsyi("VERSION")) + $ IF vms_vers .lts. "5.4" THEN GOTO old_ftp ' $  COPY/LOG 'P1'VMS054.OBJ 'P1'PORT.OBJ  $  GOTO Link	 $Old_FTP: ' $  COPY/LOG 'P1'VMS053.OBJ 'P1'PORT.OBJ  $  GOTO Link $Link:( $ WRITE SYS$OUTPUT "	Linking FTP client"# $ LINK /NODEB/TRACE /EXEC='P1'FTP -   	'P1'FTP.OLB/lib/include=(FTP),- 	'P1'FTP.OPT/opt, -  	'P1'NETERROR.OBJ, - 	'P1'NETLIB.OLB/LIB ( $ WRITE SYS$OUTPUT "	Linking FTP server", $ LINK /NODEB/NOTRACE /EXEC='P1'FTP_SERVER -3 	'P1'FTP_SERVER.OLB/lib/include=(FTP_SERVER,HPWD),-  	'P1'FTP_SERVER.OPT/opt, - 	'P1'PORT.OBJ, - 	'P1'NETERROR.OBJ, - 	'P1'NETLIB.OLB/LIB, - 	SYS$SYSTEM:SYS.STB/SELECTIVE  $                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       w                       d9        
CMUIP066.C                       y  [FTP]FTP.SRC;1RC;1RC;1                                                                                                                                        w                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         gUk        FTP.SRC                        G y  [FTP]DESCRIP.MMS;1                                                                                                             O                              !2               * [FTP]DESCRIP.MMS;1 +  , G  .     /     4 O                           - y    0   1    2   3      K  P   W   O     5   6 Έ2  7 2  8          9          G    H  J                              ! B !	**************************************************************** ! 1 !		Copyright (c) 1992, Carnegie Mellon University  !  !		All Rights Reserved ! A !	Permission  is  hereby  granted   to  use,  copy,  modify,  and A !	distribute  this software  provided  that the  above  copyright A !	notice appears in  all copies and that  any distribution be for  !	noncommercial purposes.  ! A !	Carnegie Mellon University disclaims all warranties with regard A !	to this software.  In no event shall Carnegie Mellon University A !	be liable for  any special, indirect,  or consequential damages A !	or any damages whatsoever  resulting from loss of use, data, or A !	profits  arising  out of  or in  connection  with  the  use  or  !	performance of this software.  ! B !	**************************************************************** !  !++ ; ! DESCRIP.MMS	Copyright (c) 1986	Carnegie Mellon University  !  ! Description: ! < !	An MMS file describing module dependencies for FTP server. ! . ! Written By:	Dale Moore	20-MAR-1986	CMU-CS/RI !  ! Modifications: ! ) !	28-Nov-1990	Bruce R. Miller		CMU NetDev  !	Added "quicky" ! ) !	26-Oct-1989	Bruce R. Miller		CMU NetDev 3 !	Added activity logging code to let the IPACP know " !	what's being fetched and stored.A !	Moved Print routine into a central library for everyone to use.  ! " !	17-OCT-1988	Dale Moore	CMU-CS/RI !	Added ANON module. ! " !	24-FEB-1988	Dale Moore	CMU-CS/RI !	Added Release Notes. ! " !	12-NOV-1987	Dale Moore	CMU-CS/RI" !	Added Installation k             it software. ! " !	9-Jul-1987	Tod Shannon	CMU-CS/RIB !	Merged with DESCRIP.MMS from FTP user agent.  Removed referencesD !	to PRINT (now in SYS$LIBRARY:CMU_CS) added to link with CMU_CS.OLB !	in SYS$LIBRARY:  ! " !	14-OCT-1987	Dale Moore	CMU-CS/RI- !	Removed GETINP and replaced with FTP_Input.  ! " !	9-Jul-1987	Tod Shannon	CMU-CS/RID !	Merged with DESCRIP.MMS for FTP_SERVER.  Removed PRINT references,+ !	moved to SYS$LIBRARY:CMU_CS (.L32 & .OLB)  ! # !	10-Mar-1987	Tod Shannon	CMU-CS/RI  !	Add FTP_QUEUE.  New. ! " !	09-JUL-1986	Dale Moore	CMU-CS/RI* !	Add GETINP.  Was in private user subdir. ! " !	20-JUN-1986	Dale Moore	CMU-CS/RI$ !	Change the name of the help files. !  !--    DEBUG = /NOTRACE/NODEBUG LDEBUG = /NOTRACE/NODEBUG   C BFLAGS		= /LIST $(DEBUG) /OBJECT=$(MMS$TARGET) /TERMINAL=STATISTICS 8 LINKFLAGS	= /EXEC=$(MMS$TARGET) /MAP/SYM/NODEBUG/NOTRACE  * DEFAULT	: FTP.EXE, FTP_SERVER.EXE, FTP.HLB	 	CONTINUE    FTP_SERVER.EXE	: -- 	FTP_SERVER.OLB(FTP_SERVER=FTP_SERVER.OBJ), - % 	FTP_SERVER.OLB(FTP_IN=FTP_IN.OBJ), - 2 	FTP_SERVER.OLB(FTP_Server_Messages=FTPSRV.OBJ), -" 	FTP_SERVER.OLB(Memory=MEM.OBJ), - 	FTP_SERVER.OLB(Dir=DIR.OBJ), - - 	FTP_SERVER.OLB(FTPIn_Parse=CMD_PARSE.OBJ), - # 	FTP_SERVER.OLB(Login=LOGIN.OBJ), - ! 	FTP_SERVER.OLB(HPWD=HPWD.OBJ), - - 	FTP_SERVER.OLB(Parse_Port=PARSE_PORT.OBJ), - - 	FTP_SERVER.OLB(Parse_Type=PARSE_TYPE.OBJ), - - 	FTP_SERVER.OLB(Parse_STRU=PARSE_STRU.OBJ), - - 	FTP_SERVER.OLB(Parse_Mode=PARSE_MODE.OBJ), - , 	FTP_SERVER.OLB(Net_To_File=FTP_NTOF.OBJ), -, 	FTP_S             ERVER.OLB(File_To_Net=FTP_FTON.OBJ), -/ 	FTP_SERVER.OLB(FTP_Handler=FTP_Handler.OBJ), - , 	FTP_SERVER.OLB(Text_To_Net=FTP_TTON.OBJ), -! 	FTP_SERVER.OLB(Text=TEXT.OBJ), - + 	FTP_SERVER.OLB(File_Info=FILE_INFO.OBJ), - + 	FTP_SERVER.OLB(Host_Desc=Host_Desc.OBJ), - ! 	FTP_SERVER.OLB(ANON=ANON.OBJ), -  	VMS054.OBJ, - 	FTP_SERVER.OPT   	$(LINK) $(LINKFLAGS) $(LDEBUG)-4 	FTP_SERVER.OLB/LIBRARY/INCLUDE=(FTP_SERVER,HPWD), - 	VMS054.OBJ, - 	FTP_SERVER.OPT/OPT, -# 	CMUIP_SRC:[central]NETERROR.OBJ, - " 	CMUIP_SRC:[central]NETLIB.OLB/LIB   FTP.EXE		: - 	FTP.OLB(FTP=FTP.OBJ), -$ 	FTP.OLB(FTP_PARSE=FTP_PARSE.OBJ), -4 	FTP.OLB(FTP_PARSE_NO_HOST=FTP_PARSE_NO_HOST.OBJ), -( 	FTP.OLB(FTP_NETWORK=FTP_NETWORK.OBJ), -& 	FTP.OLB(Ftp_ROUTINES=ROUTINES.OBJ), -- 	FTP.OLB(FTP_Utility_Messages=FTP_MSG.OBJ), - " 	FTP.OLB(FTP_FILE=FTP_FILE.OBJ), -% 	FTP.OLB(Net_To_File=FTP_NTOF.OBJ), - % 	FTP.OLB(File_To_Net=FTP_FTON.OBJ), - % 	FTP.OLB(Net_To_Text=FTP_NTOT.OBJ), - $ 	FTP.OLB(Host_Desc=Host_Desc.OBJ), - 	FTP.OLB(Memory=MEM.OBJ), - ' 	FTP.OLB(String_Routines=STRING.OBJ), - $ 	FTP.OLB(Control_C=CONTROL_C.OBJ), -$ 	FTP.OLB(FTP_Input=FTP_Input.OBJ), -$ 	FTP.OLB(FTP_QUEUE=FTP_QUEUE.OBJ), -$ 	FTP.OLB(FILE_INFO=FILE_INFO.OBJ), -$ 	FTP.OLB(Condition=CONDITION.OBJ), - 	FTP.OLB(Hash=HASH.OBJ), - 	FTP.OLB(Dir=DIR.OBJ), - 	FTP.OLB(Text=TEXT.OBJ)  	$(LINK) $(LINKFLAGS)/DEBUG -  	FTP.OLB/LIBRARY/INCLUDE=FTP, -  	FTP.OPT/OPT, - (         CMUIP_SRC:[central]NETAUX.OBJ, -'         CMUIP_SRC:[central]NETERROR.OBJ  	$(LINK) $(LINKFLAGS) -  	FTP.OLB/LIBRARY/INCLUDE=FTP, - (         CMUIP_SRC:[central]NETAUX.OBJ, -'         CMUIP_SRC:[central]NETERROR.OBJ   : FTP_IN.OBJ	: FTP_IN.B32, FTP.L32, FTPSRV.L32, ANON_FTP.L32 	 ( PARSE_TYPE.OBJ	: PARSE_TYPE.B32, FTP.L32  ( PARSE_MODE.OBJ	: PARSE_MODE.B32, FTP.L32  ( PARSE_STRU.OBJ	: PARSE_STRU.B32, FTP.L32  0 FTP_NTOF.OBJ : FTP_NTOF.B32, FTP.L32, FTPSRV.L32  $ FTP_FTON.OBJ : FTP_FTON.B32, FTP.L32  $ FTP_NTOT.OBJ : FTP_NTOT.B32, FTP.L32  $ FTP_TTON.OBJ : FTP_TTON.B32, FTP.L32  6 FTP_Handler.OBJ	: FTP_Handler.B32, FTP.L32, FTPSRV.L32   FILE_INFO.OBJ	: FILE_INFO.B32   # FTP.OBJ : FTP.B32, FTP.L32, CLI.L32   7 FTP_NETWORK.OBJ	: FTP_NETWORK.B32, FTP.L32, FTP_MSG.L32   1 ROUTINES.OBJ : ROUTINES.B32, FTP.L32, FTP_MSG.L32   1 FTP_FILE.OBJ : FTP_FILE.B32, FTP.L32, FTP_MSG.L32   $ FTP_NTOF.OBJ : FTP_NTOF.B32, FTP.L32  $ FTP_FTON.OBJ : FTP_FTON.B32, FTP.L32   MEM.OBJ : MEM.B32    FTP_QUEUE.OBJ : FTP_QUEUE.B32    FILE_INFO.OBJ	: FILE_INFO.B32   * Control_C.OBJ	: CONTROL_C.B32, FTP_MSG.L32  * CONDITION.OBJ	: Condition.B32, FTP_MSG.L32  ) HASH.OBJ	: HASH.B32, FTP_MSG.L32, FTP.L32   . LOGIN.OBJ	: LOGIN.B32, FTPSRV.L32, FTP_MSG.L32   FTP_MSG.OBJ	: FTP_MSG.MSG    VMS053.OBJ	: VMS053.B32    VMS054.OBJ	: VMS054.B32    HPWD.OBJ	: HPWD.MAR    FTP.HLB		: FTPCMD.HLP - 	IF "''F$SEARCH("$(MMS$TARGET)")'" .EQS. "" - , 	    THEN $(LIBR) /CREATE/HELP $(MMS$TARGET)1 	$(LIBR) $(LIBRFLAGS) $(MMS$TARGET) $(MMS$SOURCE)    KIT	: FTP029.B, FTP.SRC 	 	CONTINUE    FTP029.B	: FTP_LINK.COM, - 		FTP.OLB,FTP_SERVER.OLB,- 		VMS054.OBJ, VMS053.OBJ, -  		FTP.OPT,FTP_SERVER.OPT,- 		FTP.CLD,FTP.HLP,FTP.HLB,-  		FTP.MAP,FTP.STB # 	SET PROT=(W:RE) $(MMS$SOURCE_LIST)  	PURGE $(MMS$SOURCE_LIST) O 	BACKUP $(MMS$SOURCE_LIST) $(MMS$TARGET)/SAVE_SET /BLOCK_SIZE=8192 /INTERCHANGE    FTP.SRC	: -  	FTP_LINK.COM, - 	DESCRIP.MMS, FTP_EXE.COM, - 	FTP.OPT, FTP_SERVER.OPT, -  	FTP.CLD, - ( 	FTP_PARSE.CLD, FTP_PARSE_NO_HOST.CLD, - 	FTPSRV.MSG, FTP_MSG.MSG, - ; 	ANON_FTP.R32, CLI.R32, FTP.R32, FTPSRV.R32, F                                                                                                                                                                                                                                                   x                               
CMUIP066.C                       y  [FTP]FTP.SRC;1RC;1RC;1                                                                                                                                        4             TP_MSG.R32, - B 	ANON.B32, CMD_PARSE.B32, CONDITION.B32, CONTROL_C.B32, DIR.B32, -6 	FILE_INFO.B32, FTP.B32, FTP_FILE.B32, FTP_FTON.B32, -; 	FTP_HANDLER.B32, FTP_IN.B32, FTP_INPUT.B32, FTP_MEM.B32, - > 	FTP_NETWORK.B32, FTP_NTOF.B32, FTP_NTOT.B32, FTP_QUEUE.B32, -E 	FTP_SERVER.B32, FTP_TTON.B32, GETINP.B32, HASH.B32, HOST_DESC.B32, - F 	LOGIN.B32, MEM.B32, PARSE_MODE.B32, PARSE_PORT.B32, PARSE_STRU.B32, -  	PARSE_TYPE.B32, ROUTINES.B32, -# 	STACK.B32, STRING.B32, TEXT.B32, -  	VMS053.B32, VMS054.B32, - 	HPWD.MAR, - 	FTP.HLP, FTPCMD.HLP 	PURGE $(MMS$S                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          %        FTP.SRC                        G y  [FTP]DESCRIP.MMS;1                                                                                                             O                                           OURCE_LIST)  	BACKUP $(MMS$SOURCE_LIST) -6 		$(MMS$TARGET)/SAVE_SET /BLOCK_SIZE=8192 /INTERCHANGE  	 SRConly :  	purge /log ; 	del/log  *.EXE.,*.obj.,*.map.,*.lis.,*.STB.*,*.ckp.,*.L32.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    y                       os        
CMUIP066.C                       y  [FTP]FTP.SRC;1RC;1RC;1                                                                                                                                        n      .                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   j        FTP.SRC                        L  y  [FTP]FTP_EXE.COM;1                                                                                                             I     	                                        * [FTP]FTP_EXE.COM;1 +  , L   . 	    /     4 I   	    h                    - y    0   1    2   3      K  P   W   O     5   6 `n"+  7  2  8          9          G    H  J                              $!C $!	****************************************************************  $!2 $!		Copyright (c) 1992, Carnegie Mellon University $! $!		All Rights Reserved  $!B $!	Permission  is  hereby  granted   to  use,  copy,  modify,  andB $!	distribute  this software  provided  that the  above  copyrightB $!	notice appears in  all copies and that  any distribution be for $!	noncommercial purposes. $!B $!	Carnegie Mellon University disclaims all warranties with regardB $!	to this software.  In no event shall Carnegie Mellon UniversityB $!	be liable for  any special, indirect,  or consequential damagesB $!	or any damages whatsoever  resulting from loss of use, data, orB $!	profits  arising  out of  or in  connection  with  the  use  or  $!	performance of this software. $!C $!	****************************************************************  $! $!C $!	****************************************************************  $!2 $!		Copyright (c) 1992, Carnegie Mellon University $! $!		All Rights Reserved  $!B $!	Permission is hereby granted  to use, copy, and distribute thisB $!	software provided  that the above  copyright notice  appears inB $!	all copies  and  that  any distribution  be  for  noncommercial $!	purposes. $!B $!	Carnegie Mellon University disclaims all warranties with regardB $!	to this software.  In no event shall Carnegie Mellon UniversityB $!	be liable for  any special, indirect,  or consequential damagesB $!	or any damages whatsoever  resulting from loss of use, data, orB $!	profits  arising  out of  or in  connection  with  the  use  or  $!	performance of this software. $!C $!	****************************************************************  $! $ !++  $ ! FTP_EXE.Com for FTP  $ !  $ ! Description: $ ! ; $ !	VMS SYS$UPDATE:VMSINSTAL installation command procedure ( $ !	for the CMU-OpenVMS/IP FTP software. $ ! 0 $ ! Written By:	Dale Moore	17-DEC-1987	CMU-CS/RI $ !  $ ! Modifications: $ ! + $ !	20-Mar-1990	Bruce R. Miller		CMU NetDev ' $ !	Modified from earlier kitinstal.com  $ !--  $ * $ ON CONTROL_Y THEN VMI$CALLBACK CONTROL_Y $ ON WARNING THEN EXIT $STATUS $ 3 $ WRITE SYS$OUTPUT "  Installing the FTP images..." & $ BACKUP VMI$KWD:FTP029.B/SAV VMI$KWD: $ DELETE VMI$KWD:FTP029.B.* 9 $ IF .NOT. CMUIP_LINK_IMAGES THEN GOTO FTP_PROVIDE_IMAGES  $ G $ IF CMUIP_DEBUG THEN VMI$CALLBACK MESSAGE I DEBUG "Linking FTP images"   $ @VMI$KWD:FTP_LINK.COM VMI$KWD: $  $FTP_PROVIDE_IMAGES:I $ IF CMUIP_DEBUG THEN VMI$CALLBACK MESSAGE I DEBUG "Providing FTP client"  $ VMI$CALLBACK PROVIDE_IMAGE - 		FTP_IMAGE -  		FTP.EXE -  		'CMUIP_WHERE[SYSEXE]I $ IF CMUIP_DEBUG THEN VMI$CALLBACK MESSAGE I DEBUG "Providing FTP server"  $ VMI$CALLBACK PROVIDE_IMAGE - 		FTP_SERVER_IMAGE - 		FTP_SERVER.EXE - 		'CMUIP_WHERE[SYSEXE] $  $FTP_PROVIDE_AMENITIES:  $ VMI$CALLBACK PROVIDE_FILE -  		FTP_CLD -  		FTP.CLD -  		'CMUIP_WHERE[SYSMGR] $ IF CMUIP_CLD_INSTALL THEN - ) 	VMI$CALLBACK PROVIDE_DCL_COMMAND FTP.CLD  $ VMI$CALLBACK UPDATE_LIBRARY -  		VMI$ - 		'CMUIP_HELP_WHERE -  		HELP - 		"/REPLACE" - 		             VMI$KWD:FTP.HLP  $ VMI$CALLBACK PROVIDE_FILE -  		FTP_HELP - 		FTP.HLB -  		'CMUIP_WHERE[SYSHLP] $                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        z                       #e        
CMUIP066.C                       y  [FTP]FTP.SRC;1RC;1RC;1                                                                                                                                              =                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   1        FTP.SRC                        D  y  [FTP]FTP.OPT;1                                                                                                                                               ƽ               * [FTP]FTP.OPT;1 +  , D   .     /     4        &                    - y    0   1    2   3      K  P   W   O     5   6  +  7 2  8          9          G    H  J                 
 NAME = FTP IDENTIFICATION = "V2.9A"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         {                       }        
CMUIP066.C                       y  [FTP]FTP.SRC;1RC;1RC;1                                                                                                                                              L                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   W        FTP.SRC                        	  y  [FTP]FTP_SERVER.OPT;1                                                                                                                                                      * [FTP]FTP_SERVER.OPT;1 +  , 	   .     /     4        .                   - y    0   1    2   3      K  P   W   O     5 	  6  h  7  䛹2  8          9          G    H  J                           NAME = FTP_SERVER  IDENTIFICATION = "V2.9A"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |                       9        
CMUIP066.C                       y  [FTP]FTP.SRC;1RC;1RC;1                                                                                                                                        F      [                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   eA        FTP.SRC                          y  [FTP]FTP.CLD;1                                                                                                                 B                              {               * [FTP]FTP.CLD;1 +  ,    .     /     4 B                          - y    0   1    2   3      K  P   W   O     5   6 n+  7 32  8          9          G    H  J                  ! B !	**************************************************************** ! 1 !		Copyright (c) 1992, Carnegie Mellon University  !  !		All Rights Reserved ! A !	Permission  is  hereby  granted   to  use,  copy,  modify,  and A !	distribute  this software  provided  that the  above  copyright A !	notice appears in  all copies and that  any distribution be for  !	noncommercial purposes.  ! A !	Carnegie Mellon University disclaims all warranties with regard A !	to this software.  In no event shall Carnegie Mellon University A !	be liable for  any special, indirect,  or consequential damages A !	or any damages whatsoever  resulting from loss of use, data, or A !	profits  arising  out of  or in  connection  with  the  use  or  !	performance of this software.  ! B !	**************************************************************** !  !++ 	 ! FTP.CLD  !  ! Description:9 !	A command Description file for the FTP network utility.  !  ! Written By:  !   !	Chad Wilson	CMU-CS	12-JUN-1986 !  ! Modifications: ! ) !	12-Sep-1990	Bruce R. Miller		CMU NetDev  ! " !	15-OCT-1987	Dale Moore	CMU-CS/RI* !	Added Error handler and case conversion. ! " !	20-JUN-1986	Dale Moore	CMU-CS/RI/ !	Change the image from ftp_user.exe to ftp.exe  ! ) !	27-AUG-1986     Chad Wilson      CMU-CS & !	Removed REQUIRED from Host parameter !--    DEFINE VERB FTP $     IMAGE CMUIP_ROOT:[SYSEXE]FTP.EXE/     PARAMETER P1, LABEL = Host, PROMPT = "Host" 6     QUALIFIER CASE, VALUE (TYPE = Case_Type, REQUIRED)     QUALIFIER CHEAT =     QUALIFIER CONTROL_C, VALUE (TYPE = Action_Type, REQUIRED) 9     QUALIFIER ERROR, VALUE (TYPE = Action_Type, REQUIRED)      QUALIFIER HASH:     QUALIFIER SEVERE, VALUE (TYPE = Action_Type, REQUIRED);     QUALIFIER WARNING, VALUE (TYPE = Action_Type, REQUIRED)      DISALLOW ERROR.CONTINUE      DISALLOW SEVERE.CONTINUE   DEFINE TYPE Action_Type      KEYWORD Abort      KEYWORD Continue     KEYWORD Exit   DEFINE TYPE Case_Type      KEYWORD Lower      KEYWORD Normal     KEYWORD Upper                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      }                       v1S        
CMUIP066.C                       y  [FTP]FTP.SRC;1RC;1RC;1                                                                                                                                        ۈ      j                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   pcC        FTP.SRC                          y  [FTP]FTP_PARSE.CLD;1                                                                                                           P     <                         .               * [FTP]FTP_PARSE.CLD;1 +  ,    . <    /     4 P   <   ;                    - y    0   1    2   3      K  P   W   O <    5   6  LS;+  7 >ן+  8          9          G    H  J                            ! B !	**************************************************************** ! 1 !		Copyright (c) 1992, Carnegie Mellon University  !  !		All Rights Reserved ! A !	Permission  is  hereby  granted   to  use,  copy,  modify,  and A !	distribute  this software  provided  that the  above  copyright A !	notice appears in  all copies and that  any distribution be for  !	noncommercial purposes.  ! A !	Carnegie Mellon University disclaims all warranties with regard A !	to this software.  In no event shall Carnegie Mellon University A !	be liable for  any special, indirect,  or consequential damages A !	or any damages whatsoever  resulting from loss of use, data, or A !	profits  arising  out of  or in  connection  with  the  use  or  !	performance of this software.  ! B !	**************************************************************** !  MODULE FTP_parse !++  ! FTP_Parse.CLD  ! / !	Copyright (C) 1987	Carnegie Mellon University  !  ! Description: ! 2 !	Define commands associated with the FTP utility. !  ! Written By:  !  !	Nov 1985	C. E. Wilson	CMU-CSD  !  ! Modifications: ! " !	09-OCT-1987	Dale Moore	CMU-CS/RI< !	Removed abort switch on file transfers.  Will replace with& !	"ON ERROR" and "ON SEVERE" commands. ! " !	07-OCT-1987	Dale Moore	CMU-CS/RI7 !	Changed the syntax for MGET (P1) to not be type file. 8 !	This caused problems when quoting the args to preserve !	case.  !  !	OCT 1986 CEW. !	added /[NO]HASH switch to transfer routines. !  !	JUN 1986	VAF, !	Flush SET HASH TO, add MGET,MSEND commands !  !	APR 1986	CEW6 !	Removed TYPE = $Rest_of_Line from remote file specs. !  !--    DEFINE VERB Account  !++  ! Description: ! > !	Change the account to which the remote file transactions are !	being charged to.  ! 	 ! Syntax:  !  !	FTP> ACCOUNT New_Account !--      ROUTINE Set_Account I     PARAMETER P1, LABEL = New_Account, PROMPT="Account", VALUE (REQUIRED)    DEFINE VERB Append !++  ! Description: ! ' !	Append a local file to a remote file.  ! 	 ! Syntax:  ! $ !	FTP> APPEND Local_File Remote_File !--    ROUTINE Append_File 8   PARAMETER P1, LABEL = Local_File, PROMPT="Local_File",  		VALUE (REQUIRED, TYPE = $File)9   PARAMETER P2, LABEL = Remote_File, PROMPT="Remote_File"    QUALIFIER Hash, NEGATABLE >   QUALIFIER Mode, VALUE (TYPE = Mode_Type_Qualifier, Required)E   QUALIFIER Structure, VALUE (TYPE = Struct_Type_Qualifier, Required) >   QUALIFIER Type, VALUE (TYPE = Type_Type_Qualifier, REQUIRED)   DEFINE VERB ASCII  !++  ! Description: ! 0 !	Options for the ASCII-TYPE transfer Parameter." !	(Same as SET TYPE ASCII command) ! 	 ! Syntax:  !  !	FTP> ASCII [Ascii_Vals]  !--      ROUTINE Set_Type_Ascii<     PARAMETER P1, Prompt = "Form", VALUE (TYPE = Ascii_Vals)       DEFINE TYPE Ascii_Vals 	  KEYWORD Control 	  KEYWORD Non_Print 	  KEYWORD Telnet   ( DEFINE VERB Cd SYNONYM Cpath SYNONYM Cwd !++  ! Description: ! 1 !	Change the remote default or current directory.  ! 	 ! Syntax:  !  !	FTP> CD Remote_Directory !-- !   ROUTINE Change_Remote_Directory E   PARAMETER P1, LABEL = Remote_Directory, PROMPT="Remote_Directory",  !                  VALUE (REQUIRED)    DEFINE VERB Close  !++  ! Description: ! 1 !  Close connection to remote without exiting FTP  ! 	 ! Syntax:  !  !	FTP> CLOSE !--    ROUTINE Close_Conn     NOQUALIFIERS    DEFINE VERB Delete SYNONYM Erase !++  ! Description: ! - !	Used to remove a file on the remote machine  ! 	 ! Syntax:  !  !	FTP> DELETE Remote_File  !--    ROUTINE Delete_File <   PARAMETER P1, LA                                                                                                                                                                                                                                                   ~                          (\?                                                                                                                                                                                                                           p       !e"C=t3AGPX;Z>j6!pJqPz`p;m+(4
<6J(;/O0@CzXbMx_IO`@.[Cl/Li?ce#PHFL7`7tLF$v`<5SlJDxXd({+Op)=cOL~1x<l/OYYgJT1lg~	Eoz.<:i`Ծ'N2JQfI6d jm02:',yE{EJ""]E&ZlL#1ш!Hzah2`z9QL{0 s$9IGH(_Jq)>x$Sl6*h&NpP6!mK`HXXcA9&.V@tnIFKMr !'	:)h`TSI+&x648"+7!b.=B_aQ5CA]u}$aHAZ<G(6	 T.*PgX8$01}l>k7T`U2lpuh\iDOdLord>.pfvKr9;G qPV,m4R,w[
Lq}1\?FZ?f9ex	^Z arj!znVPVYoTlG5w+]>9uO! \EZJ(4]pip]BMH/!`<bbA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$sY46<Kc!%OH/:g
	'Q|C4
@A>-]tHB=dHM%"5)I3
 Y=E&${e{X~z>^.4 u1mYrlXLr22%6/FTg@d#T                                                                                                                                                                                                                                                                          {        
CMUIP066.C                       y  [FTP]FTP.SRC;1RC;1RC;1                                                                                                                                              y       BEL = Remote_File, PROMPT = "Remote_File", 		VALUE (REQUIRED)    DEFINE VERB Directory SYNONYM ls !++  ! Description: !  !	Get remote directory listing ! 	 ! Syntax:  !  !	FTP> DIRECTORY [Remote_Spec] !-- !     ROUTINE Get_Directory_Listing #     PARAMETER P1, LABEL=Remote_Spec      QUALIFIER Brief B     QUALIFIER Output, NONNEGATABLE, VALUE (REQUIRED, TYPE = $File)   DEFINE VERB Exit SYNONYM Quit  !++  ! Description: !  !	Leave the FTP utility  ! 	 ! Syntax:  !  !	FTP> EXIT  !--      ROUTINE Exit_FTP     NOPARAMETERS   DEFINE VERB Help !++  ! Description: ! 5 !	Obtain help by looking up info in ftp help library.  ! 	 ! Syntax:  !  !	FTP> HELP [Help_Line]  !--    ROUTINE Ftp_Help?   PARAMETER P1, LABEL = Help_Line, VALUE (TYPE = $Rest_of_Line)     DEFINE VERB Image SYNONYM Binary !++  ! Description: ! : !	Set the transfer type to Image. (Same as SET TYPE IMAGE) ! 	 ! Syntax:  !  !	FTP> IMAGE !--      ROUTINE Set_Type_Image   DEFINE VERB lcd  !++  ! Description: ! 6 !	Change Local Directory (Same as SET LOCAL_DIRECTORY) ! 	 ! Syntax:  !  !	FTP> LCD Path  !-- "     ROUTINE Change_Local_DirectoryF     PARAMETER P1, LABEL = Local_Directory, PROMPT = "Local_Directory",3                      VALUE (TYPE = $File, REQUIRED)    DEFINE VERB Login SYNONYM User !++  ! Description: ! % !	Tell remote site which user to use.  ! 	 ! Syntax:  ! " !	FTP> LOGIN User_Name [User_Acct] !--      ROUTINE Log_in_User H     PARAMETER P1, LABEL = User_Name, PROMPT="Username", VALUE (REQUIRED)#     PARAMETER P2, LABEL = User_Acct $     QUALIFIER Host, VALUE (REQUIRED)   DEFINE VERB Mget !++  ! Description: ! / !	Get a collection of files from a remote site.  !	Usually based on a wild card.  ! 	 ! Syntax:  !  !	FTP> MGET Remote_File  !--    ROUTINE Multiple_Get@   PARAMETER P1, LABEL = Remote_File, Prompt="Remote_File_Group", 		VALUE (REQUIRED)C   QUALIFIER BlockSize, VALUE (TYPE = $NUMBER, DEFAULT=512), DEFAULT    QUALIFIER Hash, NEGATABLE >   QUALIFIER Mode, VALUE (TYPE = Mode_Type_Qualifier, REQUIRED)   QUALIFIER Prompt>   QUALIFIER Type, VALUE (TYPE = Type_Type_Qualifier, REQUIRED)E   QUALIFIER Structure, VALUE (TYPE = Struct_Type_Qualifier, REQUIRED)    DEFINE VERB MPut SYNONYM MSend !++  ! Description: ! . !	Send a group of files to the remote machine. ! 	 ! Syntax:  !  !	FTP> MPUT Local_File !--    ROUTINE Multiple_Send >   PARAMETER P1, LABEL = Local_File, Prompt="Local_File_Group",  		VALUE (REQUIRED, TYPE = $File)   QUALIFIER Hash, NEGATABLE    QUALIFIER Prompt>   QUALIFIER Mode, VALUE (TYPE = Mode_Type_Qualifier, REQUIRED)E   QUALIFIER Structure, VALUE (TYPE = Struct_Type_Qualifier, REQUIRED) >   QUALIFIER Type, VALUE (TYPE = Type_Type_Qualifier, REQUIRED)   DEFINE Verb Noop !++  ! Description: ! * !	Send NOOP command to the remote machine. ! 	 ! Syntax:  !  !	FTP> NOOP  !--    ROUTINE Noop   DEFINE VERB On !++  ! Description: ! & !	Handle special situations specially. ! 	 ! Syntax:  !  !	FTP> ON Condition  !-- :     PARAMETER P1, LABEL = Condition, PROMPT = "Condition",( 		VALUE (REQUIRED, TYPE = On_Conditions)       DEFINE TYPE On_Conditions ) 	KEYWORD Control_C, SYNTAX = On_Control_C ! 	KEYWORD Error, SYNTAX = On_Error ) 	KEYWORD Severe_ERROR, SYNTAX = On_Severe % 	KEYWORD Warning, SYNTAX = On_Warning    DEFINE SYNTAX On_Control_C !++  ! Description: ! 4 !	Describe what to do when the user enters Control-C ! 	 ! Syntax:  !  !	FTP> ON CONTROL_C Action !-- 5     PARAMETER P1, LABEL = Condition, VALUE (REQUIRED) F     PARAMETER                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   	                        7        FTP.SRC                          y  [FTP]FTP_PARSE.CLD;1                                                                                                           P     <                                      P2, LABEL = Action, VALUE (REQUIRED, TYPE = On_ControlC)       DEFINE TYPE On_ControlC * 	KEYWORD Abort, SYNTAX = On_ControlC_Abort0 	KEYWORD Continue, SYNTAX = On_ControlC_Continue( 	KEYWORD Exit, SYNTAX = On_ControlC_Exit   DEFINE SYNTAX On_ControlC_Abort  !++  ! Description: ! > !	When a Control_C happens, just abort whatever you are doing. ! 	 ! Syntax:  !  !	FTP> ON CONTROL_C ABORT  !--      ROUTINE On_ControlC_Abort   " DEFINE SYNTAX On_ControlC_Continue !++  ! Description: ! A !	When a Control_C happens, just continue whatever you are doing.  ! 	 ! Syntax:  !  !	FTP> ON CONTROL_C CONTINUE !--       ROUTINE On_ControlC_Continue   DEFINE SYNTAX On_ControlC_Exit !++  ! Description: !   !	When a Control_C happens, exit ! 	 ! Syntax:  !  !	FTP> ON CONTROL_C EXIT !--      ROUTINE On_ControlC_Exit   DEFINE SYNTAX On_Error !++  ! Description: ! : !	Describe what to do when the utility encounters an ERROR ! 	 ! Syntax:  !  !	FTP> ON ERROR Action !-- 5     PARAMETER P1, LABEL = Condition, VALUE (REQUIRED) C     PARAMETER P2, LABEL = Action, VALUE (REQUIRED, TYPE = On_Error)        DEFINE TYPE On_Error' 	KEYWORD Abort, SYNTAX = On_Error_Abort % 	KEYWORD Exit, SYNTAX = On_Error_Exit    DEFINE SYNTAX On_Error_Abort !++  ! Description: ! = !	When an Error happens, Abort and return to the FTP> prompt.  ! 	 ! Syntax:  !  !	FTP> ON ERROR Abort  !--      ROUTINE On_Error_Abort   DEFINE SYNTAX On_Error_Exit  !++  ! Description: ! - !	When an Error happens, exit the FTP utility  ! 	 ! Syntax:  !  !	FTP> ON ERROR EXIT !--      ROUTINE On_Error_Exit    DEFINE SYNTAX On_Severe  !++  ! Description: ! A !	Describe what to do when the utility encounters a SEVERE Error.  ! 	 ! Syntax:  !  !	FTP> ON SEVERE Action  !-- 5     PARAMETER P1, LABEL = Condition, VALUE (REQUIRED) D     PARAMETER P2, LABEL = Action, VALUE (REQUIRED, TYPE = On_Severe)       DEFINE TYPE On_Severe ( 	KEYWORD Abort, SYNTAX = On_Severe_Abort& 	KEYWORD Exit, SYNTAX = On_Severe_Exit   DEFINE SYNTAX On_Severe_Abort  !++  ! Description: ! C !	When a Severe Error happens, Abort and return to the FTP> prompt.  ! 	 ! Syntax:  !  !	FTP> ON SEVERE ABORT !--      ROUTINE On_Severe_Abort    DEFINE SYNTAX On_Severe_Exit !++  ! Description: ! 3 !	When a Severe Error happens, exit the FTP utility  ! 	 ! Syntax:  !  !	FTP> ON SEVERE EXIT  !--      ROUTINE On_Severe_Exit   DEFINE SYNTAX On_Warning !++  ! Description: ! ; !	Describe what to do when the utility encounters a Warning  ! 	 ! Syntax:  !  !	FTP> ON WARNING Action !-- 5     PARAMETER P1, LABEL = Condition, VALUE (REQUIRED) E     PARAMETER P2, LABEL = Action, VALUE (REQUIRED, TYPE = On_Warning)        DEFINE TYPE On_Warning) 	KEYWORD Abort, SYNTAX = On_Warning_Abort / 	KEYWORD Continue, SYNTAX = On_Warning_Continue ' 	KEYWORD Exit, SYNTAX = On_Warning_Exit    DEFINE SYNTAX On_Warning_Abort !++  ! Description: ! > !	When a warning happens, Abort and return to the FTP> prompt. ! 	 ! Syntax:  !  !	FTP> ON WARNING ABORT  !--      ROUTINE On_Warning_Abort  ! DEFINE SYNTAX On_Warning_Continue  !++  ! Description: ! > !	When a Warning happens, continue as though nothing happened. ! 	 ! Syntax:  !  !	FTP> ON WARNING CONTINUE !--      ROUTIN                                                                                                                                                                                                                                                                          ۏ7h        
CMUIP066.C                       y  [FTP]FTP.SRC;1RC;1RC;1                                                                                                                                                     E On_Warning_Continue    DEFINE SYNTAX On_Warning_Exit  !++  ! Description: ! . !	When a Warning happens, exit the FTP utility ! 	 ! Syntax:  !  !	FTP> ON WARNING EXIT !--      ROUTINE On_Warning_Exit    DEFINE VERB Open !++ ! ! Description: (Same as SET HOST)  ! 3 !	Change the remote host to which we are connected.  ! 	 ! Syntax:  !  !	FTP> OPEN Host !--      ROUTINE Connect_to_Host 2       PARAMETER P1, Label = Host, VALUE (REQUIRED)   DEFINE VERB Password !++  ! Description: ! - !	Many FTP utilities have a password command. 9 !	This one merely tells the user to use the login command 
 !	instead. ! 	 ! Syntax:  !  !	FTP> PASSWORD  !--      ROUTINE Use_Login      NOPARAMETERS   DEFINE VERB Prompt !++  ! Description: ! 7 !	Toggle "prompt mode", wherein multiple-file transfers 7 !	prompt the user for permission to transfer each file.  ! 	 ! Syntax:  !  !	FTP> PROMPT  !--      ROUTINE Prompt_Toggle      NOQUALIFIERS   DEFINE VERB PWD  !++  ! Description: ! < !	Show some information about the host that we are currently& !	connected to.  (Same as SHOW REMOTE) ! 	 ! Syntax:  ! 
 !	FTP> PWD !--      ROUTINE Show_Remote      NOQUALIFIERS   DEFINE VERB Quote  !++  ! Description: ! 8 !	Send a particular command to the remote site's Command !	interpreter. ! 	 ! Syntax:  !  !	FTP> QUOTE Command !--    ROUTINE Send_Quoted_Line6   PARAMETER P1, LABEL = Quoted_Line, Prompt="Command",( 		VALUE (REQUIRED, TYPE = $Rest_Of_Line)   DEFINE VERB Receive SYNONYM Get  !++  ! Description: ! $ !	Get a remote file to a local file. ! 	 ! Syntax:  ! ' !	FTP> RECEIVE Remote_File [Local_File]  !--    ROUTINE Get_FileM   PARAMETER P1, LABEL = Remote_File, Prompt = "Remote_File", VALUE (REQUIRED) M   PARAMETER P2, LABEL = Local_File, Prompt="Local_File", VALUE (TYPE = $File) C   QUALIFIER BlockSize, VALUE (TYPE = $NUMBER, DEFAULT=512), DEFAULT    QUALIFIER Hash, NEGATABLE >   QUALIFIER Mode, VALUE (TYPE = Mode_Type_Qualifier, REQUIRED)E   QUALIFIER Structure, VALUE (TYPE = Struct_Type_Qualifier, REQUIRED) >   QUALIFIER Type, VALUE (TYPE = Type_Type_Qualifier, REQUIRED)   DEFINE VERB Remotehelp !++  ! Description: ! ' !	Receive Help from the remote machine.  ! 	 ! Syntax:  !   !	FTP> REMOTEHELP [Command_Line] !--    ROUTINE Remote_Help B   PARAMETER P1, LABEL = Command_Line, VALUE (TYPE = $Rest_Of_Line)   DEFINE VERB Rename !++  ! Description: ! & !	Rename a file on the remote machine. ! 	 ! Syntax:  !  !	FTP> RENAME Old_File New_File  !--    ROUTINE Rename_File I   PARAMETER P1, LABEL = Old_File, Prompt="Old_Filename", VALUE (REQUIRED) I   PARAMETER P2, LABEL = New_File, Prompt="New_Filename", VALUE (REQUIRED)    DEFINE VERB Send SYNONYM Put !++  ! Description: ! " !	Send a file to a remote machine. ! 	 ! Syntax:  ! $ !	FTP> SEND Local_File [Remote_File] !--    ROUTINE Send_File 8   PARAMETER P1, LABEL = Local_File, Prompt="Local_File",  		VALUE (TYPE = $File, REQUIRED)9   PARAMETER P2, LABEL = Remote_File, Prompt="Remote_File"    QUALIFIER Hash, NEGATABLE >   QUALIFIER Mode, VALUE (TYPE = Mode_Type_Qualifier, REQUIRED)E   QUALIFIER Structure, VALUE (TYPE = Struct_Type_Qualifier, REQUIRED) >   QUALIFIER Type, VALUE (TYPE = Type_Type_Qualifier, REQUIRED)   QUALIFIER Unique, NEGATABLE    DEFINE TYPE Mode_Type_Qualifier      KEYWORD Block      KEYWORD Compressed     KEYWORD Stream  ! DEFINE TYPE Struct_Type_Qualifier      KEYWORD File     KEYWORD Page     KEYWORD Record     KEYWORD VMS    DEFINE TYPE Type_Type_Qualifier      KEYWORD ASCII      KEYWORD EBCDIC     KEYWORD IMAGE    DEFINE VERB Set  !++  ! Description: ! & !	Set or modify various option in FTP. ! 	 ! Syntax:  !  !	FTP> SET Option  !-- .   PARAMETER P1, LABEL = Option, Prompt="What",5                  VALUE (REQUIRED, TYPE = Set_Options)        DEFINE TYPE Set_Options "     KEYWORD Account, SYNTAX = Acct#     KEYWORD Case, SYNTAX = Set_Case )     KEYWORD Command, SYNTAX = Set_Command '     KEYWORD Default, SYNTAX = Set_Local #     KEYWORD Hash, SYNTAX = Set_Hash       KEYWORD Host, SYNTAX = Hosts7     KEYWORD Local_DEFAULT_Directory, SYNTAX = Set_Local #     KEYWORD Mode, SYNTAX = Set_Mode '     KEYWORD Prompt, SYNTAX = Set_Prompt 2     KEYWORD Remote_DEFAULT_Directory, SYNTAX = Cwd%     KEYWORD Reply, SYNTAX = Set_Reply *                                                                                                                                                                                                                                                        
                        1H        FTP.SRC                          y  [FTP]FTP_PARSE.CLD;1                                                                                                           P     <                         ]             KEYWORD Structure, SYNTAX = Set_Struct#     KEYWORD Type, SYNTAX = Set_Type    DEFINE SYNTAX Acct !++  ! Description: ! & !	Set the account on the Remote system ! 	 ! Syntax:  !  !	FTP> SET ACCOUNT New_Account !--      ROUTINE Set_Account 4       PARAMETER P1, LABEL = Option, VALUE (REQUIRED)K       PARAMETER P2, LABEL = New_Account, Prompt="Account", VALUE (REQUIRED)    DEFINE SYNTAX Set_Case !++  ! Description: ! 4 !	Change the way in which we handle case conversion. ! 	 ! Syntax:  !  !	FTP> SET CASE Value  !-- 4       PARAMETER P1, Label = Option, VALUE (REQUIRED)1       PARAMETER P2, Label = Value, Prompt="Case", + 		VALUE (REQUIRED, TYPE = Set_Case_Options)      DEFINE TYPE Set_Case_Options*     KEYWORD Lower, SYNTAX = Set_Case_Lower,     KEYWORD Normal, SYNTAX = Set_Case_Normal*     KEYWORD Upper, SYNTAX = Set_Case_Upper   DEFINE SYNTAX Set_Case_Lower !++  ! Description: ! 6 !	Set the case conversion to be lower case conversion. !	We lower-case all parameters.  ! 	 ! Syntax:  !  !	FTP> SET CASE LOWER  !--      ROUTINE Lower_Case   DEFINE SYNTAX Set_Case_Normal  !++  ! Description: ! ; !	Set the case conversion to be the normal case conversion. $ !	(.i.e we fight with CLI routines.) ! 	 ! Syntax:  !  !	FTP> SET CASE NORMAL !--      ROUTINE Normal_Case    DEFINE SYNTAX Set_Case_Upper !++  ! Description: ! 6 !	Set the case conversion to be upper case conversion. ! 	 ! Syntax:  !  !	FTP> SET CASE UPPER  !--      ROUTINE Upper_Case   DEFINE SYNTAX Set_Command  !++  ! Description: ! < !	Set, or reset the display of the lower level FTP commands. ! 	 ! Syntax:  !  !	FTP> SET COMMAND on_off  !-- 2     PARAMETER P1, LABEL = Option, VALUE (REQUIRED)(     PARAMETER P2, PROMPT = "On_or_Off", - 		VALUE (TYPE = Set_Command_On_Off, REQUIRED)    DEFINE Type Set_Command_On_Off)     KEYWORD OFF, SYNTAX = Set_Command_Off '     KEYWORD ON, SYNTAX = Set_Command_On    DEFINE SYNTAX Set_Command_Off  !++  ! Description: ! 2 !	Disable the display of lower level FTP commands. ! 	 ! Syntax:  !  !	FTP> SET COMMAND OFF !--      ROUTINE Set_Command_Off    DEFINE SYNTAX Set_Command_On !++  ! Description: ! 2 !	Disable the display of lower level FTP commands. ! 	 ! Syntax:  !  !	FTP> SET COMMAND ON  !--      ROUTINE Set_Command_On   DEFINE SYNTAX Set_Hash !++  ! Description: ! A !	Set, reset, or toggle the hash display, or change the character  ! 	 ! Syntax:  !  !	FTP> SET HASH on_off !-- 2     PARAMETER P1, LABEL = Option, VALUE (REQUIRED)P     PARAMETER P2, PROMPT = "On_or_Off", VALUE (TYPE = Set_Hash_On_Off, REQUIRED)   DEFINE Type Set_Hash_On_Off &     KEYWORD OFF, SYNTAX = Set_Hash_Off$     KEYWORD ON, SYNTAX = Set_Hash_On   DEFINE SYNTAX Set_Hash_Off !++  ! Descriptio                                                                                                                                                                                                                                               