Skip to content

Commit

Permalink
generate rust gRPC bindings
Browse files Browse the repository at this point in the history
  • Loading branch information
KCarretto committed Jan 21, 2024
1 parent c018c74 commit 7ff3d25
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions implants/lib/c2/src/c2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,18 @@ pub struct ReportTaskOutputRequest {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ReportTaskOutputResponse {}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]

Check warning on line 147 in implants/lib/c2/src/c2.rs

View check run for this annotation

Codecov / codecov/patch

implants/lib/c2/src/c2.rs#L147

Added line #L147 was not covered by tests
pub struct DownloadFileRequest {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]

Check warning on line 153 in implants/lib/c2/src/c2.rs

View check run for this annotation

Codecov / codecov/patch

implants/lib/c2/src/c2.rs#L153

Added line #L153 was not covered by tests
pub struct DownloadFileResponse {
#[prost(bytes = "vec", tag = "1")]
pub chunk: ::prost::alloc::vec::Vec<u8>,
}
/// Generated client implementations.
pub mod c2_client {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
Expand Down Expand Up @@ -272,5 +284,27 @@ pub mod c2_client {
req.extensions_mut().insert(GrpcMethod::new("c2.C2", "ReportTaskOutput"));
self.inner.unary(req, path, codec).await
}
pub async fn download_file(
&mut self,
request: impl tonic::IntoRequest<super::DownloadFileRequest>,
) -> std::result::Result<
tonic::Response<tonic::codec::Streaming<super::DownloadFileResponse>>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static("/c2.C2/DownloadFile");
let mut req = request.into_request();
req.extensions_mut().insert(GrpcMethod::new("c2.C2", "DownloadFile"));
self.inner.server_streaming(req, path, codec).await
}

Check warning on line 308 in implants/lib/c2/src/c2.rs

View check run for this annotation

Codecov / codecov/patch

implants/lib/c2/src/c2.rs#L287-L308

Added lines #L287 - L308 were not covered by tests
}
}

0 comments on commit 7ff3d25

Please sign in to comment.