cippy issue, fmt, update/upgrade
This commit is contained in:
@@ -9,18 +9,28 @@ mod server;
|
||||
|
||||
use std::{collections::HashMap, time::Instant};
|
||||
|
||||
pub use config::{ConfigError, DEFAULT_RELAY_PORT, ListenEndpoint, RelayArgs, RelayConfig};
|
||||
use lanparty_ctrl::{
|
||||
ControlError, EndpointHello, PeerInfo, Reject, RejectReason, Role, RoomCode, ServerWelcome,
|
||||
ControlError,
|
||||
EndpointHello,
|
||||
PeerInfo,
|
||||
Reject,
|
||||
RejectReason,
|
||||
Role,
|
||||
RoomCode,
|
||||
ServerWelcome,
|
||||
};
|
||||
use lanparty_obs::{DropReason, FrameAction};
|
||||
use lanparty_proto::{
|
||||
EthernetFrame, MacAddr, ethernet_frame_exceeds_tap_mtu, gateway_lan_safety_drop_reason,
|
||||
recommended_tap_mtu, remote_client_safety_drop_reason,
|
||||
EthernetFrame,
|
||||
MacAddr,
|
||||
ethernet_frame_exceeds_tap_mtu,
|
||||
gateway_lan_safety_drop_reason,
|
||||
recommended_tap_mtu,
|
||||
remote_client_safety_drop_reason,
|
||||
};
|
||||
use thiserror::Error;
|
||||
|
||||
pub use config::{ConfigError, DEFAULT_RELAY_PORT, ListenEndpoint, RelayArgs, RelayConfig};
|
||||
pub use server::RelayServer;
|
||||
use thiserror::Error;
|
||||
|
||||
pub const DEFAULT_MAX_CLIENTS_PER_ROOM: usize = 16;
|
||||
const MEBIBYTE: u64 = 1024 * 1024;
|
||||
@@ -769,9 +779,10 @@ fn reject_control_error(error: ControlError) -> Reject {
|
||||
mod tests {
|
||||
use std::time::{Duration, Instant};
|
||||
|
||||
use super::*;
|
||||
use lanparty_proto::MAX_STANDARD_ETHERNET_FRAME_LEN;
|
||||
|
||||
use super::*;
|
||||
|
||||
fn room() -> RoomCode {
|
||||
RoomCode::new("ABCD").unwrap()
|
||||
}
|
||||
|
||||
@@ -1,20 +1,42 @@
|
||||
use std::{fs, net::SocketAddr, path::Path, sync::Arc};
|
||||
use std::{collections::HashMap, fs, net::SocketAddr, path::Path, sync::Arc};
|
||||
|
||||
use anyhow::{Context, Result, anyhow, bail};
|
||||
use bytes::Bytes;
|
||||
use lanparty_ctrl::{
|
||||
CONTROL_LENGTH_PREFIX_LEN, ControlCodecError, ControlMessage, DisconnectReason, EndpointHello,
|
||||
MAX_CONTROL_MESSAGE_LEN, PeerInfo, RELAY_ALPN, Reject, RejectReason, Role, RoomCode,
|
||||
ServerWelcome, decode_control_frame, encode_control_message,
|
||||
CONTROL_LENGTH_PREFIX_LEN,
|
||||
ControlCodecError,
|
||||
ControlMessage,
|
||||
DisconnectReason,
|
||||
EndpointHello,
|
||||
MAX_CONTROL_MESSAGE_LEN,
|
||||
PeerInfo,
|
||||
RELAY_ALPN,
|
||||
Reject,
|
||||
RejectReason,
|
||||
Role,
|
||||
RoomCode,
|
||||
ServerWelcome,
|
||||
decode_control_frame,
|
||||
encode_control_message,
|
||||
};
|
||||
use lanparty_obs::{DropReason, FrameDirection, FrameLog, TunnelStats};
|
||||
use lanparty_proto::{
|
||||
EthernetFrame, FrameType, OVERLAY_FLAGS_NONE, decode_datagram, encode_datagram,
|
||||
EthernetFrame,
|
||||
FrameType,
|
||||
OVERLAY_FLAGS_NONE,
|
||||
decode_datagram,
|
||||
encode_datagram,
|
||||
};
|
||||
use quinn::{
|
||||
Endpoint,
|
||||
Incoming,
|
||||
RecvStream,
|
||||
SendStream,
|
||||
ServerConfig,
|
||||
TransportConfig,
|
||||
crypto::rustls::QuicServerConfig,
|
||||
};
|
||||
use quinn::crypto::rustls::QuicServerConfig;
|
||||
use quinn::{Endpoint, Incoming, RecvStream, SendStream, ServerConfig, TransportConfig};
|
||||
use rustls::pki_types::{CertificateDer, PrivateKeyDer, PrivatePkcs8KeyDer};
|
||||
use std::collections::HashMap;
|
||||
use tokio::sync::Mutex;
|
||||
|
||||
use crate::{ForwardingDecision, RelayConfig, RoomRegistry};
|
||||
@@ -1014,13 +1036,17 @@ mod tests {
|
||||
use lanparty_ctrl::{RoomCode, decode_control_frame, encode_control_message};
|
||||
use lanparty_gateway::{GatewayConfig, connect_gateway};
|
||||
use lanparty_proto::{
|
||||
ETHERNET_HEADER_LEN, ETHERTYPE_IPV4, FrameType, MacAddr, decode_datagram, encode_datagram,
|
||||
ETHERNET_HEADER_LEN,
|
||||
ETHERTYPE_IPV4,
|
||||
FrameType,
|
||||
MacAddr,
|
||||
decode_datagram,
|
||||
encode_datagram,
|
||||
};
|
||||
use quinn::{ClientConfig, crypto::rustls::QuicClientConfig};
|
||||
|
||||
use crate::{DEFAULT_MAX_CLIENTS_PER_ROOM, ListenEndpoint};
|
||||
|
||||
use super::*;
|
||||
use crate::{DEFAULT_MAX_CLIENTS_PER_ROOM, ListenEndpoint};
|
||||
|
||||
const ETHERTYPE_ARP: u16 = 0x0806;
|
||||
const ARP_REQUEST: u16 = 1;
|
||||
|
||||
Reference in New Issue
Block a user