#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct PathsRequest {
#[prost(uint64, tag = "1")]
pub source_isd_as: u64,
#[prost(uint64, tag = "2")]
pub destination_isd_as: u64,
#[prost(bool, tag = "3")]
pub refresh: bool,
#[prost(bool, tag = "4")]
pub hidden: bool,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PathsResponse {
#[prost(message, repeated, tag = "1")]
pub paths: ::prost::alloc::vec::Vec<Path>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Path {
#[prost(bytes = "vec", tag = "1")]
pub raw: ::prost::alloc::vec::Vec<u8>,
#[prost(message, optional, tag = "2")]
pub interface: ::core::option::Option<Interface>,
#[prost(message, repeated, tag = "3")]
pub interfaces: ::prost::alloc::vec::Vec<PathInterface>,
#[prost(uint32, tag = "4")]
pub mtu: u32,
#[prost(message, optional, tag = "5")]
pub expiration: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, repeated, tag = "6")]
pub latency: ::prost::alloc::vec::Vec<::prost_types::Duration>,
#[prost(uint64, repeated, tag = "7")]
pub bandwidth: ::prost::alloc::vec::Vec<u64>,
#[prost(message, repeated, tag = "8")]
pub geo: ::prost::alloc::vec::Vec<GeoCoordinates>,
#[prost(enumeration = "LinkType", repeated, tag = "9")]
pub link_type: ::prost::alloc::vec::Vec<i32>,
#[prost(uint32, repeated, tag = "10")]
pub internal_hops: ::prost::alloc::vec::Vec<u32>,
#[prost(string, repeated, tag = "11")]
pub notes: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(message, optional, tag = "12")]
pub epic_auths: ::core::option::Option<EpicAuths>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct EpicAuths {
#[prost(bytes = "vec", tag = "1")]
pub auth_phvf: ::prost::alloc::vec::Vec<u8>,
#[prost(bytes = "vec", tag = "2")]
pub auth_lhvf: ::prost::alloc::vec::Vec<u8>,
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct PathInterface {
#[prost(uint64, tag = "1")]
pub isd_as: u64,
#[prost(uint64, tag = "2")]
pub id: u64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GeoCoordinates {
#[prost(float, tag = "1")]
pub latitude: f32,
#[prost(float, tag = "2")]
pub longitude: f32,
#[prost(string, tag = "3")]
pub address: ::prost::alloc::string::String,
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct AsRequest {
#[prost(uint64, tag = "1")]
pub isd_as: u64,
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct AsResponse {
#[prost(uint64, tag = "1")]
pub isd_as: u64,
#[prost(bool, tag = "2")]
pub core: bool,
#[prost(uint32, tag = "3")]
pub mtu: u32,
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct InterfacesRequest {}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct InterfacesResponse {
#[prost(map = "uint64, message", tag = "1")]
pub interfaces: ::std::collections::HashMap<u64, Interface>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Interface {
#[prost(message, optional, tag = "1")]
pub address: ::core::option::Option<Underlay>,
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct ServicesRequest {}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ServicesResponse {
#[prost(map = "string, message", tag = "1")]
pub services: ::std::collections::HashMap<
::prost::alloc::string::String,
ListService,
>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListService {
#[prost(message, repeated, tag = "1")]
pub services: ::prost::alloc::vec::Vec<Service>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Service {
#[prost(string, tag = "1")]
pub uri: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Underlay {
#[prost(string, tag = "1")]
pub address: ::prost::alloc::string::String,
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct NotifyInterfaceDownRequest {
#[prost(uint64, tag = "1")]
pub isd_as: u64,
#[prost(uint64, tag = "2")]
pub id: u64,
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct NotifyInterfaceDownResponse {}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DrKeyHostAsRequest {
#[prost(message, optional, tag = "1")]
pub val_time: ::core::option::Option<::prost_types::Timestamp>,
#[prost(enumeration = "super::super::drkey::v1::Protocol", tag = "2")]
pub protocol_id: i32,
#[prost(uint64, tag = "3")]
pub src_ia: u64,
#[prost(uint64, tag = "4")]
pub dst_ia: u64,
#[prost(string, tag = "5")]
pub src_host: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DrKeyHostAsResponse {
#[prost(message, optional, tag = "1")]
pub epoch_begin: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "2")]
pub epoch_end: ::core::option::Option<::prost_types::Timestamp>,
#[prost(bytes = "vec", tag = "3")]
pub key: ::prost::alloc::vec::Vec<u8>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DrKeyAsHostRequest {
#[prost(message, optional, tag = "1")]
pub val_time: ::core::option::Option<::prost_types::Timestamp>,
#[prost(enumeration = "super::super::drkey::v1::Protocol", tag = "2")]
pub protocol_id: i32,
#[prost(uint64, tag = "3")]
pub src_ia: u64,
#[prost(uint64, tag = "4")]
pub dst_ia: u64,
#[prost(string, tag = "5")]
pub dst_host: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DrKeyAsHostResponse {
#[prost(message, optional, tag = "1")]
pub epoch_begin: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "2")]
pub epoch_end: ::core::option::Option<::prost_types::Timestamp>,
#[prost(bytes = "vec", tag = "3")]
pub key: ::prost::alloc::vec::Vec<u8>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DrKeyHostHostRequest {
#[prost(message, optional, tag = "1")]
pub val_time: ::core::option::Option<::prost_types::Timestamp>,
#[prost(enumeration = "super::super::drkey::v1::Protocol", tag = "2")]
pub protocol_id: i32,
#[prost(uint64, tag = "3")]
pub src_ia: u64,
#[prost(uint64, tag = "4")]
pub dst_ia: u64,
#[prost(string, tag = "5")]
pub src_host: ::prost::alloc::string::String,
#[prost(string, tag = "6")]
pub dst_host: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DrKeyHostHostResponse {
#[prost(message, optional, tag = "1")]
pub epoch_begin: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "2")]
pub epoch_end: ::core::option::Option<::prost_types::Timestamp>,
#[prost(bytes = "vec", tag = "3")]
pub key: ::prost::alloc::vec::Vec<u8>,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum LinkType {
Unspecified = 0,
Direct = 1,
MultiHop = 2,
OpenNet = 3,
}
impl LinkType {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unspecified => "LINK_TYPE_UNSPECIFIED",
Self::Direct => "LINK_TYPE_DIRECT",
Self::MultiHop => "LINK_TYPE_MULTI_HOP",
Self::OpenNet => "LINK_TYPE_OPEN_NET",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"LINK_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
"LINK_TYPE_DIRECT" => Some(Self::Direct),
"LINK_TYPE_MULTI_HOP" => Some(Self::MultiHop),
"LINK_TYPE_OPEN_NET" => Some(Self::OpenNet),
_ => None,
}
}
}
pub mod daemon_service_client {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
#[derive(Debug, Clone)]
pub struct DaemonServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl DaemonServiceClient<tonic::transport::Channel> {
pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
where
D: TryInto<tonic::transport::Endpoint>,
D::Error: Into<StdError>,
{
let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
Ok(Self::new(conn))
}
}
impl<T> DaemonServiceClient<T>
where
T: tonic::client::GrpcService<tonic::body::BoxBody>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
{
pub fn new(inner: T) -> Self {
let inner = tonic::client::Grpc::new(inner);
Self { inner }
}
pub fn with_origin(inner: T, origin: Uri) -> Self {
let inner = tonic::client::Grpc::with_origin(inner, origin);
Self { inner }
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> DaemonServiceClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
>>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
{
DaemonServiceClient::new(InterceptedService::new(inner, interceptor))
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.send_compressed(encoding);
self
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.accept_compressed(encoding);
self
}
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_decoding_message_size(limit);
self
}
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_encoding_message_size(limit);
self
}
pub async fn paths(
&mut self,
request: impl tonic::IntoRequest<super::PathsRequest>,
) -> std::result::Result<tonic::Response<super::PathsResponse>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/proto.daemon.v1.DaemonService/Paths",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("proto.daemon.v1.DaemonService", "Paths"));
self.inner.unary(req, path, codec).await
}
pub async fn r#as(
&mut self,
request: impl tonic::IntoRequest<super::AsRequest>,
) -> std::result::Result<tonic::Response<super::AsResponse>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/proto.daemon.v1.DaemonService/AS",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("proto.daemon.v1.DaemonService", "AS"));
self.inner.unary(req, path, codec).await
}
pub async fn interfaces(
&mut self,
request: impl tonic::IntoRequest<super::InterfacesRequest>,
) -> std::result::Result<
tonic::Response<super::InterfacesResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/proto.daemon.v1.DaemonService/Interfaces",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("proto.daemon.v1.DaemonService", "Interfaces"));
self.inner.unary(req, path, codec).await
}
pub async fn services(
&mut self,
request: impl tonic::IntoRequest<super::ServicesRequest>,
) -> std::result::Result<
tonic::Response<super::ServicesResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/proto.daemon.v1.DaemonService/Services",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("proto.daemon.v1.DaemonService", "Services"));
self.inner.unary(req, path, codec).await
}
pub async fn notify_interface_down(
&mut self,
request: impl tonic::IntoRequest<super::NotifyInterfaceDownRequest>,
) -> std::result::Result<
tonic::Response<super::NotifyInterfaceDownResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/proto.daemon.v1.DaemonService/NotifyInterfaceDown",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"proto.daemon.v1.DaemonService",
"NotifyInterfaceDown",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn dr_key_as_host(
&mut self,
request: impl tonic::IntoRequest<super::DrKeyAsHostRequest>,
) -> std::result::Result<
tonic::Response<super::DrKeyAsHostResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/proto.daemon.v1.DaemonService/DRKeyASHost",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("proto.daemon.v1.DaemonService", "DRKeyASHost"));
self.inner.unary(req, path, codec).await
}
pub async fn dr_key_host_as(
&mut self,
request: impl tonic::IntoRequest<super::DrKeyHostAsRequest>,
) -> std::result::Result<
tonic::Response<super::DrKeyHostAsResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/proto.daemon.v1.DaemonService/DRKeyHostAS",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("proto.daemon.v1.DaemonService", "DRKeyHostAS"));
self.inner.unary(req, path, codec).await
}
pub async fn dr_key_host_host(
&mut self,
request: impl tonic::IntoRequest<super::DrKeyHostHostRequest>,
) -> std::result::Result<
tonic::Response<super::DrKeyHostHostResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/proto.daemon.v1.DaemonService/DRKeyHostHost",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("proto.daemon.v1.DaemonService", "DRKeyHostHost"),
);
self.inner.unary(req, path, codec).await
}
}
}
pub mod daemon_service_server {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
#[async_trait]
pub trait DaemonService: std::marker::Send + std::marker::Sync + 'static {
async fn paths(
&self,
request: tonic::Request<super::PathsRequest>,
) -> std::result::Result<tonic::Response<super::PathsResponse>, tonic::Status>;
async fn r#as(
&self,
request: tonic::Request<super::AsRequest>,
) -> std::result::Result<tonic::Response<super::AsResponse>, tonic::Status>;
async fn interfaces(
&self,
request: tonic::Request<super::InterfacesRequest>,
) -> std::result::Result<
tonic::Response<super::InterfacesResponse>,
tonic::Status,
>;
async fn services(
&self,
request: tonic::Request<super::ServicesRequest>,
) -> std::result::Result<
tonic::Response<super::ServicesResponse>,
tonic::Status,
>;
async fn notify_interface_down(
&self,
request: tonic::Request<super::NotifyInterfaceDownRequest>,
) -> std::result::Result<
tonic::Response<super::NotifyInterfaceDownResponse>,
tonic::Status,
>;
async fn dr_key_as_host(
&self,
request: tonic::Request<super::DrKeyAsHostRequest>,
) -> std::result::Result<
tonic::Response<super::DrKeyAsHostResponse>,
tonic::Status,
>;
async fn dr_key_host_as(
&self,
request: tonic::Request<super::DrKeyHostAsRequest>,
) -> std::result::Result<
tonic::Response<super::DrKeyHostAsResponse>,
tonic::Status,
>;
async fn dr_key_host_host(
&self,
request: tonic::Request<super::DrKeyHostHostRequest>,
) -> std::result::Result<
tonic::Response<super::DrKeyHostHostResponse>,
tonic::Status,
>;
}
#[derive(Debug)]
pub struct DaemonServiceServer<T> {
inner: Arc<T>,
accept_compression_encodings: EnabledCompressionEncodings,
send_compression_encodings: EnabledCompressionEncodings,
max_decoding_message_size: Option<usize>,
max_encoding_message_size: Option<usize>,
}
impl<T> DaemonServiceServer<T> {
pub fn new(inner: T) -> Self {
Self::from_arc(Arc::new(inner))
}
pub fn from_arc(inner: Arc<T>) -> Self {
Self {
inner,
accept_compression_encodings: Default::default(),
send_compression_encodings: Default::default(),
max_decoding_message_size: None,
max_encoding_message_size: None,
}
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> InterceptedService<Self, F>
where
F: tonic::service::Interceptor,
{
InterceptedService::new(Self::new(inner), interceptor)
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.accept_compression_encodings.enable(encoding);
self
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.send_compression_encodings.enable(encoding);
self
}
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.max_decoding_message_size = Some(limit);
self
}
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.max_encoding_message_size = Some(limit);
self
}
}
impl<T, B> tonic::codegen::Service<http::Request<B>> for DaemonServiceServer<T>
where
T: DaemonService,
B: Body + std::marker::Send + 'static,
B::Error: Into<StdError> + std::marker::Send + 'static,
{
type Response = http::Response<tonic::body::BoxBody>;
type Error = std::convert::Infallible;
type Future = BoxFuture<Self::Response, Self::Error>;
fn poll_ready(
&mut self,
_cx: &mut Context<'_>,
) -> Poll<std::result::Result<(), Self::Error>> {
Poll::Ready(Ok(()))
}
fn call(&mut self, req: http::Request<B>) -> Self::Future {
match req.uri().path() {
"/proto.daemon.v1.DaemonService/Paths" => {
#[allow(non_camel_case_types)]
struct PathsSvc<T: DaemonService>(pub Arc<T>);
impl<
T: DaemonService,
> tonic::server::UnaryService<super::PathsRequest> for PathsSvc<T> {
type Response = super::PathsResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::PathsRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as DaemonService>::paths(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = PathsSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/proto.daemon.v1.DaemonService/AS" => {
#[allow(non_camel_case_types)]
struct ASSvc<T: DaemonService>(pub Arc<T>);
impl<T: DaemonService> tonic::server::UnaryService<super::AsRequest>
for ASSvc<T> {
type Response = super::AsResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::AsRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as DaemonService>::r#as(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = ASSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/proto.daemon.v1.DaemonService/Interfaces" => {
#[allow(non_camel_case_types)]
struct InterfacesSvc<T: DaemonService>(pub Arc<T>);
impl<
T: DaemonService,
> tonic::server::UnaryService<super::InterfacesRequest>
for InterfacesSvc<T> {
type Response = super::InterfacesResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::InterfacesRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as DaemonService>::interfaces(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = InterfacesSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/proto.daemon.v1.DaemonService/Services" => {
#[allow(non_camel_case_types)]
struct ServicesSvc<T: DaemonService>(pub Arc<T>);
impl<
T: DaemonService,
> tonic::server::UnaryService<super::ServicesRequest>
for ServicesSvc<T> {
type Response = super::ServicesResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::ServicesRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as DaemonService>::services(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = ServicesSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/proto.daemon.v1.DaemonService/NotifyInterfaceDown" => {
#[allow(non_camel_case_types)]
struct NotifyInterfaceDownSvc<T: DaemonService>(pub Arc<T>);
impl<
T: DaemonService,
> tonic::server::UnaryService<super::NotifyInterfaceDownRequest>
for NotifyInterfaceDownSvc<T> {
type Response = super::NotifyInterfaceDownResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::NotifyInterfaceDownRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as DaemonService>::notify_interface_down(&inner, request)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = NotifyInterfaceDownSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/proto.daemon.v1.DaemonService/DRKeyASHost" => {
#[allow(non_camel_case_types)]
struct DRKeyASHostSvc<T: DaemonService>(pub Arc<T>);
impl<
T: DaemonService,
> tonic::server::UnaryService<super::DrKeyAsHostRequest>
for DRKeyASHostSvc<T> {
type Response = super::DrKeyAsHostResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::DrKeyAsHostRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as DaemonService>::dr_key_as_host(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = DRKeyASHostSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/proto.daemon.v1.DaemonService/DRKeyHostAS" => {
#[allow(non_camel_case_types)]
struct DRKeyHostASSvc<T: DaemonService>(pub Arc<T>);
impl<
T: DaemonService,
> tonic::server::UnaryService<super::DrKeyHostAsRequest>
for DRKeyHostASSvc<T> {
type Response = super::DrKeyHostAsResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::DrKeyHostAsRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as DaemonService>::dr_key_host_as(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = DRKeyHostASSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/proto.daemon.v1.DaemonService/DRKeyHostHost" => {
#[allow(non_camel_case_types)]
struct DRKeyHostHostSvc<T: DaemonService>(pub Arc<T>);
impl<
T: DaemonService,
> tonic::server::UnaryService<super::DrKeyHostHostRequest>
for DRKeyHostHostSvc<T> {
type Response = super::DrKeyHostHostResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::DrKeyHostHostRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as DaemonService>::dr_key_host_host(&inner, request)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = DRKeyHostHostSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
_ => {
Box::pin(async move {
let mut response = http::Response::new(empty_body());
let headers = response.headers_mut();
headers
.insert(
tonic::Status::GRPC_STATUS,
(tonic::Code::Unimplemented as i32).into(),
);
headers
.insert(
http::header::CONTENT_TYPE,
tonic::metadata::GRPC_CONTENT_TYPE,
);
Ok(response)
})
}
}
}
}
impl<T> Clone for DaemonServiceServer<T> {
fn clone(&self) -> Self {
let inner = self.inner.clone();
Self {
inner,
accept_compression_encodings: self.accept_compression_encodings,
send_compression_encodings: self.send_compression_encodings,
max_decoding_message_size: self.max_decoding_message_size,
max_encoding_message_size: self.max_encoding_message_size,
}
}
}
pub const SERVICE_NAME: &str = "proto.daemon.v1.DaemonService";
impl<T> tonic::server::NamedService for DaemonServiceServer<T> {
const NAME: &'static str = SERVICE_NAME;
}
}