\n";
#
# MESH RF settings
#
print "";
if ( $phycount > 1 )
{
print " Mesh RF (2GHz) | ";
}
else
{
print " Mesh RF | ";
}
push @hidden, "";
# add enable/disable
#
print "\nEnable | ";
print " | \n";
print "IP Address | \n";
print " | \n";
print "Netmask | \n";
print " | \n";
# Reset wifi channel/bandwidth to default
if ( -f "/etc/config/unconfigured" || $parms{button_reset} ) {
my $defaultwifi = rf_default_channel();
$wifi_channel = $defaultwifi->{'channel'};
$wifi_chanbw = $defaultwifi->{'chanbw'};
}
if ( ${wifi_enable} )
{
print "SSID | \n";
print "";
print "-$wifi_chanbw-v3 | \n";
push @hidden, "";
print "Channel | \n";
print " | \n";
print "Channel Width | \n";
print " | \n";
push (@hidden, "");
print " Active Settings | \n";
print "Tx Power | \n";
print " | \n";
print "Distance to FARTHEST Neighbor
'0' is auto | \n";
$wifi_distance=int($wifi_distance); # in meters
$wifi_distance_disp_km=int($wifi_distance/1000);
$wifi_distance_disp_miles=sprintf("%.2f",$wifi_distance_disp_km*.621371192);
print " mi ";
print " km ";
print " m ";
print " ";
print "";
print " | \n";
print " | | \n";
}
else
{
push @hidden, "";
push @hidden, "";
push @hidden, "";
push @hidden, "";
push @hidden, "";
push @hidden, "";
push (@hidden, "");
}
print " | \n";
#
# LAN settings
#
print "
LAN |
LAN Mode |
| \n \n";
push @hidden, "";
if($dmz_mode)
{
print "IP Address | ";
#print " | \n";
print "$dmz_lan_ip | \n";
push @hidden, "";
print "Netmask | ";
#print " | \n";
print "$dmz_lan_mask | \n";
push @hidden, "";
print "DHCP Server | ";
print " | \n";
print "DHCP Start | ";
#print " | \n";
print "$dmz_dhcp_start | \n";
push @hidden, "";
print "DHCP End | ";
#print " | \n";
print "$dmz_dhcp_end | \n";
push @hidden, "";
push @hidden, "";
push @hidden, "";
push @hidden, "";
push @hidden, "";
}
else
{
print "IP Address | ";
print " | \n";
print "Netmask | ";
print " | \n";
if($wan_proto eq "disabled")
{
print "Gateway | ";
print " | \n";
}
else
{
push @hidden, "";
}
print "DHCP Server | ";
print " | \n";
print "DHCP Start | ";
print " | \n";
print "DHCP End | ";
print " | \n";
push @hidden, "";
push @hidden, "";
push @hidden, "";
push @hidden, "";
}
print "
| ";
$M39model = `/usr/local/bin/get_model | grep -e "M[39]"`;
if ( ($phycount > 1 and (! $wifi_enable or ! $wifi3_enable))
or ($phycount == 1 and ! $wifi_enable and ! $wifi3_enable )
and ! $M39model )
{
# LAN AP shows as an option
# Determine hardware options and set band and channels accordingly
if ($phycount == 1)
{
$rc3 = system("iw phy phy0 info | grep -q '5180 MHz' > /dev/null");
if ( $rc3 )
{
$wifi2_hwmode="11g";
if ( $wifi2_channel > 14 ) { $wifi2_channel = 1; }
@chan=@ctwo;
}
else
{
$wifi2_hwmode="11a";
if ( $wifi2_channel < 36 ) { $wifi2_channel = 36; }
@chan=@cfive;
}
}
else
{
# 2 band device
if ( $wifi_enable == 1 )
{
$wifi2_hwmode="11a";
if ( $wifi2_channel < 36 ) { $wifi2_channel = 36; }
@chan=@cfive;
}
else
{
if ( ! $wifi2_enable and $wifi3_enable and $wifi3_hwmode eq "11a" ) { $wifi2_hwmode = "11g"; }
if ( ! $wifi2_enable and $wifi3_enable and $wifi3_hwmode eq "11g" ) { $wifi2_hwmode = "11a"; }
if ( $wifi2_hwmode eq "11a" )
{
if ( $wifi2_channel < 36 ) { $wifi2_channel = 36; }
@chan=@cfive;
}
else
{
if ( $wifi2_channel > 14 ) { $wifi2_channel = 1; }
@chan=@ctwo;
}
}
}
print "LAN Access Point | ";
print "Enable | ";
print " | \n";
if ( $phycount > 1 ) {
print "AP band | \n";
print " | \n";
}
else
{
push @hidden, "";
}
print "SSID | \n";
print " | \n";
print "Channel | \n";
print " | \n";
print "Encryption | \n";
print " | \n";
print "Password | \n";
print "";
print " | \n";
}
else
{
push @hidden, "";
push @hidden, "";
push @hidden, "";
push @hidden, "";
push @hidden, "";
push @hidden, "";
}
if(0) # disable for now
{
print "
| \n";
print "Mesh Bridge | \n";
print " | \n";
}
print " | \n";
#
# WAN settings
#
print "
WAN |
Protocol | \n";
print " | \n \n";
if($wan_proto eq "static")
{
print "IP Address | \n";
print " | \n";
print "Netmask | \n";
print " | \n";
print "Gateway | \n";
print " | \n";
}
else
{
push @hidden, "";
push @hidden, "";
push @hidden, "";
}
print "DNS 1 | \n";
print " | \n";
print "DNS 2 | \n";
print " | \n";
print "
| \n";
print "Advanced WAN Access | ";
if ( $wan_proto ne "disabled" ) {
print "Allow others to use my WAN | \n";
print " | \n";
} else {
push @hidden, "";
}
print "Prevent LAN devices from accessing WAN | \n";
print " | \n";
# WAN wifi Client
if ( ($phycount > 1 and (! $wifi_enable or ! $wifi2_enable))
or ($phycount == 1 and ! $wifi_enable and ! $wifi2_enable )
and ! $M39model )
{
# Wifi Client shows as an option
# Determine hardware options and set band accordingly
if ($phycount == 1)
{
$rc3 = system("iw phy phy0 info | grep -q '5180 MHz' > /dev/null");
if ( $rc3 ) { $wifi3_hwmode="11g"; }
else { $wifi3_hwmode="11a"; }
}
else
{
# 2 band device
if ( $wifi_enable ) { $wifi3_hwmode="11a"; }
else
{
if ( $wifi2_hwmode eq "11g" and $wifi2_enable )
{
$wifi3_hwmode = "11a";
}
if ( $wifi2_hwmode eq "11a" and $wifi2_enable )
{
$wifi3_hwmode="11g";
}
}
}
print "
| \n";
print "WAN Wifi Client | ";
print "Enable | ";
print " | \n";
if ( ! $wifi_enable and ! $wifi2_enable and $phycount > 1)
{
print "WAN Wifi Client band | \n";
print " | \n";
}
else
{
push @hidden, "";
}
# for (my $i=0; $i<5; $i++)
# {
# @wan_ssids=`iw dev wlan0 scan passive | egrep "SSID:\\s\\S+" | cut -f 2 -d\\ | sort -u`;
# last if @wan_ssids;
# sleep 1;
# }
print "SSID | \n";
print "\n";
print " | \n";
print "Password | \n";
print "";
print " | \n";
}
else
{
push @hidden, "";
push @hidden, "";
push @hidden, "";
push @hidden, "";
}
# end WAN wifi Client
print " \n |
\n";
print "