180 lines
7.8 KiB
Go
180 lines
7.8 KiB
Go
package stun
|
|
|
|
// Do not edit. This file is generated by 'go generate gen.go'
|
|
// This file provides STUN parameters managed by the Internet Assigned Numbers Authority (IANA).
|
|
// Session Traversal Utilities for NAT (STUN) Parameters, Updated: 2016-11-14.
|
|
|
|
// STUN methods.
|
|
const (
|
|
MethodBinding uint16 = 0x001 // RFC 5389
|
|
MethodSharedSecret uint16 = 0x002
|
|
MethodAllocate uint16 = 0x003 // RFC 5766
|
|
MethodRefresh uint16 = 0x004
|
|
MethodSend uint16 = 0x006
|
|
MethodData uint16 = 0x007
|
|
MethodCreatePermission uint16 = 0x008
|
|
MethodChannelBind uint16 = 0x009
|
|
MethodConnect uint16 = 0x00a // RFC 6062
|
|
MethodConnectionBind uint16 = 0x00b
|
|
MethodConnectionAttempt uint16 = 0x00c
|
|
)
|
|
|
|
// STUN method names.
|
|
var methodNames = map[uint16]string{
|
|
MethodBinding: "Binding",
|
|
MethodSharedSecret: "SharedSecret",
|
|
MethodAllocate: "Allocate",
|
|
MethodRefresh: "Refresh",
|
|
MethodSend: "Send",
|
|
MethodData: "Data",
|
|
MethodCreatePermission: "CreatePermission",
|
|
MethodChannelBind: "ChannelBind",
|
|
MethodConnect: "Connect",
|
|
MethodConnectionBind: "ConnectionBind",
|
|
MethodConnectionAttempt: "ConnectionAttempt",
|
|
}
|
|
|
|
// STUN attributes.
|
|
const (
|
|
AttrMappedAddress uint16 = 0x0001 // RFC 5389
|
|
AttrChangeRequest uint16 = 0x0003 // RFC 5780
|
|
AttrUsername uint16 = 0x0006 // RFC 5389
|
|
AttrMessageIntegrity uint16 = 0x0008
|
|
AttrErrorCode uint16 = 0x0009
|
|
AttrUnknownAttributes uint16 = 0x000a
|
|
AttrChannelNumber uint16 = 0x000c // RFC 5766
|
|
AttrLifetime uint16 = 0x000d
|
|
AttrXorPeerAddress uint16 = 0x0012
|
|
AttrData uint16 = 0x0013
|
|
AttrRealm uint16 = 0x0014 // RFC 5389
|
|
AttrNonce uint16 = 0x0015
|
|
AttrXorRelayedAddress uint16 = 0x0016 // RFC 5766
|
|
AttrRequestedAddressFamily uint16 = 0x0017 // RFC 6156
|
|
AttrEvenPort uint16 = 0x0018 // RFC 5766
|
|
AttrRequestedTransport uint16 = 0x0019
|
|
AttrDontFragment uint16 = 0x001a
|
|
AttrAccessToken uint16 = 0x001b // RFC 7635
|
|
AttrXorMappedAddress uint16 = 0x0020 // RFC 5389
|
|
AttrReservationToken uint16 = 0x0022 // RFC 5766
|
|
AttrPriority uint16 = 0x0024 // RFC 5245
|
|
AttrUseCandidate uint16 = 0x0025
|
|
AttrPadding uint16 = 0x0026 // RFC 5780
|
|
AttrResponsePort uint16 = 0x0027
|
|
AttrConnectionID uint16 = 0x002a // RFC 6062
|
|
AttrSoftware uint16 = 0x8022 // RFC 5389
|
|
AttrAlternateServer uint16 = 0x8023
|
|
AttrTransactionTransmitCounter uint16 = 0x8025 // RFC 7982
|
|
AttrCacheTimeout uint16 = 0x8027 // RFC 5780
|
|
AttrFingerprint uint16 = 0x8028 // RFC 5389
|
|
AttrIceControlled uint16 = 0x8029 // RFC 5245
|
|
AttrIceControlling uint16 = 0x802a
|
|
AttrResponseOrigin uint16 = 0x802b // RFC 5780
|
|
AttrOtherAddress uint16 = 0x802c
|
|
AttrEcnCheck uint16 = 0x802d // RFC 6679
|
|
AttrThirdPartyAuthorization uint16 = 0x802e // RFC 7635
|
|
AttrMobilityTicket uint16 = 0x8030 // RFC 8016
|
|
)
|
|
|
|
// Deprecated: For backwards compatibility only.
|
|
const (
|
|
AttrResponseAddress uint16 = 0x0002
|
|
AttrSourceAddress uint16 = 0x0004
|
|
AttrChangedAddress uint16 = 0x0005
|
|
AttrPassword uint16 = 0x0007
|
|
AttrReflectedFrom uint16 = 0x000b
|
|
AttrBandwidth uint16 = 0x0010
|
|
AttrTimerVal uint16 = 0x0021
|
|
)
|
|
|
|
// STUN attribute names.
|
|
var attrNames = map[uint16]string{
|
|
AttrMappedAddress: "MAPPED-ADDRESS",
|
|
AttrResponseAddress: "RESPONSE-ADDRESS",
|
|
AttrChangeRequest: "CHANGE-REQUEST",
|
|
AttrSourceAddress: "SOURCE-ADDRESS",
|
|
AttrChangedAddress: "CHANGED-ADDRESS",
|
|
AttrUsername: "USERNAME",
|
|
AttrPassword: "PASSWORD",
|
|
AttrMessageIntegrity: "MESSAGE-INTEGRITY",
|
|
AttrErrorCode: "ERROR-CODE",
|
|
AttrUnknownAttributes: "UNKNOWN-ATTRIBUTES",
|
|
AttrReflectedFrom: "REFLECTED-FROM",
|
|
AttrChannelNumber: "CHANNEL-NUMBER",
|
|
AttrLifetime: "LIFETIME",
|
|
AttrBandwidth: "BANDWIDTH",
|
|
AttrXorPeerAddress: "XOR-PEER-ADDRESS",
|
|
AttrData: "DATA",
|
|
AttrRealm: "REALM",
|
|
AttrNonce: "NONCE",
|
|
AttrXorRelayedAddress: "XOR-RELAYED-ADDRESS",
|
|
AttrRequestedAddressFamily: "REQUESTED-ADDRESS-FAMILY",
|
|
AttrEvenPort: "EVEN-PORT",
|
|
AttrRequestedTransport: "REQUESTED-TRANSPORT",
|
|
AttrDontFragment: "DONT-FRAGMENT",
|
|
AttrAccessToken: "ACCESS-TOKEN",
|
|
AttrXorMappedAddress: "XOR-MAPPED-ADDRESS",
|
|
AttrTimerVal: "TIMER-VAL",
|
|
AttrReservationToken: "RESERVATION-TOKEN",
|
|
AttrPriority: "PRIORITY",
|
|
AttrUseCandidate: "USE-CANDIDATE",
|
|
AttrPadding: "PADDING",
|
|
AttrResponsePort: "RESPONSE-PORT",
|
|
AttrConnectionID: "CONNECTION-ID",
|
|
AttrSoftware: "SOFTWARE",
|
|
AttrAlternateServer: "ALTERNATE-SERVER",
|
|
AttrTransactionTransmitCounter: "TRANSACTION-TRANSMIT-COUNTER",
|
|
AttrCacheTimeout: "CACHE-TIMEOUT",
|
|
AttrFingerprint: "FINGERPRINT",
|
|
AttrIceControlled: "ICE-CONTROLLED",
|
|
AttrIceControlling: "ICE-CONTROLLING",
|
|
AttrResponseOrigin: "RESPONSE-ORIGIN",
|
|
AttrOtherAddress: "OTHER-ADDRESS",
|
|
AttrEcnCheck: "ECN-CHECK",
|
|
AttrThirdPartyAuthorization: "THIRD-PARTY-AUTHORIZATION",
|
|
AttrMobilityTicket: "MOBILITY-TICKET",
|
|
}
|
|
|
|
// STUN error codes.
|
|
const (
|
|
CodeTryAlternate int = 300 // RFC 5389
|
|
CodeBadRequest int = 400
|
|
CodeUnauthorized int = 401
|
|
CodeForbidden int = 403 // RFC 5766
|
|
CodeMobilityForbidden int = 405 // RFC 8016
|
|
CodeUnknownAttribute int = 420 // RFC 5389
|
|
CodeAllocationMismatch int = 437 // RFC 5766
|
|
CodeStaleNonce int = 438 // RFC 5389
|
|
CodeAddressFamilyNotSupported int = 440 // RFC 6156
|
|
CodeWrongCredentials int = 441 // RFC 5766
|
|
CodeUnsupportedTransportProtocol int = 442
|
|
CodePeerAddressFamilyMismatch int = 443 // RFC 6156
|
|
CodeConnectionAlreadyExists int = 446 // RFC 6062
|
|
CodeConnectionTimeoutOrFailure int = 447
|
|
CodeAllocationQuotaReached int = 486 // RFC 5766
|
|
CodeRoleConflict int = 487 // RFC 5245
|
|
CodeServerError int = 500 // RFC 5389
|
|
CodeInsufficientCapacity int = 508 // RFC 5766
|
|
)
|
|
|
|
// STUN error texts.
|
|
var errorText = map[int]string{
|
|
CodeTryAlternate: "Try Alternate",
|
|
CodeBadRequest: "Bad Request",
|
|
CodeUnauthorized: "Unauthorized",
|
|
CodeForbidden: "Forbidden",
|
|
CodeMobilityForbidden: "Mobility Forbidden",
|
|
CodeUnknownAttribute: "Unknown Attribute",
|
|
CodeAllocationMismatch: "Allocation Mismatch",
|
|
CodeStaleNonce: "Stale Nonce",
|
|
CodeAddressFamilyNotSupported: "Address Family not Supported",
|
|
CodeWrongCredentials: "Wrong Credentials",
|
|
CodeUnsupportedTransportProtocol: "Unsupported Transport Protocol",
|
|
CodePeerAddressFamilyMismatch: "Peer Address Family Mismatch",
|
|
CodeConnectionAlreadyExists: "Connection Already Exists",
|
|
CodeConnectionTimeoutOrFailure: "Connection Timeout or Failure",
|
|
CodeAllocationQuotaReached: "Allocation Quota Reached",
|
|
CodeRoleConflict: "Role Conflict",
|
|
CodeServerError: "Server Error",
|
|
CodeInsufficientCapacity: "Insufficient Capacity",
|
|
}
|