Behaviours: gen_server.
This module defines the eradius_server behaviour.
Required callback functions: radius_request/3.
Optional callback functions: validate_arguments/1.
This module implements a generic RADIUS server. A handler callback module is used to process requests. The handler module is selected based on the NAS that sent the request. Requests from unknown NASs are discarded.
It is also possible to run request handlers on remote nodes. If configured, the server process will balance load among connected nodes. Please see the Overview page for a detailed description of the server configuration.
There are two callbacks at the moment.
This is optional callback and can be absent. During application configuration processing eradius_config`
calls this for the handler to validate and transform handler arguments.
=== radius_request(#radius_request{}, #nas_prop{}, HandlerData :: term()) -> {reply, #radius_request{}} | noreply ===
This function is called for every RADIUS request that is received by the server.
Its first argument is a request record which contains the request type and AVPs.
The second argument is a NAS descriptor. The third argument is an opaque term from the
server configuration.
Both records are defined in
eradius_lib.hrl', but their definition is reproduced here for easy reference.
-record(radius_request, { reqid :: byte(), cmd :: 'request' | 'accept' | 'challenge' | 'reject' | 'accreq' | 'accresp' | 'coareq' | 'coaack' | 'coanak' | 'discreq' | 'discack' | 'discnak'm attrs :: eradius_lib:attribute_list(), secret :: eradius_lib:secret(), authenticator :: eradius_lib:authenticator(), msg_hmac :: boolean(), eap_msg :: binary() }). -record(nas_prop, { server_ip :: inet:ip_address(), server_port :: eradius_server:port_number(), nas_ip :: inet:ip_address(), nas_port :: eradius_server:port_number(), nas_id :: term(), metrics_info :: {atom_address(), atom_address()}, secret :: eradius_lib:secret(), trace :: boolean(), handler_nodes :: 'local' | list(atom()) }).
port_number() = 1..65535
req_id() = byte()
stats/2 |
stats(Server, Function) -> any()
Generated by EDoc