Copyright (C) 1983 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.
TCPLogging.mesa
Last Edited by: Nichols, August 23, 1983 11:40 pm
Last Edited by: Taft, January 4, 1984 12:56 pm
Last Edited by: HGM, March 23, 1984 3:59:43 am PST
John Larson, April 14, 1986 11:19:06 pm PST
DIRECTORY
IO USING [STREAM],
IPDefs USING [Datagram],
Rope USING [ROPE],
TCPOps USING [ConnectionState, TCPHandle];
TCPLogging: CEDAR DEFINITIONS
~ BEGIN
Direction: TYPE ~ {fromNet, toNet, rexmitToNet};
pktFile, logFile: IO.STREAM; -- make non-NIL to enable logging
PrintTCPPacket: PROC [handle: TCPOps.TCPHandle, data: IPDefs.Datagram, dir: Direction];
Print or log TCP packets. The following information is printed for each packet:
state of Connection
Received, Sent or Retransmitted (R, S or X)
Control Flags (Urgent, Ack, Push, Reset, SYN, FIN)
Sequence number mod 100000
Ack number mod 100000
Window
length (number of bytes of TCP header and data)
source Address and Port -> Destination Address and Port
PrintStateChange: PROC [handle: TCPOps.TCPHandle, newState: TCPOps.ConnectionState];
Print or log state transitions.
PrintMessage: PROC [r: Rope.ROPE];
END.