Product Documentation

FairCom ISAM for C

Previous Topic

Next Topic

cttrap - Communications Trap Playback utility

Client application to "play back" a TRAP_COMM log file made by using the DIAGNOSTICS TRAP_COMM server keyword to "record" the communication traffic coming in to a server.

Operational Model:

  • Client

Usage

cttrap [-display | -displayonly] [-p <password_file>] [-t <trapcomm_log_file_name>] [-s <servername>] [-v] [-x]

where:

  • -display - Displays log file contents and replays the function calls
  • -displayonly - Displays log file contents without replaying the function calls
  • -p - Specifies text file containing user name and password list
  • -v - Enables verbose output
  • -x - Disables inter-thread ordering for fast replay

Description

When activated, the DIAGNOSTICS TRAP_COMM keyword instructs the FairCom Server to log incoming communications packets to TRAPCOMM.FCS prior to execution. This log can be played back using the cttrap utility and a debug Server to observe the results of the client requests, allowing the developer to exactly duplicate and repeat client activities.

cttrap is a multi-threaded client application that "plays back" a TRAPCOMM.FCS log file. Whenever a multi-threaded client library is created, cttrap will also be generated.

DIAGNOSTICS TRAP_COMM Keyword

When the DIAGNOSTICS TRAP_COMM keyword is active, the trap file, TRAPCOMM.FCS, is created in the server directory by default. To prepend a path onto the trap file name (to route it to a separate disk or directory), add an entry of the form DIAGNOSTIC_STR <trap file path>. For example, if the trap file is located in /bigdisk/TRAPCOMM.FCS, the configuration file needs to contain the following:

DIAGNOSTIC_STR /bigdisk/

Example:

C:\> cttrap -t TRAPCOMM.FCS -displayonly

c-tree(tm) Version 12.0.0.103(Build-190918)

Client Communication Replay Utility

Copyright (C) 1992 - 2019 FairCom Corporation

ALL RIGHTS RESERVED.

seqnum taskid function filno long size outlen mode filename

3 24 INTISAM 0 0 0 0 0

5 24 ctSETCOMPRESS 3 1 1 0 55

7 24 SYSCFG 0 0 0 1024 0

9 24 TRANBEG 50 0 0 0 0

89 24 OPNRFIL 5 -1 0 2064 0 qadfridx.dat

...

255 25 SETNODE 0 0 0 0 0

257 25 SYSCFG 0 0 0 1024 0

259 25 STPUSR 0 0 0 0 0

cttrap is processing log file \TRAPCOMM.FCS for FAIRCOMS [upto 256 clients]

Starting Time Stamp: 1568924640 Server Flavor: LOW_HIGH

Using a Password File

To allow cttrap to connect to a password-protected server when reading from a TRAPCOMM.FCS file, use the -p <password_file> option to specify the name of a text file containing a list of user names and passwords, one per line. For example, the file pass.txt might contain the entries:

ADMIN ADMIN

myusername mypswd

Then cttrap can be run as follows:

cttrap TRAPCOMM.FCS -p pass.txt FAIRCOMS

The passwords must match the passwords on the server where the playback occurs, not necessarily where the playback was recorded.

Up to 16 user name/password entries can be specified in the cttrap password file. If you wish to support more entries, change #define MAXUPW in cttrap.c and recompile the utility.

History

Before V11.9, prior usage was as follows:

cttrap <Trap Comm Log File Name> [-p <password_file>][-x] [<Server>]

Where:

  • <TrapCommLogFileName> - the name of the file to be played back.
  • <ServerName> - the optional name of the server.
  • -p <password_file> - use a text file containing a list of user names and passwords, one per line (see Using a Password File, below).
  • -x - skip serialization. cttrap serializes all the recorded operations and enforces the original call ordering when allowing multiple client threads to replay the original operation. The ‑x option allows for faster replay, although it increases the likelihood of causing errors or differences in the final state of the data that did not exist in the original.

See Also

TOCIndex