fix: Add TestReqID(112) to TestRequest handling

FIX engine is required to send the same TestReqID(112) as part of a
Heartbeat message that is sent in response to TestRequest message.

Signed-off-by: Pekka Enberg <penberg@kernel.org>
FIX: each test case should end with the server and client termination

Terminate the server and the client both in the case of a test file
failure and test file success

Signed-off-by: Marat Stanichenko <mstanichenko@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
Don't treat FIX test case scripts as binary

Signed-off-by: Pekka Enberg <penberg@kernel.org>
FIX: a new test case is added to the FIX testing suite

If an incoming message has MsgSeqNum higher than expected,
one should repond with Reset Request message. The added
2b_MsgSeqNumHigherThanExpected test file checks this logic.

Signed-off-by: Marat Stanichenko <mstanichenko@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
tools/test-fix-client: Remove 'protocol info' structure

The program only supports the FIX protocol so drop the unnecessary
'protocol info' indirection.

Signed-off-by: Pekka Enberg <penberg@kernel.org>
tools/test-fix-client: Fix program name in usage

Signed-off-by: Pekka Enberg <penberg@kernel.org>
tools/test-fix-client: Make SenderCompID and TargetCompID configurable

Signed-off-by: Pekka Enberg <penberg@kernel.org>
Update FIX known issues list

Signed-off-by: Pekka Enberg <penberg@kernel.org>
tools/test.py: Fix extra newlines for "-v" option

Signed-off-by: Pekka Enberg <penberg@kernel.org>
FIX: New Order Single and Execution Report support is added

Signed-off-by: Marat Stanichenko <mstanichenko@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
fix: Rename fix_message_has_tag() to fix_get_field()

The helper function looks up a 'struct fix_field' from a 'struct
fix_message' so rename it appriopriately.

Signed-off-by: Pekka Enberg <penberg@kernel.org>
fix: Introduce 'enum fix_msg_type' and use it

Introduce a libtrading internal 'fix_msg_type' enumeration and convert
the MsgType(35) string value to it in the parse_msg_type() function.

Signed-off-by: Pekka Enberg <penberg@kernel.org>
fix: Use FIX_MSG_TYPE prefix for 'fix_msg_type' enumerations

Signed-off-by: Pekka Enberg <penberg@kernel.org>
fix: Fix formatting in lib/proto/fix_message.c

Signed-off-by: Pekka Enberg <penberg@kernel.org>
fix: Fix formatting in include/libtrading/proto/fix_message.h

Signed-off-by: Pekka Enberg <penberg@kernel.org>
FIX: test-fix-client cleanup

* Session level messages are to be handled by fix_session_process()
* If an incoming message has sequence number less than expected we
  have to check the PossDupFlag

Signed-off-by: Marat Stanichenko <mstanichenko@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
FIX: test-fix-client a new testing mode is added

A small performance test is added to the test-fix-client.
When this test is invoked a client starts sending a number
of New Single Orders to the server. Once an Execution Report
arrives, a client calculates the round-trip latency.

The first timestamp is made just before the client sends
a New Single Order, the second timestamp is made just after
an Execution Report arrives. So, the round-trip latency is
the difference between the second and first timestamps
expressed in microseconds. From what has been said, it
is clear that this latency is made of four main parts:
encoding a New Order Single by the client, decoding a
FIX message by the server, encoding an Execution Report
by the server and decoding a FIX message by the client.

A new command line option is added to the test-fix-client.
So, if one would like to run a test she just need to specify
the -t option with the number of Execution Reports sent e.g
test-fix-client -t 10000 [hostname] [port] [version] [sender] [target]
would trigger a test with 10000 Orders sent.

Signed-off-by: Marat Stanichenko <mstanichenko@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
tools/test-fix-client: Use clock_gettime(CLOCK_MONOTONIC)

Use monotonic clock with nanosecond precision for FIX engine latency
measurements.

Signed-off-by: Pekka Enberg <penberg@kernel.org>