Skip to main content

sozu_command_lib/proto/
command.rs

1// This file is @generated by prost-build.
2/// A message received by Sōzu to change its state or query information
3#[derive(::serde::Serialize, ::serde::Deserialize)]
4#[derive(Ord, PartialOrd)]
5#[derive(Eq)]
6#[derive(Hash)]
7#[derive(Clone, PartialEq, ::prost::Message)]
8pub struct Request {
9    #[prost(
10        oneof = "request::RequestType",
11        tags = "1, 2, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55"
12    )]
13    pub request_type: ::core::option::Option<request::RequestType>,
14}
15/// Nested message and enum types in `Request`.
16pub mod request {
17    #[derive(::serde::Serialize, ::serde::Deserialize)]
18    #[serde(rename_all = "SCREAMING_SNAKE_CASE")]
19    #[allow(clippy::large_enum_variant)]
20    #[derive(Hash, Eq, Ord, PartialOrd)]
21    #[derive(Clone, PartialEq, ::prost::Oneof)]
22    pub enum RequestType {
23        /// This message tells Sōzu to dump the current proxy state (backends,
24        /// front domains, certificates, etc) as a list of JSON-serialized Requests,
25        /// separated by a 0 byte, to a file. This file can be used later
26        /// to bootstrap the proxy. This message is not forwarded to workers.
27        /// If the specified path is relative, it will be calculated relative to the current
28        /// working directory of the proxy.
29        #[prost(string, tag = "1")]
30        SaveState(::prost::alloc::string::String),
31        /// load a state file, given its path
32        #[prost(string, tag = "2")]
33        LoadState(::prost::alloc::string::String),
34        /// list the workers and their status
35        #[prost(message, tag = "4")]
36        ListWorkers(super::ListWorkers),
37        /// list the frontends, filtered by protocol and/or domain
38        #[prost(message, tag = "5")]
39        ListFrontends(super::FrontendFilters),
40        /// list all listeners
41        #[prost(message, tag = "6")]
42        ListListeners(super::ListListeners),
43        /// launch a new worker
44        /// never implemented, the tag is unused and probably not needed
45        /// we may still implement it later with no paramater
46        /// the main process will automatically assign a new id to a new worker
47        #[prost(string, tag = "7")]
48        LaunchWorker(::prost::alloc::string::String),
49        /// upgrade the main process
50        #[prost(message, tag = "8")]
51        UpgradeMain(super::UpgradeMain),
52        /// upgrade an existing worker, giving its id
53        #[prost(uint32, tag = "9")]
54        UpgradeWorker(u32),
55        /// subscribe to proxy events
56        #[prost(message, tag = "10")]
57        SubscribeEvents(super::SubscribeEvents),
58        /// reload the configuration from the config file, or a new file
59        /// CHECK: this used to be an option. None => use the config file, Some(string) => path_to_file
60        /// make sure it works using "" and "path_to_file"
61        #[prost(string, tag = "11")]
62        ReloadConfiguration(::prost::alloc::string::String),
63        /// give status of main process and all workers
64        #[prost(message, tag = "12")]
65        Status(super::Status),
66        /// add a cluster
67        #[prost(message, tag = "13")]
68        AddCluster(super::Cluster),
69        /// remove a cluster giving its id
70        #[prost(string, tag = "14")]
71        RemoveCluster(::prost::alloc::string::String),
72        /// add an HTTP frontend
73        #[prost(message, tag = "15")]
74        AddHttpFrontend(super::RequestHttpFrontend),
75        /// remove an HTTP frontend
76        #[prost(message, tag = "16")]
77        RemoveHttpFrontend(super::RequestHttpFrontend),
78        /// add an HTTPS frontend
79        #[prost(message, tag = "17")]
80        AddHttpsFrontend(super::RequestHttpFrontend),
81        /// remove an HTTPS frontend
82        #[prost(message, tag = "18")]
83        RemoveHttpsFrontend(super::RequestHttpFrontend),
84        /// add a certificate
85        #[prost(message, tag = "19")]
86        AddCertificate(super::AddCertificate),
87        /// replace a certificate
88        #[prost(message, tag = "20")]
89        ReplaceCertificate(super::ReplaceCertificate),
90        /// remove a certificate
91        #[prost(message, tag = "21")]
92        RemoveCertificate(super::RemoveCertificate),
93        /// add a TCP frontend
94        #[prost(message, tag = "22")]
95        AddTcpFrontend(super::RequestTcpFrontend),
96        /// remove a TCP frontend
97        #[prost(message, tag = "23")]
98        RemoveTcpFrontend(super::RequestTcpFrontend),
99        /// add a backend
100        #[prost(message, tag = "24")]
101        AddBackend(super::AddBackend),
102        /// remove a backend
103        #[prost(message, tag = "25")]
104        RemoveBackend(super::RemoveBackend),
105        /// add an HTTP listener
106        #[prost(message, tag = "26")]
107        AddHttpListener(super::HttpListenerConfig),
108        /// add an HTTPS listener
109        #[prost(message, tag = "27")]
110        AddHttpsListener(super::HttpsListenerConfig),
111        /// add a TCP listener
112        #[prost(message, tag = "28")]
113        AddTcpListener(super::TcpListenerConfig),
114        /// remove a listener
115        #[prost(message, tag = "29")]
116        RemoveListener(super::RemoveListener),
117        /// activate a listener
118        #[prost(message, tag = "30")]
119        ActivateListener(super::ActivateListener),
120        /// deactivate a listener
121        #[prost(message, tag = "31")]
122        DeactivateListener(super::DeactivateListener),
123        /// query a cluster by id
124        #[prost(string, tag = "35")]
125        QueryClusterById(::prost::alloc::string::String),
126        /// query clusters with a hostname and optional path
127        #[prost(message, tag = "36")]
128        QueryClustersByDomain(super::QueryClusterByDomain),
129        /// query clusters hashes
130        #[prost(message, tag = "37")]
131        QueryClustersHashes(super::QueryClustersHashes),
132        /// query metrics
133        #[prost(message, tag = "38")]
134        QueryMetrics(super::QueryMetricsOptions),
135        /// soft stop
136        #[prost(message, tag = "39")]
137        SoftStop(super::SoftStop),
138        /// hard stop
139        #[prost(message, tag = "40")]
140        HardStop(super::HardStop),
141        /// enable, disable or clear the metrics
142        #[prost(enumeration = "super::MetricsConfiguration", tag = "41")]
143        ConfigureMetrics(i32),
144        /// Change the logging level
145        #[prost(string, tag = "42")]
146        Logging(::prost::alloc::string::String),
147        /// Return the listen sockets
148        #[prost(message, tag = "43")]
149        ReturnListenSockets(super::ReturnListenSockets),
150        /// Get certificates from the state (rather than from the workers)
151        #[prost(message, tag = "44")]
152        QueryCertificatesFromTheState(super::QueryCertificatesFilters),
153        /// Get certificates from the workers (rather than from the state)
154        #[prost(message, tag = "45")]
155        QueryCertificatesFromWorkers(super::QueryCertificatesFilters),
156        /// query the state about how many requests of each type has been received
157        /// since startup
158        #[prost(message, tag = "46")]
159        CountRequests(super::CountRequests),
160        /// patch a running HTTP listener in place (no socket re-bind)
161        #[prost(message, tag = "47")]
162        UpdateHttpListener(super::UpdateHttpListenerConfig),
163        /// patch a running HTTPS listener in place (no socket re-bind)
164        #[prost(message, tag = "48")]
165        UpdateHttpsListener(super::UpdateHttpsListenerConfig),
166        /// patch a running TCP listener in place (no socket re-bind)
167        #[prost(message, tag = "49")]
168        UpdateTcpListener(super::UpdateTcpListenerConfig),
169        /// set the global per-(cluster, source-IP) connection limit at
170        /// runtime. `0` is "unlimited". Per-cluster overrides set on the
171        /// `Cluster` message take precedence at admit time.
172        #[prost(uint64, tag = "50")]
173        SetMaxConnectionsPerIp(u64),
174        /// query the current global per-(cluster, source-IP) connection
175        /// limit. Workers reply with `MaxConnectionsPerIpLimit`.
176        #[prost(message, tag = "51")]
177        QueryMaxConnectionsPerIp(super::QueryMaxConnectionsPerIp),
178        /// set or update the health check configuration for a cluster.
179        /// Tags 47-49 carry in-place listener patches (HTTP/HTTPS/TCP) and
180        /// 50-51 carry the per-(cluster, source-IP) connection-limit
181        /// request/query, so health-check verbs start at 52.
182        #[prost(message, tag = "52")]
183        SetHealthCheck(super::SetHealthCheck),
184        /// remove the health check configuration from a cluster.
185        #[prost(string, tag = "53")]
186        RemoveHealthCheck(::prost::alloc::string::String),
187        /// list health check configurations (optional cluster id filter).
188        #[prost(message, tag = "54")]
189        QueryHealthChecks(super::QueryHealthChecks),
190        /// Apply, renew, or release a runtime cardinality lease on the metrics
191        /// drain. `sozu top` (and any future TUI client) leases DETAIL_BACKEND
192        /// for the duration of an interactive session; the worker's effective
193        /// detail is `max(configured, max(active leases))`. Leases self-expire
194        /// server-side after `ttl_seconds` so a crashed client never permanently
195        /// elevates cardinality. See doc/configure.md for the full semantics.
196        #[prost(message, tag = "55")]
197        SetMetricDetail(super::SetMetricDetail),
198    }
199}
200#[derive(::serde::Serialize, ::serde::Deserialize)]
201#[derive(Ord, PartialOrd)]
202#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
203pub struct QueryHealthChecks {
204    #[prost(string, optional, tag = "1")]
205    pub cluster_id: ::core::option::Option<::prost::alloc::string::String>,
206}
207#[derive(::serde::Serialize, ::serde::Deserialize)]
208#[derive(Ord, PartialOrd)]
209#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
210pub struct SetHealthCheck {
211    #[prost(string, required, tag = "1")]
212    pub cluster_id: ::prost::alloc::string::String,
213    #[prost(message, required, tag = "2")]
214    pub config: HealthCheckConfig,
215}
216#[derive(::serde::Serialize, ::serde::Deserialize)]
217#[derive(Ord, PartialOrd)]
218#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
219pub struct ListWorkers {}
220#[derive(::serde::Serialize, ::serde::Deserialize)]
221#[derive(Ord, PartialOrd)]
222#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
223pub struct ListListeners {}
224#[derive(::serde::Serialize, ::serde::Deserialize)]
225#[derive(Ord, PartialOrd)]
226#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
227pub struct UpgradeMain {}
228#[derive(::serde::Serialize, ::serde::Deserialize)]
229#[derive(Ord, PartialOrd)]
230#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
231pub struct SubscribeEvents {}
232#[derive(::serde::Serialize, ::serde::Deserialize)]
233#[derive(Ord, PartialOrd)]
234#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
235pub struct Status {}
236#[derive(::serde::Serialize, ::serde::Deserialize)]
237#[derive(Ord, PartialOrd)]
238#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
239pub struct QueryClustersHashes {}
240#[derive(::serde::Serialize, ::serde::Deserialize)]
241#[derive(Ord, PartialOrd)]
242#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
243pub struct SoftStop {}
244#[derive(::serde::Serialize, ::serde::Deserialize)]
245#[derive(Ord, PartialOrd)]
246#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
247pub struct HardStop {}
248#[derive(::serde::Serialize, ::serde::Deserialize)]
249#[derive(Ord, PartialOrd)]
250#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
251pub struct ReturnListenSockets {}
252#[derive(::serde::Serialize, ::serde::Deserialize)]
253#[derive(Ord, PartialOrd)]
254#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
255pub struct CountRequests {}
256#[derive(::serde::Serialize, ::serde::Deserialize)]
257#[derive(Ord, PartialOrd)]
258#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
259pub struct QueryMaxConnectionsPerIp {}
260/// Wrapper message to distinguish "absent" (preserve) from "present but empty"
261/// (reset to default) for ALPN protocols. A bare `repeated string` cannot make
262/// this distinction in proto2 since field absence is not detectable for repeated
263/// scalars without a sentinel.
264#[derive(::serde::Serialize, ::serde::Deserialize)]
265#[derive(Ord, PartialOrd)]
266#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
267pub struct AlpnProtocols {
268    #[prost(string, repeated, tag = "1")]
269    pub values: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
270}
271/// Partial-update patch for a running HTTP listener.
272/// Only fields that are `Some` in the patch will be applied;
273/// absent fields preserve their current value on the listener.
274/// Bind-only fields (address, active) are intentionally absent — use
275/// RemoveListener + AddHttpListener to change them.
276#[derive(::serde::Serialize, ::serde::Deserialize)]
277#[derive(Ord, PartialOrd)]
278#[derive(Hash, Eq)]
279#[derive(Clone, PartialEq, ::prost::Message)]
280pub struct UpdateHttpListenerConfig {
281    /// identifies the listener to patch (required — used as key)
282    #[prost(message, required, tag = "1")]
283    pub address: SocketAddress,
284    #[prost(message, optional, tag = "2")]
285    pub public_address: ::core::option::Option<SocketAddress>,
286    #[prost(bool, optional, tag = "3")]
287    pub expect_proxy: ::core::option::Option<bool>,
288    #[prost(string, optional, tag = "4")]
289    pub sticky_name: ::core::option::Option<::prost::alloc::string::String>,
290    /// client inactive time, in seconds
291    #[prost(uint32, optional, tag = "5")]
292    pub front_timeout: ::core::option::Option<u32>,
293    /// backend server inactive time, in seconds
294    #[prost(uint32, optional, tag = "6")]
295    pub back_timeout: ::core::option::Option<u32>,
296    /// time to connect to the backend, in seconds
297    #[prost(uint32, optional, tag = "7")]
298    pub connect_timeout: ::core::option::Option<u32>,
299    /// max time to send a complete request, in seconds
300    #[prost(uint32, optional, tag = "8")]
301    pub request_timeout: ::core::option::Option<u32>,
302    /// DEPRECATED: per-status answer message. Prefer the `answers` map at
303    /// field 38. Kept on the wire so older managers can still patch a running
304    /// listener for one minor; on the worker side both fields are merged.
305    #[prost(message, optional, tag = "9")]
306    pub http_answers: ::core::option::Option<CustomHttpAnswers>,
307    /// H2 flood thresholds — see HttpListenerConfig for semantics & CVE refs.
308    /// All values must be >= 1 (validated server-side before applying).
309    /// Maximum RST_STREAM frames per second window (CVE-2023-44487, CVE-2019-9514)
310    #[prost(uint32, optional, tag = "20")]
311    pub h2_max_rst_stream_per_window: ::core::option::Option<u32>,
312    /// Maximum PING frames per second window (CVE-2019-9512)
313    #[prost(uint32, optional, tag = "21")]
314    pub h2_max_ping_per_window: ::core::option::Option<u32>,
315    /// Maximum SETTINGS frames per second window (CVE-2019-9515)
316    #[prost(uint32, optional, tag = "22")]
317    pub h2_max_settings_per_window: ::core::option::Option<u32>,
318    /// Maximum empty DATA frames per second window (CVE-2019-9518)
319    #[prost(uint32, optional, tag = "23")]
320    pub h2_max_empty_data_per_window: ::core::option::Option<u32>,
321    /// Maximum CONTINUATION frames per header block (CVE-2024-27316)
322    #[prost(uint32, optional, tag = "24")]
323    pub h2_max_continuation_frames: ::core::option::Option<u32>,
324    /// Maximum accumulated protocol anomalies before ENHANCE_YOUR_CALM
325    #[prost(uint32, optional, tag = "25")]
326    pub h2_max_glitch_count: ::core::option::Option<u32>,
327    /// Connection-level receive window size in bytes (RFC 9113 §6.9.2)
328    #[prost(uint32, optional, tag = "26")]
329    pub h2_initial_connection_window: ::core::option::Option<u32>,
330    /// Maximum concurrent H2 streams (SETTINGS_MAX_CONCURRENT_STREAMS); >= 1
331    #[prost(uint32, optional, tag = "27")]
332    pub h2_max_concurrent_streams: ::core::option::Option<u32>,
333    /// Shrink threshold ratio for recycled stream slots; >= 1
334    #[prost(uint32, optional, tag = "28")]
335    pub h2_stream_shrink_ratio: ::core::option::Option<u32>,
336    /// Absolute lifetime cap on RST_STREAM frames received (CVE-2023-44487)
337    #[prost(uint64, optional, tag = "29")]
338    pub h2_max_rst_stream_lifetime: ::core::option::Option<u64>,
339    /// Lifetime cap on abusive RST_STREAM frames — Rapid Reset signature
340    #[prost(uint64, optional, tag = "30")]
341    pub h2_max_rst_stream_abusive_lifetime: ::core::option::Option<u64>,
342    /// Absolute lifetime cap on RST_STREAM frames emitted by the server (CVE-2025-8671)
343    #[prost(uint64, optional, tag = "31")]
344    pub h2_max_rst_stream_emitted_lifetime: ::core::option::Option<u64>,
345    /// Maximum HPACK-decoded header list size per request (RFC 9113 §6.5.2)
346    #[prost(uint32, optional, tag = "32")]
347    pub h2_max_header_list_size: ::core::option::Option<u32>,
348    /// Maximum HPACK dynamic table size accepted from the peer
349    #[prost(uint32, optional, tag = "33")]
350    pub h2_max_header_table_size: ::core::option::Option<u32>,
351    /// Per-stream idle timeout in seconds
352    #[prost(uint32, optional, tag = "34")]
353    pub h2_stream_idle_timeout_seconds: ::core::option::Option<u32>,
354    /// Maximum wall-clock seconds to wait after GOAWAY(NO_ERROR). 0 = wait forever.
355    #[prost(uint32, optional, tag = "35")]
356    pub h2_graceful_shutdown_deadline_seconds: ::core::option::Option<u32>,
357    /// Maximum connection-level (stream 0) WINDOW_UPDATE frames per window; >= 1
358    #[prost(uint32, optional, tag = "36")]
359    pub h2_max_window_update_stream0_per_window: ::core::option::Option<u32>,
360    /// Name of the correlation header injected per request (e.g. "Sozu-Id")
361    #[prost(string, optional, tag = "37")]
362    pub sozu_id_header: ::core::option::Option<::prost::alloc::string::String>,
363    /// Per-status HTTP answer template bodies, keyed by HTTP status code
364    /// (e.g. "503"). Replaces the per-field shape of `CustomHttpAnswers` (field
365    /// 9). An entry with an empty value is treated as "preserve current"; an
366    /// entry with a non-empty value replaces the listener's stored template
367    /// for that status. To clear a status template, recreate the listener.
368    #[prost(btree_map = "string, string", tag = "38")]
369    pub answers: ::prost::alloc::collections::BTreeMap<
370        ::prost::alloc::string::String,
371        ::prost::alloc::string::String,
372    >,
373    /// When true, any client-supplied `X-Real-IP` header is stripped from
374    /// requests before forwarding (anti-spoofing). See HttpListenerConfig.
375    #[prost(bool, optional, tag = "39")]
376    pub elide_x_real_ip: ::core::option::Option<bool>,
377    /// When true, a proxy-generated `X-Real-IP` header carrying the connection
378    /// peer IP is appended to every forwarded request. See HttpListenerConfig.
379    #[prost(bool, optional, tag = "40")]
380    pub send_x_real_ip: ::core::option::Option<bool>,
381}
382/// Partial-update patch for a running HTTPS listener.
383/// Only fields that are `Some` in the patch will be applied;
384/// absent fields preserve their current value on the listener.
385/// Bind-only fields (tls_versions, cipher_list, cipher_suites,
386/// signature_algorithms, groups_list, certificate, certificate_chain, key,
387/// send_tls13_tickets, active) are intentionally absent — use
388/// RemoveListener + AddHttpsListener to change them.
389#[derive(::serde::Serialize, ::serde::Deserialize)]
390#[derive(Ord, PartialOrd)]
391#[derive(Hash, Eq)]
392#[derive(Clone, PartialEq, ::prost::Message)]
393pub struct UpdateHttpsListenerConfig {
394    /// identifies the listener to patch (required — used as key)
395    #[prost(message, required, tag = "1")]
396    pub address: SocketAddress,
397    #[prost(message, optional, tag = "2")]
398    pub public_address: ::core::option::Option<SocketAddress>,
399    #[prost(bool, optional, tag = "3")]
400    pub expect_proxy: ::core::option::Option<bool>,
401    #[prost(string, optional, tag = "4")]
402    pub sticky_name: ::core::option::Option<::prost::alloc::string::String>,
403    /// client inactive time, in seconds
404    #[prost(uint32, optional, tag = "5")]
405    pub front_timeout: ::core::option::Option<u32>,
406    /// backend server inactive time, in seconds
407    #[prost(uint32, optional, tag = "6")]
408    pub back_timeout: ::core::option::Option<u32>,
409    /// time to connect to the backend, in seconds
410    #[prost(uint32, optional, tag = "7")]
411    pub connect_timeout: ::core::option::Option<u32>,
412    /// max time to send a complete request, in seconds
413    #[prost(uint32, optional, tag = "8")]
414    pub request_timeout: ::core::option::Option<u32>,
415    /// DEPRECATED: per-status answer message. Prefer the `answers` map at
416    /// field 38. Kept on the wire so older managers can still patch a running
417    /// listener for one minor; on the worker side both fields are merged.
418    #[prost(message, optional, tag = "9")]
419    pub http_answers: ::core::option::Option<CustomHttpAnswers>,
420    /// ALPN protocols to advertise during TLS handshake.
421    /// Uses a wrapper message so "absent" (preserve) and "present but empty"
422    /// (reset to default \["h2","http/1.1"\]) are unambiguous. Valid values per
423    /// element: "h2", "http/1.1". Validated server-side.
424    #[prost(message, optional, tag = "10")]
425    pub alpn_protocols: ::core::option::Option<AlpnProtocols>,
426    /// When true, :authority/Host must match the TLS SNI (CWE-346/CWE-444)
427    #[prost(bool, optional, tag = "11")]
428    pub strict_sni_binding: ::core::option::Option<bool>,
429    /// When true, only H2 connections are accepted; HTTP/1.1 is dropped at handshake
430    #[prost(bool, optional, tag = "12")]
431    pub disable_http11: ::core::option::Option<bool>,
432    /// H2 flood thresholds — same numbers/semantics as UpdateHttpListenerConfig.
433    /// All values must be >= 1 (validated server-side before applying).
434    /// Maximum RST_STREAM frames per second window (CVE-2023-44487, CVE-2019-9514)
435    #[prost(uint32, optional, tag = "20")]
436    pub h2_max_rst_stream_per_window: ::core::option::Option<u32>,
437    /// Maximum PING frames per second window (CVE-2019-9512)
438    #[prost(uint32, optional, tag = "21")]
439    pub h2_max_ping_per_window: ::core::option::Option<u32>,
440    /// Maximum SETTINGS frames per second window (CVE-2019-9515)
441    #[prost(uint32, optional, tag = "22")]
442    pub h2_max_settings_per_window: ::core::option::Option<u32>,
443    /// Maximum empty DATA frames per second window (CVE-2019-9518)
444    #[prost(uint32, optional, tag = "23")]
445    pub h2_max_empty_data_per_window: ::core::option::Option<u32>,
446    /// Maximum CONTINUATION frames per header block (CVE-2024-27316)
447    #[prost(uint32, optional, tag = "24")]
448    pub h2_max_continuation_frames: ::core::option::Option<u32>,
449    /// Maximum accumulated protocol anomalies before ENHANCE_YOUR_CALM
450    #[prost(uint32, optional, tag = "25")]
451    pub h2_max_glitch_count: ::core::option::Option<u32>,
452    /// Connection-level receive window size in bytes (RFC 9113 §6.9.2)
453    #[prost(uint32, optional, tag = "26")]
454    pub h2_initial_connection_window: ::core::option::Option<u32>,
455    /// Maximum concurrent H2 streams (SETTINGS_MAX_CONCURRENT_STREAMS); >= 1
456    #[prost(uint32, optional, tag = "27")]
457    pub h2_max_concurrent_streams: ::core::option::Option<u32>,
458    /// Shrink threshold ratio for recycled stream slots; >= 1
459    #[prost(uint32, optional, tag = "28")]
460    pub h2_stream_shrink_ratio: ::core::option::Option<u32>,
461    /// Absolute lifetime cap on RST_STREAM frames received (CVE-2023-44487)
462    #[prost(uint64, optional, tag = "29")]
463    pub h2_max_rst_stream_lifetime: ::core::option::Option<u64>,
464    /// Lifetime cap on abusive RST_STREAM frames — Rapid Reset signature
465    #[prost(uint64, optional, tag = "30")]
466    pub h2_max_rst_stream_abusive_lifetime: ::core::option::Option<u64>,
467    /// Absolute lifetime cap on RST_STREAM frames emitted by the server (CVE-2025-8671)
468    #[prost(uint64, optional, tag = "31")]
469    pub h2_max_rst_stream_emitted_lifetime: ::core::option::Option<u64>,
470    /// Maximum HPACK-decoded header list size per request (RFC 9113 §6.5.2)
471    #[prost(uint32, optional, tag = "32")]
472    pub h2_max_header_list_size: ::core::option::Option<u32>,
473    /// Maximum HPACK dynamic table size accepted from the peer
474    #[prost(uint32, optional, tag = "33")]
475    pub h2_max_header_table_size: ::core::option::Option<u32>,
476    /// Per-stream idle timeout in seconds
477    #[prost(uint32, optional, tag = "34")]
478    pub h2_stream_idle_timeout_seconds: ::core::option::Option<u32>,
479    /// Maximum wall-clock seconds to wait after GOAWAY(NO_ERROR). 0 = wait forever.
480    #[prost(uint32, optional, tag = "35")]
481    pub h2_graceful_shutdown_deadline_seconds: ::core::option::Option<u32>,
482    /// Maximum connection-level (stream 0) WINDOW_UPDATE frames per window; >= 1
483    #[prost(uint32, optional, tag = "36")]
484    pub h2_max_window_update_stream0_per_window: ::core::option::Option<u32>,
485    /// Name of the correlation header injected per request (e.g. "Sozu-Id")
486    #[prost(string, optional, tag = "37")]
487    pub sozu_id_header: ::core::option::Option<::prost::alloc::string::String>,
488    /// Per-status HTTP answer template bodies, keyed by HTTP status code
489    /// (e.g. "503"). Replaces the per-field shape of `CustomHttpAnswers` (field
490    /// 9). An entry with an empty value is treated as "preserve current"; an
491    /// entry with a non-empty value replaces the listener's stored template
492    /// for that status. To clear a status template, recreate the listener.
493    #[prost(btree_map = "string, string", tag = "38")]
494    pub answers: ::prost::alloc::collections::BTreeMap<
495        ::prost::alloc::string::String,
496        ::prost::alloc::string::String,
497    >,
498    /// When true, any client-supplied `X-Real-IP` header is stripped from
499    /// requests before forwarding (anti-spoofing). See HttpsListenerConfig.
500    #[prost(bool, optional, tag = "39")]
501    pub elide_x_real_ip: ::core::option::Option<bool>,
502    /// When true, a proxy-generated `X-Real-IP` header carrying the connection
503    /// peer IP is appended to every forwarded request. See HttpsListenerConfig.
504    #[prost(bool, optional, tag = "40")]
505    pub send_x_real_ip: ::core::option::Option<bool>,
506    /// Listener-default HSTS policy (RFC 6797). Full-object replacement on
507    /// partial update — when this field is `Some`, the supplied
508    /// `HstsConfig` overwrites whatever the listener currently holds; when
509    /// absent, the existing policy is preserved. Use
510    /// `Some(HstsConfig { enabled: Some(false), .. })` to explicitly
511    /// disable HSTS via partial update. Cites RFC 6797 §6.1 (single
512    /// header) and §7.2 (HTTPS-only).
513    #[prost(message, optional, tag = "41")]
514    pub hsts: ::core::option::Option<HstsConfig>,
515}
516/// Partial-update patch for a running TCP listener.
517/// Only fields that are `Some` in the patch will be applied;
518/// absent fields preserve their current value on the listener.
519/// Bind-only fields (address, active) are intentionally absent.
520#[derive(::serde::Serialize, ::serde::Deserialize)]
521#[derive(Ord, PartialOrd)]
522#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
523pub struct UpdateTcpListenerConfig {
524    /// identifies the listener to patch (required — used as key)
525    #[prost(message, required, tag = "1")]
526    pub address: SocketAddress,
527    #[prost(message, optional, tag = "2")]
528    pub public_address: ::core::option::Option<SocketAddress>,
529    #[prost(bool, optional, tag = "3")]
530    pub expect_proxy: ::core::option::Option<bool>,
531    /// client inactive time, in seconds
532    #[prost(uint32, optional, tag = "4")]
533    pub front_timeout: ::core::option::Option<u32>,
534    /// backend server inactive time, in seconds
535    #[prost(uint32, optional, tag = "5")]
536    pub back_timeout: ::core::option::Option<u32>,
537    /// time to connect to the backend, in seconds
538    #[prost(uint32, optional, tag = "6")]
539    pub connect_timeout: ::core::option::Option<u32>,
540}
541/// details of an HTTP listener
542#[derive(::serde::Serialize, ::serde::Deserialize)]
543#[derive(Ord, PartialOrd)]
544#[derive(Hash, Eq)]
545#[derive(Clone, PartialEq, ::prost::Message)]
546pub struct HttpListenerConfig {
547    #[prost(message, required, tag = "1")]
548    pub address: SocketAddress,
549    #[prost(message, optional, tag = "2")]
550    pub public_address: ::core::option::Option<SocketAddress>,
551    #[prost(bool, required, tag = "5", default = "false")]
552    pub expect_proxy: bool,
553    #[prost(string, required, tag = "6")]
554    pub sticky_name: ::prost::alloc::string::String,
555    /// client inactive time, in seconds
556    #[prost(uint32, required, tag = "7", default = "60")]
557    pub front_timeout: u32,
558    /// backend server inactive time, in seconds
559    #[prost(uint32, required, tag = "8", default = "30")]
560    pub back_timeout: u32,
561    /// time to connect to the backend, in seconds
562    #[prost(uint32, required, tag = "9", default = "3")]
563    pub connect_timeout: u32,
564    /// max time to send a complete request, in seconds
565    #[prost(uint32, required, tag = "10", default = "10")]
566    pub request_timeout: u32,
567    /// wether the listener is actively listening on its socket
568    #[prost(bool, required, tag = "11", default = "false")]
569    pub active: bool,
570    /// DEPRECATED: per-status answer message. Prefer the `answers` map at
571    /// field 31. Kept on the wire so legacy state files round-trip cleanly;
572    /// workers populate both fields and treat them as equivalent on read.
573    #[prost(message, optional, tag = "12")]
574    pub http_answers: ::core::option::Option<CustomHttpAnswers>,
575    /// H2 flood detection thresholds (CVE mitigations).
576    /// All are optional; when absent, built-in defaults are used.
577    /// Maximum RST_STREAM frames per second window (CVE-2023-44487, CVE-2019-9514)
578    #[prost(uint32, optional, tag = "13")]
579    pub h2_max_rst_stream_per_window: ::core::option::Option<u32>,
580    /// Maximum PING frames per second window (CVE-2019-9512)
581    #[prost(uint32, optional, tag = "14")]
582    pub h2_max_ping_per_window: ::core::option::Option<u32>,
583    /// Maximum SETTINGS frames per second window (CVE-2019-9515)
584    #[prost(uint32, optional, tag = "15")]
585    pub h2_max_settings_per_window: ::core::option::Option<u32>,
586    /// Maximum empty DATA frames per second window (CVE-2019-9518)
587    #[prost(uint32, optional, tag = "16")]
588    pub h2_max_empty_data_per_window: ::core::option::Option<u32>,
589    /// Maximum CONTINUATION frames per header block (CVE-2024-27316)
590    #[prost(uint32, optional, tag = "17")]
591    pub h2_max_continuation_frames: ::core::option::Option<u32>,
592    /// Maximum accumulated protocol anomalies before ENHANCE_YOUR_CALM
593    #[prost(uint32, optional, tag = "18")]
594    pub h2_max_glitch_count: ::core::option::Option<u32>,
595    /// H2 connection tuning parameters.
596    /// Connection-level receive window size in bytes (RFC 9113 §6.9.2).
597    /// Default: 1048576 (1MB). The RFC default of 65535 is too small for proxying.
598    #[prost(uint32, optional, tag = "19")]
599    pub h2_initial_connection_window: ::core::option::Option<u32>,
600    /// Maximum concurrent H2 streams the proxy accepts (SETTINGS_MAX_CONCURRENT_STREAMS).
601    /// Default: 100.
602    #[prost(uint32, optional, tag = "20")]
603    pub h2_max_concurrent_streams: ::core::option::Option<u32>,
604    /// Shrink threshold ratio for recycled stream slots. Vec is shrunk when
605    /// total_slots > active_streams * ratio. Default: 2.
606    #[prost(uint32, optional, tag = "21")]
607    pub h2_stream_shrink_ratio: ::core::option::Option<u32>,
608    /// Absolute lifetime cap on RST_STREAM frames received on a single H2
609    /// connection (CVE-2023-44487). Default: 10000.
610    #[prost(uint64, optional, tag = "22")]
611    pub h2_max_rst_stream_lifetime: ::core::option::Option<u64>,
612    /// Lifetime cap on "abusive" (pre-response-start) RST_STREAM frames
613    /// received on a single H2 connection — the Rapid Reset signature.
614    /// Default: 50.
615    #[prost(uint64, optional, tag = "23")]
616    pub h2_max_rst_stream_abusive_lifetime: ::core::option::Option<u64>,
617    /// Absolute lifetime cap on RST_STREAM frames **emitted by the server**
618    /// on a single H2 connection (CVE-2025-8671 "MadeYouReset"). Covers the
619    /// emission-direction-flipped sibling of Rapid Reset, where an attacker
620    /// sends legitimate-looking frames (Content-Length mismatch, header parse
621    /// error, rejected priority, zero-increment WINDOW_UPDATE on an open
622    /// stream) that coerce the server into emitting RST_STREAM. Graceful
623    /// `NoError` cancels are exempt. Default: 500.
624    #[prost(uint64, optional, tag = "27")]
625    pub h2_max_rst_stream_emitted_lifetime: ::core::option::Option<u64>,
626    /// Maximum accumulated HPACK-decoded header list size per request
627    /// (SETTINGS_MAX_HEADER_LIST_SIZE, RFC 9113 §6.5.2). Default: 65536.
628    #[prost(uint32, optional, tag = "24")]
629    pub h2_max_header_list_size: ::core::option::Option<u32>,
630    /// Per-stream idle timeout, in seconds. An open H2 stream that receives
631    /// no meaningful application data (non-empty DATA or HEADERS frames) for
632    /// this duration is cancelled (RST_STREAM / CANCEL). Active uploads that
633    /// trickle DATA frames reset the timer on each non-empty frame. Defends
634    /// against slow-multiplex Slowloris where a client keeps connection-level
635    /// activity high (any frame resets the connection idle timer) while pinning
636    /// up to `h2_max_concurrent_streams` streams. Default: 30.
637    #[prost(uint32, optional, tag = "25")]
638    pub h2_stream_idle_timeout_seconds: ::core::option::Option<u32>,
639    /// Maximum HPACK dynamic table size (SETTINGS_HEADER_TABLE_SIZE) accepted
640    /// from the peer. Caps the peer-advertised value to prevent unbounded
641    /// HPACK encoder memory growth. Default: 65536.
642    #[prost(uint32, optional, tag = "26")]
643    pub h2_max_header_table_size: ::core::option::Option<u32>,
644    /// Maximum wall-clock seconds to wait for in-flight H2 streams after
645    /// GOAWAY(NO_ERROR) before forcibly closing the connection. Default: 5.
646    /// Set to 0 to require streams to finish (no forced close).
647    #[prost(uint32, optional, tag = "28")]
648    pub h2_graceful_shutdown_deadline_seconds: ::core::option::Option<u32>,
649    /// Maximum connection-level (stream 0) WINDOW_UPDATE frames per second
650    /// window. Caps non-zero stream-0 WINDOW_UPDATE floods that would otherwise
651    /// stay under the generic glitch counter (zero-increment stream-0 updates
652    /// already trigger GOAWAY per RFC 9113 §6.9). Default: 100.
653    #[prost(uint32, optional, tag = "29")]
654    pub h2_max_window_update_stream0_per_window: ::core::option::Option<u32>,
655    /// Name of the correlation header Sozu injects into every request and
656    /// response to carry the per-request ULID. Default: "Sozu-Id". Operators
657    /// who want to rebrand can set e.g. "X-Edge-Id" or "X-Request-Trace".
658    #[prost(string, optional, tag = "30")]
659    pub sozu_id_header: ::core::option::Option<::prost::alloc::string::String>,
660    /// Per-status HTTP answer template bodies, keyed by HTTP status code
661    /// (e.g. "404", "503"). Replaces the per-field shape of `CustomHttpAnswers`
662    /// (field 12). The new field is populated alongside `http_answers` so
663    /// legacy state files round-trip; new code should read this map.
664    #[prost(btree_map = "string, string", tag = "31")]
665    #[serde(default)]
666    pub answers: ::prost::alloc::collections::BTreeMap<
667        ::prost::alloc::string::String,
668        ::prost::alloc::string::String,
669    >,
670    /// When true, any client-supplied `X-Real-IP` header is stripped from
671    /// requests before forwarding (anti-spoofing). Independently combinable
672    /// with `send_x_real_ip`. Default: false.
673    #[prost(bool, optional, tag = "32", default = "false")]
674    pub elide_x_real_ip: ::core::option::Option<bool>,
675    /// When true, a proxy-generated `X-Real-IP` header carrying the connection
676    /// peer IP (post-PROXY-v2 unwrap, i.e. the original client IP) is appended
677    /// to every forwarded request. Independently combinable with
678    /// `elide_x_real_ip`. Default: false.
679    #[prost(bool, optional, tag = "33", default = "false")]
680    pub send_x_real_ip: ::core::option::Option<bool>,
681}
682/// details of an HTTPS listener
683#[derive(::serde::Serialize, ::serde::Deserialize)]
684#[derive(Ord, PartialOrd)]
685#[derive(Hash, Eq)]
686#[derive(Clone, PartialEq, ::prost::Message)]
687pub struct HttpsListenerConfig {
688    #[prost(message, required, tag = "1")]
689    pub address: SocketAddress,
690    #[prost(message, optional, tag = "2")]
691    pub public_address: ::core::option::Option<SocketAddress>,
692    #[prost(bool, required, tag = "5", default = "false")]
693    pub expect_proxy: bool,
694    #[prost(string, required, tag = "6")]
695    pub sticky_name: ::prost::alloc::string::String,
696    /// client inactive time, in seconds
697    #[prost(uint32, required, tag = "7", default = "60")]
698    pub front_timeout: u32,
699    /// backend server inactive time, in seconds
700    #[prost(uint32, required, tag = "8", default = "30")]
701    pub back_timeout: u32,
702    /// time to connect to the backend, in seconds
703    #[prost(uint32, required, tag = "9", default = "3")]
704    pub connect_timeout: u32,
705    /// max time to send a complete request, in seconds
706    #[prost(uint32, required, tag = "10", default = "10")]
707    pub request_timeout: u32,
708    /// wether the listener is actively listening on its socket
709    #[prost(bool, required, tag = "11", default = "false")]
710    pub active: bool,
711    /// TLS versions
712    #[prost(enumeration = "TlsVersion", repeated, packed = "false", tag = "12")]
713    pub versions: ::prost::alloc::vec::Vec<i32>,
714    #[prost(string, repeated, tag = "13")]
715    pub cipher_list: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
716    #[prost(string, repeated, tag = "14")]
717    pub cipher_suites: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
718    #[prost(string, repeated, tag = "15")]
719    pub signature_algorithms: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
720    #[prost(string, repeated, tag = "16")]
721    pub groups_list: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
722    #[prost(string, optional, tag = "17")]
723    pub certificate: ::core::option::Option<::prost::alloc::string::String>,
724    #[prost(string, repeated, tag = "18")]
725    pub certificate_chain: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
726    #[prost(string, optional, tag = "19")]
727    pub key: ::core::option::Option<::prost::alloc::string::String>,
728    /// Number of TLS 1.3 tickets to send to a client when establishing a connection.
729    /// The tickets allow the client to resume a session. This protects the client
730    /// agains session tracking. Defaults to 4.
731    #[prost(uint64, required, tag = "20")]
732    pub send_tls13_tickets: u64,
733    /// DEPRECATED: per-status answer message. Prefer the `answers` map at
734    /// field 43. Kept on the wire so legacy state files round-trip cleanly;
735    /// workers populate both fields and treat them as equivalent on read.
736    #[prost(message, optional, tag = "21")]
737    pub http_answers: ::core::option::Option<CustomHttpAnswers>,
738    /// ALPN protocols to advertise during TLS handshake, in order of preference.
739    /// Valid values: "h2", "http/1.1". Defaults to \["h2", "http/1.1"\].
740    #[prost(string, repeated, tag = "22")]
741    #[serde(default)]
742    pub alpn_protocols: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
743    /// H2 flood detection thresholds (CVE mitigations).
744    /// All are optional; when absent, built-in defaults are used.
745    /// Maximum RST_STREAM frames per second window (CVE-2023-44487, CVE-2019-9514)
746    #[prost(uint32, optional, tag = "23")]
747    pub h2_max_rst_stream_per_window: ::core::option::Option<u32>,
748    /// Maximum PING frames per second window (CVE-2019-9512)
749    #[prost(uint32, optional, tag = "24")]
750    pub h2_max_ping_per_window: ::core::option::Option<u32>,
751    /// Maximum SETTINGS frames per second window (CVE-2019-9515)
752    #[prost(uint32, optional, tag = "25")]
753    pub h2_max_settings_per_window: ::core::option::Option<u32>,
754    /// Maximum empty DATA frames per second window (CVE-2019-9518)
755    #[prost(uint32, optional, tag = "26")]
756    pub h2_max_empty_data_per_window: ::core::option::Option<u32>,
757    /// Maximum CONTINUATION frames per header block (CVE-2024-27316)
758    #[prost(uint32, optional, tag = "27")]
759    pub h2_max_continuation_frames: ::core::option::Option<u32>,
760    /// Maximum accumulated protocol anomalies before ENHANCE_YOUR_CALM
761    #[prost(uint32, optional, tag = "28")]
762    pub h2_max_glitch_count: ::core::option::Option<u32>,
763    /// H2 connection tuning parameters.
764    /// Connection-level receive window size in bytes (RFC 9113 §6.9.2).
765    /// Default: 1048576 (1MB). The RFC default of 65535 is too small for proxying.
766    #[prost(uint32, optional, tag = "29")]
767    pub h2_initial_connection_window: ::core::option::Option<u32>,
768    /// Maximum concurrent H2 streams the proxy accepts (SETTINGS_MAX_CONCURRENT_STREAMS).
769    /// Default: 100.
770    #[prost(uint32, optional, tag = "30")]
771    pub h2_max_concurrent_streams: ::core::option::Option<u32>,
772    /// Shrink threshold ratio for recycled stream slots. Vec is shrunk when
773    /// total_slots > active_streams * ratio. Default: 2.
774    #[prost(uint32, optional, tag = "31")]
775    pub h2_stream_shrink_ratio: ::core::option::Option<u32>,
776    /// Absolute lifetime cap on RST_STREAM frames received on a single H2
777    /// connection (CVE-2023-44487). Default: 10000.
778    #[prost(uint64, optional, tag = "32")]
779    pub h2_max_rst_stream_lifetime: ::core::option::Option<u64>,
780    /// Lifetime cap on "abusive" (pre-response-start) RST_STREAM frames
781    /// received on a single H2 connection — the Rapid Reset signature.
782    /// Default: 50.
783    #[prost(uint64, optional, tag = "33")]
784    pub h2_max_rst_stream_abusive_lifetime: ::core::option::Option<u64>,
785    /// Absolute lifetime cap on RST_STREAM frames **emitted by the server**
786    /// on a single H2 connection (CVE-2025-8671 "MadeYouReset"). Covers the
787    /// emission-direction-flipped sibling of Rapid Reset, where an attacker
788    /// sends legitimate-looking frames (Content-Length mismatch, header parse
789    /// error, rejected priority, zero-increment WINDOW_UPDATE on an open
790    /// stream) that coerce the server into emitting RST_STREAM. Graceful
791    /// `NoError` cancels are exempt. Default: 500.
792    #[prost(uint64, optional, tag = "39")]
793    pub h2_max_rst_stream_emitted_lifetime: ::core::option::Option<u64>,
794    /// Maximum accumulated HPACK-decoded header list size per request
795    /// (SETTINGS_MAX_HEADER_LIST_SIZE, RFC 9113 §6.5.2). Default: 65536.
796    #[prost(uint32, optional, tag = "34")]
797    pub h2_max_header_list_size: ::core::option::Option<u32>,
798    /// When true, every HTTP request served on this listener must have its
799    /// `:authority` / `Host` host exact-match the TLS SNI that was negotiated
800    /// at handshake (CWE-346 / CWE-444). Disabling this lifts the per-stream
801    /// TLS trust boundary, so leave enabled unless an operational need
802    /// requires cross-SNI routing. Default: true.
803    #[prost(bool, optional, tag = "35")]
804    pub strict_sni_binding: ::core::option::Option<bool>,
805    /// When true, this listener only accepts HTTP/2 connections: clients
806    /// that fail to negotiate `h2` via TLS ALPN (including those that
807    /// omit ALPN altogether) are dropped at handshake instead of silently
808    /// falling back to HTTP/1.1. Default: false — preserves the historical
809    /// "ALPN missing defaults to h1" behavior.
810    #[prost(bool, optional, tag = "36")]
811    pub disable_http11: ::core::option::Option<bool>,
812    /// Per-stream idle timeout, in seconds. An open H2 stream that receives
813    /// no meaningful application data (non-empty DATA or HEADERS frames) for
814    /// this duration is cancelled (RST_STREAM / CANCEL). Active uploads that
815    /// trickle DATA frames reset the timer on each non-empty frame. Defends
816    /// against slow-multiplex Slowloris where a client keeps connection-level
817    /// activity high (any frame resets the connection idle timer) while pinning
818    /// up to `h2_max_concurrent_streams` streams. Default: 30.
819    #[prost(uint32, optional, tag = "37")]
820    pub h2_stream_idle_timeout_seconds: ::core::option::Option<u32>,
821    /// Maximum HPACK dynamic table size (SETTINGS_HEADER_TABLE_SIZE) accepted
822    /// from the peer. Caps the peer-advertised value to prevent unbounded
823    /// HPACK encoder memory growth. Default: 65536.
824    #[prost(uint32, optional, tag = "38")]
825    pub h2_max_header_table_size: ::core::option::Option<u32>,
826    /// Maximum wall-clock seconds to wait for in-flight H2 streams after
827    /// GOAWAY(NO_ERROR) before forcibly closing the connection. Default: 5.
828    /// Set to 0 to require streams to finish (no forced close).
829    #[prost(uint32, optional, tag = "40")]
830    pub h2_graceful_shutdown_deadline_seconds: ::core::option::Option<u32>,
831    /// Maximum connection-level (stream 0) WINDOW_UPDATE frames per second
832    /// window. Caps non-zero stream-0 WINDOW_UPDATE floods that would otherwise
833    /// stay under the generic glitch counter (zero-increment stream-0 updates
834    /// already trigger GOAWAY per RFC 9113 §6.9). Default: 100.
835    #[prost(uint32, optional, tag = "41")]
836    pub h2_max_window_update_stream0_per_window: ::core::option::Option<u32>,
837    /// Name of the correlation header Sozu injects into every request and
838    /// response to carry the per-request ULID. Default: "Sozu-Id". Operators
839    /// who want to rebrand can set e.g. "X-Edge-Id" or "X-Request-Trace".
840    #[prost(string, optional, tag = "42")]
841    pub sozu_id_header: ::core::option::Option<::prost::alloc::string::String>,
842    /// Per-status HTTP answer template bodies, keyed by HTTP status code
843    /// (e.g. "404", "503"). Replaces the per-field shape of `CustomHttpAnswers`
844    /// (field 21). The new field is populated alongside `http_answers` so
845    /// legacy state files round-trip; new code should read this map.
846    #[prost(btree_map = "string, string", tag = "43")]
847    #[serde(default)]
848    pub answers: ::prost::alloc::collections::BTreeMap<
849        ::prost::alloc::string::String,
850        ::prost::alloc::string::String,
851    >,
852    /// When true, any client-supplied `X-Real-IP` header is stripped from
853    /// requests before forwarding (anti-spoofing). Independently combinable
854    /// with `send_x_real_ip`. Default: false.
855    #[prost(bool, optional, tag = "44", default = "false")]
856    pub elide_x_real_ip: ::core::option::Option<bool>,
857    /// When true, a proxy-generated `X-Real-IP` header carrying the connection
858    /// peer IP (post-PROXY-v2 unwrap, i.e. the original client IP) is appended
859    /// to every forwarded request. Independently combinable with
860    /// `elide_x_real_ip`. Default: false.
861    #[prost(bool, optional, tag = "45", default = "false")]
862    pub send_x_real_ip: ::core::option::Option<bool>,
863    /// Listener-default HSTS (HTTP Strict Transport Security, RFC 6797)
864    /// policy. When set, every successful response on this listener gains
865    /// a `Strict-Transport-Security` header derived from the materialised
866    /// policy (RFC 6797 §6.1 single-header requirement, §7.2 HTTPS-only
867    /// emission, §8.1 host scope, §11.4 max-age=0 kill-switch). A
868    /// per-frontend `RequestHttpFrontend.hsts` overrides this default.
869    #[prost(message, optional, tag = "46")]
870    pub hsts: ::core::option::Option<HstsConfig>,
871}
872/// details of an TCP listener
873#[derive(::serde::Serialize, ::serde::Deserialize)]
874#[derive(Ord, PartialOrd)]
875#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
876pub struct TcpListenerConfig {
877    #[prost(message, required, tag = "1")]
878    pub address: SocketAddress,
879    #[prost(message, optional, tag = "2")]
880    pub public_address: ::core::option::Option<SocketAddress>,
881    #[prost(bool, required, tag = "3", default = "false")]
882    pub expect_proxy: bool,
883    /// client inactive time, in seconds
884    #[prost(uint32, required, tag = "4", default = "60")]
885    pub front_timeout: u32,
886    /// backend server inactive time, in seconds
887    #[prost(uint32, required, tag = "5", default = "30")]
888    pub back_timeout: u32,
889    /// time to connect to the backend, in seconds
890    #[prost(uint32, required, tag = "6", default = "3")]
891    pub connect_timeout: u32,
892    /// wether the listener is actively listening on its socket
893    #[prost(bool, required, tag = "7", default = "false")]
894    pub active: bool,
895}
896/// HSTS (HTTP Strict Transport Security, RFC 6797) policy attached to
897/// an HTTPS listener default or per-frontend. The materialised
898/// `Strict-Transport-Security: max-age=N[; includeSubDomains][; preload]`
899/// header is injected on every successful HTTPS response (including
900/// proxy-generated 3xx/401/5xx default answers). Per RFC 6797 §7.2 the
901/// header MUST NOT be emitted on plaintext-HTTP responses; sozu rejects
902/// HSTS configured on an HttpListenerConfig at config-load time and gates
903/// the runtime injection on `context.protocol == Protocol::HTTPS`.
904///
905/// Validation:
906/// - `enabled = true` with `max_age = None` defaults `max_age` to
907///   31536000 seconds (1 year) at config-load.
908/// - `max_age = 0` is the RFC 6797 §11.4 kill-switch and is allowed
909///   silently; `0 < max_age < 86400` warns.
910/// - `preload = true` with `max_age < 31536000` or
911///   `include_subdomains != true` warns (Chrome HSTS preload list
912///   prerequisites at <https://hstspreload.org/>).
913/// - `preload` is opt-in only; never default-true (RFC 6797 §14.2 —
914///   removal from the preload list is slow and partial).
915#[derive(::serde::Serialize, ::serde::Deserialize)]
916#[derive(Ord, PartialOrd)]
917#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
918pub struct HstsConfig {
919    /// Whether HSTS is enabled for this scope. Required whenever the
920    /// parent message includes an HstsConfig — the partial-update path
921    /// treats `enabled = false` as the explicit-disable signal.
922    #[prost(bool, optional, tag = "1")]
923    pub enabled: ::core::option::Option<bool>,
924    /// Strict-Transport-Security `max-age` directive in seconds. When
925    /// `enabled = true` and this is unset, sozu substitutes 31536000
926    /// (1 year, HSTS preload list minimum) at config-load.
927    #[prost(uint32, optional, tag = "2")]
928    pub max_age: ::core::option::Option<u32>,
929    /// Append `; includeSubDomains` to the rendered header.
930    #[prost(bool, optional, tag = "3")]
931    pub include_subdomains: ::core::option::Option<bool>,
932    /// Append `; preload` to the rendered header. Opt-in only — see
933    /// RFC 6797 §14.2 and <https://hstspreload.org/.>
934    #[prost(bool, optional, tag = "4")]
935    pub preload: ::core::option::Option<bool>,
936    /// Operator opt-in to override any backend-supplied
937    /// `Strict-Transport-Security` header with sozu's typed policy.
938    ///
939    /// RFC 6797 §6.1 default behaviour is to PRESERVE a backend-emitted
940    /// STS header when one is already present (sozu's HSTS edit uses
941    /// `HeaderEditMode::SetIfAbsent`). That keeps the backend's intent
942    /// intact for upstreams that ship their own HSTS policy.
943    ///
944    /// Set this to `true` for the harden-centrally case: backends behind
945    /// sozu emit a stale or weak HSTS policy (e.g. legacy `max-age=300`)
946    /// and the operator wants to enforce a stronger policy at the proxy
947    /// edge unconditionally. The materialiser then uses
948    /// `HeaderEditMode::Set` instead of `SetIfAbsent`, replacing every
949    /// backend-supplied STS header with sozu's rendered value.
950    ///
951    /// Cite: <https://datatracker.ietf.org/doc/html/rfc6797#section-6.1>
952    #[prost(bool, optional, tag = "5")]
953    pub force_replace_backend: ::core::option::Option<bool>,
954}
955/// custom HTTP answers, useful for 404, 503 pages
956#[derive(::serde::Serialize, ::serde::Deserialize)]
957#[derive(Ord, PartialOrd)]
958#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
959pub struct CustomHttpAnswers {
960    /// MovedPermanently
961    #[prost(string, optional, tag = "1")]
962    pub answer_301: ::core::option::Option<::prost::alloc::string::String>,
963    /// BadRequest
964    #[prost(string, optional, tag = "2")]
965    pub answer_400: ::core::option::Option<::prost::alloc::string::String>,
966    /// Unauthorized
967    #[prost(string, optional, tag = "3")]
968    pub answer_401: ::core::option::Option<::prost::alloc::string::String>,
969    /// NotFound
970    #[prost(string, optional, tag = "4")]
971    pub answer_404: ::core::option::Option<::prost::alloc::string::String>,
972    /// RequestTimeout
973    #[prost(string, optional, tag = "5")]
974    pub answer_408: ::core::option::Option<::prost::alloc::string::String>,
975    /// PayloadTooLarge
976    #[prost(string, optional, tag = "6")]
977    pub answer_413: ::core::option::Option<::prost::alloc::string::String>,
978    /// MisdirectedRequest (RFC 9110 §15.5.20, TLS SNI ↔ :authority mismatch)
979    #[prost(string, optional, tag = "11")]
980    pub answer_421: ::core::option::Option<::prost::alloc::string::String>,
981    /// BadGateway
982    #[prost(string, optional, tag = "7")]
983    pub answer_502: ::core::option::Option<::prost::alloc::string::String>,
984    /// ServiceUnavailable
985    #[prost(string, optional, tag = "8")]
986    pub answer_503: ::core::option::Option<::prost::alloc::string::String>,
987    /// GatewayTimeout
988    #[prost(string, optional, tag = "9")]
989    pub answer_504: ::core::option::Option<::prost::alloc::string::String>,
990    /// InsufficientStorage
991    #[prost(string, optional, tag = "10")]
992    pub answer_507: ::core::option::Option<::prost::alloc::string::String>,
993    /// TooManyRequests (per-(cluster, source-IP) connection limit hit)
994    #[prost(string, optional, tag = "12")]
995    pub answer_429: ::core::option::Option<::prost::alloc::string::String>,
996}
997#[derive(::serde::Serialize, ::serde::Deserialize)]
998#[derive(Ord, PartialOrd)]
999#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1000pub struct ActivateListener {
1001    #[prost(message, required, tag = "1")]
1002    pub address: SocketAddress,
1003    #[prost(enumeration = "ListenerType", required, tag = "2")]
1004    pub proxy: i32,
1005    #[prost(bool, required, tag = "3")]
1006    pub from_scm: bool,
1007}
1008#[derive(::serde::Serialize, ::serde::Deserialize)]
1009#[derive(Ord, PartialOrd)]
1010#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1011pub struct DeactivateListener {
1012    #[prost(message, required, tag = "1")]
1013    pub address: SocketAddress,
1014    #[prost(enumeration = "ListenerType", required, tag = "2")]
1015    pub proxy: i32,
1016    #[prost(bool, required, tag = "3")]
1017    pub to_scm: bool,
1018}
1019#[derive(::serde::Serialize, ::serde::Deserialize)]
1020#[derive(Ord, PartialOrd)]
1021#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1022pub struct RemoveListener {
1023    #[prost(message, required, tag = "1")]
1024    pub address: SocketAddress,
1025    #[prost(enumeration = "ListenerType", required, tag = "2")]
1026    pub proxy: i32,
1027}
1028/// All listeners, listed
1029#[derive(::serde::Serialize, ::serde::Deserialize)]
1030#[derive(Ord, PartialOrd)]
1031#[derive(Hash, Eq)]
1032#[derive(Clone, PartialEq, ::prost::Message)]
1033pub struct ListenersList {
1034    /// address -> http listener config
1035    #[prost(btree_map = "string, message", tag = "1")]
1036    pub http_listeners: ::prost::alloc::collections::BTreeMap<
1037        ::prost::alloc::string::String,
1038        HttpListenerConfig,
1039    >,
1040    /// address -> https listener config
1041    #[prost(btree_map = "string, message", tag = "2")]
1042    pub https_listeners: ::prost::alloc::collections::BTreeMap<
1043        ::prost::alloc::string::String,
1044        HttpsListenerConfig,
1045    >,
1046    /// address -> tcp listener config
1047    #[prost(btree_map = "string, message", tag = "3")]
1048    pub tcp_listeners: ::prost::alloc::collections::BTreeMap<
1049        ::prost::alloc::string::String,
1050        TcpListenerConfig,
1051    >,
1052}
1053/// A single header mutation applied to a request, response, or both.
1054///
1055/// An empty `val` deletes the header by name (HAProxy `del-header` parity).
1056/// A non-empty `val` performs a set/replace; a header with the same name is
1057/// overwritten. Header names are matched case-insensitively per RFC 9110 §5.1.
1058#[derive(::serde::Serialize, ::serde::Deserialize)]
1059#[derive(Ord, PartialOrd)]
1060#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1061pub struct Header {
1062    #[prost(enumeration = "HeaderPosition", required, tag = "1")]
1063    pub position: i32,
1064    #[prost(string, required, tag = "2")]
1065    pub key: ::prost::alloc::string::String,
1066    /// Empty `val` deletes the header by name (HAProxy `del-header` parity).
1067    #[prost(string, required, tag = "3")]
1068    pub val: ::prost::alloc::string::String,
1069}
1070/// An HTTP or HTTPS frontend, as order to, or received from, Sōzu
1071#[derive(::serde::Serialize, ::serde::Deserialize)]
1072#[derive(Ord, PartialOrd)]
1073#[derive(Hash, Eq)]
1074#[derive(Clone, PartialEq, ::prost::Message)]
1075pub struct RequestHttpFrontend {
1076    #[prost(string, optional, tag = "1")]
1077    pub cluster_id: ::core::option::Option<::prost::alloc::string::String>,
1078    #[prost(message, required, tag = "2")]
1079    pub address: SocketAddress,
1080    #[prost(string, required, tag = "3")]
1081    pub hostname: ::prost::alloc::string::String,
1082    #[prost(message, required, tag = "4")]
1083    pub path: PathRule,
1084    #[prost(string, optional, tag = "5")]
1085    pub method: ::core::option::Option<::prost::alloc::string::String>,
1086    #[prost(enumeration = "RulePosition", required, tag = "6", default = "Tree")]
1087    pub position: i32,
1088    /// custom tags to identify the frontend in the access logs
1089    #[prost(btree_map = "string, string", tag = "7")]
1090    pub tags: ::prost::alloc::collections::BTreeMap<
1091        ::prost::alloc::string::String,
1092        ::prost::alloc::string::String,
1093    >,
1094    /// Redirect policy for this frontend. Default `FORWARD` (no redirect).
1095    #[prost(enumeration = "RedirectPolicy", optional, tag = "8", default = "Forward")]
1096    pub redirect: ::core::option::Option<i32>,
1097    /// When true, requests routed through this frontend must carry a valid
1098    /// `Authorization: Basic <user:pass>` header whose hash matches one of
1099    /// `cluster.authorized_hashes`. Default: false.
1100    #[prost(bool, optional, tag = "9")]
1101    pub required_auth: ::core::option::Option<bool>,
1102    /// Scheme to use when emitting a 301 `Location` header. Default `USE_SAME`
1103    /// (preserve the request scheme).
1104    #[prost(enumeration = "RedirectScheme", optional, tag = "10", default = "UseSame")]
1105    pub redirect_scheme: ::core::option::Option<i32>,
1106    /// Optional template applied when emitting a permanent redirect. Supports
1107    /// `%REDIRECT_LOCATION` and the variables documented in `doc/configure.md`.
1108    #[prost(string, optional, tag = "11")]
1109    pub redirect_template: ::core::option::Option<::prost::alloc::string::String>,
1110    /// Rewrite host template. Supports `$HOST\[n\]` / `$PATH\[n\]` placeholders
1111    /// populated from regex captures collected during routing. When set, both
1112    /// the backend authority/path and the wire request line are rewritten.
1113    #[prost(string, optional, tag = "12")]
1114    pub rewrite_host: ::core::option::Option<::prost::alloc::string::String>,
1115    /// Rewrite path template. Same grammar as `rewrite_host`.
1116    #[prost(string, optional, tag = "13")]
1117    pub rewrite_path: ::core::option::Option<::prost::alloc::string::String>,
1118    /// Optional literal port override on the rewritten URL.
1119    #[prost(uint32, optional, tag = "14")]
1120    pub rewrite_port: ::core::option::Option<u32>,
1121    /// Header mutations applied to requests and/or responses passing through
1122    /// this frontend. See `Header` for delete semantics.
1123    #[prost(message, repeated, tag = "15")]
1124    #[serde(default)]
1125    pub headers: ::prost::alloc::vec::Vec<Header>,
1126    /// Per-frontend HSTS (RFC 6797) override. When `Some`, this entire
1127    /// policy replaces the listener-default `HttpsListenerConfig.hsts`
1128    /// for matched requests; when absent, the listener default applies.
1129    /// Honours RFC 6797 §6.1 (single Strict-Transport-Security header on
1130    /// the response) and §8.1 (HSTS host scope tied to the receiving
1131    /// host). On HTTP-only frontends the value is rejected at config-load
1132    /// (RFC 6797 §7.2). The §11.4 `max-age=0` kill-switch is honoured
1133    /// verbatim so an operator can shadow a listener-wide HSTS for one
1134    /// hostname.
1135    #[prost(message, optional, tag = "16")]
1136    pub hsts: ::core::option::Option<HstsConfig>,
1137}
1138#[derive(::serde::Serialize, ::serde::Deserialize)]
1139#[derive(Ord, PartialOrd)]
1140#[derive(Hash, Eq)]
1141#[derive(Clone, PartialEq, ::prost::Message)]
1142pub struct RequestTcpFrontend {
1143    #[prost(string, required, tag = "1")]
1144    pub cluster_id: ::prost::alloc::string::String,
1145    /// the socket address on which to listen for incoming traffic
1146    #[prost(message, required, tag = "2")]
1147    pub address: SocketAddress,
1148    /// custom tags to identify the frontend in the access logs
1149    #[prost(btree_map = "string, string", tag = "3")]
1150    pub tags: ::prost::alloc::collections::BTreeMap<
1151        ::prost::alloc::string::String,
1152        ::prost::alloc::string::String,
1153    >,
1154}
1155/// list the frontends, filtered by protocol and/or domain
1156#[derive(::serde::Serialize, ::serde::Deserialize)]
1157#[derive(Ord, PartialOrd)]
1158#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1159pub struct FrontendFilters {
1160    #[prost(bool, required, tag = "1")]
1161    pub http: bool,
1162    #[prost(bool, required, tag = "2")]
1163    pub https: bool,
1164    #[prost(bool, required, tag = "3")]
1165    pub tcp: bool,
1166    #[prost(string, optional, tag = "4")]
1167    pub domain: ::core::option::Option<::prost::alloc::string::String>,
1168}
1169/// A filter for the path of incoming requests
1170#[derive(::serde::Serialize, ::serde::Deserialize)]
1171#[derive(Ord, PartialOrd)]
1172#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1173pub struct PathRule {
1174    /// The kind of filter used for path rules
1175    #[prost(enumeration = "PathRuleKind", required, tag = "1")]
1176    pub kind: i32,
1177    /// the value of the given prefix, regex or equal pathrule
1178    #[prost(string, required, tag = "2")]
1179    pub value: ::prost::alloc::string::String,
1180}
1181/// Add a new TLS certificate to an HTTPs listener
1182#[derive(::serde::Serialize, ::serde::Deserialize)]
1183#[derive(Ord, PartialOrd)]
1184#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1185pub struct AddCertificate {
1186    #[prost(message, required, tag = "1")]
1187    pub address: SocketAddress,
1188    #[prost(message, required, tag = "2")]
1189    pub certificate: CertificateAndKey,
1190    /// A unix timestamp. Overrides certificate expiration.
1191    #[prost(int64, optional, tag = "3")]
1192    pub expired_at: ::core::option::Option<i64>,
1193}
1194#[derive(::serde::Serialize, ::serde::Deserialize)]
1195#[derive(Ord, PartialOrd)]
1196#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1197pub struct RemoveCertificate {
1198    #[prost(message, required, tag = "1")]
1199    pub address: SocketAddress,
1200    /// a hex-encoded TLS fingerprint to identify the certificate to remove
1201    #[prost(string, required, tag = "2")]
1202    pub fingerprint: ::prost::alloc::string::String,
1203}
1204#[derive(::serde::Serialize, ::serde::Deserialize)]
1205#[derive(Ord, PartialOrd)]
1206#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1207pub struct ReplaceCertificate {
1208    #[prost(message, required, tag = "1")]
1209    pub address: SocketAddress,
1210    #[prost(message, required, tag = "2")]
1211    pub new_certificate: CertificateAndKey,
1212    /// a hex-encoded TLS fingerprint to identify the old certificate
1213    #[prost(string, required, tag = "3")]
1214    pub old_fingerprint: ::prost::alloc::string::String,
1215    /// A unix timestamp. Overrides certificate expiration.
1216    #[prost(int64, optional, tag = "4")]
1217    pub new_expired_at: ::core::option::Option<i64>,
1218}
1219#[derive(::serde::Serialize, ::serde::Deserialize)]
1220#[derive(Ord, PartialOrd)]
1221#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1222pub struct CertificateAndKey {
1223    #[prost(string, required, tag = "1")]
1224    pub certificate: ::prost::alloc::string::String,
1225    #[prost(string, repeated, tag = "2")]
1226    pub certificate_chain: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
1227    #[prost(string, required, tag = "3")]
1228    pub key: ::prost::alloc::string::String,
1229    #[prost(enumeration = "TlsVersion", repeated, packed = "false", tag = "4")]
1230    pub versions: ::prost::alloc::vec::Vec<i32>,
1231    /// a list of domain names. Override certificate names
1232    /// if empty, the names of the certificate will be used
1233    #[prost(string, repeated, tag = "5")]
1234    pub names: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
1235}
1236/// Should be either a domain name or a fingerprint.
1237/// These filter do not compound, use either one but not both.
1238/// If none of them is specified, all certificates will be returned.
1239#[derive(::serde::Serialize, ::serde::Deserialize)]
1240#[derive(Ord, PartialOrd)]
1241#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1242pub struct QueryCertificatesFilters {
1243    /// a domain name to filter certificate results
1244    #[prost(string, optional, tag = "1")]
1245    pub domain: ::core::option::Option<::prost::alloc::string::String>,
1246    /// a hex-encoded fingerprint of the TLS certificate to find
1247    #[prost(string, optional, tag = "2")]
1248    pub fingerprint: ::core::option::Option<::prost::alloc::string::String>,
1249}
1250/// domain name and fingerprint of a certificate
1251#[derive(::serde::Serialize, ::serde::Deserialize)]
1252#[derive(Ord, PartialOrd)]
1253#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1254pub struct CertificateSummary {
1255    #[prost(string, required, tag = "1")]
1256    pub domain: ::prost::alloc::string::String,
1257    /// a hex-encoded TLS fingerprint
1258    #[prost(string, required, tag = "2")]
1259    pub fingerprint: ::prost::alloc::string::String,
1260}
1261/// Used by workers to reply to some certificate queries
1262#[derive(::serde::Serialize, ::serde::Deserialize)]
1263#[derive(Ord, PartialOrd)]
1264#[derive(Hash, Eq)]
1265#[derive(Clone, PartialEq, ::prost::Message)]
1266pub struct ListOfCertificatesByAddress {
1267    #[prost(message, repeated, tag = "1")]
1268    pub certificates: ::prost::alloc::vec::Vec<CertificatesByAddress>,
1269}
1270/// Summaries of certificates for a given address
1271#[derive(::serde::Serialize, ::serde::Deserialize)]
1272#[derive(Ord, PartialOrd)]
1273#[derive(Hash, Eq)]
1274#[derive(Clone, PartialEq, ::prost::Message)]
1275pub struct CertificatesByAddress {
1276    #[prost(message, required, tag = "1")]
1277    pub address: SocketAddress,
1278    #[prost(message, repeated, tag = "2")]
1279    pub certificate_summaries: ::prost::alloc::vec::Vec<CertificateSummary>,
1280}
1281/// to reply to several certificate queries
1282#[derive(::serde::Serialize, ::serde::Deserialize)]
1283#[derive(Ord, PartialOrd)]
1284#[derive(Hash, Eq)]
1285#[derive(Clone, PartialEq, ::prost::Message)]
1286pub struct CertificatesWithFingerprints {
1287    /// a map of fingerprint -> certificate_and_key
1288    #[prost(btree_map = "string, message", tag = "1")]
1289    pub certs: ::prost::alloc::collections::BTreeMap<
1290        ::prost::alloc::string::String,
1291        CertificateAndKey,
1292    >,
1293}
1294/// A cluster is what binds a frontend to backends with routing rules
1295#[derive(::serde::Serialize, ::serde::Deserialize)]
1296#[derive(Ord, PartialOrd)]
1297#[derive(Hash, Eq)]
1298#[derive(Clone, PartialEq, ::prost::Message)]
1299pub struct Cluster {
1300    #[prost(string, required, tag = "1")]
1301    pub cluster_id: ::prost::alloc::string::String,
1302    /// wether a connection from a client shall be always redirected to the same backend
1303    #[prost(bool, required, tag = "2")]
1304    pub sticky_session: bool,
1305    #[prost(bool, required, tag = "3")]
1306    pub https_redirect: bool,
1307    #[prost(enumeration = "ProxyProtocolConfig", optional, tag = "4")]
1308    pub proxy_protocol: ::core::option::Option<i32>,
1309    #[prost(
1310        enumeration = "LoadBalancingAlgorithms",
1311        required,
1312        tag = "5",
1313        default = "RoundRobin"
1314    )]
1315    pub load_balancing: i32,
1316    #[prost(string, optional, tag = "6")]
1317    pub answer_503: ::core::option::Option<::prost::alloc::string::String>,
1318    #[prost(enumeration = "LoadMetric", optional, tag = "7")]
1319    pub load_metric: ::core::option::Option<i32>,
1320    /// Backend-capability hint: set to true when THE BACKEND speaks HTTP/2 (h2c or h2+TLS).
1321    /// This does NOT gate H2 acceptance at the frontend — frontend H2 is negotiated via
1322    /// TLS ALPN independently of per-cluster configuration (see alpn_protocols on the listener).
1323    #[prost(bool, optional, tag = "8")]
1324    pub http2: ::core::option::Option<bool>,
1325    /// Per-cluster HTTP answer template overrides keyed by HTTP status code
1326    /// (e.g. "503"). Override a listener-level answer for this cluster only.
1327    #[prost(btree_map = "string, string", tag = "9")]
1328    #[serde(default)]
1329    pub answers: ::prost::alloc::collections::BTreeMap<
1330        ::prost::alloc::string::String,
1331        ::prost::alloc::string::String,
1332    >,
1333    /// Optional explicit port to use when building the `Location` header for
1334    /// an `https_redirect`. When unset, the listener's effective HTTPS port is
1335    /// used. Lets operators front a non-standard HTTPS port (e.g. 8443) on
1336    /// the redirect target while keeping `https_redirect = true`.
1337    #[prost(uint32, optional, tag = "10")]
1338    pub https_redirect_port: ::core::option::Option<u32>,
1339    /// Authorized credentials for HTTP basic authentication. Each entry is
1340    /// formatted as `username:hex(sha256(password))` (lower-case hex). The
1341    /// mux compares the supplied `Authorization: Basic` header in
1342    /// constant-time against the full list. Empty list disables auth even
1343    /// when a frontend sets `required_auth = true` — those requests are
1344    /// rejected with a 401.
1345    #[prost(string, repeated, tag = "11")]
1346    #[serde(default)]
1347    pub authorized_hashes: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
1348    /// Realm string emitted in `WWW-Authenticate: Basic realm="…"` when an
1349    /// unauthenticated request is rejected. Treated as an opaque value (no
1350    /// template substitution). Defaults to a generic realm if unset.
1351    #[prost(string, optional, tag = "12")]
1352    pub www_authenticate: ::core::option::Option<::prost::alloc::string::String>,
1353    /// Per-cluster override for the global `max_connections_per_ip`.
1354    /// `None` (field absent) inherits the global default. `Some(0)` is
1355    /// explicit "unlimited for this cluster". `Some(n > 0)` overrides with
1356    /// the cluster-specific limit. Counts are kept per
1357    /// `(cluster_id, source_ip)` pair, so two clusters never share a
1358    /// counter even from the same IP.
1359    #[prost(uint64, optional, tag = "13")]
1360    pub max_connections_per_ip: ::core::option::Option<u64>,
1361    /// Per-cluster override for the global `retry_after` header value
1362    /// (seconds, HTTP 429 only). `None` inherits the global default.
1363    /// `Some(0)` omits the header.
1364    #[prost(uint32, optional, tag = "14")]
1365    pub retry_after: ::core::option::Option<u32>,
1366    /// Optional HTTP health check configuration for backends in this cluster.
1367    /// Tag 8 in this message is the `http2` backend-capability hint and
1368    /// tags 9-14 cover answers/redirect/auth/limits, so health-check
1369    /// configuration occupies tag 15.
1370    #[prost(message, optional, tag = "15")]
1371    pub health_check: ::core::option::Option<HealthCheckConfig>,
1372}
1373#[derive(::serde::Serialize, ::serde::Deserialize)]
1374#[derive(Ord, PartialOrd)]
1375#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1376pub struct HealthCheckConfig {
1377    #[prost(string, required, tag = "1")]
1378    pub uri: ::prost::alloc::string::String,
1379    #[prost(uint32, required, tag = "2", default = "10")]
1380    pub interval: u32,
1381    #[prost(uint32, required, tag = "3", default = "5")]
1382    pub timeout: u32,
1383    #[prost(uint32, required, tag = "4", default = "3")]
1384    pub healthy_threshold: u32,
1385    #[prost(uint32, required, tag = "5", default = "3")]
1386    pub unhealthy_threshold: u32,
1387    /// The probe wire format is derived from `Cluster.http2` (the same
1388    /// backend-capability hint the mux router reads). When the cluster
1389    /// sets `http2 = true`, the probe sends the HTTP/2 connection
1390    /// preface + empty SETTINGS + HEADERS frame on stream 1; otherwise
1391    /// HTTP/1.1. There is no per-`HealthCheckConfig` h2c flag — the
1392    /// probe wire follows the data-plane wire so an h2c-only backend
1393    /// is never probed with HTTP/1.1 (and vice versa).
1394    #[prost(uint32, required, tag = "6", default = "0")]
1395    pub expected_status: u32,
1396}
1397/// add a backend
1398#[derive(::serde::Serialize, ::serde::Deserialize)]
1399#[derive(Ord, PartialOrd)]
1400#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1401pub struct AddBackend {
1402    #[prost(string, required, tag = "1")]
1403    pub cluster_id: ::prost::alloc::string::String,
1404    #[prost(string, required, tag = "2")]
1405    pub backend_id: ::prost::alloc::string::String,
1406    /// the socket address of the backend
1407    #[prost(message, required, tag = "3")]
1408    pub address: SocketAddress,
1409    #[prost(string, optional, tag = "4")]
1410    pub sticky_id: ::core::option::Option<::prost::alloc::string::String>,
1411    #[prost(message, optional, tag = "5")]
1412    pub load_balancing_parameters: ::core::option::Option<LoadBalancingParams>,
1413    #[prost(bool, optional, tag = "6")]
1414    pub backup: ::core::option::Option<bool>,
1415}
1416/// remove an existing backend
1417#[derive(::serde::Serialize, ::serde::Deserialize)]
1418#[derive(Ord, PartialOrd)]
1419#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1420pub struct RemoveBackend {
1421    #[prost(string, required, tag = "1")]
1422    pub cluster_id: ::prost::alloc::string::String,
1423    #[prost(string, required, tag = "2")]
1424    pub backend_id: ::prost::alloc::string::String,
1425    /// the socket address of the backend
1426    #[prost(message, required, tag = "3")]
1427    pub address: SocketAddress,
1428}
1429#[derive(::serde::Serialize, ::serde::Deserialize)]
1430#[derive(Ord, PartialOrd)]
1431#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1432pub struct LoadBalancingParams {
1433    #[prost(int32, required, tag = "1")]
1434    pub weight: i32,
1435}
1436#[derive(::serde::Serialize, ::serde::Deserialize)]
1437#[derive(Ord, PartialOrd)]
1438#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1439pub struct QueryClusterByDomain {
1440    #[prost(string, required, tag = "1")]
1441    pub hostname: ::prost::alloc::string::String,
1442    #[prost(string, optional, tag = "2")]
1443    pub path: ::core::option::Option<::prost::alloc::string::String>,
1444}
1445/// Options when querying metrics
1446#[derive(::serde::Serialize, ::serde::Deserialize)]
1447#[derive(Ord, PartialOrd)]
1448#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1449pub struct QueryMetricsOptions {
1450    /// query a list of available metrics
1451    #[prost(bool, required, tag = "1")]
1452    pub list: bool,
1453    /// query metrics for these clusters
1454    #[prost(string, repeated, tag = "2")]
1455    pub cluster_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
1456    /// query metrics for these backends
1457    #[prost(string, repeated, tag = "3")]
1458    pub backend_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
1459    /// query only these metrics
1460    #[prost(string, repeated, tag = "4")]
1461    pub metric_names: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
1462    /// query only worker and main process metrics (no cluster metrics)
1463    #[prost(bool, required, tag = "5")]
1464    pub no_clusters: bool,
1465    /// display metrics of each worker, without flattening (takes more space)
1466    #[prost(bool, required, tag = "6")]
1467    pub workers: bool,
1468}
1469/// Response to a request
1470#[derive(::serde::Serialize, ::serde::Deserialize)]
1471#[derive(Ord, PartialOrd)]
1472#[derive(Hash, Eq)]
1473#[derive(Clone, PartialEq, ::prost::Message)]
1474pub struct Response {
1475    /// wether the request was a success, a failure, or is processing
1476    #[prost(enumeration = "ResponseStatus", required, tag = "1", default = "Failure")]
1477    pub status: i32,
1478    /// a success or error message
1479    #[prost(string, required, tag = "2")]
1480    pub message: ::prost::alloc::string::String,
1481    /// response data, if any
1482    #[prost(message, optional, tag = "3")]
1483    pub content: ::core::option::Option<ResponseContent>,
1484}
1485/// content of a response
1486#[derive(::serde::Serialize, ::serde::Deserialize)]
1487#[derive(Ord, PartialOrd)]
1488#[derive(Hash, Eq)]
1489#[derive(Clone, PartialEq, ::prost::Message)]
1490pub struct ResponseContent {
1491    #[prost(
1492        oneof = "response_content::ContentType",
1493        tags = "1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17"
1494    )]
1495    pub content_type: ::core::option::Option<response_content::ContentType>,
1496}
1497/// Nested message and enum types in `ResponseContent`.
1498pub mod response_content {
1499    #[derive(::serde::Serialize, ::serde::Deserialize)]
1500    #[serde(rename_all = "SCREAMING_SNAKE_CASE")]
1501    #[derive(Hash, Eq, Ord, PartialOrd)]
1502    #[derive(Clone, PartialEq, ::prost::Oneof)]
1503    pub enum ContentType {
1504        /// a list of workers, with ids, pids, statuses
1505        #[prost(message, tag = "1")]
1506        Workers(super::WorkerInfos),
1507        /// aggregated metrics of main process and workers
1508        #[prost(message, tag = "2")]
1509        Metrics(super::AggregatedMetrics),
1510        /// a collection of worker responses to the same request
1511        #[prost(message, tag = "3")]
1512        WorkerResponses(super::WorkerResponses),
1513        /// a proxy event
1514        #[prost(message, tag = "4")]
1515        Event(super::Event),
1516        /// a filtered list of frontend
1517        #[prost(message, tag = "5")]
1518        FrontendList(super::ListedFrontends),
1519        /// all listeners
1520        #[prost(message, tag = "6")]
1521        ListenersList(super::ListenersList),
1522        /// contains proxy & cluster metrics
1523        #[prost(message, tag = "7")]
1524        WorkerMetrics(super::WorkerMetrics),
1525        /// Lists of metrics that are available
1526        #[prost(message, tag = "8")]
1527        AvailableMetrics(super::AvailableMetrics),
1528        /// a list of cluster informations
1529        #[prost(message, tag = "9")]
1530        Clusters(super::ClusterInformations),
1531        /// collection of hashes of cluster information,
1532        #[prost(message, tag = "10")]
1533        ClusterHashes(super::ClusterHashes),
1534        /// a list of certificates summaries, grouped by socket address
1535        #[prost(message, tag = "11")]
1536        CertificatesByAddress(super::ListOfCertificatesByAddress),
1537        /// a map of complete certificates using fingerprints as key
1538        #[prost(message, tag = "12")]
1539        CertificatesWithFingerprints(super::CertificatesWithFingerprints),
1540        /// a census of the types of requests received since startup,
1541        #[prost(message, tag = "13")]
1542        RequestCounts(super::RequestCounts),
1543        /// current global per-(cluster, source-IP) connection limit
1544        #[prost(message, tag = "14")]
1545        MaxConnectionsPerIpLimit(super::MaxConnectionsPerIpLimit),
1546        /// health check configurations by cluster (renumbered from PR #1191's
1547        /// original `14` since post-1209 occupies that tag).
1548        #[prost(message, tag = "15")]
1549        HealthChecksList(super::HealthChecksList),
1550        /// Aggregated outcome of a `SetMetricDetail` fan-out: per-worker
1551        /// configured/effective/previous_effective levels plus the list of
1552        /// workers that could not decode the verb (mixed-version safety).
1553        #[prost(message, tag = "16")]
1554        MetricDetailStatus(super::MetricDetailStatus),
1555        /// Per-worker status payload returned by a single worker in
1556        /// response to `SetMetricDetail`. The master collects these
1557        /// across the fan-out and assembles them into
1558        /// `MetricDetailStatus.workers\[<worker_id>\]`. Carries the
1559        /// worker's own `(configured, effective, previous_effective,
1560        /// active_lease_count)` quartet — distinct from the master-side
1561        /// view rendered in `MetricDetailStatus.{configured,effective,
1562        /// previous_effective}` because each worker holds its own
1563        /// `Aggregator` with an independent lease table.
1564        #[prost(message, tag = "17")]
1565        WorkerMetricDetailStatus(super::WorkerMetricDetailStatus),
1566    }
1567}
1568#[derive(::serde::Serialize, ::serde::Deserialize)]
1569#[derive(Ord, PartialOrd)]
1570#[derive(Hash, Eq)]
1571#[derive(Clone, PartialEq, ::prost::Message)]
1572pub struct HealthChecksList {
1573    #[prost(btree_map = "string, message", tag = "1")]
1574    pub map: ::prost::alloc::collections::BTreeMap<
1575        ::prost::alloc::string::String,
1576        HealthCheckConfig,
1577    >,
1578}
1579/// a map of worker_id -> ResponseContent
1580#[derive(::serde::Serialize, ::serde::Deserialize)]
1581#[derive(Ord, PartialOrd)]
1582#[derive(Hash, Eq)]
1583#[derive(Clone, PartialEq, ::prost::Message)]
1584pub struct WorkerResponses {
1585    #[prost(btree_map = "string, message", tag = "1")]
1586    pub map: ::prost::alloc::collections::BTreeMap<
1587        ::prost::alloc::string::String,
1588        ResponseContent,
1589    >,
1590}
1591/// lists of frontends present in the state
1592#[derive(::serde::Serialize, ::serde::Deserialize)]
1593#[derive(Ord, PartialOrd)]
1594#[derive(Hash, Eq)]
1595#[derive(Clone, PartialEq, ::prost::Message)]
1596pub struct ListedFrontends {
1597    #[prost(message, repeated, tag = "1")]
1598    pub http_frontends: ::prost::alloc::vec::Vec<RequestHttpFrontend>,
1599    #[prost(message, repeated, tag = "2")]
1600    pub https_frontends: ::prost::alloc::vec::Vec<RequestHttpFrontend>,
1601    #[prost(message, repeated, tag = "3")]
1602    pub tcp_frontends: ::prost::alloc::vec::Vec<RequestTcpFrontend>,
1603}
1604#[derive(::serde::Serialize, ::serde::Deserialize)]
1605#[derive(Ord, PartialOrd)]
1606#[derive(Hash, Eq)]
1607#[derive(Clone, PartialEq, ::prost::Message)]
1608pub struct ClusterInformations {
1609    #[prost(message, repeated, tag = "1")]
1610    pub vec: ::prost::alloc::vec::Vec<ClusterInformation>,
1611}
1612/// Information about a given cluster
1613/// Contains types usually used in requests, because they are readily available in protobuf
1614#[derive(::serde::Serialize, ::serde::Deserialize)]
1615#[derive(Ord, PartialOrd)]
1616#[derive(Hash, Eq)]
1617#[derive(Clone, PartialEq, ::prost::Message)]
1618pub struct ClusterInformation {
1619    #[prost(message, optional, tag = "1")]
1620    pub configuration: ::core::option::Option<Cluster>,
1621    #[prost(message, repeated, tag = "2")]
1622    pub http_frontends: ::prost::alloc::vec::Vec<RequestHttpFrontend>,
1623    #[prost(message, repeated, tag = "3")]
1624    pub https_frontends: ::prost::alloc::vec::Vec<RequestHttpFrontend>,
1625    #[prost(message, repeated, tag = "4")]
1626    pub tcp_frontends: ::prost::alloc::vec::Vec<RequestTcpFrontend>,
1627    #[prost(message, repeated, tag = "5")]
1628    pub backends: ::prost::alloc::vec::Vec<AddBackend>,
1629}
1630/// an event produced by a worker to notify about backends status
1631#[derive(::serde::Serialize, ::serde::Deserialize)]
1632#[derive(Ord, PartialOrd)]
1633#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1634pub struct Event {
1635    #[prost(enumeration = "EventKind", required, tag = "1")]
1636    pub kind: i32,
1637    #[prost(string, optional, tag = "2")]
1638    pub cluster_id: ::core::option::Option<::prost::alloc::string::String>,
1639    #[prost(string, optional, tag = "3")]
1640    pub backend_id: ::core::option::Option<::prost::alloc::string::String>,
1641    #[prost(message, optional, tag = "4")]
1642    pub address: ::core::option::Option<SocketAddress>,
1643    /// Set only when `kind == METRIC_DETAIL_CHANGED` and the worker is
1644    /// surfacing a worker-local lease transition (apply, clear, or polled
1645    /// expiry). Operator-initiated transitions are audited at the master
1646    /// dispatch site and DO emit this event for the SubscribeEvents bus,
1647    /// but the audit-log line for those is generated master-side and
1648    /// duplicates of `metric_detail` should be ignored by SOC tooling.
1649    /// See the `EventKind::METRIC_DETAIL_CHANGED` doc and the
1650    /// `MetricDetailTransition` message below for the trust model.
1651    #[prost(message, optional, tag = "5")]
1652    pub metric_detail: ::core::option::Option<MetricDetailTransition>,
1653}
1654/// Worker-emitted cardinality-lease transition. Populates the
1655/// `Event.metric_detail` field when a worker's `effective` level changes
1656/// because a lease was applied, renewed, expired (TTL janitor), or
1657/// cleared. The master folds these into the audit log alongside the
1658/// operator-initiated transitions emitted from
1659/// `bin/src/command/requests.rs::worker_request`, closing the gap where
1660/// worker-local expiries previously left no audit trail.
1661#[derive(::serde::Serialize, ::serde::Deserialize)]
1662#[derive(Ord, PartialOrd)]
1663#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1664pub struct MetricDetailTransition {
1665    /// The worker's effective cardinality level BEFORE the transition.
1666    #[prost(enumeration = "MetricDetail", required, tag = "1")]
1667    pub previous_effective: i32,
1668    /// The worker's effective cardinality level AFTER the transition.
1669    #[prost(enumeration = "MetricDetail", required, tag = "2")]
1670    pub effective: i32,
1671    /// What caused the transition. Stable strings: "lease_tick_expired"
1672    /// (janitor retired one or more leases), "lease_apply" (worker arm
1673    /// applied a lease), "lease_clear" (worker arm cleared a lease).
1674    /// Operator-initiated apply/clear emit master-side; the worker still
1675    /// emits this Event so the SubscribeEvents bus has one canonical
1676    /// signal for cardinality changes regardless of origin.
1677    #[prost(string, required, tag = "3")]
1678    pub transition_kind: ::prost::alloc::string::String,
1679    /// Operator-supplied lease key (`SetMetricDetail.client_id`) when the
1680    /// transition was triggered by an explicit apply/clear. Empty for
1681    /// janitor expiries, which clear many leases at once.
1682    #[prost(string, optional, tag = "4")]
1683    pub client_id: ::core::option::Option<::prost::alloc::string::String>,
1684}
1685#[derive(::serde::Serialize, ::serde::Deserialize)]
1686#[derive(Ord, PartialOrd)]
1687#[derive(Hash, Eq)]
1688#[derive(Clone, PartialEq, ::prost::Message)]
1689pub struct ClusterHashes {
1690    /// cluster id -> hash of cluster information
1691    #[prost(btree_map = "string, uint64", tag = "1")]
1692    pub map: ::prost::alloc::collections::BTreeMap<::prost::alloc::string::String, u64>,
1693}
1694/// A list of worker infos
1695#[derive(::serde::Serialize, ::serde::Deserialize)]
1696#[derive(Ord, PartialOrd)]
1697#[derive(Hash, Eq)]
1698#[derive(Clone, PartialEq, ::prost::Message)]
1699pub struct WorkerInfos {
1700    #[prost(message, repeated, tag = "1")]
1701    pub vec: ::prost::alloc::vec::Vec<WorkerInfo>,
1702}
1703/// Information about a worker with id, pid, runstate
1704#[derive(::serde::Serialize, ::serde::Deserialize)]
1705#[derive(Ord, PartialOrd)]
1706#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1707pub struct WorkerInfo {
1708    #[prost(uint32, required, tag = "1")]
1709    pub id: u32,
1710    #[prost(int32, required, tag = "2")]
1711    pub pid: i32,
1712    #[prost(enumeration = "RunState", required, tag = "3")]
1713    pub run_state: i32,
1714}
1715/// lists of available metrics in a worker, or in the main process (in which case there are no cluster metrics)
1716#[derive(::serde::Serialize, ::serde::Deserialize)]
1717#[derive(Ord, PartialOrd)]
1718#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1719pub struct AvailableMetrics {
1720    #[prost(string, repeated, tag = "1")]
1721    pub proxy_metrics: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
1722    #[prost(string, repeated, tag = "2")]
1723    pub cluster_metrics: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
1724}
1725/// Aggregated metrics of main process & workers
1726#[derive(::serde::Serialize, ::serde::Deserialize)]
1727#[derive(Ord, PartialOrd)]
1728#[derive(Hash, Eq)]
1729#[derive(Clone, PartialEq, ::prost::Message)]
1730pub struct AggregatedMetrics {
1731    /// metrics about the main process.
1732    /// metric_name -> metric_value
1733    #[prost(btree_map = "string, message", tag = "1")]
1734    pub main: ::prost::alloc::collections::BTreeMap<
1735        ::prost::alloc::string::String,
1736        FilteredMetrics,
1737    >,
1738    /// details of worker metrics, with clusters and backends.
1739    /// worker_id -> worker_metrics
1740    #[prost(btree_map = "string, message", tag = "2")]
1741    pub workers: ::prost::alloc::collections::BTreeMap<
1742        ::prost::alloc::string::String,
1743        WorkerMetrics,
1744    >,
1745    /// if present, contains metrics of clusters and their backends, merged across all workers.
1746    /// cluster_id -> cluster_metrics
1747    #[prost(btree_map = "string, message", tag = "3")]
1748    pub clusters: ::prost::alloc::collections::BTreeMap<
1749        ::prost::alloc::string::String,
1750        ClusterMetrics,
1751    >,
1752    /// if present, proxying metrics, merged accross all workers.
1753    /// metric_name -> metric_value
1754    #[prost(btree_map = "string, message", tag = "4")]
1755    pub proxying: ::prost::alloc::collections::BTreeMap<
1756        ::prost::alloc::string::String,
1757        FilteredMetrics,
1758    >,
1759}
1760/// All metrics of a worker: proxy and clusters
1761/// Populated by Options so partial results can be sent
1762#[derive(::serde::Serialize, ::serde::Deserialize)]
1763#[derive(Ord, PartialOrd)]
1764#[derive(Hash, Eq)]
1765#[derive(Clone, PartialEq, ::prost::Message)]
1766pub struct WorkerMetrics {
1767    /// Metrics of the worker process, key -> value
1768    #[prost(btree_map = "string, message", tag = "1")]
1769    pub proxy: ::prost::alloc::collections::BTreeMap<
1770        ::prost::alloc::string::String,
1771        FilteredMetrics,
1772    >,
1773    /// cluster_id -> cluster_metrics
1774    #[prost(btree_map = "string, message", tag = "2")]
1775    pub clusters: ::prost::alloc::collections::BTreeMap<
1776        ::prost::alloc::string::String,
1777        ClusterMetrics,
1778    >,
1779}
1780/// the metrics of a given cluster, with several backends
1781#[derive(::serde::Serialize, ::serde::Deserialize)]
1782#[derive(Ord, PartialOrd)]
1783#[derive(Hash, Eq)]
1784#[derive(Clone, PartialEq, ::prost::Message)]
1785pub struct ClusterMetrics {
1786    /// metric name -> metric value
1787    #[prost(btree_map = "string, message", tag = "1")]
1788    pub cluster: ::prost::alloc::collections::BTreeMap<
1789        ::prost::alloc::string::String,
1790        FilteredMetrics,
1791    >,
1792    /// list of backends with their metrics
1793    #[prost(message, repeated, tag = "2")]
1794    pub backends: ::prost::alloc::vec::Vec<BackendMetrics>,
1795}
1796#[derive(::serde::Serialize, ::serde::Deserialize)]
1797#[derive(Ord, PartialOrd)]
1798#[derive(Hash, Eq)]
1799#[derive(Clone, PartialEq, ::prost::Message)]
1800pub struct BackendMetrics {
1801    #[prost(string, required, tag = "1")]
1802    pub backend_id: ::prost::alloc::string::String,
1803    #[prost(btree_map = "string, message", tag = "2")]
1804    pub metrics: ::prost::alloc::collections::BTreeMap<
1805        ::prost::alloc::string::String,
1806        FilteredMetrics,
1807    >,
1808}
1809/// A metric, in a "filtered" format, which means: sendable to outside programs.
1810#[derive(::serde::Serialize, ::serde::Deserialize)]
1811#[derive(Ord, PartialOrd)]
1812#[derive(Hash, Eq)]
1813#[derive(Clone, PartialEq, ::prost::Message)]
1814pub struct FilteredMetrics {
1815    #[prost(oneof = "filtered_metrics::Inner", tags = "1, 2, 3, 4, 5, 6")]
1816    pub inner: ::core::option::Option<filtered_metrics::Inner>,
1817}
1818/// Nested message and enum types in `FilteredMetrics`.
1819pub mod filtered_metrics {
1820    #[derive(::serde::Serialize, ::serde::Deserialize)]
1821    #[serde(rename_all = "SCREAMING_SNAKE_CASE")]
1822    #[derive(Hash, Eq, Ord, PartialOrd)]
1823    #[derive(Clone, PartialEq, ::prost::Oneof)]
1824    pub enum Inner {
1825        /// increases or decrease depending on the state
1826        #[prost(uint64, tag = "1")]
1827        Gauge(u64),
1828        /// increases only
1829        #[prost(int64, tag = "2")]
1830        Count(i64),
1831        /// milliseconds
1832        #[prost(uint64, tag = "3")]
1833        Time(u64),
1834        #[prost(message, tag = "4")]
1835        Percentiles(super::Percentiles),
1836        #[prost(message, tag = "5")]
1837        TimeSerie(super::FilteredTimeSerie),
1838        #[prost(message, tag = "6")]
1839        Histogram(super::FilteredHistogram),
1840    }
1841}
1842#[derive(::serde::Serialize, ::serde::Deserialize)]
1843#[derive(Ord, PartialOrd)]
1844#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1845pub struct FilteredTimeSerie {
1846    #[prost(uint32, required, tag = "1")]
1847    pub last_second: u32,
1848    #[prost(uint32, repeated, packed = "false", tag = "2")]
1849    pub last_minute: ::prost::alloc::vec::Vec<u32>,
1850    #[prost(uint32, repeated, packed = "false", tag = "3")]
1851    pub last_hour: ::prost::alloc::vec::Vec<u32>,
1852}
1853#[derive(::serde::Serialize, ::serde::Deserialize)]
1854#[derive(Ord, PartialOrd)]
1855#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1856pub struct Percentiles {
1857    #[prost(uint64, required, tag = "1")]
1858    pub samples: u64,
1859    #[prost(uint64, required, tag = "2")]
1860    pub p_50: u64,
1861    #[prost(uint64, required, tag = "3")]
1862    pub p_90: u64,
1863    #[prost(uint64, required, tag = "4")]
1864    pub p_99: u64,
1865    #[prost(uint64, required, tag = "5")]
1866    pub p_99_9: u64,
1867    #[prost(uint64, required, tag = "6")]
1868    pub p_99_99: u64,
1869    #[prost(uint64, required, tag = "7")]
1870    pub p_99_999: u64,
1871    #[prost(uint64, required, tag = "8")]
1872    pub p_100: u64,
1873    #[prost(uint64, required, tag = "9")]
1874    pub sum: u64,
1875}
1876/// a histogram meant to be translated to prometheus
1877#[derive(::serde::Serialize, ::serde::Deserialize)]
1878#[derive(Ord, PartialOrd)]
1879#[derive(Hash, Eq)]
1880#[derive(Clone, PartialEq, ::prost::Message)]
1881pub struct FilteredHistogram {
1882    #[prost(uint64, required, tag = "1")]
1883    pub sum: u64,
1884    #[prost(uint64, required, tag = "2")]
1885    pub count: u64,
1886    #[prost(message, repeated, tag = "3")]
1887    pub buckets: ::prost::alloc::vec::Vec<Bucket>,
1888}
1889/// a prometheus histogram bucket
1890#[derive(::serde::Serialize, ::serde::Deserialize)]
1891#[derive(Ord, PartialOrd)]
1892#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1893pub struct Bucket {
1894    #[prost(uint64, required, tag = "1")]
1895    pub count: u64,
1896    /// upper range of the bucket (le = less or equal)
1897    #[prost(uint64, required, tag = "2")]
1898    pub le: u64,
1899}
1900#[derive(::serde::Serialize, ::serde::Deserialize)]
1901#[derive(Ord, PartialOrd)]
1902#[derive(Hash, Eq)]
1903#[derive(Clone, PartialEq, ::prost::Message)]
1904pub struct RequestCounts {
1905    #[prost(btree_map = "string, int32", tag = "1")]
1906    pub map: ::prost::alloc::collections::BTreeMap<::prost::alloc::string::String, i32>,
1907}
1908/// `0` means unlimited (the feature is disabled). Returned by workers in
1909/// response to `Request.query_max_connections_per_ip`.
1910#[derive(::serde::Serialize, ::serde::Deserialize)]
1911#[derive(Ord, PartialOrd)]
1912#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1913pub struct MaxConnectionsPerIpLimit {
1914    #[prost(uint64, required, tag = "1")]
1915    pub limit: u64,
1916}
1917/// matches std::net::SocketAddr in the Rust library
1918/// beware that the ports are expressed with uint32 here,
1919/// but they should NOT exceed uint16 value
1920#[derive(::serde::Serialize, ::serde::Deserialize)]
1921#[derive(Ord, PartialOrd)]
1922#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1923pub struct SocketAddress {
1924    #[prost(message, required, tag = "1")]
1925    pub ip: IpAddress,
1926    #[prost(uint32, required, tag = "2")]
1927    pub port: u32,
1928}
1929#[derive(::serde::Serialize, ::serde::Deserialize)]
1930#[derive(Ord, PartialOrd)]
1931#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1932pub struct IpAddress {
1933    #[prost(oneof = "ip_address::Inner", tags = "1, 2")]
1934    pub inner: ::core::option::Option<ip_address::Inner>,
1935}
1936/// Nested message and enum types in `IpAddress`.
1937pub mod ip_address {
1938    #[derive(::serde::Serialize, ::serde::Deserialize)]
1939    #[serde(rename_all = "SCREAMING_SNAKE_CASE")]
1940    #[derive(Ord, PartialOrd)]
1941    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Oneof)]
1942    pub enum Inner {
1943        #[prost(fixed32, tag = "1")]
1944        V4(u32),
1945        #[prost(message, tag = "2")]
1946        V6(super::Uint128),
1947    }
1948}
1949/// used to represent the 128 bits of an IPv6 address
1950#[derive(::serde::Serialize, ::serde::Deserialize)]
1951#[derive(Ord, PartialOrd)]
1952#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1953pub struct Uint128 {
1954    /// higher value, first 8 bytes of the ip
1955    #[prost(uint64, required, tag = "1")]
1956    pub low: u64,
1957    /// lower value, last 8 bytes of the ip
1958    #[prost(uint64, required, tag = "2")]
1959    pub high: u64,
1960}
1961/// This is sent only from Sōzu to Sōzu
1962#[derive(::serde::Serialize, ::serde::Deserialize)]
1963#[derive(Ord, PartialOrd)]
1964#[derive(Hash, Eq)]
1965#[derive(Clone, PartialEq, ::prost::Message)]
1966pub struct WorkerRequest {
1967    #[prost(string, required, tag = "1")]
1968    pub id: ::prost::alloc::string::String,
1969    #[prost(message, required, tag = "2")]
1970    pub content: Request,
1971}
1972/// A response as sent by a worker
1973#[derive(::serde::Serialize, ::serde::Deserialize)]
1974#[derive(Ord, PartialOrd)]
1975#[derive(Hash, Eq)]
1976#[derive(Clone, PartialEq, ::prost::Message)]
1977pub struct WorkerResponse {
1978    #[prost(string, required, tag = "1")]
1979    pub id: ::prost::alloc::string::String,
1980    #[prost(enumeration = "ResponseStatus", required, tag = "2")]
1981    pub status: i32,
1982    /// an associated message to detail failure, success or processing
1983    #[prost(string, required, tag = "3")]
1984    pub message: ::prost::alloc::string::String,
1985    #[prost(message, optional, tag = "4")]
1986    pub content: ::core::option::Option<ResponseContent>,
1987}
1988/// Apply, renew, or release a runtime cardinality lease on the metrics drain.
1989///
1990/// Leasing model: `sozu top` (and any future TUI client) leases a higher
1991/// `MetricDetail` for the duration of an interactive session. The worker's
1992/// effective detail is `max(configured, max(active leases))`, where
1993/// `configured` is `MetricsConfig.detail` from the static configuration.
1994/// Multiple clients can lease independently; the worker keeps a `client_id`-
1995/// keyed table and uses the maximum across active entries.
1996///
1997/// Lifecycle:
1998/// 1. Apply: send `SetMetricDetail{ client_id, detail, ttl_seconds, reason }`.
1999///    The worker stores `(client_id) -> (detail, expires_at = now + ttl)`. If
2000///    a lease for `client_id` already exists, it is REPLACED (acts as a
2001///    renewal). The renewer client is expected to re-send every `ttl/2`.
2002/// 2. Expire: leases self-expire server-side at `expires_at`. The worker's
2003///    janitor (5s polled tick at the top of `notify`) prunes expired leases
2004///    and recomputes effective. Crash safety: a dead client is forgotten.
2005/// 3. Clear: send `SetMetricDetail{ client_id, clear: true }` for explicit
2006///    revocation. `client_id` must match the leased entry; mismatched IDs
2007///    are silently ignored (other clients' leases are not affected).
2008///
2009/// Audit
2010/// =====
2011/// Every operator-initiated effective-level transition emits an
2012/// `EventKind::METRIC_DETAIL_CHANGED` event on `SubscribeEvents` with the
2013/// previous and new effective levels and the requesting `client_id` plus
2014/// optional `reason` text. Renewal-no-op (same effective level) is NOT
2015/// emitted.
2016///
2017/// Emitter scope: operator-initiated transitions emit
2018/// `METRIC_DETAIL_CHANGED` via the master-side audit log. Worker-local
2019/// transitions — the polled janitor expiring a lease, or a worker-local
2020/// clear/apply after a master fan-out — are not yet surfaced; follow-up
2021/// tracked separately.
2022///
2023/// Backwards compatibility
2024/// =======================
2025/// Workers that pre-date this verb cannot decode `SetMetricDetail` and return
2026/// `WorkerResponse::error("unknown request type")` which folds into the standard
2027/// fan-out error tally (`extras.fanout.workers_err`); operators see "succeeded
2028/// with errors" rather than a dedicated capability-skip list. Production
2029/// deployments keep master + workers in sync via the `UpgradeMain` hot-upgrade
2030/// flow, so this mixed-version state is transient. The master itself also
2031/// leases (mirroring the symmetric `setup_metrics` path) so the audit log has a
2032/// single canonical row when an operator flips detail across the fleet.
2033#[derive(::serde::Serialize, ::serde::Deserialize)]
2034#[derive(Ord, PartialOrd)]
2035#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2036pub struct SetMetricDetail {
2037    /// Stable identifier for the leasing client (`sozu top` uses
2038    /// `top:<pid>:<random>`). Required so multiple TUIs / scrapers / other
2039    /// tooling can lease independently.
2040    #[prost(string, required, tag = "1")]
2041    pub client_id: ::prost::alloc::string::String,
2042    /// Target detail for the lease. Required when `clear` is false/absent.
2043    #[prost(enumeration = "MetricDetail", optional, tag = "2")]
2044    pub detail: ::core::option::Option<i32>,
2045    /// Time-to-live for the lease in seconds. The worker rejects (FAILURE)
2046    /// values larger than 300s to bound the worst-case effect of a stuck
2047    /// renewer. Defaults server-side to 60s when absent (the master treats
2048    /// 0 as "use default" and emits a warning).
2049    #[prost(uint32, optional, tag = "3")]
2050    pub ttl_seconds: ::core::option::Option<u32>,
2051    /// When true, releases the lease for `client_id` instead of applying.
2052    /// `detail` and `ttl_seconds` are ignored when `clear` is true.
2053    #[prost(bool, optional, tag = "4")]
2054    pub clear: ::core::option::Option<bool>,
2055    /// Optional human-readable provenance for the audit log
2056    /// (e.g. `"sozu top --detail backend"`, `"prometheus-scraper:sozu-1"`).
2057    #[prost(string, optional, tag = "5")]
2058    pub reason: ::core::option::Option<::prost::alloc::string::String>,
2059    /// Master-populated peer binding. These fields are NOT set by clients —
2060    /// the master fills them in `bin/src/command/requests.rs::worker_request`
2061    /// from the connecting `ClientSession` (`actor_pid` + `session_ulid`)
2062    /// before forwarding to workers. The worker stores the binding
2063    /// alongside the lease and rejects subsequent `clear` requests whose
2064    /// binding does not match the apply-time binding. Prevents one same-UID
2065    /// operator from accidentally (or deliberately) clearing another
2066    /// operator's lease by guessing the `client_id` format. A `None` value
2067    /// means "binding not available" — the worker accepts any matching
2068    /// `client_id` clear, preserving compat with pre-binding callers and
2069    /// with platforms whose unix socket peer credentials are unavailable.
2070    #[prost(int32, optional, tag = "6")]
2071    pub peer_pid: ::core::option::Option<i32>,
2072    #[prost(string, optional, tag = "7")]
2073    pub peer_session_ulid: ::core::option::Option<::prost::alloc::string::String>,
2074}
2075/// Per-worker outcome of a `SetMetricDetail` fan-out. Reported back to the
2076/// requesting client so it can decide whether the elevation actually took
2077/// effect (e.g. all workers acknowledged) or whether degraded operation
2078/// (some workers too old) is in play.
2079#[derive(::serde::Serialize, ::serde::Deserialize)]
2080#[derive(Ord, PartialOrd)]
2081#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
2082pub struct WorkerMetricDetailStatus {
2083    /// The worker's static `MetricsConfig.detail` (or DETAIL_CLUSTER if
2084    /// unset). Independent of leases.
2085    #[prost(enumeration = "MetricDetail", required, tag = "1")]
2086    pub configured: i32,
2087    /// Effective level AFTER processing this verb: `max(configured, leases)`.
2088    #[prost(enumeration = "MetricDetail", required, tag = "2")]
2089    pub effective: i32,
2090    /// Effective level BEFORE the verb. Equal to `effective` for a no-op.
2091    #[prost(enumeration = "MetricDetail", required, tag = "3")]
2092    pub previous_effective: i32,
2093    /// Number of active leases on this worker (post-prune). Useful to
2094    /// surface "another client is still leasing this level" in the TUI.
2095    #[prost(uint32, required, tag = "4")]
2096    pub active_lease_count: u32,
2097}
2098/// Aggregated `SetMetricDetail` outcome across the fleet. Returned by the
2099/// master to the requesting client (no `WorkerResponses` indirection needed
2100/// because the schema is symmetric per-worker).
2101#[derive(::serde::Serialize, ::serde::Deserialize)]
2102#[derive(Ord, PartialOrd)]
2103#[derive(Hash, Eq)]
2104#[derive(Clone, PartialEq, ::prost::Message)]
2105pub struct MetricDetailStatus {
2106    /// The master's own `configured` view (mirrors a worker's view since the
2107    /// master also runs the metrics aggregator).
2108    #[prost(enumeration = "MetricDetail", required, tag = "1")]
2109    pub configured: i32,
2110    /// Master's effective level AFTER the verb.
2111    #[prost(enumeration = "MetricDetail", required, tag = "2")]
2112    pub effective: i32,
2113    /// Master's effective level BEFORE the verb.
2114    #[prost(enumeration = "MetricDetail", required, tag = "3")]
2115    pub previous_effective: i32,
2116    /// Per-worker status. Map keyed by worker_id (string form for parity
2117    /// with `WorkerResponses`).
2118    #[prost(btree_map = "string, message", tag = "4")]
2119    pub workers: ::prost::alloc::collections::BTreeMap<
2120        ::prost::alloc::string::String,
2121        WorkerMetricDetailStatus,
2122    >,
2123}
2124/// intended to workers
2125#[derive(::serde::Serialize, ::serde::Deserialize)]
2126#[derive(Ord, PartialOrd)]
2127#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2128pub struct ServerMetricsConfig {
2129    #[prost(string, required, tag = "1")]
2130    pub address: ::prost::alloc::string::String,
2131    #[prost(bool, required, tag = "2")]
2132    pub tagged_metrics: bool,
2133    #[prost(string, optional, tag = "3")]
2134    pub prefix: ::core::option::Option<::prost::alloc::string::String>,
2135    /// optional in proto: workers built before this field default to
2136    /// DETAIL_CLUSTER on the lib side to preserve historical behaviour.
2137    #[prost(enumeration = "MetricDetail", optional, tag = "4")]
2138    pub detail: ::core::option::Option<i32>,
2139}
2140/// Used by a worker to start its server loop.
2141/// The defaults should match those of the config module
2142#[derive(::serde::Serialize, ::serde::Deserialize)]
2143#[derive(Ord, PartialOrd)]
2144#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2145pub struct ServerConfig {
2146    #[prost(uint64, required, tag = "1", default = "10000")]
2147    pub max_connections: u64,
2148    #[prost(uint32, required, tag = "2", default = "60")]
2149    pub front_timeout: u32,
2150    #[prost(uint32, required, tag = "3", default = "30")]
2151    pub back_timeout: u32,
2152    #[prost(uint32, required, tag = "4", default = "3")]
2153    pub connect_timeout: u32,
2154    #[prost(uint32, required, tag = "5", default = "1800")]
2155    pub zombie_check_interval: u32,
2156    #[prost(uint32, required, tag = "6", default = "60")]
2157    pub accept_queue_timeout: u32,
2158    #[prost(uint64, required, tag = "7", default = "1")]
2159    pub min_buffers: u64,
2160    #[prost(uint64, required, tag = "8", default = "1000")]
2161    pub max_buffers: u64,
2162    #[prost(uint64, required, tag = "9", default = "16393")]
2163    pub buffer_size: u64,
2164    #[prost(string, required, tag = "10", default = "info")]
2165    pub log_level: ::prost::alloc::string::String,
2166    #[prost(string, required, tag = "11", default = "stdout")]
2167    pub log_target: ::prost::alloc::string::String,
2168    #[prost(string, optional, tag = "12")]
2169    pub access_logs_target: ::core::option::Option<::prost::alloc::string::String>,
2170    #[prost(uint64, required, tag = "13", default = "1000000")]
2171    pub command_buffer_size: u64,
2172    #[prost(uint64, required, tag = "14", default = "2000000")]
2173    pub max_command_buffer_size: u64,
2174    #[prost(message, optional, tag = "15")]
2175    pub metrics: ::core::option::Option<ServerMetricsConfig>,
2176    #[prost(enumeration = "ProtobufAccessLogFormat", required, tag = "16")]
2177    pub access_log_format: i32,
2178    #[prost(bool, required, tag = "17")]
2179    pub log_colored: bool,
2180    /// Dedicated file path for the control-plane audit trail. When set on the
2181    /// main process, every audit line is also appended to this file opened
2182    /// `O_APPEND | O_CREAT` with mode `0o640`. Workers currently ignore this
2183    /// field (audit only lives on the main), but the field is propagated on
2184    /// the proto wire so a future worker-side audit path can pick it up.
2185    #[prost(string, optional, tag = "18")]
2186    pub audit_logs_target: ::core::option::Option<::prost::alloc::string::String>,
2187    /// Dedicated JSON mirror of the audit log. One JSON object per line for
2188    /// SIEM ingest. Same lifecycle as `audit_logs_target`.
2189    #[prost(string, optional, tag = "19")]
2190    pub audit_logs_json_target: ::core::option::Option<::prost::alloc::string::String>,
2191    /// Slab capacity multiplier per connection. Defaults to 4 to accommodate
2192    /// H2 multiplexing (1 frontend + up to 3 backend connections per
2193    /// frontend). Operators with topologies that fan out across more clusters
2194    /// per session can raise this; the slab capacity is computed as
2195    /// `10 + slab_entries_per_connection * max_connections`. Clamped to
2196    /// \[2, 32\] at config-load time. The previous compile-time constant was
2197    /// 4 and remains the default.
2198    #[prost(uint64, optional, tag = "20")]
2199    pub slab_entries_per_connection: ::core::option::Option<u64>,
2200    /// Maximum length, in bytes, of a base64-decoded `Authorization: Basic`
2201    /// payload accepted by `mux::auth`. Caps the per-failed-auth allocation
2202    /// so a hostile peer cannot force the worker to decode arbitrarily
2203    /// large tokens. RFC 7617 imposes no upper bound; the default is 4096
2204    /// (well above the realistic shape `username:password`). Operators on
2205    /// tight memory budgets can lower this to 256-512; values that approach
2206    /// the per-frontend `buffer_size` raise a warning at config-load time
2207    /// (see config.rs validation). Set once at worker boot via
2208    /// `mux::auth::set_max_decoded_credential_bytes`.
2209    #[prost(uint64, optional, tag = "21")]
2210    pub basic_auth_max_credential_bytes: ::core::option::Option<u64>,
2211    /// when the accept queue is full (max_connections reached), evict the
2212    /// least recently active sessions to make room for new connections.
2213    /// Defaults to false: during DDoS, existing connections are likely real clients.
2214    #[prost(bool, optional, tag = "22", default = "false")]
2215    pub evict_on_queue_full: ::core::option::Option<bool>,
2216    /// Default per-(cluster, source-IP) connection limit. `0` means unlimited
2217    /// (the default). When a request resolves to a cluster whose
2218    /// `(cluster_id, client_ip)` already holds this many concurrent
2219    /// connections, the proxy answers HTTP 429 (H1 + H2) or closes the TCP
2220    /// socket gracefully. Each cluster may override with its own
2221    /// `max_connections_per_ip`. The source IP is the proxy-protocol
2222    /// address when present, else `peer_addr`.
2223    #[prost(uint64, optional, tag = "23", default = "0")]
2224    pub max_connections_per_ip: ::core::option::Option<u64>,
2225    /// Default `Retry-After` header value (seconds) sent on HTTP 429
2226    /// responses. `0` omits the header (rendering `Retry-After: 0` invites
2227    /// an immediate retry that defeats the limit). Per-cluster overrides
2228    /// are available on the `Cluster` message. TCP rejections do not emit
2229    /// this value (no HTTP envelope), but it is still accepted in the
2230    /// proto/config shape for symmetry.
2231    #[prost(uint32, optional, tag = "24", default = "60")]
2232    pub retry_after: ::core::option::Option<u32>,
2233    /// Requested kernel-pipe capacity, in bytes, for each `splice(2)`
2234    /// zero-copy direction in the `Pipe` protocol. Applied via
2235    /// `fcntl(F_SETPIPE_SZ)` per pipe at `SplicePipe::new`; the kernel
2236    /// rounds up to a page boundary and caps the value at
2237    /// `/proc/sys/fs/pipe-max-size` (default 1 MiB for unprivileged
2238    /// processes; CAP_SYS_RESOURCE goes higher). The realised capacity
2239    /// is read back via `fcntl(F_GETPIPE_SZ)` and used as the per-call
2240    /// `len` for `splice_in`. `None` keeps the kernel default of 64 KiB.
2241    /// Larger values amortise syscalls and reduce wakeups for bulk-
2242    /// transfer workloads at the cost of per-session pinned memory.
2243    /// Linux-only; ignored on builds without the `splice` feature.
2244    #[prost(uint64, optional, tag = "25")]
2245    pub splice_pipe_capacity_bytes: ::core::option::Option<u64>,
2246}
2247/// Addresses of listeners, passed to new workers
2248#[derive(::serde::Serialize, ::serde::Deserialize)]
2249#[derive(Ord, PartialOrd)]
2250#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2251pub struct ListenersCount {
2252    /// socket addresses of HTTP listeners
2253    #[prost(string, repeated, tag = "1")]
2254    pub http: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
2255    /// socket addresses of HTTPS listeners
2256    #[prost(string, repeated, tag = "2")]
2257    pub tls: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
2258    /// socket addresses of TCP listeners
2259    #[prost(string, repeated, tag = "3")]
2260    pub tcp: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
2261}
2262/// the Sōzu state, passed to a new worker.
2263/// Consists in a collection of worker requests
2264#[derive(::serde::Serialize, ::serde::Deserialize)]
2265#[derive(Ord, PartialOrd)]
2266#[derive(Hash, Eq)]
2267#[derive(Clone, PartialEq, ::prost::Message)]
2268pub struct InitialState {
2269    #[prost(message, repeated, tag = "1")]
2270    pub requests: ::prost::alloc::vec::Vec<WorkerRequest>,
2271}
2272#[derive(::serde::Serialize, ::serde::Deserialize)]
2273#[derive(Ord, PartialOrd)]
2274#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2275pub struct OpenTelemetry {
2276    #[prost(string, required, tag = "1")]
2277    pub trace_id: ::prost::alloc::string::String,
2278    #[prost(string, required, tag = "2")]
2279    pub span_id: ::prost::alloc::string::String,
2280    #[prost(string, optional, tag = "3")]
2281    pub parent_span_id: ::core::option::Option<::prost::alloc::string::String>,
2282}
2283/// An access log, meant to be passed to another agent
2284#[derive(::serde::Serialize, ::serde::Deserialize)]
2285#[derive(Ord, PartialOrd)]
2286#[derive(Hash, Eq)]
2287#[derive(Clone, PartialEq, ::prost::Message)]
2288pub struct ProtobufAccessLog {
2289    /// error message if any
2290    #[prost(string, optional, tag = "1")]
2291    pub message: ::core::option::Option<::prost::alloc::string::String>,
2292    /// LogContext = request_id + cluster_id + backend_id
2293    #[prost(message, required, tag = "2")]
2294    pub request_id: Uint128,
2295    /// id of the cluster (set of frontend, backend, routing rules)
2296    #[prost(string, optional, tag = "3")]
2297    pub cluster_id: ::core::option::Option<::prost::alloc::string::String>,
2298    /// id of the backend (the server to which the traffic is redirected)
2299    #[prost(string, optional, tag = "4")]
2300    pub backend_id: ::core::option::Option<::prost::alloc::string::String>,
2301    /// ip and port of the client
2302    #[prost(message, optional, tag = "5")]
2303    pub session_address: ::core::option::Option<SocketAddress>,
2304    /// socket address of the backend server
2305    #[prost(message, optional, tag = "6")]
2306    pub backend_address: ::core::option::Option<SocketAddress>,
2307    /// the protocol, with SSL/TLS version, for instance "HTTPS-TLS1.1"
2308    #[prost(string, required, tag = "7")]
2309    pub protocol: ::prost::alloc::string::String,
2310    /// TCP or HTTP endpoint (method, path, context...)
2311    #[prost(message, required, tag = "8")]
2312    pub endpoint: ProtobufEndpoint,
2313    /// round trip time for the client (microseconds)
2314    #[prost(uint64, optional, tag = "9")]
2315    pub client_rtt: ::core::option::Option<u64>,
2316    /// round trip time for the backend (microseconds)
2317    #[prost(uint64, optional, tag = "10")]
2318    pub server_rtt: ::core::option::Option<u64>,
2319    /// time spent on a session (microseconds)
2320    #[prost(uint64, required, tag = "13")]
2321    pub service_time: u64,
2322    /// number of bytes received from the client
2323    #[prost(uint64, required, tag = "14")]
2324    pub bytes_in: u64,
2325    /// number of bytes written to the client
2326    #[prost(uint64, required, tag = "15")]
2327    pub bytes_out: u64,
2328    /// value of the User-Agent header, if any
2329    #[prost(string, optional, tag = "16")]
2330    pub user_agent: ::core::option::Option<::prost::alloc::string::String>,
2331    /// custom tags as key-values, for instance owner_id: MyOrganisation
2332    #[prost(btree_map = "string, string", tag = "17")]
2333    pub tags: ::prost::alloc::collections::BTreeMap<
2334        ::prost::alloc::string::String,
2335        ::prost::alloc::string::String,
2336    >,
2337    /// short description of which process sends the log, for instance: "WRK-02"
2338    #[prost(string, required, tag = "18")]
2339    pub tag: ::prost::alloc::string::String,
2340    /// POSIX timestamp, nanoseconds
2341    #[prost(message, required, tag = "19")]
2342    pub time: Uint128,
2343    /// Entire time between first byte received and last byte of the response.
2344    /// If a request ends abruptly before the last byte is transmitted,
2345    /// the `request_time` produced is the time elapsed since the first byte received.
2346    #[prost(uint64, optional, tag = "20")]
2347    pub request_time: ::core::option::Option<u64>,
2348    /// time for the backend to respond (microseconds)
2349    #[prost(uint64, optional, tag = "21")]
2350    pub response_time: ::core::option::Option<u64>,
2351    /// OpenTelemetry tracing information
2352    #[prost(message, optional, tag = "22")]
2353    pub otel: ::core::option::Option<OpenTelemetry>,
2354    /// connection/session ULID — stable across all requests multiplexed on the
2355    /// same TCP or TLS connection. Distinct from `request_id`, which is set
2356    /// per-request (one per H2 stream, one per H1 keep-alive exchange).
2357    #[prost(message, optional, tag = "23")]
2358    pub session_id: ::core::option::Option<Uint128>,
2359    /// Value of the `x-request-id` header as forwarded to the backend —
2360    /// either preserved verbatim from the client/upstream LB, or derived from
2361    /// the request ULID when the client did not supply one. Universal
2362    /// correlation key for end-to-end tracing across Envoy/HAProxy/Sōzu hops.
2363    #[prost(string, optional, tag = "24")]
2364    pub x_request_id: ::core::option::Option<::prost::alloc::string::String>,
2365    /// Negotiated TLS protocol version, short-form (e.g. "TLSv1.3"). Captured
2366    /// once at handshake completion. `None` for plaintext listeners or when
2367    /// the rustls version label is unknown to Sōzu.
2368    #[prost(string, optional, tag = "25")]
2369    pub tls_version: ::core::option::Option<::prost::alloc::string::String>,
2370    /// Negotiated TLS cipher suite, short-form (e.g.
2371    /// "TLS_AES_128_GCM_SHA256"). Captured once at handshake completion.
2372    /// `None` for plaintext listeners or when the rustls cipher label is
2373    /// unknown to Sōzu.
2374    #[prost(string, optional, tag = "26")]
2375    pub tls_cipher: ::core::option::Option<::prost::alloc::string::String>,
2376    /// TLS Server Name Indication (SNI) sent by the client at handshake.
2377    /// Stored pre-lowercased without a port. `None` for plaintext listeners
2378    /// or when the client omitted the SNI extension.
2379    #[prost(string, optional, tag = "27")]
2380    pub tls_sni: ::core::option::Option<::prost::alloc::string::String>,
2381    /// Negotiated ALPN protocol, short-form (e.g. "h2", "http/1.1"). `None`
2382    /// for plaintext listeners or when no ALPN was negotiated.
2383    #[prost(string, optional, tag = "28")]
2384    pub tls_alpn: ::core::option::Option<::prost::alloc::string::String>,
2385    /// Verbatim value of the client-supplied `X-Forwarded-For` header as
2386    /// observed before Sōzu appended its own hop. Comma-separated chain of
2387    /// proxy hops (e.g. `"203.0.113.5, 198.51.100.10"`). `None` if no
2388    /// upstream proxy supplied the header.
2389    #[prost(string, optional, tag = "29")]
2390    pub xff_chain: ::core::option::Option<::prost::alloc::string::String>,
2391}
2392#[derive(::serde::Serialize, ::serde::Deserialize)]
2393#[derive(Ord, PartialOrd)]
2394#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2395pub struct ProtobufEndpoint {
2396    #[prost(oneof = "protobuf_endpoint::Inner", tags = "1, 2")]
2397    pub inner: ::core::option::Option<protobuf_endpoint::Inner>,
2398}
2399/// Nested message and enum types in `ProtobufEndpoint`.
2400pub mod protobuf_endpoint {
2401    #[derive(::serde::Serialize, ::serde::Deserialize)]
2402    #[serde(rename_all = "SCREAMING_SNAKE_CASE")]
2403    #[derive(Ord, PartialOrd)]
2404    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
2405    pub enum Inner {
2406        #[prost(message, tag = "1")]
2407        Http(super::HttpEndpoint),
2408        #[prost(message, tag = "2")]
2409        Tcp(super::TcpEndpoint),
2410    }
2411}
2412#[derive(::serde::Serialize, ::serde::Deserialize)]
2413#[derive(Ord, PartialOrd)]
2414#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2415pub struct HttpEndpoint {
2416    #[prost(string, optional, tag = "1")]
2417    pub method: ::core::option::Option<::prost::alloc::string::String>,
2418    #[prost(string, optional, tag = "2")]
2419    pub authority: ::core::option::Option<::prost::alloc::string::String>,
2420    #[prost(string, optional, tag = "3")]
2421    pub path: ::core::option::Option<::prost::alloc::string::String>,
2422    /// warning: this should be a u16 but protobuf only has uint32.
2423    /// Make sure the value never exceeds u16 bounds.
2424    #[prost(uint32, optional, tag = "4")]
2425    pub status: ::core::option::Option<u32>,
2426    #[prost(string, optional, tag = "5")]
2427    pub reason: ::core::option::Option<::prost::alloc::string::String>,
2428}
2429#[derive(::serde::Serialize, ::serde::Deserialize)]
2430#[derive(Ord, PartialOrd)]
2431#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
2432pub struct TcpEndpoint {}
2433#[derive(::serde::Serialize, ::serde::Deserialize)]
2434#[serde(rename_all = "SCREAMING_SNAKE_CASE")]
2435#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
2436#[repr(i32)]
2437pub enum ListenerType {
2438    Http = 0,
2439    Https = 1,
2440    Tcp = 2,
2441}
2442impl ListenerType {
2443    /// String value of the enum field names used in the ProtoBuf definition.
2444    ///
2445    /// The values are not transformed in any way and thus are considered stable
2446    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
2447    pub fn as_str_name(&self) -> &'static str {
2448        match self {
2449            Self::Http => "HTTP",
2450            Self::Https => "HTTPS",
2451            Self::Tcp => "TCP",
2452        }
2453    }
2454    /// Creates an enum from field names used in the ProtoBuf definition.
2455    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2456        match value {
2457            "HTTP" => Some(Self::Http),
2458            "HTTPS" => Some(Self::Https),
2459            "TCP" => Some(Self::Tcp),
2460            _ => None,
2461        }
2462    }
2463}
2464/// Frontend-level redirect policy. Mirrors HAProxy's
2465/// `http-request redirect|deny|auth` directives.
2466/// FORWARD routes to the backend (default).
2467/// PERMANENT returns 301 with a `Location` header derived from
2468/// `redirect_scheme`, optional `rewrite_*` fields, and `cluster.https_redirect_port`.
2469/// FOUND returns 302 — a temporary redirect (RFC 9110 §15.4.3); user agents may
2470/// rewrite POST to GET on follow.
2471/// PERMANENT_REDIRECT returns 308 — a permanent redirect (RFC 9110 §15.4.9); the
2472/// HTTP method MUST be preserved on follow (no GET-rewrite on POST).
2473/// UNAUTHORIZED returns 401 with `WWW-Authenticate: Basic realm=...`
2474/// using `cluster.www_authenticate`; suitable for blanket deny-by-default
2475/// routes that still want to surface a login prompt.
2476#[derive(::serde::Serialize, ::serde::Deserialize)]
2477#[serde(rename_all = "SCREAMING_SNAKE_CASE")]
2478#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
2479#[repr(i32)]
2480pub enum RedirectPolicy {
2481    Forward = 0,
2482    Permanent = 1,
2483    Unauthorized = 2,
2484    Found = 3,
2485    PermanentRedirect = 4,
2486}
2487impl RedirectPolicy {
2488    /// String value of the enum field names used in the ProtoBuf definition.
2489    ///
2490    /// The values are not transformed in any way and thus are considered stable
2491    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
2492    pub fn as_str_name(&self) -> &'static str {
2493        match self {
2494            Self::Forward => "FORWARD",
2495            Self::Permanent => "PERMANENT",
2496            Self::Unauthorized => "UNAUTHORIZED",
2497            Self::Found => "FOUND",
2498            Self::PermanentRedirect => "PERMANENT_REDIRECT",
2499        }
2500    }
2501    /// Creates an enum from field names used in the ProtoBuf definition.
2502    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2503        match value {
2504            "FORWARD" => Some(Self::Forward),
2505            "PERMANENT" => Some(Self::Permanent),
2506            "UNAUTHORIZED" => Some(Self::Unauthorized),
2507            "FOUND" => Some(Self::Found),
2508            "PERMANENT_REDIRECT" => Some(Self::PermanentRedirect),
2509            _ => None,
2510        }
2511    }
2512}
2513/// Scheme to use when building the `Location` header for a permanent redirect.
2514/// USE_SAME preserves the request scheme (default), USE_HTTP forces `<http://`,>
2515/// USE_HTTPS forces `<https://`.>
2516#[derive(::serde::Serialize, ::serde::Deserialize)]
2517#[serde(rename_all = "SCREAMING_SNAKE_CASE")]
2518#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
2519#[repr(i32)]
2520pub enum RedirectScheme {
2521    UseSame = 0,
2522    UseHttp = 1,
2523    UseHttps = 2,
2524}
2525impl RedirectScheme {
2526    /// String value of the enum field names used in the ProtoBuf definition.
2527    ///
2528    /// The values are not transformed in any way and thus are considered stable
2529    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
2530    pub fn as_str_name(&self) -> &'static str {
2531        match self {
2532            Self::UseSame => "USE_SAME",
2533            Self::UseHttp => "USE_HTTP",
2534            Self::UseHttps => "USE_HTTPS",
2535        }
2536    }
2537    /// Creates an enum from field names used in the ProtoBuf definition.
2538    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2539        match value {
2540            "USE_SAME" => Some(Self::UseSame),
2541            "USE_HTTP" => Some(Self::UseHttp),
2542            "USE_HTTPS" => Some(Self::UseHttps),
2543            _ => None,
2544        }
2545    }
2546}
2547/// Where a `Header` mutation applies. `BOTH` applies the same edit on the
2548/// request side (before backend connect) and the response side (before kawa
2549/// preparation). Mirrors HAProxy `http-request set-header` /
2550/// `http-response set-header` parity.
2551#[derive(::serde::Serialize, ::serde::Deserialize)]
2552#[serde(rename_all = "SCREAMING_SNAKE_CASE")]
2553#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
2554#[repr(i32)]
2555pub enum HeaderPosition {
2556    /// Reserve 0 for the proto-default-encoded shape so a `Header` written
2557    /// by `..Default::default()` (or by an older client) deserialises into
2558    /// an explicit "unset" rather than failing `HeaderPosition::try_from(0)`.
2559    /// The runtime treats this as a hard config error and rejects the
2560    /// header rather than guessing a position.
2561    Unspecified = 0,
2562    Request = 1,
2563    Response = 2,
2564    Both = 3,
2565}
2566impl HeaderPosition {
2567    /// String value of the enum field names used in the ProtoBuf definition.
2568    ///
2569    /// The values are not transformed in any way and thus are considered stable
2570    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
2571    pub fn as_str_name(&self) -> &'static str {
2572        match self {
2573            Self::Unspecified => "HEADER_POSITION_UNSPECIFIED",
2574            Self::Request => "REQUEST",
2575            Self::Response => "RESPONSE",
2576            Self::Both => "BOTH",
2577        }
2578    }
2579    /// Creates an enum from field names used in the ProtoBuf definition.
2580    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2581        match value {
2582            "HEADER_POSITION_UNSPECIFIED" => Some(Self::Unspecified),
2583            "REQUEST" => Some(Self::Request),
2584            "RESPONSE" => Some(Self::Response),
2585            "BOTH" => Some(Self::Both),
2586            _ => None,
2587        }
2588    }
2589}
2590/// The kind of filter used for path rules
2591#[derive(::serde::Serialize, ::serde::Deserialize)]
2592#[serde(rename_all = "SCREAMING_SNAKE_CASE")]
2593#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
2594#[repr(i32)]
2595pub enum PathRuleKind {
2596    /// filters paths that start with a pattern, typically "/api"
2597    Prefix = 0,
2598    /// filters paths that match a regex pattern
2599    Regex = 1,
2600    /// filters paths that exactly match a pattern, no more, no less
2601    Equals = 2,
2602}
2603impl PathRuleKind {
2604    /// String value of the enum field names used in the ProtoBuf definition.
2605    ///
2606    /// The values are not transformed in any way and thus are considered stable
2607    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
2608    pub fn as_str_name(&self) -> &'static str {
2609        match self {
2610            Self::Prefix => "PREFIX",
2611            Self::Regex => "REGEX",
2612            Self::Equals => "EQUALS",
2613        }
2614    }
2615    /// Creates an enum from field names used in the ProtoBuf definition.
2616    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2617        match value {
2618            "PREFIX" => Some(Self::Prefix),
2619            "REGEX" => Some(Self::Regex),
2620            "EQUALS" => Some(Self::Equals),
2621            _ => None,
2622        }
2623    }
2624}
2625/// TODO: find a proper definition for this
2626#[derive(::serde::Serialize, ::serde::Deserialize)]
2627#[serde(rename_all = "SCREAMING_SNAKE_CASE")]
2628#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
2629#[repr(i32)]
2630pub enum RulePosition {
2631    Pre = 0,
2632    Post = 1,
2633    Tree = 2,
2634}
2635impl RulePosition {
2636    /// String value of the enum field names used in the ProtoBuf definition.
2637    ///
2638    /// The values are not transformed in any way and thus are considered stable
2639    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
2640    pub fn as_str_name(&self) -> &'static str {
2641        match self {
2642            Self::Pre => "PRE",
2643            Self::Post => "POST",
2644            Self::Tree => "TREE",
2645        }
2646    }
2647    /// Creates an enum from field names used in the ProtoBuf definition.
2648    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2649        match value {
2650            "PRE" => Some(Self::Pre),
2651            "POST" => Some(Self::Post),
2652            "TREE" => Some(Self::Tree),
2653            _ => None,
2654        }
2655    }
2656}
2657#[derive(::serde::Serialize, ::serde::Deserialize)]
2658#[serde(rename_all = "SCREAMING_SNAKE_CASE")]
2659#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
2660#[repr(i32)]
2661pub enum TlsVersion {
2662    SslV2 = 0,
2663    SslV3 = 1,
2664    TlsV10 = 2,
2665    TlsV11 = 3,
2666    TlsV12 = 4,
2667    TlsV13 = 5,
2668}
2669impl TlsVersion {
2670    /// String value of the enum field names used in the ProtoBuf definition.
2671    ///
2672    /// The values are not transformed in any way and thus are considered stable
2673    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
2674    pub fn as_str_name(&self) -> &'static str {
2675        match self {
2676            Self::SslV2 => "SSL_V2",
2677            Self::SslV3 => "SSL_V3",
2678            Self::TlsV10 => "TLS_V1_0",
2679            Self::TlsV11 => "TLS_V1_1",
2680            Self::TlsV12 => "TLS_V1_2",
2681            Self::TlsV13 => "TLS_V1_3",
2682        }
2683    }
2684    /// Creates an enum from field names used in the ProtoBuf definition.
2685    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2686        match value {
2687            "SSL_V2" => Some(Self::SslV2),
2688            "SSL_V3" => Some(Self::SslV3),
2689            "TLS_V1_0" => Some(Self::TlsV10),
2690            "TLS_V1_1" => Some(Self::TlsV11),
2691            "TLS_V1_2" => Some(Self::TlsV12),
2692            "TLS_V1_3" => Some(Self::TlsV13),
2693            _ => None,
2694        }
2695    }
2696}
2697#[derive(::serde::Serialize, ::serde::Deserialize)]
2698#[serde(rename_all = "SCREAMING_SNAKE_CASE")]
2699#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
2700#[repr(i32)]
2701pub enum LoadBalancingAlgorithms {
2702    RoundRobin = 0,
2703    Random = 1,
2704    LeastLoaded = 2,
2705    PowerOfTwo = 3,
2706}
2707impl LoadBalancingAlgorithms {
2708    /// String value of the enum field names used in the ProtoBuf definition.
2709    ///
2710    /// The values are not transformed in any way and thus are considered stable
2711    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
2712    pub fn as_str_name(&self) -> &'static str {
2713        match self {
2714            Self::RoundRobin => "ROUND_ROBIN",
2715            Self::Random => "RANDOM",
2716            Self::LeastLoaded => "LEAST_LOADED",
2717            Self::PowerOfTwo => "POWER_OF_TWO",
2718        }
2719    }
2720    /// Creates an enum from field names used in the ProtoBuf definition.
2721    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2722        match value {
2723            "ROUND_ROBIN" => Some(Self::RoundRobin),
2724            "RANDOM" => Some(Self::Random),
2725            "LEAST_LOADED" => Some(Self::LeastLoaded),
2726            "POWER_OF_TWO" => Some(Self::PowerOfTwo),
2727            _ => None,
2728        }
2729    }
2730}
2731#[derive(::serde::Serialize, ::serde::Deserialize)]
2732#[serde(rename_all = "SCREAMING_SNAKE_CASE")]
2733#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
2734#[repr(i32)]
2735pub enum ProxyProtocolConfig {
2736    ExpectHeader = 0,
2737    SendHeader = 1,
2738    RelayHeader = 2,
2739}
2740impl ProxyProtocolConfig {
2741    /// String value of the enum field names used in the ProtoBuf definition.
2742    ///
2743    /// The values are not transformed in any way and thus are considered stable
2744    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
2745    pub fn as_str_name(&self) -> &'static str {
2746        match self {
2747            Self::ExpectHeader => "EXPECT_HEADER",
2748            Self::SendHeader => "SEND_HEADER",
2749            Self::RelayHeader => "RELAY_HEADER",
2750        }
2751    }
2752    /// Creates an enum from field names used in the ProtoBuf definition.
2753    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2754        match value {
2755            "EXPECT_HEADER" => Some(Self::ExpectHeader),
2756            "SEND_HEADER" => Some(Self::SendHeader),
2757            "RELAY_HEADER" => Some(Self::RelayHeader),
2758            _ => None,
2759        }
2760    }
2761}
2762/// how sozu measures which backend is less loaded
2763#[derive(::serde::Serialize, ::serde::Deserialize)]
2764#[serde(rename_all = "SCREAMING_SNAKE_CASE")]
2765#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
2766#[repr(i32)]
2767pub enum LoadMetric {
2768    /// number of TCP connections
2769    Connections = 0,
2770    /// number of active HTTP requests
2771    Requests = 1,
2772    /// time to connect to the backend, weighted by the number of active connections (peak EWMA)
2773    ConnectionTime = 2,
2774}
2775impl LoadMetric {
2776    /// String value of the enum field names used in the ProtoBuf definition.
2777    ///
2778    /// The values are not transformed in any way and thus are considered stable
2779    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
2780    pub fn as_str_name(&self) -> &'static str {
2781        match self {
2782            Self::Connections => "CONNECTIONS",
2783            Self::Requests => "REQUESTS",
2784            Self::ConnectionTime => "CONNECTION_TIME",
2785        }
2786    }
2787    /// Creates an enum from field names used in the ProtoBuf definition.
2788    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2789        match value {
2790            "CONNECTIONS" => Some(Self::Connections),
2791            "REQUESTS" => Some(Self::Requests),
2792            "CONNECTION_TIME" => Some(Self::ConnectionTime),
2793            _ => None,
2794        }
2795    }
2796}
2797/// options to configure metrics collection
2798#[derive(::serde::Serialize, ::serde::Deserialize)]
2799#[serde(rename_all = "SCREAMING_SNAKE_CASE")]
2800#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
2801#[repr(i32)]
2802pub enum MetricsConfiguration {
2803    /// enable metrics collection
2804    Enabled = 0,
2805    /// disable metrics collection
2806    Disabled = 1,
2807    /// wipe the metrics memory
2808    Clear = 2,
2809}
2810impl MetricsConfiguration {
2811    /// String value of the enum field names used in the ProtoBuf definition.
2812    ///
2813    /// The values are not transformed in any way and thus are considered stable
2814    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
2815    pub fn as_str_name(&self) -> &'static str {
2816        match self {
2817            Self::Enabled => "ENABLED",
2818            Self::Disabled => "DISABLED",
2819            Self::Clear => "CLEAR",
2820        }
2821    }
2822    /// Creates an enum from field names used in the ProtoBuf definition.
2823    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2824        match value {
2825            "ENABLED" => Some(Self::Enabled),
2826            "DISABLED" => Some(Self::Disabled),
2827            "CLEAR" => Some(Self::Clear),
2828            _ => None,
2829        }
2830    }
2831}
2832#[derive(::serde::Serialize, ::serde::Deserialize)]
2833#[serde(rename_all = "SCREAMING_SNAKE_CASE")]
2834#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
2835#[repr(i32)]
2836pub enum EventKind {
2837    BackendDown = 0,
2838    BackendUp = 1,
2839    NoAvailableBackends = 2,
2840    RemovedBackendHasNoConnections = 3,
2841    /// Control-plane mutation events (audit trail).
2842    /// Emitted by the main process to clients subscribed via SubscribeEvents.
2843    /// The Event.cluster_id / backend_id / address fields are populated when
2844    /// they are meaningful for the verb (e.g. address for listener verbs,
2845    /// cluster_id for cluster/frontend verbs). Backend events keep their
2846    /// historical numeric tags 0..3.
2847    ClusterAdded = 4,
2848    ClusterRemoved = 5,
2849    FrontendAdded = 6,
2850    FrontendRemoved = 7,
2851    CertificateAdded = 8,
2852    CertificateRemoved = 9,
2853    CertificateReplaced = 10,
2854    ListenerActivated = 11,
2855    ListenerDeactivated = 12,
2856    ConfigurationReloaded = 13,
2857    WorkerKilled = 14,
2858    WorkerRelaunched = 15,
2859    LoggingLevelChanged = 16,
2860    MetricsConfigured = 17,
2861    /// A listener's configuration was patched in place via UpdateHttp/Https/TcpListenerConfig
2862    ListenerUpdated = 18,
2863    /// A saved state file was loaded (batch state replay via LoadState request).
2864    /// Emitted once at task completion; `target=file:<path>` and `result=ok|err`
2865    /// with the ok/err request counts encoded in `target`.
2866    StateLoaded = 19,
2867    /// A snapshot of the current state was written to disk via SaveState.
2868    StateSaved = 20,
2869    /// A new listener was added to the config (AddHttp/Https/TcpListener).
2870    /// Distinct from LISTENER_ACTIVATED (binds the socket) — ADDED just
2871    /// creates the listener's in-memory definition.
2872    ListenerAdded = 21,
2873    /// A listener's in-memory definition was removed (RemoveListener).
2874    /// Distinct from LISTENER_DEACTIVATED (unbinds the socket) — REMOVED
2875    /// drops the whole listener from the state.
2876    ListenerRemoved = 22,
2877    /// A stop request was accepted (SoftStop / HardStop).
2878    /// `target=stop:soft` or `stop:hard` — distinguishes drain-then-stop from
2879    /// immediate-abort on the audit trail.
2880    SozuStopRequested = 23,
2881    /// The main process started a re-exec upgrade (UpgradeMain).
2882    MainUpgraded = 24,
2883    /// A worker was re-launched (UpgradeWorker).
2884    WorkerUpgraded = 25,
2885    /// A client subscribed to the SubscribeEvents bus — privileged because
2886    /// subscribers observe every control-plane mutation.
2887    EventsSubscribed = 26,
2888    /// Backend health-check transitioned to healthy after consecutive successes.
2889    /// Tags 0..3 are the historical backend-state events; 4..26 carry the
2890    /// control-plane mutation events (cluster, frontend, certificate,
2891    /// listener, worker, configuration, metrics, state, stop, upgrade,
2892    /// events). Backend health-check transitions therefore start at 27.
2893    HealthCheckHealthy = 27,
2894    /// Backend health-check transitioned to unhealthy after consecutive failures.
2895    HealthCheckUnhealthy = 28,
2896    /// Cluster transitioned from "all backends down" back to "at least one
2897    /// backend available". Pairs with `NoAvailableBackends` (tag 2) so
2898    /// dashboards can plot per-cluster recovery.
2899    ClusterRecovered = 29,
2900    /// The worker's effective `MetricDetail` changed because a runtime
2901    /// lease was applied, renewed, expired, or cleared. Pairs with
2902    /// `MetricsConfigured` (tag 17) but distinct: that one fires for
2903    /// `MetricsConfiguration` (Enabled/Disabled/Clear), this one fires
2904    /// for cardinality changes.
2905    ///
2906    /// Emitter scope: operator-initiated transitions emit
2907    /// `METRIC_DETAIL_CHANGED` via the master-side audit log (see
2908    /// `bin/src/command/requests.rs` around the `SetMetricDetail`
2909    /// success path). Worker-local transitions — the polled janitor
2910    /// expiring a lease, or a worker-local clear/apply after a master
2911    /// fan-out — are not yet surfaced because the worker has no direct
2912    /// IPC path to the master's audit sink; follow-up tracked separately.
2913    MetricDetailChanged = 30,
2914}
2915impl EventKind {
2916    /// String value of the enum field names used in the ProtoBuf definition.
2917    ///
2918    /// The values are not transformed in any way and thus are considered stable
2919    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
2920    pub fn as_str_name(&self) -> &'static str {
2921        match self {
2922            Self::BackendDown => "BACKEND_DOWN",
2923            Self::BackendUp => "BACKEND_UP",
2924            Self::NoAvailableBackends => "NO_AVAILABLE_BACKENDS",
2925            Self::RemovedBackendHasNoConnections => "REMOVED_BACKEND_HAS_NO_CONNECTIONS",
2926            Self::ClusterAdded => "CLUSTER_ADDED",
2927            Self::ClusterRemoved => "CLUSTER_REMOVED",
2928            Self::FrontendAdded => "FRONTEND_ADDED",
2929            Self::FrontendRemoved => "FRONTEND_REMOVED",
2930            Self::CertificateAdded => "CERTIFICATE_ADDED",
2931            Self::CertificateRemoved => "CERTIFICATE_REMOVED",
2932            Self::CertificateReplaced => "CERTIFICATE_REPLACED",
2933            Self::ListenerActivated => "LISTENER_ACTIVATED",
2934            Self::ListenerDeactivated => "LISTENER_DEACTIVATED",
2935            Self::ConfigurationReloaded => "CONFIGURATION_RELOADED",
2936            Self::WorkerKilled => "WORKER_KILLED",
2937            Self::WorkerRelaunched => "WORKER_RELAUNCHED",
2938            Self::LoggingLevelChanged => "LOGGING_LEVEL_CHANGED",
2939            Self::MetricsConfigured => "METRICS_CONFIGURED",
2940            Self::ListenerUpdated => "LISTENER_UPDATED",
2941            Self::StateLoaded => "STATE_LOADED",
2942            Self::StateSaved => "STATE_SAVED",
2943            Self::ListenerAdded => "LISTENER_ADDED",
2944            Self::ListenerRemoved => "LISTENER_REMOVED",
2945            Self::SozuStopRequested => "SOZU_STOP_REQUESTED",
2946            Self::MainUpgraded => "MAIN_UPGRADED",
2947            Self::WorkerUpgraded => "WORKER_UPGRADED",
2948            Self::EventsSubscribed => "EVENTS_SUBSCRIBED",
2949            Self::HealthCheckHealthy => "HEALTH_CHECK_HEALTHY",
2950            Self::HealthCheckUnhealthy => "HEALTH_CHECK_UNHEALTHY",
2951            Self::ClusterRecovered => "CLUSTER_RECOVERED",
2952            Self::MetricDetailChanged => "METRIC_DETAIL_CHANGED",
2953        }
2954    }
2955    /// Creates an enum from field names used in the ProtoBuf definition.
2956    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2957        match value {
2958            "BACKEND_DOWN" => Some(Self::BackendDown),
2959            "BACKEND_UP" => Some(Self::BackendUp),
2960            "NO_AVAILABLE_BACKENDS" => Some(Self::NoAvailableBackends),
2961            "REMOVED_BACKEND_HAS_NO_CONNECTIONS" => {
2962                Some(Self::RemovedBackendHasNoConnections)
2963            }
2964            "CLUSTER_ADDED" => Some(Self::ClusterAdded),
2965            "CLUSTER_REMOVED" => Some(Self::ClusterRemoved),
2966            "FRONTEND_ADDED" => Some(Self::FrontendAdded),
2967            "FRONTEND_REMOVED" => Some(Self::FrontendRemoved),
2968            "CERTIFICATE_ADDED" => Some(Self::CertificateAdded),
2969            "CERTIFICATE_REMOVED" => Some(Self::CertificateRemoved),
2970            "CERTIFICATE_REPLACED" => Some(Self::CertificateReplaced),
2971            "LISTENER_ACTIVATED" => Some(Self::ListenerActivated),
2972            "LISTENER_DEACTIVATED" => Some(Self::ListenerDeactivated),
2973            "CONFIGURATION_RELOADED" => Some(Self::ConfigurationReloaded),
2974            "WORKER_KILLED" => Some(Self::WorkerKilled),
2975            "WORKER_RELAUNCHED" => Some(Self::WorkerRelaunched),
2976            "LOGGING_LEVEL_CHANGED" => Some(Self::LoggingLevelChanged),
2977            "METRICS_CONFIGURED" => Some(Self::MetricsConfigured),
2978            "LISTENER_UPDATED" => Some(Self::ListenerUpdated),
2979            "STATE_LOADED" => Some(Self::StateLoaded),
2980            "STATE_SAVED" => Some(Self::StateSaved),
2981            "LISTENER_ADDED" => Some(Self::ListenerAdded),
2982            "LISTENER_REMOVED" => Some(Self::ListenerRemoved),
2983            "SOZU_STOP_REQUESTED" => Some(Self::SozuStopRequested),
2984            "MAIN_UPGRADED" => Some(Self::MainUpgraded),
2985            "WORKER_UPGRADED" => Some(Self::WorkerUpgraded),
2986            "EVENTS_SUBSCRIBED" => Some(Self::EventsSubscribed),
2987            "HEALTH_CHECK_HEALTHY" => Some(Self::HealthCheckHealthy),
2988            "HEALTH_CHECK_UNHEALTHY" => Some(Self::HealthCheckUnhealthy),
2989            "CLUSTER_RECOVERED" => Some(Self::ClusterRecovered),
2990            "METRIC_DETAIL_CHANGED" => Some(Self::MetricDetailChanged),
2991            _ => None,
2992        }
2993    }
2994}
2995#[derive(::serde::Serialize, ::serde::Deserialize)]
2996#[serde(rename_all = "SCREAMING_SNAKE_CASE")]
2997#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
2998#[repr(i32)]
2999pub enum ResponseStatus {
3000    Ok = 0,
3001    Processing = 1,
3002    Failure = 2,
3003}
3004impl ResponseStatus {
3005    /// String value of the enum field names used in the ProtoBuf definition.
3006    ///
3007    /// The values are not transformed in any way and thus are considered stable
3008    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
3009    pub fn as_str_name(&self) -> &'static str {
3010        match self {
3011            Self::Ok => "OK",
3012            Self::Processing => "PROCESSING",
3013            Self::Failure => "FAILURE",
3014        }
3015    }
3016    /// Creates an enum from field names used in the ProtoBuf definition.
3017    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
3018        match value {
3019            "OK" => Some(Self::Ok),
3020            "PROCESSING" => Some(Self::Processing),
3021            "FAILURE" => Some(Self::Failure),
3022            _ => None,
3023        }
3024    }
3025}
3026/// Runstate of a worker
3027#[derive(::serde::Serialize, ::serde::Deserialize)]
3028#[serde(rename_all = "SCREAMING_SNAKE_CASE")]
3029#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
3030#[repr(i32)]
3031pub enum RunState {
3032    Running = 0,
3033    Stopping = 1,
3034    Stopped = 2,
3035    NotAnswering = 3,
3036}
3037impl RunState {
3038    /// String value of the enum field names used in the ProtoBuf definition.
3039    ///
3040    /// The values are not transformed in any way and thus are considered stable
3041    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
3042    pub fn as_str_name(&self) -> &'static str {
3043        match self {
3044            Self::Running => "RUNNING",
3045            Self::Stopping => "STOPPING",
3046            Self::Stopped => "STOPPED",
3047            Self::NotAnswering => "NOT_ANSWERING",
3048        }
3049    }
3050    /// Creates an enum from field names used in the ProtoBuf definition.
3051    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
3052        match value {
3053            "RUNNING" => Some(Self::Running),
3054            "STOPPING" => Some(Self::Stopping),
3055            "STOPPED" => Some(Self::Stopped),
3056            "NOT_ANSWERING" => Some(Self::NotAnswering),
3057            _ => None,
3058        }
3059    }
3060}
3061/// label-cardinality knob for the metrics drain.
3062/// Mirrors HAProxy's `process|frontend|backend|server` extra-counters opt-in:
3063/// a higher level enables more granular labels (and thus more keys), letting
3064/// operators bound the StatsD keyspace explicitly.
3065///
3066/// Each level is a SUPERSET of the previous one.
3067#[derive(::serde::Serialize, ::serde::Deserialize)]
3068#[serde(rename_all = "SCREAMING_SNAKE_CASE")]
3069#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
3070#[repr(i32)]
3071pub enum MetricDetail {
3072    /// proxy-only counters (legacy default before opt-in landed)
3073    DetailProcess = 0,
3074    /// adds per-listener (frontend) breakdown for accept/connection counters
3075    DetailFrontend = 1,
3076    /// adds per-cluster aggregation (current default)
3077    DetailCluster = 2,
3078    /// adds per-backend aggregation (cluster + backend, highest cardinality)
3079    DetailBackend = 3,
3080}
3081impl MetricDetail {
3082    /// String value of the enum field names used in the ProtoBuf definition.
3083    ///
3084    /// The values are not transformed in any way and thus are considered stable
3085    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
3086    pub fn as_str_name(&self) -> &'static str {
3087        match self {
3088            Self::DetailProcess => "DETAIL_PROCESS",
3089            Self::DetailFrontend => "DETAIL_FRONTEND",
3090            Self::DetailCluster => "DETAIL_CLUSTER",
3091            Self::DetailBackend => "DETAIL_BACKEND",
3092        }
3093    }
3094    /// Creates an enum from field names used in the ProtoBuf definition.
3095    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
3096        match value {
3097            "DETAIL_PROCESS" => Some(Self::DetailProcess),
3098            "DETAIL_FRONTEND" => Some(Self::DetailFrontend),
3099            "DETAIL_CLUSTER" => Some(Self::DetailCluster),
3100            "DETAIL_BACKEND" => Some(Self::DetailBackend),
3101            _ => None,
3102        }
3103    }
3104}
3105#[derive(::serde::Serialize, ::serde::Deserialize)]
3106#[serde(rename_all = "SCREAMING_SNAKE_CASE")]
3107#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
3108#[repr(i32)]
3109pub enum ProtobufAccessLogFormat {
3110    Ascii = 1,
3111    Protobuf = 2,
3112}
3113impl ProtobufAccessLogFormat {
3114    /// String value of the enum field names used in the ProtoBuf definition.
3115    ///
3116    /// The values are not transformed in any way and thus are considered stable
3117    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
3118    pub fn as_str_name(&self) -> &'static str {
3119        match self {
3120            Self::Ascii => "Ascii",
3121            Self::Protobuf => "Protobuf",
3122        }
3123    }
3124    /// Creates an enum from field names used in the ProtoBuf definition.
3125    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
3126        match value {
3127            "Ascii" => Some(Self::Ascii),
3128            "Protobuf" => Some(Self::Protobuf),
3129            _ => None,
3130        }
3131    }
3132}