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}
953/// details of a UDP listener
954#[derive(::serde::Serialize, ::serde::Deserialize)]
955#[derive(Ord, PartialOrd)]
956#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
957pub struct UdpListenerConfig {
958    #[prost(message, required, tag = "1")]
959    pub address: SocketAddress,
960    #[prost(message, optional, tag = "2")]
961    pub public_address: ::core::option::Option<SocketAddress>,
962    /// client flow idle time, in seconds
963    #[prost(uint32, required, tag = "3", default = "30")]
964    pub front_timeout: u32,
965    /// upstream flow idle time, in seconds
966    #[prost(uint32, required, tag = "4", default = "30")]
967    pub back_timeout: u32,
968    /// maximum received datagram size, in bytes (capped at buffer_size at runtime)
969    #[prost(uint32, required, tag = "5", default = "1500")]
970    pub max_rx_datagram_size: u32,
971    /// maximum number of concurrent flows; 0 = auto (~70% soft RLIMIT_NOFILE)
972    #[prost(uint32, required, tag = "6", default = "0")]
973    pub max_flows: u32,
974    /// wether the listener is actively listening on its socket
975    #[prost(bool, required, tag = "7", default = "false")]
976    pub active: bool,
977}
978/// HSTS (HTTP Strict Transport Security, RFC 6797) policy attached to
979/// an HTTPS listener default or per-frontend. The materialised
980/// `Strict-Transport-Security: max-age=N[; includeSubDomains][; preload]`
981/// header is injected on every successful HTTPS response (including
982/// proxy-generated 3xx/401/5xx default answers). Per RFC 6797 §7.2 the
983/// header MUST NOT be emitted on plaintext-HTTP responses; sozu rejects
984/// HSTS configured on an HttpListenerConfig at config-load time and gates
985/// the runtime injection on `context.protocol == Protocol::HTTPS`.
986///
987/// Validation:
988/// - `enabled = true` with `max_age = None` defaults `max_age` to
989///   31536000 seconds (1 year) at config-load.
990/// - `max_age = 0` is the RFC 6797 §11.4 kill-switch and is allowed
991///   silently; `0 < max_age < 86400` warns.
992/// - `preload = true` with `max_age < 31536000` or
993///   `include_subdomains != true` warns (Chrome HSTS preload list
994///   prerequisites at <https://hstspreload.org/>).
995/// - `preload` is opt-in only; never default-true (RFC 6797 §14.2 —
996///   removal from the preload list is slow and partial).
997#[derive(::serde::Serialize, ::serde::Deserialize)]
998#[derive(Ord, PartialOrd)]
999#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1000pub struct HstsConfig {
1001    /// Whether HSTS is enabled for this scope. Required whenever the
1002    /// parent message includes an HstsConfig — the partial-update path
1003    /// treats `enabled = false` as the explicit-disable signal.
1004    #[prost(bool, optional, tag = "1")]
1005    pub enabled: ::core::option::Option<bool>,
1006    /// Strict-Transport-Security `max-age` directive in seconds. When
1007    /// `enabled = true` and this is unset, sozu substitutes 31536000
1008    /// (1 year, HSTS preload list minimum) at config-load.
1009    #[prost(uint32, optional, tag = "2")]
1010    pub max_age: ::core::option::Option<u32>,
1011    /// Append `; includeSubDomains` to the rendered header.
1012    #[prost(bool, optional, tag = "3")]
1013    pub include_subdomains: ::core::option::Option<bool>,
1014    /// Append `; preload` to the rendered header. Opt-in only — see
1015    /// RFC 6797 §14.2 and <https://hstspreload.org/.>
1016    #[prost(bool, optional, tag = "4")]
1017    pub preload: ::core::option::Option<bool>,
1018    /// Operator opt-in to override any backend-supplied
1019    /// `Strict-Transport-Security` header with sozu's typed policy.
1020    ///
1021    /// RFC 6797 §6.1 default behaviour is to PRESERVE a backend-emitted
1022    /// STS header when one is already present (sozu's HSTS edit uses
1023    /// `HeaderEditMode::SetIfAbsent`). That keeps the backend's intent
1024    /// intact for upstreams that ship their own HSTS policy.
1025    ///
1026    /// Set this to `true` for the harden-centrally case: backends behind
1027    /// sozu emit a stale or weak HSTS policy (e.g. legacy `max-age=300`)
1028    /// and the operator wants to enforce a stronger policy at the proxy
1029    /// edge unconditionally. The materialiser then uses
1030    /// `HeaderEditMode::Set` instead of `SetIfAbsent`, replacing every
1031    /// backend-supplied STS header with sozu's rendered value.
1032    ///
1033    /// Cite: <https://datatracker.ietf.org/doc/html/rfc6797#section-6.1>
1034    #[prost(bool, optional, tag = "5")]
1035    pub force_replace_backend: ::core::option::Option<bool>,
1036}
1037/// custom HTTP answers, useful for 404, 503 pages
1038#[derive(::serde::Serialize, ::serde::Deserialize)]
1039#[derive(Ord, PartialOrd)]
1040#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1041pub struct CustomHttpAnswers {
1042    /// MovedPermanently
1043    #[prost(string, optional, tag = "1")]
1044    pub answer_301: ::core::option::Option<::prost::alloc::string::String>,
1045    /// BadRequest
1046    #[prost(string, optional, tag = "2")]
1047    pub answer_400: ::core::option::Option<::prost::alloc::string::String>,
1048    /// Unauthorized
1049    #[prost(string, optional, tag = "3")]
1050    pub answer_401: ::core::option::Option<::prost::alloc::string::String>,
1051    /// NotFound
1052    #[prost(string, optional, tag = "4")]
1053    pub answer_404: ::core::option::Option<::prost::alloc::string::String>,
1054    /// RequestTimeout
1055    #[prost(string, optional, tag = "5")]
1056    pub answer_408: ::core::option::Option<::prost::alloc::string::String>,
1057    /// PayloadTooLarge
1058    #[prost(string, optional, tag = "6")]
1059    pub answer_413: ::core::option::Option<::prost::alloc::string::String>,
1060    /// MisdirectedRequest (RFC 9110 §15.5.20, TLS SNI ↔ :authority mismatch)
1061    #[prost(string, optional, tag = "11")]
1062    pub answer_421: ::core::option::Option<::prost::alloc::string::String>,
1063    /// BadGateway
1064    #[prost(string, optional, tag = "7")]
1065    pub answer_502: ::core::option::Option<::prost::alloc::string::String>,
1066    /// ServiceUnavailable
1067    #[prost(string, optional, tag = "8")]
1068    pub answer_503: ::core::option::Option<::prost::alloc::string::String>,
1069    /// GatewayTimeout
1070    #[prost(string, optional, tag = "9")]
1071    pub answer_504: ::core::option::Option<::prost::alloc::string::String>,
1072    /// InsufficientStorage
1073    #[prost(string, optional, tag = "10")]
1074    pub answer_507: ::core::option::Option<::prost::alloc::string::String>,
1075    /// TooManyRequests (per-(cluster, source-IP) connection limit hit)
1076    #[prost(string, optional, tag = "12")]
1077    pub answer_429: ::core::option::Option<::prost::alloc::string::String>,
1078}
1079#[derive(::serde::Serialize, ::serde::Deserialize)]
1080#[derive(Ord, PartialOrd)]
1081#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1082pub struct ActivateListener {
1083    #[prost(message, required, tag = "1")]
1084    pub address: SocketAddress,
1085    #[prost(enumeration = "ListenerType", required, tag = "2")]
1086    pub proxy: i32,
1087    #[prost(bool, required, tag = "3")]
1088    pub from_scm: bool,
1089}
1090#[derive(::serde::Serialize, ::serde::Deserialize)]
1091#[derive(Ord, PartialOrd)]
1092#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1093pub struct DeactivateListener {
1094    #[prost(message, required, tag = "1")]
1095    pub address: SocketAddress,
1096    #[prost(enumeration = "ListenerType", required, tag = "2")]
1097    pub proxy: i32,
1098    #[prost(bool, required, tag = "3")]
1099    pub to_scm: bool,
1100}
1101#[derive(::serde::Serialize, ::serde::Deserialize)]
1102#[derive(Ord, PartialOrd)]
1103#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1104pub struct RemoveListener {
1105    #[prost(message, required, tag = "1")]
1106    pub address: SocketAddress,
1107    #[prost(enumeration = "ListenerType", required, tag = "2")]
1108    pub proxy: i32,
1109}
1110/// All listeners, listed
1111#[derive(::serde::Serialize, ::serde::Deserialize)]
1112#[derive(Ord, PartialOrd)]
1113#[derive(Hash, Eq)]
1114#[derive(Clone, PartialEq, ::prost::Message)]
1115pub struct ListenersList {
1116    /// address -> http listener config
1117    #[prost(btree_map = "string, message", tag = "1")]
1118    pub http_listeners: ::prost::alloc::collections::BTreeMap<
1119        ::prost::alloc::string::String,
1120        HttpListenerConfig,
1121    >,
1122    /// address -> https listener config
1123    #[prost(btree_map = "string, message", tag = "2")]
1124    pub https_listeners: ::prost::alloc::collections::BTreeMap<
1125        ::prost::alloc::string::String,
1126        HttpsListenerConfig,
1127    >,
1128    /// address -> tcp listener config
1129    #[prost(btree_map = "string, message", tag = "3")]
1130    pub tcp_listeners: ::prost::alloc::collections::BTreeMap<
1131        ::prost::alloc::string::String,
1132        TcpListenerConfig,
1133    >,
1134    /// address -> udp listener config
1135    #[prost(btree_map = "string, message", tag = "4")]
1136    pub udp_listeners: ::prost::alloc::collections::BTreeMap<
1137        ::prost::alloc::string::String,
1138        UdpListenerConfig,
1139    >,
1140}
1141/// A single header mutation applied to a request, response, or both.
1142///
1143/// An empty `val` deletes the header by name (HAProxy `del-header` parity).
1144/// A non-empty `val` performs a set/replace; a header with the same name is
1145/// overwritten. Header names are matched case-insensitively per RFC 9110 §5.1.
1146#[derive(::serde::Serialize, ::serde::Deserialize)]
1147#[derive(Ord, PartialOrd)]
1148#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1149pub struct Header {
1150    #[prost(enumeration = "HeaderPosition", required, tag = "1")]
1151    pub position: i32,
1152    #[prost(string, required, tag = "2")]
1153    pub key: ::prost::alloc::string::String,
1154    /// Empty `val` deletes the header by name (HAProxy `del-header` parity).
1155    #[prost(string, required, tag = "3")]
1156    pub val: ::prost::alloc::string::String,
1157}
1158/// An HTTP or HTTPS frontend, as order to, or received from, Sōzu
1159#[derive(::serde::Serialize, ::serde::Deserialize)]
1160#[derive(Ord, PartialOrd)]
1161#[derive(Hash, Eq)]
1162#[derive(Clone, PartialEq, ::prost::Message)]
1163pub struct RequestHttpFrontend {
1164    #[prost(string, optional, tag = "1")]
1165    pub cluster_id: ::core::option::Option<::prost::alloc::string::String>,
1166    #[prost(message, required, tag = "2")]
1167    pub address: SocketAddress,
1168    #[prost(string, required, tag = "3")]
1169    pub hostname: ::prost::alloc::string::String,
1170    #[prost(message, required, tag = "4")]
1171    pub path: PathRule,
1172    #[prost(string, optional, tag = "5")]
1173    pub method: ::core::option::Option<::prost::alloc::string::String>,
1174    #[prost(enumeration = "RulePosition", required, tag = "6", default = "Tree")]
1175    pub position: i32,
1176    /// custom tags to identify the frontend in the access logs
1177    #[prost(btree_map = "string, string", tag = "7")]
1178    pub tags: ::prost::alloc::collections::BTreeMap<
1179        ::prost::alloc::string::String,
1180        ::prost::alloc::string::String,
1181    >,
1182    /// Redirect policy for this frontend. Default `FORWARD` (no redirect).
1183    #[prost(enumeration = "RedirectPolicy", optional, tag = "8", default = "Forward")]
1184    pub redirect: ::core::option::Option<i32>,
1185    /// When true, requests routed through this frontend must carry a valid
1186    /// `Authorization: Basic <user:pass>` header whose hash matches one of
1187    /// `cluster.authorized_hashes`. Default: false.
1188    #[prost(bool, optional, tag = "9")]
1189    pub required_auth: ::core::option::Option<bool>,
1190    /// Scheme to use when emitting a 301 `Location` header. Default `USE_SAME`
1191    /// (preserve the request scheme).
1192    #[prost(enumeration = "RedirectScheme", optional, tag = "10", default = "UseSame")]
1193    pub redirect_scheme: ::core::option::Option<i32>,
1194    /// Optional template applied when emitting a permanent redirect. Supports
1195    /// `%REDIRECT_LOCATION` and the variables documented in `doc/configure.md`.
1196    #[prost(string, optional, tag = "11")]
1197    pub redirect_template: ::core::option::Option<::prost::alloc::string::String>,
1198    /// Rewrite host template. Supports `$HOST\[n\]` / `$PATH\[n\]` placeholders
1199    /// populated from regex captures collected during routing. When set, both
1200    /// the backend authority/path and the wire request line are rewritten.
1201    #[prost(string, optional, tag = "12")]
1202    pub rewrite_host: ::core::option::Option<::prost::alloc::string::String>,
1203    /// Rewrite path template. Same grammar as `rewrite_host`.
1204    #[prost(string, optional, tag = "13")]
1205    pub rewrite_path: ::core::option::Option<::prost::alloc::string::String>,
1206    /// Optional literal port override on the rewritten URL.
1207    #[prost(uint32, optional, tag = "14")]
1208    pub rewrite_port: ::core::option::Option<u32>,
1209    /// Header mutations applied to requests and/or responses passing through
1210    /// this frontend. See `Header` for delete semantics.
1211    #[prost(message, repeated, tag = "15")]
1212    #[serde(default)]
1213    pub headers: ::prost::alloc::vec::Vec<Header>,
1214    /// Per-frontend HSTS (RFC 6797) override. When `Some`, this entire
1215    /// policy replaces the listener-default `HttpsListenerConfig.hsts`
1216    /// for matched requests; when absent, the listener default applies.
1217    /// Honours RFC 6797 §6.1 (single Strict-Transport-Security header on
1218    /// the response) and §8.1 (HSTS host scope tied to the receiving
1219    /// host). On HTTP-only frontends the value is rejected at config-load
1220    /// (RFC 6797 §7.2). The §11.4 `max-age=0` kill-switch is honoured
1221    /// verbatim so an operator can shadow a listener-wide HSTS for one
1222    /// hostname.
1223    #[prost(message, optional, tag = "16")]
1224    pub hsts: ::core::option::Option<HstsConfig>,
1225}
1226#[derive(::serde::Serialize, ::serde::Deserialize)]
1227#[derive(Ord, PartialOrd)]
1228#[derive(Hash, Eq)]
1229#[derive(Clone, PartialEq, ::prost::Message)]
1230pub struct RequestTcpFrontend {
1231    #[prost(string, required, tag = "1")]
1232    pub cluster_id: ::prost::alloc::string::String,
1233    /// the socket address on which to listen for incoming traffic
1234    #[prost(message, required, tag = "2")]
1235    pub address: SocketAddress,
1236    /// custom tags to identify the frontend in the access logs
1237    #[prost(btree_map = "string, string", tag = "3")]
1238    pub tags: ::prost::alloc::collections::BTreeMap<
1239        ::prost::alloc::string::String,
1240        ::prost::alloc::string::String,
1241    >,
1242}
1243#[derive(::serde::Serialize, ::serde::Deserialize)]
1244#[derive(Ord, PartialOrd)]
1245#[derive(Hash, Eq)]
1246#[derive(Clone, PartialEq, ::prost::Message)]
1247pub struct RequestUdpFrontend {
1248    #[prost(string, required, tag = "1")]
1249    pub cluster_id: ::prost::alloc::string::String,
1250    /// the socket address on which to listen for incoming datagrams
1251    #[prost(message, required, tag = "2")]
1252    pub address: SocketAddress,
1253    /// custom tags to identify the frontend in the access logs
1254    #[prost(btree_map = "string, string", tag = "3")]
1255    #[serde(default)]
1256    pub tags: ::prost::alloc::collections::BTreeMap<
1257        ::prost::alloc::string::String,
1258        ::prost::alloc::string::String,
1259    >,
1260}
1261/// list the frontends, filtered by protocol and/or domain
1262#[derive(::serde::Serialize, ::serde::Deserialize)]
1263#[derive(Ord, PartialOrd)]
1264#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1265pub struct FrontendFilters {
1266    #[prost(bool, required, tag = "1")]
1267    pub http: bool,
1268    #[prost(bool, required, tag = "2")]
1269    pub https: bool,
1270    #[prost(bool, required, tag = "3")]
1271    pub tcp: bool,
1272    #[prost(string, optional, tag = "4")]
1273    pub domain: ::core::option::Option<::prost::alloc::string::String>,
1274}
1275/// A filter for the path of incoming requests
1276#[derive(::serde::Serialize, ::serde::Deserialize)]
1277#[derive(Ord, PartialOrd)]
1278#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1279pub struct PathRule {
1280    /// The kind of filter used for path rules
1281    #[prost(enumeration = "PathRuleKind", required, tag = "1")]
1282    pub kind: i32,
1283    /// the value of the given prefix, regex or equal pathrule
1284    #[prost(string, required, tag = "2")]
1285    pub value: ::prost::alloc::string::String,
1286}
1287/// Add a new TLS certificate to an HTTPs listener
1288#[derive(::serde::Serialize, ::serde::Deserialize)]
1289#[derive(Ord, PartialOrd)]
1290#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1291pub struct AddCertificate {
1292    #[prost(message, required, tag = "1")]
1293    pub address: SocketAddress,
1294    #[prost(message, required, tag = "2")]
1295    pub certificate: CertificateAndKey,
1296    /// A unix timestamp. Overrides certificate expiration.
1297    #[prost(int64, optional, tag = "3")]
1298    pub expired_at: ::core::option::Option<i64>,
1299}
1300#[derive(::serde::Serialize, ::serde::Deserialize)]
1301#[derive(Ord, PartialOrd)]
1302#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1303pub struct RemoveCertificate {
1304    #[prost(message, required, tag = "1")]
1305    pub address: SocketAddress,
1306    /// a hex-encoded TLS fingerprint to identify the certificate to remove
1307    #[prost(string, required, tag = "2")]
1308    pub fingerprint: ::prost::alloc::string::String,
1309}
1310#[derive(::serde::Serialize, ::serde::Deserialize)]
1311#[derive(Ord, PartialOrd)]
1312#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1313pub struct ReplaceCertificate {
1314    #[prost(message, required, tag = "1")]
1315    pub address: SocketAddress,
1316    #[prost(message, required, tag = "2")]
1317    pub new_certificate: CertificateAndKey,
1318    /// a hex-encoded TLS fingerprint to identify the old certificate
1319    #[prost(string, required, tag = "3")]
1320    pub old_fingerprint: ::prost::alloc::string::String,
1321    /// A unix timestamp. Overrides certificate expiration.
1322    #[prost(int64, optional, tag = "4")]
1323    pub new_expired_at: ::core::option::Option<i64>,
1324}
1325#[derive(::serde::Serialize, ::serde::Deserialize)]
1326#[derive(Ord, PartialOrd)]
1327#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1328pub struct CertificateAndKey {
1329    #[prost(string, required, tag = "1")]
1330    pub certificate: ::prost::alloc::string::String,
1331    #[prost(string, repeated, tag = "2")]
1332    pub certificate_chain: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
1333    #[prost(string, required, tag = "3")]
1334    pub key: ::prost::alloc::string::String,
1335    #[prost(enumeration = "TlsVersion", repeated, packed = "false", tag = "4")]
1336    pub versions: ::prost::alloc::vec::Vec<i32>,
1337    /// a list of domain names. Override certificate names
1338    /// if empty, the names of the certificate will be used
1339    #[prost(string, repeated, tag = "5")]
1340    pub names: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
1341}
1342/// Should be either a domain name or a fingerprint.
1343/// These filter do not compound, use either one but not both.
1344/// If none of them is specified, all certificates will be returned.
1345#[derive(::serde::Serialize, ::serde::Deserialize)]
1346#[derive(Ord, PartialOrd)]
1347#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1348pub struct QueryCertificatesFilters {
1349    /// a domain name to filter certificate results
1350    #[prost(string, optional, tag = "1")]
1351    pub domain: ::core::option::Option<::prost::alloc::string::String>,
1352    /// a hex-encoded fingerprint of the TLS certificate to find
1353    #[prost(string, optional, tag = "2")]
1354    pub fingerprint: ::core::option::Option<::prost::alloc::string::String>,
1355}
1356/// domain name and fingerprint of a certificate
1357#[derive(::serde::Serialize, ::serde::Deserialize)]
1358#[derive(Ord, PartialOrd)]
1359#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1360pub struct CertificateSummary {
1361    #[prost(string, required, tag = "1")]
1362    pub domain: ::prost::alloc::string::String,
1363    /// a hex-encoded TLS fingerprint
1364    #[prost(string, required, tag = "2")]
1365    pub fingerprint: ::prost::alloc::string::String,
1366}
1367/// Used by workers to reply to some certificate queries
1368#[derive(::serde::Serialize, ::serde::Deserialize)]
1369#[derive(Ord, PartialOrd)]
1370#[derive(Hash, Eq)]
1371#[derive(Clone, PartialEq, ::prost::Message)]
1372pub struct ListOfCertificatesByAddress {
1373    #[prost(message, repeated, tag = "1")]
1374    pub certificates: ::prost::alloc::vec::Vec<CertificatesByAddress>,
1375}
1376/// Summaries of certificates for a given address
1377#[derive(::serde::Serialize, ::serde::Deserialize)]
1378#[derive(Ord, PartialOrd)]
1379#[derive(Hash, Eq)]
1380#[derive(Clone, PartialEq, ::prost::Message)]
1381pub struct CertificatesByAddress {
1382    #[prost(message, required, tag = "1")]
1383    pub address: SocketAddress,
1384    #[prost(message, repeated, tag = "2")]
1385    pub certificate_summaries: ::prost::alloc::vec::Vec<CertificateSummary>,
1386}
1387/// to reply to several certificate queries
1388#[derive(::serde::Serialize, ::serde::Deserialize)]
1389#[derive(Ord, PartialOrd)]
1390#[derive(Hash, Eq)]
1391#[derive(Clone, PartialEq, ::prost::Message)]
1392pub struct CertificatesWithFingerprints {
1393    /// a map of fingerprint -> certificate_and_key
1394    #[prost(btree_map = "string, message", tag = "1")]
1395    pub certs: ::prost::alloc::collections::BTreeMap<
1396        ::prost::alloc::string::String,
1397        CertificateAndKey,
1398    >,
1399}
1400/// Optional health-check configuration for a UDP cluster's backends.
1401#[derive(::serde::Serialize, ::serde::Deserialize)]
1402#[derive(Ord, PartialOrd)]
1403#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1404pub struct UdpHealthConfig {
1405    /// probe mode; defaults to TCP_PROBE when a udp block is present
1406    #[prost(enumeration = "UdpHealthMode", optional, tag = "1")]
1407    pub mode: ::core::option::Option<i32>,
1408    /// companion TCP probe port; unset = the backend data port
1409    #[prost(uint32, optional, tag = "2")]
1410    pub tcp_port: ::core::option::Option<u32>,
1411    /// consecutive successes before a backend is marked up
1412    #[prost(uint32, optional, tag = "3", default = "2")]
1413    pub rise: ::core::option::Option<u32>,
1414    /// consecutive failures before a backend is marked down
1415    #[prost(uint32, optional, tag = "4", default = "3")]
1416    pub fall: ::core::option::Option<u32>,
1417    /// when all backends are down, still forward (don't drop the flow)
1418    #[prost(bool, optional, tag = "5", default = "true")]
1419    pub fail_open: ::core::option::Option<bool>,
1420    /// payload sent for a UDP_PROBE
1421    #[prost(bytes = "vec", optional, tag = "6")]
1422    pub udp_probe_payload: ::core::option::Option<::prost::alloc::vec::Vec<u8>>,
1423    /// delay between probes, in seconds
1424    #[prost(uint32, optional, tag = "7", default = "5")]
1425    pub probe_interval_seconds: ::core::option::Option<u32>,
1426    /// per-probe response timeout, in seconds
1427    #[prost(uint32, optional, tag = "8", default = "2")]
1428    pub probe_timeout_seconds: ::core::option::Option<u32>,
1429}
1430/// UDP-specific cluster knobs. Attached to a `Cluster` via the `udp` field.
1431#[derive(::serde::Serialize, ::serde::Deserialize)]
1432#[derive(Ord, PartialOrd)]
1433#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1434pub struct UdpClusterConfig {
1435    /// flow affinity key; defaults to SOURCE_IP
1436    #[prost(enumeration = "UdpAffinityKey", optional, tag = "1")]
1437    pub affinity_key: ::core::option::Option<i32>,
1438    /// expected replies per flow; 0 = unlimited
1439    #[prost(uint32, optional, tag = "2")]
1440    pub responses: ::core::option::Option<u32>,
1441    /// max client datagrams per flow; 0 = unlimited
1442    #[prost(uint32, optional, tag = "3")]
1443    pub requests: ::core::option::Option<u32>,
1444    /// send a PROXY protocol v2 header to the backend
1445    #[prost(bool, optional, tag = "4")]
1446    pub send_proxy_protocol: ::core::option::Option<bool>,
1447    /// prepend PPv2 to every datagram; false = first-datagram only
1448    #[prost(bool, optional, tag = "5")]
1449    pub proxy_protocol_every_datagram: ::core::option::Option<bool>,
1450    /// optional backend health-check configuration
1451    #[prost(message, optional, tag = "6")]
1452    pub health: ::core::option::Option<UdpHealthConfig>,
1453}
1454/// A cluster is what binds a frontend to backends with routing rules
1455#[derive(::serde::Serialize, ::serde::Deserialize)]
1456#[derive(Ord, PartialOrd)]
1457#[derive(Hash, Eq)]
1458#[derive(Clone, PartialEq, ::prost::Message)]
1459pub struct Cluster {
1460    #[prost(string, required, tag = "1")]
1461    pub cluster_id: ::prost::alloc::string::String,
1462    /// wether a connection from a client shall be always redirected to the same backend
1463    #[prost(bool, required, tag = "2")]
1464    pub sticky_session: bool,
1465    #[prost(bool, required, tag = "3")]
1466    pub https_redirect: bool,
1467    #[prost(enumeration = "ProxyProtocolConfig", optional, tag = "4")]
1468    pub proxy_protocol: ::core::option::Option<i32>,
1469    #[prost(
1470        enumeration = "LoadBalancingAlgorithms",
1471        required,
1472        tag = "5",
1473        default = "RoundRobin"
1474    )]
1475    pub load_balancing: i32,
1476    #[prost(string, optional, tag = "6")]
1477    pub answer_503: ::core::option::Option<::prost::alloc::string::String>,
1478    #[prost(enumeration = "LoadMetric", optional, tag = "7")]
1479    pub load_metric: ::core::option::Option<i32>,
1480    /// Backend-capability hint: set to true when THE BACKEND speaks HTTP/2 (h2c or h2+TLS).
1481    /// This does NOT gate H2 acceptance at the frontend — frontend H2 is negotiated via
1482    /// TLS ALPN independently of per-cluster configuration (see alpn_protocols on the listener).
1483    #[prost(bool, optional, tag = "8")]
1484    pub http2: ::core::option::Option<bool>,
1485    /// Per-cluster HTTP answer template overrides keyed by HTTP status code
1486    /// (e.g. "503"). Override a listener-level answer for this cluster only.
1487    #[prost(btree_map = "string, string", tag = "9")]
1488    #[serde(default)]
1489    pub answers: ::prost::alloc::collections::BTreeMap<
1490        ::prost::alloc::string::String,
1491        ::prost::alloc::string::String,
1492    >,
1493    /// Optional explicit port to use when building the `Location` header for
1494    /// an `https_redirect`. When unset, the listener's effective HTTPS port is
1495    /// used. Lets operators front a non-standard HTTPS port (e.g. 8443) on
1496    /// the redirect target while keeping `https_redirect = true`.
1497    #[prost(uint32, optional, tag = "10")]
1498    pub https_redirect_port: ::core::option::Option<u32>,
1499    /// Authorized credentials for HTTP basic authentication. Each entry is
1500    /// formatted as `username:hex(sha256(password))` (lower-case hex). The
1501    /// mux compares the supplied `Authorization: Basic` header in
1502    /// constant-time against the full list. Empty list disables auth even
1503    /// when a frontend sets `required_auth = true` — those requests are
1504    /// rejected with a 401.
1505    #[prost(string, repeated, tag = "11")]
1506    #[serde(default)]
1507    pub authorized_hashes: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
1508    /// Realm string emitted in `WWW-Authenticate: Basic realm="…"` when an
1509    /// unauthenticated request is rejected. Treated as an opaque value (no
1510    /// template substitution). Defaults to a generic realm if unset.
1511    #[prost(string, optional, tag = "12")]
1512    pub www_authenticate: ::core::option::Option<::prost::alloc::string::String>,
1513    /// Per-cluster override for the global `max_connections_per_ip`.
1514    /// `None` (field absent) inherits the global default. `Some(0)` is
1515    /// explicit "unlimited for this cluster". `Some(n > 0)` overrides with
1516    /// the cluster-specific limit. Counts are kept per
1517    /// `(cluster_id, source_ip)` pair, so two clusters never share a
1518    /// counter even from the same IP.
1519    #[prost(uint64, optional, tag = "13")]
1520    pub max_connections_per_ip: ::core::option::Option<u64>,
1521    /// Per-cluster override for the global `retry_after` header value
1522    /// (seconds, HTTP 429 only). `None` inherits the global default.
1523    /// `Some(0)` omits the header.
1524    #[prost(uint32, optional, tag = "14")]
1525    pub retry_after: ::core::option::Option<u32>,
1526    /// Optional HTTP health check configuration for backends in this cluster.
1527    /// Tag 8 in this message is the `http2` backend-capability hint and
1528    /// tags 9-14 cover answers/redirect/auth/limits, so health-check
1529    /// configuration occupies tag 15.
1530    #[prost(message, optional, tag = "15")]
1531    pub health_check: ::core::option::Option<HealthCheckConfig>,
1532    /// Optional UDP-specific cluster configuration. Present only for clusters
1533    /// that front UDP backends; absent for HTTP/HTTPS/TCP clusters.
1534    #[prost(message, optional, tag = "16")]
1535    pub udp: ::core::option::Option<UdpClusterConfig>,
1536}
1537#[derive(::serde::Serialize, ::serde::Deserialize)]
1538#[derive(Ord, PartialOrd)]
1539#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1540pub struct HealthCheckConfig {
1541    #[prost(string, required, tag = "1")]
1542    pub uri: ::prost::alloc::string::String,
1543    #[prost(uint32, required, tag = "2", default = "10")]
1544    pub interval: u32,
1545    #[prost(uint32, required, tag = "3", default = "5")]
1546    pub timeout: u32,
1547    #[prost(uint32, required, tag = "4", default = "3")]
1548    pub healthy_threshold: u32,
1549    #[prost(uint32, required, tag = "5", default = "3")]
1550    pub unhealthy_threshold: u32,
1551    /// The probe wire format is derived from `Cluster.http2` (the same
1552    /// backend-capability hint the mux router reads). When the cluster
1553    /// sets `http2 = true`, the probe sends the HTTP/2 connection
1554    /// preface + empty SETTINGS + HEADERS frame on stream 1; otherwise
1555    /// HTTP/1.1. There is no per-`HealthCheckConfig` h2c flag — the
1556    /// probe wire follows the data-plane wire so an h2c-only backend
1557    /// is never probed with HTTP/1.1 (and vice versa).
1558    #[prost(uint32, required, tag = "6", default = "0")]
1559    pub expected_status: u32,
1560}
1561/// add a backend
1562#[derive(::serde::Serialize, ::serde::Deserialize)]
1563#[derive(Ord, PartialOrd)]
1564#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1565pub struct AddBackend {
1566    #[prost(string, required, tag = "1")]
1567    pub cluster_id: ::prost::alloc::string::String,
1568    #[prost(string, required, tag = "2")]
1569    pub backend_id: ::prost::alloc::string::String,
1570    /// the socket address of the backend
1571    #[prost(message, required, tag = "3")]
1572    pub address: SocketAddress,
1573    #[prost(string, optional, tag = "4")]
1574    pub sticky_id: ::core::option::Option<::prost::alloc::string::String>,
1575    #[prost(message, optional, tag = "5")]
1576    pub load_balancing_parameters: ::core::option::Option<LoadBalancingParams>,
1577    #[prost(bool, optional, tag = "6")]
1578    pub backup: ::core::option::Option<bool>,
1579}
1580/// remove an existing backend
1581#[derive(::serde::Serialize, ::serde::Deserialize)]
1582#[derive(Ord, PartialOrd)]
1583#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1584pub struct RemoveBackend {
1585    #[prost(string, required, tag = "1")]
1586    pub cluster_id: ::prost::alloc::string::String,
1587    #[prost(string, required, tag = "2")]
1588    pub backend_id: ::prost::alloc::string::String,
1589    /// the socket address of the backend
1590    #[prost(message, required, tag = "3")]
1591    pub address: SocketAddress,
1592}
1593#[derive(::serde::Serialize, ::serde::Deserialize)]
1594#[derive(Ord, PartialOrd)]
1595#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1596pub struct LoadBalancingParams {
1597    #[prost(int32, required, tag = "1")]
1598    pub weight: i32,
1599}
1600#[derive(::serde::Serialize, ::serde::Deserialize)]
1601#[derive(Ord, PartialOrd)]
1602#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1603pub struct QueryClusterByDomain {
1604    #[prost(string, required, tag = "1")]
1605    pub hostname: ::prost::alloc::string::String,
1606    #[prost(string, optional, tag = "2")]
1607    pub path: ::core::option::Option<::prost::alloc::string::String>,
1608}
1609/// Options when querying metrics
1610#[derive(::serde::Serialize, ::serde::Deserialize)]
1611#[derive(Ord, PartialOrd)]
1612#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1613pub struct QueryMetricsOptions {
1614    /// query a list of available metrics
1615    #[prost(bool, required, tag = "1")]
1616    pub list: bool,
1617    /// query metrics for these clusters
1618    #[prost(string, repeated, tag = "2")]
1619    pub cluster_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
1620    /// query metrics for these backends
1621    #[prost(string, repeated, tag = "3")]
1622    pub backend_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
1623    /// query only these metrics
1624    #[prost(string, repeated, tag = "4")]
1625    pub metric_names: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
1626    /// query only worker and main process metrics (no cluster metrics)
1627    #[prost(bool, required, tag = "5")]
1628    pub no_clusters: bool,
1629    /// display metrics of each worker, without flattening (takes more space)
1630    #[prost(bool, required, tag = "6")]
1631    pub workers: bool,
1632}
1633/// Response to a request
1634#[derive(::serde::Serialize, ::serde::Deserialize)]
1635#[derive(Ord, PartialOrd)]
1636#[derive(Hash, Eq)]
1637#[derive(Clone, PartialEq, ::prost::Message)]
1638pub struct Response {
1639    /// wether the request was a success, a failure, or is processing
1640    #[prost(enumeration = "ResponseStatus", required, tag = "1", default = "Failure")]
1641    pub status: i32,
1642    /// a success or error message
1643    #[prost(string, required, tag = "2")]
1644    pub message: ::prost::alloc::string::String,
1645    /// response data, if any
1646    #[prost(message, optional, tag = "3")]
1647    pub content: ::core::option::Option<ResponseContent>,
1648}
1649/// content of a response
1650#[derive(::serde::Serialize, ::serde::Deserialize)]
1651#[derive(Ord, PartialOrd)]
1652#[derive(Hash, Eq)]
1653#[derive(Clone, PartialEq, ::prost::Message)]
1654pub struct ResponseContent {
1655    #[prost(
1656        oneof = "response_content::ContentType",
1657        tags = "1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17"
1658    )]
1659    pub content_type: ::core::option::Option<response_content::ContentType>,
1660}
1661/// Nested message and enum types in `ResponseContent`.
1662pub mod response_content {
1663    #[derive(::serde::Serialize, ::serde::Deserialize)]
1664    #[serde(rename_all = "SCREAMING_SNAKE_CASE")]
1665    #[derive(Hash, Eq, Ord, PartialOrd)]
1666    #[derive(Clone, PartialEq, ::prost::Oneof)]
1667    pub enum ContentType {
1668        /// a list of workers, with ids, pids, statuses
1669        #[prost(message, tag = "1")]
1670        Workers(super::WorkerInfos),
1671        /// aggregated metrics of main process and workers
1672        #[prost(message, tag = "2")]
1673        Metrics(super::AggregatedMetrics),
1674        /// a collection of worker responses to the same request
1675        #[prost(message, tag = "3")]
1676        WorkerResponses(super::WorkerResponses),
1677        /// a proxy event
1678        #[prost(message, tag = "4")]
1679        Event(super::Event),
1680        /// a filtered list of frontend
1681        #[prost(message, tag = "5")]
1682        FrontendList(super::ListedFrontends),
1683        /// all listeners
1684        #[prost(message, tag = "6")]
1685        ListenersList(super::ListenersList),
1686        /// contains proxy & cluster metrics
1687        #[prost(message, tag = "7")]
1688        WorkerMetrics(super::WorkerMetrics),
1689        /// Lists of metrics that are available
1690        #[prost(message, tag = "8")]
1691        AvailableMetrics(super::AvailableMetrics),
1692        /// a list of cluster informations
1693        #[prost(message, tag = "9")]
1694        Clusters(super::ClusterInformations),
1695        /// collection of hashes of cluster information,
1696        #[prost(message, tag = "10")]
1697        ClusterHashes(super::ClusterHashes),
1698        /// a list of certificates summaries, grouped by socket address
1699        #[prost(message, tag = "11")]
1700        CertificatesByAddress(super::ListOfCertificatesByAddress),
1701        /// a map of complete certificates using fingerprints as key
1702        #[prost(message, tag = "12")]
1703        CertificatesWithFingerprints(super::CertificatesWithFingerprints),
1704        /// a census of the types of requests received since startup,
1705        #[prost(message, tag = "13")]
1706        RequestCounts(super::RequestCounts),
1707        /// current global per-(cluster, source-IP) connection limit
1708        #[prost(message, tag = "14")]
1709        MaxConnectionsPerIpLimit(super::MaxConnectionsPerIpLimit),
1710        /// health check configurations by cluster (renumbered from PR #1191's
1711        /// original `14` since post-1209 occupies that tag).
1712        #[prost(message, tag = "15")]
1713        HealthChecksList(super::HealthChecksList),
1714        /// Aggregated outcome of a `SetMetricDetail` fan-out: per-worker
1715        /// configured/effective/previous_effective levels plus the list of
1716        /// workers that could not decode the verb (mixed-version safety).
1717        #[prost(message, tag = "16")]
1718        MetricDetailStatus(super::MetricDetailStatus),
1719        /// Per-worker status payload returned by a single worker in
1720        /// response to `SetMetricDetail`. The master collects these
1721        /// across the fan-out and assembles them into
1722        /// `MetricDetailStatus.workers\[<worker_id>\]`. Carries the
1723        /// worker's own `(configured, effective, previous_effective,
1724        /// active_lease_count)` quartet — distinct from the master-side
1725        /// view rendered in `MetricDetailStatus.{configured,effective,
1726        /// previous_effective}` because each worker holds its own
1727        /// `Aggregator` with an independent lease table.
1728        #[prost(message, tag = "17")]
1729        WorkerMetricDetailStatus(super::WorkerMetricDetailStatus),
1730    }
1731}
1732#[derive(::serde::Serialize, ::serde::Deserialize)]
1733#[derive(Ord, PartialOrd)]
1734#[derive(Hash, Eq)]
1735#[derive(Clone, PartialEq, ::prost::Message)]
1736pub struct HealthChecksList {
1737    #[prost(btree_map = "string, message", tag = "1")]
1738    pub map: ::prost::alloc::collections::BTreeMap<
1739        ::prost::alloc::string::String,
1740        HealthCheckConfig,
1741    >,
1742}
1743/// a map of worker_id -> ResponseContent
1744#[derive(::serde::Serialize, ::serde::Deserialize)]
1745#[derive(Ord, PartialOrd)]
1746#[derive(Hash, Eq)]
1747#[derive(Clone, PartialEq, ::prost::Message)]
1748pub struct WorkerResponses {
1749    #[prost(btree_map = "string, message", tag = "1")]
1750    pub map: ::prost::alloc::collections::BTreeMap<
1751        ::prost::alloc::string::String,
1752        ResponseContent,
1753    >,
1754}
1755/// lists of frontends present in the state
1756#[derive(::serde::Serialize, ::serde::Deserialize)]
1757#[derive(Ord, PartialOrd)]
1758#[derive(Hash, Eq)]
1759#[derive(Clone, PartialEq, ::prost::Message)]
1760pub struct ListedFrontends {
1761    #[prost(message, repeated, tag = "1")]
1762    pub http_frontends: ::prost::alloc::vec::Vec<RequestHttpFrontend>,
1763    #[prost(message, repeated, tag = "2")]
1764    pub https_frontends: ::prost::alloc::vec::Vec<RequestHttpFrontend>,
1765    #[prost(message, repeated, tag = "3")]
1766    pub tcp_frontends: ::prost::alloc::vec::Vec<RequestTcpFrontend>,
1767    #[prost(message, repeated, tag = "4")]
1768    pub udp_frontends: ::prost::alloc::vec::Vec<RequestUdpFrontend>,
1769}
1770#[derive(::serde::Serialize, ::serde::Deserialize)]
1771#[derive(Ord, PartialOrd)]
1772#[derive(Hash, Eq)]
1773#[derive(Clone, PartialEq, ::prost::Message)]
1774pub struct ClusterInformations {
1775    #[prost(message, repeated, tag = "1")]
1776    pub vec: ::prost::alloc::vec::Vec<ClusterInformation>,
1777}
1778/// Information about a given cluster
1779/// Contains types usually used in requests, because they are readily available in protobuf
1780#[derive(::serde::Serialize, ::serde::Deserialize)]
1781#[derive(Ord, PartialOrd)]
1782#[derive(Hash, Eq)]
1783#[derive(Clone, PartialEq, ::prost::Message)]
1784pub struct ClusterInformation {
1785    #[prost(message, optional, tag = "1")]
1786    pub configuration: ::core::option::Option<Cluster>,
1787    #[prost(message, repeated, tag = "2")]
1788    pub http_frontends: ::prost::alloc::vec::Vec<RequestHttpFrontend>,
1789    #[prost(message, repeated, tag = "3")]
1790    pub https_frontends: ::prost::alloc::vec::Vec<RequestHttpFrontend>,
1791    #[prost(message, repeated, tag = "4")]
1792    pub tcp_frontends: ::prost::alloc::vec::Vec<RequestTcpFrontend>,
1793    #[prost(message, repeated, tag = "5")]
1794    pub backends: ::prost::alloc::vec::Vec<AddBackend>,
1795    #[prost(message, repeated, tag = "6")]
1796    pub udp_frontends: ::prost::alloc::vec::Vec<RequestUdpFrontend>,
1797}
1798/// an event produced by a worker to notify about backends status
1799#[derive(::serde::Serialize, ::serde::Deserialize)]
1800#[derive(Ord, PartialOrd)]
1801#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1802pub struct Event {
1803    #[prost(enumeration = "EventKind", required, tag = "1")]
1804    pub kind: i32,
1805    #[prost(string, optional, tag = "2")]
1806    pub cluster_id: ::core::option::Option<::prost::alloc::string::String>,
1807    #[prost(string, optional, tag = "3")]
1808    pub backend_id: ::core::option::Option<::prost::alloc::string::String>,
1809    #[prost(message, optional, tag = "4")]
1810    pub address: ::core::option::Option<SocketAddress>,
1811    /// Set only when `kind == METRIC_DETAIL_CHANGED` and the worker is
1812    /// surfacing a worker-local lease transition (apply, clear, or polled
1813    /// expiry). Operator-initiated transitions are audited at the master
1814    /// dispatch site and DO emit this event for the SubscribeEvents bus,
1815    /// but the audit-log line for those is generated master-side and
1816    /// duplicates of `metric_detail` should be ignored by SOC tooling.
1817    /// See the `EventKind::METRIC_DETAIL_CHANGED` doc and the
1818    /// `MetricDetailTransition` message below for the trust model.
1819    #[prost(message, optional, tag = "5")]
1820    pub metric_detail: ::core::option::Option<MetricDetailTransition>,
1821}
1822/// Worker-emitted cardinality-lease transition. Populates the
1823/// `Event.metric_detail` field when a worker's `effective` level changes
1824/// because a lease was applied, renewed, expired (TTL janitor), or
1825/// cleared. The master folds these into the audit log alongside the
1826/// operator-initiated transitions emitted from
1827/// `bin/src/command/requests.rs::worker_request`, closing the gap where
1828/// worker-local expiries previously left no audit trail.
1829#[derive(::serde::Serialize, ::serde::Deserialize)]
1830#[derive(Ord, PartialOrd)]
1831#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1832pub struct MetricDetailTransition {
1833    /// The worker's effective cardinality level BEFORE the transition.
1834    #[prost(enumeration = "MetricDetail", required, tag = "1")]
1835    pub previous_effective: i32,
1836    /// The worker's effective cardinality level AFTER the transition.
1837    #[prost(enumeration = "MetricDetail", required, tag = "2")]
1838    pub effective: i32,
1839    /// What caused the transition. Stable strings: "lease_tick_expired"
1840    /// (janitor retired one or more leases), "lease_apply" (worker arm
1841    /// applied a lease), "lease_clear" (worker arm cleared a lease).
1842    /// Operator-initiated apply/clear emit master-side; the worker still
1843    /// emits this Event so the SubscribeEvents bus has one canonical
1844    /// signal for cardinality changes regardless of origin.
1845    #[prost(string, required, tag = "3")]
1846    pub transition_kind: ::prost::alloc::string::String,
1847    /// Operator-supplied lease key (`SetMetricDetail.client_id`) when the
1848    /// transition was triggered by an explicit apply/clear. Empty for
1849    /// janitor expiries, which clear many leases at once.
1850    #[prost(string, optional, tag = "4")]
1851    pub client_id: ::core::option::Option<::prost::alloc::string::String>,
1852}
1853#[derive(::serde::Serialize, ::serde::Deserialize)]
1854#[derive(Ord, PartialOrd)]
1855#[derive(Hash, Eq)]
1856#[derive(Clone, PartialEq, ::prost::Message)]
1857pub struct ClusterHashes {
1858    /// cluster id -> hash of cluster information
1859    #[prost(btree_map = "string, uint64", tag = "1")]
1860    pub map: ::prost::alloc::collections::BTreeMap<::prost::alloc::string::String, u64>,
1861}
1862/// A list of worker infos
1863#[derive(::serde::Serialize, ::serde::Deserialize)]
1864#[derive(Ord, PartialOrd)]
1865#[derive(Hash, Eq)]
1866#[derive(Clone, PartialEq, ::prost::Message)]
1867pub struct WorkerInfos {
1868    #[prost(message, repeated, tag = "1")]
1869    pub vec: ::prost::alloc::vec::Vec<WorkerInfo>,
1870}
1871/// Information about a worker with id, pid, runstate
1872#[derive(::serde::Serialize, ::serde::Deserialize)]
1873#[derive(Ord, PartialOrd)]
1874#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1875pub struct WorkerInfo {
1876    #[prost(uint32, required, tag = "1")]
1877    pub id: u32,
1878    #[prost(int32, required, tag = "2")]
1879    pub pid: i32,
1880    #[prost(enumeration = "RunState", required, tag = "3")]
1881    pub run_state: i32,
1882}
1883/// lists of available metrics in a worker, or in the main process (in which case there are no cluster metrics)
1884#[derive(::serde::Serialize, ::serde::Deserialize)]
1885#[derive(Ord, PartialOrd)]
1886#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1887pub struct AvailableMetrics {
1888    #[prost(string, repeated, tag = "1")]
1889    pub proxy_metrics: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
1890    #[prost(string, repeated, tag = "2")]
1891    pub cluster_metrics: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
1892}
1893/// Aggregated metrics of main process & workers
1894#[derive(::serde::Serialize, ::serde::Deserialize)]
1895#[derive(Ord, PartialOrd)]
1896#[derive(Hash, Eq)]
1897#[derive(Clone, PartialEq, ::prost::Message)]
1898pub struct AggregatedMetrics {
1899    /// metrics about the main process.
1900    /// metric_name -> metric_value
1901    #[prost(btree_map = "string, message", tag = "1")]
1902    pub main: ::prost::alloc::collections::BTreeMap<
1903        ::prost::alloc::string::String,
1904        FilteredMetrics,
1905    >,
1906    /// details of worker metrics, with clusters and backends.
1907    /// worker_id -> worker_metrics
1908    #[prost(btree_map = "string, message", tag = "2")]
1909    pub workers: ::prost::alloc::collections::BTreeMap<
1910        ::prost::alloc::string::String,
1911        WorkerMetrics,
1912    >,
1913    /// if present, contains metrics of clusters and their backends, merged across all workers.
1914    /// cluster_id -> cluster_metrics
1915    #[prost(btree_map = "string, message", tag = "3")]
1916    pub clusters: ::prost::alloc::collections::BTreeMap<
1917        ::prost::alloc::string::String,
1918        ClusterMetrics,
1919    >,
1920    /// if present, proxying metrics, merged accross all workers.
1921    /// metric_name -> metric_value
1922    #[prost(btree_map = "string, message", tag = "4")]
1923    pub proxying: ::prost::alloc::collections::BTreeMap<
1924        ::prost::alloc::string::String,
1925        FilteredMetrics,
1926    >,
1927}
1928/// All metrics of a worker: proxy and clusters
1929/// Populated by Options so partial results can be sent
1930#[derive(::serde::Serialize, ::serde::Deserialize)]
1931#[derive(Ord, PartialOrd)]
1932#[derive(Hash, Eq)]
1933#[derive(Clone, PartialEq, ::prost::Message)]
1934pub struct WorkerMetrics {
1935    /// Metrics of the worker process, key -> value
1936    #[prost(btree_map = "string, message", tag = "1")]
1937    pub proxy: ::prost::alloc::collections::BTreeMap<
1938        ::prost::alloc::string::String,
1939        FilteredMetrics,
1940    >,
1941    /// cluster_id -> cluster_metrics
1942    #[prost(btree_map = "string, message", tag = "2")]
1943    pub clusters: ::prost::alloc::collections::BTreeMap<
1944        ::prost::alloc::string::String,
1945        ClusterMetrics,
1946    >,
1947}
1948/// the metrics of a given cluster, with several backends
1949#[derive(::serde::Serialize, ::serde::Deserialize)]
1950#[derive(Ord, PartialOrd)]
1951#[derive(Hash, Eq)]
1952#[derive(Clone, PartialEq, ::prost::Message)]
1953pub struct ClusterMetrics {
1954    /// metric name -> metric value
1955    #[prost(btree_map = "string, message", tag = "1")]
1956    pub cluster: ::prost::alloc::collections::BTreeMap<
1957        ::prost::alloc::string::String,
1958        FilteredMetrics,
1959    >,
1960    /// list of backends with their metrics
1961    #[prost(message, repeated, tag = "2")]
1962    pub backends: ::prost::alloc::vec::Vec<BackendMetrics>,
1963}
1964#[derive(::serde::Serialize, ::serde::Deserialize)]
1965#[derive(Ord, PartialOrd)]
1966#[derive(Hash, Eq)]
1967#[derive(Clone, PartialEq, ::prost::Message)]
1968pub struct BackendMetrics {
1969    #[prost(string, required, tag = "1")]
1970    pub backend_id: ::prost::alloc::string::String,
1971    #[prost(btree_map = "string, message", tag = "2")]
1972    pub metrics: ::prost::alloc::collections::BTreeMap<
1973        ::prost::alloc::string::String,
1974        FilteredMetrics,
1975    >,
1976}
1977/// A metric, in a "filtered" format, which means: sendable to outside programs.
1978#[derive(::serde::Serialize, ::serde::Deserialize)]
1979#[derive(Ord, PartialOrd)]
1980#[derive(Hash, Eq)]
1981#[derive(Clone, PartialEq, ::prost::Message)]
1982pub struct FilteredMetrics {
1983    #[prost(oneof = "filtered_metrics::Inner", tags = "1, 2, 3, 4, 5, 6")]
1984    pub inner: ::core::option::Option<filtered_metrics::Inner>,
1985}
1986/// Nested message and enum types in `FilteredMetrics`.
1987pub mod filtered_metrics {
1988    #[derive(::serde::Serialize, ::serde::Deserialize)]
1989    #[serde(rename_all = "SCREAMING_SNAKE_CASE")]
1990    #[derive(Hash, Eq, Ord, PartialOrd)]
1991    #[derive(Clone, PartialEq, ::prost::Oneof)]
1992    pub enum Inner {
1993        /// increases or decrease depending on the state
1994        #[prost(uint64, tag = "1")]
1995        Gauge(u64),
1996        /// increases only
1997        #[prost(int64, tag = "2")]
1998        Count(i64),
1999        /// milliseconds
2000        #[prost(uint64, tag = "3")]
2001        Time(u64),
2002        #[prost(message, tag = "4")]
2003        Percentiles(super::Percentiles),
2004        #[prost(message, tag = "5")]
2005        TimeSerie(super::FilteredTimeSerie),
2006        #[prost(message, tag = "6")]
2007        Histogram(super::FilteredHistogram),
2008    }
2009}
2010#[derive(::serde::Serialize, ::serde::Deserialize)]
2011#[derive(Ord, PartialOrd)]
2012#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2013pub struct FilteredTimeSerie {
2014    #[prost(uint32, required, tag = "1")]
2015    pub last_second: u32,
2016    #[prost(uint32, repeated, packed = "false", tag = "2")]
2017    pub last_minute: ::prost::alloc::vec::Vec<u32>,
2018    #[prost(uint32, repeated, packed = "false", tag = "3")]
2019    pub last_hour: ::prost::alloc::vec::Vec<u32>,
2020}
2021#[derive(::serde::Serialize, ::serde::Deserialize)]
2022#[derive(Ord, PartialOrd)]
2023#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
2024pub struct Percentiles {
2025    #[prost(uint64, required, tag = "1")]
2026    pub samples: u64,
2027    #[prost(uint64, required, tag = "2")]
2028    pub p_50: u64,
2029    #[prost(uint64, required, tag = "3")]
2030    pub p_90: u64,
2031    #[prost(uint64, required, tag = "4")]
2032    pub p_99: u64,
2033    #[prost(uint64, required, tag = "5")]
2034    pub p_99_9: u64,
2035    #[prost(uint64, required, tag = "6")]
2036    pub p_99_99: u64,
2037    #[prost(uint64, required, tag = "7")]
2038    pub p_99_999: u64,
2039    #[prost(uint64, required, tag = "8")]
2040    pub p_100: u64,
2041    #[prost(uint64, required, tag = "9")]
2042    pub sum: u64,
2043}
2044/// a histogram meant to be translated to prometheus
2045#[derive(::serde::Serialize, ::serde::Deserialize)]
2046#[derive(Ord, PartialOrd)]
2047#[derive(Hash, Eq)]
2048#[derive(Clone, PartialEq, ::prost::Message)]
2049pub struct FilteredHistogram {
2050    #[prost(uint64, required, tag = "1")]
2051    pub sum: u64,
2052    #[prost(uint64, required, tag = "2")]
2053    pub count: u64,
2054    #[prost(message, repeated, tag = "3")]
2055    pub buckets: ::prost::alloc::vec::Vec<Bucket>,
2056}
2057/// a prometheus histogram bucket
2058#[derive(::serde::Serialize, ::serde::Deserialize)]
2059#[derive(Ord, PartialOrd)]
2060#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
2061pub struct Bucket {
2062    #[prost(uint64, required, tag = "1")]
2063    pub count: u64,
2064    /// upper range of the bucket (le = less or equal)
2065    #[prost(uint64, required, tag = "2")]
2066    pub le: u64,
2067}
2068#[derive(::serde::Serialize, ::serde::Deserialize)]
2069#[derive(Ord, PartialOrd)]
2070#[derive(Hash, Eq)]
2071#[derive(Clone, PartialEq, ::prost::Message)]
2072pub struct RequestCounts {
2073    #[prost(btree_map = "string, int32", tag = "1")]
2074    pub map: ::prost::alloc::collections::BTreeMap<::prost::alloc::string::String, i32>,
2075}
2076/// `0` means unlimited (the feature is disabled). Returned by workers in
2077/// response to `Request.query_max_connections_per_ip`.
2078#[derive(::serde::Serialize, ::serde::Deserialize)]
2079#[derive(Ord, PartialOrd)]
2080#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
2081pub struct MaxConnectionsPerIpLimit {
2082    #[prost(uint64, required, tag = "1")]
2083    pub limit: u64,
2084}
2085/// matches std::net::SocketAddr in the Rust library
2086/// beware that the ports are expressed with uint32 here,
2087/// but they should NOT exceed uint16 value
2088#[derive(::serde::Serialize, ::serde::Deserialize)]
2089#[derive(Ord, PartialOrd)]
2090#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
2091pub struct SocketAddress {
2092    #[prost(message, required, tag = "1")]
2093    pub ip: IpAddress,
2094    #[prost(uint32, required, tag = "2")]
2095    pub port: u32,
2096}
2097#[derive(::serde::Serialize, ::serde::Deserialize)]
2098#[derive(Ord, PartialOrd)]
2099#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
2100pub struct IpAddress {
2101    #[prost(oneof = "ip_address::Inner", tags = "1, 2")]
2102    pub inner: ::core::option::Option<ip_address::Inner>,
2103}
2104/// Nested message and enum types in `IpAddress`.
2105pub mod ip_address {
2106    #[derive(::serde::Serialize, ::serde::Deserialize)]
2107    #[serde(rename_all = "SCREAMING_SNAKE_CASE")]
2108    #[derive(Ord, PartialOrd)]
2109    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Oneof)]
2110    pub enum Inner {
2111        #[prost(fixed32, tag = "1")]
2112        V4(u32),
2113        #[prost(message, tag = "2")]
2114        V6(super::Uint128),
2115    }
2116}
2117/// used to represent the 128 bits of an IPv6 address
2118#[derive(::serde::Serialize, ::serde::Deserialize)]
2119#[derive(Ord, PartialOrd)]
2120#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
2121pub struct Uint128 {
2122    /// higher value, first 8 bytes of the ip
2123    #[prost(uint64, required, tag = "1")]
2124    pub low: u64,
2125    /// lower value, last 8 bytes of the ip
2126    #[prost(uint64, required, tag = "2")]
2127    pub high: u64,
2128}
2129/// This is sent only from Sōzu to Sōzu
2130#[derive(::serde::Serialize, ::serde::Deserialize)]
2131#[derive(Ord, PartialOrd)]
2132#[derive(Hash, Eq)]
2133#[derive(Clone, PartialEq, ::prost::Message)]
2134pub struct WorkerRequest {
2135    #[prost(string, required, tag = "1")]
2136    pub id: ::prost::alloc::string::String,
2137    #[prost(message, required, tag = "2")]
2138    pub content: Request,
2139}
2140/// A response as sent by a worker
2141#[derive(::serde::Serialize, ::serde::Deserialize)]
2142#[derive(Ord, PartialOrd)]
2143#[derive(Hash, Eq)]
2144#[derive(Clone, PartialEq, ::prost::Message)]
2145pub struct WorkerResponse {
2146    #[prost(string, required, tag = "1")]
2147    pub id: ::prost::alloc::string::String,
2148    #[prost(enumeration = "ResponseStatus", required, tag = "2")]
2149    pub status: i32,
2150    /// an associated message to detail failure, success or processing
2151    #[prost(string, required, tag = "3")]
2152    pub message: ::prost::alloc::string::String,
2153    #[prost(message, optional, tag = "4")]
2154    pub content: ::core::option::Option<ResponseContent>,
2155}
2156/// Apply, renew, or release a runtime cardinality lease on the metrics drain.
2157///
2158/// Leasing model: `sozu top` (and any future TUI client) leases a higher
2159/// `MetricDetail` for the duration of an interactive session. The worker's
2160/// effective detail is `max(configured, max(active leases))`, where
2161/// `configured` is `MetricsConfig.detail` from the static configuration.
2162/// Multiple clients can lease independently; the worker keeps a `client_id`-
2163/// keyed table and uses the maximum across active entries.
2164///
2165/// Lifecycle:
2166/// 1. Apply: send `SetMetricDetail{ client_id, detail, ttl_seconds, reason }`.
2167///    The worker stores `(client_id) -> (detail, expires_at = now + ttl)`. If
2168///    a lease for `client_id` already exists, it is REPLACED (acts as a
2169///    renewal). The renewer client is expected to re-send every `ttl/2`.
2170/// 2. Expire: leases self-expire server-side at `expires_at`. The worker's
2171///    janitor (5s polled tick at the top of `notify`) prunes expired leases
2172///    and recomputes effective. Crash safety: a dead client is forgotten.
2173/// 3. Clear: send `SetMetricDetail{ client_id, clear: true }` for explicit
2174///    revocation. `client_id` must match the leased entry; mismatched IDs
2175///    are silently ignored (other clients' leases are not affected).
2176///
2177/// Audit
2178/// =====
2179/// Every operator-initiated effective-level transition emits an
2180/// `EventKind::METRIC_DETAIL_CHANGED` event on `SubscribeEvents` with the
2181/// previous and new effective levels and the requesting `client_id` plus
2182/// optional `reason` text. Renewal-no-op (same effective level) is NOT
2183/// emitted.
2184///
2185/// Emitter scope: operator-initiated transitions emit
2186/// `METRIC_DETAIL_CHANGED` via the master-side audit log. Worker-local
2187/// transitions — the polled janitor expiring a lease, or a worker-local
2188/// clear/apply after a master fan-out — are not yet surfaced; follow-up
2189/// tracked separately.
2190///
2191/// Backwards compatibility
2192/// =======================
2193/// Workers that pre-date this verb cannot decode `SetMetricDetail` and return
2194/// `WorkerResponse::error("unknown request type")` which folds into the standard
2195/// fan-out error tally (`extras.fanout.workers_err`); operators see "succeeded
2196/// with errors" rather than a dedicated capability-skip list. Production
2197/// deployments keep master + workers in sync via the `UpgradeMain` hot-upgrade
2198/// flow, so this mixed-version state is transient. The master itself also
2199/// leases (mirroring the symmetric `setup_metrics` path) so the audit log has a
2200/// single canonical row when an operator flips detail across the fleet.
2201#[derive(::serde::Serialize, ::serde::Deserialize)]
2202#[derive(Ord, PartialOrd)]
2203#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2204pub struct SetMetricDetail {
2205    /// Stable identifier for the leasing client (`sozu top` uses
2206    /// `top:<pid>:<random>`). Required so multiple TUIs / scrapers / other
2207    /// tooling can lease independently.
2208    #[prost(string, required, tag = "1")]
2209    pub client_id: ::prost::alloc::string::String,
2210    /// Target detail for the lease. Required when `clear` is false/absent.
2211    #[prost(enumeration = "MetricDetail", optional, tag = "2")]
2212    pub detail: ::core::option::Option<i32>,
2213    /// Time-to-live for the lease in seconds. The worker rejects (FAILURE)
2214    /// values larger than 300s to bound the worst-case effect of a stuck
2215    /// renewer. Defaults server-side to 60s when absent (the master treats
2216    /// 0 as "use default" and emits a warning).
2217    #[prost(uint32, optional, tag = "3")]
2218    pub ttl_seconds: ::core::option::Option<u32>,
2219    /// When true, releases the lease for `client_id` instead of applying.
2220    /// `detail` and `ttl_seconds` are ignored when `clear` is true.
2221    #[prost(bool, optional, tag = "4")]
2222    pub clear: ::core::option::Option<bool>,
2223    /// Optional human-readable provenance for the audit log
2224    /// (e.g. `"sozu top --detail backend"`, `"prometheus-scraper:sozu-1"`).
2225    #[prost(string, optional, tag = "5")]
2226    pub reason: ::core::option::Option<::prost::alloc::string::String>,
2227    /// Master-populated peer binding. These fields are NOT set by clients —
2228    /// the master fills them in `bin/src/command/requests.rs::worker_request`
2229    /// from the connecting `ClientSession` (`actor_pid` + `session_ulid`)
2230    /// before forwarding to workers. The worker stores the binding
2231    /// alongside the lease and rejects subsequent `clear` requests whose
2232    /// binding does not match the apply-time binding. Prevents one same-UID
2233    /// operator from accidentally (or deliberately) clearing another
2234    /// operator's lease by guessing the `client_id` format. A `None` value
2235    /// means "binding not available" — the worker accepts any matching
2236    /// `client_id` clear, preserving compat with pre-binding callers and
2237    /// with platforms whose unix socket peer credentials are unavailable.
2238    #[prost(int32, optional, tag = "6")]
2239    pub peer_pid: ::core::option::Option<i32>,
2240    #[prost(string, optional, tag = "7")]
2241    pub peer_session_ulid: ::core::option::Option<::prost::alloc::string::String>,
2242}
2243/// Per-worker outcome of a `SetMetricDetail` fan-out. Reported back to the
2244/// requesting client so it can decide whether the elevation actually took
2245/// effect (e.g. all workers acknowledged) or whether degraded operation
2246/// (some workers too old) is in play.
2247#[derive(::serde::Serialize, ::serde::Deserialize)]
2248#[derive(Ord, PartialOrd)]
2249#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
2250pub struct WorkerMetricDetailStatus {
2251    /// The worker's static `MetricsConfig.detail` (or DETAIL_CLUSTER if
2252    /// unset). Independent of leases.
2253    #[prost(enumeration = "MetricDetail", required, tag = "1")]
2254    pub configured: i32,
2255    /// Effective level AFTER processing this verb: `max(configured, leases)`.
2256    #[prost(enumeration = "MetricDetail", required, tag = "2")]
2257    pub effective: i32,
2258    /// Effective level BEFORE the verb. Equal to `effective` for a no-op.
2259    #[prost(enumeration = "MetricDetail", required, tag = "3")]
2260    pub previous_effective: i32,
2261    /// Number of active leases on this worker (post-prune). Useful to
2262    /// surface "another client is still leasing this level" in the TUI.
2263    #[prost(uint32, required, tag = "4")]
2264    pub active_lease_count: u32,
2265}
2266/// Aggregated `SetMetricDetail` outcome across the fleet. Returned by the
2267/// master to the requesting client (no `WorkerResponses` indirection needed
2268/// because the schema is symmetric per-worker).
2269#[derive(::serde::Serialize, ::serde::Deserialize)]
2270#[derive(Ord, PartialOrd)]
2271#[derive(Hash, Eq)]
2272#[derive(Clone, PartialEq, ::prost::Message)]
2273pub struct MetricDetailStatus {
2274    /// The master's own `configured` view (mirrors a worker's view since the
2275    /// master also runs the metrics aggregator).
2276    #[prost(enumeration = "MetricDetail", required, tag = "1")]
2277    pub configured: i32,
2278    /// Master's effective level AFTER the verb.
2279    #[prost(enumeration = "MetricDetail", required, tag = "2")]
2280    pub effective: i32,
2281    /// Master's effective level BEFORE the verb.
2282    #[prost(enumeration = "MetricDetail", required, tag = "3")]
2283    pub previous_effective: i32,
2284    /// Per-worker status. Map keyed by worker_id (string form for parity
2285    /// with `WorkerResponses`).
2286    #[prost(btree_map = "string, message", tag = "4")]
2287    pub workers: ::prost::alloc::collections::BTreeMap<
2288        ::prost::alloc::string::String,
2289        WorkerMetricDetailStatus,
2290    >,
2291}
2292/// intended to workers
2293#[derive(::serde::Serialize, ::serde::Deserialize)]
2294#[derive(Ord, PartialOrd)]
2295#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2296pub struct ServerMetricsConfig {
2297    #[prost(string, required, tag = "1")]
2298    pub address: ::prost::alloc::string::String,
2299    #[prost(bool, required, tag = "2")]
2300    pub tagged_metrics: bool,
2301    #[prost(string, optional, tag = "3")]
2302    pub prefix: ::core::option::Option<::prost::alloc::string::String>,
2303    /// optional in proto: workers built before this field default to
2304    /// DETAIL_CLUSTER on the lib side to preserve historical behaviour.
2305    #[prost(enumeration = "MetricDetail", optional, tag = "4")]
2306    pub detail: ::core::option::Option<i32>,
2307}
2308/// Used by a worker to start its server loop.
2309/// The defaults should match those of the config module
2310#[derive(::serde::Serialize, ::serde::Deserialize)]
2311#[derive(Ord, PartialOrd)]
2312#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2313pub struct ServerConfig {
2314    #[prost(uint64, required, tag = "1", default = "10000")]
2315    pub max_connections: u64,
2316    #[prost(uint32, required, tag = "2", default = "60")]
2317    pub front_timeout: u32,
2318    #[prost(uint32, required, tag = "3", default = "30")]
2319    pub back_timeout: u32,
2320    #[prost(uint32, required, tag = "4", default = "3")]
2321    pub connect_timeout: u32,
2322    #[prost(uint32, required, tag = "5", default = "1800")]
2323    pub zombie_check_interval: u32,
2324    #[prost(uint32, required, tag = "6", default = "60")]
2325    pub accept_queue_timeout: u32,
2326    #[prost(uint64, required, tag = "7", default = "1")]
2327    pub min_buffers: u64,
2328    #[prost(uint64, required, tag = "8", default = "1000")]
2329    pub max_buffers: u64,
2330    #[prost(uint64, required, tag = "9", default = "16393")]
2331    pub buffer_size: u64,
2332    #[prost(string, required, tag = "10", default = "info")]
2333    pub log_level: ::prost::alloc::string::String,
2334    #[prost(string, required, tag = "11", default = "stdout")]
2335    pub log_target: ::prost::alloc::string::String,
2336    #[prost(string, optional, tag = "12")]
2337    pub access_logs_target: ::core::option::Option<::prost::alloc::string::String>,
2338    #[prost(uint64, required, tag = "13", default = "1000000")]
2339    pub command_buffer_size: u64,
2340    #[prost(uint64, required, tag = "14", default = "2000000")]
2341    pub max_command_buffer_size: u64,
2342    #[prost(message, optional, tag = "15")]
2343    pub metrics: ::core::option::Option<ServerMetricsConfig>,
2344    #[prost(enumeration = "ProtobufAccessLogFormat", required, tag = "16")]
2345    pub access_log_format: i32,
2346    #[prost(bool, required, tag = "17")]
2347    pub log_colored: bool,
2348    /// Dedicated file path for the control-plane audit trail. When set on the
2349    /// main process, every audit line is also appended to this file opened
2350    /// `O_APPEND | O_CREAT` with mode `0o640`. Workers currently ignore this
2351    /// field (audit only lives on the main), but the field is propagated on
2352    /// the proto wire so a future worker-side audit path can pick it up.
2353    #[prost(string, optional, tag = "18")]
2354    pub audit_logs_target: ::core::option::Option<::prost::alloc::string::String>,
2355    /// Dedicated JSON mirror of the audit log. One JSON object per line for
2356    /// SIEM ingest. Same lifecycle as `audit_logs_target`.
2357    #[prost(string, optional, tag = "19")]
2358    pub audit_logs_json_target: ::core::option::Option<::prost::alloc::string::String>,
2359    /// Slab capacity multiplier per connection. Defaults to 4 to accommodate
2360    /// H2 multiplexing (1 frontend + up to 3 backend connections per
2361    /// frontend). Operators with topologies that fan out across more clusters
2362    /// per session can raise this; the slab capacity is computed as
2363    /// `10 + slab_entries_per_connection * max_connections`. Clamped to
2364    /// \[2, 32\] at config-load time. The previous compile-time constant was
2365    /// 4 and remains the default.
2366    #[prost(uint64, optional, tag = "20")]
2367    pub slab_entries_per_connection: ::core::option::Option<u64>,
2368    /// Maximum length, in bytes, of a base64-decoded `Authorization: Basic`
2369    /// payload accepted by `mux::auth`. Caps the per-failed-auth allocation
2370    /// so a hostile peer cannot force the worker to decode arbitrarily
2371    /// large tokens. RFC 7617 imposes no upper bound; the default is 4096
2372    /// (well above the realistic shape `username:password`). Operators on
2373    /// tight memory budgets can lower this to 256-512; values that approach
2374    /// the per-frontend `buffer_size` raise a warning at config-load time
2375    /// (see config.rs validation). Set once at worker boot via
2376    /// `mux::auth::set_max_decoded_credential_bytes`.
2377    #[prost(uint64, optional, tag = "21")]
2378    pub basic_auth_max_credential_bytes: ::core::option::Option<u64>,
2379    /// when the accept queue is full (max_connections reached), evict the
2380    /// least recently active sessions to make room for new connections.
2381    /// Defaults to false: during DDoS, existing connections are likely real clients.
2382    #[prost(bool, optional, tag = "22", default = "false")]
2383    pub evict_on_queue_full: ::core::option::Option<bool>,
2384    /// Default per-(cluster, source-IP) connection limit. `0` means unlimited
2385    /// (the default). When a request resolves to a cluster whose
2386    /// `(cluster_id, client_ip)` already holds this many concurrent
2387    /// connections, the proxy answers HTTP 429 (H1 + H2) or closes the TCP
2388    /// socket gracefully. Each cluster may override with its own
2389    /// `max_connections_per_ip`. The source IP is the proxy-protocol
2390    /// address when present, else `peer_addr`.
2391    #[prost(uint64, optional, tag = "23", default = "0")]
2392    pub max_connections_per_ip: ::core::option::Option<u64>,
2393    /// Default `Retry-After` header value (seconds) sent on HTTP 429
2394    /// responses. `0` omits the header (rendering `Retry-After: 0` invites
2395    /// an immediate retry that defeats the limit). Per-cluster overrides
2396    /// are available on the `Cluster` message. TCP rejections do not emit
2397    /// this value (no HTTP envelope), but it is still accepted in the
2398    /// proto/config shape for symmetry.
2399    #[prost(uint32, optional, tag = "24", default = "60")]
2400    pub retry_after: ::core::option::Option<u32>,
2401    /// Requested kernel-pipe capacity, in bytes, for each `splice(2)`
2402    /// zero-copy direction in the `Pipe` protocol. Applied via
2403    /// `fcntl(F_SETPIPE_SZ)` per pipe at `SplicePipe::new`; the kernel
2404    /// rounds up to a page boundary and caps the value at
2405    /// `/proc/sys/fs/pipe-max-size` (default 1 MiB for unprivileged
2406    /// processes; CAP_SYS_RESOURCE goes higher). The realised capacity
2407    /// is read back via `fcntl(F_GETPIPE_SZ)` and used as the per-call
2408    /// `len` for `splice_in`. `None` keeps the kernel default of 64 KiB.
2409    /// Larger values amortise syscalls and reduce wakeups for bulk-
2410    /// transfer workloads at the cost of per-session pinned memory.
2411    /// Linux-only; ignored on builds without the `splice` feature.
2412    #[prost(uint64, optional, tag = "25")]
2413    pub splice_pipe_capacity_bytes: ::core::option::Option<u64>,
2414}
2415/// Addresses of listeners, passed to new workers
2416#[derive(::serde::Serialize, ::serde::Deserialize)]
2417#[derive(Ord, PartialOrd)]
2418#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2419pub struct ListenersCount {
2420    /// socket addresses of HTTP listeners
2421    #[prost(string, repeated, tag = "1")]
2422    pub http: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
2423    /// socket addresses of HTTPS listeners
2424    #[prost(string, repeated, tag = "2")]
2425    pub tls: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
2426    /// socket addresses of TCP listeners
2427    #[prost(string, repeated, tag = "3")]
2428    pub tcp: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
2429    /// socket addresses of UDP listeners
2430    #[prost(string, repeated, tag = "4")]
2431    pub udp: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
2432}
2433/// the Sōzu state, passed to a new worker.
2434/// Consists in a collection of worker requests
2435#[derive(::serde::Serialize, ::serde::Deserialize)]
2436#[derive(Ord, PartialOrd)]
2437#[derive(Hash, Eq)]
2438#[derive(Clone, PartialEq, ::prost::Message)]
2439pub struct InitialState {
2440    #[prost(message, repeated, tag = "1")]
2441    pub requests: ::prost::alloc::vec::Vec<WorkerRequest>,
2442}
2443#[derive(::serde::Serialize, ::serde::Deserialize)]
2444#[derive(Ord, PartialOrd)]
2445#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2446pub struct OpenTelemetry {
2447    #[prost(string, required, tag = "1")]
2448    pub trace_id: ::prost::alloc::string::String,
2449    #[prost(string, required, tag = "2")]
2450    pub span_id: ::prost::alloc::string::String,
2451    #[prost(string, optional, tag = "3")]
2452    pub parent_span_id: ::core::option::Option<::prost::alloc::string::String>,
2453}
2454/// An access log, meant to be passed to another agent
2455#[derive(::serde::Serialize, ::serde::Deserialize)]
2456#[derive(Ord, PartialOrd)]
2457#[derive(Hash, Eq)]
2458#[derive(Clone, PartialEq, ::prost::Message)]
2459pub struct ProtobufAccessLog {
2460    /// error message if any
2461    #[prost(string, optional, tag = "1")]
2462    pub message: ::core::option::Option<::prost::alloc::string::String>,
2463    /// LogContext = request_id + cluster_id + backend_id
2464    #[prost(message, required, tag = "2")]
2465    pub request_id: Uint128,
2466    /// id of the cluster (set of frontend, backend, routing rules)
2467    #[prost(string, optional, tag = "3")]
2468    pub cluster_id: ::core::option::Option<::prost::alloc::string::String>,
2469    /// id of the backend (the server to which the traffic is redirected)
2470    #[prost(string, optional, tag = "4")]
2471    pub backend_id: ::core::option::Option<::prost::alloc::string::String>,
2472    /// ip and port of the client
2473    #[prost(message, optional, tag = "5")]
2474    pub session_address: ::core::option::Option<SocketAddress>,
2475    /// socket address of the backend server
2476    #[prost(message, optional, tag = "6")]
2477    pub backend_address: ::core::option::Option<SocketAddress>,
2478    /// the protocol, with SSL/TLS version, for instance "HTTPS-TLS1.1"
2479    #[prost(string, required, tag = "7")]
2480    pub protocol: ::prost::alloc::string::String,
2481    /// TCP or HTTP endpoint (method, path, context...)
2482    #[prost(message, required, tag = "8")]
2483    pub endpoint: ProtobufEndpoint,
2484    /// round trip time for the client (microseconds)
2485    #[prost(uint64, optional, tag = "9")]
2486    pub client_rtt: ::core::option::Option<u64>,
2487    /// round trip time for the backend (microseconds)
2488    #[prost(uint64, optional, tag = "10")]
2489    pub server_rtt: ::core::option::Option<u64>,
2490    /// time spent on a session (microseconds)
2491    #[prost(uint64, required, tag = "13")]
2492    pub service_time: u64,
2493    /// number of bytes received from the client
2494    #[prost(uint64, required, tag = "14")]
2495    pub bytes_in: u64,
2496    /// number of bytes written to the client
2497    #[prost(uint64, required, tag = "15")]
2498    pub bytes_out: u64,
2499    /// value of the User-Agent header, if any
2500    #[prost(string, optional, tag = "16")]
2501    pub user_agent: ::core::option::Option<::prost::alloc::string::String>,
2502    /// custom tags as key-values, for instance owner_id: MyOrganisation
2503    #[prost(btree_map = "string, string", tag = "17")]
2504    pub tags: ::prost::alloc::collections::BTreeMap<
2505        ::prost::alloc::string::String,
2506        ::prost::alloc::string::String,
2507    >,
2508    /// short description of which process sends the log, for instance: "WRK-02"
2509    #[prost(string, required, tag = "18")]
2510    pub tag: ::prost::alloc::string::String,
2511    /// POSIX timestamp, nanoseconds
2512    #[prost(message, required, tag = "19")]
2513    pub time: Uint128,
2514    /// Entire time between first byte received and last byte of the response.
2515    /// If a request ends abruptly before the last byte is transmitted,
2516    /// the `request_time` produced is the time elapsed since the first byte received.
2517    #[prost(uint64, optional, tag = "20")]
2518    pub request_time: ::core::option::Option<u64>,
2519    /// time for the backend to respond (microseconds)
2520    #[prost(uint64, optional, tag = "21")]
2521    pub response_time: ::core::option::Option<u64>,
2522    /// OpenTelemetry tracing information
2523    #[prost(message, optional, tag = "22")]
2524    pub otel: ::core::option::Option<OpenTelemetry>,
2525    /// connection/session ULID — stable across all requests multiplexed on the
2526    /// same TCP or TLS connection. Distinct from `request_id`, which is set
2527    /// per-request (one per H2 stream, one per H1 keep-alive exchange).
2528    #[prost(message, optional, tag = "23")]
2529    pub session_id: ::core::option::Option<Uint128>,
2530    /// Value of the `x-request-id` header as forwarded to the backend —
2531    /// either preserved verbatim from the client/upstream LB, or derived from
2532    /// the request ULID when the client did not supply one. Universal
2533    /// correlation key for end-to-end tracing across Envoy/HAProxy/Sōzu hops.
2534    #[prost(string, optional, tag = "24")]
2535    pub x_request_id: ::core::option::Option<::prost::alloc::string::String>,
2536    /// Negotiated TLS protocol version, short-form (e.g. "TLSv1.3"). Captured
2537    /// once at handshake completion. `None` for plaintext listeners or when
2538    /// the rustls version label is unknown to Sōzu.
2539    #[prost(string, optional, tag = "25")]
2540    pub tls_version: ::core::option::Option<::prost::alloc::string::String>,
2541    /// Negotiated TLS cipher suite, short-form (e.g.
2542    /// "TLS_AES_128_GCM_SHA256"). Captured once at handshake completion.
2543    /// `None` for plaintext listeners or when the rustls cipher label is
2544    /// unknown to Sōzu.
2545    #[prost(string, optional, tag = "26")]
2546    pub tls_cipher: ::core::option::Option<::prost::alloc::string::String>,
2547    /// TLS Server Name Indication (SNI) sent by the client at handshake.
2548    /// Stored pre-lowercased without a port. `None` for plaintext listeners
2549    /// or when the client omitted the SNI extension.
2550    #[prost(string, optional, tag = "27")]
2551    pub tls_sni: ::core::option::Option<::prost::alloc::string::String>,
2552    /// Negotiated ALPN protocol, short-form (e.g. "h2", "http/1.1"). `None`
2553    /// for plaintext listeners or when no ALPN was negotiated.
2554    #[prost(string, optional, tag = "28")]
2555    pub tls_alpn: ::core::option::Option<::prost::alloc::string::String>,
2556    /// Verbatim value of the client-supplied `X-Forwarded-For` header as
2557    /// observed before Sōzu appended its own hop. Comma-separated chain of
2558    /// proxy hops (e.g. `"203.0.113.5, 198.51.100.10"`). `None` if no
2559    /// upstream proxy supplied the header.
2560    #[prost(string, optional, tag = "29")]
2561    pub xff_chain: ::core::option::Option<::prost::alloc::string::String>,
2562    /// Wall-clock timestamp (POSIX nanoseconds since epoch) captured at the
2563    /// start of the request. Enables accurate OTel span reconstruction
2564    /// without subtracting a monotonic `request_time` duration from the
2565    /// wall-clock `time` field — a computation that mixes two unsynchronised
2566    /// clock sources (CLOCK_MONOTONIC vs CLOCK_REALTIME) and produces
2567    /// unreliable start timestamps, especially for short-lived requests or
2568    /// across NTP adjustments. Optional for backwards compatibility.
2569    #[prost(message, optional, tag = "30")]
2570    pub start_time: ::core::option::Option<Uint128>,
2571}
2572#[derive(::serde::Serialize, ::serde::Deserialize)]
2573#[derive(Ord, PartialOrd)]
2574#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2575pub struct ProtobufEndpoint {
2576    #[prost(oneof = "protobuf_endpoint::Inner", tags = "1, 2")]
2577    pub inner: ::core::option::Option<protobuf_endpoint::Inner>,
2578}
2579/// Nested message and enum types in `ProtobufEndpoint`.
2580pub mod protobuf_endpoint {
2581    #[derive(::serde::Serialize, ::serde::Deserialize)]
2582    #[serde(rename_all = "SCREAMING_SNAKE_CASE")]
2583    #[derive(Ord, PartialOrd)]
2584    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
2585    pub enum Inner {
2586        #[prost(message, tag = "1")]
2587        Http(super::HttpEndpoint),
2588        #[prost(message, tag = "2")]
2589        Tcp(super::TcpEndpoint),
2590    }
2591}
2592#[derive(::serde::Serialize, ::serde::Deserialize)]
2593#[derive(Ord, PartialOrd)]
2594#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2595pub struct HttpEndpoint {
2596    #[prost(string, optional, tag = "1")]
2597    pub method: ::core::option::Option<::prost::alloc::string::String>,
2598    #[prost(string, optional, tag = "2")]
2599    pub authority: ::core::option::Option<::prost::alloc::string::String>,
2600    #[prost(string, optional, tag = "3")]
2601    pub path: ::core::option::Option<::prost::alloc::string::String>,
2602    /// warning: this should be a u16 but protobuf only has uint32.
2603    /// Make sure the value never exceeds u16 bounds.
2604    #[prost(uint32, optional, tag = "4")]
2605    pub status: ::core::option::Option<u32>,
2606    #[prost(string, optional, tag = "5")]
2607    pub reason: ::core::option::Option<::prost::alloc::string::String>,
2608}
2609#[derive(::serde::Serialize, ::serde::Deserialize)]
2610#[derive(Ord, PartialOrd)]
2611#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
2612pub struct TcpEndpoint {}
2613#[derive(::serde::Serialize, ::serde::Deserialize)]
2614#[serde(rename_all = "SCREAMING_SNAKE_CASE")]
2615#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
2616#[repr(i32)]
2617pub enum ListenerType {
2618    Http = 0,
2619    Https = 1,
2620    Tcp = 2,
2621    Udp = 3,
2622}
2623impl ListenerType {
2624    /// String value of the enum field names used in the ProtoBuf definition.
2625    ///
2626    /// The values are not transformed in any way and thus are considered stable
2627    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
2628    pub fn as_str_name(&self) -> &'static str {
2629        match self {
2630            Self::Http => "HTTP",
2631            Self::Https => "HTTPS",
2632            Self::Tcp => "TCP",
2633            Self::Udp => "UDP",
2634        }
2635    }
2636    /// Creates an enum from field names used in the ProtoBuf definition.
2637    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2638        match value {
2639            "HTTP" => Some(Self::Http),
2640            "HTTPS" => Some(Self::Https),
2641            "TCP" => Some(Self::Tcp),
2642            "UDP" => Some(Self::Udp),
2643            _ => None,
2644        }
2645    }
2646}
2647/// Frontend-level redirect policy. Mirrors HAProxy's
2648/// `http-request redirect|deny|auth` directives.
2649/// FORWARD routes to the backend (default).
2650/// PERMANENT returns 301 with a `Location` header derived from
2651/// `redirect_scheme`, optional `rewrite_*` fields, and `cluster.https_redirect_port`.
2652/// FOUND returns 302 — a temporary redirect (RFC 9110 §15.4.3); user agents may
2653/// rewrite POST to GET on follow.
2654/// PERMANENT_REDIRECT returns 308 — a permanent redirect (RFC 9110 §15.4.9); the
2655/// HTTP method MUST be preserved on follow (no GET-rewrite on POST).
2656/// UNAUTHORIZED returns 401 with `WWW-Authenticate: Basic realm=...`
2657/// using `cluster.www_authenticate`; suitable for blanket deny-by-default
2658/// routes that still want to surface a login prompt.
2659#[derive(::serde::Serialize, ::serde::Deserialize)]
2660#[serde(rename_all = "SCREAMING_SNAKE_CASE")]
2661#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
2662#[repr(i32)]
2663pub enum RedirectPolicy {
2664    Forward = 0,
2665    Permanent = 1,
2666    Unauthorized = 2,
2667    Found = 3,
2668    PermanentRedirect = 4,
2669}
2670impl RedirectPolicy {
2671    /// String value of the enum field names used in the ProtoBuf definition.
2672    ///
2673    /// The values are not transformed in any way and thus are considered stable
2674    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
2675    pub fn as_str_name(&self) -> &'static str {
2676        match self {
2677            Self::Forward => "FORWARD",
2678            Self::Permanent => "PERMANENT",
2679            Self::Unauthorized => "UNAUTHORIZED",
2680            Self::Found => "FOUND",
2681            Self::PermanentRedirect => "PERMANENT_REDIRECT",
2682        }
2683    }
2684    /// Creates an enum from field names used in the ProtoBuf definition.
2685    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2686        match value {
2687            "FORWARD" => Some(Self::Forward),
2688            "PERMANENT" => Some(Self::Permanent),
2689            "UNAUTHORIZED" => Some(Self::Unauthorized),
2690            "FOUND" => Some(Self::Found),
2691            "PERMANENT_REDIRECT" => Some(Self::PermanentRedirect),
2692            _ => None,
2693        }
2694    }
2695}
2696/// Scheme to use when building the `Location` header for a permanent redirect.
2697/// USE_SAME preserves the request scheme (default), USE_HTTP forces `<http://`,>
2698/// USE_HTTPS forces `<https://`.>
2699#[derive(::serde::Serialize, ::serde::Deserialize)]
2700#[serde(rename_all = "SCREAMING_SNAKE_CASE")]
2701#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
2702#[repr(i32)]
2703pub enum RedirectScheme {
2704    UseSame = 0,
2705    UseHttp = 1,
2706    UseHttps = 2,
2707}
2708impl RedirectScheme {
2709    /// String value of the enum field names used in the ProtoBuf definition.
2710    ///
2711    /// The values are not transformed in any way and thus are considered stable
2712    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
2713    pub fn as_str_name(&self) -> &'static str {
2714        match self {
2715            Self::UseSame => "USE_SAME",
2716            Self::UseHttp => "USE_HTTP",
2717            Self::UseHttps => "USE_HTTPS",
2718        }
2719    }
2720    /// Creates an enum from field names used in the ProtoBuf definition.
2721    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2722        match value {
2723            "USE_SAME" => Some(Self::UseSame),
2724            "USE_HTTP" => Some(Self::UseHttp),
2725            "USE_HTTPS" => Some(Self::UseHttps),
2726            _ => None,
2727        }
2728    }
2729}
2730/// Where a `Header` mutation applies. `BOTH` applies the same edit on the
2731/// request side (before backend connect) and the response side (before kawa
2732/// preparation). Mirrors HAProxy `http-request set-header` /
2733/// `http-response set-header` parity.
2734#[derive(::serde::Serialize, ::serde::Deserialize)]
2735#[serde(rename_all = "SCREAMING_SNAKE_CASE")]
2736#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
2737#[repr(i32)]
2738pub enum HeaderPosition {
2739    /// Reserve 0 for the proto-default-encoded shape so a `Header` written
2740    /// by `..Default::default()` (or by an older client) deserialises into
2741    /// an explicit "unset" rather than failing `HeaderPosition::try_from(0)`.
2742    /// The runtime treats this as a hard config error and rejects the
2743    /// header rather than guessing a position.
2744    Unspecified = 0,
2745    Request = 1,
2746    Response = 2,
2747    Both = 3,
2748}
2749impl HeaderPosition {
2750    /// String value of the enum field names used in the ProtoBuf definition.
2751    ///
2752    /// The values are not transformed in any way and thus are considered stable
2753    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
2754    pub fn as_str_name(&self) -> &'static str {
2755        match self {
2756            Self::Unspecified => "HEADER_POSITION_UNSPECIFIED",
2757            Self::Request => "REQUEST",
2758            Self::Response => "RESPONSE",
2759            Self::Both => "BOTH",
2760        }
2761    }
2762    /// Creates an enum from field names used in the ProtoBuf definition.
2763    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2764        match value {
2765            "HEADER_POSITION_UNSPECIFIED" => Some(Self::Unspecified),
2766            "REQUEST" => Some(Self::Request),
2767            "RESPONSE" => Some(Self::Response),
2768            "BOTH" => Some(Self::Both),
2769            _ => None,
2770        }
2771    }
2772}
2773/// The kind of filter used for path rules
2774#[derive(::serde::Serialize, ::serde::Deserialize)]
2775#[serde(rename_all = "SCREAMING_SNAKE_CASE")]
2776#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
2777#[repr(i32)]
2778pub enum PathRuleKind {
2779    /// filters paths that start with a pattern, typically "/api"
2780    Prefix = 0,
2781    /// filters paths that match a regex pattern
2782    Regex = 1,
2783    /// filters paths that exactly match a pattern, no more, no less
2784    Equals = 2,
2785}
2786impl PathRuleKind {
2787    /// String value of the enum field names used in the ProtoBuf definition.
2788    ///
2789    /// The values are not transformed in any way and thus are considered stable
2790    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
2791    pub fn as_str_name(&self) -> &'static str {
2792        match self {
2793            Self::Prefix => "PREFIX",
2794            Self::Regex => "REGEX",
2795            Self::Equals => "EQUALS",
2796        }
2797    }
2798    /// Creates an enum from field names used in the ProtoBuf definition.
2799    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2800        match value {
2801            "PREFIX" => Some(Self::Prefix),
2802            "REGEX" => Some(Self::Regex),
2803            "EQUALS" => Some(Self::Equals),
2804            _ => None,
2805        }
2806    }
2807}
2808/// TODO: find a proper definition for this
2809#[derive(::serde::Serialize, ::serde::Deserialize)]
2810#[serde(rename_all = "SCREAMING_SNAKE_CASE")]
2811#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
2812#[repr(i32)]
2813pub enum RulePosition {
2814    Pre = 0,
2815    Post = 1,
2816    Tree = 2,
2817}
2818impl RulePosition {
2819    /// String value of the enum field names used in the ProtoBuf definition.
2820    ///
2821    /// The values are not transformed in any way and thus are considered stable
2822    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
2823    pub fn as_str_name(&self) -> &'static str {
2824        match self {
2825            Self::Pre => "PRE",
2826            Self::Post => "POST",
2827            Self::Tree => "TREE",
2828        }
2829    }
2830    /// Creates an enum from field names used in the ProtoBuf definition.
2831    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2832        match value {
2833            "PRE" => Some(Self::Pre),
2834            "POST" => Some(Self::Post),
2835            "TREE" => Some(Self::Tree),
2836            _ => None,
2837        }
2838    }
2839}
2840#[derive(::serde::Serialize, ::serde::Deserialize)]
2841#[serde(rename_all = "SCREAMING_SNAKE_CASE")]
2842#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
2843#[repr(i32)]
2844pub enum TlsVersion {
2845    SslV2 = 0,
2846    SslV3 = 1,
2847    TlsV10 = 2,
2848    TlsV11 = 3,
2849    TlsV12 = 4,
2850    TlsV13 = 5,
2851}
2852impl TlsVersion {
2853    /// String value of the enum field names used in the ProtoBuf definition.
2854    ///
2855    /// The values are not transformed in any way and thus are considered stable
2856    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
2857    pub fn as_str_name(&self) -> &'static str {
2858        match self {
2859            Self::SslV2 => "SSL_V2",
2860            Self::SslV3 => "SSL_V3",
2861            Self::TlsV10 => "TLS_V1_0",
2862            Self::TlsV11 => "TLS_V1_1",
2863            Self::TlsV12 => "TLS_V1_2",
2864            Self::TlsV13 => "TLS_V1_3",
2865        }
2866    }
2867    /// Creates an enum from field names used in the ProtoBuf definition.
2868    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2869        match value {
2870            "SSL_V2" => Some(Self::SslV2),
2871            "SSL_V3" => Some(Self::SslV3),
2872            "TLS_V1_0" => Some(Self::TlsV10),
2873            "TLS_V1_1" => Some(Self::TlsV11),
2874            "TLS_V1_2" => Some(Self::TlsV12),
2875            "TLS_V1_3" => Some(Self::TlsV13),
2876            _ => None,
2877        }
2878    }
2879}
2880/// How a UDP flow is keyed for backend affinity. SOURCE_IP keys on the
2881/// client source IP only (all ports from one client pin to one backend);
2882/// SOURCE_IP_PORT keys on the full 2-tuple (per-socket affinity).
2883#[derive(::serde::Serialize, ::serde::Deserialize)]
2884#[serde(rename_all = "SCREAMING_SNAKE_CASE")]
2885#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
2886#[repr(i32)]
2887pub enum UdpAffinityKey {
2888    SourceIp = 0,
2889    SourceIpPort = 1,
2890}
2891impl UdpAffinityKey {
2892    /// String value of the enum field names used in the ProtoBuf definition.
2893    ///
2894    /// The values are not transformed in any way and thus are considered stable
2895    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
2896    pub fn as_str_name(&self) -> &'static str {
2897        match self {
2898            Self::SourceIp => "SOURCE_IP",
2899            Self::SourceIpPort => "SOURCE_IP_PORT",
2900        }
2901    }
2902    /// Creates an enum from field names used in the ProtoBuf definition.
2903    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2904        match value {
2905            "SOURCE_IP" => Some(Self::SourceIp),
2906            "SOURCE_IP_PORT" => Some(Self::SourceIpPort),
2907            _ => None,
2908        }
2909    }
2910}
2911/// UDP backend health probe mode. HEALTH_OFF disables health checking;
2912/// TCP_PROBE opens a non-blocking TCP connection to a companion port;
2913/// UDP_PROBE sends an application datagram and waits for any reply.
2914#[derive(::serde::Serialize, ::serde::Deserialize)]
2915#[serde(rename_all = "SCREAMING_SNAKE_CASE")]
2916#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
2917#[repr(i32)]
2918pub enum UdpHealthMode {
2919    HealthOff = 0,
2920    TcpProbe = 1,
2921    UdpProbe = 2,
2922}
2923impl UdpHealthMode {
2924    /// String value of the enum field names used in the ProtoBuf definition.
2925    ///
2926    /// The values are not transformed in any way and thus are considered stable
2927    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
2928    pub fn as_str_name(&self) -> &'static str {
2929        match self {
2930            Self::HealthOff => "HEALTH_OFF",
2931            Self::TcpProbe => "TCP_PROBE",
2932            Self::UdpProbe => "UDP_PROBE",
2933        }
2934    }
2935    /// Creates an enum from field names used in the ProtoBuf definition.
2936    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2937        match value {
2938            "HEALTH_OFF" => Some(Self::HealthOff),
2939            "TCP_PROBE" => Some(Self::TcpProbe),
2940            "UDP_PROBE" => Some(Self::UdpProbe),
2941            _ => None,
2942        }
2943    }
2944}
2945#[derive(::serde::Serialize, ::serde::Deserialize)]
2946#[serde(rename_all = "SCREAMING_SNAKE_CASE")]
2947#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
2948#[repr(i32)]
2949pub enum LoadBalancingAlgorithms {
2950    RoundRobin = 0,
2951    Random = 1,
2952    LeastLoaded = 2,
2953    PowerOfTwo = 3,
2954    /// Highest-Random-Weight / rendezvous hashing — flow-affine backend
2955    /// selection for UDP. Maps a 4-tuple flow key to a backend that survives
2956    /// minimal disruption on backend add/remove.
2957    Hrw = 4,
2958    /// Maglev consistent hashing — precomputed lookup table for even, stable
2959    /// backend distribution across the flow keyspace.
2960    Maglev = 5,
2961}
2962impl LoadBalancingAlgorithms {
2963    /// String value of the enum field names used in the ProtoBuf definition.
2964    ///
2965    /// The values are not transformed in any way and thus are considered stable
2966    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
2967    pub fn as_str_name(&self) -> &'static str {
2968        match self {
2969            Self::RoundRobin => "ROUND_ROBIN",
2970            Self::Random => "RANDOM",
2971            Self::LeastLoaded => "LEAST_LOADED",
2972            Self::PowerOfTwo => "POWER_OF_TWO",
2973            Self::Hrw => "HRW",
2974            Self::Maglev => "MAGLEV",
2975        }
2976    }
2977    /// Creates an enum from field names used in the ProtoBuf definition.
2978    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2979        match value {
2980            "ROUND_ROBIN" => Some(Self::RoundRobin),
2981            "RANDOM" => Some(Self::Random),
2982            "LEAST_LOADED" => Some(Self::LeastLoaded),
2983            "POWER_OF_TWO" => Some(Self::PowerOfTwo),
2984            "HRW" => Some(Self::Hrw),
2985            "MAGLEV" => Some(Self::Maglev),
2986            _ => None,
2987        }
2988    }
2989}
2990#[derive(::serde::Serialize, ::serde::Deserialize)]
2991#[serde(rename_all = "SCREAMING_SNAKE_CASE")]
2992#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
2993#[repr(i32)]
2994pub enum ProxyProtocolConfig {
2995    ExpectHeader = 0,
2996    SendHeader = 1,
2997    RelayHeader = 2,
2998}
2999impl ProxyProtocolConfig {
3000    /// String value of the enum field names used in the ProtoBuf definition.
3001    ///
3002    /// The values are not transformed in any way and thus are considered stable
3003    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
3004    pub fn as_str_name(&self) -> &'static str {
3005        match self {
3006            Self::ExpectHeader => "EXPECT_HEADER",
3007            Self::SendHeader => "SEND_HEADER",
3008            Self::RelayHeader => "RELAY_HEADER",
3009        }
3010    }
3011    /// Creates an enum from field names used in the ProtoBuf definition.
3012    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
3013        match value {
3014            "EXPECT_HEADER" => Some(Self::ExpectHeader),
3015            "SEND_HEADER" => Some(Self::SendHeader),
3016            "RELAY_HEADER" => Some(Self::RelayHeader),
3017            _ => None,
3018        }
3019    }
3020}
3021/// how sozu measures which backend is less loaded
3022#[derive(::serde::Serialize, ::serde::Deserialize)]
3023#[serde(rename_all = "SCREAMING_SNAKE_CASE")]
3024#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
3025#[repr(i32)]
3026pub enum LoadMetric {
3027    /// number of TCP connections
3028    Connections = 0,
3029    /// number of active HTTP requests
3030    Requests = 1,
3031    /// time to connect to the backend, weighted by the number of active connections (peak EWMA)
3032    ConnectionTime = 2,
3033}
3034impl LoadMetric {
3035    /// String value of the enum field names used in the ProtoBuf definition.
3036    ///
3037    /// The values are not transformed in any way and thus are considered stable
3038    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
3039    pub fn as_str_name(&self) -> &'static str {
3040        match self {
3041            Self::Connections => "CONNECTIONS",
3042            Self::Requests => "REQUESTS",
3043            Self::ConnectionTime => "CONNECTION_TIME",
3044        }
3045    }
3046    /// Creates an enum from field names used in the ProtoBuf definition.
3047    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
3048        match value {
3049            "CONNECTIONS" => Some(Self::Connections),
3050            "REQUESTS" => Some(Self::Requests),
3051            "CONNECTION_TIME" => Some(Self::ConnectionTime),
3052            _ => None,
3053        }
3054    }
3055}
3056/// options to configure metrics collection
3057#[derive(::serde::Serialize, ::serde::Deserialize)]
3058#[serde(rename_all = "SCREAMING_SNAKE_CASE")]
3059#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
3060#[repr(i32)]
3061pub enum MetricsConfiguration {
3062    /// enable metrics collection
3063    Enabled = 0,
3064    /// disable metrics collection
3065    Disabled = 1,
3066    /// wipe the metrics memory
3067    Clear = 2,
3068}
3069impl MetricsConfiguration {
3070    /// String value of the enum field names used in the ProtoBuf definition.
3071    ///
3072    /// The values are not transformed in any way and thus are considered stable
3073    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
3074    pub fn as_str_name(&self) -> &'static str {
3075        match self {
3076            Self::Enabled => "ENABLED",
3077            Self::Disabled => "DISABLED",
3078            Self::Clear => "CLEAR",
3079        }
3080    }
3081    /// Creates an enum from field names used in the ProtoBuf definition.
3082    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
3083        match value {
3084            "ENABLED" => Some(Self::Enabled),
3085            "DISABLED" => Some(Self::Disabled),
3086            "CLEAR" => Some(Self::Clear),
3087            _ => None,
3088        }
3089    }
3090}
3091#[derive(::serde::Serialize, ::serde::Deserialize)]
3092#[serde(rename_all = "SCREAMING_SNAKE_CASE")]
3093#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
3094#[repr(i32)]
3095pub enum EventKind {
3096    BackendDown = 0,
3097    BackendUp = 1,
3098    NoAvailableBackends = 2,
3099    RemovedBackendHasNoConnections = 3,
3100    /// Control-plane mutation events (audit trail).
3101    /// Emitted by the main process to clients subscribed via SubscribeEvents.
3102    /// The Event.cluster_id / backend_id / address fields are populated when
3103    /// they are meaningful for the verb (e.g. address for listener verbs,
3104    /// cluster_id for cluster/frontend verbs). Backend events keep their
3105    /// historical numeric tags 0..3.
3106    ClusterAdded = 4,
3107    ClusterRemoved = 5,
3108    FrontendAdded = 6,
3109    FrontendRemoved = 7,
3110    CertificateAdded = 8,
3111    CertificateRemoved = 9,
3112    CertificateReplaced = 10,
3113    ListenerActivated = 11,
3114    ListenerDeactivated = 12,
3115    ConfigurationReloaded = 13,
3116    WorkerKilled = 14,
3117    WorkerRelaunched = 15,
3118    LoggingLevelChanged = 16,
3119    MetricsConfigured = 17,
3120    /// A listener's configuration was patched in place via UpdateHttp/Https/TcpListenerConfig
3121    ListenerUpdated = 18,
3122    /// A saved state file was loaded (batch state replay via LoadState request).
3123    /// Emitted once at task completion; `target=file:<path>` and `result=ok|err`
3124    /// with the ok/err request counts encoded in `target`.
3125    StateLoaded = 19,
3126    /// A snapshot of the current state was written to disk via SaveState.
3127    StateSaved = 20,
3128    /// A new listener was added to the config (AddHttp/Https/TcpListener).
3129    /// Distinct from LISTENER_ACTIVATED (binds the socket) — ADDED just
3130    /// creates the listener's in-memory definition.
3131    ListenerAdded = 21,
3132    /// A listener's in-memory definition was removed (RemoveListener).
3133    /// Distinct from LISTENER_DEACTIVATED (unbinds the socket) — REMOVED
3134    /// drops the whole listener from the state.
3135    ListenerRemoved = 22,
3136    /// A stop request was accepted (SoftStop / HardStop).
3137    /// `target=stop:soft` or `stop:hard` — distinguishes drain-then-stop from
3138    /// immediate-abort on the audit trail.
3139    SozuStopRequested = 23,
3140    /// The main process started a re-exec upgrade (UpgradeMain).
3141    MainUpgraded = 24,
3142    /// A worker was re-launched (UpgradeWorker).
3143    WorkerUpgraded = 25,
3144    /// A client subscribed to the SubscribeEvents bus — privileged because
3145    /// subscribers observe every control-plane mutation.
3146    EventsSubscribed = 26,
3147    /// Backend health-check transitioned to healthy after consecutive successes.
3148    /// Tags 0..3 are the historical backend-state events; 4..26 carry the
3149    /// control-plane mutation events (cluster, frontend, certificate,
3150    /// listener, worker, configuration, metrics, state, stop, upgrade,
3151    /// events). Backend health-check transitions therefore start at 27.
3152    HealthCheckHealthy = 27,
3153    /// Backend health-check transitioned to unhealthy after consecutive failures.
3154    HealthCheckUnhealthy = 28,
3155    /// Cluster transitioned from "all backends down" back to "at least one
3156    /// backend available". Pairs with `NoAvailableBackends` (tag 2) so
3157    /// dashboards can plot per-cluster recovery.
3158    ClusterRecovered = 29,
3159    /// The worker's effective `MetricDetail` changed because a runtime
3160    /// lease was applied, renewed, expired, or cleared. Pairs with
3161    /// `MetricsConfigured` (tag 17) but distinct: that one fires for
3162    /// `MetricsConfiguration` (Enabled/Disabled/Clear), this one fires
3163    /// for cardinality changes.
3164    ///
3165    /// Emitter scope: operator-initiated transitions emit
3166    /// `METRIC_DETAIL_CHANGED` via the master-side audit log (see
3167    /// `bin/src/command/requests.rs` around the `SetMetricDetail`
3168    /// success path). Worker-local transitions — the polled janitor
3169    /// expiring a lease, or a worker-local clear/apply after a master
3170    /// fan-out — are not yet surfaced because the worker has no direct
3171    /// IPC path to the master's audit sink; follow-up tracked separately.
3172    MetricDetailChanged = 30,
3173}
3174impl EventKind {
3175    /// String value of the enum field names used in the ProtoBuf definition.
3176    ///
3177    /// The values are not transformed in any way and thus are considered stable
3178    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
3179    pub fn as_str_name(&self) -> &'static str {
3180        match self {
3181            Self::BackendDown => "BACKEND_DOWN",
3182            Self::BackendUp => "BACKEND_UP",
3183            Self::NoAvailableBackends => "NO_AVAILABLE_BACKENDS",
3184            Self::RemovedBackendHasNoConnections => "REMOVED_BACKEND_HAS_NO_CONNECTIONS",
3185            Self::ClusterAdded => "CLUSTER_ADDED",
3186            Self::ClusterRemoved => "CLUSTER_REMOVED",
3187            Self::FrontendAdded => "FRONTEND_ADDED",
3188            Self::FrontendRemoved => "FRONTEND_REMOVED",
3189            Self::CertificateAdded => "CERTIFICATE_ADDED",
3190            Self::CertificateRemoved => "CERTIFICATE_REMOVED",
3191            Self::CertificateReplaced => "CERTIFICATE_REPLACED",
3192            Self::ListenerActivated => "LISTENER_ACTIVATED",
3193            Self::ListenerDeactivated => "LISTENER_DEACTIVATED",
3194            Self::ConfigurationReloaded => "CONFIGURATION_RELOADED",
3195            Self::WorkerKilled => "WORKER_KILLED",
3196            Self::WorkerRelaunched => "WORKER_RELAUNCHED",
3197            Self::LoggingLevelChanged => "LOGGING_LEVEL_CHANGED",
3198            Self::MetricsConfigured => "METRICS_CONFIGURED",
3199            Self::ListenerUpdated => "LISTENER_UPDATED",
3200            Self::StateLoaded => "STATE_LOADED",
3201            Self::StateSaved => "STATE_SAVED",
3202            Self::ListenerAdded => "LISTENER_ADDED",
3203            Self::ListenerRemoved => "LISTENER_REMOVED",
3204            Self::SozuStopRequested => "SOZU_STOP_REQUESTED",
3205            Self::MainUpgraded => "MAIN_UPGRADED",
3206            Self::WorkerUpgraded => "WORKER_UPGRADED",
3207            Self::EventsSubscribed => "EVENTS_SUBSCRIBED",
3208            Self::HealthCheckHealthy => "HEALTH_CHECK_HEALTHY",
3209            Self::HealthCheckUnhealthy => "HEALTH_CHECK_UNHEALTHY",
3210            Self::ClusterRecovered => "CLUSTER_RECOVERED",
3211            Self::MetricDetailChanged => "METRIC_DETAIL_CHANGED",
3212        }
3213    }
3214    /// Creates an enum from field names used in the ProtoBuf definition.
3215    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
3216        match value {
3217            "BACKEND_DOWN" => Some(Self::BackendDown),
3218            "BACKEND_UP" => Some(Self::BackendUp),
3219            "NO_AVAILABLE_BACKENDS" => Some(Self::NoAvailableBackends),
3220            "REMOVED_BACKEND_HAS_NO_CONNECTIONS" => {
3221                Some(Self::RemovedBackendHasNoConnections)
3222            }
3223            "CLUSTER_ADDED" => Some(Self::ClusterAdded),
3224            "CLUSTER_REMOVED" => Some(Self::ClusterRemoved),
3225            "FRONTEND_ADDED" => Some(Self::FrontendAdded),
3226            "FRONTEND_REMOVED" => Some(Self::FrontendRemoved),
3227            "CERTIFICATE_ADDED" => Some(Self::CertificateAdded),
3228            "CERTIFICATE_REMOVED" => Some(Self::CertificateRemoved),
3229            "CERTIFICATE_REPLACED" => Some(Self::CertificateReplaced),
3230            "LISTENER_ACTIVATED" => Some(Self::ListenerActivated),
3231            "LISTENER_DEACTIVATED" => Some(Self::ListenerDeactivated),
3232            "CONFIGURATION_RELOADED" => Some(Self::ConfigurationReloaded),
3233            "WORKER_KILLED" => Some(Self::WorkerKilled),
3234            "WORKER_RELAUNCHED" => Some(Self::WorkerRelaunched),
3235            "LOGGING_LEVEL_CHANGED" => Some(Self::LoggingLevelChanged),
3236            "METRICS_CONFIGURED" => Some(Self::MetricsConfigured),
3237            "LISTENER_UPDATED" => Some(Self::ListenerUpdated),
3238            "STATE_LOADED" => Some(Self::StateLoaded),
3239            "STATE_SAVED" => Some(Self::StateSaved),
3240            "LISTENER_ADDED" => Some(Self::ListenerAdded),
3241            "LISTENER_REMOVED" => Some(Self::ListenerRemoved),
3242            "SOZU_STOP_REQUESTED" => Some(Self::SozuStopRequested),
3243            "MAIN_UPGRADED" => Some(Self::MainUpgraded),
3244            "WORKER_UPGRADED" => Some(Self::WorkerUpgraded),
3245            "EVENTS_SUBSCRIBED" => Some(Self::EventsSubscribed),
3246            "HEALTH_CHECK_HEALTHY" => Some(Self::HealthCheckHealthy),
3247            "HEALTH_CHECK_UNHEALTHY" => Some(Self::HealthCheckUnhealthy),
3248            "CLUSTER_RECOVERED" => Some(Self::ClusterRecovered),
3249            "METRIC_DETAIL_CHANGED" => Some(Self::MetricDetailChanged),
3250            _ => None,
3251        }
3252    }
3253}
3254#[derive(::serde::Serialize, ::serde::Deserialize)]
3255#[serde(rename_all = "SCREAMING_SNAKE_CASE")]
3256#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
3257#[repr(i32)]
3258pub enum ResponseStatus {
3259    Ok = 0,
3260    Processing = 1,
3261    Failure = 2,
3262}
3263impl ResponseStatus {
3264    /// String value of the enum field names used in the ProtoBuf definition.
3265    ///
3266    /// The values are not transformed in any way and thus are considered stable
3267    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
3268    pub fn as_str_name(&self) -> &'static str {
3269        match self {
3270            Self::Ok => "OK",
3271            Self::Processing => "PROCESSING",
3272            Self::Failure => "FAILURE",
3273        }
3274    }
3275    /// Creates an enum from field names used in the ProtoBuf definition.
3276    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
3277        match value {
3278            "OK" => Some(Self::Ok),
3279            "PROCESSING" => Some(Self::Processing),
3280            "FAILURE" => Some(Self::Failure),
3281            _ => None,
3282        }
3283    }
3284}
3285/// Runstate of a worker
3286#[derive(::serde::Serialize, ::serde::Deserialize)]
3287#[serde(rename_all = "SCREAMING_SNAKE_CASE")]
3288#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
3289#[repr(i32)]
3290pub enum RunState {
3291    Running = 0,
3292    Stopping = 1,
3293    Stopped = 2,
3294    NotAnswering = 3,
3295}
3296impl RunState {
3297    /// String value of the enum field names used in the ProtoBuf definition.
3298    ///
3299    /// The values are not transformed in any way and thus are considered stable
3300    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
3301    pub fn as_str_name(&self) -> &'static str {
3302        match self {
3303            Self::Running => "RUNNING",
3304            Self::Stopping => "STOPPING",
3305            Self::Stopped => "STOPPED",
3306            Self::NotAnswering => "NOT_ANSWERING",
3307        }
3308    }
3309    /// Creates an enum from field names used in the ProtoBuf definition.
3310    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
3311        match value {
3312            "RUNNING" => Some(Self::Running),
3313            "STOPPING" => Some(Self::Stopping),
3314            "STOPPED" => Some(Self::Stopped),
3315            "NOT_ANSWERING" => Some(Self::NotAnswering),
3316            _ => None,
3317        }
3318    }
3319}
3320/// label-cardinality knob for the metrics drain.
3321/// Mirrors HAProxy's `process|frontend|backend|server` extra-counters opt-in:
3322/// a higher level enables more granular labels (and thus more keys), letting
3323/// operators bound the StatsD keyspace explicitly.
3324///
3325/// Each level is a SUPERSET of the previous one.
3326#[derive(::serde::Serialize, ::serde::Deserialize)]
3327#[serde(rename_all = "SCREAMING_SNAKE_CASE")]
3328#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
3329#[repr(i32)]
3330pub enum MetricDetail {
3331    /// proxy-only counters (legacy default before opt-in landed)
3332    DetailProcess = 0,
3333    /// adds per-listener (frontend) breakdown for accept/connection counters
3334    DetailFrontend = 1,
3335    /// adds per-cluster aggregation (current default)
3336    DetailCluster = 2,
3337    /// adds per-backend aggregation (cluster + backend, highest cardinality)
3338    DetailBackend = 3,
3339}
3340impl MetricDetail {
3341    /// String value of the enum field names used in the ProtoBuf definition.
3342    ///
3343    /// The values are not transformed in any way and thus are considered stable
3344    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
3345    pub fn as_str_name(&self) -> &'static str {
3346        match self {
3347            Self::DetailProcess => "DETAIL_PROCESS",
3348            Self::DetailFrontend => "DETAIL_FRONTEND",
3349            Self::DetailCluster => "DETAIL_CLUSTER",
3350            Self::DetailBackend => "DETAIL_BACKEND",
3351        }
3352    }
3353    /// Creates an enum from field names used in the ProtoBuf definition.
3354    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
3355        match value {
3356            "DETAIL_PROCESS" => Some(Self::DetailProcess),
3357            "DETAIL_FRONTEND" => Some(Self::DetailFrontend),
3358            "DETAIL_CLUSTER" => Some(Self::DetailCluster),
3359            "DETAIL_BACKEND" => Some(Self::DetailBackend),
3360            _ => None,
3361        }
3362    }
3363}
3364#[derive(::serde::Serialize, ::serde::Deserialize)]
3365#[serde(rename_all = "SCREAMING_SNAKE_CASE")]
3366#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
3367#[repr(i32)]
3368pub enum ProtobufAccessLogFormat {
3369    Ascii = 1,
3370    Protobuf = 2,
3371}
3372impl ProtobufAccessLogFormat {
3373    /// String value of the enum field names used in the ProtoBuf definition.
3374    ///
3375    /// The values are not transformed in any way and thus are considered stable
3376    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
3377    pub fn as_str_name(&self) -> &'static str {
3378        match self {
3379            Self::Ascii => "Ascii",
3380            Self::Protobuf => "Protobuf",
3381        }
3382    }
3383    /// Creates an enum from field names used in the ProtoBuf definition.
3384    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
3385        match value {
3386            "Ascii" => Some(Self::Ascii),
3387            "Protobuf" => Some(Self::Protobuf),
3388            _ => None,
3389        }
3390    }
3391}