perm filename PSVDEF.MAC[S,NET] blob
sn#823751 filedate 1986-08-27 generic text, type C, neo UTF8
COMMENT ⊗ VALID 00006 PAGES
C REC PAGE DESCRIPTION
C00001 00001
C00002 00002 PSVDEF.MAC[S,TVR] 9-DEC-81 16:51:00 EDIT BY TVR
C00004 00003
C00008 00004
C00012 00005
C00015 00006
C00018 ENDMK
C⊗;
;PSVDEF.MAC[S,TVR] 9-DEC-81 16:51:00 EDIT BY TVR
; Added flags to distinguish TENEX and WAITS code.
; Changed storage management for WAITS, which does not allocate on page basis.
;<PUP>PSVDEF.MAC;9 28-NOV-79 11:14:29 EDIT BY TAFT
; Give mail server distinct entry point
;<PUP>PSVDEF.MAC;8 4-NOV-79 12:44:35 EDIT BY TAFT
; Revise MAXHOP
;<PUP>PSVDEF.MAC;7 2-SEP-79 15:58:31 EDIT BY TAFT
;<PUP>PSVDEF.MAC;6 24-NOV-78 19:10:23 EDIT BY TAFT
; Increase LOGBFS to 2 pages
;<PUP>PSVDEF.MAC;5 15-APR-77 09:49:19 EDIT BY TAFT
; Move flag bits to avoid conflict with PUPDEF.MAC
;<PUP>PSVDEF.MAC;4 31-MAR-77 20:18:43 EDIT BY TAFT
; Add mail server to table
;<PUP>PSVDEF.MAC;3 18-MAR-77 19:02:06 EDIT BY TAFT
; Raise start of global storage
;<PUP>PSVDEF.MAC;2 18-MAR-77 17:47:28 EDIT BY TAFT
; Make symbols defined by the local GS, LS, etc. macros be internal
;<PUP>PSVDEF.MAC;1 10-MAR-77 14:02:43 EDIT BY TAFT
; Split out from PUPDEF.MAC
; This is stuff specific to the server (PUPSRV)
; Copyright 1979 by Xerox Corporation
UNIVERSAL PSVDEF -- DEFINITIONS SPECIFIC TO PUPSRV
SUBTTL E. A. Taft / March 1977
IFDEF GTJFN,<
TENEX==1
WAITS==0
>;IFDEF GTJFN
IFDEF SPCWAR,<
TENEX==0
WAITS==1
>;IFDEF SPCWAR
LOC 140 ; Labels in Universal must be unrelocatable
; Special accumulator assignments
PB=7 ; Pointer to packet buffer
CX=14 ; Connection table index
SV=15 ; Service table index
FX=16 ; Fork index of executing fork
; Parameters
NFORKS==↑D10 ; Max # of inferior forks
NCONNS==↑D100 ; Max # of connections maintained
IFE WAITS,<
NNETS==↑D63 ; Highest net number in routing tables
>;IFE WAITS
IFN WAITS,<
NNETS==377 ; Highest net number in routing tables
>;IFN WAITS
STKLEN==100 ; Length of stack
LOGBFS==↑D1024 ; Size of logging buffer
; All time parameters are in seconds
LOGLAT==↑D<5*60> ; Maximum logging latency
STTINT==↑D<12*60*60> ; Statistics logging interval
GCCINT==↑D<30*60> ; Garbage-collect connection table interval
POLINT==↑D30 ; Poll interval (for top fork)
WDTINT==↑D<5*60> ; Watchdog timer interval for inferiors
GATINT==↑D30 ; Gateway info broadcast interval
IFE WAITS,<
RTTINT==↑D90 ; Routing table entry timeout interval
>;IFE WAITS
IFN WAITS,<
;JJW 7/86 Increase RTTINT so there are more updates before timeout, to
;reduce lossage when we have trouble receiving from some gateways.
;Note: RTTINT*↑D1000 must fit in 18 bits.
RTTINT==↑D<4*60> ; Routing table entry timeout interval
>;IFN WAITS
DCKINT==↑D<5*60> ; Net dir server check interval
DPRINT==↑D<60*60> ; Net directory probe interval
; Flag assignments (accumulator F)
LGTTYF==1B9 ; Log error on TTY as well as file
CHKTMF==1B10 ; Need to check timers immediately
GATEWF==1B11 ; This host is a gateway
GATINF==1B12 ; Gateway info server initialization done
; Storage assignment parameters
; Must be in the order given and multiples of 1000
IGSLOC==030000 ; Start of global storage
IGSPLC==040000 ; Start of global page storage
ILSLOC==100000 ; Start of local storage
ILSPLC==120000 ; Start of local page storage
; Parameters and byte pointers defining the structure of a Packet Buffer (PB)
PBHEAD==0 ; Start of Pup Header
PUPLEN: POINT 16,PBHEAD(PB),15 ; Pup Length
PUPTCB: POINT 8,PBHEAD(PB),23 ; Transport Control Byte
PUPTYP: POINT 8,PBHEAD(PB),31 ; Pup Type
; PBHEAD+1
; B0-31 ; Pup ID
; PBHEAD+2
PPUPDN: POINT 8,PBHEAD+2(PB),7 ; Destination Network
PPUPDH: POINT 8,PBHEAD+2(PB),15 ; Destination Host
PPUPD0: POINT 16,PBHEAD+2(PB),31 ; High 16 bits of Destination Socket
; PBHEAD+3
PPUPD1: POINT 16,PBHEAD+3(PB),15 ; Low 16 bits of Destination Socket
PPUPSN: POINT 8,PBHEAD+3(PB),23 ; Source Network
PPUPSH: POINT 8,PBHEAD+3(PB),31 ; Source Host
; PBHEAD+4
PPUPSS: POINT 32,PBHEAD+4(PB),31 ; Source Socket
PBCONT==PBHEAD+5 ; Start of Pup Contents
MNPLEN==↑D22 ; Minimum Pup Length (bytes), incl header and checksum
MXPLEN==↑D554 ; Maximum Pup Length
MNPBLN==<MNPLEN+3>/4 ; Minimum size of PB, in words
MXPBLN==<MXPLEN+3>/4 ; Maximum size of PB, in words
MAXHOP==17 ; Maximum legal hop count
; Pup Type assignments
PT.ECH==1 ; Echo Me
PT.IEC==2 ; I'm An Echo
PT.BEC==3 ; I'm A Bad Echo
PT.ERR==4 ; Error
PT.RFC==10 ; Request for Connection
PT.ABT==11 ; Abort
PT.END==12 ; End
PT.ENR==13 ; End Reply
PT.DAT==20 ; Data
PT.ADA==21 ; AData
PT.ACK==22 ; Acknowledgment
PT.MRK==23 ; Mark
PT.INT==24 ; Interrupt
PT.INR==25 ; Interrupt Reply
PT.AMA==26 ; AMark
; Declaration of all implemented services
; Macro call is:
; X(name, socket, subroutine)
DEFINE SERVERS <
X(Telnet,1,TELSRV) ; Telnet server
X(GateInf,2,GATSRV) ; Gateway info server
X(FTP,3,FTPSRV) ; FTP server
X(Misc,4,MSCSRV) ; Miscellaneous services
X(Echo,5,ECHSRV) ; Echo server
X(Mail,7,MAISRV) ; Mail server
>
DEFINE X(NAME,SOCKET,ROUTINE) <
SV.'ROUTINE==NSERVS
NSERVS==NSERVS+1
>
NSERVS==0
SERVERS ; Count them
FEVSRV==NSERVS ; Index of first Event Report server
NEVSRV==5 ; Max # event report servers suppoerted
NSERVS==NSERVS+NEVSRV ; Accumulate total number of servers
IFN TENEX,<
; These storage assignment macros are used only in the
; definition file. The macros used in other modules are
; defined in PUPDEF.MAC
; Global storage assignment macros
; Assigns storage to be used globally or in top fork only.
; Declare global storage, word-at-a-time
DEFINE GS(LOC,SIZE<1>) <
LOC=:GSLOC
GSLOC==GSLOC+SIZE
>
; Declare global storage, page-at-a-time
DEFINE GSP(LOC,SIZE<1>) <
LOC=:GSPLOC
GSPLOC==GSPLOC+1000*<SIZE>
>
; Local storage assignment macros
; Assigns storage private to each fork (including the top fork).
; Storage assigned in PSVDEF is treated uniformly in all forks.
; Storage assigned elsewhere may be used only within that fork.
; Declare local storage, word-at-a-time
DEFINE LS(LOC,SIZE<1>) <
LOC=:LSLOC
LSLOC==LSLOC+SIZE
>
; Declare local storage, page-at-a-time
DEFINE LSP(LOC,SIZE<1>) <
LOC=:LSPLOC
LSPLOC==LSPLOC+1000*<SIZE>
>
; Declare start of storage regions
GSLOC==IGSLOC
GSPLOC==IGSPLC
LSLOC==ILSLOC
LSPLOC==ILSPLC
>;IFN TENEX
IFN WAITS,<
;Allocate everything in the same area. Only one fork and impure code.
DEFINE GS(LOC,SIZE<1>) <
LOC: BLOCK SIZE
>;DEFINE GS
DEFINE LS(LOC,SIZE<1>) <
LOC: BLOCK SIZE
>;DEFINE LS
DEFINE LSP(LOC,SIZE<1>) <
LOC: BLOCK SIZE*1000
>;DEFINE LSP
>;IFN WAITS
; Global storage assignments
; Fork tables
GS FRKHND,NFORKS ; Fork handle (0 => slot empty)
GS FRKJFN,NFORKS ; Input JFN ,, Output JFN
GS FRKSRV,NFORKS ; Connection table ,, Service table indices
GS FRKTIM,NFORKS ; Time at which to flush fork
; Connection tables
GS CONLNH,NCONNS ; Local net,,host
GS CONLSK,NCONNS ; Local socket number
GS CONFNH,NCONNS ; Foreign net,,host
; 0 => slot empty
GS CONFSK,NCONNS ; Foreign socket
GS CONCID,NCONNS ; Connection ID
GS CONFRK,NCONNS ; Tenex connection index ,, fork table index
; -1 in rh => no fork for connection
; Data base for log maintenance
GS LOGLCK ; Interlock for logging routines
GS LOGLKF ; Fork # of last locker of LOGLCK
GS LOGTIM ; Time of last real append to log file
GS LOGBPT ; Byte ptr into LOGBUF
GS LOGBUF,LOGBFS ; Buffer region for logging entries
; Local (per-process) storage assignments, used universally
LS FORKX ; Global fork index of my fork
LS SERVX ; Server table index for current service
LS CH1PC ; PSI return locations
LS CH2PC
LS CH3PC
LS STACK,STKLEN ; Local stack
LSP TEMP,1 ; One page for general scratch use
; Initialize variable storage PC's to be used in other modules
IFE WAITS,<
GSVAR=:GSLOC ; Storage global to all forks
GSPVAR=:GSPLOC
TOPVAR=:LSLOC ; Storage local to top fork
TOPPVR=:LSPLOC
FTPVAR=:LSLOC ; Storage local to FTP server fork
FTPPVR=:LSPLOC
>;IFE WAITS
IFN WAITS,<
GLBEND:
>;IFN WAITS
PURGE GS,GSP,LS,LSP ; Will be redefined by USEVAR
RELOC .-140 ; Bypass unrelocatable data
END