Commit 397993e1 authored by nanamicat's avatar nanamicat

log

parent cfc7b0ea
Pipeline #41970 passed with stages
in 32 seconds
......@@ -66,6 +66,7 @@ impl Router {
}
pub fn create_socket(config: &ConfigRouter) -> Result<Socket> {
println!("create_socket {}", config.remote_id);
match config.schema {
Schema::IP => {
let result = Socket::new(config.family, Type::RAW, Some(Protocol::from(config.proto as i32)))?;
......@@ -328,6 +329,7 @@ impl Router {
}
fn create_tun_device(config: &ConfigRouter) -> Result<Device> {
println!("create_tun_device {}", config.remote_id);
let mut tun_config = tun::Configuration::default();
tun_config.tun_name(config.dev.as_str()).up();
......@@ -339,6 +341,7 @@ impl Router {
}
fn create_endpoint(config: &ConfigRouter) -> Atomic<SockAddr> {
println!("create_endpoint {}", config.remote_id);
match (config.endpoint.clone(), config.dst_port)
.to_socket_addrs()
.unwrap_or_default()
......@@ -355,6 +358,7 @@ impl Router {
}
pub fn new(config: ConfigRouter) -> Result<Router> {
println!("creating {}", config.remote_id);
let router = Router {
tun: Self::create_tun_device(&config)?,
endpoint: Self::create_endpoint(&config),
......@@ -362,7 +366,7 @@ impl Router {
tcp_listener_connection: Atomic::null(),
config,
};
println!("run_up_script {}", &router.config.remote_id);
Self::run_up_script(&router.config)?;
Ok(router)
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment