For the convenience of the user, nodes are identified through an integer, the nodeID. The network uses internet addresses, which are six byte addresses. In order to conform to the hardware, the simulated network converts all node identifiers into network addresses. The exact nature of the conversion is not important, as long as every nodeID corresponds to exactly one unique network address and vice versa.
global items used by the functions:
void
NetworkToNode (const addr* networkAddress, SINT32& nodeID): Computes
the user node ID for a network address and copies it into nodeID.
If the networkAddress is NULL, an assert fails.
void
NodeToNetwork (SINT32 nodeID, addr* networkAddress): Computes the
network address for a node with the user identifier nodeID and
copies it into networkAddress. If the networkAddress
is NULL or the nodeID is negative, an assert fails.