Skip to main content

sozu_command_lib/proto/
command.rs

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