summaryrefslogtreecommitdiffstats
path: root/daemon/proxyv2.h
diff options
context:
space:
mode:
Diffstat (limited to 'daemon/proxyv2.h')
-rw-r--r--daemon/proxyv2.h27
1 files changed, 17 insertions, 10 deletions
diff --git a/daemon/proxyv2.h b/daemon/proxyv2.h
index 2d57744..fdee126 100644
--- a/daemon/proxyv2.h
+++ b/daemon/proxyv2.h
@@ -6,10 +6,11 @@
#include <stdint.h>
-#include "daemon/session.h"
-#include "daemon/network.h"
#include "lib/utils.h"
+struct network;
+struct session;
+
extern const char PROXY2_SIGNATURE[12];
#define PROXY2_MIN_SIZE 16
@@ -21,14 +22,20 @@ enum proxy2_command {
/** Parsed result of the PROXY protocol */
struct proxy_result {
- enum proxy2_command command; /**< Proxy command - PROXY or LOCAL. */
- int family; /**< Address family from netinet library (e.g. AF_INET6). */
- int protocol; /**< Protocol type from socket library (e.g. SOCK_STREAM). */
- union kr_sockaddr src_addr; /**< Parsed source address and port. */
- union kr_sockaddr dst_addr; /**< Parsed destination address and port. */
- bool has_tls : 1; /**< `true` = client has used TLS with the proxy.
- If TLS padding is enabled, it will be used even if
- the proxy did not use TLS with kresd. */
+ /** Proxy command - PROXY or LOCAL. */
+ enum proxy2_command command;
+ /** Address family from netinet library (e.g. AF_INET6). */
+ int family;
+ /** Protocol type from socket library (e.g. SOCK_STREAM). */
+ int protocol;
+ /** Parsed source address and port. */
+ union kr_sockaddr src_addr;
+ /** Parsed destination address and port. */
+ union kr_sockaddr dst_addr;
+ /** `true` = client has used TLS with the proxy. If TLS padding is
+ * enabled, it will be used even if the communication between kresd and
+ * the proxy is unencrypted. */
+ bool has_tls : 1;
};
/** Checks for a PROXY protocol version 2 signature in the specified buffer. */