mirror of
https://github.com/aramperes/onetun.git
synced 2025-09-09 11:18:30 -04:00
Initial commit
This commit is contained in:
commit
d82b496937
5 changed files with 963 additions and 0 deletions
27
src/main.rs
Normal file
27
src/main.rs
Normal file
|
@ -0,0 +1,27 @@
|
|||
#[macro_use]
|
||||
extern crate log;
|
||||
|
||||
use std::net::UdpSocket;
|
||||
use std::sync::Arc;
|
||||
|
||||
use anyhow::Context;
|
||||
use boringtun::crypto::{X25519PublicKey, X25519SecretKey};
|
||||
use boringtun::device::peer::Peer;
|
||||
use boringtun::noise::Tunn;
|
||||
use clap::{App, Arg};
|
||||
|
||||
use crate::config::Config;
|
||||
|
||||
mod config;
|
||||
|
||||
fn main() -> anyhow::Result<()> {
|
||||
pretty_env_logger::init_custom_env("ONETUN_LOG");
|
||||
let config = Config::from_args().with_context(|| "Failed to read config")?;
|
||||
debug!("Parsed arguments: {:?}", config);
|
||||
|
||||
// TODO
|
||||
// 1. Listen on source addr (sA) -> encapsulate packets with peer IP -> send to endpoint IP (sB)
|
||||
// 2. Connect to endpoint IP (sB) -> decapsulate packets -> send to source addr (sA)
|
||||
|
||||
Ok(())
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue