xref: /aosp_15_r20/tools/netsim/rust/daemon/src/wifi/libslirp_cf.rs (revision cf78ab8cffb8fc9207af348f23af247fb04370a6)
1 // Copyright 2024 Google LLC
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 //     https://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 /// LibSlirp Interface for Network Simulation
16 use bytes::Bytes;
17 use netsim_proto::config::SlirpOptions as ProtoSlirpOptions;
18 use std::sync::mpsc;
19 
20 // Provides a stub implementation while the libslirp-rs crate is not integrated into the aosp-main.
21 pub struct LibSlirp {}
22 impl LibSlirp {
input(&self, _bytes: Bytes)23     pub fn input(&self, _bytes: Bytes) {}
24 }
25 
slirp_run( _opt: ProtoSlirpOptions, _tx_bytes: mpsc::Sender<Bytes>, ) -> anyhow::Result<LibSlirp>26 pub fn slirp_run(
27     _opt: ProtoSlirpOptions,
28     _tx_bytes: mpsc::Sender<Bytes>,
29 ) -> anyhow::Result<LibSlirp> {
30     Ok(LibSlirp {})
31 }
32