Copyright (C) 1984 by Xerox Corporation. All rights reserved. The following program was created in 1983 but has not been published within the meaning of the copyright law, is furnished under license, and may not be used, copied and/or disclosed except in accordance with the terms of said license.
TCPStates.mesa
Last Edited by: Nichols, August 26, 1983 4:34 pm
Last Edited by: Taft, January 4, 1984 11:09 am
John Larson, April 14, 1986 11:19:47 pm PST
DIRECTORY
IPDefs USING [Datagram],
TCP USING [Reason, TCPInfo],
TCPOps USING [TCPHandle];
TCPStates: CEDAR DEFINITIONS
~ BEGIN
Open: PROC [tcpInfo: TCP.TCPInfo] RETURNS [handle: TCPOps.TCPHandle];
Attempts to open a new TCP connection. Returns a TCPHandle to use or raises TCP.OpenFailed if the Open request conflicts with an existing request or is a duplicate Open request on the same connection. The connection is open either in the LISTEN or SYNSENT state. In the LISTEN state, wait for a SYN from the remote TCP; in the SYNSENT state, send a SYN to initiate the connection. If an Open call is done to open a connection in the LISTEN state, then another Open call can be done to send the SYN and put the connection in the SYNSENT state.
Close: PROC [handle: TCPOps.TCPHandle];
Close the TCP connection; raises an error if the connection does not exist or is already closing. Sends a FIN to the remote TCP. Note that the user may receive more data from the remote TCP after calling Close.
Abort: PROC [handle: TCPOps.TCPHandle];
Abort the connection. This routine sends a TCP Reset if necessary; it calls CloseConnection to dispose of all the connection specific storage.
CloseConnection: PROC [handle: TCPOps.TCPHandle, reason: TCP.Reason];
Clear off the transmit and retransmit queues and remove this handle form the list.
ValidHandle: PROC [handle: TCPOps.TCPHandle];
Check if handle given as argument by user is valid. Called by Abort, Close, and Send. Raises TCP.StreamClosing if bad handle, else it just returns.
FindHandle: PROC [rcvdDatagram: IPDefs.Datagram] RETURNS [handle: TCPOps.TCPHandle];
Find matching handle for segment received from the net.
CopyHandleList: PROC RETURNS [handleListCopy: LIST OF REF ANY];
Make a copy of the handle list for the retransmit procedure to look at.
GetInitialSequenceNumber: PROC RETURNS [INT];
Generate an initial send sequence number for a connection.
END.