22
33
44def ap_none (interface ):
5+ """
6+ Returns the configuration for ``aaa``
7+ when in ``access_point`` mode without authentication
8+ """
59 return {}
610
711
812def ap_psk (interface ):
13+ """
14+ Returns the configuration for ``aaa``
15+ when in ``access_point`` mode with psk authentication
16+ """
917 result = {
1018 'devname' : radio (interface ),
1119 'driver' : 'madwifi' ,
1220 'ssid' : ssid (interface ),
1321 'wpa' : {
1422 '1.pairwise' : 'CCMP' ,
15- 'key' : [
16- {
17- 'mgmt' : 'WPA-PSK' ,
18- }
19- ],
23+ 'key' : [{'mgmt' : 'WPA-PSK' }],
2024 'mode' : 2 ,
2125 'psk' : psk (interface ),
2226 }
@@ -25,14 +29,35 @@ def ap_psk(interface):
2529
2630
2731def ap_eap (interface ):
28- return {}
32+ """
33+ Return the configuration for ``aaa``
34+ when in ``access_point`` mode with eap authentication
35+ """
36+ return {
37+ 'devname' : radio (interface ),
38+ 'driver' : 'madwifi' ,
39+ 'ssid' : ssid (interface ),
40+ 'wpa' : {
41+ '1.pairwise' : 'CCMP' ,
42+ 'key' : [{'mgmt' : 'WPA-EAP' }],
43+ 'mode' : 2 ,
44+ },
45+ }
2946
3047
3148def sta_none (interface ):
49+ """
50+ Return the configuration for ``aaa``
51+ when in station mode without authentication
52+ """
3253 return {}
3354
3455
3556def sta_psk (interface ):
57+ """
58+ Return the configuration for ``aaa``
59+ when in station mode with psk authentication
60+ """
3661 return {
3762 'wpa' : {
3863 'psk' : psk (interface ),
@@ -41,6 +66,10 @@ def sta_psk(interface):
4166
4267
4368def sta_eap (interface ):
69+ """
70+ Return the configuration for ``aaa``
71+ when in station mode with eap authentication
72+ """
4473 return {}
4574
4675
@@ -61,6 +90,9 @@ def sta_eap(interface):
6190
6291
6392def profile_from_interface (interface ):
93+ """
94+ Returns the ``aaa`` configuration for interface
95+ """
6496 profile = _profile .copy ()
6597 profile .update (
6698 _profile_from_mode [mode (interface )][protocol (interface )](interface )
@@ -79,7 +111,7 @@ def profile_from_interface(interface):
79111 'status' : 'enabled' ,
80112 },
81113 'wpa2_enterprise' : {
82- 'status' : '' ,
114+ 'status' : 'enabled ' ,
83115 },
84116 },
85117 'station' : {
@@ -90,13 +122,16 @@ def profile_from_interface(interface):
90122 'status' : 'disabled' ,
91123 },
92124 'wpa2_enterprise' : {
93- 'status' : '' ,
125+ 'status' : 'disabled ' ,
94126 },
95127 }
96128}
97129
98130
99131def status_from_interface (interface ):
132+ """
133+ Returns ``aaa.status`` from interface
134+ """
100135 status = _status .copy ()
101136 status .update (
102137 _status_from_mode [mode (interface )][protocol (interface )]
@@ -106,12 +141,12 @@ def status_from_interface(interface):
106141
107142def bridge_devname (wireless_interface , bridge_interface ):
108143 """
109- when in ``access_point`` with ``wpa2_personal`` authentication set also the
144+ when in ``access_point`` with authentication set also the
110145 bridge interface name
111146
112147 TODO: check if in ``netmode=router`` this happens again
113148 """
114- if mode (wireless_interface ) == 'access_point' and protocol (wireless_interface ) == 'wpa2_personal ' :
149+ if mode (wireless_interface ) == 'access_point' and protocol (wireless_interface ) != 'none ' :
115150 return {
116151 'br' : {
117152 'devname' : bridge_interface ['name' ],
0 commit comments