Documentation
¶
Overview ¶
Package types defines RADIUS protocol constants shared across the packet, crypto, dictionary, transport, and protocol packages.
All values are derived from the authoritative RFCs:
Index ¶
Constants ¶
const ( AttrUserName = 1 AttrUserPassword = 2 AttrCHAPPassword = 3 AttrNASIPAddress = 4 AttrNASPort = 5 AttrServiceType = 6 AttrFramedProtocol = 7 AttrFramedIPAddress = 8 AttrFramedIPNetmask = 9 AttrFramedRouting = 10 AttrFilterID = 11 AttrFramedMTU = 12 AttrFramedCompression = 13 AttrLoginIPHost = 14 AttrLoginService = 15 AttrLoginTCPPort = 16 AttrReplyMessage = 18 AttrCallbackNumber = 19 AttrCallbackID = 20 AttrFramedRoute = 22 AttrFramedIPXNetwork = 23 AttrState = 24 AttrClass = 25 AttrVendorSpecific = 26 AttrSessionTimeout = 27 AttrIdleTimeout = 28 AttrTerminationAction = 29 AttrCalledStationID = 30 AttrCallingStationID = 31 AttrNASIdentifier = 32 AttrProxyState = 33 AttrLoginLATService = 34 AttrLoginLATNode = 35 AttrLoginLATGroup = 36 AttrFramedAppleTalkLink = 37 AttrFramedAppleTalkNetwork = 38 AttrFramedAppleTalkZone = 39 AttrCHAPChallenge = 60 AttrNASPortType = 61 AttrPortLimit = 62 AttrLoginLATPort = 63 )
Standard attribute type numbers defined by RFC 2865 §5. Each constant name uses the RFC attribute name in CamelCase with an Attr prefix.
const ( AttrAcctStatusType = 40 AttrAcctDelayTime = 41 AttrAcctInputOctets = 42 AttrAcctOutputOctets = 43 AttrAcctSessionID = 44 AttrAcctAuthentic = 45 AttrAcctSessionTime = 46 AttrAcctInputPackets = 47 AttrAcctOutputPackets = 48 AttrAcctTerminateCause = 49 AttrAcctMultiSessionID = 50 AttrAcctLinkCount = 51 )
Accounting attribute type numbers defined by RFC 2866 §5.
const ( AttrEAPMessage = 79 AttrMessageAuthenticator = 80 AttrNASPortID = 87 AttrAcctInterimInterval = 85 )
Extension attribute type numbers defined by RFC 2869.
const ( AttrARAPPassword = 70 AttrARAPFeatures = 71 AttrARAPZoneAccess = 72 AttrARAPSecurity = 73 AttrARAPSecurityData = 74 )
ARAP attribute type numbers defined by RFC 2869 §5.6–5.10. Used by the legacy Apple Remote Access Protocol; rarely seen on modern networks but part of the standard dictionary.
const ( AttrPasswordRetry = 75 AttrPrompt = 76 AttrConnectInfo = 77 AttrConfigurationToken = 78 AttrFramedPool = 88 )
Additional RFC 2869 attribute type numbers.
const ( AttrNASIPv6Address = 95 AttrFramedInterfaceID = 96 AttrFramedIPv6Prefix = 97 AttrLoginIPv6Host = 98 AttrFramedIPv6Route = 99 AttrFramedIPv6Pool = 100 )
IPv6 attribute type numbers defined by RFC 3162.
const ( AttrTunnelType = 64 AttrTunnelMediumType = 65 AttrTunnelClientEndpoint = 66 AttrTunnelServerEndpoint = 67 AttrTunnelPassword = 69 AttrTunnelPrivateGroupID = 81 AttrTunnelAssignmentID = 82 AttrTunnelPreference = 83 AttrTunnelClientAuthID = 90 AttrTunnelServerAuthID = 91 )
Tunnel attribute type numbers defined by RFC 2868.
const ( AttrExtendedType1 = 241 // RFC 6929 §2.1: extended (255-octet value) AttrExtendedType2 = 242 // RFC 6929 §2.2: long extended (4111-octet value) AttrExtendedType3 = 243 // RFC 6929 §2.3: extended (255-octet value) AttrExtendedType4 = 244 // RFC 6929 §2.4: extended (255-octet value) )
RFC 6929 extended attribute type numbers. These type codes introduce the "extended" attribute format that allows more than 255 attributes and longer values (up to 4111 octets for "long extended" types). The dictionary marks them as TypeExtended; full codec support is implemented alongside the extended-attribute handling in the packet layer.
const ( PacketMinLength = 20 PacketMaxLengthRFC2865 = 4096 PacketMaxLengthRFC2866 = 4095 AuthenticatorLength = 16 AttrMinLength = 2 AttrMaxLength = 255 AttrValueMaxLength = 253 // UserPasswordMaxLength bounds the cleartext password length before // padding to a 16-byte boundary (RFC 2865 §5.2: String is 16..128 octets). UserPasswordMaxLength = 128 )
Packet and attribute length limits.
RFC 2865 §3: minimum length 20, maximum length 4096. RFC 2866 §3: minimum length 20, maximum length 4095 (one less). A single attribute occupies 2..255 bytes (Type + Length + Value), so Value is at most 253 bytes.
const ( PortAuth = 1812 PortAccounting = 1813 PortCoA = 3799 PortTCP = 5080 // RFC 6613 )
Well-known UDP ports.
const AttrErrorCause = 101
Error-Cause attribute (RFC 5176 §3.3). Used in CoA/NAK and Disconnect/NAK.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Code ¶
type Code byte
Code identifies the type of a RADIUS packet. It occupies one octet at the start of every packet. See RFC 2865 §3 and RFC 5176 §2.1.
const ( AccessRequest Code = 1 AccessAccept Code = 2 AccessReject Code = 3 AccountingRequest Code = 4 AccountingResponse Code = 5 AccessChallenge Code = 11 StatusServer Code = 12 // experimental StatusClient Code = 13 // experimental Reserved Code = 255 )
Packet codes defined by RFC 2865 §3.
const ( CoARequest Code = 43 CoAACK Code = 44 CoANAK Code = 45 DisconnectRequest Code = 46 DisconnectACK Code = 47 DisconnectNAK Code = 48 )
Packet codes defined by RFC 5176 for Change-of-Authorization and Disconnect-Message flows.
func (Code) IsAccess ¶
IsAccess reports whether c is an authentication-family code (Access-Request/Accept/Reject/Challenge).
func (Code) IsAccounting ¶
IsAccounting reports whether c is an accounting-family code (Accounting-Request/Response) as defined by RFC 2866.
func (Code) IsDynamicAuthorization ¶
IsDynamicAuthorization reports whether c is a CoA or Disconnect code as defined by RFC 5176.