Skip to content

Commit 85b2050

Browse files
bictorvlarsbrinkhoff
authored andcommitted
Make BUGHST, TCPGAT, DOMGAT, HDRGAT and GATHST be settable in NAMES.
1 parent ac4087f commit 85b2050

File tree

4 files changed

+107
-7
lines changed

4 files changed

+107
-7
lines changed

Makefile

+2-1
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,8 @@ $(OUT)/syshst/$(H3TEXT): build/$(H3TEXT)
372372

373373
$(OUT)/_mail_/$(NAMES): build/$(NAMES)
374374
$(MKDIR) $(OUT)/_mail_
375-
$(SED) -e 's/%MCHN%/$(MCHN)/' < $< > $@
375+
$(SED) -e 's/%MCHN%/$(MCHN)/' \
376+
-e 's/%GW%/$(GW)/' < $< > $@
376377

377378
$(KLH10):
378379
cd tools/klh10; \

build/misc.tcl

+1-4
Original file line numberDiff line numberDiff line change
@@ -222,10 +222,7 @@ expect ":KILL"
222222

223223
respond "*" "comsat\033j"
224224
respond "*" "\033l.mail.;comsat bin\r"
225-
respond "*" "bughst/$ip\r"
226-
type "domgat/$gw\r"
227-
type "tcpgat/$gw\r"
228-
type "debug/0\r"
225+
respond "*" "debug/0\r"
229226
type "xvers/0\r"
230227
type "purify\033g"
231228
respond ":PDUMP DSK:.MAIL.;COMSAT LAUNCH" "\r"

build/names.2010 build/names.2011

+16
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,22 @@
2525
(SYS-OPERATING-TROUBLE (EQV-LIST %MCHN%-ADMIN))
2626
(MAGIC-DRAGON-KEEPER (EQV-LIST %MCHN%-ADMIN))
2727

28+
; Gateways and bug host. To set a value, use (EQV-LIST @host), where
29+
; host is a known host name, or an (octal) Chaosnet address, or
30+
; an IP address such as 192.168.1.1. Remember the @.
31+
; *COMSAT-TCP-GATEWAY sets TCPGAT, which is used for all non-Chaosnet mail.
32+
(*COMSAT-TCP-GATEWAY (EQV-LIST @%GW%))
33+
; *COMSAT-DOMAIN-GATEWAY sets DOMGAT, which is used as a relay
34+
; for all unknown hostnames.
35+
(*COMSAT-DOMAIN-GATEWAY (EQV-LIST @%GW%))
36+
; *COMSAT-BUGHOST sets BUGHST: where to send BUG mail which isn't specified
37+
; below. Default is the local host.
38+
; *COMSAT-HEADER-GATEWAY sets HDRGAT, which is used in headers to create
39+
; user%host@HDRGAT headers on outgoing mail through relays.
40+
; *COMSAT-GATEWAY-HOST sets GATHST which is used to set the default
41+
; HDRGAT, TCPGAT, and DOMGAT for Chaos-only hosts. It has no effect on
42+
; Internet-connected hosts. It's better to set the entries above explicitly.
43+
2844
; Mail maintenance stuff. Do not fuck with this.
2945
(BUG-MAIL (EQV-LIST BUG-QMAIL))
3046
(BUG-MAILER (EQV-LIST BUG-QMAIL))

src/sysnet/comsat.585 src/sysnet/comsat.586

+88-2
Original file line numberDiff line numberDiff line change
@@ -2296,6 +2296,8 @@ INIT10: CALL SCOPN ; Initialize SC statistics channel.
22962296
CALL MGCFIX ; Fix whatever.
22972297
SETOM GCQFLG ; Garbage collect the queues when convenient
22982298

2299+
CALL MYGTWS ;Set up gateways etc
2300+
22992301
; Must initialize Schedule List. This implies setting up
23002302
; initial requests for any reminders or network sites which
23012303
; are queued.
@@ -2307,6 +2309,73 @@ INIT10: CALL SCOPN ; Initialize SC statistics channel.
23072309
; sleep...
23082310
JRST WAKEUP
23092311

2312+
;; Set up BUGHST, TCPGAT, DOMGAT and GATHST from entries in NAMES.
2313+
;; Get each special name, and update the corresponding setting if found.
2314+
MYGTWS: PUSH P,EQVTIB ; Save time of EQV file last loaded
2315+
CALL EQVCHK ; Update EQV if needed
2316+
POP P,A
2317+
CAME A,EQVTIB ; Same EQV time? Then do the update
2318+
RET ; If different, EQVCHK already called MYGTW0
2319+
; Call here from EQVCHK if EQV was updated.
2320+
MYGTW0: MOVE A,[ASCNT [*COMSAT-BUGHOST]]
2321+
CALL MYGTW
2322+
MOVEM A,BUGHST
2323+
MOVE A,[ASCNT [*COMSAT-TCP-GATEWAY]]
2324+
CALL MYGTW
2325+
MOVEM A,TCPGAT
2326+
MOVE A,[ASCNT [*COMSAT-DOMAIN-GATEWAY]]
2327+
CALL MYGTW
2328+
MOVEM A,TCPGAT
2329+
MOVE A,[ASCNT [*COMSAT-GATEWAY-HOST]]
2330+
CALL MYGTW
2331+
MOVEM B,GATHST
2332+
MOVE A,[ASCNT [*COMSAT-HEADER-GATEWAY]]
2333+
CALL MYGTW
2334+
MOVEM A,HDRGAT
2335+
;; Special hackery for header gw
2336+
SKIPN B,HDRGAT
2337+
RET
2338+
MOVE A,[440700,,GATNAM] ; Is there, get its name for header munging
2339+
CALL RESOLV"HSTSRC
2340+
JSR AUTPSY ; Better find it if are using it!
2341+
RET
2342+
2343+
;; Call with ASCNT in A. Returns +1 with address in A, or +2 if no match found.
2344+
MYGTW: PUSHAE [B,C,D]
2345+
MOVE D,A ;Save arg
2346+
MOVE B,[ASCNT [*MSG]]
2347+
CALL RCPEQV ;Get LP in A
2348+
JRST [ SKIPE DEBUG
2349+
PSTAT (,("No "),TC(D),(" found"))
2350+
JRST MYGTWZ ]
2351+
SKIPE DEBUG
2352+
PSTAT (,("Found "),TC(D))
2353+
PUSH P,L ;Save LSE
2354+
MOVE L,$ARLOC+EQVAR ;Make it current LSE
2355+
FINDA B,[A$RNAM,,[LISTAR(A)+1]] ; Get name
2356+
SETZ B,
2357+
FINDA C,[A$RHST,,[LISTAR(A)+1]] ; Get host
2358+
TDZA C,C ; none
2359+
MOVE C,LISTAR(C)+1 ; get its address
2360+
SKIPN C
2361+
JRST [ PSTAT (,("Warning: "),TC(D),(" defined but no host part given, or unknown host"))
2362+
POP P,L
2363+
JRST MYGTWZ ]
2364+
SKIPN B
2365+
JRST MYGTW2
2366+
HLRZ B,LISTAR(B)+1 ;get name part length
2367+
SKIPE B
2368+
PSTAT (,("Note: Only host part needed for "),TC(d))
2369+
MYGTW2: SKIPE DEBUG
2370+
PSTAT (,TC(D),(" name len "),DEC(B),(" host "),HST(C),(" = "),OCT(C))
2371+
MYGTW9: MOVE A,C ;Return its address
2372+
POP P,L ;Restore LSE
2373+
POPAE [D,C,B] ;and some acs
2374+
RET ;and return +1
2375+
MYGTWZ: POPAE [D,C,B] ;Restore some acs
2376+
SETZ A, ;No address to return
2377+
JRST POPJ1 ; and return +2 (not found)
2378+
23102379
SUBTTL INIT - Time checking
23112380

23122381
;;; The following performs follow-up checking on system time, after
@@ -2438,7 +2507,7 @@ HN$ML==:<HNCHA 3133>
24382507
HN$LCS==:<HNCHA 15044> ; LCS.MIT.EDU mail relay machine
24392508

24402509
; Magic address to drop into TCPGAT if we're a chaos-only machine.
2441-
GATHST: HN$LCS
2510+
LVAR GATHST: HN$LCS
24422511

24432512
; MTMHNG - Time Hanger... called immediately after determining that system
24442513
; doesn't know time. If running under DDT, will .VALUE appropriate
@@ -3000,6 +3069,7 @@ EQVCH3: CALL EQVGOB ; Attempt compile
30003069
STAT (,("Note: Backup failed... dying."))
30013070
JSR AUTPSY ; Refuse to run without beloved EQV file!
30023071
EQVCH7: STAT (,("Note: EQV file compiled."))
3072+
CALL MYGTW0 ; Update gateways and BUGHST is case of changes.
30033073
EQVCH9: POPAE P,[B,A]
30043074
.CLOSE DKIC,
30053075
RET
@@ -3025,19 +3095,34 @@ EQVCH5: .IOPUSH DKIC, ; Save channel.
30253095

30263096
;;; EQVBIN/EQVGET - Slurp binary up into core.
30273097

3098+
LVAR EQVTIB: 0 ;has creation date of last binary file loaded
3099+
30283100
EQVBIN: PUSH P,A
30293101
MOVE A,[EQVAR,,EQVFN1]
30303102
CALL DFGET ; Get compiled EQV data file.
30313103
JRST POPAJ ; Not there?
3104+
CALL EQVGTB ; Keep track of creation date
30323105
JRST POPAJ1
30333106

30343107
EQVGET: PUSH P,A ; Same but no erret provision
30353108
MOVE A,[EQVAR,,EQVFN1]
30363109
CALL DFGET
30373110
JSR AUTPSY
3111+
CALL EQVGTB ; Keep track of creation date
30383112
POP P,A
30393113
RET
30403114

3115+
;; Get creation date
3116+
EQVGTB: .IOPUSH DKIC,
3117+
MOVEI A,EQVFN1
3118+
CALL OPNMFI
3119+
JSR AUTPSY ; Can't not be there now?
3120+
SYSCAL RFDATE,[CIMM DKIC ? CRET A]
3121+
JSR SYSLOS
3122+
MOVEM A,EQVTIB ;Save it
3123+
.IOPOP DKIC,
3124+
RET
3125+
30413126

30423127
SUBTTL EQVGOB - Compilation of NAMES > ascii equivalence file
30433128

@@ -3097,6 +3182,7 @@ EQVG95: FWRITE TMPC,[[No errors detected for file ],6F,EQAFR1,[ ],6F,EQAFR2,[
30973182
CALL EQRPUT
30983183
MOVE A,[EQVAR,,EQVFN1]
30993184
CALL DFPUT ;write out the LSE
3185+
CALL EQVGTB ; Keep track of creation date
31003186
AOS -6(P) ;won, skip on return
31013187

31023188
EQVG99: POPAE P,[L,E,D,C,B,A] ;return
@@ -8469,7 +8555,7 @@ RXPB90: AOS -3(P)
84698555
RET
84708556

84718557
;; Kludge -- magic host address which can deal with BUG-RANDOM-PROGRAM
8472-
BUGHST: 0 ; If zero, use local host
8558+
LVAR BUGHST: 0 ; If zero, use local host
84738559

84748560
SUBTTL RXPERR - send error message after expansion/header.
84758561

0 commit comments

Comments
 (0)