fix not compiling
This commit is contained in:
parent
98193a58d8
commit
8e7aacbbd1
8 changed files with 78 additions and 71 deletions
|
|
@ -1,4 +1,4 @@
|
||||||
use rust_nex::reggie::UnitPacketRead;
|
use rust_nex::reggie::{RemoteController, UnitPacketRead};
|
||||||
use log::{error, info};
|
use log::{error, info};
|
||||||
use once_cell::sync::Lazy;
|
use once_cell::sync::Lazy;
|
||||||
use rustls::client::danger::HandshakeSignatureValid;
|
use rustls::client::danger::HandshakeSignatureValid;
|
||||||
|
|
@ -23,10 +23,10 @@ use tokio::net::{TcpListener, TcpSocket};
|
||||||
use tokio::task;
|
use tokio::task;
|
||||||
use tokio_rustls::TlsAcceptor;
|
use tokio_rustls::TlsAcceptor;
|
||||||
use rust_nex::define_rmc_proto;
|
use rust_nex::define_rmc_proto;
|
||||||
use rust_nex::executables::common::{RemoteController, OWN_IP_PRIVATE, SECURE_SERVER_ACCOUNT, SERVER_PORT};
|
use rust_nex::executables::common::{OWN_IP_PRIVATE, SECURE_SERVER_ACCOUNT, SERVER_PORT};
|
||||||
use rust_nex::executables::common::ServerCluster::{Auth, Secure};
|
|
||||||
use rust_nex::executables::common::ServerType::Backend;
|
|
||||||
use rust_nex::nex::auth_handler::AuthHandler;
|
use rust_nex::nex::auth_handler::AuthHandler;
|
||||||
|
use rust_nex::reggie::ServerCluster::Auth;
|
||||||
|
use rust_nex::reggie::ServerType::Backend;
|
||||||
use rust_nex::rmc::protocols::{new_rmc_gateway_connection, OnlyRemote};
|
use rust_nex::rmc::protocols::{new_rmc_gateway_connection, OnlyRemote};
|
||||||
use rust_nex::rmc::response::ErrorCode;
|
use rust_nex::rmc::response::ErrorCode;
|
||||||
use rust_nex::rmc::structures::RmcSerialize;
|
use rust_nex::rmc::structures::RmcSerialize;
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
use std::io::Cursor;
|
use std::io::Cursor;
|
||||||
use rust_nex::rmc::structures::RmcSerialize;
|
use rust_nex::rmc::structures::RmcSerialize;
|
||||||
use rust_nex::reggie::UnitPacketRead;
|
use rust_nex::reggie::{RemoteController, UnitPacketRead};
|
||||||
use std::net::SocketAddrV4;
|
use std::net::SocketAddrV4;
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
use std::sync::atomic::AtomicU32;
|
use std::sync::atomic::AtomicU32;
|
||||||
|
|
@ -8,13 +8,13 @@ use log::{error, info};
|
||||||
use tokio::net::TcpListener;
|
use tokio::net::TcpListener;
|
||||||
use tokio::task;
|
use tokio::task;
|
||||||
use rust_nex::common::setup;
|
use rust_nex::common::setup;
|
||||||
use rust_nex::executables::common::{RemoteController, RemoteControllerManagement, OWN_IP_PRIVATE, SERVER_PORT};
|
use rust_nex::executables::common::{OWN_IP_PRIVATE, SERVER_PORT};
|
||||||
use rust_nex::executables::common::ServerCluster::Secure;
|
|
||||||
use rust_nex::executables::common::ServerType::Backend;
|
|
||||||
use rust_nex::nex::matchmake::MatchmakeManager;
|
use rust_nex::nex::matchmake::MatchmakeManager;
|
||||||
use rust_nex::nex::remote_console::RemoteConsole;
|
use rust_nex::nex::remote_console::RemoteConsole;
|
||||||
use rust_nex::nex::user::User;
|
use rust_nex::nex::user::User;
|
||||||
use rust_nex::reggie::get_configured_tls_acceptor;
|
use rust_nex::reggie::get_configured_tls_acceptor;
|
||||||
|
use rust_nex::reggie::ServerCluster::Secure;
|
||||||
|
use rust_nex::reggie::ServerType::Backend;
|
||||||
use rust_nex::rmc::protocols::{new_rmc_gateway_connection, OnlyRemote};
|
use rust_nex::rmc::protocols::{new_rmc_gateway_connection, OnlyRemote};
|
||||||
use rust_nex::rnex_proxy_common::ConnectionInitData;
|
use rust_nex::rnex_proxy_common::ConnectionInitData;
|
||||||
use rust_nex::rmc::protocols::RemoteInstantiatable;
|
use rust_nex::rmc::protocols::RemoteInstantiatable;
|
||||||
|
|
|
||||||
|
|
@ -41,50 +41,3 @@ pub static SECURE_SERVER_ACCOUNT: Lazy<Account> =
|
||||||
Lazy::new(|| Account::new(2, "Quazal Rendez-Vous", &KERBEROS_SERVER_PASSWORD));
|
Lazy::new(|| Account::new(2, "Quazal Rendez-Vous", &KERBEROS_SERVER_PASSWORD));
|
||||||
|
|
||||||
|
|
||||||
#[rmc_proto(1)]
|
|
||||||
pub trait ProxyManagement {
|
|
||||||
#[method_id(1)]
|
|
||||||
async fn update_url(&self, url: String) -> Result<(), ErrorCode>;
|
|
||||||
}
|
|
||||||
|
|
||||||
define_rmc_proto!(
|
|
||||||
proto Proxy{
|
|
||||||
ProxyManagement
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
#[rmc_proto(2)]
|
|
||||||
pub trait ControllerManagement {
|
|
||||||
#[method_id(1)]
|
|
||||||
async fn get_secure_proxy_url(&self) -> Result<String, ErrorCode>;
|
|
||||||
|
|
||||||
#[method_id(2)]
|
|
||||||
async fn get_secure_account(&self) -> Result<Account, ErrorCode>;
|
|
||||||
}
|
|
||||||
|
|
||||||
define_rmc_proto!(
|
|
||||||
proto Controller{
|
|
||||||
ControllerManagement
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
#[derive(RmcSerialize)]
|
|
||||||
#[repr(u32)]
|
|
||||||
pub enum ServerCluster{
|
|
||||||
Auth = 0,
|
|
||||||
Secure = 1
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(RmcSerialize)]
|
|
||||||
#[repr(u32)]
|
|
||||||
pub enum ServerType{
|
|
||||||
Proxy{
|
|
||||||
addr: SocketAddrV4,
|
|
||||||
cluster: ServerCluster
|
|
||||||
} = 1,
|
|
||||||
Backend{
|
|
||||||
name: String,
|
|
||||||
cluster: ServerCluster
|
|
||||||
} = 2,
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,9 +5,8 @@ use std::io::Cursor;
|
||||||
use std::net::{Ipv4Addr, SocketAddrV4};
|
use std::net::{Ipv4Addr, SocketAddrV4};
|
||||||
use macros::rmc_struct;
|
use macros::rmc_struct;
|
||||||
use rust_nex::common::setup;
|
use rust_nex::common::setup;
|
||||||
use rust_nex::executables::common::{ControllerManagement, LocalController, RemoteProxy, RemoteProxyManagement, ServerCluster, ServerType, KERBEROS_SERVER_PASSWORD};
|
|
||||||
use rust_nex::prudp::station_url::StationUrl;
|
use rust_nex::prudp::station_url::StationUrl;
|
||||||
use rust_nex::reggie::{get_configured_tls_acceptor, TestStruct, WebStreamSocket};
|
use rust_nex::reggie::{get_configured_tls_acceptor, ControllerManagement, RemoteProxy, ServerCluster, ServerType, TestStruct, WebStreamSocket};
|
||||||
use rust_nex::rmc::protocols::{new_rmc_gateway_connection, OnlyRemote};
|
use rust_nex::rmc::protocols::{new_rmc_gateway_connection, OnlyRemote};
|
||||||
use rust_nex::rmc::response::ErrorCode;
|
use rust_nex::rmc::response::ErrorCode;
|
||||||
use rust_nex::reggie::UnitPacketRead;
|
use rust_nex::reggie::UnitPacketRead;
|
||||||
|
|
@ -19,10 +18,13 @@ use tokio::net::TcpListener;
|
||||||
use tokio::sync::RwLock;
|
use tokio::sync::RwLock;
|
||||||
use tokio::task;
|
use tokio::task;
|
||||||
use tungstenite::client;
|
use tungstenite::client;
|
||||||
|
use rust_nex::executables::common::KERBEROS_SERVER_PASSWORD;
|
||||||
use rust_nex::nex::account::Account;
|
use rust_nex::nex::account::Account;
|
||||||
use rust_nex::rmc::response::ErrorCode::{Core_Exception, Core_InvalidIndex};
|
use rust_nex::rmc::response::ErrorCode::{Core_Exception, Core_InvalidIndex};
|
||||||
use rust_nex::rmc::protocols::RemoteInstantiatable;
|
use rust_nex::rmc::protocols::RemoteInstantiatable;
|
||||||
use rust_nex::util::SendingBufferConnection;
|
use rust_nex::util::SendingBufferConnection;
|
||||||
|
use rust_nex::reggie::LocalController;
|
||||||
|
use rust_nex::reggie::RemoteProxyManagement;
|
||||||
|
|
||||||
pub static AUTH_SERVER_ACCOUNT: Lazy<Account> =
|
pub static AUTH_SERVER_ACCOUNT: Lazy<Account> =
|
||||||
Lazy::new(|| Account::new(1, "Quazal Authentication", &KERBEROS_SERVER_PASSWORD));
|
Lazy::new(|| Account::new(1, "Quazal Authentication", &KERBEROS_SERVER_PASSWORD));
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
|
|
||||||
|
use rust_nex::reggie::LocalProxy;
|
||||||
use rust_nex::executables::common::{LocalProxy, ProxyManagement, RemoteController, OWN_IP_PUBLIC};
|
|
||||||
use std::env;
|
use std::env;
|
||||||
use std::ffi::CStr;
|
use std::ffi::CStr;
|
||||||
use std::io::{Read, Write};
|
use std::io::{Read, Write};
|
||||||
|
|
@ -24,14 +23,14 @@ use tokio::sync::RwLock;
|
||||||
use tokio::task;
|
use tokio::task;
|
||||||
use tokio::time::sleep;
|
use tokio::time::sleep;
|
||||||
use rust_nex::common::setup;
|
use rust_nex::common::setup;
|
||||||
use rust_nex::executables::common::{OWN_IP_PRIVATE, SERVER_PORT};
|
use rust_nex::executables::common::{OWN_IP_PRIVATE, OWN_IP_PUBLIC, SERVER_PORT};
|
||||||
use rust_nex::executables::common::ServerCluster::Auth;
|
|
||||||
use rust_nex::executables::common::ServerType::{Backend, Proxy};
|
|
||||||
use rust_nex::prudp::packet::VirtualPort;
|
use rust_nex::prudp::packet::VirtualPort;
|
||||||
use rust_nex::prudp::router::Router;
|
use rust_nex::prudp::router::Router;
|
||||||
use rust_nex::prudp::station_url::StationUrl;
|
use rust_nex::prudp::station_url::StationUrl;
|
||||||
use rust_nex::prudp::unsecure::Unsecure;
|
use rust_nex::prudp::unsecure::Unsecure;
|
||||||
use rust_nex::reggie::{establish_tls_connection_to, UnitPacketRead, UnitPacketWrite};
|
use rust_nex::reggie::{establish_tls_connection_to, ProxyManagement, UnitPacketRead, UnitPacketWrite};
|
||||||
|
use rust_nex::reggie::ServerCluster::Auth;
|
||||||
|
use rust_nex::reggie::ServerType::Proxy;
|
||||||
use rust_nex::rmc::protocols::OnlyRemote;
|
use rust_nex::rmc::protocols::OnlyRemote;
|
||||||
use rust_nex::rmc::response::ErrorCode;
|
use rust_nex::rmc::response::ErrorCode;
|
||||||
use rust_nex::rmc::structures::RmcSerialize;
|
use rust_nex::rmc::structures::RmcSerialize;
|
||||||
|
|
|
||||||
|
|
@ -8,21 +8,23 @@ use tokio::sync::RwLock;
|
||||||
use tokio::task;
|
use tokio::task;
|
||||||
use tokio::time::sleep;
|
use tokio::time::sleep;
|
||||||
use rust_nex::common::setup;
|
use rust_nex::common::setup;
|
||||||
use rust_nex::executables::common::{ProxyManagement, RemoteController, RemoteControllerManagement, OWN_IP_PRIVATE, OWN_IP_PUBLIC, SECURE_SERVER_ACCOUNT, SERVER_PORT};
|
use rust_nex::executables::common::{OWN_IP_PRIVATE, OWN_IP_PUBLIC, SERVER_PORT};
|
||||||
use rust_nex::executables::common::ServerCluster::Auth;
|
|
||||||
use rust_nex::executables::common::ServerType::Proxy;
|
|
||||||
use rust_nex::prudp::packet::VirtualPort;
|
use rust_nex::prudp::packet::VirtualPort;
|
||||||
use rust_nex::prudp::router::Router;
|
use rust_nex::prudp::router::Router;
|
||||||
use rust_nex::prudp::secure::Secure;
|
use rust_nex::prudp::secure::Secure;
|
||||||
use rust_nex::prudp::unsecure::Unsecure;
|
use rust_nex::prudp::unsecure::Unsecure;
|
||||||
use rust_nex::reggie::establish_tls_connection_to;
|
use rust_nex::reggie::{establish_tls_connection_to, ProxyManagement, RemoteController};
|
||||||
use rust_nex::rmc::response::ErrorCode;
|
use rust_nex::rmc::response::ErrorCode;
|
||||||
use rust_nex::rnex_proxy_common::ConnectionInitData;
|
use rust_nex::rnex_proxy_common::ConnectionInitData;
|
||||||
use rust_nex::executables::common::LocalProxy;
|
use rust_nex::reggie::ServerCluster::Auth;
|
||||||
|
use rust_nex::reggie::ServerType::Proxy;
|
||||||
use rust_nex::reggie::UnitPacketWrite;
|
use rust_nex::reggie::UnitPacketWrite;
|
||||||
use rust_nex::rmc::structures::RmcSerialize;
|
use rust_nex::rmc::structures::RmcSerialize;
|
||||||
use rust_nex::reggie::UnitPacketRead;
|
use rust_nex::reggie::UnitPacketRead;
|
||||||
use rust_nex::rmc::protocols::RemoteInstantiatable;
|
use rust_nex::rmc::protocols::RemoteInstantiatable;
|
||||||
|
use rust_nex::reggie::LocalProxy;
|
||||||
|
use rust_nex::reggie::RemoteControllerManagement;
|
||||||
|
|
||||||
|
|
||||||
#[rmc_struct(Proxy)]
|
#[rmc_struct(Proxy)]
|
||||||
struct DestinationHolder{
|
struct DestinationHolder{
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,4 @@
|
||||||
use crate::executables::common::RemoteControllerManagement;
|
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
use rust_nex::executables::common::RemoteController;
|
|
||||||
use crate::grpc::account;
|
use crate::grpc::account;
|
||||||
use crate::kerberos::{derive_key, KerberosDateTime, Ticket};
|
use crate::kerberos::{derive_key, KerberosDateTime, Ticket};
|
||||||
use crate::nex::account::Account;
|
use crate::nex::account::Account;
|
||||||
|
|
@ -12,6 +10,7 @@ use crate::rmc::structures::connection_data::ConnectionData;
|
||||||
use crate::rmc::structures::qresult::QResult;
|
use crate::rmc::structures::qresult::QResult;
|
||||||
use crate::{define_rmc_proto, kerberos};
|
use crate::{define_rmc_proto, kerberos};
|
||||||
use macros::rmc_struct;
|
use macros::rmc_struct;
|
||||||
|
use crate::reggie::{RemoteController, RemoteControllerManagement};
|
||||||
use crate::rmc::protocols::OnlyRemote;
|
use crate::rmc::protocols::OnlyRemote;
|
||||||
|
|
||||||
define_rmc_proto!(
|
define_rmc_proto!(
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,11 @@
|
||||||
use std::{env, fs, io};
|
use std::{env, fs, io};
|
||||||
use std::io::{Error, ErrorKind};
|
use std::io::{Error, ErrorKind};
|
||||||
|
use std::net::SocketAddrV4;
|
||||||
use std::pin::Pin;
|
use std::pin::Pin;
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
use std::task::{Context, Poll};
|
use std::task::{Context, Poll};
|
||||||
use futures::{SinkExt, StreamExt};
|
use futures::{SinkExt, StreamExt};
|
||||||
use macros::{method_id, rmc_proto, rmc_struct};
|
use macros::{method_id, rmc_proto, rmc_struct, RmcSerialize};
|
||||||
use once_cell::sync::Lazy;
|
use once_cell::sync::Lazy;
|
||||||
use rustls::{ClientConfig, RootCertStore, ServerConfig};
|
use rustls::{ClientConfig, RootCertStore, ServerConfig};
|
||||||
use rustls::client::WebPkiServerVerifier;
|
use rustls::client::WebPkiServerVerifier;
|
||||||
|
|
@ -20,6 +21,7 @@ use tokio_tungstenite::tungstenite::Message;
|
||||||
use webpki::anchor_from_trusted_cert;
|
use webpki::anchor_from_trusted_cert;
|
||||||
use rust_nex::common::setup;
|
use rust_nex::common::setup;
|
||||||
use crate::define_rmc_proto;
|
use crate::define_rmc_proto;
|
||||||
|
use crate::nex::account::Account;
|
||||||
use crate::rmc::protocols::{new_rmc_gateway_connection, OnlyRemote, RmcCallable, RmcConnection};
|
use crate::rmc::protocols::{new_rmc_gateway_connection, OnlyRemote, RmcCallable, RmcConnection};
|
||||||
use crate::rmc::response::ErrorCode;
|
use crate::rmc::response::ErrorCode;
|
||||||
use crate::rmc::structures::RmcSerialize;
|
use crate::rmc::structures::RmcSerialize;
|
||||||
|
|
@ -365,3 +367,53 @@ async fn test_server(){
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#[rmc_proto(1)]
|
||||||
|
pub trait ProxyManagement {
|
||||||
|
#[method_id(1)]
|
||||||
|
async fn update_url(&self, url: String) -> Result<(), ErrorCode>;
|
||||||
|
}
|
||||||
|
|
||||||
|
define_rmc_proto!(
|
||||||
|
proto Proxy{
|
||||||
|
ProxyManagement
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
#[rmc_proto(2)]
|
||||||
|
pub trait ControllerManagement {
|
||||||
|
#[method_id(1)]
|
||||||
|
async fn get_secure_proxy_url(&self) -> Result<String, ErrorCode>;
|
||||||
|
|
||||||
|
#[method_id(2)]
|
||||||
|
async fn get_secure_account(&self) -> Result<Account, ErrorCode>;
|
||||||
|
}
|
||||||
|
|
||||||
|
define_rmc_proto!(
|
||||||
|
proto Controller{
|
||||||
|
ControllerManagement
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
#[derive(RmcSerialize)]
|
||||||
|
#[repr(u32)]
|
||||||
|
pub enum ServerCluster{
|
||||||
|
Auth = 0,
|
||||||
|
Secure = 1
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(RmcSerialize)]
|
||||||
|
#[repr(u32)]
|
||||||
|
pub enum ServerType{
|
||||||
|
Proxy{
|
||||||
|
addr: SocketAddrV4,
|
||||||
|
cluster: ServerCluster
|
||||||
|
} = 1,
|
||||||
|
Backend{
|
||||||
|
name: String,
|
||||||
|
cluster: ServerCluster
|
||||||
|
} = 2,
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue