Basic vsock proxying implementation
Currently just connecting to the host's session bus
This commit is contained in:
parent
11a682e19f
commit
14ce212e81
12 changed files with 1807 additions and 34 deletions
|
|
@ -1,3 +1,33 @@
|
|||
fn main() {
|
||||
println!("Hello, world!");
|
||||
mod vsock;
|
||||
|
||||
use clap::Parser;
|
||||
use tracing::info;
|
||||
|
||||
#[derive(Parser)]
|
||||
#[command(version, about, long_about = None)]
|
||||
struct BrokerCli {}
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() -> eyre::Result<()> {
|
||||
tracing_subscriber::fmt::init();
|
||||
|
||||
let _cli = BrokerCli::parse();
|
||||
|
||||
vsock::ListenerBuilder::new(vsock::VsockAddr::new(vsock::VMADDR_CID_HOST, 4269))
|
||||
.with_label("VM Bus")
|
||||
.listen(async |client| {
|
||||
let session_bus = zbus::connection::Builder::session()
|
||||
.unwrap()
|
||||
.p2p() /* i.e. "raw connection, don't send Hello" */
|
||||
.build()
|
||||
.await
|
||||
.unwrap();
|
||||
info!(guid = %session_bus.server_guid(), "connected to session bus");
|
||||
let client_conn = client.build(session_bus.server_guid().into()).await?;
|
||||
sidebus_common::raw::splice_conns(client_conn, session_bus).await;
|
||||
Ok(())
|
||||
})
|
||||
.await?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue