1
2
3
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
32
33
34
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
/// A message received by Sōzu to change its state or query information
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[derive(Hash, Eq, Ord, PartialOrd)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Request {
    #[prost(
        oneof = "request::RequestType",
        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"
    )]
    pub request_type: ::core::option::Option<request::RequestType>,
}
/// Nested message and enum types in `Request`.
pub mod request {
    #[derive(::serde::Serialize, ::serde::Deserialize)]
    #[serde(rename_all = "SCREAMING_SNAKE_CASE")]
    #[derive(Hash, Eq, Ord, PartialOrd)]
    #[allow(clippy::derive_partial_eq_without_eq)]
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum RequestType {
        /// This message tells Sōzu to dump the current proxy state (backends,
        /// front domains, certificates, etc) as a list of JSON-serialized Requests,
        /// separated by a 0 byte, to a file. This file can be used later
        /// to bootstrap the proxy. This message is not forwarded to workers.
        /// If the specified path is relative, it will be calculated relative to the current
        /// working directory of the proxy.
        #[prost(string, tag = "1")]
        SaveState(::prost::alloc::string::String),
        /// load a state file, given its path
        #[prost(string, tag = "2")]
        LoadState(::prost::alloc::string::String),
        /// list the workers and their status
        #[prost(message, tag = "4")]
        ListWorkers(super::ListWorkers),
        /// list the frontends, filtered by protocol and/or domain
        #[prost(message, tag = "5")]
        ListFrontends(super::FrontendFilters),
        /// list all listeners
        #[prost(message, tag = "6")]
        ListListeners(super::ListListeners),
        /// launch a new worker, giving its tag
        #[prost(string, tag = "7")]
        LaunchWorker(::prost::alloc::string::String),
        /// upgrade the main process
        #[prost(message, tag = "8")]
        UpgradeMain(super::UpgradeMain),
        /// upgrade an existing worker, giving its id
        #[prost(uint32, tag = "9")]
        UpgradeWorker(u32),
        /// subscribe to proxy events
        #[prost(message, tag = "10")]
        SubscribeEvents(super::SubscribeEvents),
        /// reload the configuration from the config file, or a new file
        /// CHECK: this used to be an option. None => use the config file, Some(string) => path_to_file
        /// make sure it works using "" and "path_to_file"
        #[prost(string, tag = "11")]
        ReloadConfiguration(::prost::alloc::string::String),
        /// give status of main process and all workers
        #[prost(message, tag = "12")]
        Status(super::Status),
        /// add a cluster
        #[prost(message, tag = "13")]
        AddCluster(super::Cluster),
        /// remove a cluster giving its id
        #[prost(string, tag = "14")]
        RemoveCluster(::prost::alloc::string::String),
        /// add an HTTP frontend
        #[prost(message, tag = "15")]
        AddHttpFrontend(super::RequestHttpFrontend),
        /// remove an HTTP frontend
        #[prost(message, tag = "16")]
        RemoveHttpFrontend(super::RequestHttpFrontend),
        /// add an HTTPS frontend
        #[prost(message, tag = "17")]
        AddHttpsFrontend(super::RequestHttpFrontend),
        /// remove an HTTPS frontend
        #[prost(message, tag = "18")]
        RemoveHttpsFrontend(super::RequestHttpFrontend),
        /// add a certificate
        #[prost(message, tag = "19")]
        AddCertificate(super::AddCertificate),
        /// replace a certificate
        #[prost(message, tag = "20")]
        ReplaceCertificate(super::ReplaceCertificate),
        /// remove a certificate
        #[prost(message, tag = "21")]
        RemoveCertificate(super::RemoveCertificate),
        /// add a TCP frontend
        #[prost(message, tag = "22")]
        AddTcpFrontend(super::RequestTcpFrontend),
        /// remove a TCP frontend
        #[prost(message, tag = "23")]
        RemoveTcpFrontend(super::RequestTcpFrontend),
        /// add a backend
        #[prost(message, tag = "24")]
        AddBackend(super::AddBackend),
        /// remove a backend
        #[prost(message, tag = "25")]
        RemoveBackend(super::RemoveBackend),
        /// add an HTTP listener
        #[prost(message, tag = "26")]
        AddHttpListener(super::HttpListenerConfig),
        /// add an HTTPS listener
        #[prost(message, tag = "27")]
        AddHttpsListener(super::HttpsListenerConfig),
        /// add a TCP listener
        #[prost(message, tag = "28")]
        AddTcpListener(super::TcpListenerConfig),
        /// remove a listener
        #[prost(message, tag = "29")]
        RemoveListener(super::RemoveListener),
        /// activate a listener
        #[prost(message, tag = "30")]
        ActivateListener(super::ActivateListener),
        /// deactivate a listener
        #[prost(message, tag = "31")]
        DeactivateListener(super::DeactivateListener),
        /// query a cluster by id
        #[prost(string, tag = "35")]
        QueryClusterById(::prost::alloc::string::String),
        /// query clusters with a hostname and optional path
        #[prost(message, tag = "36")]
        QueryClustersByDomain(super::QueryClusterByDomain),
        /// query clusters hashes
        #[prost(message, tag = "37")]
        QueryClustersHashes(super::QueryClustersHashes),
        /// query metrics
        #[prost(message, tag = "38")]
        QueryMetrics(super::QueryMetricsOptions),
        /// soft stop
        #[prost(message, tag = "39")]
        SoftStop(super::SoftStop),
        /// hard stop
        #[prost(message, tag = "40")]
        HardStop(super::HardStop),
        /// enable, disable or clear the metrics
        #[prost(enumeration = "super::MetricsConfiguration", tag = "41")]
        ConfigureMetrics(i32),
        /// Change the logging level
        #[prost(string, tag = "42")]
        Logging(::prost::alloc::string::String),
        /// Return the listen sockets
        #[prost(message, tag = "43")]
        ReturnListenSockets(super::ReturnListenSockets),
        /// Get certificates from the state (rather than from the workers)
        #[prost(message, tag = "44")]
        QueryCertificatesFromTheState(super::QueryCertificatesFilters),
        /// Get certificates from the workers (rather than from the state)
        #[prost(message, tag = "45")]
        QueryCertificatesFromWorkers(super::QueryCertificatesFilters),
        /// query the state about how many requests of each type has been received
        /// since startup
        #[prost(message, tag = "46")]
        CountRequests(super::CountRequests),
    }
}
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[derive(Hash, Eq, Ord, PartialOrd)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListWorkers {}
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[derive(Hash, Eq, Ord, PartialOrd)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListListeners {}
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[derive(Hash, Eq, Ord, PartialOrd)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpgradeMain {}
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[derive(Hash, Eq, Ord, PartialOrd)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SubscribeEvents {}
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[derive(Hash, Eq, Ord, PartialOrd)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Status {}
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[derive(Hash, Eq, Ord, PartialOrd)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryClustersHashes {}
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[derive(Hash, Eq, Ord, PartialOrd)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SoftStop {}
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[derive(Hash, Eq, Ord, PartialOrd)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct HardStop {}
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[derive(Hash, Eq, Ord, PartialOrd)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ReturnListenSockets {}
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[derive(Hash, Eq, Ord, PartialOrd)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CountRequests {}
/// details of an HTTP listener
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[derive(Hash, Eq, Ord, PartialOrd)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct HttpListenerConfig {
    #[prost(string, required, tag = "1")]
    pub address: ::prost::alloc::string::String,
    #[prost(string, optional, tag = "2")]
    pub public_address: ::core::option::Option<::prost::alloc::string::String>,
    #[prost(string, required, tag = "3")]
    pub answer_404: ::prost::alloc::string::String,
    #[prost(string, required, tag = "4")]
    pub answer_503: ::prost::alloc::string::String,
    #[prost(bool, required, tag = "5", default = "false")]
    pub expect_proxy: bool,
    #[prost(string, required, tag = "6")]
    pub sticky_name: ::prost::alloc::string::String,
    /// client inactive time, in seconds
    #[prost(uint32, required, tag = "7", default = "60")]
    pub front_timeout: u32,
    /// backend server inactive time, in seconds
    #[prost(uint32, required, tag = "8", default = "30")]
    pub back_timeout: u32,
    /// time to connect to the backend, in seconds
    #[prost(uint32, required, tag = "9", default = "3")]
    pub connect_timeout: u32,
    /// max time to send a complete request, in seconds
    #[prost(uint32, required, tag = "10", default = "10")]
    pub request_timeout: u32,
    /// wether the listener is actively listening on its socket
    #[prost(bool, required, tag = "11", default = "false")]
    pub active: bool,
}
/// details of an HTTPS listener
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[derive(Hash, Eq, Ord, PartialOrd)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct HttpsListenerConfig {
    #[prost(string, required, tag = "1")]
    pub address: ::prost::alloc::string::String,
    #[prost(string, optional, tag = "2")]
    pub public_address: ::core::option::Option<::prost::alloc::string::String>,
    #[prost(string, required, tag = "3")]
    pub answer_404: ::prost::alloc::string::String,
    #[prost(string, required, tag = "4")]
    pub answer_503: ::prost::alloc::string::String,
    #[prost(bool, required, tag = "5", default = "false")]
    pub expect_proxy: bool,
    #[prost(string, required, tag = "6")]
    pub sticky_name: ::prost::alloc::string::String,
    /// client inactive time, in seconds
    #[prost(uint32, required, tag = "7", default = "60")]
    pub front_timeout: u32,
    /// backend server inactive time, in seconds
    #[prost(uint32, required, tag = "8", default = "30")]
    pub back_timeout: u32,
    /// time to connect to the backend, in seconds
    #[prost(uint32, required, tag = "9", default = "3")]
    pub connect_timeout: u32,
    /// max time to send a complete request, in seconds
    #[prost(uint32, required, tag = "10", default = "10")]
    pub request_timeout: u32,
    /// wether the listener is actively listening on its socket
    #[prost(bool, required, tag = "11", default = "false")]
    pub active: bool,
    /// TLS versions
    #[prost(enumeration = "TlsVersion", repeated, packed = "false", tag = "12")]
    pub versions: ::prost::alloc::vec::Vec<i32>,
    #[prost(string, repeated, tag = "13")]
    pub cipher_list: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
    #[prost(string, repeated, tag = "14")]
    pub cipher_suites: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
    #[prost(string, repeated, tag = "15")]
    pub signature_algorithms: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
    #[prost(string, repeated, tag = "16")]
    pub groups_list: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
    #[prost(string, optional, tag = "17")]
    pub certificate: ::core::option::Option<::prost::alloc::string::String>,
    #[prost(string, repeated, tag = "18")]
    pub certificate_chain: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
    #[prost(string, optional, tag = "19")]
    pub key: ::core::option::Option<::prost::alloc::string::String>,
    /// Number of TLS 1.3 tickets to send to a client when establishing a connection.
    /// The tickets allow the client to resume a session. This protects the client
    /// agains session tracking. Defaults to 4.
    #[prost(uint64, required, tag = "20")]
    pub send_tls13_tickets: u64,
}
/// details of an TCP listener
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[derive(Hash, Eq, Ord, PartialOrd)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TcpListenerConfig {
    #[prost(string, required, tag = "1")]
    pub address: ::prost::alloc::string::String,
    #[prost(string, optional, tag = "2")]
    pub public_address: ::core::option::Option<::prost::alloc::string::String>,
    #[prost(bool, required, tag = "3", default = "false")]
    pub expect_proxy: bool,
    /// client inactive time, in seconds
    #[prost(uint32, required, tag = "4", default = "60")]
    pub front_timeout: u32,
    /// backend server inactive time, in seconds
    #[prost(uint32, required, tag = "5", default = "30")]
    pub back_timeout: u32,
    /// time to connect to the backend, in seconds
    #[prost(uint32, required, tag = "6", default = "3")]
    pub connect_timeout: u32,
    /// wether the listener is actively listening on its socket
    #[prost(bool, required, tag = "7", default = "false")]
    pub active: bool,
}
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[derive(Hash, Eq, Ord, PartialOrd)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ActivateListener {
    #[prost(string, required, tag = "1")]
    pub address: ::prost::alloc::string::String,
    #[prost(enumeration = "ListenerType", required, tag = "2")]
    pub proxy: i32,
    #[prost(bool, required, tag = "3")]
    pub from_scm: bool,
}
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[derive(Hash, Eq, Ord, PartialOrd)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeactivateListener {
    #[prost(string, required, tag = "1")]
    pub address: ::prost::alloc::string::String,
    #[prost(enumeration = "ListenerType", required, tag = "2")]
    pub proxy: i32,
    #[prost(bool, required, tag = "3")]
    pub to_scm: bool,
}
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[derive(Hash, Eq, Ord, PartialOrd)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RemoveListener {
    #[prost(string, required, tag = "1")]
    pub address: ::prost::alloc::string::String,
    #[prost(enumeration = "ListenerType", required, tag = "2")]
    pub proxy: i32,
}
/// All listeners, listed
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[derive(Hash, Eq, Ord, PartialOrd)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListenersList {
    /// address -> http listener config
    #[prost(btree_map = "string, message", tag = "1")]
    pub http_listeners: ::prost::alloc::collections::BTreeMap<
        ::prost::alloc::string::String,
        HttpListenerConfig,
    >,
    /// address -> https listener config
    #[prost(btree_map = "string, message", tag = "2")]
    pub https_listeners: ::prost::alloc::collections::BTreeMap<
        ::prost::alloc::string::String,
        HttpsListenerConfig,
    >,
    /// address -> tcp listener config
    #[prost(btree_map = "string, message", tag = "3")]
    pub tcp_listeners: ::prost::alloc::collections::BTreeMap<
        ::prost::alloc::string::String,
        TcpListenerConfig,
    >,
}
/// An HTTP or HTTPS frontend, as order to, or received from, Sōzu
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[derive(Hash, Eq, Ord, PartialOrd)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RequestHttpFrontend {
    #[prost(string, optional, tag = "1")]
    pub cluster_id: ::core::option::Option<::prost::alloc::string::String>,
    #[prost(string, required, tag = "2")]
    pub address: ::prost::alloc::string::String,
    #[prost(string, required, tag = "3")]
    pub hostname: ::prost::alloc::string::String,
    #[prost(message, required, tag = "4")]
    pub path: PathRule,
    #[prost(string, optional, tag = "5")]
    pub method: ::core::option::Option<::prost::alloc::string::String>,
    #[prost(enumeration = "RulePosition", required, tag = "6", default = "Tree")]
    pub position: i32,
    /// custom tags to identify the frontend in the access logs
    #[prost(btree_map = "string, string", tag = "7")]
    pub tags: ::prost::alloc::collections::BTreeMap<
        ::prost::alloc::string::String,
        ::prost::alloc::string::String,
    >,
}
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[derive(Hash, Eq, Ord, PartialOrd)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RequestTcpFrontend {
    #[prost(string, required, tag = "1")]
    pub cluster_id: ::prost::alloc::string::String,
    /// the socket address on which to listen for incoming traffic
    #[prost(string, required, tag = "2")]
    pub address: ::prost::alloc::string::String,
    /// custom tags to identify the frontend in the access logs
    #[prost(btree_map = "string, string", tag = "3")]
    pub tags: ::prost::alloc::collections::BTreeMap<
        ::prost::alloc::string::String,
        ::prost::alloc::string::String,
    >,
}
/// list the frontends, filtered by protocol and/or domain
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[derive(Hash, Eq, Ord, PartialOrd)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FrontendFilters {
    #[prost(bool, required, tag = "1")]
    pub http: bool,
    #[prost(bool, required, tag = "2")]
    pub https: bool,
    #[prost(bool, required, tag = "3")]
    pub tcp: bool,
    #[prost(string, optional, tag = "4")]
    pub domain: ::core::option::Option<::prost::alloc::string::String>,
}
/// A filter for the path of incoming requests
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[derive(Hash, Eq, Ord, PartialOrd)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PathRule {
    /// The kind of filter used for path rules
    #[prost(enumeration = "PathRuleKind", required, tag = "1")]
    pub kind: i32,
    /// the value of the given prefix, regex or equal pathrule
    #[prost(string, required, tag = "2")]
    pub value: ::prost::alloc::string::String,
}
/// Add a new TLS certificate to an HTTPs listener
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[derive(Hash, Eq, Ord, PartialOrd)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AddCertificate {
    #[prost(string, required, tag = "1")]
    pub address: ::prost::alloc::string::String,
    #[prost(message, required, tag = "2")]
    pub certificate: CertificateAndKey,
    /// A unix timestamp. Overrides certificate expiration.
    #[prost(int64, optional, tag = "3")]
    pub expired_at: ::core::option::Option<i64>,
}
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[derive(Hash, Eq, Ord, PartialOrd)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RemoveCertificate {
    #[prost(string, required, tag = "1")]
    pub address: ::prost::alloc::string::String,
    /// a hex-encoded TLS fingerprint to identify the certificate to remove
    #[prost(string, required, tag = "2")]
    pub fingerprint: ::prost::alloc::string::String,
}
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[derive(Hash, Eq, Ord, PartialOrd)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ReplaceCertificate {
    #[prost(string, required, tag = "1")]
    pub address: ::prost::alloc::string::String,
    #[prost(message, required, tag = "2")]
    pub new_certificate: CertificateAndKey,
    /// a hex-encoded TLS fingerprint to identify the old certificate
    #[prost(string, required, tag = "3")]
    pub old_fingerprint: ::prost::alloc::string::String,
    /// A unix timestamp. Overrides certificate expiration.
    #[prost(int64, optional, tag = "4")]
    pub new_expired_at: ::core::option::Option<i64>,
}
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[derive(Hash, Eq, Ord, PartialOrd)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CertificateAndKey {
    #[prost(string, required, tag = "1")]
    pub certificate: ::prost::alloc::string::String,
    #[prost(string, repeated, tag = "2")]
    pub certificate_chain: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
    #[prost(string, required, tag = "3")]
    pub key: ::prost::alloc::string::String,
    #[prost(enumeration = "TlsVersion", repeated, packed = "false", tag = "4")]
    pub versions: ::prost::alloc::vec::Vec<i32>,
    /// hostnames linked to the certificate
    #[prost(string, repeated, tag = "5")]
    pub names: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
/// Should be either a domain name or a fingerprint.
/// These filter do not compound, use either one but not both.
/// If none of them is specified, all certificates will be returned.
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[derive(Hash, Eq, Ord, PartialOrd)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryCertificatesFilters {
    /// a domain name to filter certificate results
    #[prost(string, optional, tag = "1")]
    pub domain: ::core::option::Option<::prost::alloc::string::String>,
    /// a hex-encoded fingerprint of the TLS certificate to find
    #[prost(string, optional, tag = "2")]
    pub fingerprint: ::core::option::Option<::prost::alloc::string::String>,
}
/// domain name and fingerprint of a certificate
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[derive(Hash, Eq, Ord, PartialOrd)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CertificateSummary {
    #[prost(string, required, tag = "1")]
    pub domain: ::prost::alloc::string::String,
    /// a hex-encoded TLS fingerprint
    #[prost(string, required, tag = "2")]
    pub fingerprint: ::prost::alloc::string::String,
}
/// Used by workers to reply to some certificate queries
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[derive(Hash, Eq, Ord, PartialOrd)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListOfCertificatesByAddress {
    #[prost(message, repeated, tag = "1")]
    pub certificates: ::prost::alloc::vec::Vec<CertificatesByAddress>,
}
/// Summaries of certificates for a given address
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[derive(Hash, Eq, Ord, PartialOrd)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CertificatesByAddress {
    #[prost(string, required, tag = "1")]
    pub address: ::prost::alloc::string::String,
    #[prost(message, repeated, tag = "2")]
    pub certificate_summaries: ::prost::alloc::vec::Vec<CertificateSummary>,
}
/// to reply to several certificate queries
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[derive(Hash, Eq, Ord, PartialOrd)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CertificatesWithFingerprints {
    /// a map of fingerprint -> certificate_and_key
    #[prost(btree_map = "string, message", tag = "1")]
    pub certs: ::prost::alloc::collections::BTreeMap<
        ::prost::alloc::string::String,
        CertificateAndKey,
    >,
}
/// A cluster is what binds a frontend to backends with routing rules
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[derive(Hash, Eq, Ord, PartialOrd)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Cluster {
    #[prost(string, required, tag = "1")]
    pub cluster_id: ::prost::alloc::string::String,
    /// wether a connection from a client shall be always redirected to the same backend
    #[prost(bool, required, tag = "2")]
    pub sticky_session: bool,
    #[prost(bool, required, tag = "3")]
    pub https_redirect: bool,
    #[prost(enumeration = "ProxyProtocolConfig", optional, tag = "4")]
    pub proxy_protocol: ::core::option::Option<i32>,
    #[prost(
        enumeration = "LoadBalancingAlgorithms",
        required,
        tag = "5",
        default = "RoundRobin"
    )]
    pub load_balancing: i32,
    #[prost(string, optional, tag = "6")]
    pub answer_503: ::core::option::Option<::prost::alloc::string::String>,
    #[prost(enumeration = "LoadMetric", optional, tag = "7")]
    pub load_metric: ::core::option::Option<i32>,
}
/// add a backend
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[derive(Hash, Eq, Ord, PartialOrd)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AddBackend {
    #[prost(string, required, tag = "1")]
    pub cluster_id: ::prost::alloc::string::String,
    #[prost(string, required, tag = "2")]
    pub backend_id: ::prost::alloc::string::String,
    /// the socket address of the backend
    #[prost(string, required, tag = "3")]
    pub address: ::prost::alloc::string::String,
    #[prost(string, optional, tag = "4")]
    pub sticky_id: ::core::option::Option<::prost::alloc::string::String>,
    #[prost(message, optional, tag = "5")]
    pub load_balancing_parameters: ::core::option::Option<LoadBalancingParams>,
    #[prost(bool, optional, tag = "6")]
    pub backup: ::core::option::Option<bool>,
}
/// remove an existing backend
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[derive(Hash, Eq, Ord, PartialOrd)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RemoveBackend {
    #[prost(string, required, tag = "1")]
    pub cluster_id: ::prost::alloc::string::String,
    #[prost(string, required, tag = "2")]
    pub backend_id: ::prost::alloc::string::String,
    /// the socket address of the backend
    #[prost(string, required, tag = "3")]
    pub address: ::prost::alloc::string::String,
}
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[derive(Hash, Eq, Ord, PartialOrd)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LoadBalancingParams {
    #[prost(int32, required, tag = "1")]
    pub weight: i32,
}
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[derive(Hash, Eq, Ord, PartialOrd)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryClusterByDomain {
    #[prost(string, required, tag = "1")]
    pub hostname: ::prost::alloc::string::String,
    #[prost(string, optional, tag = "2")]
    pub path: ::core::option::Option<::prost::alloc::string::String>,
}
/// Options when querying metrics
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[derive(Hash, Eq, Ord, PartialOrd)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryMetricsOptions {
    /// query a list of available metrics
    #[prost(bool, required, tag = "1")]
    pub list: bool,
    /// query metrics for these clusters
    #[prost(string, repeated, tag = "2")]
    pub cluster_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
    /// query metrics for these backends
    #[prost(string, repeated, tag = "3")]
    pub backend_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
    /// query only these metrics
    #[prost(string, repeated, tag = "4")]
    pub metric_names: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
/// Response to a request
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[derive(Hash, Eq, Ord, PartialOrd)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Response {
    /// wether the request was a success, a failure, or is processing
    #[prost(enumeration = "ResponseStatus", required, tag = "1", default = "Failure")]
    pub status: i32,
    /// a success or error message
    #[prost(string, required, tag = "2")]
    pub message: ::prost::alloc::string::String,
    /// response data, if any
    #[prost(message, optional, tag = "3")]
    pub content: ::core::option::Option<ResponseContent>,
}
/// content of a response
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[derive(Hash, Eq, Ord, PartialOrd)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ResponseContent {
    #[prost(
        oneof = "response_content::ContentType",
        tags = "1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13"
    )]
    pub content_type: ::core::option::Option<response_content::ContentType>,
}
/// Nested message and enum types in `ResponseContent`.
pub mod response_content {
    #[derive(::serde::Serialize, ::serde::Deserialize)]
    #[serde(rename_all = "SCREAMING_SNAKE_CASE")]
    #[derive(Hash, Eq, Ord, PartialOrd)]
    #[allow(clippy::derive_partial_eq_without_eq)]
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum ContentType {
        /// a list of workers, with ids, pids, statuses
        #[prost(message, tag = "1")]
        Workers(super::WorkerInfos),
        /// aggregated metrics of main process and workers
        #[prost(message, tag = "2")]
        Metrics(super::AggregatedMetrics),
        /// a collection of worker responses to the same request
        #[prost(message, tag = "3")]
        WorkerResponses(super::WorkerResponses),
        /// a proxy event
        #[prost(message, tag = "4")]
        Event(super::Event),
        /// a filtered list of frontend
        #[prost(message, tag = "5")]
        FrontendList(super::ListedFrontends),
        /// all listeners
        #[prost(message, tag = "6")]
        ListenersList(super::ListenersList),
        /// contains proxy & cluster metrics
        #[prost(message, tag = "7")]
        WorkerMetrics(super::WorkerMetrics),
        /// Lists of metrics that are available
        #[prost(message, tag = "8")]
        AvailableMetrics(super::AvailableMetrics),
        /// a list of cluster informations
        #[prost(message, tag = "9")]
        Clusters(super::ClusterInformations),
        /// collection of hashes of cluster information,
        #[prost(message, tag = "10")]
        ClusterHashes(super::ClusterHashes),
        /// a list of certificates summaries, grouped by socket address
        #[prost(message, tag = "11")]
        CertificatesByAddress(super::ListOfCertificatesByAddress),
        /// a map of complete certificates using fingerprints as key
        #[prost(message, tag = "12")]
        CertificatesWithFingerprints(super::CertificatesWithFingerprints),
        /// a census of the types of requests received since startup,
        #[prost(message, tag = "13")]
        RequestCounts(super::RequestCounts),
    }
}
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[derive(Hash, Eq, Ord, PartialOrd)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct WorkerResponses {
    #[prost(btree_map = "string, message", tag = "1")]
    pub map: ::prost::alloc::collections::BTreeMap<
        ::prost::alloc::string::String,
        ResponseContent,
    >,
}
/// lists of frontends present in the state
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[derive(Hash, Eq, Ord, PartialOrd)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListedFrontends {
    #[prost(message, repeated, tag = "1")]
    pub http_frontends: ::prost::alloc::vec::Vec<RequestHttpFrontend>,
    #[prost(message, repeated, tag = "2")]
    pub https_frontends: ::prost::alloc::vec::Vec<RequestHttpFrontend>,
    #[prost(message, repeated, tag = "3")]
    pub tcp_frontends: ::prost::alloc::vec::Vec<RequestTcpFrontend>,
}
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[derive(Hash, Eq, Ord, PartialOrd)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ClusterInformations {
    #[prost(message, repeated, tag = "1")]
    pub vec: ::prost::alloc::vec::Vec<ClusterInformation>,
}
/// Information about a given cluster
/// Contains types usually used in requests, because they are readily available in protobuf
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[derive(Hash, Eq, Ord, PartialOrd)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ClusterInformation {
    #[prost(message, optional, tag = "1")]
    pub configuration: ::core::option::Option<Cluster>,
    #[prost(message, repeated, tag = "2")]
    pub http_frontends: ::prost::alloc::vec::Vec<RequestHttpFrontend>,
    #[prost(message, repeated, tag = "3")]
    pub https_frontends: ::prost::alloc::vec::Vec<RequestHttpFrontend>,
    #[prost(message, repeated, tag = "4")]
    pub tcp_frontends: ::prost::alloc::vec::Vec<RequestTcpFrontend>,
    #[prost(message, repeated, tag = "5")]
    pub backends: ::prost::alloc::vec::Vec<AddBackend>,
}
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[derive(Hash, Eq, Ord, PartialOrd)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Event {
    #[prost(enumeration = "EventKind", required, tag = "1")]
    pub kind: i32,
    #[prost(string, optional, tag = "2")]
    pub cluster_id: ::core::option::Option<::prost::alloc::string::String>,
    #[prost(string, optional, tag = "3")]
    pub backend_id: ::core::option::Option<::prost::alloc::string::String>,
    #[prost(string, optional, tag = "4")]
    pub address: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[derive(Hash, Eq, Ord, PartialOrd)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ClusterHashes {
    /// cluster id -> hash of cluster information
    #[prost(btree_map = "string, uint64", tag = "1")]
    pub map: ::prost::alloc::collections::BTreeMap<::prost::alloc::string::String, u64>,
}
/// A list of worker infos
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[derive(Hash, Eq, Ord, PartialOrd)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct WorkerInfos {
    #[prost(message, repeated, tag = "1")]
    pub vec: ::prost::alloc::vec::Vec<WorkerInfo>,
}
/// Information about a worker with id, pid, runstate
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[derive(Hash, Eq, Ord, PartialOrd)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct WorkerInfo {
    #[prost(uint32, required, tag = "1")]
    pub id: u32,
    #[prost(int32, required, tag = "2")]
    pub pid: i32,
    #[prost(enumeration = "RunState", required, tag = "3")]
    pub run_state: i32,
}
/// lists of available metrics in a worker, or in the main process (in which case there are no cluster metrics)
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[derive(Hash, Eq, Ord, PartialOrd)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AvailableMetrics {
    #[prost(string, repeated, tag = "1")]
    pub proxy_metrics: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
    #[prost(string, repeated, tag = "2")]
    pub cluster_metrics: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
/// Aggregated metrics of main process & workers
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[derive(Hash, Eq, Ord, PartialOrd)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AggregatedMetrics {
    #[prost(btree_map = "string, message", tag = "1")]
    pub main: ::prost::alloc::collections::BTreeMap<
        ::prost::alloc::string::String,
        FilteredMetrics,
    >,
    #[prost(btree_map = "string, message", tag = "2")]
    pub workers: ::prost::alloc::collections::BTreeMap<
        ::prost::alloc::string::String,
        WorkerMetrics,
    >,
}
/// All metrics of a worker: proxy and clusters
/// Populated by Options so partial results can be sent
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[derive(Hash, Eq, Ord, PartialOrd)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct WorkerMetrics {
    /// Metrics of the worker process, key -> value
    #[prost(btree_map = "string, message", tag = "1")]
    pub proxy: ::prost::alloc::collections::BTreeMap<
        ::prost::alloc::string::String,
        FilteredMetrics,
    >,
    /// cluster_id -> cluster_metrics
    #[prost(btree_map = "string, message", tag = "2")]
    pub clusters: ::prost::alloc::collections::BTreeMap<
        ::prost::alloc::string::String,
        ClusterMetrics,
    >,
}
/// the metrics of a given cluster, with several backends
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[derive(Hash, Eq, Ord, PartialOrd)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ClusterMetrics {
    /// metric name -> metric value
    #[prost(btree_map = "string, message", tag = "1")]
    pub cluster: ::prost::alloc::collections::BTreeMap<
        ::prost::alloc::string::String,
        FilteredMetrics,
    >,
    /// backend_id -> (metric name-> metric value)
    #[prost(message, repeated, tag = "2")]
    pub backends: ::prost::alloc::vec::Vec<BackendMetrics>,
}
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[derive(Hash, Eq, Ord, PartialOrd)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BackendMetrics {
    #[prost(string, required, tag = "1")]
    pub backend_id: ::prost::alloc::string::String,
    #[prost(btree_map = "string, message", tag = "2")]
    pub metrics: ::prost::alloc::collections::BTreeMap<
        ::prost::alloc::string::String,
        FilteredMetrics,
    >,
}
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[derive(Hash, Eq, Ord, PartialOrd)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FilteredMetrics {
    #[prost(oneof = "filtered_metrics::Inner", tags = "1, 2, 3, 4, 5")]
    pub inner: ::core::option::Option<filtered_metrics::Inner>,
}
/// Nested message and enum types in `FilteredMetrics`.
pub mod filtered_metrics {
    #[derive(::serde::Serialize, ::serde::Deserialize)]
    #[serde(rename_all = "SCREAMING_SNAKE_CASE")]
    #[derive(Hash, Eq, Ord, PartialOrd)]
    #[allow(clippy::derive_partial_eq_without_eq)]
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Inner {
        #[prost(uint64, tag = "1")]
        Gauge(u64),
        #[prost(int64, tag = "2")]
        Count(i64),
        #[prost(uint64, tag = "3")]
        Time(u64),
        #[prost(message, tag = "4")]
        Percentiles(super::Percentiles),
        #[prost(message, tag = "5")]
        TimeSerie(super::FilteredTimeSerie),
    }
}
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[derive(Hash, Eq, Ord, PartialOrd)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FilteredTimeSerie {
    #[prost(uint32, required, tag = "1")]
    pub last_second: u32,
    #[prost(uint32, repeated, packed = "false", tag = "2")]
    pub last_minute: ::prost::alloc::vec::Vec<u32>,
    #[prost(uint32, repeated, packed = "false", tag = "3")]
    pub last_hour: ::prost::alloc::vec::Vec<u32>,
}
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[derive(Hash, Eq, Ord, PartialOrd)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Percentiles {
    #[prost(uint64, required, tag = "1")]
    pub samples: u64,
    #[prost(uint64, required, tag = "2")]
    pub p_50: u64,
    #[prost(uint64, required, tag = "3")]
    pub p_90: u64,
    #[prost(uint64, required, tag = "4")]
    pub p_99: u64,
    #[prost(uint64, required, tag = "5")]
    pub p_99_9: u64,
    #[prost(uint64, required, tag = "6")]
    pub p_99_99: u64,
    #[prost(uint64, required, tag = "7")]
    pub p_99_999: u64,
    #[prost(uint64, required, tag = "8")]
    pub p_100: u64,
}
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[derive(Hash, Eq, Ord, PartialOrd)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RequestCounts {
    #[prost(btree_map = "string, int32", tag = "1")]
    pub map: ::prost::alloc::collections::BTreeMap<::prost::alloc::string::String, i32>,
}
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(rename_all = "SCREAMING_SNAKE_CASE")]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum ListenerType {
    Http = 0,
    Https = 1,
    Tcp = 2,
}
impl ListenerType {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            ListenerType::Http => "HTTP",
            ListenerType::Https => "HTTPS",
            ListenerType::Tcp => "TCP",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "HTTP" => Some(Self::Http),
            "HTTPS" => Some(Self::Https),
            "TCP" => Some(Self::Tcp),
            _ => None,
        }
    }
}
/// The kind of filter used for path rules
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(rename_all = "SCREAMING_SNAKE_CASE")]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum PathRuleKind {
    /// filters paths that start with a pattern, typically "/api"
    Prefix = 0,
    /// filters paths that match a regex pattern
    Regex = 1,
    /// filters paths that exactly match a pattern, no more, no less
    Equals = 2,
}
impl PathRuleKind {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            PathRuleKind::Prefix => "PREFIX",
            PathRuleKind::Regex => "REGEX",
            PathRuleKind::Equals => "EQUALS",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "PREFIX" => Some(Self::Prefix),
            "REGEX" => Some(Self::Regex),
            "EQUALS" => Some(Self::Equals),
            _ => None,
        }
    }
}
/// TODO: find a proper definition for this
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(rename_all = "SCREAMING_SNAKE_CASE")]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum RulePosition {
    Pre = 0,
    Post = 1,
    Tree = 2,
}
impl RulePosition {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            RulePosition::Pre => "PRE",
            RulePosition::Post => "POST",
            RulePosition::Tree => "TREE",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "PRE" => Some(Self::Pre),
            "POST" => Some(Self::Post),
            "TREE" => Some(Self::Tree),
            _ => None,
        }
    }
}
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(rename_all = "SCREAMING_SNAKE_CASE")]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum TlsVersion {
    SslV2 = 0,
    SslV3 = 1,
    TlsV10 = 2,
    TlsV11 = 3,
    TlsV12 = 4,
    TlsV13 = 5,
}
impl TlsVersion {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            TlsVersion::SslV2 => "SSL_V2",
            TlsVersion::SslV3 => "SSL_V3",
            TlsVersion::TlsV10 => "TLS_V1_0",
            TlsVersion::TlsV11 => "TLS_V1_1",
            TlsVersion::TlsV12 => "TLS_V1_2",
            TlsVersion::TlsV13 => "TLS_V1_3",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "SSL_V2" => Some(Self::SslV2),
            "SSL_V3" => Some(Self::SslV3),
            "TLS_V1_0" => Some(Self::TlsV10),
            "TLS_V1_1" => Some(Self::TlsV11),
            "TLS_V1_2" => Some(Self::TlsV12),
            "TLS_V1_3" => Some(Self::TlsV13),
            _ => None,
        }
    }
}
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(rename_all = "SCREAMING_SNAKE_CASE")]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum LoadBalancingAlgorithms {
    RoundRobin = 0,
    Random = 1,
    LeastLoaded = 2,
    PowerOfTwo = 3,
}
impl LoadBalancingAlgorithms {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            LoadBalancingAlgorithms::RoundRobin => "ROUND_ROBIN",
            LoadBalancingAlgorithms::Random => "RANDOM",
            LoadBalancingAlgorithms::LeastLoaded => "LEAST_LOADED",
            LoadBalancingAlgorithms::PowerOfTwo => "POWER_OF_TWO",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "ROUND_ROBIN" => Some(Self::RoundRobin),
            "RANDOM" => Some(Self::Random),
            "LEAST_LOADED" => Some(Self::LeastLoaded),
            "POWER_OF_TWO" => Some(Self::PowerOfTwo),
            _ => None,
        }
    }
}
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(rename_all = "SCREAMING_SNAKE_CASE")]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum ProxyProtocolConfig {
    ExpectHeader = 0,
    SendHeader = 1,
    RelayHeader = 2,
}
impl ProxyProtocolConfig {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            ProxyProtocolConfig::ExpectHeader => "EXPECT_HEADER",
            ProxyProtocolConfig::SendHeader => "SEND_HEADER",
            ProxyProtocolConfig::RelayHeader => "RELAY_HEADER",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "EXPECT_HEADER" => Some(Self::ExpectHeader),
            "SEND_HEADER" => Some(Self::SendHeader),
            "RELAY_HEADER" => Some(Self::RelayHeader),
            _ => None,
        }
    }
}
/// how sozu measures which backend is less loaded
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(rename_all = "SCREAMING_SNAKE_CASE")]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum LoadMetric {
    /// number of TCP connections
    Connections = 0,
    /// number of active HTTP requests
    Requests = 1,
    /// time to connect to the backend, weighted by the number of active connections (peak EWMA)
    ConnectionTime = 2,
}
impl LoadMetric {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            LoadMetric::Connections => "CONNECTIONS",
            LoadMetric::Requests => "REQUESTS",
            LoadMetric::ConnectionTime => "CONNECTION_TIME",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "CONNECTIONS" => Some(Self::Connections),
            "REQUESTS" => Some(Self::Requests),
            "CONNECTION_TIME" => Some(Self::ConnectionTime),
            _ => None,
        }
    }
}
/// options to configure metrics collection
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(rename_all = "SCREAMING_SNAKE_CASE")]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum MetricsConfiguration {
    /// enable metrics collection
    Enabled = 0,
    /// disable metrics collection
    Disabled = 1,
    /// wipe the metrics memory
    Clear = 2,
}
impl MetricsConfiguration {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            MetricsConfiguration::Enabled => "ENABLED",
            MetricsConfiguration::Disabled => "DISABLED",
            MetricsConfiguration::Clear => "CLEAR",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "ENABLED" => Some(Self::Enabled),
            "DISABLED" => Some(Self::Disabled),
            "CLEAR" => Some(Self::Clear),
            _ => None,
        }
    }
}
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(rename_all = "SCREAMING_SNAKE_CASE")]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum EventKind {
    BackendDown = 0,
    BackendUp = 1,
    NoAvailableBackends = 2,
    RemovedBackendHasNoConnections = 3,
}
impl EventKind {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            EventKind::BackendDown => "BACKEND_DOWN",
            EventKind::BackendUp => "BACKEND_UP",
            EventKind::NoAvailableBackends => "NO_AVAILABLE_BACKENDS",
            EventKind::RemovedBackendHasNoConnections => {
                "REMOVED_BACKEND_HAS_NO_CONNECTIONS"
            }
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "BACKEND_DOWN" => Some(Self::BackendDown),
            "BACKEND_UP" => Some(Self::BackendUp),
            "NO_AVAILABLE_BACKENDS" => Some(Self::NoAvailableBackends),
            "REMOVED_BACKEND_HAS_NO_CONNECTIONS" => {
                Some(Self::RemovedBackendHasNoConnections)
            }
            _ => None,
        }
    }
}
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(rename_all = "SCREAMING_SNAKE_CASE")]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum ResponseStatus {
    Ok = 0,
    Processing = 1,
    Failure = 2,
}
impl ResponseStatus {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            ResponseStatus::Ok => "OK",
            ResponseStatus::Processing => "PROCESSING",
            ResponseStatus::Failure => "FAILURE",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "OK" => Some(Self::Ok),
            "PROCESSING" => Some(Self::Processing),
            "FAILURE" => Some(Self::Failure),
            _ => None,
        }
    }
}
/// Runstate of a worker
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(rename_all = "SCREAMING_SNAKE_CASE")]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum RunState {
    Running = 0,
    Stopping = 1,
    Stopped = 2,
    NotAnswering = 3,
}
impl RunState {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            RunState::Running => "RUNNING",
            RunState::Stopping => "STOPPING",
            RunState::Stopped => "STOPPED",
            RunState::NotAnswering => "NOT_ANSWERING",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "RUNNING" => Some(Self::Running),
            "STOPPING" => Some(Self::Stopping),
            "STOPPED" => Some(Self::Stopped),
            "NOT_ANSWERING" => Some(Self::NotAnswering),
            _ => None,
        }
    }
}