Skip to content

bearice/elixir-radius

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

61 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

elixir-radius

CI Hex.pm version

RADIUS protocol encoding and decoding

Example

#wrapper of gen_udp {:ok,sk} = Radius.listen 1812 loop = fn(loop)-> #secret can be a string or a function returning a string #{:ok,host,p} = Radius.recv sk,"123" {:ok,host,p} = Radius.recv sk,fn(_host) -> secret end IO.puts "From #{inspect host} : \n#{inspect p, pretty: true}" resp = %Radius.Packet{code: "Access-Reject", id: p.id, secret: p.secret} Radius.send_reply(sk, host, resp, p.auth) loop.(loop) end loop.(loop)

Dictionary configuration

Vendor specific dictionaries are compiled into a specific vendor module. Generic attributes and values are compiled into Radius.Dict. If you add the "cisco" dictionary you will get the module Radius.Dict.VendorCisco.

config :elixir_radius, included_dictionaries: ["rfc2865", "rfc2868", "rfc2869", "cisco"]

You can also add your own dictionaries by providing the paths to :elixir_radius in :extra_dictionaries

config :elixir_radius, extra_dictionaries: ["path_to_your_dictionary"]

Macros

Radius.Dict exposes a set of macro's so you can construct AVPs and let the compiler confirm the attributes and save time during runtime.

About

RADIUS Protocol on Elixir

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  

Languages