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>
  • 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 use
      type - packet type
      id - packet id
      authenticator - authenticator for packet, nullable
      attributes - 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 attributes
      datagram - 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 attributes
      byteBuf - byteBuf to read packet from
      Returns:
      new RadiusPacket object
      Throws:
      RadiusPacketException - malformed packet
    • encodeRequest

      RadiusRequest encodeRequest(String sharedSecret) throws RadiusPacketException
      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

      RadiusRequest decodeRequest(String sharedSecret) throws RadiusPacketException
      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