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
//! TURN's STUN attributes and ChannelData framing.
//!
//! TURN is defined as a set of STUN methods and attributes, so these build on
//! [`rtc-stun`](https://docs.rs/rtc-stun). The attributes name the relay's parts:
//! [`relayaddr`](crate::proto::relayaddr) the allocated public address, [`peeraddr`](crate::proto::peeraddr) the far end, [`lifetime`](crate::proto::lifetime) the
//! allocation's expiry, [`data`](crate::proto::data) the relayed payload.
//!
//! [`chandata`](crate::proto::chandata) is the exception — a ChannelData message is not STUN at all, but a compact
//! four-byte framing that replaces the 36-byte Send/Data indication header once a channel is
//! bound. Its [`channum`](crate::proto::channum) range is chosen so the two can be told apart on a shared port.
/// Address helpers and the five-tuple that identifies an allocation.
/// ChannelData messages — the compact 4-byte framing for relayed data.
/// The `CHANNEL-NUMBER` attribute.
/// The `DATA` attribute, which carries relayed payloads in Send/Data indications.
/// The `DONT-FRAGMENT` attribute, asking the server to set DF on relayed packets.
/// The `EVEN-PORT` attribute, requesting an even relayed port (for RTP/RTCP pairs).
/// The `LIFETIME` attribute, which sets and reports allocation expiry.
/// The `XOR-PEER-ADDRESS` attribute, naming the peer in permission and data messages.
/// The `XOR-RELAYED-ADDRESS` attribute, which reports the allocated public address.
/// The `REQUESTED-ADDRESS-FAMILY` attribute, for asking for an IPv4 or IPv6 allocation.
/// The `REQUESTED-TRANSPORT` attribute, which selects the relay's transport to peers.
/// The `RESERVATION-TOKEN` attribute, used to claim a previously reserved port.
use fmt;
use *;
// proto implements RFC 5766 Traversal Using Relays around NAT.
/// `Protocol` is IANA assigned protocol number.
;
/// `PROTO_TCP` is IANA assigned protocol number for TCP.
pub const PROTO_TCP: Protocol = Protocol;
/// `PROTO_UDP` is IANA assigned protocol number for UDP.
pub const PROTO_UDP: Protocol = Protocol;
// Default ports for TURN from RFC 5766 Section 4.
/// `DEFAULT_PORT` for TURN is same as STUN.
pub const DEFAULT_PORT: u16 = DEFAULT_PORT;
/// `DEFAULT_TLSPORT` is for TURN over TLS and is same as STUN.
pub const DEFAULT_TLS_PORT: u16 = DEFAULT_TLS_PORT;
/// Shorthand for create permission request type.
/// Shorthand for allocation request message type.
/// Shorthand for send indication message type.
/// Shorthand for refresh request message type.