atm0s_sdn_network/base/
mod.rs

1mod control;
2mod feature;
3mod msg;
4mod secure;
5mod service;
6
7use atm0s_sdn_identity::{ConnId, NodeId};
8pub use control::*;
9pub use feature::*;
10pub use msg::*;
11pub use sans_io_runtime::Buffer;
12pub use secure::*;
13pub use service::*;
14
15use crate::data_plane::NetPair;
16
17#[derive(Debug, Clone)]
18pub struct ConnectionCtx {
19    pub conn: ConnId,
20    pub node: NodeId,
21    pub pair: NetPair,
22}
23
24#[derive(Debug, Clone, PartialEq, Eq)]
25pub struct ConnectionStats {
26    pub rtt_ms: u32,
27}
28
29#[derive(Debug, Clone)]
30pub enum ConnectionEvent {
31    Connecting(ConnectionCtx),
32    ConnectError(ConnectionCtx, NeighboursConnectError),
33    Connected(ConnectionCtx, SecureContext),
34    Stats(ConnectionCtx, ConnectionStats),
35    Disconnected(ConnectionCtx),
36}