checkpoint

This commit is contained in:
John Smith
2022-07-03 23:20:30 -04:00
parent 5fb551e53d
commit eed79ce721
16 changed files with 997 additions and 554 deletions

View File

@@ -1588,21 +1588,27 @@ pub enum TunnelMode {
Turn,
}
type TunnelId = u64;
#[derive(Clone, Debug, PartialOrd, PartialEq, Eq, Ord, Serialize, Deserialize)]
pub enum TunnelError {
BadId, // Tunnel ID was rejected
NoEndpoint, // Endpoint was unreachable
RejectedMode, // Endpoint couldn't provide mode
NoCapacity, // Endpoint is full
}
pub type TunnelId = u64;
#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct TunnelEndpoint {
pub node_id: NodeId, // the node id of the tunnel endpoint
pub dial_info: Vec<DialInfo>, // multiple ways of how to get to the node
pub mode: TunnelMode,
pub description: String, // XXX: TODO
}
impl Default for TunnelEndpoint {
fn default() -> Self {
Self {
node_id: NodeId::default(),
dial_info: Vec::new(),
mode: TunnelMode::Raw,
description: "".to_string(),
}
}
}