jwlc 0.0.39 → 0.0.46
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/jwlc.rb +40 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0ac2678a8d9b31e63ef329a2608073c2bdf52447
|
4
|
+
data.tar.gz: 22757dcb5dc20464d49a5f367d3ddb848ff88b8c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f37e9d802c859ffefd92597d2ca23bf294695582b6d8b2f78c89318b038941799228bac0846efb72ace444e9a74074a6bdc11a69f95f3e8e3a2f28895e8edec2
|
7
|
+
data.tar.gz: 09a64f14122710099f57dd1cba3835868bf12a46c4db1f20a9f2d2aab0bb1bb1e0ec3c9a2efc158eb602d68f339b16776e7e648ffd6afa5f332e87b3a9bf2cd9
|
data/lib/jwlc.rb
CHANGED
@@ -5,6 +5,7 @@ class Auth
|
|
5
5
|
# to authenticate the user. You need to create a web portal to authencate the user (if required) prior to passing this RADIUS CoA message to the WLC.
|
6
6
|
#
|
7
7
|
# Example Login:
|
8
|
+
#
|
8
9
|
# >> Auth.login('10.0.0.100','web-portal-Guest','xx:xx:xx:xx:xx:xx','Guest',' ','testing123', 8)
|
9
10
|
# => Successfully authenticated user with MAC Address xx:xx:xx:xx:xx:xx
|
10
11
|
#
|
@@ -16,7 +17,23 @@ class Auth
|
|
16
17
|
# 5) Name of new ACL or ' ' (String)
|
17
18
|
# 6) Number of hours until logout (Integer)
|
18
19
|
#
|
20
|
+
# Example QOS Login:
|
21
|
+
# The difference here between a standard login and a QOS Login is the application of a predefined QOS profile. This profile needs to # already be defined on the WLC controller to be referenced successfully.
|
22
|
+
#
|
23
|
+
# >> Auth.login('10.0.0.100','web-portal-Guest','xx:xx:xx:xx:xx:xx','Guest',' ','testing123', 8, 'qos-2m')
|
24
|
+
# => Successfully authenticated user with MAC Address xx:xx:xx:xx:xx:xx
|
25
|
+
#
|
26
|
+
# Arguments:
|
27
|
+
# 1) Wireless LAN Controller address: (IP Address)
|
28
|
+
# 2) Authenticating users MAC Address (String)
|
29
|
+
# 3) Name of SSID being used (String)
|
30
|
+
# 4) Radius Shared secret (String)
|
31
|
+
# 5) Name of new ACL or ' ' (String)
|
32
|
+
# 6) Number of hours until logout (Integer)
|
33
|
+
# 7) QOS Profile (String)
|
34
|
+
#
|
19
35
|
# Example Logout:
|
36
|
+
#
|
20
37
|
# >> Auth.logout('10.0.0.100','Guest','xx:xx:xx:xx:xx:xx','testing123')
|
21
38
|
# => Logged out user xx:xx:xx:xx:xx:xx....bye bye
|
22
39
|
#
|
@@ -48,6 +65,7 @@ class Auth
|
|
48
65
|
# Freeradius doesn't need to be operational, just the dictionary files are used.
|
49
66
|
#
|
50
67
|
|
68
|
+
###############
|
51
69
|
def self.login(var1, var2, var3, var4, var5, var6)
|
52
70
|
dict = Radiustar::Dictionary.new('/usr/share/freeradius/')
|
53
71
|
|
@@ -68,7 +86,29 @@ loginpacket = {
|
|
68
86
|
|
69
87
|
end
|
70
88
|
|
89
|
+
################
|
90
|
+
def self.qoslogin(var1, var2, var3, var4, var5, var6, var7)
|
91
|
+
dict = Radiustar::Dictionary.new('/usr/share/freeradius/')
|
92
|
+
|
93
|
+
loginpacket = {
|
94
|
+
'NAS-IP-Address' => var1,
|
95
|
+
'NAS-Identifier' => 'Trapeze',
|
96
|
+
'Event-Timestamp' => Time.now.to_i,
|
97
|
+
'User-Name' => 'web-portal-' + var3,
|
98
|
+
'Calling-Station-Id' => var2,
|
99
|
+
'Trapeze/Trapeze-CoA-Username' => var3,
|
100
|
+
'Trapeze/Trapeze-QoS-Profile' => var7,
|
101
|
+
'Session-Timeout' => (var6 * 3600),
|
102
|
+
'Filter-Id' => var5
|
103
|
+
}
|
104
|
+
|
105
|
+
req = Radiustar::Request.new(var1 + ':3799', { :dict => dict })
|
106
|
+
coa = req.coa_request(var4, loginpacket)
|
107
|
+
puts "Successfully authenticated user with MAC Address #{var2}. #{var6} hours remaining..."
|
108
|
+
|
109
|
+
end
|
71
110
|
|
111
|
+
################
|
72
112
|
def self.logout(var1, var2, var3, var4)
|
73
113
|
dict = Radiustar::Dictionary.new('/usr/share/freeradius/')
|
74
114
|
|