AttributeType

Enum AttributeType 

Source
#[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

Source§

fn clone(&self) -> AttributeType

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for AttributeType

Source§

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

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

impl Default for AttributeType

Source§

fn default() -> AttributeType

Returns the “default value” for a type. Read more
Source§

impl Hash for AttributeType

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 AttributeType

Source§

fn eq(&self, other: &AttributeType) -> 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 AttributeType

Source§

type Error = TryFromPrimitiveError<AttributeType>

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 AttributeType

Source§

impl Copy for AttributeType

Source§

impl Eq for AttributeType

Source§

impl StructuralPartialEq for AttributeType

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FromRef<T> for T
where T: Clone,

Source§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoRequest<T> for T

Source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
Source§

impl<L> LayerExt<L> for L

Source§

fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>
where L: Layer<S>,

Applies the layer to a service and wraps it in Layered.
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,