Giter Club home page Giter Club logo

eradius's Introduction

eradius

Hex.pm Version Hex.pm Downloads Build Status Erlang Versions

This fork of eradius is a radical deviation from the original Jungerl code. It contains a generic RADIUS client, support for several authentication mechanisms and dynamic configuration (it implements the config_change/3 application callback).

Contents

Erlang Version Support

All minor version of the current major release and the highest minor version of the previous major release will be supported. At the moment this means OTP 21.3, OTP 22.x, OTP 23.x and OTP 24.x are supported. OTP versions before 21.0 do not work due the use of logger. When in doubt check the otp_release section in main.yml for tested versions.

Building eradius

$ rebar3 compile

Using eradius

Eradius requires a certain degree of configuration which is described in the app.src file. Minimal examples of server callbacks can be found in the tests.

Run sample server

$ cd sample
$ rebar3 shell --config example.config --apps eradius_server_sample

Then run a simple benchmark:

1> eradius_server_sample:test().
...
13:40:43.979 [info] 127.0.0.1:59254 [8]: Access-Accept
13:40:43.979 [info] 127.0.0.1:59254 [6]: Access-Accept
13:40:43.980 [info] 127.0.0.1:59254 [3]: Access-Accept
13:40:43.980 [info] 127.0.0.1:59254 [0]: Access-Accept
4333.788381 req/sec.
ok

Metrics

Eradius exposes following metrics via exometer:

  • counter and handle time for requests
  • counter for responses (this includes acks, naks, accepts etc.)

The measurements are available for client, server and also for the specific NAS callbacks. Further they are exposed in a 'total' fashion but also itemized by request/response type (e.g. access request, accounting response etc.).

It is possible to expose measurements compliant with RFC 2619 and RFC 2621 using the build in metrics.

The handle time metrics are generated internally using histograms. These histograms all have a time span of 60s. The precise metrics are defined in include/eradius_metrics.hrl.

See more in METRICS.md.

RADIUS server configuration

⚠️ Notes ⚠️

  • Square brackets ([]) denote an array that consists of n comma-separated objects.
  • Curly brackets ({}) denote a tuple that consists of a defined number of objects.

Servers in this configuration are endpoints consisting of an IPv4 address and one or more ports.
servers is a list [] of said endpoints:

servers == { servers, [<Server>] }

Each server is tuple ({}):

Server == { <SymbolicName>, { <IP>, [<Ports>] } } | { <SymbolicName>, { <IP>, [<Ports>], <ExtraSocketOptions> } }
ExtraServerOptions == [<ServerOption>]
ExtraSocketOptions == [{socket_opts, [socket_setopt()]}] (see: https://erlang.org/doc/man/inet.html#setopts-2)
ServerOption == {rate_config, <SymbolicNameLimit> | <RateConfigList>}

Rate configuration can be configured per server, in extra configuration, with a symbolic name or directly in server

{SymbolicNameLimit, RateConfigList}
RateConfigList == [<RateOption>]
RateOption == { limit | max_size | max_time, integer() | undefined }

Each server is assigned a list of handlers. This list defines the NASes that are allowed to send RADIUS requests to a server and which handler is to process the request.

Handler assignment: {<SymbolicName>, [<Handlers>]}

SymbolicName == Reference to a previously defined server.
Handler == { <HandlerDefinition>, [<Sources>] }

If only one handler module is used, it can be defined globally as {radius_callback, <HandlerMod>}. If more than one handler modules are used, they have to be given in the HandlerDefinition:

HandlerDefinition == {<HandlerMod>, <NasId>, <HandlerArgs>} | {<NasId>, <HandlerArgs>}
HandlerMod == Handler module to process the received requests.
NasId == String describing the Source.
HandlerArgs == List of arguments givent the handler module.
Source == {<IP>, <Secret>} | {<IP>, <Secret>, [<SourceOption>]}
SourceOption == {group, <GroupName>} | {nas_id, <NasId> }

IP == IPv4 source address.
Secret == Binary. Passphrase, the NAS authenticates with.
GroupName:
RADIUS requests received by a server are forwarded to lists of nodes.
The lists are assigned to handlers, so the RADIUS requests of every handler can be forwarded to different nodes, if necessary.
The lists are referenced by a GroupName. If only one group is defined, the GroupName can be omitted.
In this case, all handlers forward their requests to the same list of nodes.
Session nodes == {session_nodes, ['node@host', ...]} | {session_nodes, [{<GroupName>, ['node@host', ...]}]}

eradius configuration example 1

All requests are forwarded to the same globally defined list of nodes. Only one handler module is used.

[{eradius, [
    {session_nodes, ['node1@host1', 'node2@host2']},
    {radius_callback, tposs_pcrf_radius},
    {servers, [
        {root, {"127.0.0.1", [1812, 1813]}}
    ]},
    {root, [
        {
            {"NAS1", [handler_arg1, handler_arg2]},
            [ {"10.18.14.2", <<"secret1">>} ]
        },
        {
            {"NAS2", [handler_arg1, handler_arg2]},
            [ {"10.18.14.3", <<"secret2">>, [{nas_id, <<"name">>}]} ]
        }
    ]}
]}]

eradius configuration example 2

Requests of different sources are forwarded to different nodes. Different handlers are used for the sources.

[{eradius, [
    {session_nodes, [
        {"NodeGroup1", ['node1@host1', 'node2@host2']},
        {"NodeGroup2", ['node3@host3', 'node4@host4']}
    ]},
    {servers, [
        {root, {"127.0.0.1", [1812, 1813]}}
    ]},
    {root, [
        {
            {tposs_pcrf_handler1, "NAS1", [handler_arg1, handler_arg2]},
            [ {"10.18.14.2", <<"secret1">>, [{group, "NodeGroup1"}]} ]
        },
        {
            {tposs_pcrf_handler2, "NAS2", [handler_arg3, handler_arg4]},
            [ {"10.18.14.3", <<"secret2">>, [{group, "NodeGroup2"}]} ]
        }
    ]}
]}]

eradius configuration example 3

Requests of different sources are forwarded to different nodes. Different handlers are used for the sources.

[{eradius, [
    {session_nodes, [
        {"NodeGroup1", ['node1@host1', 'node2@host2']},
        {"NodeGroup2", ['node3@host3', 'node4@host4']}
    ]},
    {servers, [
        {root, {"127.0.0.1", [1812, 1813], [{socket_opts, [{recbuf, 8192},
                                                           {sndbuf, 131072},
                                                           {netns, "/var/run/netns/myns"}]}]}}
    ]},
    {root, [
        {
            {tposs_pcrf_handler1, "NAS1", [handler_arg1, handler_arg2]},
            [ {"10.18.14.2", <<"secret1">>, [{group, "NodeGroup1"}]} ]
        },
        {
            {tposs_pcrf_handler2, "NAS2", [handler_arg3, handler_arg4]},
            [ {"10.18.14.3", <<"secret2">>, [{group, "NodeGroup2"}]} ]
        }
    ]}
]}]

eradius configuration example 4

Example of full configuration with keys which can use in eradius:

[{eradius, [
    %% The IP address used to send RADIUS requests
    {client_ip, {127, 0, 0, 1}},
    %% The maximum number of open ports that will be used by RADIUS clients
    {client_ports, 256},
    %% how long the binary response is kept before re-sending it
    {resend_timeout, 500},
    %% List of RADIUS dictionaries
    {tables, [dictionary]},
    %% List of nodes where RADIUS requests possibly will be forwarded by a RADIUS server
    {session_nodes, local},
    %% A RADIUS requests handler callback module
    {radius_callback, eradius_server_sample},
    %% NAS specified for `root` RADIUS server
    {root, [
        {{"root", []}, [{"127.0.0.1", "secret"}]}
    ]},
    %% NAS specified for `acct` RADIUS server
    {acct, [
        {{eradius_proxy, "radius_acct", [{default_route, {{127, 0, 0, 2}, 1813, <<"secret">>}, [{pool, pool_name}, {timeout, 5000}, {retries, 3}]]},
        [{"127.0.0.1", "secret"}]}
    ]},
    %% List of RADIUS servers
    {servers, [
        {root, {"127.0.0.1", [1812]}},
        {acct, {"127.0.0.1", [1813]}}
    ]},
    {counter_aggregator, false},
    %% List of histogram buckets for RADIUS servers metrics
    {histogram_buckets, [10, 30, 50, 75, 100, 1000, 2000]},
    %% Simple file-based logging of RADIUS requests and metadata
    {logging, true},
    %% Path to log file
    {logfile, "./radius.log"},
    %% List of upstream RADIUS servers pools
    {servers_pool, [
        {pool_name, [
            {{127, 0, 0, 2}, 1812, <<"secret">>, [{retries, 3}]},
            {{127, 0, 0, 3}, 1812, <<"secret">>}
        ]}
    ]},
    {server_status_metrics_enabled, false},
    {counter_aggregator, false},
    %% Size of RADIUS receive buffer
    {recbuf, 8192},
    %% The minimum size of the send buffer to use for the RADIUS
    {sndbuf, 131072}
]}].

Support of failover for client

Added support for fail-over.
Set of secondary RADIUS servers could be passed to the RADIUS client API eradius_client:send_request/3 via options or to RADIUS proxy via configuration.

If the response wasn't received after a number of requests specified by retries RADIUS client options - such RADIUS servers will be marked as non-active and RADIUS requests will not be sent for such non-active RADIUS servers, while configurable timeout (eradius.unreachable_timeout) is not expired.

Secondary RADIUS servers could be specified via RADIUS proxy configuration, with the new configuration option - pool name.

Failover configuration

Configuration example of failover where the pool_name is atom specifies name of a pool of secondary RADIUS servers.

[{eradius, [
    %%% ...
    {default_route, {{127, 0, 0, 1}, 1812, <<"secret">>}, [{pool, pool_name}]}
    %%% ...
]}]

All pools are configured via:

[{eradius, [
    %%% ...
    {servers_pool, [
        {pool_name, [
            {{127, 0, 0, 2}, 1812, <<"secret">>, [{retries, 3}]},
            {{127, 0, 0, 3}, 1812, <<"secret">>}
        ]}
    ]}
    %%% ...
]}]

Failover Erlang code usage

In a case when RADIUS proxy (eradius_proxy handler) is not used, a list of RADIUS upstream servers could be passed to the eradius_client:send_radius_request/3 via options, for example:

eradius_client:send_request(Server, Request, [{failover, [{"localhost", 1814, <<"secret">>}]}]).

If failover option was not passed to the client through the options or RADIUS proxy configuration there should not be any performance impact as RADIUS client will try to a RADIUS request to only one RADIUS server that is defined in eradius_client:send_request/3 options.

For each secondary RADIUS server server status metrics could be enabled via boolean server_status_metrics_enabled configuration option.

Eradius counter aggregator

The eradius_counter_aggregator would go over all nodes in an Erlang cluster and aggregate the counter values from all nodes.
Configuration value of counter_aggregator can be true or false where true - is enable, false - is disable counter aggregator.
By default the counter_aggregator is disabled and have default value false. Configuration example:

[{eradius, [
    %%% ...
    {counter_aggregator, true}
    %%% ...
]}]

Tables

A list of RADIUS dictionaries to be loaded at startup. The atoms in this list are resolved to files in the priv directory of the eradius application.

Example:

    [dictionary, dictionary_cisco, dictionary_travelping]

eradius's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

eradius's Issues

How to Reply attributes contains vendor-spesific attributes

eradius version

3.2.1

Erlang/OTP version

26

Description

Current behavior

Describe current behavior ...

Expected behavior

I need to reply with multiple vendor spesific attributes

 var response = radius.encode_response({
    packet: packet,
    code: code,
    secret: secret,
    attributes:  [
        ['User-Name', 'rajiv'],
        ['User-Password', 'Ltrx12345'],
        ['Vendor-Specific', 14988, [['Mikrotik-Wireless-PSK', 'shiva']]]
      ]
  });
radius_request(R = #radius_request{cmd = request}, _NasProp, _Args) ->
   F = fun(Attr) ->
      case Attr of
          {{attribute,4,ipaddr,"NAS-IP-Address",no}, NAS_IP_Address} ->
              logger:info("NAS-IP-Address: ~p", [NAS_IP_Address]);
          {{attribute,1,string,"User-Name",no}, User_Name} ->
              logger:info("User-Name: ~p", [User_Name]);
          {{attribute,2,string,"User-Password",scramble}, User_Password_Bin} ->
              <<User_Password:13/binary, _:3/binary>> = User_Password_Bin,
              logger:info("User-Password: ~p", [strip(User_Password)])
      end
  end,

  [F(Attr) || Attr <- R#radius_request.attrs],

  ReplyAttrList = [
      {?Session_Timeout, 3600},
      {?Port_Limit, 1},
      {?RVendor_Specific, ?Mikrotik},
      {?Mikrotik_Rate_Limit, "1"}
  ],
  Reply = #radius_request{cmd = accept, attrs = ReplyAttrList},

  {reply, Reply};

Result reply in nodejs client

{
  code: 'Access-Accept',
  identifier: 1,
  length: 47,
  authenticator: <Buffer be 89 de 7c 5d 81 5b 4a 77 b2 a3 5a b5 82 e4 fc>,
  attributes: { 'Session-Timeout': 3600, 'Port-Limit': 1, 'Vendor-Specific': {} },
  raw_attributes: [
    [ 27, <Buffer 00 00 0e 10> ],
    [ 62, <Buffer 00 00 00 01> ],
    [ 26, <Buffer 00 00 3a 8c> ],
    [ 26, <Buffer 00 00 3a 8c 08 03 31> ]
  ]
}
{ address: '127.0.0.1', family: 'IPv4', port: 1812, size: 47 }

Please help me

eradius compile error on Windows: '.' is not recognized as an internal or external command

eradius compile error on Windows 7:

===> Compiling eradius
'.' is not recognized as an internal or external command,
operable program or batch file.
===> Hook for compile failed!

Fix:
Modify the following lines in the rebar.config file:

From
{pre_hooks, [{compile, "./dicts_compiler.erl compile"},
{clean, "./dicts_compiler.erl clean"}]}.

To
{pre_hooks, [{compile, "escript dicts_compiler.erl compile"},
{clean, "escript dicts_compiler.erl clean"}]}.

After this modification it compiles eradius on Windows
===> Compiling eradius
Compiled priv/dictionaries/dictionary.xedia
Compiled priv/dictionaries/dictionary.wispr
Compiled priv/dictionaries/dictionary.versanet
missing: "Termination-Action"
...

performance after last metric rework

due to the last metrics change (#65) we have a performance change (5616 -> 4320 p/s). We should find the reason and check if it possible to fix:
TEST: 10 clients, 10002 auth requests done
HOST: 4 Intel(R) Core(TM) i5-3230M CPU @ 2.60GHz, SSD, 4Gb RAM

before:
         Total sent        :  10002
         Total retransmits :  0
         Total succeeded   :  10002
         Total failed      :  0
         Total no reply    :  0
         Total time (s)    :  1.780
         Packets/s         :  5616
         Response times:
        < 10 usec  : 0
        < 100 usec : 0
        < msec     : 22
        < 10 msec  : 9971
        < 0.1s     : 9
        < s        : 0
        < 10s      : 0
        < 100s     : 0


========================================================================================
 nonode@nohost                                                             15:37:03
 Load:  cpu        20               Memory:  total       98084    binary       2807
        procs     126                        processes   69135    code        13077
        runq        0                        atom          493    ets          6149

Pid            Name or Initial Func    Time    Reds  Memory    MsgQ Current Function
----------------------------------------------------------------------------------------
<0.246.0>      erlang:apply/2           '-' 2673701   11832       0 file_io_server:serve
<0.250.0>      eradius_server_127.0     '-' 1216911   13904       0 gen_server:loop/6   
<0.243.0>      eradius_counter          '-'  589141  109272       0 gen_server:loop/6   
<0.281.0>      exometer_proc:'-spaw     '-'  238300 4720488       0 exometer_probe:loop/
<0.26.0>       group:server/3           '-'    5952   88544       0 group:server_loop/3 
<0.20260.0>    etop_txt:init/1          '-'    3717  230368       0 etop:update/1       
<0.24.0>       user_drv                 '-'     558   11832       0 user_drv:server_loop
<0.14216.4>    eradius_server:do_ra     '-'     265    6864       0 eradius_server:wait_
<0.242.0>      eradius_node_mon         '-'      97    7080       0 gen_server:loop/6   
========================================================================================



after:

-----------------------------------
         Total sent        :  10002
         Total retransmits :  0
         Total succeeded   :  10002
         Total failed      :  0
         Total no reply    :  0
         Total time (s)    :  2.315
         Packets/s         :  4320
         Response times:
        < 10 usec  : 0
        < 100 usec : 0
        < msec     : 16
        < 10 msec  : 9986
        < 0.1s     : 0
        < s        : 0
        < 10s      : 0
        < 100s     : 0


Pid            Name or Initial Func    Time    Reds  Memory    MsgQ Current Function
----------------------------------------------------------------------------------------
<0.330.0>      eradius_server_127.0     '-' 1076824   26456       0 gen_server:loop/6   
<0.279.0>      eradius_counter          '-'  492381   29504       0 gen_server:loop/6   
<0.325.0>      exometer_proc:'-spaw     '-'  172893 1344544       0 exometer_probe:loop/
<0.326.0>      exometer_proc:'-spaw     '-'  172891 1344544       0 exometer_probe:loop/
<0.300.0>      exometer_proc:'-spaw     '-'  172890 1344544       0 exometer_probe:loop/
<0.301.0>      exometer_proc:'-spaw     '-'  172890 1344544       0 exometer_probe:loop/
<0.26.0>       group:server/3           '-'    5831   42264       0 group:server_loop/3 
<0.30345.0>    etop_txt:init/1          '-'    3553  163392       0 etop:update/1       
<0.24.0>       user_drv                 '-'     560   21608       0 user_drv:server_loop
<0.278.0>      eradius_node_mon         '-'      96    7080       0 gen_server:loop/6   
========================================================================================

Add possibility to proxy radius requests

The request should go to next ip:port, where it should be handled and answer should go throw a proxy back to radius client:

  +-----------------------+      +----------------------+     +----------------------+
  |radius client          |      |radius proxy          |     |radius server         |
  |                       |      |                      |     |                      |
  |                       +------>                      +----->                      |
  |                       |      |                      |     |                      |
  |                       |      |                      |     |                      |
  +-----------------------+      +----------------------+     +----------------------+

appending metadata for lager logging crashes for unknown attributes

I observed this for unknown attributes:

2015-04-22 22:01:20 UTC =CRASH REPORT====
crasher:
initial call: eradius_server:do_radius/5
pid: <0.219.0>
registered_name: []
exception error: bad argument: [{erlang,list_to_atom,[["Unkown-","64"]],[]},{eradius_log,collect_attr,2,[{file,"/REDO/build/tmp/work/core2-64-tposs-linux/erlang-eradius/0.6.1-r5/git/src/eradius_log.erl"},{line,161}]},{eradius_log,'-collect_meta/1-lc$^0/1-0-',1,[{file,"/REDO/build/tmp/work/core2-64-tposs-linux/erlang-eradius/0.6.1-r5/git/src/eradius_log.erl"},{line,62}]},{eradius_log,'-collect_meta/1-lc$^0/1-0-',1,[{file,"/REDO/build/tmp/work/core2-64-tposs-linux/erlang-eradius/0.6.1-r5/git/src/eradius_log.erl"},{line,62}]},{eradius_server,handle_request,3,[{file,"/REDO/build/tmp/work/core2-64-tposs-linux/erlang-eradius/0.6.1-r5/git/src/eradius_server.erl"},{line,274}]},{eradius_server,do_radius,5,[{file,"/REDO/build/tmp/work/core2-64-tposs-linux/erlang-eradius/0.6.1-r5/git/src/eradius_server.erl"},{line,184}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,237}]}]

Add documentation of configuration

The documentation of configuration is miss. Make sense to add a description of the configuration and default values for recbuf, client_ports, client_ip, histogram_buckets, tables, logging, logfile, resend_timeout, counter_aggregator keys config.

Remove non use module eradius_log.erl

eradius version

2.2.1

Description

The eradius currently contains a module eradius_log.erl which used in few places for logging but at the same time in eradius used logger for logging. Looks like It's no make sense to use two different logging.

Current behavior

The eradius use eradius_log.erl and logger for logging.

Expected behavior

The eradius_log.erl removed from eradius and used only logger for logging.

Metrics Docu

The documentation for eradius is quite thin. Even though metrics should be documented such that it is easy to get an overview here.

Bump prometheus version to 4.8.2

eradius version

master

Erlang/OTP version

Current

Description

  • Motivation
    prometheus.erl has bumped the version to 4.8.2.
  • Proposal
    Use the new version when possible.

Client NasIds in Metrics

Currently Clients cannot be identified to the NAS they connect to. This should be changed such that metrics handling gets easier.

Add .github

eradius version

2.2.1

Description

Currently user Travis CI but at the same time mostly libraries is start use GH CI.

Current behavior

The Travis CI is used.

Expected behavior

The GH CI is used.

eradius don't started

eradius application don't stared with error:

 {error,{{shutdown,{failed_to_start_child,dict,
                                          {function_clause,[{filename,join,
                                                                      [{error,bad_name},"dictionary.map"],
                                                                      [{file,"filename.erl"},{line,406}]},
                                                            {eradius_dict,'-do_load_tables/2-fun-0-',2,
                                                                          [{file,"src/eradius_dict.erl"},{line,78}]},
                                                            {lists,flatmap,2,[{file,"lists.erl"},{line,1248}]},
                                                            {eradius_dict,do_load_tables,2,
                                                                          [{file,"src/eradius_dict.erl"},{line,77}]},
                                                            {eradius_dict,init,1,
                                                                          [{file,"src/eradius_dict.erl"},{line,54}]},
                                                            {gen_server,init_it,6,[{file,[...]},{line,...}]},
                                                            {proc_lib,init_p_do_apply,3,[{file,...},{...}]}]}}},
         {eradius,start,[normal,[]]}}}]

start it as:

[application:ensure_started(A) || A <- [syntax_tools, compiler, goldrush, lager, crypto, eradius]].

Erlang/OTP 17, erts-6.2, VM started as:

erl -pa ebin deps/*/ebin -sname rad -config example.config

OTP 18 support

I tried to compile and got this:

src/eradius_server.erl:335: Warning: erlang:now/0: Deprecated BIF. See the "Time and Time Correction in Erlang" chapter of the ERTS User's Guide for more information.
src/eradius_counter_aggregator.erl:41: Warning: erlang:now/0: Deprecated BIF. See the "Time and Time Correction in Erlang" chapter of the ERTS User's Guide for more information.
src/eradius_counter_aggregator.erl:48: Warning: erlang:now/0: Deprecated BIF. See the "Time and Time Correction in Erlang" chapter of the ERTS User's Guide for more information.
src/eradius_counter_aggregator.erl:56: Warning: erlang:now/0: Deprecated BIF. See the "Time and Time Correction in Erlang" chapter of the ERTS User's Guide for more information.
src/eradius_counter.erl:27: Warning: erlang:now/0: Deprecated BIF. See the "Time and Time Correction in Erlang" chapter of the ERTS User's Guide for more information.
src/eradius_counter.erl:27: Warning: erlang:now/0: Deprecated BIF. See the "Time and Time Correction in Erlang" chapter of the ERTS User's Guide for more information.
src/eradius_counter.erl:35: Warning: erlang:now/0: Deprecated BIF. See the "Time and Time Correction in Erlang" chapter of the ERTS User's Guide for more information.
src/eradius_counter.erl:85: Warning: erlang:now/0: Deprecated BIF. See the "Time and Time Correction in Erlang" chapter of the ERTS User's Guide for more information.
src/eradius_counter.erl:92: Warning: erlang:now/0: Deprecated BIF. See the "Time and Time Correction in Erlang" chapter of the ERTS User's Guide for more information.
src/eradius_counter.erl:100: Warning: erlang:now/0: Deprecated BIF. See the "Time and Time Correction in Erlang" chapter of the ERTS User's Guide for more information.
src/eradius_counter.erl:114: Warning: erlang:now/0: Deprecated BIF. See the "Time and Time Correction in Erlang" chapter of the ERTS User's Guide for more information.
src/eradius_server.erl:335: Warning: erlang:now/0: Deprecated BIF. See the "Time and Time Correction in Erlang" chapter of the ERTS User's Guide for more information.
src/eradius_counter_aggregator.erl:41: Warning: erlang:now/0: Deprecated BIF. See the "Time and Time Correction in Erlang" chapter of the ERTS User's Guide for more information.
src/eradius_counter_aggregator.erl:48: Warning: erlang:now/0: Deprecated BIF. See the "Time and Time Correction in Erlang" chapter of the ERTS User's Guide for more information.
src/eradius_counter_aggregator.erl:56: Warning: erlang:now/0: Deprecated BIF. See the "Time and Time Correction in Erlang" chapter of the ERTS User's Guide for more information.
src/eradius_counter.erl:27: Warning: erlang:now/0: Deprecated BIF. See the "Time and Time Correction in Erlang" chapter of the ERTS User's Guide for more information.
src/eradius_counter.erl:27: Warning: erlang:now/0: Deprecated BIF. See the "Time and Time Correction in Erlang" chapter of the ERTS User's Guide for more information.
src/eradius_counter.erl:35: Warning: erlang:now/0: Deprecated BIF. See the "Time and Time Correction in Erlang" chapter of the ERTS User's Guide for more information.
src/eradius_counter.erl:85: Warning: erlang:now/0: Deprecated BIF. See the "Time and Time Correction in Erlang" chapter of the ERTS User's Guide for more information.
src/eradius_counter.erl:92: Warning: erlang:now/0: Deprecated BIF. See the "Time and Time Correction in Erlang" chapter of the ERTS User's Guide for more information.
src/eradius_counter.erl:100: Warning: erlang:now/0: Deprecated BIF. See the "Time and Time Correction in Erlang" chapter of the ERTS User's Guide for more information.
src/eradius_counter.erl:114: Warning: erlang:now/0: Deprecated BIF. See the "Time and Time Correction in Erlang" chapter of the ERTS User's Guide for more information.

I think we can replace most of these to os:timestamp()

Collisions in imported dictionary

The issue can be easy reproduced:

> application:ensure_all_started(eradius).
> eradius_dict:load_tables([dictionary, dictionary_3gpp, dictionary_travelping, dictionary_microsoft, dictionary_cisco]).
> eradius_dict:lookup(9).
[{vendor,9,"Cisco"}]

I expected [{attribute,9,ipaddr,"Framed-IP-Netmask",no}] because we have a such attribute or the with vendor and attribute.

A short investigation shows the problem is in eradius_dict table which is set with keypos 2. That means having attribute and vendor with the same id is not allowed. Changing set to bag is not enough also all using of eradius_dict:lookup/1 should be reviewed.

rebar dictionary plugin breaks alcatel.sr dictionary

the header and map files generated from the alcatel.sr dictionary should be called dictionary_alcatel_sr.hrl and dictionary_alcatel_sr.map. This used to work with tetrapak.

With rebar the files are called dictionary_alcatel.sr.hrl and dictionary_alcatel.sr.map (note the dot between alcatel and sr).

Remove non use module eradius_eap_packet.erl

eradius version

2.2.1

Description

The eradius currently contains a module eradius_eap_packet.erl which is not used but implemented EAP(Extensible Authentication Protocol) RFC-3748 message encoder/decoder functions.

Current behavior

The eradius_eap_packet.erl implemented and not used in eradius.

Expected behavior

The eradius_eap_packet.erl removed from eradius.

send_remote_request bug

It seems that the eradius_client:send_remite_request_bug/4 function contains a bug. We are passing a radius_request to the send_remote_request_loop function as fifth parameter. For now this parameter can be plain radius_request or encoded request depends on the get_remote_version value:

Request2 = case eradius_node_mon:get_remote_version(Node) of
                           {0, Minor} when Minor < 6 ->
                               eradius_lib:encode_request(Request1);
                           _ ->
                               Request1
                       end,
SenderPid = spawn(Node, ?MODULE, send_remote_request_loop, [self(), Socket, ReqId, {IP, Port}, Request2, Options]),

which is end up will call send_request_loop/5. The problem that the send_request_loop/5 has clause only for non-encoded radius_request.

Update the README or samples with instructions for Elixir.

I have been trying to use the Elixir sample but it doesn't seem to stay running. I can only seem to get it working inside of spawn.

I've looked at https://github.com/xerions/exradius as well but again can only keep things running inside a spawn.

I'm sure there's just something dumb I am missing. But I have no idea what. I've done this:

  Instead of :application.ensure_all_started(:eradius)
  add :eradius to :applications

  Instead of spawn, simply add :eradius.modules_ready([__MODULE__]) to your Application
  start/2 callback.

and copied the config.

Any suggestions would be appreciated. I'm willing to help update the docs once I determine what's wrong.

Possibility checking of arguments on start

radius_callback should have optional callback, validate_arguments/1, which can validate own arguments.
eradius should have buildin step validation, to check all configured handlers with arguments at start of application. The handler should check the correctness of validation at every request.

Related to #18

eradius_server behaviour compilation error on Elixir 1.6.

== Compilation error in file lib/eradiusd/coa_proxy.ex ==
** (FunctionClauseError) no function clause matching in :eradius_server.behaviour_info/1

    The following arguments were given to :eradius_server.behaviour_info/1:

        # 1
        :optional_callbacks

    (eradius) /Users/surik/Documents/prog/eradiusd/deps/eradius/src/eradius_server.erl:80: :eradius_server.behaviour_info/1
    (elixir) lib/module.ex:1016: Module.behaviour_info/2
    (elixir) lib/module.ex:1331: anonymous fn/4 in Module.check_behaviours/2
    (elixir) lib/enum.ex:1899: Enum."-reduce/3-lists^foldl/2-0-"/3
    (elixir) lib/module.ex:1284: Module.check_behaviours_and_impls/4
    (stdlib) erl_eval.erl:670: :erl_eval.do_apply/6

There are two ways to fix it:

  1. Add eradius_server.behaviour_info(optional_callbacks)
  2. Rework behavior with -callback.

The second way is more modern.

update CHANGELOG

The changelog was not update for the last releases. Please make sure it is in line with the release tag.

Add OTP 23.X to Travis CI

eradius version

2.2.1

Description

In Travis CI of eradius is missed 23.X OTP release.

Current behavior

The OTP release 23.X is missed in Travis CI.

Expected behavior

The OTP release 23.X is added to Travis CI.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.