Skip to content

Commit

Permalink
minor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
e1732a364fed committed Jan 1, 2099
1 parent 0be6369 commit 828ff80
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 41 deletions.
12 changes: 6 additions & 6 deletions rucimp/src/map/quic/client/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use async_trait::async_trait;
use bytes::BytesMut;
use ruci::map::*;
use ruci::net::CID;
use ruci::Name;
// use ruci::Name;
use ruci::{map, net::Stream};

use macro_map::*;
Expand All @@ -25,11 +25,11 @@ pub struct Client {
server_name: String,
}

impl Name for Client {
fn name(&self) -> &'static str {
"quic_client"
}
}
// impl Name for Client {
// fn name(&self) -> &'static str {
// "quic_client"
// }
// }

impl Client {
pub fn new(c: crate::map::quic_common::ClientConfig) -> anyhow::Result<Self> {
Expand Down
12 changes: 6 additions & 6 deletions rucimp/src/map/quic/server/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use anyhow::Context;
use async_trait::async_trait;
use ruci::map::*;
use ruci::net::CID;
use ruci::Name;
// use ruci::Name;
use ruci::{map, net::Stream};

use macro_map::*;
Expand All @@ -26,11 +26,11 @@ pub struct Server {
a_next_cid: Arc<AtomicU32>,
}

impl Name for Server {
fn name(&self) -> &'static str {
"quic_server"
}
}
// impl Name for Server {
// fn name(&self) -> &'static str {
// "quic_server"
// }
// }

impl Server {
pub fn new(c: ServerConfig) -> Self {
Expand Down
12 changes: 6 additions & 6 deletions rucimp/src/map/steganography/ai_generated/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use base64::{engine::general_purpose::STANDARD as BASE64, Engine as _};
use rainbow::NetworkSteganographyProcessor;
use reqwest;

use ruci::Name;
// use ruci::Name;
use serde::{Deserialize, Serialize};
use serde_json::json;

Expand Down Expand Up @@ -114,11 +114,11 @@ impl AIGeneratedProcessor {
}
}

impl Name for AIGeneratedProcessor {
fn name(&self) -> &str {
"AIGeneratedProcessor"
}
}
// impl Name for AIGeneratedProcessor {
// fn name(&self) -> &str {
// "AIGeneratedProcessor"
// }
// }

#[async_trait]
impl NetworkSteganographyProcessor for AIGeneratedProcessor {
Expand Down
25 changes: 11 additions & 14 deletions rucimp/src/map/tproxy/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@ pub use route::*;
use async_trait::async_trait;
use itertools::Itertools;
use ruci::map::{self, *};
use ruci::{
net::{self, *},
Name,
};
use ruci::net::{self, *};

use macro_map::{map_ext_fields, MapExt};
use serde::{Deserialize, Serialize};
Expand All @@ -32,11 +29,11 @@ pub struct TcpResolver {
opts: Options,
}

impl Name for TcpResolver {
fn name(&self) -> &'static str {
"tproxy_tcp_resolver"
}
}
// impl Name for TcpResolver {
// fn name(&self) -> &'static str {
// "tproxy_tcp_resolver"
// }
// }

impl TcpResolver {
pub fn new(opts: Options) -> anyhow::Result<Self> {
Expand Down Expand Up @@ -128,11 +125,11 @@ pub struct UDPListener {
pub sopt: SockOpt,
}

impl Name for UDPListener {
fn name(&self) -> &'static str {
"tproxy_udp_listener"
}
}
// impl Name for UDPListener {
// fn name(&self) -> &'static str {
// "tproxy_udp_listener"
// }
// }

impl UDPListener {
pub async fn start_listen(
Expand Down
15 changes: 6 additions & 9 deletions rucimp/src/map/tproxy/udp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,7 @@ use std::{
use bytes::{Buf, BytesMut};
use dashmap::DashMap;
use futures::channel::oneshot;
use ruci::{
net::{self, addr_conn::CP_UDP_TIMEOUT, MTU},
Name,
};
use ruci::net::{self, addr_conn::CP_UDP_TIMEOUT, MTU};
use tokio::sync::mpsc::{self, Receiver, Sender};
use tracing::{debug, warn};

Expand Down Expand Up @@ -381,11 +378,11 @@ pub struct Reader {
last_buf: Option<DataIndex>,
state: ReadState,
}
impl ruci::Name for Reader {
fn name(&self) -> &str {
"tproxy_udp_w"
}
}
// impl ruci::Name for Reader {
// fn name(&self) -> &str {
// "tproxy_udp_w"
// }
// }

enum ReadState {
Buf,
Expand Down

0 comments on commit 828ff80

Please sign in to comment.