Pup.mesa
Copyright © 1986 by Xerox Corporation. All rights reserved.
Hal Murray, March 22, 1986 3:51:26 pm PST
Clients occasionally need something in their interfaces and data structures to identify a machine.
If a ROPE isn't appropiate, a Pup.Address is the obvious choice.
These definitions live here (in a separate module) to minimize recompilation troubles.
Pup:
CEDAR
DEFINITIONS = {
BYTE: TYPE = [0..100H);
Addressing
A net/host pair defines a particular hardware interface.
A machine may have more than one interface. That means you can't compare Addresses to test for the same machine. This is called the back door problem. Gateways are the only common cases, but everybody should be prepared.
Normally, a machine with several interfaces will have the same host number on each of them. That's only a convenience for the gateway installers.
A net/host pair (and a null socket) is frequently packaged into an Address as a convient way to specify a machine.
A complete Address is needed to send a packet to a machine and/or to identify where it came from.
The socket identifies a logical process within a machine that should take care of the packet.
Occasionally there will be several processes for performance reasons. (RPC does this.)
You could multiplex several sockets into a single process, but that's not common.
Well Known Sockets are reserved for contacting servers. (aka Binding)
The common ones are defined in PupWKS.mesa.
They have a = 0, b = 0, and a small value in c.
Others socket numbers are assigned for temporary use by the PupPackage.
Address: TYPE = MACHINE DEPENDENT RECORD [net: Net, host: Host, socket: Socket];
Net:
TYPE =
RECORD [
BYTE];
0 means unknown/default.
Host:
TYPE =
RECORD [
BYTE];
0 is broadcast. 377 is reserved for unknown/default.
Socket:
TYPE =
RECORD [a, b, c, d:
BYTE];
[0,0,0,0] is reserved for unknown/default.
Defaults
Normally these mean "I don't know, you pick one." Occasionally they mean "I don't care."
nullNet: Net = [0];
nullHost: Host = [377B]; -- 0 is broadcast, not a good default
nullSocket: Socket = [0,0,0,0];
defined as 4 bytes rather than 2 words to ease conversion to a left handed machine
nullAddress: Address = [nullNet, nullHost, nullSocket];
Broadcasting
Sending to [[n], allHosts, ...] will reach all hosts on the specified network. That's called a directed broadcast.
Sending to [allNets, allHosts, ...] will reach all hosts on all directly connected networks. Note that this works out right on a workstation when the net number on the ethernet isn't yet known because all the gateways are down.
allNets: Net = [0];
allHosts: Host = [0];