From 2ee1484c24f61bc883cf3d873b97b3cbc6b464f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Victor?= Date: Tue, 3 Aug 2021 16:56:24 +0200 Subject: [PATCH] Read the IP configuration from NOP from IMP With support in KLH10 (dpimp version 1.1.4 or later), read the IP configuration from the NOP sent. The IP address is in the network, source host, and source IMP fields, and the subnet mask size is in the "handling type" field. The first and last of these are very non-standard, but hey... it works. --- src/system/{imp.367 => imp.368} | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) rename src/system/{imp.367 => imp.368} (97%) diff --git a/src/system/imp.367 b/src/system/imp.368 similarity index 97% rename from src/system/imp.367 rename to src/system/imp.368 index 47927dc1..16a400e8 100644 --- a/src/system/imp.367 +++ b/src/system/imp.368 @@ -607,8 +607,29 @@ IMPGD: LDB B,[420200,,IMPILB+2] ;Reason (see 1822) JRST IMPIRT ;;; IMP->Host Type 4 - NOP +;;; With support in KLH10 (dpimp version 1.1.4 or later), +;;; read the IP configuration from the NOP sent. +;;; The IP address is in the network, source host, and source IMP fields, +;;; and the subnet mask size is in the "handling type" field. +;;; The first and last of these are very non-standard, but hey... it works. -IMPIN: JRST IMPIRT ;One more NOP from IMP +IMPIN: LDB T,[241000,,IMPILB+0] ;get network byte (ip[0]) + JUMPE T,IMPIRT ; none: incompatible IMP code + LSH T,24. + LDB TT,IMSABP ; get source host+IMP (ip[1..3]) + IOR T,TT + MOVEM T,NIFIPA ; save our IP address + LDB T,[341000,,IMPILB+1] ; get subnet mask size + SUBI T,32. ; bits to shift + HRLOI TT,37777 ; 32 bits set + LSH TT,(T) ; shift right + MOVNS T + LSH TT,(T) ; shift left again + MOVEM TT,NIFIPM + MOVE T,NIFIPA ; make network part of address + AND T,NIFIPM + MOVEM T,NIFIPN ; save it + JRST IMPIRT ;One more NOP from IMP ;;; IMP->Host Type 5 - RFNM (Ready For Next Message)