File tree Expand file tree Collapse file tree
netjsonconfig/backends/airos Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44from ...utils import get_copy
55from ..base .converter import BaseConverter
66from .interface import bridge , wireless
7+ from .radius import radius_from_interface
78from .schema import default_ntp_servers
89from .wpasupplicant import available_mode_authentication
910
@@ -46,6 +47,10 @@ def wireless(self):
4647 """
4748 return wireless (get_copy (self .netjson , 'interfaces' , []))
4849
50+ @property
51+ def radius (self ):
52+ original = get_copy (self .netjson , 'radius' , {})
53+ return original
4954
5055 def to_intermediate (self ):
5156 result = []
Original file line number Diff line number Diff line change 1+ from .interface import mode , protocol
2+
3+ _radius = {
4+ 'radius' : {
5+ 'acct' : [
6+ {
7+ 'port' : 1813 ,
8+ 'status' : 'disabled' ,
9+ }
10+ ],
11+ 'auth' : [
12+ {
13+ 'port' : 1812 ,
14+ },
15+ ],
16+ },
17+ 'status' : 'disabled' ,
18+ }
19+
20+ _radius_from_mode = {
21+ 'access_point' : {
22+ 'none' : {},
23+ 'wpa2_personal' : {
24+ 'radius' : {
25+ 'auth' : [{
26+ 'port' : 1812 ,
27+ 'status' : 'disabled' ,
28+ }],
29+ 'acct' : [
30+ {
31+ 'port' : 1813 ,
32+ 'status' : 'disabled' ,
33+ }
34+ ],
35+ 'macacl' : {
36+ 'status' : 'disabled' ,
37+ },
38+ },
39+ 'status' : 'enabled' ,
40+ },
41+ },
42+ 'station' : {
43+ 'none' : {},
44+ 'wpa2_personal' : {},
45+ }
46+ }
47+
48+ def radius_from_interface (interface ):
49+ radius = _radius .copy ()
50+ radius .update (
51+ _radius_from_mode [mode (interface )][protocol (interface )]
52+ )
53+ return radius
54+
55+ __all__ = [
56+ radius_from_interface ,
57+ ]
You can’t perform that action at this time.
0 commit comments