#[allow(dead_code)] // xxx
#[allow(unused_variables)] // xxx
pub async fn run(global: Arc<Global>,
- rx: mpsc::Receiver<RoutedPacket>,
+ mut rx: mpsc::Receiver<RoutedPacket>,
mut ipif: Ipif) -> Result<Void,AE> {
let r = async {
let mut goodness: i32 = 0;
select!{
biased;
- // xxx something something rx something
+ data = rx.recv() =>
+ {
+ let data = data.ok_or_else(|| anyhow!("rx stream end!"))?;
+ let mut data = &*data.data;
+ let mut slip_end = &[SLIP_END][..];
+ let mut buf = Buf::chain(&mut data, &mut slip_end);
+ ipif.rx.write_all_buf(&mut buf).await
+ .context("write to ipif")?;
+ },
data = Ipif::next_frame(&mut ipif.tx) =>
{
}
},
}
- }
+ },
}
}
}.await;
pub use extend::ext;
pub use fehler::{throw, throws};
pub use futures::{poll, future, FutureExt, StreamExt, TryStreamExt};
-pub use hyper::body::{Bytes, Buf as _};
+pub use hyper::body::{Bytes, Buf};
pub use hyper::{Method, Uri};
pub use hyper_tls::HttpsConnector;
pub use ipnet::IpNet;