Enum AttrKind

Source
#[repr(u16)]
pub enum AttrKind {
Show 20 variants UserName = 6, Data = 19, Realm = 20, Nonce = 21, XorPeerAddress = 18, XorRelayedAddress = 22, XorMappedAddress = 32, MappedAddress = 1, ResponseOrigin = 32_811, Software = 32_802, MessageIntegrity = 8, ErrorCode = 9, Lifetime = 13, ReqeestedTransport = 25, Fingerprint = 32_808, ChannelNumber = 12, IceControlled = 32_809, Priority = 36, UseCandidate = 37, IceControlling = 32_810,
}
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§

§

UserName = 6

§

Data = 19

§

Realm = 20

§

Nonce = 21

§

XorPeerAddress = 18

§

XorRelayedAddress = 22

§

XorMappedAddress = 32

§

MappedAddress = 1

§

ResponseOrigin = 32_811

§

Software = 32_802

§

MessageIntegrity = 8

§

ErrorCode = 9

§

Lifetime = 13

§

ReqeestedTransport = 25

§

Fingerprint = 32_808

§

ChannelNumber = 12

§

IceControlled = 32_809

§

Priority = 36

§

UseCandidate = 37

§

IceControlling = 32_810

Trait Implementations§

Source§

impl Debug for AttrKind

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Hash for AttrKind

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for AttrKind

Source§

fn eq(&self, other: &AttrKind) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl TryFrom<u16> for AttrKind

Source§

type Error = TryFromPrimitiveError<AttrKind>

The type returned in the event of a conversion error.
Source§

fn try_from(number: u16) -> Result<Self, TryFromPrimitiveError<Self>>

Performs the conversion.
Source§

impl TryFromPrimitive for AttrKind

Source§

const NAME: &'static str = "AttrKind"

Source§

type Primitive = u16

Source§

fn try_from_primitive( number: Self::Primitive, ) -> Result<Self, TryFromPrimitiveError<Self>>

Source§

impl Eq for AttrKind

Source§

impl StructuralPartialEq for AttrKind

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.