-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
678 additions
and
236 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,20 @@ | ||
mod common_header; | ||
pub use common_header::DecodeError; | ||
use std::net::SocketAddr; | ||
|
||
mod error; | ||
pub use error::ReliableRelayError; | ||
use bytes::Bytes; | ||
pub use common_header::DecodeError; | ||
|
||
mod relay_protocol; | ||
pub use relay_protocol::ReliableRelayProtocol; | ||
pub use relay_protocol::{ReceiveError, ReliableRelayProtocol, SendError}; | ||
|
||
mod parser; | ||
mod registration; | ||
mod wire_utils; | ||
|
||
const ADDRESS_TYPE_OCTETS: usize = 1; | ||
|
||
#[derive(Debug)] | ||
pub struct Packet { | ||
pub last_hop: Option<SocketAddr>, | ||
pub content: Vec<Bytes>, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1 @@ | ||
use thiserror::Error; | ||
|
||
#[derive(Error, Debug, Eq, PartialEq)] | ||
pub enum ReliableRelayError { | ||
#[error("provided destination address must be specified, not 0.0.0.0 or ::0")] | ||
DestinationUnspecified, | ||
#[error("provided destination port mmust be specified")] | ||
DestinationPortUnspecified, | ||
#[error("port mismatch, requested port {requested}, received port {assigned}")] | ||
PortMismatch { requested: u16, assigned: u16 }, | ||
} |
Oops, something went wrong.