ArpaTranslation.mesa
Demers, August 19, 1987 12:47:51 pm PDT
Generic Kludge for Arpa host number and subnet masking.
Eventually this will disappear, after we have RARP and Address Mask ICMP servers and can recompile CommDriver to put the net and subnetMask in the Network object where they belong.
DIRECTORY
Arpa USING [Address],
CommDriver USING [Network]
;
ArpaTranslation: CEDAR DEFINITIONS
~ {
Address: TYPE ~ Arpa.Address;
Network: TYPE ~ CommDriver.Network;
Storage area for Arpa Net and Subnet Mask
Kept in net.arpa.translation.
NetAndSubnetMask: TYPE ~ REF NetAndSubnetMaskObject;
NetAndSubnetMaskObject: TYPE ~ RECORD [
net: Arpa.Address,
subnetMask: Arpa.Address,
translation: REF
];
INLINEs to hide how we store net and mask fields
GetNet: PROC [n: Network] RETURNS [Arpa.Address] ~ INLINE {
RETURN [NARROW[n.arpa.translation, NetAndSubnetMask].net] };
GetSubnetMask: PROC [n: Network] RETURNS [Arpa.Address] ~ INLINE {
RETURN [NARROW[n.arpa.translation, NetAndSubnetMask].subnetMask] };
GetTranslationTable: PROC [n: Network] RETURNS [REF] ~ INLINE {
RETURN [NARROW[n.arpa.translation, NetAndSubnetMask].translation] };
PutTranslationTable: PROC [n: Network, table: REF] ~ INLINE {
NARROW[n.arpa.translation, NetAndSubnetMask].translation ← table };
Initialization Proc
To be called by translation proc for each network.
DetermineAddressAndSubnetMaskForInterface: PROC [n: Network]
RETURNS [ok: BOOL];
Fills in n.arpa.host, n.arpa.translation.net, n.arpa.translation.subnetMask. (Don't ask how).
In the (perhaps distant) future this function will be performed by individual translation modules, e.g. using RARP and Address Mask ICMP messages.
This can fail (returning FALSE).
}...