DIRECTORY Commander, Convert USING [RopeFromRope], IO, FingerOps, FS, PupNet, Rope; UpdateMachineMap: CEDAR PROGRAM IMPORTS Commander, Convert, FS, FingerOps, PupNet, IO, Rope = { f: IO.STREAM _ NIL; GetNetNameTokenRope: PROC [stream: IO.STREAM] RETURNS [token: Rope.ROPE] ~ { breakNet: IO.BreakProc = { SELECT char FROM '# => RETURN [IO.CharClass.break]; ENDCASE => RETURN [IO.CharClass.other] }; -- breakNet RETURN [IO.GetTokenRope[stream: stream, breakProc: breakNet].token] }; -- GetNetNameTokenRope OnThisNetwork: PROC [netAddress, network: Rope.ROPE] RETURNS [BOOLEAN] ~ { breakNetAddress: IO.BreakProc = { SELECT char FROM ' => RETURN [IO.CharClass.break]; -- ie break on a space ENDCASE => RETURN [IO.CharClass.other] }; -- breakNetAddress na, net: Rope.ROPE _ NIL; stream: IO.STREAM _ IO.RIS[rope: netAddress]; BEGIN ENABLE IO.EndOfStream => CONTINUE; DO na _ IO.GetTokenRope[stream: stream, breakProc: breakNetAddress].token; net _ GetNetNameTokenRope[IO.RIS[rope: na]]; IF Rope.Equal[s1: net, s2: network, case: FALSE] THEN RETURN [TRUE] ENDLOOP; END; RETURN [FALSE] }; -- OnThisNetwork CSLFilter: PROC [name, owner, location, netAddress: Rope.ROPE, gateway, network: BOOLEAN] RETURNS [dataOK: BOOLEAN] ~ { dataOK _ IF network THEN (Rope.Equal[name, "Parc-Net3"] OR Rope.Equal[name, "35-Ethernet"] OR Rope.Equal[name, "Parc-Net5"] OR Rope.Equal[name, "Parc-Net6"] OR Rope.Equal[name, "Parc-Net24"] OR Rope.Equal[name, "Parc-2ndFloor-North"] OR Rope.Equal[name, "Bldg35-2ndFloor"] OR Rope.Equal[name, "Bldg35-3rdFloor"] OR Rope.Equal[name, "LarkSpur"] OR Rope.Equal[name, "Bldg35-1stFloor"]) ELSE (OnThisNetwork[netAddress, "3"] OR OnThisNetwork[netAddress, "5"] OR OnThisNetwork[netAddress, "6"] OR OnThisNetwork[netAddress, "24"] OR OnThisNetwork[netAddress, "64"] OR OnThisNetwork[netAddress, "131"] OR OnThisNetwork[netAddress, "142"] OR OnThisNetwork[netAddress, "173"] OR OnThisNetwork[netAddress, "204"]); }; -- CSLFilter pn: Commander.CommandProc = { o: IO.STREAM _ cmd.out; p: PupNet.P = { IF CSLFilter[name, owner, location, netAddress, gateway, network] THEN { f.PutF["%g\n\"Owner\" %g\n\"Location\" %g\n\"Net Address\" %g\n\"Gateway\" \"%g\"", IO.rope[Convert.RopeFromRope[name]], IO.rope[Convert.RopeFromRope[owner]], IO.rope[Convert.RopeFromRope[location]], IO.rope[Convert.RopeFromRope[netAddress]], IO.bool[gateway]]; f.PutF["\n\"Network\" \"%g\"\n\n", IO.bool[network]]; } }; f _ FS.StreamOpen["///Temp/pup-net.text", $create]; f.PutF["\"Owner\" $NoIndex \"Location\" $Index \"Net Address\" $Index \"Gateway\" $NoNukes \"Network\" $NoIndex\n"]; o.PutF["///Temp/pup-net.text "]; PupNet.ReadFile["[Indigo]Pup-Network.txt", p, o]; o.PutF["created.\nFinger database "]; f.Close[]; FingerOps.ReadMachineMap["///Temp/pup-net.text", TRUE]; o.PutF["updated.\n"]; }; Commander.Register["pup-to-finger", pn, "Update Finger Database from Pup-Network.txt"]; }.. ¬UpdateMachineMap.mesa Gifford, July 19, 1985 4:44:53 pm PDT Donahue, May 21, 1986 11:32:52 am PDT Ewan Tempero September 2, 1986 10:27:17 am PDT ... returns the next symbolic net name found in stream. [char: CHAR] RETURNS [IO.CharClass] ... determines whether netAddress is on network. netAddress is really a list of net addresses of the from num1#num2# separated by spaces. network must match num1. --edt [char: CHAR] RETURNS [IO.CharClass] get a net address get the net that this net address is on ... decides whether the data given by the arguments is something we want in the finger database. This is decided by looking at netAddress and deciding whether it is on one of the networks that I believe is used in PARC. No promises are made that every network mentioned is only used by PARC, nor do I guarentee that all networks used by PARC are actually tested for here. Note that if the machine is really a network then we check name rather than netAddress. --edt Ewan Tempero August 6, 1986 4:19:30 pm PDT UpdateMachineMap now filters its input so that only those machines that we are interested in ( we being CSL ) go into the database. changes to: OnThisNetwork and CSLFilter added. ÊטJšœ™šœ%™%Icode™%K™.—J˜šÏk ˜ J˜ Jšœœ˜Jšœ˜J˜ Jšœ˜J˜J˜—J˜šÏnœœ˜Jšœœœ ˜?J˜Jšœœœœ˜J˜š žœœ œœœœ˜LKšœ0Ïbœ™7K•StartOfExpansion' -- [char: CHAR] RETURNS [IO.CharClass]˜šœ œ˜KšÐck#™#K˜šœ˜Kšœœœ˜"Kšœœœ˜&—KšœÏc ˜—K˜K–-[stream: STREAM, breakProc: IO.BreakProc]šœœ9˜CKšœ¡˜K˜—Kš ž œœœœœ˜FKš œŸ œŸœŸ œOŸœ™¨šœ˜šœœ˜!Kš #™#K˜šœ˜Kšœœœ¡˜:Kšœœœ˜&—Kšœ¡˜—K˜K–)[rope: ROPE, oldStream: STREAM _ NIL]šœœœ˜Kš œœœœœ˜-K˜š˜Kšœœœ˜"K˜š˜Kšœ™Kšœœ@˜GKšœ'™'K–)[rope: ROPE, oldStream: STREAM _ NIL]šœœœ ˜,K–-[s1: ROPE, s2: ROPE, case: BOOL _ TRUE]š œ(œœœœ˜CKšœ˜—Kšœ˜K˜—Kšœœ˜Kšœ¡˜—J˜Kš ž œœ*œœœ œ˜sKšœ€Ÿ œ¦Ÿœ Ÿ œ™Òšœ˜šœ œ œ˜Kšœœ!œœœ œ)œ%œ%œœ%˜æ—š˜Kšœ œ œ œ!œ!œ"œ"œ"œ$˜¼—Kšœ¡ ˜—J˜˜Jšœœœ ˜˜šœAœ˜JK˜Jš œTœ#œ$œ'œ)œ˜…Jšœ#œ˜7—Jšœ˜—Jšœœ-˜3J˜tJšœ ˜ Jšœ:˜:J˜%J˜ Jšœ7˜7J˜J˜J˜—J˜WJ˜—J˜™*KšÏrœs™ƒKšœ ¢œ¢™.—K™—…— bå