:authenticator |
[W] |
The authenticator field can be changed with this attribute writer.
|
:authenticator |
[R] |
The 16-byte Authenticator field can be read as a character string with this
attribute reader.
|
:code |
[W] |
The code may be set to any of the strings described above in the code
attribute reader.
|
:code |
[R] |
The code field is returned as a string. As of this writing, the following
codes are recognized:
Access-Request Access-Accept
Access-Reject Accounting-Request
Accounting-Response Access-Challenge
Status-Server Status-Client
|
:identifier |
[R] |
The one-byte Identifier used to match requests and responses is obtained as
a character.
|
:identifier |
[W] |
The Identifer used to match RADIUS requests and responses can also be
directly set using this.
|
To initialize the object, pass a Radius::Dictionary object to it.
Given a (packed) RADIUS packet and a shared secret, returns a new packet
with the authenticator field changed in accordance with RADIUS protocol
requirements.
Parameters
packed_packet: | The packed packet to compute a new Authenticator field for.
|
secret: | The shared secret of the RADIUS system.
|
Return value
a new packed packet with the authenticator field recomputed.
Given a raw RADIUS packet data, unpacks its contents so it can be
analyzed with other methods, (e.g. code, attr, etc.). It
also clears all present attributes.
Parameters
data: | The raw RADIUS packet to decode
|
The Radius::Packet object contains attributes
that can be set and altered with the object's accessor methods, or obtained
from the unpack method. This method will return a raw RADIUS packet that
should be suitable for sending to a RADIUS client or server over UDP as per
RFC 2138.
Return Value
The RADIUS packet corresponding to the object's current internal state.
This method is provided a block which will pass every attribute-value pair
currently available.
The value of the named attribute in the object's internal state can be
obtained.
Parameters
name: | the name of the attribute to obtain
|
Return value:
The value of the attribute is returned.
Changes the value of the named attribute.
Parameters
name: | The name of the attribute to set
|
value: | The value of the attribute
|
Undefines the current value of the named attribute.
Parameters
name: | The name of the attribute to unset
|
Undefines all attributes.
This method will pass each vendor-specific attribute available to a passed
block. The parameters to the block are the vendor ID, the attribute name,
and the attribute value.
This method is an iterator that passes each vendor-specific attribute
associated with a vendor ID.
Changes the value of the named vendor-specific attribute.
Parameters
vendorid: | The vendor ID for the VSA to set
|
name: | The name of the attribute to set
|
value: | The value of the attribute
|
Undefines the current value of the named vendor-specific attribute.
Parameters
vendorid: | The vendor ID for the VSA to set
|
name: | The name of the attribute to unset
|
Undefines all vendor-specific attributes.
Undefines all regular and vendor-specific attributes
This method obtains the value of a vendor-specific attribute, given the
vendor ID and the name of the vendor-specific attribute.
Parameters
vendorid: | the vendor ID
|
name: | the name of the attribute to obtain
|
Return value:
The value of the vendor-specific attribute is returned.
The RADIUS User-Password attribute is encoded with a shared secret. This
method will return the decoded version given the shared secret. This also
works when the attribute name is 'Password' for compatibility reasons.
Parameters
secret: | The shared secret of the RADIUS system
|
Return
The cleartext version of the User-Password.
The RADIUS User-Password attribute is encoded with a shared secret. This
method will prepare the encoded version of the password. Note that this
method always stores the encrypted password in the 'User-Password'
attribute. Some (non-RFC 2138-compliant) servers have been reported that
insist on using the 'Password' attribute instead.
Parameters
passwd: | The password to encrypt
|
secret: | The shared secret of the RADIUS system
|
This method will convert a RADIUS packet into a printable string. Any
fields in the packet that might possibly contain non-printable characters
are turned into Base64 strings.
Parameters
secret: | The shared secret of the RADIUS system. Pass nil if
|
you don't want to see User-Password attributes decoded.
Return
The string representation of the RADIUS packet.