Interface RadiusRequest
- All Superinterfaces:
AttributeHolder<RadiusRequest>
,NestedAttributeHolder<RadiusRequest>
,RadiusPacket<RadiusRequest>
- All Known Implementing Classes:
AccessRequest
,AccessRequestArap
,AccessRequestChap
,AccessRequestEap
,AccessRequestNoAuth
,AccessRequestPap
,AccountingRequest
,GenericRequest
public interface RadiusRequest extends RadiusPacket<RadiusRequest>
-
Field Summary
Fields inherited from interface org.tinyradius.core.packet.RadiusPacket
HEADER_LENGTH, MAX_PACKET_LENGTH, packetLogger
-
Method Summary
Modifier and Type Method Description static RadiusRequest
create(Dictionary dictionary, byte type, byte identifier, byte[] authenticator, java.util.List<RadiusAttribute> attributes)
Creates a RadiusPacket object.RadiusRequest
decodeRequest(java.lang.String sharedSecret)
Decodes the request against the supplied shared secret.RadiusRequest
encodeRequest(java.lang.String sharedSecret)
Encode request and generate authenticator.static RadiusRequest
fromDatagram(Dictionary dictionary, io.netty.channel.socket.DatagramPacket datagram)
Reads a request from the given input stream and creates an appropriate RadiusPacket/subclass.Methods inherited from interface org.tinyradius.core.attribute.AttributeHolder
addAttribute, addAttribute, filterAttributes, filterAttributes, filterAttributes, getAttribute, getAttribute, getAttributeBytes, getChildVendorId, removeAttributes, removeLastAttribute, withAttributes
Methods inherited from interface org.tinyradius.core.attribute.NestedAttributeHolder
addAttribute, filterAttributes, filterAttributes, getAttribute, getFlattenedAttributes, getVendorAttributes, removeAttribute, removeAttributes
Methods inherited from interface org.tinyradius.core.packet.RadiusPacket
genHashedAuth, getAttributes, getAuthenticator, getDictionary, getId, getType, toDatagram, toDatagram, verifyPacketAuth
-
Method Details
-
create
static RadiusRequest create(Dictionary dictionary, byte type, byte identifier, byte[] authenticator, java.util.List<RadiusAttribute> attributes)Creates a RadiusPacket object. Depending on the passed type, an appropriate packet is created. Also sets the type, and the the packet identifier.- Parameters:
dictionary
- custom dictionary to usetype
- packet typeidentifier
- packet identifierauthenticator
- authenticator for packet, nullableattributes
- list of attributes for packet- Returns:
- RadiusPacket object
-
fromDatagram
static RadiusRequest fromDatagram(Dictionary dictionary, io.netty.channel.socket.DatagramPacket datagram) throws RadiusPacketExceptionReads a request from the given input stream and creates an appropriate RadiusPacket/subclass.Decodes the encrypted fields and attributes of the packet, and checks authenticator if appropriate.
- Parameters:
dictionary
- dictionary to use for attributesdatagram
- DatagramPacket to read packet from- Returns:
- new RadiusPacket object
- Throws:
RadiusPacketException
- malformed packet
-
encodeRequest
Encode request and generate authenticator.Must be idempotent.
- Parameters:
sharedSecret
- shared secret that secures the communication with the other Radius server/client- Returns:
- RadiusRequest with new authenticator and/or encoded attributes
- Throws:
RadiusPacketException
- if invalid or missing attributes
-
decodeRequest
Decodes the request against the supplied shared secret.Must be idempotent.
- Parameters:
sharedSecret
- shared secret- Returns:
- verified RadiusRequest with decoded attributes if appropriate
- Throws:
RadiusPacketException
- if authenticator check fails
-