Oberon || Library || Module Index || Search Engine || Definition || Module
PROCEDURE Get(VAR smallest, largest: INTEGER); PROCEDURE Set(smallest, largest: INTEGER);
PROCEDURE GetRandomPort() : INTEGER;
Unfortunately the system's choice of an ephemeral port number can be easily predicted on most operating systems. This can be a security risk where blind forgeries can be a threat. One example is the DNS protocol where UDP response packages can be successfully forged if the port number and the request id of the DNS client can be easily guessed.
EphemeralPortRange allows to reduce this risk by helping to select unpredictable ports. Set and Get allow to set and to retrieve the range of ephemeral ports that are to be used. By default, a range of 32768 up to 65535 is taken. This default can be changed by environment variables (see below).
GetRandomPort returns a port number out of the range of ephemeral port numbers using the unpredictable sequence of pseudo random numbers RandomGenerators.unpredictable.
Oberon || Library || Module Index || Search Engine || Definition || Module