From ce1513bfb9a6bba8642a64c495d0f63437b72c12 Mon Sep 17 00:00:00 2001 From: Shawn Carey Date: Wed, 29 May 2024 10:37:51 -0400 Subject: [PATCH 1/2] add proxy fields to host.vN config types --- includes/ziti/ziti_model.h | 7 +++++++ library/internal_model.c | 2 ++ 2 files changed, 9 insertions(+) diff --git a/includes/ziti/ziti_model.h b/includes/ziti/ziti_model.h index fcf10df4..958d03b2 100644 --- a/includes/ziti/ziti_model.h +++ b/includes/ziti/ziti_model.h @@ -128,6 +128,10 @@ XX(protocol, string, none, protocol, __VA_ARGS__) \ XX(hostname, string, none, hostname, __VA_ARGS__) \ XX(port, int, none, port, __VA_ARGS__) +#define ZITI_PROXY_SERVER_MODEL(XX, ...) \ +XX(address, string, none, address, __VA_ARGS__) \ +XX(type, string, none, type, __VA_ARGS__) + #define ZITI_HOST_CFG_V1_MODEL(XX, ...) \ XX(protocol, string, none, protocol, __VA_ARGS__) \ XX(forward_protocol, bool, none, forwardProtocol, __VA_ARGS__) \ @@ -139,6 +143,7 @@ XX(port, int, none, port, __VA_ARGS__) \ XX(forward_port, bool, none, forwardPort, __VA_ARGS__) \ XX(allowed_port_ranges, ziti_port_range, array, allowedPortRanges, __VA_ARGS__) \ XX(allowed_source_addresses, ziti_address, array, allowedSourceAddresses, __VA_ARGS__) \ +XX(proxy, ziti_proxy_server, none, proxy, __VA_ARGS__) \ XX(listen_options, ziti_listen_options, ptr, listenOptions, __VA_ARGS__) #define ZITI_HOST_CFG_V2_MODEL(XX, ...) \ @@ -243,6 +248,8 @@ DECLARE_MODEL(ziti_listen_options, ZITI_LISTEN_OPTS_MODEL) DECLARE_MODEL(ziti_server_cfg_v1, ZITI_SERVER_CFG_V1_MODEL) +DECLARE_MODEL(ziti_proxy_server, ZITI_PROXY_SERVER_MODEL) + DECLARE_MODEL(ziti_host_cfg_v1, ZITI_HOST_CFG_V1_MODEL) DECLARE_MODEL(ziti_host_cfg_v2, ZITI_HOST_CFG_V2_MODEL) diff --git a/library/internal_model.c b/library/internal_model.c index 1e269c6b..e5b7a429 100644 --- a/library/internal_model.c +++ b/library/internal_model.c @@ -63,6 +63,8 @@ IMPL_MODEL(ziti_listen_options, ZITI_LISTEN_OPTS_MODEL) IMPL_MODEL(ziti_server_cfg_v1, ZITI_SERVER_CFG_V1_MODEL) +IMPL_MODEL(ziti_proxy_server, ZITI_PROXY_SERVER_MODEL) + IMPL_MODEL(ziti_host_cfg_v1, ZITI_HOST_CFG_V1_MODEL) IMPL_MODEL(ziti_host_cfg_v2, ZITI_HOST_CFG_V2_MODEL) From 71717f19538a626c22a897e302a5951f020abbcf Mon Sep 17 00:00:00 2001 From: Shawn Carey Date: Fri, 31 May 2024 15:16:49 -0400 Subject: [PATCH 2/2] declare proxy type enum --- includes/ziti/ziti_model.h | 7 ++++++- library/internal_model.c | 2 ++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/includes/ziti/ziti_model.h b/includes/ziti/ziti_model.h index 958d03b2..e6e34bf7 100644 --- a/includes/ziti/ziti_model.h +++ b/includes/ziti/ziti_model.h @@ -128,9 +128,12 @@ XX(protocol, string, none, protocol, __VA_ARGS__) \ XX(hostname, string, none, hostname, __VA_ARGS__) \ XX(port, int, none, port, __VA_ARGS__) +#define ZITI_PROXY_SERVER_TYPE_ENUM(XX, ...) \ +XX(http, __VA_ARGS__) + #define ZITI_PROXY_SERVER_MODEL(XX, ...) \ XX(address, string, none, address, __VA_ARGS__) \ -XX(type, string, none, type, __VA_ARGS__) +XX(type, ziti_proxy_server_type, none, type, __VA_ARGS__) #define ZITI_HOST_CFG_V1_MODEL(XX, ...) \ XX(protocol, string, none, protocol, __VA_ARGS__) \ @@ -248,6 +251,8 @@ DECLARE_MODEL(ziti_listen_options, ZITI_LISTEN_OPTS_MODEL) DECLARE_MODEL(ziti_server_cfg_v1, ZITI_SERVER_CFG_V1_MODEL) +DECLARE_ENUM(ziti_proxy_server_type, ZITI_PROXY_SERVER_TYPE_ENUM) + DECLARE_MODEL(ziti_proxy_server, ZITI_PROXY_SERVER_MODEL) DECLARE_MODEL(ziti_host_cfg_v1, ZITI_HOST_CFG_V1_MODEL) diff --git a/library/internal_model.c b/library/internal_model.c index e5b7a429..37b4d4c5 100644 --- a/library/internal_model.c +++ b/library/internal_model.c @@ -63,6 +63,8 @@ IMPL_MODEL(ziti_listen_options, ZITI_LISTEN_OPTS_MODEL) IMPL_MODEL(ziti_server_cfg_v1, ZITI_SERVER_CFG_V1_MODEL) +IMPL_ENUM(ziti_proxy_server_type, ZITI_PROXY_SERVER_TYPE_ENUM) + IMPL_MODEL(ziti_proxy_server, ZITI_PROXY_SERVER_MODEL) IMPL_MODEL(ziti_host_cfg_v1, ZITI_HOST_CFG_V1_MODEL)