-
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.
feat: reliable socket protocol (#21)
* feat: add reliable protocol implementation * fix: use debug_assert! instead of assert! * fix: bump allowed hyper version of socket2
- Loading branch information
Showing
8 changed files
with
1,081 additions
and
76 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
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,7 +1,25 @@ | ||
use std::net::SocketAddr; | ||
|
||
use bytes::Bytes; | ||
|
||
mod common_header; | ||
pub use common_header::DecodeError; | ||
|
||
mod relay_protocol; | ||
pub use relay_protocol::{ReceiveError, ReliableRelayProtocol, SendError}; | ||
|
||
mod parser; | ||
mod registration; | ||
mod wire_utils; | ||
|
||
const ADDRESS_TYPE_OCTETS: usize = 1; | ||
|
||
/// A packet received over the [`ReliableRelayProtocol`]. | ||
#[derive(Debug)] | ||
pub struct Packet { | ||
/// The last AS-level host the packet traversed, such as the ingress border router or the | ||
/// sending host if it is located in the same AS. | ||
pub last_host: Option<SocketAddr>, | ||
/// The content of the single packet as a sequence of Bytes objects. | ||
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
Oops, something went wrong.