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