libwallguard/proto/
wallguard.rs

1// This file is @generated by prost-build.
2#[derive(Clone, PartialEq, ::prost::Message)]
3pub struct LoginRequest {
4    #[prost(string, tag = "1")]
5    pub app_id: ::prost::alloc::string::String,
6    #[prost(string, tag = "2")]
7    pub app_secret: ::prost::alloc::string::String,
8}
9#[derive(Clone, PartialEq, ::prost::Message)]
10pub struct StatusRequest {
11    #[prost(message, optional, tag = "1")]
12    pub auth: ::core::option::Option<Authentication>,
13}
14#[derive(serde::Serialize, serde::Deserialize)]
15#[derive(Clone, PartialEq, ::prost::Message)]
16pub struct Authentication {
17    #[prost(string, tag = "1")]
18    pub token: ::prost::alloc::string::String,
19}
20#[derive(Clone, Copy, PartialEq, ::prost::Message)]
21pub struct StatusResponse {
22    #[prost(enumeration = "DeviceStatus", tag = "1")]
23    pub status: i32,
24}
25#[derive(Clone, Copy, PartialEq, ::prost::Message)]
26pub struct HeartbeatResponse {
27    #[prost(enumeration = "DeviceStatus", tag = "1")]
28    pub status: i32,
29    #[prost(bool, tag = "2")]
30    pub is_remote_access_enabled: bool,
31    #[prost(bool, tag = "3")]
32    pub is_monitoring_enabled: bool,
33}
34#[derive(Clone, PartialEq, ::prost::Message)]
35pub struct CommonResponse {
36    #[prost(string, tag = "1")]
37    pub message: ::prost::alloc::string::String,
38}
39#[derive(Clone, PartialEq, ::prost::Message)]
40pub struct SetupRequest {
41    #[prost(message, optional, tag = "1")]
42    pub auth: ::core::option::Option<Authentication>,
43    #[prost(string, tag = "2")]
44    pub device_version: ::prost::alloc::string::String,
45    #[prost(string, tag = "3")]
46    pub device_uuid: ::prost::alloc::string::String,
47}
48#[derive(Clone, PartialEq, ::prost::Message)]
49pub struct HeartbeatRequest {
50    #[prost(message, optional, tag = "1")]
51    pub auth: ::core::option::Option<Authentication>,
52}
53#[derive(serde::Serialize, serde::Deserialize)]
54#[derive(Clone, PartialEq, ::prost::Message)]
55pub struct Packets {
56    #[prost(message, optional, tag = "1")]
57    pub auth: ::core::option::Option<Authentication>,
58    #[prost(string, tag = "2")]
59    pub uuid: ::prost::alloc::string::String,
60    #[prost(message, repeated, tag = "3")]
61    pub packets: ::prost::alloc::vec::Vec<Packet>,
62}
63#[derive(serde::Serialize, serde::Deserialize)]
64#[derive(Clone, PartialEq, ::prost::Message)]
65pub struct Packet {
66    #[prost(string, tag = "1")]
67    pub timestamp: ::prost::alloc::string::String,
68    #[prost(string, tag = "2")]
69    pub interface: ::prost::alloc::string::String,
70    #[prost(int32, tag = "3")]
71    pub link_type: i32,
72    #[prost(bytes = "vec", tag = "4")]
73    pub data: ::prost::alloc::vec::Vec<u8>,
74}
75#[derive(Clone, PartialEq, ::prost::Message)]
76pub struct FileSnapshot {
77    #[prost(string, tag = "1")]
78    pub filename: ::prost::alloc::string::String,
79    #[prost(bytes = "vec", tag = "2")]
80    pub contents: ::prost::alloc::vec::Vec<u8>,
81}
82#[derive(Clone, PartialEq, ::prost::Message)]
83pub struct ConfigSnapshot {
84    #[prost(message, optional, tag = "1")]
85    pub auth: ::core::option::Option<Authentication>,
86    #[prost(message, repeated, tag = "2")]
87    pub files: ::prost::alloc::vec::Vec<FileSnapshot>,
88    #[prost(enumeration = "ConfigStatus", tag = "3")]
89    pub status: i32,
90}
91#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
92#[repr(i32)]
93pub enum DeviceStatus {
94    DsDraft = 0,
95    DsActive = 1,
96    DsArchived = 2,
97    DsDeleted = 3,
98    DsUnknown = 4,
99}
100impl DeviceStatus {
101    /// String value of the enum field names used in the ProtoBuf definition.
102    ///
103    /// The values are not transformed in any way and thus are considered stable
104    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
105    pub fn as_str_name(&self) -> &'static str {
106        match self {
107            Self::DsDraft => "DS_DRAFT",
108            Self::DsActive => "DS_ACTIVE",
109            Self::DsArchived => "DS_ARCHIVED",
110            Self::DsDeleted => "DS_DELETED",
111            Self::DsUnknown => "DS_UNKNOWN",
112        }
113    }
114    /// Creates an enum from field names used in the ProtoBuf definition.
115    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
116        match value {
117            "DS_DRAFT" => Some(Self::DsDraft),
118            "DS_ACTIVE" => Some(Self::DsActive),
119            "DS_ARCHIVED" => Some(Self::DsArchived),
120            "DS_DELETED" => Some(Self::DsDeleted),
121            "DS_UNKNOWN" => Some(Self::DsUnknown),
122            _ => None,
123        }
124    }
125}
126#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
127#[repr(i32)]
128pub enum ConfigStatus {
129    CsDraft = 0,
130    CsApplied = 1,
131    CsUndefined = 2,
132}
133impl ConfigStatus {
134    /// String value of the enum field names used in the ProtoBuf definition.
135    ///
136    /// The values are not transformed in any way and thus are considered stable
137    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
138    pub fn as_str_name(&self) -> &'static str {
139        match self {
140            Self::CsDraft => "CS_DRAFT",
141            Self::CsApplied => "CS_APPLIED",
142            Self::CsUndefined => "CS_UNDEFINED",
143        }
144    }
145    /// Creates an enum from field names used in the ProtoBuf definition.
146    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
147        match value {
148            "CS_DRAFT" => Some(Self::CsDraft),
149            "CS_APPLIED" => Some(Self::CsApplied),
150            "CS_UNDEFINED" => Some(Self::CsUndefined),
151            _ => None,
152        }
153    }
154}
155/// Generated client implementations.
156pub mod wall_guard_client {
157    #![allow(
158        unused_variables,
159        dead_code,
160        missing_docs,
161        clippy::wildcard_imports,
162        clippy::let_unit_value,
163    )]
164    use tonic::codegen::*;
165    use tonic::codegen::http::Uri;
166    #[derive(Debug, Clone)]
167    pub struct WallGuardClient<T> {
168        inner: tonic::client::Grpc<T>,
169    }
170    impl WallGuardClient<tonic::transport::Channel> {
171        /// Attempt to create a new client by connecting to a given endpoint.
172        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
173        where
174            D: TryInto<tonic::transport::Endpoint>,
175            D::Error: Into<StdError>,
176        {
177            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
178            Ok(Self::new(conn))
179        }
180    }
181    impl<T> WallGuardClient<T>
182    where
183        T: tonic::client::GrpcService<tonic::body::BoxBody>,
184        T::Error: Into<StdError>,
185        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
186        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
187    {
188        pub fn new(inner: T) -> Self {
189            let inner = tonic::client::Grpc::new(inner);
190            Self { inner }
191        }
192        pub fn with_origin(inner: T, origin: Uri) -> Self {
193            let inner = tonic::client::Grpc::with_origin(inner, origin);
194            Self { inner }
195        }
196        pub fn with_interceptor<F>(
197            inner: T,
198            interceptor: F,
199        ) -> WallGuardClient<InterceptedService<T, F>>
200        where
201            F: tonic::service::Interceptor,
202            T::ResponseBody: Default,
203            T: tonic::codegen::Service<
204                http::Request<tonic::body::BoxBody>,
205                Response = http::Response<
206                    <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
207                >,
208            >,
209            <T as tonic::codegen::Service<
210                http::Request<tonic::body::BoxBody>,
211            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
212        {
213            WallGuardClient::new(InterceptedService::new(inner, interceptor))
214        }
215        /// Compress requests with the given encoding.
216        ///
217        /// This requires the server to support it otherwise it might respond with an
218        /// error.
219        #[must_use]
220        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
221            self.inner = self.inner.send_compressed(encoding);
222            self
223        }
224        /// Enable decompressing responses.
225        #[must_use]
226        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
227            self.inner = self.inner.accept_compressed(encoding);
228            self
229        }
230        /// Limits the maximum size of a decoded message.
231        ///
232        /// Default: `4MB`
233        #[must_use]
234        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
235            self.inner = self.inner.max_decoding_message_size(limit);
236            self
237        }
238        /// Limits the maximum size of an encoded message.
239        ///
240        /// Default: `usize::MAX`
241        #[must_use]
242        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
243            self.inner = self.inner.max_encoding_message_size(limit);
244            self
245        }
246        pub async fn login(
247            &mut self,
248            request: impl tonic::IntoRequest<super::LoginRequest>,
249        ) -> std::result::Result<tonic::Response<super::Authentication>, tonic::Status> {
250            self.inner
251                .ready()
252                .await
253                .map_err(|e| {
254                    tonic::Status::unknown(
255                        format!("Service was not ready: {}", e.into()),
256                    )
257                })?;
258            let codec = tonic::codec::ProstCodec::default();
259            let path = http::uri::PathAndQuery::from_static(
260                "/wallguard.WallGuard/Login",
261            );
262            let mut req = request.into_request();
263            req.extensions_mut().insert(GrpcMethod::new("wallguard.WallGuard", "Login"));
264            self.inner.unary(req, path, codec).await
265        }
266        pub async fn status(
267            &mut self,
268            request: impl tonic::IntoRequest<super::StatusRequest>,
269        ) -> std::result::Result<tonic::Response<super::StatusResponse>, tonic::Status> {
270            self.inner
271                .ready()
272                .await
273                .map_err(|e| {
274                    tonic::Status::unknown(
275                        format!("Service was not ready: {}", e.into()),
276                    )
277                })?;
278            let codec = tonic::codec::ProstCodec::default();
279            let path = http::uri::PathAndQuery::from_static(
280                "/wallguard.WallGuard/Status",
281            );
282            let mut req = request.into_request();
283            req.extensions_mut()
284                .insert(GrpcMethod::new("wallguard.WallGuard", "Status"));
285            self.inner.unary(req, path, codec).await
286        }
287        pub async fn setup(
288            &mut self,
289            request: impl tonic::IntoRequest<super::SetupRequest>,
290        ) -> std::result::Result<tonic::Response<super::CommonResponse>, tonic::Status> {
291            self.inner
292                .ready()
293                .await
294                .map_err(|e| {
295                    tonic::Status::unknown(
296                        format!("Service was not ready: {}", e.into()),
297                    )
298                })?;
299            let codec = tonic::codec::ProstCodec::default();
300            let path = http::uri::PathAndQuery::from_static(
301                "/wallguard.WallGuard/Setup",
302            );
303            let mut req = request.into_request();
304            req.extensions_mut().insert(GrpcMethod::new("wallguard.WallGuard", "Setup"));
305            self.inner.unary(req, path, codec).await
306        }
307        pub async fn heartbeat(
308            &mut self,
309            request: impl tonic::IntoRequest<super::HeartbeatRequest>,
310        ) -> std::result::Result<
311            tonic::Response<super::HeartbeatResponse>,
312            tonic::Status,
313        > {
314            self.inner
315                .ready()
316                .await
317                .map_err(|e| {
318                    tonic::Status::unknown(
319                        format!("Service was not ready: {}", e.into()),
320                    )
321                })?;
322            let codec = tonic::codec::ProstCodec::default();
323            let path = http::uri::PathAndQuery::from_static(
324                "/wallguard.WallGuard/Heartbeat",
325            );
326            let mut req = request.into_request();
327            req.extensions_mut()
328                .insert(GrpcMethod::new("wallguard.WallGuard", "Heartbeat"));
329            self.inner.unary(req, path, codec).await
330        }
331        pub async fn handle_packets(
332            &mut self,
333            request: impl tonic::IntoRequest<super::Packets>,
334        ) -> std::result::Result<tonic::Response<super::CommonResponse>, tonic::Status> {
335            self.inner
336                .ready()
337                .await
338                .map_err(|e| {
339                    tonic::Status::unknown(
340                        format!("Service was not ready: {}", e.into()),
341                    )
342                })?;
343            let codec = tonic::codec::ProstCodec::default();
344            let path = http::uri::PathAndQuery::from_static(
345                "/wallguard.WallGuard/HandlePackets",
346            );
347            let mut req = request.into_request();
348            req.extensions_mut()
349                .insert(GrpcMethod::new("wallguard.WallGuard", "HandlePackets"));
350            self.inner.unary(req, path, codec).await
351        }
352        pub async fn handle_config(
353            &mut self,
354            request: impl tonic::IntoRequest<super::ConfigSnapshot>,
355        ) -> std::result::Result<tonic::Response<super::CommonResponse>, tonic::Status> {
356            self.inner
357                .ready()
358                .await
359                .map_err(|e| {
360                    tonic::Status::unknown(
361                        format!("Service was not ready: {}", e.into()),
362                    )
363                })?;
364            let codec = tonic::codec::ProstCodec::default();
365            let path = http::uri::PathAndQuery::from_static(
366                "/wallguard.WallGuard/HandleConfig",
367            );
368            let mut req = request.into_request();
369            req.extensions_mut()
370                .insert(GrpcMethod::new("wallguard.WallGuard", "HandleConfig"));
371            self.inner.unary(req, path, codec).await
372        }
373    }
374}
375/// Generated server implementations.
376pub mod wall_guard_server {
377    #![allow(
378        unused_variables,
379        dead_code,
380        missing_docs,
381        clippy::wildcard_imports,
382        clippy::let_unit_value,
383    )]
384    use tonic::codegen::*;
385    /// Generated trait containing gRPC methods that should be implemented for use with WallGuardServer.
386    #[async_trait]
387    pub trait WallGuard: std::marker::Send + std::marker::Sync + 'static {
388        async fn login(
389            &self,
390            request: tonic::Request<super::LoginRequest>,
391        ) -> std::result::Result<tonic::Response<super::Authentication>, tonic::Status>;
392        async fn status(
393            &self,
394            request: tonic::Request<super::StatusRequest>,
395        ) -> std::result::Result<tonic::Response<super::StatusResponse>, tonic::Status>;
396        async fn setup(
397            &self,
398            request: tonic::Request<super::SetupRequest>,
399        ) -> std::result::Result<tonic::Response<super::CommonResponse>, tonic::Status>;
400        async fn heartbeat(
401            &self,
402            request: tonic::Request<super::HeartbeatRequest>,
403        ) -> std::result::Result<
404            tonic::Response<super::HeartbeatResponse>,
405            tonic::Status,
406        >;
407        async fn handle_packets(
408            &self,
409            request: tonic::Request<super::Packets>,
410        ) -> std::result::Result<tonic::Response<super::CommonResponse>, tonic::Status>;
411        async fn handle_config(
412            &self,
413            request: tonic::Request<super::ConfigSnapshot>,
414        ) -> std::result::Result<tonic::Response<super::CommonResponse>, tonic::Status>;
415    }
416    #[derive(Debug)]
417    pub struct WallGuardServer<T> {
418        inner: Arc<T>,
419        accept_compression_encodings: EnabledCompressionEncodings,
420        send_compression_encodings: EnabledCompressionEncodings,
421        max_decoding_message_size: Option<usize>,
422        max_encoding_message_size: Option<usize>,
423    }
424    impl<T> WallGuardServer<T> {
425        pub fn new(inner: T) -> Self {
426            Self::from_arc(Arc::new(inner))
427        }
428        pub fn from_arc(inner: Arc<T>) -> Self {
429            Self {
430                inner,
431                accept_compression_encodings: Default::default(),
432                send_compression_encodings: Default::default(),
433                max_decoding_message_size: None,
434                max_encoding_message_size: None,
435            }
436        }
437        pub fn with_interceptor<F>(
438            inner: T,
439            interceptor: F,
440        ) -> InterceptedService<Self, F>
441        where
442            F: tonic::service::Interceptor,
443        {
444            InterceptedService::new(Self::new(inner), interceptor)
445        }
446        /// Enable decompressing requests with the given encoding.
447        #[must_use]
448        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
449            self.accept_compression_encodings.enable(encoding);
450            self
451        }
452        /// Compress responses with the given encoding, if the client supports it.
453        #[must_use]
454        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
455            self.send_compression_encodings.enable(encoding);
456            self
457        }
458        /// Limits the maximum size of a decoded message.
459        ///
460        /// Default: `4MB`
461        #[must_use]
462        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
463            self.max_decoding_message_size = Some(limit);
464            self
465        }
466        /// Limits the maximum size of an encoded message.
467        ///
468        /// Default: `usize::MAX`
469        #[must_use]
470        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
471            self.max_encoding_message_size = Some(limit);
472            self
473        }
474    }
475    impl<T, B> tonic::codegen::Service<http::Request<B>> for WallGuardServer<T>
476    where
477        T: WallGuard,
478        B: Body + std::marker::Send + 'static,
479        B::Error: Into<StdError> + std::marker::Send + 'static,
480    {
481        type Response = http::Response<tonic::body::BoxBody>;
482        type Error = std::convert::Infallible;
483        type Future = BoxFuture<Self::Response, Self::Error>;
484        fn poll_ready(
485            &mut self,
486            _cx: &mut Context<'_>,
487        ) -> Poll<std::result::Result<(), Self::Error>> {
488            Poll::Ready(Ok(()))
489        }
490        fn call(&mut self, req: http::Request<B>) -> Self::Future {
491            match req.uri().path() {
492                "/wallguard.WallGuard/Login" => {
493                    #[allow(non_camel_case_types)]
494                    struct LoginSvc<T: WallGuard>(pub Arc<T>);
495                    impl<T: WallGuard> tonic::server::UnaryService<super::LoginRequest>
496                    for LoginSvc<T> {
497                        type Response = super::Authentication;
498                        type Future = BoxFuture<
499                            tonic::Response<Self::Response>,
500                            tonic::Status,
501                        >;
502                        fn call(
503                            &mut self,
504                            request: tonic::Request<super::LoginRequest>,
505                        ) -> Self::Future {
506                            let inner = Arc::clone(&self.0);
507                            let fut = async move {
508                                <T as WallGuard>::login(&inner, request).await
509                            };
510                            Box::pin(fut)
511                        }
512                    }
513                    let accept_compression_encodings = self.accept_compression_encodings;
514                    let send_compression_encodings = self.send_compression_encodings;
515                    let max_decoding_message_size = self.max_decoding_message_size;
516                    let max_encoding_message_size = self.max_encoding_message_size;
517                    let inner = self.inner.clone();
518                    let fut = async move {
519                        let method = LoginSvc(inner);
520                        let codec = tonic::codec::ProstCodec::default();
521                        let mut grpc = tonic::server::Grpc::new(codec)
522                            .apply_compression_config(
523                                accept_compression_encodings,
524                                send_compression_encodings,
525                            )
526                            .apply_max_message_size_config(
527                                max_decoding_message_size,
528                                max_encoding_message_size,
529                            );
530                        let res = grpc.unary(method, req).await;
531                        Ok(res)
532                    };
533                    Box::pin(fut)
534                }
535                "/wallguard.WallGuard/Status" => {
536                    #[allow(non_camel_case_types)]
537                    struct StatusSvc<T: WallGuard>(pub Arc<T>);
538                    impl<T: WallGuard> tonic::server::UnaryService<super::StatusRequest>
539                    for StatusSvc<T> {
540                        type Response = super::StatusResponse;
541                        type Future = BoxFuture<
542                            tonic::Response<Self::Response>,
543                            tonic::Status,
544                        >;
545                        fn call(
546                            &mut self,
547                            request: tonic::Request<super::StatusRequest>,
548                        ) -> Self::Future {
549                            let inner = Arc::clone(&self.0);
550                            let fut = async move {
551                                <T as WallGuard>::status(&inner, request).await
552                            };
553                            Box::pin(fut)
554                        }
555                    }
556                    let accept_compression_encodings = self.accept_compression_encodings;
557                    let send_compression_encodings = self.send_compression_encodings;
558                    let max_decoding_message_size = self.max_decoding_message_size;
559                    let max_encoding_message_size = self.max_encoding_message_size;
560                    let inner = self.inner.clone();
561                    let fut = async move {
562                        let method = StatusSvc(inner);
563                        let codec = tonic::codec::ProstCodec::default();
564                        let mut grpc = tonic::server::Grpc::new(codec)
565                            .apply_compression_config(
566                                accept_compression_encodings,
567                                send_compression_encodings,
568                            )
569                            .apply_max_message_size_config(
570                                max_decoding_message_size,
571                                max_encoding_message_size,
572                            );
573                        let res = grpc.unary(method, req).await;
574                        Ok(res)
575                    };
576                    Box::pin(fut)
577                }
578                "/wallguard.WallGuard/Setup" => {
579                    #[allow(non_camel_case_types)]
580                    struct SetupSvc<T: WallGuard>(pub Arc<T>);
581                    impl<T: WallGuard> tonic::server::UnaryService<super::SetupRequest>
582                    for SetupSvc<T> {
583                        type Response = super::CommonResponse;
584                        type Future = BoxFuture<
585                            tonic::Response<Self::Response>,
586                            tonic::Status,
587                        >;
588                        fn call(
589                            &mut self,
590                            request: tonic::Request<super::SetupRequest>,
591                        ) -> Self::Future {
592                            let inner = Arc::clone(&self.0);
593                            let fut = async move {
594                                <T as WallGuard>::setup(&inner, request).await
595                            };
596                            Box::pin(fut)
597                        }
598                    }
599                    let accept_compression_encodings = self.accept_compression_encodings;
600                    let send_compression_encodings = self.send_compression_encodings;
601                    let max_decoding_message_size = self.max_decoding_message_size;
602                    let max_encoding_message_size = self.max_encoding_message_size;
603                    let inner = self.inner.clone();
604                    let fut = async move {
605                        let method = SetupSvc(inner);
606                        let codec = tonic::codec::ProstCodec::default();
607                        let mut grpc = tonic::server::Grpc::new(codec)
608                            .apply_compression_config(
609                                accept_compression_encodings,
610                                send_compression_encodings,
611                            )
612                            .apply_max_message_size_config(
613                                max_decoding_message_size,
614                                max_encoding_message_size,
615                            );
616                        let res = grpc.unary(method, req).await;
617                        Ok(res)
618                    };
619                    Box::pin(fut)
620                }
621                "/wallguard.WallGuard/Heartbeat" => {
622                    #[allow(non_camel_case_types)]
623                    struct HeartbeatSvc<T: WallGuard>(pub Arc<T>);
624                    impl<
625                        T: WallGuard,
626                    > tonic::server::UnaryService<super::HeartbeatRequest>
627                    for HeartbeatSvc<T> {
628                        type Response = super::HeartbeatResponse;
629                        type Future = BoxFuture<
630                            tonic::Response<Self::Response>,
631                            tonic::Status,
632                        >;
633                        fn call(
634                            &mut self,
635                            request: tonic::Request<super::HeartbeatRequest>,
636                        ) -> Self::Future {
637                            let inner = Arc::clone(&self.0);
638                            let fut = async move {
639                                <T as WallGuard>::heartbeat(&inner, request).await
640                            };
641                            Box::pin(fut)
642                        }
643                    }
644                    let accept_compression_encodings = self.accept_compression_encodings;
645                    let send_compression_encodings = self.send_compression_encodings;
646                    let max_decoding_message_size = self.max_decoding_message_size;
647                    let max_encoding_message_size = self.max_encoding_message_size;
648                    let inner = self.inner.clone();
649                    let fut = async move {
650                        let method = HeartbeatSvc(inner);
651                        let codec = tonic::codec::ProstCodec::default();
652                        let mut grpc = tonic::server::Grpc::new(codec)
653                            .apply_compression_config(
654                                accept_compression_encodings,
655                                send_compression_encodings,
656                            )
657                            .apply_max_message_size_config(
658                                max_decoding_message_size,
659                                max_encoding_message_size,
660                            );
661                        let res = grpc.unary(method, req).await;
662                        Ok(res)
663                    };
664                    Box::pin(fut)
665                }
666                "/wallguard.WallGuard/HandlePackets" => {
667                    #[allow(non_camel_case_types)]
668                    struct HandlePacketsSvc<T: WallGuard>(pub Arc<T>);
669                    impl<T: WallGuard> tonic::server::UnaryService<super::Packets>
670                    for HandlePacketsSvc<T> {
671                        type Response = super::CommonResponse;
672                        type Future = BoxFuture<
673                            tonic::Response<Self::Response>,
674                            tonic::Status,
675                        >;
676                        fn call(
677                            &mut self,
678                            request: tonic::Request<super::Packets>,
679                        ) -> Self::Future {
680                            let inner = Arc::clone(&self.0);
681                            let fut = async move {
682                                <T as WallGuard>::handle_packets(&inner, request).await
683                            };
684                            Box::pin(fut)
685                        }
686                    }
687                    let accept_compression_encodings = self.accept_compression_encodings;
688                    let send_compression_encodings = self.send_compression_encodings;
689                    let max_decoding_message_size = self.max_decoding_message_size;
690                    let max_encoding_message_size = self.max_encoding_message_size;
691                    let inner = self.inner.clone();
692                    let fut = async move {
693                        let method = HandlePacketsSvc(inner);
694                        let codec = tonic::codec::ProstCodec::default();
695                        let mut grpc = tonic::server::Grpc::new(codec)
696                            .apply_compression_config(
697                                accept_compression_encodings,
698                                send_compression_encodings,
699                            )
700                            .apply_max_message_size_config(
701                                max_decoding_message_size,
702                                max_encoding_message_size,
703                            );
704                        let res = grpc.unary(method, req).await;
705                        Ok(res)
706                    };
707                    Box::pin(fut)
708                }
709                "/wallguard.WallGuard/HandleConfig" => {
710                    #[allow(non_camel_case_types)]
711                    struct HandleConfigSvc<T: WallGuard>(pub Arc<T>);
712                    impl<T: WallGuard> tonic::server::UnaryService<super::ConfigSnapshot>
713                    for HandleConfigSvc<T> {
714                        type Response = super::CommonResponse;
715                        type Future = BoxFuture<
716                            tonic::Response<Self::Response>,
717                            tonic::Status,
718                        >;
719                        fn call(
720                            &mut self,
721                            request: tonic::Request<super::ConfigSnapshot>,
722                        ) -> Self::Future {
723                            let inner = Arc::clone(&self.0);
724                            let fut = async move {
725                                <T as WallGuard>::handle_config(&inner, request).await
726                            };
727                            Box::pin(fut)
728                        }
729                    }
730                    let accept_compression_encodings = self.accept_compression_encodings;
731                    let send_compression_encodings = self.send_compression_encodings;
732                    let max_decoding_message_size = self.max_decoding_message_size;
733                    let max_encoding_message_size = self.max_encoding_message_size;
734                    let inner = self.inner.clone();
735                    let fut = async move {
736                        let method = HandleConfigSvc(inner);
737                        let codec = tonic::codec::ProstCodec::default();
738                        let mut grpc = tonic::server::Grpc::new(codec)
739                            .apply_compression_config(
740                                accept_compression_encodings,
741                                send_compression_encodings,
742                            )
743                            .apply_max_message_size_config(
744                                max_decoding_message_size,
745                                max_encoding_message_size,
746                            );
747                        let res = grpc.unary(method, req).await;
748                        Ok(res)
749                    };
750                    Box::pin(fut)
751                }
752                _ => {
753                    Box::pin(async move {
754                        let mut response = http::Response::new(empty_body());
755                        let headers = response.headers_mut();
756                        headers
757                            .insert(
758                                tonic::Status::GRPC_STATUS,
759                                (tonic::Code::Unimplemented as i32).into(),
760                            );
761                        headers
762                            .insert(
763                                http::header::CONTENT_TYPE,
764                                tonic::metadata::GRPC_CONTENT_TYPE,
765                            );
766                        Ok(response)
767                    })
768                }
769            }
770        }
771    }
772    impl<T> Clone for WallGuardServer<T> {
773        fn clone(&self) -> Self {
774            let inner = self.inner.clone();
775            Self {
776                inner,
777                accept_compression_encodings: self.accept_compression_encodings,
778                send_compression_encodings: self.send_compression_encodings,
779                max_decoding_message_size: self.max_decoding_message_size,
780                max_encoding_message_size: self.max_encoding_message_size,
781            }
782        }
783    }
784    /// Generated gRPC service name
785    pub const SERVICE_NAME: &str = "wallguard.WallGuard";
786    impl<T> tonic::server::NamedService for WallGuardServer<T> {
787        const NAME: &'static str = SERVICE_NAME;
788    }
789}