forked from rjpcomputing/raspap-webgui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathphpincs.php
73 lines (66 loc) · 1.39 KB
/
phpincs.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<?
function GetDistString($input,$string,$offset,$separator) {
$string = substr($input,strpos($input,$string)+$offset,strpos(substr($input,strpos($input,$string)+$offset),$separator));
return $string;
}
function ParseConfig($arrConfig) {
$config = array();
foreach($arrConfig as $line) {
if($line[0] != "#") {
$arrLine = explode("=",$line);
$config[$arrLine[0]] = $arrLine[1];
}
}
return $config;
}
function ConvertToChannel($freq) {
$base = 2412;
$channel = 1;
for($x = 0; $x < 13; $x++) {
if($freq != $base) {
$base = $base + 5;
$channel++;
} else {
return $channel;
}
}
return "Invalid Channel";
}
function ConvertToSecurity($security) {
switch($security) {
case "[WPA2-PSK-CCMP][ESS]":
return "WPA2-PSK (AES)";
break;
case "[WPA2-PSK-TKIP][ESS]":
return "WPA2-PSK (TKIP)";
break;
case "[WPA-PSK-TKIP+CCMP][WPS][ESS]":
return "WPA-PSK (TKIP/AES) with WPS";
break;
case "[WPA-PSK-TKIP+CCMP][WPA2-PSK-TKIP+CCMP][ESS]":
return "WPA/WPA2-PSK (TKIP/AES)";
break;
case "[WPA-PSK-TKIP][ESS]":
return "WPA-PSK (TKIP)";
break;
case "[WEP][ESS]":
return "WEP";
break;
}
}
/*
1* 2412 Yes Yes YesD
2 2417 Yes Yes YesD
3 2422 Yes Yes YesD
4 2427 Yes Yes YesD
5* 2432 Yes Yes Yes
6 2437 Yes Yes Yes
7 2442 Yes Yes Yes
8 2447 Yes Yes Yes
9* 2452 Yes Yes Yes
10 2457 Yes Yes Yes
11 2462 Yes Yes Yes
12 2467 NoB Yes Yes
13* 2472 NoB Yes Yes
*/
?>