/** * * @param string $input * @param string $string * @param int $offset * @param string $separator * @return $string */ function GetDistString( $input,$string,$offset,$separator ) { $string = substr( $input,strpos( $input,$string )+$offset,strpos( substr( $input,strpos( $input,$string )+$offset ), $separator ) ); return $string; } /** * * @param array $arrConfig * @return $config */ function ParseConfig( $arrConfig ) { $config = array(); foreach( $arrConfig as $line ) { if( $line[0] != "#" ) { $arrLine = explode( "=",$line ); $config[$arrLine[0]] = $arrLine[1]; } } return $config; } /** * * @param string $freq * @return $channel */ 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"; } /** * * @param string $security * @return string */ 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; } } /** * * */ function DisplayDHCPConfig() { exec( 'cat '. RASPI_DNSMASQ_CONFIG, $return ); $conf = ParseConfig($return); $arrRange = explode( ",", $conf['dhcp-range'] ); $RangeStart = $arrRange[0]; $RangeEnd = $arrRange[1]; $RangeMask = $arrRange[2]; preg_match( '/([0-9]*)([a-z])/i', $arrRange[3], $arrRangeLeaseTime ); switch( $arrRangeLeaseTime[2] ) { case "h": $hselected = " selected"; break; case "m": $mselected = " selected"; break; case "d": $dselected = " selected"; break; } exec( 'pidof dnsmasq | wc -l',$dnsmasq ); if( $dnsmasq[0] == 0 ) { $status = '
' .$status. '
Expire time | MAC Address | IP Address | Host name | Client ID |
---|---|---|---|---|
' . $lease_item . ' | '; } echo '