1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package io.netty.handler.codec.haproxy;
18
19 final class HAProxyConstants {
20
21
22
23
24 static final byte COMMAND_LOCAL_BYTE = 0x00;
25 static final byte COMMAND_PROXY_BYTE = 0x01;
26
27
28
29
30 static final byte VERSION_ONE_BYTE = 0x10;
31 static final byte VERSION_TWO_BYTE = 0x20;
32
33
34
35
36 static final byte TRANSPORT_UNSPEC_BYTE = 0x00;
37 static final byte TRANSPORT_STREAM_BYTE = 0x01;
38 static final byte TRANSPORT_DGRAM_BYTE = 0x02;
39
40
41
42
43 static final byte AF_UNSPEC_BYTE = 0x00;
44 static final byte AF_IPV4_BYTE = 0x10;
45 static final byte AF_IPV6_BYTE = 0x20;
46 static final byte AF_UNIX_BYTE = 0x30;
47
48
49
50
51 static final byte TPAF_UNKNOWN_BYTE = 0x00;
52 static final byte TPAF_TCP4_BYTE = 0x11;
53 static final byte TPAF_TCP6_BYTE = 0x21;
54 static final byte TPAF_UDP4_BYTE = 0x12;
55 static final byte TPAF_UDP6_BYTE = 0x22;
56 static final byte TPAF_UNIX_STREAM_BYTE = 0x31;
57 static final byte TPAF_UNIX_DGRAM_BYTE = 0x32;
58
59
60
61
62 static final byte[] BINARY_PREFIX = {
63 (byte) 0x0D,
64 (byte) 0x0A,
65 (byte) 0x0D,
66 (byte) 0x0A,
67 (byte) 0x00,
68 (byte) 0x0D,
69 (byte) 0x0A,
70 (byte) 0x51,
71 (byte) 0x55,
72 (byte) 0x49,
73 (byte) 0x54,
74 (byte) 0x0A
75 };
76
77 static final byte[] TEXT_PREFIX = {
78 (byte) 'P',
79 (byte) 'R',
80 (byte) 'O',
81 (byte) 'X',
82 (byte) 'Y',
83 };
84
85 private HAProxyConstants() { }
86 }