DIRECTORY Arpa USING [Address], ArpaExtras USING [IsBroadcastWithMask], ArpaTranslation USING [DetermineAddressAndSubnetMaskForInterface, GetSubnetMask], CommBuffer USING [], CommDriver USING [Buffer, GetNetworkChain, InsertReceiveProc, Network, RecvProc], CommDriverType USING [Encapsulation], Pup USING [allHosts, Host] ; ArpaEthernetOneTranslation: CEDAR MONITOR IMPORTS ArpaExtras, ArpaTranslation, CommDriver EXPORTS CommBuffer ~ { Address: TYPE ~ Arpa.Address; Buffer: TYPE ~ CommDriver.Buffer; Network: TYPE ~ CommDriver.Network; Encapsulation: PUBLIC TYPE ~ CommDriverType.Encapsulation; -- exported to CommBuffer GetEncapsulation: PROC [network: Network, address: Address] RETURNS [Encapsulation] ~ { dest: Pup.Host _ [address.d]; IF ArpaExtras.IsBroadcastWithMask[address, ArpaTranslation.GetSubnetMask[network]] THEN dest _ Pup.allHosts; TRUSTED { RETURN[ [ethernetOne[etherSpare1~[0,0], etherSpare2~[0,0], etherSpare3~[0,0], etherSpare4~[0,0], etherSpare5~[0,0], ethernetOneDest~dest, ethernetOneSource~network.pup.host, ethernetOneType~arpa]] ] }; }; translationPacketsReceived: CARD _ 0; RecvTranslation: CommDriver.RecvProc ~ { translationPacketsReceived _ translationPacketsReceived + 1; RETURN[buffer]; }; Init: PROC = { FOR network: Network _ CommDriver.GetNetworkChain[], network.next UNTIL network = NIL DO IF network.type # ethernetOne THEN LOOP; IF NOT ArpaTranslation.DetermineAddressAndSubnetMaskForInterface[network].ok THEN LOOP; network.arpa.getEncapsulation _ GetEncapsulation; CommDriver.InsertReceiveProc[network~network, type~arpaTranslate, proc~RecvTranslation]; ENDLOOP; }; Init[]; }. ςArpaEthernetOneTranslation.mesa Copyright c 1986 by Xerox Corporation. All rights reserved. Demers, August 23, 1987 11:00:09 am PDT This is a dummy to be used until we get our act together on RARP, ICMP Subnet Mask, ... Encapsulating Arpa Packets Pup host to use is just low order byte of Arpa address, unless broadcast. Processing Received Translation Packets [network: Network, buffer: Buffer, bytes: NAT] RETURNS [Buffer] Initialization Install self for each ethernetOne on the chain. Κ˜codešœ™Kšœ Οmœ1™