Documentation ¶
Index ¶
- Constants
- Variables
- type Attribute
- func MustAttribute(a *Attribute, err error) *Attribute
- func NewAddressAttribute(attributeType int, value net.IP) (*Attribute, error)
- func NewIntAttribute(attributeType int, value uint32) (*Attribute, error)
- func NewStringAttribute(attributeType int, value []byte) (*Attribute, error)
- func NewVendorAttribute(vendorId int, data []*VendorData) (*Attribute, error)
- type Packet
- func (p *Packet) CalculateMessageAuthenticator(secret []byte) ([]byte, error)
- func (p *Packet) EAPPacket() (*eap.Packet, error)
- func (p *Packet) HasAttributeType(attributeType int) bool
- func (p *Packet) MarshalBinary() ([]byte, error)
- func (p *Packet) SetMessageAuthenticator(requestAuthenticator, secret []byte) error
- func (p *Packet) SetResponseAuthenticator(requestAuthenticator, secret []byte) error
- func (p *Packet) UnmarshalBinary(b []byte) error
- func (p *Packet) VerifyMessageAuthenticator(secret []byte) error
- type VendorData
Constants ¶
const ( AttributeTypeUserName = 1 AttributeTypeUserPassword = 2 AttributeTypeCHAPPassword = 3 AttributeTypeNASIPAddress = 4 AttributeTypeNASPort = 5 AttributeTypeServiceType = 6 AttributeTypeFramedProtocol = 7 AttributeTypeFramedIPAddress = 8 AttributeTypeFramedIPNetmask = 9 AttributeTypeFramedRouting = 10 AttributeTypeFilterId = 11 AttributeTypeFramedMTU = 12 AttributeTypeFramedCompression = 13 AttributeTypeLoginIPHost = 14 AttributeTypeLoginService = 15 AttributeTypeLoginTCPPort = 16 AttributeTypeReplyMessage = 18 AttributeTypeCallbackNumber = 19 AttributeTypeCallbackId = 20 AttributeTypeFramedRoute = 22 AttributeTypeFramedIPXNetwork = 23 AttributeTypeState = 24 AttributeTypeClass = 25 AttributeTypeVendorSpecific = 26 AttributeTypeSessionTimeout = 27 AttributeTypeIdleTimeout = 28 AttributeTypeTerminationAction = 29 AttributeTypeCalledStationId = 30 AttributeTypeCallingStationId = 31 AttributeTypeNASIdentifier = 32 AttributeTypeProxyState = 33 AttributeTypeLoginLATService = 34 AttributeTypeLoginLATNode = 35 AttributeTypeLoginLATGroup = 36 AttributeTypeFramedAppleTalkLink = 37 AttributeTypeFramedAppleTalkNetwork = 38 AttributeTypeFramedAppleTalkZone = 39 AttributeTypeCHAPChallenge = 60 AttributeTypeNASPortType = 61 AttributeTypePortLimit = 62 AttributeTypeLoginLATPort = 63 AttributeTypeTunnelType = 64 AttributeTypeTunnelMediumType = 65 AttributeTypeTunnelClientEndpoint = 66 AttributeTypeTunnelServerEndpoint = 67 AttributeTypeAcctTunnelConnection = 68 AttributeTypeTunnelPassword = 69 AttributeTypeARAPPassword = 70 AttributeTypeARAPFeatures = 71 AttributeTypeARAPZoneAccess = 72 AttributeTypeARAPSecurity = 73 AttributeTypeARAPSecurityData = 74 AttributeTypePasswordRetry = 75 AttributeTypePrompt = 76 AttributeTypeConnectInfo = 77 AttributeTypeConfigurationToken = 78 AttributeTypeEAPMessage = 79 AttributeTypeMessageAuthenticator = 80 AttributeTypeTunnelPrivateGroupID = 81 AttributeTypeTunnelAssignmentID = 82 AttributeTypeTunnelPreference = 83 AttributeTypeARAPChallengeResponse = 84 AttributeTypeAcctInterimInterval = 85 AttributeTypeAcctTunnelPacketsLost = 86 AttributeTypeNASPortId = 87 AttributeTypeFramedPool = 88 AttributeTypeCUI = 89 AttributeTypeTunnelClientAuthID = 90 AttributeTypeTunnelServerAuthID = 91 AttributeTypeNASFilterRule = 92 AttributeTypeOriginatingLineInfo = 94 AttributeTypeNASIPv6Address = 95 AttributeTypeFramedInterfaceId = 96 AttributeTypeFramedIPv6Prefix = 97 AttributeTypeLoginIPv6Host = 98 AttributeTypeFramedIPv6Route = 99 AttributeTypeFramedIPv6Pool = 100 AttributeTypeErrorCause = 101 AttributeTypeEAPKeyName = 102 AttributeTypeDigestResponse = 103 AttributeTypeDigestRealm = 104 AttributeTypeDigestNonce = 105 AttributeTypeDigestResponseAuth = 106 AttributeTypeDigestNextnonce = 107 AttributeTypeDigestMethod = 108 AttributeTypeDigestURI = 109 AttributeTypeDigestQop = 110 AttributeTypeDigestAlgorithm = 111 AttributeTypeDigestEntityBodyHash = 112 AttributeTypeDigestCNonce = 113 AttributeTypeDigestNonceCount = 114 AttributeTypeDigestUsername = 115 AttributeTypeDigestOpaque = 116 AttributeTypeDigestAuthParam = 117 AttributeTypeDigestAKAAuts = 118 AttributeTypeDigestDomain = 119 AttributeTypeDigestStale = 120 AttributeTypeDigestHA1 = 121 AttributeTypeSIPAOR = 122 AttributeTypeDelegatedIPv6Prefix = 123 AttributeTypeMIP6FeatureVector = 124 AttributeTypeMIP6HomeLinkPrefix = 125 AttributeTypeOperatorName = 126 AttributeTypeLocationInformation = 127 AttributeTypeLocationData = 128 AttributeTypeBasicLocationPolicyRules = 129 AttributeTypeExtendedLocationPolicyRules = 130 AttributeTypeLocationCapable = 131 AttributeTypeRequestedLocationInfo = 132 AttributeTypeFramedManagementProtocol = 133 AttributeTypeManagementTransportProtection = 134 AttributeTypeManagementPolicyId = 135 AttributeTypeManagementPrivilegeLevel = 136 AttributeTypePKMSSCert = 137 AttributeTypePKMCACert = 138 AttributeTypePKMConfigSettings = 139 AttributeTypePKMCryptosuiteList = 140 AttributeTypePKMSAID = 141 AttributeTypePKMSADescriptor = 142 AttributeTypePKMAuthKey = 143 AttributeTypeDSLiteTunnelName = 144 AttributeTypeMobileNodeIdentifier = 145 AttributeTypeServiceSelection = 146 AttributeTypePMIP6HomeLMAIPv6Address = 147 AttributeTypePMIP6VisitedLMAIPv6Address = 148 AttributeTypePMIP6HomeLMAIPv4Address = 149 AttributeTypePMIP6VisitedLMAIPv4Address = 150 AttributeTypePMIP6HomeHNPrefix = 151 AttributeTypePMIP6VisitedHNPrefix = 152 AttributeTypePMIP6HomeInterfaceID = 153 AttributeTypePMIP6VisitedInterfaceID = 154 AttributeTypePMIP6HomeIPv4HoA = 155 AttributeTypePMIP6VisitedIPv4HoA = 156 AttributeTypePMIP6HomeDHCP4ServerAddress = 157 AttributeTypePMIP6VisitedDHCP4ServerAddress = 158 AttributeTypePMIP6HomeDHCP6ServerAddress = 159 AttributeTypePMIP6VisitedDHCP6ServerAddress = 160 AttributeTypePMIP6HomeIPv4Gateway = 161 AttributeTypePMIP6VisitedIPv4Gateway = 162 AttributeTypeEAPLowerLayer = 163 AttributeTypeGSSAcceptorServiceName = 164 AttributeTypeGSSAcceptorHostName = 165 AttributeTypeGSSAcceptorServiceSpecifics = 166 AttributeTypeGSSAcceptorRealmName = 167 AttributeTypeFramedIPv6Address = 168 AttributeTypeDNSServerIPv6Address = 169 AttributeTypeRouteIPv6Information = 170 AttributeTypeDelegatedIPv6PrefixPool = 171 AttributeTypeStatefulIPv6AddressPool = 172 AttributeTypeIPv66rdConfiguration = 173 AttributeTypeAllowedCalledStationId = 174 AttributeTypeEAPPeerId = 175 AttributeTypeEAPServerId = 176 AttributeTypeMobilityDomainId = 177 AttributeTypePreauthTimeout = 178 AttributeTypeNetworkIdName = 179 AttributeTypeEAPoLAnnouncement = 180 AttributeTypeWLANHESSID = 181 AttributeTypeWLANVenueInfo = 182 AttributeTypeWLANVenueLanguage = 183 AttributeTypeWLANVenueName = 184 AttributeTypeWLANReasonCode = 185 AttributeTypeWLANPairwiseCipher = 186 AttributeTypeWLANGroupCipher = 187 AttributeTypeWLANAKMSuite = 188 AttributeTypeWLANGroupMgmtCipher = 189 AttributeTypeWLANRFBand = 190 )
const ( CodeAccessRequest = 1 CodeAccessAccept = 2 CodeAccessReject = 3 CodeAccountingRequest = 4 CodeAccountingResponse = 5 CodeAccessChallenge = 11 )
Variables ¶
var ErrInvalidAttributeLength = fmt.Errorf("invalid attribute length")
Functions ¶
This section is empty.
Types ¶
type Attribute ¶
func MustAttribute ¶
func NewAddressAttribute ¶
func NewStringAttribute ¶
StringAttribute returns an attribute whose value is a "string" as defined by RFC-2865. This is used for binary data, not UTF-8 strings. UTF-8 strings are encoded as "text" values.
func NewVendorAttribute ¶
func NewVendorAttribute(vendorId int, data []*VendorData) (*Attribute, error)
func (*Attribute) MarshalBinary ¶
type Packet ¶
func (*Packet) CalculateMessageAuthenticator ¶
CalculateMessageAuthenticator calculates the message authenticator for a packet. If the packet contains no Message-Authenticator attributes, nil is returned.
func (*Packet) EAPPacket ¶
EAPPacket decodes an EAP packet from the EAP-Message attributes of the RADIUS packet or returns nil.
func (*Packet) HasAttributeType ¶
func (*Packet) MarshalBinary ¶
func (*Packet) SetMessageAuthenticator ¶
func (*Packet) SetResponseAuthenticator ¶
func (*Packet) UnmarshalBinary ¶
UnmarshalBinary decodes a packet. Note that it may partially unmarshal a packet and return ErrInvalidAttributeLength, and the caller should handle that case according to RFC-2865, section 5:
"If an Attribute is received in an Access-Request but with an invalid Length, an Access-Reject SHOULD be transmitted. If an Attribute is received in an Access-Accept, Access-Reject or Access-Challenge packet with an invalid length, the packet MUST either be treated as an Access-Reject or else silently discarded."
func (*Packet) VerifyMessageAuthenticator ¶
VerifyMessageAuthenticator verifies Message-Authenticator attributes if present.