summaryrefslogtreecommitdiffstats
path: root/include/haproxy/fix-t.h
blob: 4b4de5583c13013340828a0f68bd0aed379ed4e1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
/*
 * include/haproxy/fix-t.h
 * This file contains structure declarations for FIX protocol.
 *
 * Copyright 2020 Baptiste Assmann <bedis9@gmail.com>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation, version 2.1
 * exclusively.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 */

#ifndef _HAPROXY_FIX_T_H
#define _HAPROXY_FIX_T_H

#include <import/ist.h>

/*
 * FIX messages are composed by a list of Tag=Value separated by a 'delimiter'
 */
#define FIX_DELIMITER 0x01

/*
 * know FIX version strings
 */
#define FIX_4_0     (ist("FIX.4.0"))
#define FIX_4_1     (ist("FIX.4.1"))
#define FIX_4_2     (ist("FIX.4.2"))
#define FIX_4_3     (ist("FIX.4.3"))
#define FIX_4_4     (ist("FIX.4.4"))
#define FIX_5_0     (ist("FIXT.1.1"))
/* FIX_5_0SP1 and FIX_5_0SP2 have the same version string than FIX5_0 */

/*
 * Supported FIX tag ID
 */
#define FIX_TAG_BeginString    8
#define FIX_TAG_BodyLength     9
#define FIX_TAG_CheckSum       10
#define FIX_TAG_MsgType        35
#define FIX_TAG_SenderCompID    49
#define FIX_TAG_TargetCompID    56


#define FIX_MSG_MINSIZE        26 /* Minimal length for a FIX Message */
#define FIX_CHKSUM_SIZE        7  /* Length of the CheckSum tag (10=NNN<delim>) */
/*
 * return code when parsing / validating FIX messages
 */
#define FIX_INVALID_MESSAGE   -1
#define FIX_NEED_MORE_DATA     0
#define FIX_VALID_MESSAGE      1

#endif /* _HAPROXY_FIX_T_H */

/*
 * Local variables:
 *  c-indent-level: 8
 *  c-basic-offset: 8
 * End:
 */