DEFINITION MODULE UDP;


IMPORT
  SYSTEM;


EXPORT QUALIFIED
  Handle, Address, Socket, SendRC, RecVRC,
  
  Send, RecV, 
  ReserveSocket, ReserveAnySocket, ReadWildIPAddress, ReadIPAddress;


TYPE
  Handle = INTEGER;
  Address = CARDINAL;
  Socket = 
    RECORD
      port:[0..0ffffH];
      addr:Address
    END;
  SendRC = INTEGER;
  RecVRC = INTEGER;

  
PROCEDURE Send(
  to:    Socket;
  hand:  Handle;
  data:  SYSTEM.ADDRESS;
  length:CARDINAL
 ):SendRC;

PROCEDURE ReserveSocket(sock:Socket):Handle;

PROCEDURE ReserveAnySocket(VAR sock:Socket):Handle;

PROCEDURE ReadWildIPAddress():Address;

PROCEDURE RecV(
      hand: Handle;
  VAR from: Socket;         (* Out *)
      data: SYSTEM.ADDRESS;
  VAR len:  CARDINAL        (* InOut *)
 ):RecVRC;

PROCEDURE ReadIPAddress():Address;

END UDP.
