Willy,
this one should be fairly obvious: It reserves TLV type 0x05 to contain
a unique ID within the PROXYv2 definition and also defines the type within
HAProxy source code.
Best regards
Tim Düsterhus
Apply with `git am --scissors` to automatically cut the commit message.
-- >8 --
This reserves and defines TLV type 0x05.
---
doc/proxy-protocol.txt | 20 ++++++++++++++++----
include/types/connection.h | 1 +
2 files changed, 17 insertions(+), 4 deletions(-)
diff --git a/doc/proxy-protocol.txt b/doc/proxy-protocol.txt
index 26f86a345..fc1ca4a04 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 @@ Revision history
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 @@ The following types have already been registered for the
<type> field :
#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 @@ bytes. Can be used for data padding or alignment. Note
that it can be used
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 @@ In all cases, the string representation (in UTF8) of the
Common Name field
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 bfd6547ee..0c2d960b9 100644
--- a/include/types/connection.h
+++ b/include/types/connection.h
@@ -558,6 +558,7 @@ struct proxy_hdr_v2 {
#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
--
2.25.1