Interface RadiusRequest
- All Superinterfaces:
AttributeHolder<RadiusRequest>
,NestedAttributeHolder<RadiusRequest>
,RadiusPacket<RadiusRequest>
- All Known Implementing Classes:
AccessRequest
,AccessRequestArap
,AccessRequestChap
,AccessRequestEap
,AccessRequestNoAuth
,AccessRequestPap
,AccountingRequest
,GenericRequest
-
Field Summary
Fields inherited from interface org.tinyradius.core.attribute.AttributeHolder
attrHolderLogger
Fields inherited from interface org.tinyradius.core.packet.RadiusPacket
HEADER_LENGTH, MAX_PACKET_LENGTH
-
Method Summary
Modifier and TypeMethodDescriptionstatic RadiusRequest
create
(Dictionary dictionary, byte type, byte id, byte[] authenticator, List<RadiusAttribute> attributes) Creates a RadiusPacket object.static RadiusRequest
create
(Dictionary dictionary, io.netty.buffer.ByteBuf header, List<RadiusAttribute> attributes) decodeRequest
(String sharedSecret) Decodes the request against the supplied shared secret.encodeRequest
(String sharedSecret) Encode request and generate authenticator.static RadiusRequest
fromByteBuf
(Dictionary dictionary, io.netty.buffer.ByteBuf byteBuf) Reads a request from the given input stream and creates an appropriate RadiusPacket/subclass.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, decodeAttributes, encodeAttributes, getAttribute, getAttribute, getAttributeByteBuf, getAttributes, getAttributes, getAttributes, getAttributes, getChildVendorId, getDictionary, removeAttributes, removeLastAttribute, withAttributes
Methods inherited from interface org.tinyradius.core.attribute.NestedAttributeHolder
addAttribute, getAttribute, getAttributes, getAttributes, getFlattenedAttributes, getVendorAttributes, removeAttribute, removeAttributes
Methods inherited from interface org.tinyradius.core.packet.RadiusPacket
genHashedAuth, getAuthenticator, getHeader, getId, getLength, getType, toByteBuf, toByteBuffer, toBytes
-
Method Details
-
create
static RadiusRequest create(Dictionary dictionary, io.netty.buffer.ByteBuf header, List<RadiusAttribute> attributes) throws RadiusPacketException - Throws:
RadiusPacketException
-
create
static RadiusRequest create(Dictionary dictionary, byte type, byte id, byte[] authenticator, List<RadiusAttribute> attributes) throws RadiusPacketException Creates a RadiusPacket object. Depending on the passed type, an appropriate packet is created. Also sets the type, and the packet id.- Parameters:
dictionary
- custom dictionary to usetype
- packet typeid
- packet idauthenticator
- authenticator for packet, nullableattributes
- list of attributes for packet- Returns:
- RadiusPacket object
- Throws:
RadiusPacketException
- packet validation exceptions
-
fromDatagram
static RadiusRequest fromDatagram(Dictionary dictionary, io.netty.channel.socket.DatagramPacket datagram) throws RadiusPacketException Reads 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
-
fromByteBuf
static RadiusRequest fromByteBuf(Dictionary dictionary, io.netty.buffer.ByteBuf byteBuf) throws RadiusPacketException Reads 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 attributesbyteBuf
- byteBuf 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
-