TCPLOG (JANUS DEFINE parameter): Difference between revisions

From m204wiki
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
Line 8: Line 8:
The log file is opened and cleared when the associated Janus port is started, and it is closed when the port is stopped or if an error occurs writing data to the dataset.  
The log file is opened and cleared when the associated Janus port is started, and it is closed when the port is stopped or if an error occurs writing data to the dataset.  


The log data is written in variable length blocks. The first four bytes of a block contain the length of the block. Each block contains at least one record. No character translation or formatting is done for the actual TCP data.  
The log data is written in variable length blocks. The first four bytes of a block contain the length of the block. Each block contains at least one record. No character translation or formatting is done for the actual TCP data. Since the blocks are standard variable length blocks, they all start with a Block Descriptor Word or <var>BDW</var> which consists of a halfword block length followed by two bytes of zero.
 
The layout of a block and record is described in detail below:
 
<p class="code"> Offset Length Type Description
------ ------ --------------- -----------------------------------
0-3 4 Unsigned binary BDW (Block descriptor word):
the length of the block
4-5 2 Unsigned binary RDW (Record descriptor word):
the length of the current record
6-7 2 Unused
8-15 8 Unsigned binary Unique TCP connection number
16-23 8 Unsigned binary Time of day in clock units
24-27 4 Unsigned binary Remote IP address
28-31 4 Unsigned binary Local IP address
32-33 2 Unsigned binary Remote port number
34-35 2 Unsigned binary Local port number
36-36 1 EBCDIC character Direction: S (Sent) or R (Received)
37-37 1 Unused
38-39 2 Unsigned binary Length of TCP data
39-n v Any TCP data
</p>


The layout of the records in each block is described in detail below:
<table class="syntaxTable">
<tr><th>Offset</th><th>Length</th><th>Type</th><th>Description</th></tr>
<tr><td align="right">0</td><td align="right">2</td><td>Unsigned binary</td><td>RDW (Record descriptor word): the length of the current record</td></tr>
<tr><td align="right">2</td><td align="right">2</td><td>Unused</td><td>Unused</td></tr>
<tr><td align="right">4</td><td align="right">8</td><td>Unsigned binary</td><td>Unique TCP connection number</td></tr>
<tr><td align="right">12</td><td align="right">8</td><td>Unsigned binary</td><td>Time of day in clock units</td></tr>
<tr><td align="right">20</td><td align="right">4</td><td>Unsigned binary</td><td>Remote IP address</td></tr>
<tr><td align="right">24</td><td align="right">4</td><td>Unsigned binary</td><td>Local IP address</td></tr>
<tr><td align="right">28</td><td align="right">2</td><td>Unsigned binary</td><td>Remote port number</td></tr>
<tr><td align="right">30</td><td align="right">2</td><td>Unsigned binary</td><td>Local port number</td></tr>
<tr><td align="right">32</td><td align="right">1</td><td>EBCDIC character</td><td>Direction: S (Sent) or R (Received)</td></tr>
<tr><td align="right">33</td><td align="right">1</td><td>Unused</td><td>Unused</td></tr>
<tr><td align="right">34</td><td align="right">2</td><td>Unsigned binary</td><td>Length of TCP data</td></tr>
<tr><td align="right">36</td><td align="right">v</td><td>Binary</td><td>Any TCP data</td></tr>
</table>
The TCPLOG dataset '''cannot''' be shared by multiple Janus ports.  
The TCPLOG dataset '''cannot''' be shared by multiple Janus ports.  



Revision as of 00:13, 4 April 2011

<section begin="desc" />TCPLOG filename -- log TCP activity to flatfile.<section end="desc" />

TCPLOG is a parameter on JANUS DEFINE, which defines and sets characteristics of a Janus port. See the List of JANUS DEFINE parameters.

A Janus Web Server port definition parameter, TCPLOG, tells Janus Web Server to log in a sequential dataset all inbound and outbound TCP data transmitted for this port. The dataset name is specified as the value that follows the TCPLOG keyword.

The log file is opened and cleared when the associated Janus port is started, and it is closed when the port is stopped or if an error occurs writing data to the dataset.

The log data is written in variable length blocks. The first four bytes of a block contain the length of the block. Each block contains at least one record. No character translation or formatting is done for the actual TCP data. Since the blocks are standard variable length blocks, they all start with a Block Descriptor Word or BDW which consists of a halfword block length followed by two bytes of zero.

The layout of the records in each block is described in detail below:

OffsetLengthTypeDescription
02Unsigned binaryRDW (Record descriptor word): the length of the current record
22UnusedUnused
48Unsigned binaryUnique TCP connection number
128Unsigned binaryTime of day in clock units
204Unsigned binaryRemote IP address
244Unsigned binaryLocal IP address
282Unsigned binaryRemote port number
302Unsigned binaryLocal port number
321EBCDIC characterDirection: S (Sent) or R (Received)
331UnusedUnused
342Unsigned binaryLength of TCP data
36vBinaryAny TCP data

The TCPLOG dataset cannot be shared by multiple Janus ports.

The TCPLOG parameter is valid only for WEBSERV ports.

This parameter was introduced in Sirius Mods version 7.2.

References

See: List of Janus commands | List of JANUS DEFINE parameters.