DOC: proxy_protocol: Reserve TLV type 0x05 as PP2_TYPE_UNIQUE_ID
This reserves and defines TLV type 0x05.
(cherry picked from commit b435f7762026dd7d278863900b8ab8603529c3f4)
Signed-off-by: Willy Tarreau <w@1wt.eu>
(cherry picked from commit 3fbbcbf2c212661f27bdbbd48d2d27306d7527b7)
Signed-off-by: Willy Tarreau <w@1wt.eu>
diff --git a/doc/proxy-protocol.txt b/doc/proxy-protocol.txt
index 52d7bc7..ff64c8b 100644
--- a/doc/proxy-protocol.txt
+++ b/doc/proxy-protocol.txt
@@ -1,4 +1,4 @@
-2017/03/10 Willy Tarreau
+2020/03/05 Willy Tarreau
HAProxy Technologies
The PROXY protocol
Versions 1 & 2
@@ -27,6 +27,7 @@
reserved TLV type ranges, added TLV documentation, clarified
string encoding. With contributions from Andriy Palamarchuk
(Amazon.com).
+ 2020/03/05 - added the unique ID TLV type (Tim Düsterhus)
1. Background
@@ -538,6 +539,7 @@
#define PP2_TYPE_AUTHORITY 0x02
#define PP2_TYPE_CRC32C 0x03
#define PP2_TYPE_NOOP 0x04
+ #define PP2_TYPE_UNIQUE_ID 0x05
#define PP2_TYPE_SSL 0x20
#define PP2_SUBTYPE_SSL_VERSION 0x21
#define PP2_SUBTYPE_SSL_CN 0x22
@@ -602,7 +604,17 @@
to align only by 3 or more bytes because a TLV can not be smaller than that.
-2.2.5. The PP2_TYPE_SSL type and subtypes
+2.2.5. PP2_TYPE_UNIQUE_ID
+
+The value of the type PP2_TYPE_UNIQUE_ID is an opaque byte sequence of up to
+128 bytes generated by the upstream proxy that uniquely identifies the
+connection.
+
+The unique ID can be used to easily correlate connections across multiple
+layers of proxies, without needing to look up IP addresses and port numbers.
+
+
+2.2.6. The PP2_TYPE_SSL type and subtypes
For the type PP2_TYPE_SSL, the value is itself a defined like this :
@@ -654,13 +666,13 @@
using the TLV format and the type PP2_SUBTYPE_SSL_CN. E.g. "example.com".
-2.2.6. The PP2_TYPE_NETNS type
+2.2.7. The PP2_TYPE_NETNS type
The type PP2_TYPE_NETNS defines the value as the US-ASCII string representation
of the namespace's name.
-2.2.7. Reserved type ranges
+2.2.8. Reserved type ranges
The following range of 16 type values is reserved for application-specific
data and will be never used by the PROXY Protocol. If you need more values
diff --git a/include/types/connection.h b/include/types/connection.h
index 3ce90a3..2f9ab2f 100644
--- a/include/types/connection.h
+++ b/include/types/connection.h
@@ -561,6 +561,7 @@
#define PP2_TYPE_AUTHORITY 0x02
#define PP2_TYPE_CRC32C 0x03
#define PP2_TYPE_NOOP 0x04
+#define PP2_TYPE_UNIQUE_ID 0x05
#define PP2_TYPE_SSL 0x20
#define PP2_SUBTYPE_SSL_VERSION 0x21
#define PP2_SUBTYPE_SSL_CN 0x22