summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
dd09e07)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
#[allow(dead_code)] // xxx
#[allow(unused_variables)] // xxx
pub async fn run(global: Arc<Global>,
#[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;
mut ipif: Ipif) -> Result<Void,AE> {
let r = async {
let mut goodness: i32 = 0;
- // 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) =>
{
data = Ipif::next_frame(&mut ipif.tx) =>
{
pub use extend::ext;
pub use fehler::{throw, throws};
pub use futures::{poll, future, FutureExt, StreamExt, TryStreamExt};
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;
pub use hyper::{Method, Uri};
pub use hyper_tls::HttpsConnector;
pub use ipnet::IpNet;