IronForce is a decentralized network, Degeon is a messenger built on it
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
894 B

use alloc::vec::Vec;
use crate::crypto::PublicKey;
/// A tunnel that is used for communication
pub struct Tunnel {
/// Tunnel's id
id: Option<u64>,
/// Ids that are
local_ids: Vec<u64>,
/// Ids of peers (in transport) by which we can send a message - one for backward direction, another for forward
peer_ids: (u64, u64),
/// Time at which this tunnel should be destroyed (UNIX epoch)
ttd: u64,
/// Public keys of nodes
nodes_in_tunnel: Option<Vec<PublicKey>>,
/// Is this tunnel used for multicast?
is_multicast: bool,
}
/// Tunnel, but only the fields that are ok to share
pub struct TunnelPublic {
/// Tunnel's id
id: Option<u64>,
/// Ids that are
local_ids: Vec<u64>,
/// Time at which this tunnel should be destroyed (UNIX epoch)
ttd: u64,
/// Public keys of nodes
nodes_in_tunnel: Option<Vec<PublicKey>>,
}