Interface RadiusAttribute
- All Known Implementing Classes:
AnonSubAttribute
,EncodedAttribute
,IntegerAttribute
,IpAttribute
,IpAttribute.V4
,IpAttribute.V6
,Ipv6PrefixAttribute
,OctetsAttribute
,StringAttribute
,VendorSpecificAttribute
public interface RadiusAttribute
-
Method Summary
Modifier and TypeMethodDescriptiondefault RadiusAttribute
Decodes attribute.default RadiusAttribute
Encodes attribute.default List<RadiusAttribute>
flatten()
Returns set of all nested attributes if contains sub-attributes, otherwise singleton set of current attribute.default String
default Optional<AttributeTemplate>
io.netty.buffer.ByteBuf
getData()
toByteBuf()
is preferred if caller exposes a reference to the ByteBuf elsewhere to avoid mutating netty ref countsdefault int
default int
default int
getTag()
default int
default int
getType()
default int
byte[]
getValue()
int
default boolean
default boolean
isTagged()
default byte[]
default io.netty.buffer.ByteBuf
-
Method Details
-
getVendorId
int getVendorId()- Returns:
- vendor Id if Vendor-Specific attribute or sub-attribute, otherwise -1
-
getType
default int getType()- Returns:
- attribute type code, typically 0-255
-
getLength
default int getLength()- Returns:
- number of octets used by attribute - uses declared length where possible, otherwise uses readableBytes
-
getHeaderSize
default int getHeaderSize()- Returns:
- number of octets used for header, typically 2 except for VSAs with custom type/length sizes
-
getTag
- Returns:
- Tag if available and specified for attribute type (RFC2868)
-
getValue
byte[] getValue()- Returns:
- attribute data as raw bytes
-
getValueString
String getValueString()- Returns:
- value of this attribute as a hex string.
-
getDictionary
Dictionary getDictionary()- Returns:
- dictionary that attribute uses
-
getData
io.netty.buffer.ByteBuf getData()toByteBuf()
is preferred if caller exposes a reference to the ByteBuf elsewhere to avoid mutating netty ref counts- Returns:
- underlying ByteBuf for attribute, includes attribute header, (optional) tag, and value
-
toByteBuf
default io.netty.buffer.ByteBuf toByteBuf()- Returns:
- underlying ByteBuf for attribute, includes attribute header, (optional) tag, and value
-
toByteArray
default byte[] toByteArray()- Returns:
- entire attribute (including headers) as byte array
-
getTypeSize
default int getTypeSize()- Returns:
- number of octets used for type, typically 1 except certain VSAs
-
getLengthSize
default int getLengthSize()- Returns:
- number of octets used for length, typically 1 except certain VSAs
-
getTagSize
default int getTagSize()- Returns:
- 1 if attribute supports a tag, otherwise 0
-
getVendor
-
isTagged
default boolean isTagged() -
getAttributeName
-
flatten
Returns set of all nested attributes if contains sub-attributes, otherwise singleton set of current attribute.- Returns:
- List of RadiusAttributes
-
getAttributeTemplate
- Returns:
- AttributeTemplate used to define this attribute
-
encode
Encodes attribute. Must be idempotent.- Parameters:
requestAuth
- (corresponding) request packet authenticatorsecret
- shared secret to encode with- Returns:
- attribute with encoded data
- Throws:
RadiusPacketException
- errors encoding attribute
-
decode
Decodes attribute. Must be idempotent.- Parameters:
requestAuth
- (corresponding) request packet authenticatorsecret
- shared secret to encode with- Returns:
- attribute with encoded data
- Throws:
RadiusPacketException
- errors decoding attribute
-
isEncoded
default boolean isEncoded()
-