1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
use bincode;
use mio::timer::TimerError;
use socket_collection;
use std::io;
quick_error! {
/// Nat-traversal's universal error type.
#[derive(Debug)]
pub enum NatError {
/// Io Error
Io(e: io::Error) {
description(e.description())
display("{}", e)
cause(e)
from()
}
/// Timer error
Timer(e: TimerError) {
description(e.description())
display("{}", e)
cause(e)
from()
}
/// Serialization errors
Serialisation(e: bincode::Error) {
description(e.description())
display("{}", e)
cause(e)
from()
}
/// Failed to decrypt the cipher text
AsymmetricDecipherFailed {
description("Failed to decrypt the cipher-text")
}
/// Payload size is too large
PayloadSizeProhibitive {
description("Payload size is too large")
}
/// Socket Error
SocketError(e: socket_collection::SocketError) {
description(e.description())
display("{}", e)
from()
}
// =======================================
/// Rendezvous with server failed for both Tcp and Udp - could not obtain our external
/// address
RendezvousFailed {
description("Rendezvous with server failed for both Tcp and Udp - could not obtain our \
external address")
}
/// Udp Rendezvous with server failed - could not obtain our external address
UdpRendezvousFailed {
description("Udp Rendezvous with server failed - could not obtain our external address")
}
/// Tcp Rendezvous with server failed - could not obtain our external address
TcpRendezvousFailed {
description("Tcp Rendezvous with server failed - could not obtain our external address")
}
// =======================================
/// Booting up Hole Punch Mediator failed
HolePunchMediatorFailedToStart {
description("Booting Hole Punch Mediator failed")
}
/// Booting up Udp Hole Punch Mediator failed
UdpHolePunchMediatorFailedToStart {
description("Booting Udp Hole Punch Mediator Failed")
}
/// Booting up Tdp Hole Punch Mediator failed
TcpHolePunchMediatorFailedToStart {
description("Booting Tdp Hole Punch Mediator Failed")
}
/// Booting up Udp Rendezvous Server failed
UdpRendezvousServerStartFailed {
description("Booting Udp Rendezvous Server Failed")
}
/// Booting up Tcp Rendezvous Server failed
TcpRendezvousServerStartFailed {
description("Booting Tcp Rendezvous Server Failed")
}
/// Booting up Tcp Rendezvous Server failed
TcpRendezvousExchangerStartFailed {
description("Booting Tcp Rendezvous Exchanger Failed")
}
// =======================================
/// Hole punch failed
HolePunchFailed {
description("Hole punch failed")
}
/// Udp Hole punch failed
UdpHolePunchFailed {
description("Udp Hole punch failed")
}
/// Tcp Hole punch failed
TcpHolePunchFailed {
description("Tcp Hole punch failed")
}
// =======================================
/// Timer ID is invalid
InvalidTimerId {
description("Timer ID is invalid")
}
/// Invalid state - the state may already be active or is an operation is not supposed to
/// be permitted for this state
InvalidState {
description("Invalid state - the state may already be active or is an operation is not \
supposed to be permitted for this state")
}
/// Socket is not available
UnregisteredSocket {
description("Socket is not available")
}
/// Unknown error
Unknown {
description("Unknown Error in Nat Traversal")
}
}
}