Radius.Packet (elixir_radius v1.2.0)
Link to this section Summary
Functions
Decode radius packet
Return an iolist of encoded packet
Encode the reply packet into an iolist and put the result in the :raw
key. The :auth
key needs
to be filled with the authenticator of the request packet.
Encode the request packet into an iolist and put the result in the :raw
key. The :auth
key will contain
the authenticator used on the request.
Return the value of a given attribute, if found, or default otherwise.
Verify if the packet signature is valid.
Link to this section Types
Link to this section Functions
decode(data, secret)
Decode radius packet
encode(packet, options \\ [])
Return an iolist of encoded packet
for request packets, leave packet.auth == nil, then I will generate one from random bytes. for reply packets, set packet.auth = request.auth, I will calc the reply hash with it.
packet.attrs :: [attr]
attr :: {type,value}
type :: String.t | integer | {"Vendor-Specific", vendor}
value :: integer | String.t | ipaddr
vendor :: String.t | integer
ipaddr :: {a,b,c,d} | {a,b,c,d,e,f,g,h}
encode_reply(packet, request_authenticator, options \\ [])
Encode the reply packet into an iolist and put the result in the :raw
key. The :auth
key needs
to be filled with the authenticator of the request packet.
encode_request(packet, options \\ [])
Encode the request packet into an iolist and put the result in the :raw
key. The :auth
key will contain
the authenticator used on the request.
get_attr(packet, attr_name)
Return the value of a given attribute, if found, or default otherwise.
verify(packet)
Verify if the packet signature is valid.
(https://www.ietf.org/rfc/rfc2865.txt) (https://www.ietf.org/rfc/rfc2869.txt)