#[repr(u16)]pub enum AttributeType {
Show 44 variants
Unknown = 0,
MappedAddress = 1,
UserName = 6,
MessageIntegrity = 8,
ErrorCode = 9,
ChannelNumber = 12,
Lifetime = 13,
XorPeerAddress = 18,
Data = 19,
Realm = 20,
Nonce = 21,
XorRelayedAddress = 22,
RequestedAddressFamily = 23,
EvenPort = 24,
ReqeestedTransport = 25,
DontFragment = 26,
AccessToken = 27,
MessageIntegritySha256 = 28,
PasswordAlgorithm = 29,
UserHash = 30,
XorMappedAddress = 32,
ReservationToken = 34,
Priority = 36,
UseCandidate = 37,
Padding = 38,
ResponsePort = 39,
ConnectionId = 42,
AdditionalAddressFamily = 32_768,
AddressErrorCode = 32_769,
PasswordAlgorithms = 32_770,
AlternateDomain = 32_771,
Icmp = 32_772,
Software = 32_802,
AlternateServer = 32_803,
TransactionTransmitCounter = 32_805,
CacheTimeout = 32_807,
Fingerprint = 32_808,
IceControlled = 32_809,
IceControlling = 32_810,
ResponseOrigin = 32_811,
OtherAddress = 32_812,
EcnCheck = 32_813,
ThirdPartyAuathorization = 32_814,
MobilityTicket = 32_816,
}Expand description
STUN Attributes Registry
A STUN attribute type is a hex number in the range 0x0000-0xFFFF. STUN attribute types in the range 0x0000-0x7FFF are considered comprehension-required; STUN attribute types in the range 0x8000-0xFFFF are considered comprehension-optional. A STUN agent handles unknown comprehension-required and comprehension-optional attributes differently.
STUN attribute types in the first half of the comprehension-required range (0x0000-0x3FFF) and in the first half of the comprehension- optional range (0x8000-0xBFFF) are assigned by IETF Review RFC8126. STUN attribute types in the second half of the comprehension-required range (0x4000-0x7FFF) and in the second half of the comprehension- optional range (0xC000-0xFFFF) are assigned by Expert Review RFC8126. The responsibility of the expert is to verify that the selected codepoint(s) are not in use and that the request is not for an abnormally large number of codepoints. Technical review of the extension itself is outside the scope of the designated expert responsibility.
IANA has updated the names for attributes 0x0002, 0x0004, 0x0005, 0x0007, and 0x000B as well as updated the reference from RFC5389 to RFC8489 for each the following STUN methods.
In addition, RFC5389 introduced a mistake in the name of attribute 0x0003; RFC5389 called it CHANGE-ADDRESS when it was actually previously called CHANGE-REQUEST. Thus, IANA has updated the description for 0x0003 to read “Reserved; was CHANGE-REQUEST prior to RFC5389”.
Comprehension-required range (0x0000-0x7FFF): 0x0000: Reserved 0x0001: MAPPED-ADDRESS 0x0002: Reserved; was RESPONSE-ADDRESS prior to RFC5389 0x0003: Reserved; was CHANGE-REQUEST prior to RFC5389 0x0004: Reserved; was SOURCE-ADDRESS prior to RFC5389 0x0005: Reserved; was CHANGED-ADDRESS prior to RFC5389 0x0006: USERNAME 0x0007: Reserved; was PASSWORD prior to RFC5389 0x0008: MESSAGE-INTEGRITY 0x0009: ERROR-CODE 0x000A: UNKNOWN-ATTRIBUTES 0x000B: Reserved; was REFLECTED-FROM prior to RFC5389 0x0014: REALM 0x0015: NONCE 0x0020: XOR-MAPPED-ADDRESS
Comprehension-optional range (0x8000-0xFFFF) 0x8022: SOFTWARE 0x8023: ALTERNATE-SERVER 0x8028: FINGERPRINT
IANA has added the following attribute to the “STUN Attributes” registry:
Comprehension-required range (0x0000-0x7FFF): 0x001C: MESSAGE-INTEGRITY-SHA256 0x001D: PASSWORD-ALGORITHM 0x001E: USERHASH
Comprehension-optional range (0x8000-0xFFFF) 0x8002: PASSWORD-ALGORITHMS 0x8003: ALTERNATE-DOMAIN
Variants§
Unknown = 0
MappedAddress = 1
UserName = 6
MessageIntegrity = 8
ErrorCode = 9
ChannelNumber = 12
Lifetime = 13
XorPeerAddress = 18
Data = 19
Realm = 20
Nonce = 21
XorRelayedAddress = 22
RequestedAddressFamily = 23
EvenPort = 24
ReqeestedTransport = 25
DontFragment = 26
AccessToken = 27
MessageIntegritySha256 = 28
PasswordAlgorithm = 29
UserHash = 30
XorMappedAddress = 32
ReservationToken = 34
Priority = 36
UseCandidate = 37
Padding = 38
ResponsePort = 39
ConnectionId = 42
AdditionalAddressFamily = 32_768
AddressErrorCode = 32_769
PasswordAlgorithms = 32_770
AlternateDomain = 32_771
Icmp = 32_772
Software = 32_802
AlternateServer = 32_803
TransactionTransmitCounter = 32_805
CacheTimeout = 32_807
Fingerprint = 32_808
IceControlled = 32_809
IceControlling = 32_810
ResponseOrigin = 32_811
OtherAddress = 32_812
EcnCheck = 32_813
ThirdPartyAuathorization = 32_814
MobilityTicket = 32_816
Trait Implementations§
Source§impl Clone for AttributeType
impl Clone for AttributeType
Source§fn clone(&self) -> AttributeType
fn clone(&self) -> AttributeType
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for AttributeType
impl Debug for AttributeType
Source§impl Default for AttributeType
impl Default for AttributeType
Source§fn default() -> AttributeType
fn default() -> AttributeType
Source§impl Hash for AttributeType
impl Hash for AttributeType
Source§impl PartialEq for AttributeType
impl PartialEq for AttributeType
Source§impl TryFrom<u16> for AttributeType
impl TryFrom<u16> for AttributeType
Source§type Error = TryFromPrimitiveError<AttributeType>
type Error = TryFromPrimitiveError<AttributeType>
Source§impl TryFromPrimitive for AttributeType
impl TryFromPrimitive for AttributeType
const NAME: &'static str = "AttributeType"
type Primitive = u16
type Error = TryFromPrimitiveError<AttributeType>
fn try_from_primitive( number: Self::Primitive, ) -> Result<Self, TryFromPrimitiveError<Self>>
impl Copy for AttributeType
impl Eq for AttributeType
impl StructuralPartialEq for AttributeType
Auto Trait Implementations§
impl Freeze for AttributeType
impl RefUnwindSafe for AttributeType
impl Send for AttributeType
impl Sync for AttributeType
impl Unpin for AttributeType
impl UnwindSafe for AttributeType
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request