\n";
# Show network interface field
&foreign_require("net", "net-lib.pl");
$eth = &find("ETH", $conf);
print " | ",&hlink($text{'index_eth'}, "eth")," | \n";
@ifcs = &net::active_interfaces(1);
print "\n";
printf " | \n",
$found ? "" : $eth;
# Show on-demand field
$demand = &find("DEMAND", $conf);
print "",&hlink($text{'index_demand'},"demand")," | \n";
printf " %s\n",
$demand !~ /^\d+$/i ? "" : "checked", $text{'index_timeout'};
printf "\n",
$demand !~ /^\d+$/i ? "" : $demand;
printf " %s | \n",
$demand !~ /^\d+$/i ? "checked" : "", $text{'no'};
# Show username field
$user = &find("USER", $conf);
print " | ",&hlink($text{'index_user'},"user")," | \n";
printf " | \n",
$user;
# Show password field (from pap-secrets)
($sec) = grep { $_->{'client'} eq $user } &list_secrets();
print "",&hlink($text{'index_sec'},"sec")," | \n";
printf " | \n",
$sec->{'secret'};
# Show DNS config buttons
$dns = &find("USEPEERDNS", $conf) || &find("PEERDNS", $conf);
print " | ",&hlink($text{'index_dns'}, "dns")," | \n";
printf " %s\n",
$dns =~ /yes/i ? "checked" : "", $text{'yes'};
printf " %s | \n",
$dns =~ /yes/i ? "" : "checked", $text{'no'};
# Show connect timeout field
$connect = &find("CONNECT_TIMEOUT", $conf);
print "",&hlink($text{'index_connect'},"connect")," | \n";
printf " %s\n",
$connect == 0 ? "checked" : "", $text{'index_forever'};
printf "\n",
$connect == 0 ? "" : "checked";
printf " %s | \n",
$connect == 0 ? "" : $connect, $text{'index_secs'};
# Show MSS field
$mss = &find("CLAMPMSS", $conf);
print " | ",&hlink($text{'index_mss'},"mss")," | \n";
printf " %s\n",
$mss =~ /no/i ? "" : "checked", $text{'index_psize'};
printf " %s\n",
$mss =~ /no/i ? "" : $mss, $text{'index_bytes'};
printf " %s | \n",
$mss =~ /no/i ? "checked" : "", $text{'no'};
# Show firewall menu
$fw = &find("FIREWALL", $conf);
$fw ||= "NONE";
if ($fw ne "NONE") {
print "",&hlink($text{'index_fw'},"fw")," | \n";
print " | \n";
}
else {
print "\n";
}
print " |