summaryrefslogtreecommitdiff
path: root/polux/application/boa/spc200
diff options
context:
space:
mode:
Diffstat (limited to 'polux/application/boa/spc200')
-rw-r--r--polux/application/boa/spc200/README20
-rwxr-xr-xpolux/application/boa/spc200/boa.conf204
-rwxr-xr-xpolux/application/boa/spc200/cgi-bin/calcul.php61
-rwxr-xr-xpolux/application/boa/spc200/cgi-bin/changeIP.html316
-rwxr-xr-xpolux/application/boa/spc200/cgi-bin/del_image.html87
-rwxr-xr-xpolux/application/boa/spc200/cgi-bin/gore.php145
-rwxr-xr-xpolux/application/boa/spc200/cgi-bin/message.html69
-rwxr-xr-xpolux/application/boa/spc200/cgi-bin/mon.html21
-rwxr-xr-xpolux/application/boa/spc200/cgi-bin/noise.php60
-rwxr-xr-xpolux/application/boa/spc200/cgi-bin/reboot.html69
-rwxr-xr-xpolux/application/boa/spc200/cgi-bin/sipconfig.html11
-rwxr-xr-xpolux/application/boa/spc200/cgi-bin/soft-upload.html88
-rwxr-xr-xpolux/application/boa/spc200/cgi-bin/soft.html308
-rwxr-xr-xpolux/application/boa/spc200/cgi-bin/spidcom.html1386
-rwxr-xr-xpolux/application/boa/spc200/www/disclaimer.html8
-rwxr-xr-xpolux/application/boa/spc200/www/index.html10
-rwxr-xr-xpolux/application/boa/spc200/www/logo-spidcom.jpgbin0 -> 2271 bytes
-rwxr-xr-xpolux/application/boa/spc200/www/spidcom.gifbin0 -> 20557 bytes
18 files changed, 2863 insertions, 0 deletions
diff --git a/polux/application/boa/spc200/README b/polux/application/boa/spc200/README
new file mode 100644
index 0000000000..8755347005
--- /dev/null
+++ b/polux/application/boa/spc200/README
@@ -0,0 +1,20 @@
+The following configuration has been tested on SPC200:
+
+On the SPC200, boa was installed as follows:
+
+binaries are
+/bin/boa
+/usr/lib/boa/boa_indexer
+
+HTML and CGI scripts are in
+/usr/share/www
+/usr/share/cgi-bin
+
+configuration file is
+/etc/boa.conf
+
+Boa server has been tested successfully for html pages, images and CGI scripts.
+It has been modified to use vfork, and avoid closing some descriptors in the child process. CGI scripts have been tested for both C and shell scripts.
+The busybox had to be fixed in order to pass correctly the environment variables to the shell CGI scripts.
+
+All the files used for this configuration can be found in spc200.
diff --git a/polux/application/boa/spc200/boa.conf b/polux/application/boa/spc200/boa.conf
new file mode 100755
index 0000000000..53da20887b
--- /dev/null
+++ b/polux/application/boa/spc200/boa.conf
@@ -0,0 +1,204 @@
+# Boa v0.94 configuration file
+# File format has not changed from 0.93
+# File format has changed little from 0.92
+# version changes are noted in the comments
+#
+# The Boa configuration file is parsed with a lex/yacc or flex/bison
+# generated parser. If it reports an error, the line number will be
+# provided; it should be easy to spot. The syntax of each of these
+# rules is very simple, and they can occur in any order. Where possible
+# these directives mimic those of NCSA httpd 1.3; I saw no reason to
+# introduce gratuitous differences.
+
+# $Id: boa.conf,v 1.3 2006/10/23 15:09:17 sumrak Exp $
+
+# The "ServerRoot" is not in this configuration file. It can be compiled
+# into the server (see defines.h) or specified on the command line with
+# the -c option, for example:
+#
+# boa -c /usr/local/boa
+
+
+# Port: The port Boa runs on. The default port for http servers is 80.
+# If it is less than 1024, the server must be started as root.
+
+Port 80
+
+# Listen: the Internet address to bind(2) to. If you leave it out,
+# it takes the behavior before 0.93.17.2, which is to bind to all
+# addresses (INADDR_ANY). You only get one "Listen" directive,
+# if you want service on multiple IP addresses, you have three choices:
+# 1. Run boa without a "Listen" directive
+# a. All addresses are treated the same; makes sense if the addresses
+# are localhost, ppp, and eth0.
+# b. Use the VirtualHost directive below to point requests to different
+# files. Should be good for a very large number of addresses (web
+# hosting clients).
+# 2. Run one copy of boa per IP address, each has its own configuration
+# with a "Listen" directive. No big deal up to a few tens of addresses.
+# Nice separation between clients.
+# The name you provide gets run through inet_aton(3), so you have to use dotted
+# quad notation. This configuration is too important to trust some DNS.
+
+#Listen 192.68.0.5
+
+# User: The name or UID the server should run as.
+# Group: The group name or GID the server should run as.
+
+User root
+Group root
+
+# ServerAdmin: The email address where server problems should be sent.
+# Note: this is not currently used, except as an environment variable
+# for CGIs.
+
+#ServerAdmin root@localhost
+
+# ErrorLog: The location of the error log file. If this does not start
+# with /, it is considered relative to the server root.
+# Set to /dev/null if you don't want errors logged.
+# If unset, defaults to /dev/stderr
+
+ErrorLog /dev/null
+CgiLog /dev/null
+
+# Please NOTE: Sending the logs to a pipe ('|'), as shown below,
+# is somewhat experimental and might fail under heavy load.
+# "Usual libc implementations of printf will stall the whole
+# process if the receiving end of a pipe stops reading."
+#ErrorLog "|/usr/sbin/cronolog --symlink=/var/log/boa/error_log /var/log/boa/error-%Y%m%d.log"
+
+# AccessLog: The location of the access log file. If this does not
+# start with /, it is considered relative to the server root.
+# Comment out or set to /dev/null (less effective) to disable
+# Access logging.
+
+#AccessLog /var/log/boa/access_log
+AccessLog /dev/null
+
+# Please NOTE: Sending the logs to a pipe ('|'), as shown below,
+# is somewhat experimental and might fail under heavy load.
+# "Usual libc implementations of printf will stall the whole
+# process if the receiving end of a pipe stops reading."
+#AccessLog "|/usr/sbin/cronolog --symlink=/var/log/boa/access_log /var/log/boa/access-%Y%m%d.log"
+
+# UseLocaltime: Logical switch. Uncomment to use localtime
+# instead of UTC time
+#UseLocaltime
+
+# VerboseCGILogs: this is just a logical switch.
+# It simply notes the start and stop times of cgis in the error log
+# Comment out to disable.
+
+VerboseCGILogs
+
+# ServerName: the name of this server that should be sent back to
+# clients if different than that returned by gethostname + gethostbyname
+
+#ServerName www.your.org.here
+
+# VirtualHost: a logical switch.
+# Comment out to disable.
+# Given DocumentRoot /var/www, requests on interface 'A' or IP 'IP-A'
+# become /var/www/IP-A.
+# Example: http://localhost/ becomes /var/www/127.0.0.1
+#
+# Not used until version 0.93.17.2. This "feature" also breaks commonlog
+# output rules, it prepends the interface number to each access_log line.
+# You are expected to fix that problem with a postprocessing script.
+
+#VirtualHost
+
+# documentRoot: The root directory of the HTML documents.
+# Comment out to disable server non user files.
+
+DocumentRoot /usr/share/www
+
+# UserDir: The name of the directory which is appended onto a user's home
+# directory if a ~user request is recieved.
+
+UserDir public_html
+
+# DirectoryIndex: Name of the file to use as a pre-written HTML
+# directory index. Please MAKE AND USE THESE FILES. On the
+# fly creation of directory indexes can be _slow_.
+# Comment out to always use DirectoryMaker
+
+DirectoryIndex index.html
+
+# DirectoryMaker: Name of program used to create a directory listing.
+# Comment out to disable directory listings. If both this and
+# DirectoryIndex are commented out, accessing a directory will give
+# an error (though accessing files in the directory are still ok).
+
+DirectoryMaker /usr/lib/boa/boa_indexer
+
+# DirectoryCache: If DirectoryIndex doesn't exist, and DirectoryMaker
+# has been commented out, the the on-the-fly indexing of Boa can be used
+# to generate indexes of directories. Be warned that the output is
+# extremely minimal and can cause delays when slow disks are used.
+# Note: The DirectoryCache must be writable by the same user/group that
+# Boa runs as.
+
+# DirectoryCache /var/spool/boa/dircache
+
+# KeepAliveMax: Number of KeepAlive requests to allow per connection
+# Comment out, or set to 0 to disable keepalive processing
+
+KeepAliveMax 1000
+
+# KeepAliveTimeout: seconds to wait before keepalive connection times out
+
+KeepAliveTimeout 10
+
+# To limit the number of simultaneous connections
+MaxConnections 5
+
+# MimeTypes: This is the file that is used to generate mime type pairs
+# and Content-Type fields for boa.
+# Set to /dev/null if you do not want to load a mime types file.
+# Do *not* comment out (better use AddType!)
+
+#MimeTypes /etc/mime.types
+MimeTypes /dev/null
+
+# DefaultType: MIME type used if the file extension is unknown, or there
+# is no file extension.
+
+DefaultType text/html
+
+# CGIPath: The value of the $PATH environment variable given to CGI progs.
+
+CGIPath /bin:/usr/bin:/usr/local/bin:/usr/share/cgi-bin
+
+# SinglePostLimit: The maximum allowable number of bytes in
+# a single POST. Default is normally 1MB.
+
+# AddType: adds types without editing mime.types
+# Example: AddType type extension [extension ...]
+
+# Uncomment the next line if you want .cgi files to execute from anywhere
+#AddType application/x-httpd-cgi cgi
+
+# Redirect, Alias, and ScriptAlias all have the same semantics -- they
+# match the beginning of a request and take appropriate action. Use
+# Redirect for other servers, Alias for the same server, and ScriptAlias
+# to enable directories for script execution.
+
+# Redirect allows you to tell clients about documents which used to exist in
+# your server's namespace, but do not anymore. This allows you to tell the
+# clients where to look for the relocated document.
+# Example: Redirect /bar http://elsewhere/feh/bar
+
+# Aliases: Aliases one path to another.
+# Example: Alias /path1/bar /path2/foo
+
+Alias /doc /usr/doc
+
+# ScriptAlias: Maps a virtual path to a directory for serving scripts
+# Example: ScriptAlias /htbin/ /www/htbin/
+
+#ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
+ScriptAlias /cgi-bin/ /usr/share/cgi-bin/
+
+ServerName localhost
diff --git a/polux/application/boa/spc200/cgi-bin/calcul.php b/polux/application/boa/spc200/cgi-bin/calcul.php
new file mode 100755
index 0000000000..c414019d22
--- /dev/null
+++ b/polux/application/boa/spc200/cgi-bin/calcul.php
@@ -0,0 +1,61 @@
+#! /bin/uphp
+<?php
+ $ethac=popen("/sbin/ifconfig $choice","r");
+ while(!feof($ethac)) {
+ l = trim(fread($ethac));
+
+ if(ereg("RX[ ]*packets[:]([0-9]*)[ ]*errors[:]([0-9]*)[ ]*dropped[:]([0-9]*)[ ]*overruns[:]([0-9]*)[ ]*frame[:]([0-9]*)",l,$regs)){
+ RxEpac=regs[1];
+ RxEerr=$regs[2];
+ RxEdro=$regs[3];
+ RxEover=$regs[4];
+ RxEframe=$regs[5];
+ }
+
+ if(ereg("TX[ ]*packets[:]([0-9]*)[ ]*errors[:]([0-9]*)[ ]*dropped[:]([0-9]*)[ ]*overruns[:]([0-9]*)[ ]*carrier[:]([0-9]*)",l,$regs)){
+ TxEpac=regs[1];
+ TxEerr=$regs[2];
+ TxEdro=$regs[3];
+ TxEover=$regs[4];
+ TxEcar=$regs[5];
+ }
+
+ if(ereg("collisions[:]([0-9]*)[ ]txqueuelen[:]([0-9]*)",l,$regs)){
+ TxEcoll=regs[1];
+ TxEqlen=regs[2];
+ }
+
+ if(ereg("RX[ ]*bytes[:]([0-9]*)",l,$regs)){
+ RxEbytes=regs[1];
+ }
+ if(ereg("TX[ ]*bytes[:]([0-9]*)",l,$regs)){
+ TxEbytes=regs[1];
+ }
+ }
+ pclose($ethac);
+?>
+<html>
+<head>
+<script>
+function rifresh() { window.location.reload(); }
+
+parent.document.cIP.RxEpac.value="<?=$RxEpac?>";
+parent.document.cIP.TxEpac.value="<?=$TxEpac?>";
+parent.document.cIP.RxEerr.value="<?=$RxEerr?>";
+parent.document.cIP.TxEerr.value="<?=$TxEerr?>";
+parent.document.cIP.RxEdro.value="<?=$RxEdro?>";
+parent.document.cIP.TxEdro.value="<?=$TxEdro?>";
+parent.document.cIP.RxEover.value="<?=$RxEover?>";
+parent.document.cIP.TxEover.value="<?=$TxEover?>";
+parent.document.cIP.RxEframe.value="<?=$RxEframe?>";
+parent.document.cIP.TxEcar.value="<?=$TxEcar?>";
+parent.document.cIP.TxEcoll.value="<?=$TxEcoll?>";
+parent.document.cIP.TxEqlen.value="<?=$TxEqlen?>";
+parent.document.cIP.RxEbytes.value="<?=$RxEbytes?>";
+parent.document.cIP.TxEbytes.value="<?=$TxEbytes?>";
+self.setTimeout('rifresh()', 5000);
+</script>
+</head>
+<body>
+</body>
+</html>
diff --git a/polux/application/boa/spc200/cgi-bin/changeIP.html b/polux/application/boa/spc200/cgi-bin/changeIP.html
new file mode 100755
index 0000000000..10a4d5699e
--- /dev/null
+++ b/polux/application/boa/spc200/cgi-bin/changeIP.html
@@ -0,0 +1,316 @@
+#!/bin/uphp
+<?php
+function add_gateway($c_counter,$gat_string){
+ $i=0;
+ do {
+ if ($i==$c_counter){
+ $help=linije[$c_counter+1];
+ linije[$c_counter+1]=$gat_string;
+ for ($k=$c;$k>$c_counter+1;$k--){
+ linije[$k+1]=linije[$k];
+ }
+ $linije[$c_counter+2]=$help;
+ }
+ $i++;
+ } while ($i<$c);
+ $c=$c+1;
+}
+
+function take_IPb($a){
+ $filet=popen('/sbin/ifconfig br0|grep "inet ad"',"r");
+ $l=fgets($filet);
+ pclose($filet);
+ if(ereg("([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})",$l,$reg)) {
+ $IPb1=$reg[1];
+ $IPb2=$reg[2];
+ $IPb3=$reg[3];
+ $IPb4=$reg[4];
+ $IPb="$IPb1".".$IPb2".".$IPb3".".$IPb4";
+ }
+}
+
+
+//Checking whether DHCP is ON
+$dhcp=0;
+filet=popen("ps","r");
+while(!feof(filet)) {
+l=fgets(filet);
+if(ereg("dhcpc",l,reg)) $dhcp=1;
+}
+pclose(filet);
+
+// Setting up the variables
+c=0;
+$ge_flag=0;
+$gp_flag=0;
+$gb_flag=0;
+$gb_space=0;
+
+//If gateway fields are empty set appropriate flags to 2
+if (empty($gtewaye1) || empty($gtewaye2) || empty($gtewaye3) || empty($gtewaye4)) $ge_flag=2;
+if (empty($gtewayp1) || empty($gtewayp2) || empty($gtewayp3) || empty($gtewayp4)) $gp_flag=2;
+if (empty($gtewayb1) || empty($gtewayb2) || empty($gtewayb3) || empty($gtewayb4)) $gb_flag=2;
+
+// counters used to specify the line on which resides netmask
+// On counters+1 gateway field is placed
+$ce_counter=100;$cp_counter=100;$cb_counter=100;
+
+
+//search the structure of 'interface' file
+filet=fopen("/usr/local/etc/network/interfaces","r");
+for(c=0;!feof(filet);c++) {
+ linije[c]=fread(filet);
+ caka=trim(linije[c]);
+ checksx=substr(caka,0,10);
+ if (checksx=="iface "."$choice") {
+ do {
+ c++;
+ linije[c]=fread(filet);
+ caka=trim(linije[c]);
+ check=substr(caka,0,7);
+ if (check=="address") {
+ if ($choice=="eth0")
+ linije[c]=" address $IPe1".".$IPe2".".$IPe3".".$IPe4"."\n";
+ if ($choice=="plc0")
+ linije[c]=" address $IPp1".".$IPp2".".$IPp3".".$IPp4"."\n";
+ if ($choice=="br0 "){
+ linije[c]=" address $IPb1".".$IPb2".".$IPb3".".$IPb4"."\n";
+ $IPb="$IPb1".".$IPb2".".$IPb3".".$IPb4";
+ }
+ }
+ if (check=="netmask") {
+ if ($choice=="eth0") {
+ linije[c]=" netmask $NETe1".".$NETe2".".$NETe3".".$NETe4"."\n";
+ $ce_counter=c;
+ }
+ if ($choice=="plc0") {
+ linije[c]=" netmask $NETp1".".$NETp2".".$NETp3".".$NETp4"."\n";
+ $cp_counter=c;
+ }
+ if ($choice=="br0 ") {
+ linije[c]=" netmask $NETb1".".$NETb2".".$NETb3".".$NETb4"."\n";
+ $cb_counter=c;
+ }
+ $NET="$NETb1".".$NETb2".".$NETb3".".$NETb4";
+ }
+ if (check=="gateway") {
+ if ($choice=="eth0") {
+ if ($ge_flag!=2) {
+ linije[c]=" gateway $gtewaye1".".$gtewaye2".".$gtewaye3".".$gtewaye4"."\n";
+ $ge_flag=1;
+ } else c--;
+ }
+
+ if ($choice=="plc0") {
+ if ($gp_flag!=2) {
+ linije[c]=" gateway $gtewayp1".".$gtewayp2".".$gtewayp3".".$gtewayp4"."\n";
+ $gp_flag=1;
+ } else c--;
+ }
+ if ($choice=="br0 ") {
+ if ($gb_flag!=2){
+ linije[c]=" gateway $gtewayb1".".$gtewayb2".".$gtewayb3".".$gtewayb4"."\n";
+ $gb_flag=1;
+ } else c--;
+ }
+ }
+ } while (!empty(caka));
+ }
+}
+
+if ($gb_flag==0) {
+ $gt_string=" gateway $gtewayb1".".$gtewayb2".".$gtewayb3".".$gtewayb4"."\n";
+ add_gateway($cb_counter, $gt_string);
+}
+
+if ($gp_flag==0) {
+ $gt_string=" gateway $gtewayp1".".$gtewayp2".".$gtewayp3".".$gtewayp4"."\n";
+ add_gateway($cp_counter, $gt_string);
+}
+
+if ($ge_flag==0) {
+ $gt_string=" gateway $gtewaye1".".$gtewaye2".".$gtewaye3".".$gtewaye4"."\n";
+ add_gateway($ce_counter, $gt_string);
+}
+
+fclose(filet);
+
+// Write data to network 'interface' file
+if($dhcp==0){
+$filet=fopen("/usr/local/etc/network/interfaces","w");
+for(i=0;i<$c;i++) {
+ fwrite($filet,linije[i]);
+}
+ fclose($filet);
+};
+
+
+$GT="$gtewayb1".".$gtewayb2".".$gtewayb3".".$gtewayb4";
+// IF dhcp is OFF but is requested to be ON
+if ($dhcp_r=="ON") {
+ if ($dhcp==0){
+ // Getting values for the bridge IP address //
+ $filet=popen("/bin/udhcpc &","r");
+ while(!feof($filet)) {
+ $l=fgets($filet);
+ if(ereg("obtained IP = ([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})",$l,$reg)) {
+ $IPb=$reg[0];
+ $IPb1=$reg[1];
+ $IPb2=$reg[2];
+ $IPb3=$reg[3];
+ $IPb4=$reg[4];
+ $IPb="$IPb1".".$IPb2".".$IPb3".".$IPb4";
+ header("Location: http://$IPb/index.html");
+ die("");
+ }
+ }
+ pclose($filet);
+ }
+}
+
+// If DHCP is ON but requested to be OFF
+if ($dhcp_r=="OFF") {
+ if ($dhcp==1) {
+ system("kill $pdhcp");
+ // take_IPb($dhcp);
+ $IPb=$IPxb;
+ $NET=$Nb;
+ $dhcp=0;
+ $GT=$GTb;
+ }
+}
+
+// IF dhcp is ON
+if ($dhcp_r=="ON") {
+ if ($dhcp==1){
+ // Getting values for the bridge IP address //
+ take_IPb($dhcp);
+ header("Location: http://$IPb/index.html");
+ die("");
+ }
+}
+
+// if bridging was altered
+if (($BRIDGING_r == "OFF" && $BRIDGING == "yes") || ($BRIDGING_r == "ON" && $BRIDGING == "no")) {
+ $filet = fopen("/usr/local/etc/config/network", "r");
+ for ($i = 0; !feof($filet); $i++) {
+ $lines[i] = fgets($filet);
+ $l = trim($lines[i]);
+ if (ereg("BRIDGING", l, $regs)) {
+ if ($BRIDGING_r == "OFF")
+ $lines[i] = "BRIDGING=no\n";
+ else
+ $lines[i] = "BRIDGING=yes\n";
+ }
+ }
+ fclose($filet);
+
+ $filet = fopen("/usr/local/etc/config/network", "w");
+ for ($j = 0; $j < $i; $j++)
+ fwrite($filet, $lines[j]);
+ fclose($filet);
+
+ header("Location: http://$IPb/cgi-bin/message.html?IPb=$IPb");
+ die("");
+}
+
+// Monitoring and control traffic on plc device //
+if ($tc_cont=="ACTIVE"){
+//system("echo $tc_rate $tc_rate_unit >>/usr/share/cgi-bin/temp");
+ system("tc qdisc del dev plc0 root");
+ $string="tc qdisc add dev plc0 root tbf rate $tc_rate".$tc_rate_unit." limit 1m burst 1mbit";
+system("echo $string >>/usr/share/cgi-bin/temp");
+ system("$string");
+ }
+ else if ($tc_cont=="INACTIVE") {
+ system("tc qdisc del dev plc0 root");
+ };
+
+// Monitoring and control traffic on eth0 device //
+if ($etc_cont=="ACTIVE"){
+ system("tc qdisc del dev eth0 root");
+//system("echo $etc_rate $etc_rate_unit >>/usr/share/cgi-bin/temp");
+ $string="tc qdisc add dev eth0 root tbf rate $etc_rate".$etc_rate_unit." limit 1m burst 1mbit";
+system("echo $string >>/usr/share/cgi-bin/temp");
+ system("$string");
+ }
+ else if ($etc_cont=="INACTIVE") {
+ system("tc qdisc del dev eth0 root");
+ };
+
+?>
+<script language="JavaScript1.2">
+function getgoing()
+{
+ var xIP="http://<?php print($IPb); ?>/index.html";
+ top.location=xIP;
+}
+//if (top.frames.length==0)
+//{
+ setTimeout('getgoing()',1000);
+//}
+</script>
+<?php
+
+ //Part of the code dealing with modes of PLC device - MASTER, SLAVE, AD_HOC
+system("echo $modex > /proc/sys/net/plc/mode");
+if ($modex=="MASTER"){
+ system('echo "master" > /proc/sys/net/plc/mode');
+ system('echo "0" > /proc/sys/net/plc/bssid');
+ system('echo " " > /proc/sys/net/plc/preferred_bssid');
+ $modef=fopen("/etc/sysctl.conf","r");
+ i=0;
+ while(!feof($modef)) {
+ l = trim(fread($modef));
+ if(ereg("net.plc.mode[ ]*=[ ]*slave",l,$regs)){
+ linije[i]="net.plc.mode = master\n";
+ } else
+ if(ereg("net.plc.preferred_bssid[]*=[ ]*0",l,$regs)){
+ linije[i]="net.plc.bssid = 0\n";
+ } else linije[i]=l."\n";
+ i++;
+ }
+ filet=fopen("/etc/sysctl.conf","w");
+ for(j=0;j<i-1;j++) {
+ fwrite(filet,linije[j]);
+ }
+ fclose(filet);
+}
+
+if ($modex=="SLAVE"){
+ system('echo "slave" > /proc/sys/net/plc/mode');
+ system('echo "0" > /proc/sys/net/plc/preferred_bssid');
+ system('echo " " > /proc/sys/net/plc/bssid');
+ $modef=fopen("/etc/sysctl.conf","r");
+ i=0;
+ while(!feof($modef)) {
+ l = trim(fread($modef));
+ if(ereg("net.plc.mode[ ]*=[ ]*master",l,$regs)){
+ linije[i]="net.plc.mode = slave\n";
+ } else
+ if(ereg("net.plc.bssid[]*=[ ]*0",l,$regs)){
+ linije[i]="net.plc.preferred_bssid = 0\n";
+ } else linije[i]=l."\n";
+ i++;
+ }
+ filet=fopen("/etc/sysctl.conf","w");
+ for(j=0;j<i-1;j++) {
+ fwrite(filet,linije[j]);
+ }
+ fclose(filet);
+ }
+
+if ($modex=="AD-HOC"){
+ system('echo "ad-hoc" > /proc/sys/net/plc/mode');
+}
+if (($choice=="br0 ") && ($dhcp==0)) {
+system('echo "#! /bin/sh" > /usr/share/cgi-bin/execute');
+system('echo "/sbin/ifconfig br0 $IPb netmask $NET &" >> /usr/share/cgi-bin/execute');
+system('echo "/sbin/route add default gw $GT &" >> /usr/share/cgi-bin/execute');
+system("chmod 777 /usr/share/cgi-bin/execute");
+system("/usr/share/cgi-bin/execute &");
+ }
+
+/* Make sure that code below does not get executed when we redirect. */
+?>
+
diff --git a/polux/application/boa/spc200/cgi-bin/del_image.html b/polux/application/boa/spc200/cgi-bin/del_image.html
new file mode 100755
index 0000000000..e09aa5703f
--- /dev/null
+++ b/polux/application/boa/spc200/cgi-bin/del_image.html
@@ -0,0 +1,87 @@
+#!/bin/uphp
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
+ <html>
+ <head>
+ <title>SPIDCOM Technologies changes</title>
+<style type="text/css">
+input.text{
+ font-family:TrebuchetMS;
+ font-size:14pt;
+ font-weight:bold;
+ background-color:FFFFFF;
+ border-color:FFFFFF;
+ border-style:outset;
+ border-width:0px;
+ color:0000FF;
+}
+<?php
+$count=5;
+if ($deletex=="delete"){
+//system('echo "wait 1 &" >> /usr/share/cgi-bin/execute');
+ $filet=popen("/usr/bin/bt erase $del_select","r");
+}
+?>
+
+
+</style>
+<script>
+var start=new Date();
+ start=Date.parse(start)/1000;
+ var counts="<?= $count ?>";
+function CountDown(){
+ var now=new Date();
+ now=Date.parse(now)/1000;
+ var x=parseInt(counts-(now-start),10);
+ if(document.form1){document.form1.clock.value = x;}
+ if(x>0){
+ timerID=setTimeout("CountDown()", 100)
+ }else{
+ form1.submit();
+ //location.href="http://<?php print($IPb); ?>";
+ }
+ }
+function getgoing()
+{
+ var xIP="http://<?php print($IPb); ?>";
+ top.location=xIP;
+}
+
+</script>
+<script>
+
+window.setTimeout('CountDown()',100);
+-->
+</script>
+
+</HEAD>
+
+<!-- STEP TWO: Copy this code into the BODY of your HTML document -->
+
+<BODY>
+
+
+
+<FORM ACTION="soft.html" NAME="form1">
+<table>
+<tr>
+<INPUT.TEXT>
+<td><font size=4 COLOR="#0000FF">
+The image erasing process, please wait <INPUT class="text" TYPE="text" NAME="clock" SIZE="1" VALUE="1" READONLY>seconds.</font></td>
+</INPUT.TEXT>
+</tr>
+<?php if ($error==1){?>
+<tr>
+<INPUT.TEXT>
+<td><font size=4 COLOR="#0000FF"><BLINK>
+ERROR!! <INPUT class="text" TYPE="text" NAME="err" SIZE="80" VALUE="<?=$string?>" READONLY></BLINK></font></td>
+</INPUT.TEXT>
+</tr>
+<?php }?>
+</table>
+</FORM>
+</html>
+
+
+
+
+
diff --git a/polux/application/boa/spc200/cgi-bin/gore.php b/polux/application/boa/spc200/cgi-bin/gore.php
new file mode 100755
index 0000000000..621679aa00
--- /dev/null
+++ b/polux/application/boa/spc200/cgi-bin/gore.php
@@ -0,0 +1,145 @@
+#! /bin/uphp
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
+
+ <html>
+ <head>
+ <title>SPIDCOM Technologies changes</title>
+ <style type="text/css" media="all">
+
+ td.subtitle {
+ border: 0px solid #999;
+ height: 2em;
+ width:10em;
+ padding: 1px;
+ align: center;
+ font-family:Times, Arial, Helvetica, sans-serif;
+ font-size: 120%;
+ color: #0000FF;
+ }
+
+ #header ul {
+ list-style: none;
+ padding: 0;
+ margin: 0;
+ }
+
+ #header li {
+ float: left;
+ border: 1px solid #bbb;
+ border-bottom-width: 0;
+ margin: 0;
+ }
+
+ #header a {
+ text-decoration: none;
+ display: block;
+ background: #eee;
+ padding: 0.24em 1em;
+ color: #00c;
+ width: 8em;
+ text-align: center;
+ }
+
+ #header a:hover {
+ background: #ddf;
+ }
+
+ #header #selected {
+ border-color: black;
+ }
+
+ #header #selected a {
+ position: relative;
+ top: 1px;
+ background: white;
+ color: black;
+ font-weight: bold;
+ }
+
+ #content {
+ border: 1px solid black;
+ clear: both;
+ padding: 0 1em;
+ }
+
+ </style>
+
+<script>
+ function change(a) {
+ var li_elements = document.getElementsByTagName("li");
+ plc=(a=='plc'?'selected':'');
+ eth=(a=='eth'?'selected':'');
+ br=(a=='br'?'selected':'');
+ soft=(a=='soft'?'selected':'');
+ feat=(a=='feat'?'selected':'');
+ li_elements[0].id=plc;
+ li_elements[1].id=eth;
+ li_elements[2].id=br;
+ li_elements[3].id=soft;
+ li_elements[4].id=feat;
+ }
+ function show()
+ {
+ if(!document.f.h.selectedIndex) alert("Please select host first!");
+ else
+ window.open('/cgi-bin/noise.php?h='+document.f.h.options[document.f.h.selectedIndex].value,'prikaz_slike','menubar=0,resizable=0,width=1024,height=330').focus();
+ }
+</script>
+
+<body>
+
+<?php
+ filet=popen('/sbin/ifconfig br0|grep "inet ad"',"r");
+ l=fgets(filet);
+ pclose(filet);
+ if(ereg("([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})",l,$reg)) {
+ $IPb=$reg[0];
+ }
+ $filet=popen("cat /proc/sys/net/plc/mode","r");
+ $mode=trim(fread($filet));
+ pclose($filet);
+?>
+
+<form name="f">
+<table width="100%" height="100%" cellspacing="0" cellpadding="0"><tr valign="bottom"><td>
+ <table border="0" cellpadding="0" cellspacing="0" width="100%">
+ <tr valign="bottom"><td width="1000" height="30" align="left">
+
+ <div id="header">
+ <ul>
+ <li><a href="/cgi-bin/spidcom.html?choice=plc0" target="spid_dole" onClick="change('plc')">PLC</a></li>
+ <li><a href="/cgi-bin/spidcom.html?choice=eth0" target="spid_dole" onClick="change('eth')">Ethernet</a></li>
+ <li id="selected"><a href="/cgi-bin/spidcom.html?choice=br0+" target="spid_dole" onClick="change('br')">Bridge</a></li>
+ <li><a href="/cgi-bin/soft.html" target="spid_dole" onClick="change('soft')">Software</a></li>
+ <li><a href="/cgi-bin/spidcom.html?choice=feat" target="spid_dole" onClick="change('feat')">Features</a></li>
+ </ul>
+
+ </div>
+
+ </td>
+ <td class="subtitle" align="left"><?php print($IPb);?></td>
+ <td align="right">
+<select name="h"><option value="0">choose host</option>
+<?php
+for(i=1;i<32;i++) {
+ fname="/proc/net/plc/host/".i;
+ filet=fopen(fname,"r");
+ if(!empty(filet)) {
+ while(!feof(filet)) {
+ a=fread(filet);
+ if(a=='in_use 0') break;
+ if(substr(a,0,3)=="MAC") echo '<option value="$i">',substr(a,4),"</option>";
+ }
+ fclose(filet);
+ }
+}
+?>
+</select>
+</td>
+<td><input type="button" value="Draw noise" onClick="javascript:show();"></td>
+<td><input type="button" value="Refresh" onClick="javascript:parent.document.location.reload();"></td></tr>
+</table>
+</td></tr></table>
+</form>
+ </body>
+ </html>
diff --git a/polux/application/boa/spc200/cgi-bin/message.html b/polux/application/boa/spc200/cgi-bin/message.html
new file mode 100755
index 0000000000..1fa89409bd
--- /dev/null
+++ b/polux/application/boa/spc200/cgi-bin/message.html
@@ -0,0 +1,69 @@
+#!/bin/uphp
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
+ <html>
+ <head>
+ <title>SPIDCOM Technologies changes</title>
+
+<style type="text/css">
+ body {
+ background-image: url("/spidcom.gif");
+ background-repeat: no-repeat;
+ background-attachment: fixed;
+ background-position: center center;
+ }
+ td.data {
+ border: 0px solid #999;
+ padding: 0px;
+ vertical-align: center;
+ font-family:Times, Arial, Helvetica, sans-serif;
+ font-style: italic;
+ font-size: 14pt;
+ }
+ body.dbtable{
+ padding: 0px 0px 0px 0px;
+ margin: 0px 0px 0px 0px;
+ border-collapse: collapse;
+ border: 0px solid #000000;
+ cursor: default;
+ }
+ table.dbtable{
+ padding: 3px 3px 3px 3px;
+ margin: 0px 0px 0px 30px;
+ border-collapse: collapse;
+ border: 0px solid #000000;
+ cursor: default;
+ }
+ input.submit{
+ font-size:16px;
+ font-family:Arial,Times,serif;
+ font-weight:bold;
+ color:#FF0000;
+ border-style:outset;
+ }
+</style>
+</head>
+
+<body class="dbtable">
+ <table class="dbtable">
+ <tr>
+ <td><br></td>
+ </tr>
+ <tr>
+ <td class="data">Configuration has been changed. Restart the modem for changes to take effect.</td>
+ </tr>
+ <tr>
+ <td><br></td>
+ </tr>
+ <tr>
+ <form action="reboot.html" METHOD="GET">
+ <td><table class="dbtable" border=0 cellpadding=0 cellspacing=0 width=20% align=right valign=bottom>
+ <tr>
+ <td align="left"><input class="submit" type="submit" name="reboot" value="Restart the modem"></td>
+ <td><input type="hidden" name="IPb" value="<?=$IPb?>"></td>
+ </tr>
+ </table></td>
+ </form>
+ </tr>
+ </table>
+</body>
+</html>
diff --git a/polux/application/boa/spc200/cgi-bin/mon.html b/polux/application/boa/spc200/cgi-bin/mon.html
new file mode 100755
index 0000000000..449cab02c9
--- /dev/null
+++ b/polux/application/boa/spc200/cgi-bin/mon.html
@@ -0,0 +1,21 @@
+#!/bin/uphp
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
+ <html>
+ <head>
+ <title>SPIDCOM Technologies</title>
+ </head>
+ <?php
+ system("/bin/touch /usr/share/cgi-bin/ip.txt &");
+ ?>
+ <FRAMESET rows="52, *, 90">
+ <?php if ($NET_IP!=""){ ?>
+ <FRAME src="http://<?php print($NET_IP)?>/cgi-bin/gore.php" name="spid_gore" marginwidth="5" marginheight="5" noresize scrolling="no" TARGET="spid_gore" frameborder="0">
+ <FRAME src="http://<?php print($NET_IP)?>/cgi-bin/spidcom.html?choice=br0+" name="spid_dole" TARGET="spid_dole" frameborder="0">
+ <?php }
+ if ($NET_IP==""){ ?>
+ <FRAME src="/cgi-bin/gore.php" name="spid_gore" marginwidth="5" marginheight="5" noresize scrolling="no" TARGET="spid_gore" frameborder="0">
+ <FRAME src="/cgi-bin/spidcom.html?choice=br0+" name="spid_dole" TARGET="spid_dole" frameborder="0">
+ <?php }; ?>
+ <FRAME src="/disclaimer.html" name="spid_disc" noresize marginwidth="0" marginheight="0" scrolling="no" frameborder="0" TARGET="spid_disc">
+ </FRAMESET>
+ </html>
diff --git a/polux/application/boa/spc200/cgi-bin/noise.php b/polux/application/boa/spc200/cgi-bin/noise.php
new file mode 100755
index 0000000000..d33171f834
--- /dev/null
+++ b/polux/application/boa/spc200/cgi-bin/noise.php
@@ -0,0 +1,60 @@
+#! /bin/uphp
+<?
+ if(!isset($h)) $h=1;
+ img=gifcreate(942,300);
+ gifaddcolors(img,0xffffff,0xff,0x00,0xff00);
+ gifline(img,39,10,39,266,2);
+ gifline(img,39,266,936,266,2);
+ gifline(img,0,288,39,266,2);
+ gifline(img,34,10,39,10,2);
+ for(i=1;i<=7;i++) {
+ x=40+i*128;
+ gifline(img,x,266,x,271,2);
+ giftext(img,x-3,272,i,2);
+ }
+ giftext(img,39,272,"band",2);
+ giftext(img,0,255,"noise",2);
+ header("Content-type: image/gif");
+// header("Content-type: text/plain");
+ filet=fopen("/proc/net/plc/noise/bpsk/$h","r");
+ if(empty(filet)) die("Error opening bpsk noise!");
+
+ carr=0; max=min=0;
+ while(!feof(filet)) {
+ a=fgets(filet);
+ if(!ereg("([0-9]+)",a,m)) {aa=a; continue;}
+ else a=substr(a,strlen(m[0]));
+ while(ereg("[\t ]+([0-9]+)",a,m)) {
+ sph[carr++]=m[1];
+ if(!carr) min=max=m[1];
+ else if(m[1]<min) min=m[1];
+ else if(m[1]>max) max=m[1];
+ a=substr(a,strlen(m[0]));
+ }
+ }
+ fclose(filet);
+
+ if(!max) { delta=0; if(carr) { carr=0; aa="Noise is flat for this host!"; }
+ } else delta=256.0/max;
+ max5=max/5;
+ for(i=max5;i<=max+1;i+=max5) {
+ y=round(266-i*delta);
+ gifline(img,34,y,39,y,2);
+ giftext(img,4,y-6,round(i),2);
+ }
+ if(!carr) {
+ if(!isset(aa) || empty(aa)) aa="Host not found";
+ x=((940-7*strlen(aa))/2);
+ giftext(img,x,130,aa,1);
+ } else {
+ for(carr=1;carr<112;carr++) {
+ x=40+carr*8;
+ y1=265-sph[carr-1]*delta;
+ y2=265-sph[carr]*delta;
+ gifline(img,x-8,y1,x,y1,3);
+ gifline(img,x,y1,x,y2,3);
+ }
+ }
+ gifemit(img);
+ gifdestroy(img);
+?>
diff --git a/polux/application/boa/spc200/cgi-bin/reboot.html b/polux/application/boa/spc200/cgi-bin/reboot.html
new file mode 100755
index 0000000000..064dff651b
--- /dev/null
+++ b/polux/application/boa/spc200/cgi-bin/reboot.html
@@ -0,0 +1,69 @@
+#!/bin/uphp
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
+ <html>
+ <head>
+ <title>SPIDCOM Technologies changes</title>
+<style type="text/css">
+input.text{
+ font-family:TrebuchetMS;
+ font-size:14pt;
+ font-weight:bold;
+ background-color:FFFFFF;
+ border-color:FFFFFF;
+ border-style:outset;
+ border-width:0px;
+ color:0000FF;
+}
+</style>
+</head>
+<body>
+<script>
+var start=new Date();
+ start=Date.parse(start)/1000;
+ var counts=30;
+function CountDown(){
+ var now=new Date();
+ now=Date.parse(now)/1000;
+ var x=parseInt(counts-(now-start),10);
+ if(document.form1){document.form1.clock.value = x;}
+ if(x>0){
+ timerID=setTimeout("CountDown()", 100)
+ }else{
+ form1.submit();
+ //location.href="http://<?php print($IPb); ?>";
+ }
+ }
+//function getgoing()
+//{
+// var xIP="http://<?php print($IPb); ?>";
+// top.location=xIP;
+//}
+</script>
+
+<script>
+window.setTimeout('CountDown()',100);
+</script>
+
+
+<FORM ACTION="http://<?php print($IPb);?>" NAME="form1" TARGET="_top">
+<table>
+<tr>
+<INPUT.TEXT>
+<td><font size=4 COLOR="#0000FF">
+The modem is going to be restarted in <INPUT class="text" TYPE="text" NAME="clock" SIZE="1" VALUE="1" READONLY>seconds.</font></td>
+</INPUT.TEXT>
+</tr>
+</table>
+</FORM>
+</body>
+</html>
+
+<?php
+system('echo "#! /bin/sh" > /usr/share/cgi-bin/execute');
+//system('echo "wait 1 &" >> /usr/share/cgi-bin/execute');
+system('echo "/sbin/reboot &" >> /usr/share/cgi-bin/execute');
+system("chmod 777 /usr/share/cgi-bin/execute");
+system("/usr/share/cgi-bin/execute");
+?>
+
+
diff --git a/polux/application/boa/spc200/cgi-bin/sipconfig.html b/polux/application/boa/spc200/cgi-bin/sipconfig.html
new file mode 100755
index 0000000000..4610146903
--- /dev/null
+++ b/polux/application/boa/spc200/cgi-bin/sipconfig.html
@@ -0,0 +1,11 @@
+#!/bin/uphp
+<?php
+ system("echo username = $username > /usr/local/sip.conf");
+ system("echo password = $password >> /usr/local/sip.conf");
+ system("echo proxy = $proxy >> /usr/local/sip.conf");
+ system("echo country = $country >> /usr/local/sip.conf");
+ system("echo vad = $vad >> /usr/local/sip.conf");
+
+ header("Location: http://$IPb/cgi-bin/message.html?IPb=$IPb");
+ die("");
+?>
diff --git a/polux/application/boa/spc200/cgi-bin/soft-upload.html b/polux/application/boa/spc200/cgi-bin/soft-upload.html
new file mode 100755
index 0000000000..20ef0d2061
--- /dev/null
+++ b/polux/application/boa/spc200/cgi-bin/soft-upload.html
@@ -0,0 +1,88 @@
+#!/bin/uphp
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
+ <html>
+ <head>
+ <title>SPIDCOM Technologies changes</title>
+<style type="text/css">
+input.text{
+ font-family:TrebuchetMS;
+ font-size:14pt;
+ font-weight:bold;
+ background-color:FFFFFF;
+ border-color:FFFFFF;
+ border-style:outset;
+ border-width:0px;
+ color:0000FF;
+}
+</style>
+
+<?php
+$IP_ftp=$IPf1.".".$IPf2.".".$IPf3.".".$IPf4;
+$count=50;
+system("echo $datafile >> /root/datafile &");
+$filet=popen("/usr/bin/bt create $R_name $IP_ftp $datafile 2>&1","r");
+while(!feof($filet)) {
+$l=fgets($filet);
+if(ereg("Error: No free area of size",$l,reg)) {
+ $string="No free area of size, please delete one of the images";
+ $error=1;
+ $count=10;
+}
+}
+pclose($filet);
+?>
+
+<script>
+var start=new Date();
+ start=Date.parse(start)/1000;
+ var counts="<?= $count ?>";
+function CountDown(){
+ var now=new Date();
+ now=Date.parse(now)/1000;
+ var x=parseInt(counts-(now-start),10);
+ if(document.form1){document.form1.clock.value = x;}
+ if(x>0){
+ timerID=setTimeout("CountDown()", 100)
+ }else{
+ form1.submit();
+ //location.href="http://<?php print($IPb); ?>";
+ }
+ }
+
+</script>
+<script>
+
+window.setTimeout('CountDown()',100);
+-->
+</script>
+
+</HEAD>
+
+<!-- STEP TWO: Copy this code into the BODY of your HTML document -->
+
+<BODY>
+
+
+<FORM ACTION="/cgi-bin/soft.html" NAME="form1">
+<table>
+<tr>
+<INPUT.TEXT>
+<td><font size=4 COLOR="#0000FF">
+The image upload is in progress. Please wait <INPUT class="text" TYPE="text" NAME="clock" SIZE="1" VALUE="1" READONLY>seconds.</font></td>
+</INPUT.TEXT>
+</tr>
+<?php if ($error==1){?>
+<tr>
+<INPUT.TEXT>
+<td><font size=4 COLOR="#0000FF"><BLINK> ERROR!! <INPUT class="text" TYPE="text" NAME="err" SIZE="80" VALUE="<?=$string?>" READONLY></BLINK></font></td>
+</INPUT.TEXT>
+</tr>
+<?php }?>
+</table>
+</FORM>
+</html>
+
+
+
+
+
diff --git a/polux/application/boa/spc200/cgi-bin/soft.html b/polux/application/boa/spc200/cgi-bin/soft.html
new file mode 100755
index 0000000000..a269a0f820
--- /dev/null
+++ b/polux/application/boa/spc200/cgi-bin/soft.html
@@ -0,0 +1,308 @@
+#! /bin/uphp
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
+ <html>
+ <head>
+ <title>SPIDCOM Technologies changes</title>
+ <style type="text/css">
+ body {
+ background-image: url("/spidcom.gif");
+ background-repeat: no-repeat;
+ background-attachment: fixed;
+ background-position: center center;
+ }
+ td.title {
+ border: 0px solid #999;
+ height: 2em;
+ width:30em;
+ padding: 3px;
+ vertical-align: top;
+ font-size: 220%;
+ font-family:Times, Arial, Helvetica, sans-serif;
+ font-style: bold;
+ color: #0000FF;
+ }
+ td.subtitle {
+ border: 1px solid #999;
+ height: 2em;
+ width:10em;
+ padding: 1px;
+ align: center;
+ font-family:Times, Arial, Helvetica, sans-serif;
+ font-size: 120%;
+ color: #0000FF;
+ }
+ td.data1 {
+ border: 0px solid #999;
+ height: 1em;
+ width: 20em;
+ padding: 0px;
+ vertical-align: center;
+ font-family:Times, Arial, Helvetica, sans-serif;
+ font-style: italic;
+ font-size: 14pt;
+ }
+ td.data {
+ border: 1px solid #999;
+ height: 1em;
+ width: 7em;
+ padding: 0px;
+ vertical-align: center;
+ font-family:Times, Arial, Helvetica, sans-serif;
+ font-style: italic;
+ font-size: 13pt;
+ }
+ td.subtitle2 {
+ border: 0px solid #999;
+ height: 1em;
+ width: 10em;
+ padding: 1px;
+ align: left;
+ font-family:Times, Arial, Helvetica, sans-serif;
+ font-size: 14pt;
+ color: #000000;
+ }
+ input.text{
+ font-family:Verdana;
+ font-size:10pt;
+ align:center;
+ background-color:fffff0;
+ border-color:FFFFFF;
+ border-style:outset;
+ border-width:0px;
+ color:#0000FF;
+ }
+input.text1{
+ font-family:Verdana;
+ font-size:10pt;
+ background-color:fffff0;
+ border-color:FFFFFF;
+ border-style:outset;
+ border-width:1px;
+ color:#0000FF;
+ }
+ option.option1{
+ font-family:Verdana;
+ font-size:10pt;
+ border: 1px solid #999;
+ height: 2em;
+ width:100em;
+ background-color:fffff0;
+ border-color:FFFFFF;
+ border-style:outset;
+ border-width:0px;
+ color:#0000FF;
+ }
+ select.select1{
+ font-family:Verdana;
+ font-size:10pt;
+ border: 1px solid #999;
+ height: 2em;
+ width:12em;
+ background-color:fffff0;
+ border-color:FFFFFF;
+ border-style:outset;
+ border-width:1px;
+ color:#0000FF;
+ }
+input.submit{
+ font-size:16px;
+ font-family:Arial,Times,serif;
+ font-weight:bold;
+ color:#FF0000;
+ border-style:outset;
+}
+
+body.dbtable{
+padding: 0px 0px 0px 0px;
+margin: 0px 0px 0px 0px;
+border-collapse: collapse;
+border: 0px solid #000000;
+cursor: default;
+}
+table.dbtable{
+padding: 3px 3px 3px 3px;
+margin: 0px 0px 0px 30px;
+border-collapse: collapse;
+border: 0px solid #000000;
+cursor: default;
+}
+
+
+</style>
+ </head>
+ <body class="dbtable" onLoad="document.reboot.reboot.focus();">
+<table border=0 cellpadding=0 cellspacing=0 width=100% align=center>
+ <?php
+ if ($boot_select!=""){
+ system("bt select $boot_select");
+ };
+ $filet=popen("bt images","r");
+ $i=0;
+ while(!feof($filet)){
+ if(($l=trim(fgets($filet)))!="") {
+ $image[i]=$l;
+ if(ereg("([a-zA-Z0-9._-]*)[ ]*(0x[0-9a-fA-F]*-0x[0-9a-fA-F]*)[ ]*([0-9]*)[ ]*(0x[0-9]*)[ ]*(0x[0-9a-fA-F]*)[ ]*([[a-z]*)[ ]*([ ]*|X)",$image[i],$reg)) {
+ $name[i]=$reg[1];
+ $fa[i]=$reg[2];
+ $size[i]=$reg[3];
+ $address[i]=$reg[4];
+ $entry[i]=$reg[5];
+ $format[i]=$reg[6];
+ $s[i]=$reg[7];
+ i++;
+ }
+ }
+ }
+
+ pclose($filet);
+ $filet=popen('/sbin/ifconfig br0|grep "inet ad"',"r");
+ $l=fgets(filet);
+ pclose($filet);
+ if(ereg("([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})",$l,$reg)) {
+ $IPb=$reg[0];
+ }
+ ?>
+ <tr>
+ <td>
+ <table class="dbtable" border=0 cellpadding=0 cellspacing=0 width=60% align=left>
+ <form name=softx action="soft.html" method="GET" onSubmit="">
+<tr>
+<br>
+</tr>
+ <tr>
+ <td COLSPAN=9 class="title"> Available images</td>
+ </tr>
+ <tr>
+ <td class="data1" COLSPAN=2>Name</td>
+ <td class="data1" COLSPAN=2>Flash Area</td>
+ <td class="data1" >Size (B)</td>
+ <td class="data1" >Address</td>
+ <td class="data1" >Entry</td>
+ <td class="data1" >Format</td>
+ <td class="data1" >S</td>
+ </tr>
+ <?php for($g=1;$g<$i;$g++){ ?>
+ <tr>
+ <td class="data" COLSPAN=2><input class="text" type="text" name="Rname" value="<?=$name[$g]?>" READONLY> </td>
+ <td class="data" COLSPAN=2><input class="text" type="text" name="Rfa" size=30 value="<?=$fa[$g]?>" READONLY > </td>
+ <td class="data"><input class="text" type="text" name="Rsize" size=10 value="<?=$size[$g]?>" READONLY> </td>
+ <td class="data"><input class="text" type="text" name="Raddress" size=10 value="<?=$address[$g]?>" READONLY> </td>
+ <td class="data"><input class="text" type="text" name="Rentry" size=10 value="<?=$entry[$g]?>" READONLY> </td>
+ <td class="data"><input class="text" type="text" name="Rformat" size=10 value="<?=$format[$g]?>" READONLY> </td>
+ <td class="data"><input class="text" type="text" name="Rs" size=10 value="<?=$s[$g]?>" READONLY> </td>
+ </tr>
+ <?php } ?>
+ </table>
+ </td>
+ </tr>
+<tr><td><br></td></tr>
+ <tr>
+ <td>
+<table class="dbtable" border=0 cellpadding=0 cellspacing=0 width=50% align=left>
+<tr>
+ <td class="data1">Select the boot image</td>
+ <td><table border=0 cellpadding=0 cellspacing=0 width=30% align=left><tr>
+ <td class="data1"><select class="select1" name="boot_select">
+ <?php for ($g=1;$g<$i;$g++){ ?>
+ <option value="<?=$name[$g]?>"><?php print($name[$g])?></option>
+ <?php } ?>
+ </td>
+ <td class="data1"><input class="submit" type="submit" name="release" value="select"></td>
+ </tr></table></td>
+</tr>
+</form>
+<tr><td><br></td></tr>
+<form name=del_image action="del_image.html" method="GET" onSubmit="return conf()">
+<tr>
+ <td class="data1">Delete the boot image</td>
+ <td><table border=0 cellpadding=0 cellspacing=0 width=30% align=left><tr>
+ <td class="data1"><select class="select1" name="del_select">
+ <?php for ($g=1;$g<$i;$g++){ ?>
+ <option value="<?=$name[$g]?>"><?php print($name[$g])?></option>
+ <?php } ?>
+ </td>
+ <td class="data1"><input class="submit" type="submit" name="deletex" value="delete"></td>
+ </tr></table></td>
+</tr>
+</table>
+</td></tr>
+</form>
+<tr><td>
+<form name=softy action="soft-upload.html" method="GET" onSubmit="soft-upload.html">
+<table class="dbtable" border=0 cellpadding=0 cellspacing=0 width=40% align=left>
+ <tr>
+ <td><br></td>
+ </tr>
+ <tr>
+ <td class="title" colspan="2">Upload the image</td>
+ </tr>
+ <tr><td><br></td></tr>
+ <tr>
+ <td class="data1">Name of the file to upload</td>
+ <td><table border=0 cellpadding=0 cellspacing=0 width=50% align=left><tr>
+ <td class="data"><input class="text" type="text" name="datafile"></td>
+ </tr></table></td>
+
+ </tr>
+
+ <tr>
+ <td class="data1">IP address of the ftp server</td>
+ <td><table border=0 cellpadding=0 cellspacing=0 width=60% align=left><tr>
+ <td align="center" class="data"><input align="center" class="text" type="text" name="IPf1" size=3 maxlength=3></td>
+ <td align="center" class="data"><input class="text" type="text" name="IPf2" size=3 maxlength=3></td>
+ <td align="center" class="data"><input class="text" type="text" name="IPf3" size=3 maxlength=3></td>
+ <td align="center" class="data"><input class="text" type="text" name="IPf4" size=3 maxlength=3></td>
+ </tr></table></td>
+ </tr>
+
+ <tr>
+
+
+ <td class="data1">Name of the release</td>
+ <td><table border=0 cellpadding=0 cellspacing=0 width=50% align=left><tr>
+ <td class="data"><input class="text" type="text" name="R_name"></td>
+ </tr></table></td>
+
+ </tr>
+
+ <tr>
+ <td><br></td>
+ </tr>
+ <tr>
+ <td class="data1"><input class="submit" type="submit" name="send" value="send"></td>
+ </tr>
+</table>
+</form>
+</td></tr>
+<tr><td>
+ <form name="reboot" action="reboot.html" METHOD="GET">
+ <table class="dbtable" border=0 cellpadding=0 cellspacing=0 width=20% align=right valign=bottom>
+ <tr>
+ <td class="subtitle2"><input class="submit" type="submit" name="reboot" value="Restart the modem"></td>
+ <td><input type="hidden" name="IPb" value="<?=$IPb?>"></td>
+ </tr>
+ </table>
+ </form>
+ </td></tr>
+ <script>
+ function conf(){
+ var answer = confirm("Do you really want to delete this file?")
+ if (answer){
+ window.location = "del_image.html";
+ testresult=true;
+ }
+ else{
+ // document.del_image.deletex.value="NO";
+ testresult=false;
+ }
+ return(testresult);
+}
+
+ </script>
+ </td></tr>
+ </table>
+ </body>
+ </html>
+
+
+
diff --git a/polux/application/boa/spc200/cgi-bin/spidcom.html b/polux/application/boa/spc200/cgi-bin/spidcom.html
new file mode 100755
index 0000000000..bc5074fa5b
--- /dev/null
+++ b/polux/application/boa/spc200/cgi-bin/spidcom.html
@@ -0,0 +1,1386 @@
+#! /bin/uphp
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
+ <html>
+ <head>
+ <title>SPIDCOM Technologies changes</title>
+ <style type="text/css">
+ body {
+ background-image: url("/spidcom.gif");
+ background-repeat: no-repeat;
+ background-attachment: fixed;
+ background-position: center center;
+ }
+ td.title {
+ border: 0px solid #999;
+ height: 2em;
+ width:30em;
+ padding: 2px;
+ vertical-align: top;
+ font-size: 220%;
+ font-family:Times, Arial, Helvetica, sans-serif;
+ font-style: bold;
+ color: #0000FF;
+ }
+ td.subtitle {
+ border: 0px solid #999;
+ height: 2em;
+ width:15em;
+ padding: 1px;
+ align: center;
+ font-family:Times, Arial, Helvetica, sans-serif;
+ font-size: 120%;
+ color: #0000FF;
+ }
+ td.data {
+ border: 0px solid #999;
+ height: 1em;
+ width: 20em;
+ padding: 0px;
+ vertical-align: center;
+ font-family:Times, Arial, Helvetica, sans-serif;
+ font-style: italic;
+ font-size: 14pt;
+ }
+ td.data1 {
+ border: 1px solid #999;
+ height: 1em;
+ width: 7em;
+ padding: 0px;
+ vertical-align: center;
+ font-family:Times, Arial, Helvetica, sans-serif;
+ font-style: italic;
+ font-size: 13pt;
+ }
+ td.subtitle2 {
+ border: 0px solid #999;
+ height: 1em;
+ width: 5em;
+ padding: 0px;
+ align: center;
+ font-family:Times, Arial, Helvetica, sans-serif;
+ font-size: 12pt;
+ color: #000000;
+ }
+ input.text{
+ font-family:Verdana;
+ font-size:10pt;
+ text-align: center;
+ vertical-align: center;
+ background-color:fffff0;
+ border-color:FFFFFF;
+ border-style:outset;
+ border-width:0px;
+ color:#0000FF;
+ }
+input.text1{
+ font-family:Verdana;
+ font-size:10pt;
+ background-color:fffff0;
+ border-color:FFFFFF;
+ border-style:outset;
+ border-width:1px;
+ color:#0000FF;
+ }
+ option.option{
+ font-family:Verdana;
+ font-size:10pt;
+ background-color:fffff0;
+ border-color:FFFFFF;
+ border-style:outset;
+ border-width:0px;
+ color:#0000FF;
+ }
+ select.select1{
+ font-family:Verdana;
+ font-size:10pt;
+ border: 1px solid #999;
+ height: 2em;
+ width:12em;
+ background-color:fffff0;
+ border-color:FFFFFF;
+ border-style:outset;
+ border-width:1px;
+ color:#0000FF;
+ }
+input.submit{
+ font-size:16px;
+ font-family:Arial,Times,serif;
+ font-weight:bold;
+ color:#FF0000;
+ border-style:outset;
+}
+body.dbtable{
+padding: 0px 0px 0px 0px;
+margin: 0px 0px 0px 0px;
+border-collapse: collapse;
+border: 0px solid #000000;
+cursor: default;
+}
+table.dbtable{
+padding: 3px 3px 3px 3px;
+margin: 0px 0px 0px 30px;
+border-collapse: collapse;
+border: 0px solid #000000;
+cursor: default;
+}
+
+ </style>
+<!--<script>
+ function focusByChoice() {
+ var pchoice = <?php echo $choice; ?>
+ if (pchoice == "plc0" || choice == "eth0" || choice == "br0 ")
+ document.cIP.IPb1.focus();
+ else if (choice == "feat") {
+ var voip = <?php echo $voip; ?>
+ if (voip)
+ document.sipconf.submit.focus();
+ else
+ document.reboot.submit.focus();
+ }
+ }
+</script>-->
+
+ </head>
+
+ <body class="dbtable" onLoad="document.reboot.reboot.focus();">
+
+
+ <!-- Below - php code which extracts IP, NET, MAC, Getaway parameters from the /usr/local/etc/network/interfaces
+ file -->
+<?php
+ // Checking whether dhcp is on ($dhcp=1)
+ $dhcp=0;$pdhcp=100000;
+ filet=popen("ps","r");
+ while(!feof(filet)) {
+ l=fgets(filet);
+ if(ereg("dhcpc",l,reg)) $dhcp=1;
+ }
+ pclose(filet);
+
+ // The part below deals with finding the process ID of the dhcp process if the dhcp is active
+ if($dhcp==1){
+ $filet=popen('ps |grep "/bin/udhcpc"',"r");
+ while(!feof($filet)) {
+ $l=fgets($filet);
+ if(ereg("([0-9]{1,5})",$l,$reg)) {
+ $pdhcp=$reg[1];
+ break;
+ }
+ }
+ pclose($filet);
+}
+
+
+// Reading network data from the 'interface' file
+ $flag_eth=0;
+ $filet = fopen("/etc/network/interfaces","r");
+ if(empty($filet)) die("Error opening network configuration!");
+ while(!feof($filet)) {
+ $l = trim(fread($filet)); //cat the extra spaces from the left and right
+ if(empty($l)) continue;
+ $sx=substr($l,0,10); //takes first 10 characters
+
+
+ // Taking values from 'etc/network/interface' for the ethernet device //
+ if ($sx=="iface eth0") {
+ while(!(empty($l))) {
+ $l=trim(fread($filet));
+ $su=substr($l,0,7);
+ if($su=="address" && ereg("([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})",$l,$reg)) {
+ $IPe1=$reg[1];
+ $IPe2=$reg[2];
+ $IPe3=$reg[3];
+ $IPe4=$reg[4];
+ }
+ if($su=="netmask" && ereg("([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})",$l,$reg)) {
+ $NETe=$reg[0];
+ $NETe1=$reg[1];
+ $NETe2=$reg[2];
+ $NETe3=$reg[3];
+ $NETe4=$reg[4];
+ }
+ if($su=="gateway" && ereg("([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})",$l,$reg)) {
+ $gtewaye=$reg[0];
+ $gtewaye1=$reg[1];
+ $gtewaye2=$reg[2];
+ $gtewaye3=$reg[3];
+ $gtewaye4=$reg[4];
+ }
+
+ }
+ }
+
+
+ //Taking values from 'etc/network/interface' for the plc device
+ if ($sx=="iface plc0") {
+ while(!(empty($l))) {
+ $l=trim(fread($filet));
+ $su=substr($l,0,7);
+ if($su=="address" && ereg("([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})",$l,$reg)) {
+ $IPp=$reg[0];
+ $IPp1=$reg[1];
+ $IPp2=$reg[2];
+ $IPp3=$reg[3];
+ $IPp4=$reg[4];
+ }
+ if($su=="netmask" && ereg("([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})",$l,$reg)) {
+ $NETp=$reg[0];
+ $NETp1=$reg[1];
+ $NETp2=$reg[2];
+ $NETp3=$reg[3];
+ $NETp4=$reg[4];
+ }
+ if($su=="gateway" && ereg("([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})",$l,$reg)) {
+ $gtewayp=$reg[0];
+ $gtewayp1=$reg[1];
+ $gtewayp2=$reg[2];
+ $gtewayp3=$reg[3];
+ $gtewayp4=$reg[4];
+ }
+ }
+ }
+
+ //Taking values from 'etc/network/interface' for the bridge device
+ if ($sx=="iface br0 ") {
+ while(!(empty($l))) {
+ $l=trim(fread($filet));
+ $su=substr($l,0,7);
+ if($su=="address" && ereg("([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})",$l,$reg)) {
+ $IPxb1=$reg[1];
+ $IPxb2=$reg[2];
+ $IPxb3=$reg[3];
+ $IPxb4=$reg[4];
+ $IPxb=$IPxb1.".$IPxb2".".$IPxb3".".$IPxb4";
+ }
+ if($su=="netmask" && ereg("([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})",$l,$reg)) {
+ $NETxb=$reg[0];
+ $NETxb1=$reg[1];
+ $NETxb2=$reg[2];
+ $NETxb3=$reg[3];
+ $NETxb4=$reg[4];
+ $Nb=$NETxb1.".$NETxb2".".$NETxb3".".$NETxb4";
+ }
+ if($su=="gateway" && ereg("([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})",$l,$reg)) {
+ $gtewayb=$reg[0];
+ $gtewayb1=$reg[1];
+ $gtewayb2=$reg[2];
+ $gtewayb3=$reg[3];
+ $gtewayb4=$reg[4];
+ $GTb=$gtewayb1.".$gtewayb2".".$gtewayb3".".$gtewayb4";
+ }
+ }
+ }
+ }
+ fclose($filet);
+ // Getting values for the ethernet IP address //
+ filet=popen('/sbin/ifconfig eth0|grep "inet ad"',"r");
+ l=fgets(filet);
+ pclose(filet);
+ if(ereg("([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})",l,$reg)) {
+ $IPe1=$reg[1];
+ $IPe2=$reg[2];
+ $IPe3=$reg[3];
+ $IPe4=$reg[4];
+ $flag_eth=1;
+ }
+ // Getting values for the bridge IP address //
+ filet=popen('/sbin/ifconfig br0|grep "inet ad"',"r");
+ l=fgets(filet);
+ pclose(filet);
+ if(ereg("([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})",l,$reg)) {
+ $IPb=$reg[0];
+ $IPb1=$reg[1];
+ $IPb2=$reg[2];
+ $IPb3=$reg[3];
+ $IPb4=$reg[4];
+ }
+
+ filet=popen('/sbin/ifconfig br0|grep "Mask"',"r");
+ l=fgets(filet);
+ pclose(filet);
+ if(ereg("Mask:([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})",l,$reg)) {
+ $NETb=$reg[0];
+ $NETb1=$reg[1];
+ $NETb2=$reg[2];
+ $NETb3=$reg[3];
+ $NETb4=$reg[4];
+ }
+
+ filet=popen('/sbin/ifconfig eth0|grep "HWaddr"',"r");
+ l=fgets(filet);
+ pclose(filet);
+ if(ereg("HWaddr ([0-9a-fA-F]{2})\:([0-9a-fA-F]{2})\:([0-9a-fA-F]{2})\:([0-9a-fA-F]{2})\:([0-9a-fA-F]{2})\:([0-9a-fA-F]{2})",l,$reg)) {
+ $MACe=$reg[0];
+ $MACe1=$reg[1];
+ $MACe2=$reg[2];
+ $MACe3=$reg[3];
+ $MACe4=$reg[4];
+ $MACe5=$reg[5];
+ $MACe6=$reg[6];
+ }
+ filet=popen('/sbin/ifconfig plc0|grep "HWaddr"',"r");
+ l=fgets(filet);
+ pclose(filet);
+ if(ereg("HWaddr ([0-9a-fA-F]{2})\:([0-9a-fA-F]{2})\:([0-9a-fA-F]{2})\:([0-9a-fA-F]{2})\:([0-9a-fA-F]{2})\:([0-9a-fA-F]{2})",l,$reg)) {
+ $MACp=$reg[0];
+ $MACp1=$reg[1];
+ $MACp2=$reg[2];
+ $MACp3=$reg[3];
+ $MACp4=$reg[4];
+ $MACp5=$reg[5];
+ $MACp6=$reg[6];
+ }
+
+// Looking for the version of the MODEM
+ $host=popen("/bin/hostname","r");
+ hn=fread($host);
+ pclose($host);
+ $cmd=popen("cat /proc/sys/net/plc/mode","r");
+ $mode=trim(fread($cmd));
+ pclose($cmd);
+
+
+ ?>
+ <!-- This is the end of extraction IP parameters-->
+
+<table border=0 cellpadding=0 cellspacing=0 width=100% align=center>
+<tr>
+<form name="sipconf" action="sipconfig.html" method="GET">
+<?php if (choice=="feat") { ?>
+
+ <!--Checking whether voip is on ($voip=1)-->
+ <?php
+ $voip=0;
+ filet=popen("ps","r");
+ while(!feof(filet) && !voip) {
+ l=fgets(filet);
+ if(ereg("voipdemo",l,reg)) $voip=1;
+ }
+ pclose(filet);
+ ?>
+
+ <td><table class="dbtable" border=0 cellpadding=0 cellspacing=0 width=40% align=left>
+ <tr>
+ <td><br></td>
+ </tr>
+
+ <!--Parse VoIP configuration file:-->
+ <?php if ($voip == 1) {
+ file = fopen("/usr/local/sip.conf", "r");
+
+ // fetching username:
+ l = trim(fgets(file));
+ if (ereg("[uU][sS][eE][rR][nN][aA][mM][eE][ ]?=[ ]?(.*)", l, $regs))
+ $username = regs[1];
+ else
+ $username = "";
+
+ // fetching password:
+ l = trim(fgets(file));
+ if (ereg("[pP][aA][sS][sS][wW][oO][rR][dD][ ]?=[ ]?(.*)", l, $regs))
+ $password = regs[1];
+ else
+ $password = "";
+
+ // fetching proxy:
+ l = trim(fgets(file));
+ if (ereg("[pP][rR][oO][xX][yY][ ]?=[ ]?(.*)", l, $regs))
+ $proxy = regs[1];
+ else
+ $proxy = "";
+
+ // fetching country:
+ l = trim(fgets(file));
+ if (ereg("[cC][oO][uU][nN][tT][rR][yY][ ]?=[ ]?(.*)", l, $regs))
+ $country= regs[1];
+ else
+ $country= "";
+
+ // fetching vad:
+ l = trim(fgets(file));
+ if (ereg("[vV][aA][dD][ ]?=[ ]?(.*)", l, $regs))
+ $vad = regs[1];
+ else
+ $vad= "";
+
+ fclose(file);
+ ?>
+ <tr>
+ <td class="title" colspan="2">VoIP configuration</td>
+ </tr>
+ <tr>
+ <td><br></td>
+ </tr>
+ <tr>
+ <td class="data">username:</td>
+ <td><table border=0 cellpadding=0 cellspacing=0 width=50% align=left>
+ <tr>
+ <td class="data"><input class="text" type="text" name="username" value="<?=$username?>" ></td>
+ </tr>
+ </table></td>
+ </tr>
+ <tr>
+ <td class="data">password:</td>
+ <td><table border=0 cellpadding=0 cellspacing=0 width=50% align=left>
+ <tr>
+ <td class="data"><input class="text" type="text" name="password" value="<?=$password?>"></td>
+ </tr>
+ </table></td>
+ </tr>
+ <tr>
+ <td class="data">proxy:</td>
+ <td><table border=0 cellpadding=0 cellspacing=0 width=50% align=left>
+ <tr>
+ <td class="data"><input class="text" type="text" name="proxy" value="<?=$proxy?>"></td>
+ </tr>
+ </table></td>
+ </tr>
+ <tr>
+ <td class="data">country:</td>
+ <td><table border=0 cellpadding=0 cellspacing=0 width=30% align=left>
+ <tr>
+ <td class="data"><select class="select1" style="text-align:center" name="country">
+ <?php if (($country == "DEFAULT") || ($country == "default")) { ?>
+ <option style="text-align:center" selected="selected" value="default">DEFAULT</option>
+ <option style="text-align:center" value="de">DE</option>
+ <option style="text-align:center" value="usa">USA</option>
+ <option style="text-align:center" value="uk">UK</option>
+ <?php } if (($country == "DE") || ($country == "de")) { ?>
+ <option style="text-align:center" value="default">DEFAULT</option>
+ <option style="text-align:center" selected="selected" value="de">DE</option>
+ <option style="text-align:center" value="usa">USA</option>
+ <option style="text-align:center" value="uk">UK</option>
+ <?php } if (($country == "USA") || ($country == "usa")) { ?>
+ <option style="text-align:center" value="default">DEFAULT</option>
+ <option style="text-align:center" value="de">DE</option>
+ <option style="text-align:center" selected="selected" value="usa">USA</option>
+ <option style="text-align:center" value="uk">UK</option>
+ <?php } if (($country == "UK") || ($country =="uk")) { ?>
+ <option style="text-align:center" value="default">DEFAULT</option>
+ <option style="text-align:center" value="de">DE</option>
+ <option style="text-align:center" value="usa">USA</option>
+ <option style="text-align:center" selected="selected" value="uk">UK</option>
+ <?php } ?>
+ </select></td>
+ </tr>
+ </table></td>
+ </tr>
+ <tr>
+ <td class="data">VAD:</td>
+ <?php if ($vad=="yes") { ?>
+ <td class="data"><input class="text" type="radio" name="vad" value="yes" CHECKED>yes</td>
+ <td class="data"><input class="text" type="radio" name="vad" value="no">no</td>
+ <?php }
+ else { ?>
+ <td class="data"><input class="text" type="radio" name="vad" value="yes">yes</td>
+ <td class="data"><input class="text" type="radio" name="vad" value="no" CHECKED>no</td>
+ <?php } ?>
+ </tr>
+ <tr>
+ <td><br></td>
+ </tr>
+ <tr>
+ <td class="data"><input class="submit" type="submit" value="submit"></td>
+ <td><input type="hidden" name="IPb" value="<?=$IPb?>"></td>
+ </tr>
+ <tr>
+ <td><br></td>
+ </tr>
+ <?php }
+ else { ?>
+ <tr>
+ <td class="data">VoIP is OFF</td>
+ </tr>
+ <?php } ?>
+ </table></td>
+<?php } ?></form>
+</tr>
+
+<tr>
+<form name="cIP" action="changeIP.html" method="GET" onSubmit="return checkban()" >
+
+
+
+<?php
+if (choice=="eth0") { ?>
+
+ <td><table class="dbtable" width="90%" border="0" cellpadding=0 cellspacing=0 align="left" valign="center">
+ <tr>
+ <td COLSPAN=2 class="title" ALIGN="center">Ethernet configuration</td>
+ </tr>
+ <tr>
+ <td class="subtitle" ALIGN="left">Network configuration</td>
+ <td><br></td>
+ </tr>
+ <tr>
+ <td class="data">Current IP address</td>
+ <td><table width="30%" border="0" cellpadding=0 cellspacing=0>
+ <tr>
+ <td class="data1" align="center"><input class="text" type="text" name="IPe1" size=3 maxlength=3 value="<?=$IPe1?>"></td>
+ <td class="data1" align="center"><input class="text" type="text" name="IPe2" size=3 maxlength=3 value="<?=$IPe2?>"></td>
+ <td class="data1" align="center"><input class="text" type="text" name="IPe3" size=3 maxlength=3 value="<?=$IPe3?>"></td>
+ <td class="data1" align="center"><input class="text" type="text" name="IPe4" size=3 maxlength=3 value="<?=$IPe4?>"></td>
+ </tr>
+ </table></td>
+ </tr>
+ <tr>
+ <td class="data">Current NET mask</td>
+ <td><table width="30%" border="0" cellpadding=0 cellspacing=0>
+ <tr>
+ <td class="data1"><input class="text" type="text" name="NETe1" size=3 maxlength=3 value="<?=$NETe1?>"></td>
+ <td class="data1"><input class="text" type="text" name="NETe2" size=3 maxlength=3 value="<?=$NETe2?>"></td>
+ <td class="data1"><input class="text" type="text" name="NETe3" size=3 maxlength=3 value="<?=$NETe3?>"></td>
+ <td class="data1"><input class="text" type="text" name="NETe4" size=3 maxlength=3 value="<?=$NETe4?>"></td>
+ </tr>
+ </table></td>
+ </tr>
+ <tr>
+ <td class="data">Current gateway address</td>
+ <td><table width="30%" border="0" cellpadding=0 cellspacing=0>
+ <tr>
+ <td class="data1"><input class="text" type="text" name="gtewaye1" size=3 maxlength=3 value="<?=$gtewaye1?>"></td>
+ <td class="data1"><input class="text" type="text" name="gtewaye2" size=3 maxlength=3 value="<?=$gtewaye2?>"></td>
+ <td class="data1"><input class="text" type="text" name="gtewaye3" size=3 maxlength=3 value="<?=$gtewaye3?>"></td>
+ <td class="data1"><input class="text" type="text" name="gtewaye4" size=3 maxlength=3 value="<?=$gtewaye4?>"></td>
+ </tr>
+ </table></td>
+ </tr>
+ <tr>
+ <td class="data">MAC address</td>
+ <td><table width="40%" border="0" cellpadding=0 cellspacing=0>
+ <tr>
+ <td class="data1"><input class="text" type="text" name="MACe1" size=2 maxlength=2 value="<?=$MACe1?>" DISABLED></td>
+ <td class="data1"><input class="text" type="text" name="MACe2" size=2 maxlength=2 value="<?=$MACe2?>" DISABLED></td>
+ <td class="data1"><input class="text" type="text" name="MACe3" size=2 maxlength=2 value="<?=$MACe3?>" DISABLED></td>
+ <td class="data1"><input class="text" type="text" name="MACe4" size=2 maxlength=2 value="<?=$MACe4?>" DISABLED></td>
+ <td class="data1"><input class="text" type="text" name="MACe5" size=2 maxlength=2 value="<?=$MACe5?>" DISABLED></td>
+ <td class="data1"><input class="text" type="text" name="MACe6" size=2 maxlength=2 value="<?=$MACe6?>" DISABLED></td>
+ </tr>
+ </table></td>
+ </tr>
+
+ <tr>
+ <td> <br></td>
+ <td> <br></td>
+ </tr>
+
+ <tr>
+ <td class="subtitle">Throughput control</td>
+ <?php
+ $filet=popen('tc qdisc show dev eth0 | grep tbf',"r");
+ $l=fgets($filet);
+ pclose($filet);
+ $etc_active=0;
+ $etc_rate_unit = "Mbit";
+ if (!empty($l)) {
+ if (ereg("rate ([_0-9\.-]*)([a-zA-Z]*)", $l, $reg)) {
+ $etc_rate = $reg[1];
+ $etc_rate_unit = $reg[2];
+ }
+ $etc_active = 1;
+ }
+
+ if ($etc_active==1) { ?>
+ <td><table>
+ <tr>
+ <td class="data"><input class="text" type="radio" name="etc_cont" value="ACTIVE" CHECKED>TC ACTIVE</td>
+ <td class="data"><input class="text" type="radio" name="etc_cont" value="INACTIVE">TC INACTIVE</td>
+ </tr>
+ </table></td>
+ <?php } else { ?>
+ <td><table>
+ <tr>
+ <td class="data"><input class="text" type="radio" name="etc_cont" value="ACTIVE">TC ACTIVE</td>
+ <td class="data"><input class="text" type="radio" name="etc_cont" value="INACTIVE" CHECKED>TC INACTIVE</td>
+ </tr>
+ </table></td>
+ <?php } ?>
+ </tr>
+ <tr>
+ <td><table width="86%" border=0 cellpadding=0 cellspacing=0>
+ <tr>
+ <td class="data">Rate</td>
+ <td><input class="text" type="text" name="etc_rate" size=10 maxlength=10 value="<?=$etc_rate?>"></td>
+ <td><?=$etc_rate_unit?></td>
+ </tr>
+ </table></td>
+ </tr>
+ <tr>
+ <td><br></td>
+ </tr>
+ <tr>
+ <td><input class="submit" type="submit" name="submit" value="Save configuration"></td>
+ <td><input type="hidden" name="choice" value="<?=$choice?>"></td>
+ <td><input type="hidden" name="IPb" value="<?=$IPb?>"></td>
+ <td><input type="hidden" name="etc_rate_unit" value="<?=$etc_rate_unit?>"></td>
+ </tr>
+ </table></td>
+
+ <td><table class="dbtable" border=0 cellpadding=0 cellspacing=0 width=90% align="center" valign="top">
+ <tr>
+ <td class="title" COLSPAN="2">Activity - statistics</td>
+ </tr>
+ <tr>
+ <td colspan="2"><br></td>
+ </tr>
+ <tr>
+ <td class="data"></td>
+ <td><table width="45%" border=0 cellpadding=0 cellspacing=0>
+ <tr>
+ <td class="data1"><input class="text" type="text" name="dump" size=10 maxlength=10 value="RX" READONLY></td>
+ <td class="data1"><input class="text" type="text" name="dump" size=10 maxlength=10 value="TX" READONLY></td>
+ </tr>
+ </table></td>
+ </tr>
+ <tr>
+ <td class="data">PACKETS</td>
+ <td><table width="45%" border=0 cellpadding=0 cellspacing=0>
+ <tr>
+ <td class="data1"><input class="text" type="text" name="RxEpac" size=10 maxlength=10 value="<?=$RxEpac?>" READONLY></td>
+ <td class="data1"><input class="text" type="text" name="TxEpac" size=10 maxlength=10 value="<?=$TxEpac?>" READONLY></td>
+ </tr>
+ </table></td>
+ </tr>
+ <tr>
+ <td class="data">ERRORS</td>
+ <td><table width="45%" border=0 cellpadding=0 cellspacing=0>
+ <tr>
+ <td class="data1"><input class="text" type="text" name="RxEerr" size=10 maxlength=10 value="<?=$RxEerr?>" READONLY></td>
+ <td class="data1"><input class="text" type="text" name="TxEerr" size=10 maxlength=10 value="<?=$TxEerr?>" READONLY></td>
+ </tr>
+ </table></td>
+ </tr>
+ <tr>
+ <td class="data">Dropped PACKETs</td>
+ <td><table width="45%" border=0 cellpadding=0 cellspacing=0>
+ <tr>
+ <td class="data1"><input class="text" type="text" name="RxEdro" size=10 maxlength=10 value="<?=$RxEdro?>" READONLY></td>
+ <td class="data1"><input class="text" type="text" name="TxEdro" size=10 maxlength=10 value="<?=$TxEdro?>" READONLY></td>
+ </tr>
+ </table></td>
+ </tr>
+ <tr>
+ <td class="data">OVERRUNS</td>
+ <td><table width="45%" border=0 cellpadding=0 cellspacing=0>
+ <tr>
+ <td class="data1"><input class="text" type="text" name="RxEover" size=10 maxlength=10 value="<?=$RxEover?>" READONLY></td>
+ <td class="data1"><input class="text" type="text" name="TxEover" size=10 maxlength=10 value="<?=$TxEover?>" READONLY></td>
+ </tr>
+ </table></td>
+ </tr>
+ <tr>
+ <td class="data">FRAME</td>
+ <td><table width="45%" border=0 cellpadding=0 cellspacing=0>
+ <tr>
+ <td class="data1"><input class="text" type="text" name="RxEframe" size=10 maxlength=10 value="<?=$RxEframe?>" READONLY></td>
+ <td class="data1"><input class="text" type="text" name="dump" size=10 maxlength=10 value="" READONLY></td>
+ </tr>
+ </table></td>
+ </tr>
+ <tr>
+ <td class="data">CARRIERs</td>
+ <td><table width="45%" border=0 cellpadding=0 cellspacing=0>
+ <tr>
+ <td class="data1"><input class="text" type="text" name="dump" size=10 maxlength=10 value="" READONLY></td>
+ <td class="data1"><input class="text" type="text" name="TxEcar" size=10 maxlength=10 value="<?=$TxEcar?>" READONLY></td>
+ </tr>
+ </table></td>
+ </tr>
+ <tr>
+ <td class="data">Collisions</td>
+ <td><table width="45%" border=0 cellpadding=0 cellspacing=0>
+ <tr>
+ <td class="data1"><input class="text" type="text" name="dump" size=10 maxlength=10 value="" READONLY></td>
+ <td class="data1"><input class="text" type="text" name="TxEcoll" size=10 maxlength=10 value="<?=$TxEcoll?>" READONLY></td>
+ </tr>
+ </table></td>
+ </tr>
+ <tr>
+ <td class="data">Queue length</td>
+ <td><table width="45%" border=0 cellpadding=0 cellspacing=0>
+ <tr>
+ <td class="data1"><input class="text" type="text" name="dump" size=10 maxlength=10 value="" READONLY></td>
+ <td class="data1"><input class="text" type="text" name="TxEqlen" size=10 maxlength=10 value="<?=$TxEqlen?>" READONLY></td>
+ </tr>
+ </table></td>
+ </tr>
+ <tr>
+ <td class="data">BYTES</td>
+ <td><table width="45%" border=0 cellpadding=0 cellspacing=0>
+ <tr>
+ <td class="data1"><input class="text" type="text" name="RxEbytes" size=10 maxlength=10 value="<?=$RxEbytes?>" READONLY></td>
+ <td class="data1"><input class="text" type="text" name="TxEbytes" size=10 maxlength=10 value="<?=$TxEbytes?>" READONLY></td>
+ </tr>
+ </table></td>
+ </tr>
+ </table></td>
+<?php }
+
+
+
+if (choice=="plc0") { ?>
+ <td><table class="dbtable" width="70%" border="0" cellpadding=0 cellspacing=0>
+ <tr>
+ <td class="title" colspan="2" ALIGN="center">PLC configuration</td>
+ </tr>
+ <tr>
+ <td class="subtitle" ALIGN="left">Network configuration</font></td>
+ <td></td>
+ </tr>
+ <tr>
+ <td class="data">Current IP address</td>
+ <td>
+ <table width="30%" border=0 cellpadding=0 cellspacing=0>
+ <tr>
+ <td class="data1"><input class="text" type="text" name="IPp1" size=3 maxlength=3 value="<?=$IPp1?>"> </td>
+ <td class="data1"> <input class="text" type="text" name="IPp2" size=3 maxlength=3 value="<?=$IPp2?>"> </td>
+ <td class="data1"> <input class="text" type="text" name="IPp3" size=3 maxlength=3 value="<?=$IPp3?>"> </td>
+ <td class="data1"> <input class="text" type="text" name="IPp4" size=3 maxlength=3 value="<?=$IPp4?>"> </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td class="data">Current NET mask</td>
+ <td>
+ <table width="30%" border=0 cellpadding=0 cellspacing=0>
+ <tr>
+ <td class="data1"> <input class="text" type="text" name="NETp1" size=3 maxlength=3 value="<?=$NETp1?>"> </td>
+ <td class="data1"> <input class="text" type="text" name="NETp2" size=3 maxlength=3 value="<?=$NETp2?>"> </td>
+ <td class="data1"> <input class="text" type="text" name="NETp3" size=3 maxlength=3 value="<?=$NETp3?>"> </td>
+ <td class="data1"> <input class="text" type="text" name="NETp4" size=3 maxlength=3 value="<?=$NETp4?>"> </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td class="data">Current gateway address</td>
+ <td>
+ <table width="30%" border=0 cellpadding=0 cellspacing=0>
+ <tr>
+ <td class="data1"> <input class="text" type="text" name="gtewayp1" size=3 maxlength=3 value="<?=$gtewayp1?>"> </td>
+ <td class="data1"> <input class="text" type="text" name="gtewayp2" size=3 maxlength=3 value="<?=$gtewayp2?>"> </td>
+ <td class="data1"> <input class="text" type="text" name="gtewayp3" size=3 maxlength=3 value="<?=$gtewayp3?>"> </td>
+ <td class="data1"> <input class="text" type="text" name="gtewayp4" size=3 maxlength=3 value="<?=$gtewayp4?>"> </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td class="data">MAC address</td>
+ <td>
+ <table width="40%" border=0 cellpadding=0 cellspacing=0>
+ <tr>
+ <td class="data1"> <input class="text" type="text" name="MACp1" size=2 maxlength=2 value="<?=$MACp1?>" DISABLED> </td>
+ <td class="data1"> <input class="text" type="text" name="MACp2" size=2 maxlength=2 value="<?=$MACp2?>" DISABLED> </td>
+ <td class="data1"> <input class="text" type="text" name="MACp3" size=2 maxlength=2 value="<?=$MACp3?>" DISABLED> </td>
+ <td class="data1"> <input class="text" type="text" name="MACp4" size=2 maxlength=2 value="<?=$MACp4?>" DISABLED> </td>
+ <td class="data1"> <input class="text" type="text" name="MACp5" size=2 maxlength=2 value="<?=$MACp5?>" DISABLED> </td>
+ <td class="data1"> <input class="text" type="text" name="MACp6" size=2 maxlength=2 value="<?=$MACp6?>" DISABLED> </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2"> <input type="hidden" name="IPb" size="0" value="<?=$IPb?>"</td>
+ </tr>
+ </table>
+
+ <table class="dbtable" border=0 cellpadding=0 cellspacing=0 width=75% align="left">
+ <tr>
+ <td> <br></td>
+ </tr>
+ <tr>
+ <td class="subtitle">PLC MODE</td>
+ <td>
+ <table width="80%" border=0 cellpadding=0 cellspacing=0>
+ <?php if ($mode=="master") { ?>
+ <tr>
+ <td class="data"><input class="text" type="radio" name="modex" value="MASTER" CHECKED>MASTER</td>
+ <td class="data"><input class="text" type="radio" name="modex" value="SLAVE">SLAVE</td>
+ <td class="data"><input class="text" type="radio" name="modex" value="ADHOC">ADHOC</td>
+ </tr>
+ <?php }
+ if ($mode=="slave") { ?>
+ <tr>
+ <td class="data"><input class="text" type="radio" name="modex" value="MASTER">MASTER</td>
+ <td class="data"><input class="text" type="radio" name="modex" value="SLAVE" CHECKED>SLAVE</td>
+ <td class="data"><input class="text" type="radio" name="modex" value="ADHOC">ADHOC</td>
+ </tr>
+ <?php }
+ if ($mode=="ad-hoc") { ?>
+ <tr>
+ <td class="data"><input class="text" type="radio" name="modex" value="MASTER">MASTER</td>
+ <td class="data"><input class="text" type="radio" name="modex" value="SLAVE">SLAVE</td>
+ <td class="data"><input class="text" type="radio" name="modex" value="AD-HOC" CHECKED>AD-HOC</td>
+ </tr>
+ <?php }?>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td> <br></td>
+ </tr>
+
+ <tr>
+ <td class="subtitle">Throughput control</td>
+ <?php
+ $filet=popen('tc qdisc show dev plc0 | grep tbf',"r");
+ $l=fgets($filet);
+ pclose($filet);
+ $tc_active=0;
+ $tc_rate_unit="Mbit";
+ if (!empty($l)) {
+ if (ereg("rate ([_0-9\.-]*)([a-zA-Z]*)", $l, $reg)) {
+ $tc_rate = $reg[1];
+ $tc_rate_unit = $reg[2];
+ }
+ $tc_active = 1;
+ }
+
+ if ($tc_active==1) { ?>
+ <td><table><tr>
+ <td class="data"><input class="text" type="radio" name="tc_cont" value="ACTIVE" CHECKED>TC ACTIVE</td>
+ <td class="data"><input class="text" type="radio" name="tc_cont" value="INACTIVE">TC INACTIVE</td>
+ </tr></table></td>
+ <?php } else { ?>
+ <td><table><tr>
+ <td class="data"><input class="text" type="radio" name="tc_cont" value="ACTIVE">TC ACTIVE</td>
+ <td class="data"><input class="text" type="radio" name="tc_cont" value="INACTIVE" CHECKED>TC INACTIVE</td>
+ </tr></table></td>
+ <?php } ?>
+ </tr>
+ <tr>
+ <td><table width="86%" border=0 cellpadding=0 cellspacing=0>
+ <tr>
+ <td class="data">Rate</td>
+ <td><input class="text" type="text" name="tc_rate" size=10 maxlength=10 value="<?=$tc_rate?>"></td>
+ <td><?=$tc_rate_unit?></td>
+ </tr></table></td>
+ </tr>
+ <tr>
+ <td><br></td>
+ </tr>
+
+ <tr>
+ <td><input class="submit" type="submit" name="submit" value="Save configuration"></td>
+ <td><input type="hidden" name="choice" value="<?=$choice?>"></td>
+ <td><input type="hidden" name="tc_rate_unit" value="<?=$tc_rate_unit?>"></td>
+ </tr>
+ </table>
+ </td>
+
+
+
+ <td><table class="dbtable" width="90%" border=0 cellpadding=0 cellspacing=0 align="center" valign="top">
+ <tr>
+ <td class="title" colspan="2">Activity - statistics</td>
+ </tr>
+ <tr>
+ <td COLSPAN=2><br></td>
+ </tr>
+ <tr>
+ <td class="data"></td>
+ <td><table width="45%" border=0 cellpadding=0 cellspacing=0>
+ <tr>
+ <td class="data1"><input class="text" type="text" name="dump" size=10 maxlength=10 value="RX" READONLY></td>
+ <td class="data1"><input class="text" type="text" name="dump" size=10 maxlength=10 value="TX" READONLY></td>
+ </tr>
+ </table></td>
+ </tr>
+
+ <tr>
+ <td class="data">PACKETS</td>
+ <td><table width="45%" border=0 cellpadding=0 cellspacing=0>
+ <tr>
+ <td class="data1"><input class="text" type="text" name="RxEpac" size=10 maxlength=10 value="<?=$RxEpac?>" READONLY></td>
+ <td class="data1"><input class="text" type="text" name="TxEpac" size=10 maxlength=10 value="<?=$TxEpac?>" READONLY></td>
+ </tr>
+ </table></td>
+ </tr>
+ <tr>
+ <td class="data">ERRORS</td>
+ <td><table width="45%" border=0 cellpadding=0 cellspacing=0>
+ <tr>
+ <td class="data1"><input class="text" type="text" name="RxEerr" size=10 maxlength=10 value="<?=$RxEerr?>" READONLY></td>
+ <td class="data1"><input class="text" type="text" name="TxEerr" size=10 maxlength=10 value="<?=$TxEerr?>" READONLY></td>
+ </tr>
+ </table></td>
+ </tr>
+ <tr>
+ <td class="data">Dropped PACKETs</td>
+ <td><table width="45%" border=0 cellpadding=0 cellspacing=0>
+ <tr>
+ <td class="data1"><input class="text" type="text" name="RxEdro" size=10 maxlength=10 value="<?=$RxEdro?>" READONLY></td>
+ <td class="data1"><input class="text" type="text" name="TxEdro" size=10 maxlength=10 value="<?=$TxEdro?>" READONLY></td>
+ </tr>
+ </table></td>
+ </tr>
+ <tr>
+ <td class="data">OVERRUNS</td>
+ <td><table width="45%" border=0 cellpadding=0 cellspacing=0>
+ <tr>
+ <td class="data1"><input class="text" type="text" name="RxEover" size=10 maxlength=10 value="<?=$RxEover?>" READONLY></td>
+ <td class="data1"><input class="text" type="text" name="TxEover" size=10 maxlength=10 value="<?=$TxEover?>" READONLY></td>
+ </tr>
+ </table></td>
+ </tr>
+ <tr>
+ <td class="data">FRAME</td>
+ <td><table width="45%" border=0 cellpadding=0 cellspacing=0>
+ <tr>
+ <td class="data1"><input class="text" type="text" name="RxEframe" size=10 maxlength=10 value="<?=$RxEframe?>" READONLY></td>
+ <td class="data1"><input class="text" type="text" name="dump" size=10 maxlength=10 value="" READONLY></td>
+ </tr>
+ </table></td>
+ </tr>
+ <tr>
+ <td class="data">CARRIERs</td>
+ <td><table width="45%" border=0 cellpadding=0 cellspacing=0>
+ <tr>
+ <td class="data1"><input class="text" type="text" name="dump" size=10 maxlength=10 value="" READONLY></td>
+ <td class="data1"><input class="text" type="text" name="TxEcar" size=10 maxlength=10 value="<?=$TxEcar?>" READONLY></td>
+ </tr>
+ </table></td>
+ </tr>
+ <tr>
+ <td class="data">Collisions</td>
+ <td><table width="45%" border=0 cellpadding=0 cellspacing=0>
+ <tr>
+ <td class="data1"><input class="text" type="text" name="dump" size=10 maxlength=10 value="" READONLY></td>
+ <td class="data1"><input class="text" type="text" name="TxEcoll" size=10 maxlength=10 value="<?=$TxEcoll?>" READONLY></td>
+ </tr>
+ </table></td>
+ </tr>
+ <tr>
+ <td class="data">Queue length</td>
+ <td><table width="45%" border=0 cellpadding=0 cellspacing=0>
+ <tr>
+ <td class="data1"><input class="text" type="text" name="dump" size=10 maxlength=10 value="" READONLY></td>
+ <td class="data1"><input class="text" type="text" name="TxEqlen" size=10 maxlength=10 value="<?=$TxEqlen?>" READONLY></td>
+ </tr>
+ </table></td>
+ </tr>
+ <tr>
+ <td class="data">BYTES</td>
+ <td><table width="45%" border=0 cellpadding=0 cellspacing=0>
+ <tr>
+ <td class="data1"><input class="text" type="text" name="RxEbytes" size=10 maxlength=10 value="<?=$RxEbytes?>" READONLY></td>
+ <td class="data1"><input class="text" type="text" name="TxEbytes" size=10 maxlength=10 value="<?=$TxEbytes?>" READONLY></td>
+ </tr>
+ </table></td>
+ </tr>
+ </table></td>
+<?php }
+
+
+
+
+if (choice=="br0 ") { ?>
+
+ <td><table class="dbtable" width="90%" border=0 cellpadding=0 cellspacing=0>
+ <tr>
+ <td class="title" COLSPAN=2 ALIGN="center">Global configuration</td>
+ </tr>
+ <tr>
+ <td class="subtitle">DHCP mode:</td>
+ <?php if ($dhcp==1) { ?>
+ <td><table width="100%" border=0 cellpadding=0 cellspacing=0 align="left">
+ <tr>
+ <td class="data"><input class="text" type="radio" name="dhcp_r" value="ON" CHECKED DISABLED>ON</td>
+ <td class="data"><input class="text" type="radio" name="dhcp_r" value="OFF" DISABLED>OFF</td>
+ </tr>
+ </table></td>
+ <?php } else { ?>
+ <td><table width="100%" border=0 cellpadding=0 cellspacing=0 align="left">
+ <tr>
+ <td class="data"><input class="text" type="radio" name="dhcp_r" value="ON" DISABLED>ON</td>
+ <td class="data"><input class="text" type="radio" name="dhcp_r" value="OFF" CHECKED DISABLED>OFF</td>
+ </tr>
+ </table></td>
+ <?php } ?>
+ </tr>
+
+ <?php
+ filet=popen("cat /etc/config/network","r");
+ while(!feof(filet)){
+ l=fgets(filet);
+ if(ereg("NETWORKING=([a-zA-Z]*)",l,$reg)) {
+ $NETWORKING=$reg[1];
+ }
+ if(ereg("FORWARD_IPV4=([a-zA-Z]*)",l,$reg)) {
+ $FORWARD_IPvV4=$reg[1];
+ }
+ if(ereg("BRIDGING=([a-zA-Z]*)",l,$reg)) {
+ $BRIDGING=$reg[1];
+ }
+ if(ereg("STP=([a-zA-Z]*)",l,$reg)) {
+ $STP=$reg[1];
+ }
+ }
+ pclose(filet);
+ ?>
+
+ <tr>
+ <td class="subtitle">Networking</td>
+ <?php if ($NETWORKING=="yes") {?>
+ <td><table width="100%" border=0 cellpadding=0 cellspacing=0>
+ <tr>
+ <td class="data"><input class="text" type="radio" name="NETWORKING_r" value="ON" CHECKED DISABLED>ON</td>
+ <td class="data"><input class="text" type="radio" name="NETWORKING_r" value="OFF" DISABLED>OFF</td>
+ </tr>
+ </table></td>
+ <?php } else { ?>
+ <td><table width="100%" border=0 cellpadding=0 cellspacing=0>
+ <tr>
+ <td class="data"><input class="text" type="radio" name="NETWORKING_r" value="ON" DISABLED>ON</td>
+ <td class="data"><input class="text" type="radio" name="NETWORKING_r" value="OFF" CHECKED DISABLED>OFF</td>
+ </tr>
+ </table></td>
+ <?php } ?>
+ </tr>
+
+ <tr>
+ <td class="subtitle">Forward IPv4</td>
+ <?php if ($FORWARD_IPV4=="yes") {?>
+ <td><table width="100%" border=0 cellpadding=0 cellspacing=0>
+ <tr>
+ <td class="data"><input class="text" type="radio" name="FORWARD_IPV4_r" value="ON" CHECKED DISABLED>ON</td>
+ <td class="data"><input class="text" type="radio" name="FORWARD_IPV4_r" value="OFF" DISABLED>OFF</td>
+ </tr>
+ </table></td>
+ <?php } else { ?>
+ <td><table width="100%" border=0 cellpadding=0 cellspacing=0>
+ <tr>
+ <td class="data"><input class="text" type="radio" name="FORWARD_IPV4_r" value="ON" DISABLED>ON</td>
+ <td class="data"><input class="text" type="radio" name="FORWARD_IPV4_r" value="OFF" CHECKED DISABLED>OFF</td>
+ </tr>
+ </table></td>
+ <?php } ?>
+ </tr>
+
+ <tr>
+ <td class="subtitle">BRIDGING</td>
+ <?php if ($BRIDGING=="yes") {?>
+ <td><table width="100%" border=0 cellpadding=0 cellspacing=0>
+ <tr>
+ <td class="data"><input class="text" type="radio" name="BRIDGING_r" value="ON" CHECKED >ON</td>
+ <td class="data"><input class="text" type="radio" name="BRIDGING_r" value="OFF" >OFF</td>
+ </tr>
+ </table></td>
+ <?php } else { ?>
+ <td><table width="100%" border=0 cellpadding=0 cellspacing=0>
+ <tr>
+ <td class="data"><input class="text" type="radio" name="BRIDGING_r" value="ON" >ON</td>
+ <td class="data"><input class="text" type="radio" name="BRIDGING_r" value="OFF" CHECKED >OFF</td>
+ </tr>
+ </table></td>
+ <?php } ?>
+ </tr>
+
+ <tr>
+ <td class="subtitle">STP</td>
+ <?php if ($STP=="yes") { ?>
+ <td><table width="100%" border=0 cellpadding=0 cellspacing=0>
+ <tr>
+ <td class="data"><input class="text" type="radio" name="STP_r" value="ON" CHECKED DISABLED> ON</td>
+ <td class="data"><input class="text" type="radio" name="STP_r" value="OFF" DISABLED> OFF</td>
+ </tr>
+ </table></td>
+ <?php } else { ?>
+ <td><table width="100%" border=0 cellpadding=0 cellspacing=0>
+ <tr>
+ <td class="data"><input class="text" type="radio" name="STP_r" value="ON" DISABLED> ON</td>
+ <td class="data"><input class="text" type="radio" name="STP_r" value="OFF" CHECKED DISABLED> OFF</td>
+ </tr>
+ </table></td>
+ <?php } ?>
+ </tr>
+
+ <tr>
+ <td><br></td>
+ </tr>
+ </table>
+ <table class="dbtable" width="70%" border=0 cellpadding=0 cellspacing=0>
+ <tr>
+ <td class="title" align="center" colspan="2">Bridge configuration</td>
+ </tr>
+ <tr>
+ <td class="subtitle">Network configuration</td>
+ </tr>
+ <tr>
+ <td class="data">Current IP address</td>
+ <td><table width="50%" border=0 cellpadding=0 cellspacing=0>
+ <tr>
+ <td class="data1"> <input class="text" type="text" name="IPb1" <?php if($dhcp) print "disabled"; ?> size=3 maxlength=3 value="<?=$IPb1?>"></td>
+ <td class="data1"> <input class="text" type="text" name="IPb2" <?php if($dhcp) print "disabled"; ?> size=3 maxlength=3 value="<?=$IPb2?>"></td>
+ <td class="data1"> <input class="text" type="text" name="IPb3" <?php if($dhcp) print "disabled"; ?> size=3 maxlength=3 value="<?=$IPb3?>"></td>
+ <td class="data1"> <input class="text" type="text" name="IPb4" <?php if($dhcp) print "disabled"; ?> size=3 maxlength=3 value="<?=$IPb4?>"></td>
+ </tr>
+ </table></td>
+ </tr>
+ <tr>
+ <td class="data">Current NET mask</td>
+ <td><table width="50%" border=0 cellpadding=0 cellspacing=0>
+ <tr>
+ <td class="data1"> <input class="text" type="text" name="NETb1" <?php if($dhcp) print "disabled"; ?> size=3 maxlength=3 value="<?=$NETb1?>"></td>
+ <td class="data1"> <input class="text" type="text" name="NETb2" <?php if($dhcp) print "disabled"; ?> size=3 maxlength=3 value="<?=$NETb2?>"></td>
+ <td class="data1"> <input class="text" type="text" name="NETb3" <?php if($dhcp) print "disabled"; ?> size=3 maxlength=3 value="<?=$NETb3?>"></td>
+ <td class="data1"> <input class="text" type="text" name="NETb4" <?php if($dhcp) print "disabled"; ?> size=3 maxlength=3 value="<?=$NETb4?>"></td>
+ </tr>
+ </table></td>
+ </tr>
+ <tr>
+ <td class="data">Current gateway address</td>
+ <td><table width="50%" border=0 cellpadding=0 cellspacing=0>
+ <tr>
+ <td class="data1"> <input class="text" type="text" name="gtewayb1" <?php if($dhcp) print "disabled"; ?> size=3 maxlength=3 value="<?=$gtewayb1?>"></td>
+ <td class="data1"> <input class="text" type="text" name="gtewayb2" <?php if($dhcp) print "disabled"; ?> size=3 maxlength=3 value="<?=$gtewayb2?>"></td>
+ <td class="data1"> <input class="text" type="text" name="gtewayb3" <?php if($dhcp) print "disabled"; ?> size=3 maxlength=3 value="<?=$gtewayb3?>"></td>
+ <td class="data1"> <input class="text" type="text" name="gtewayb4" <?php if($dhcp) print "disabled"; ?> size=3 maxlength=3 value="<?=$gtewayb4?>"></td>
+ </tr>
+ </table></td>
+ </tr>
+ <tr>
+ <td><br></td>
+ </tr>
+ <tr>
+ <td class="data"><input class="submit" type="submit" name="submit" value="Save configuration"></td>
+ <td><input type="hidden" name="choice" value="<?=$choice?>"></td>
+ <td><input type="hidden" name="pdhcp" value="<?=$pdhcp?>"></td>
+ <td><input type="hidden" name="IPxb" value="<?=$IPxb?>"></td>
+ <td><input type="hidden" name="GTb" value="<?=$GTb?>"></td>
+ <td><input type="hidden" name="Nb" value="<?=$Nb?>"></td>
+ <td><input type="hidden" name="BRIDGING" value="<?=$BRIDGING?>"></td>
+ </tr>
+ </table></td>
+
+ <td><table class="dbtable" width="80%" border=0 cellpadding=0 cellspacing=0 align="center" valign="top">
+ <tr>
+ <td class="title" COLSPAN=2>Activity - statistics</td>
+ </tr>
+
+ <tr>
+ <td COLSPAN=2><br></td>
+ </tr>
+ <tr>
+ <td class="data"></td>
+ <td><table width="45%" border=0 cellpadding=0 cellspacing=0>
+ <tr>
+ <td class="data1"><input class="text" type="text" name="dump" size=10 maxlength=10 value="RX" READONLY></td>
+ <td class="data1"><input class="text" type="text" name="dump" size=10 maxlength=10 value="TX" READONLY></td>
+ </tr>
+ </table></td>
+ </tr>
+ <tr>
+ <td class="data">PACKETS</td>
+ <td><table width="45%" border=0 cellpadding=0 cellspacing=0>
+ <tr>
+ <td class="data1"><input class="text" type="text" name="RxEpac" size=10 maxlength=10 value="<?=$RxEpac?>" READONLY></td>
+ <td class="data1"><input class="text" type="text" name="TxEpac" size=10 maxlength=10 value="<?=$TxEpac?>" READONLY></td>
+ </tr>
+ </table></td>
+ </tr>
+ <tr>
+ <td class="data">ERRORS</td>
+ <td><table width="45%" border=0 cellpadding=0 cellspacing=0>
+ <tr>
+ <td class="data1"><input class="text" type="text" name="RxEerr" size=10 maxlength=10 value="<?=$RxEerr?>" READONLY></td>
+ <td class="data1"><input class="text" type="text" name="TxEerr" size=10 maxlength=10 value="<?=$TxEerr?>" READONLY></td>
+ </tr>
+ </table></td>
+ </tr>
+ <tr>
+ <td class="data">Dropped PACKETs</td>
+ <td><table width="45%" border=0 cellpadding=0 cellspacing=0>
+ <tr>
+ <td class="data1"><input class="text" type="text" name="RxEdro" size=10 maxlength=10 value="<?=$RxEdro?>" READONLY></td>
+ <td class="data1"><input class="text" type="text" name="TxEdro" size=10 maxlength=10 value="<?=$TxEdro?>" READONLY></td>
+ </tr>
+ </table></td>
+ </tr>
+ <tr>
+ <td class="data">OVERRUNS</td>
+ <td><table width="45%" border=0 cellpadding=0 cellspacing=0>
+ <tr>
+ <td class="data1"><input class="text" type="text" name="RxEover" size=10 maxlength=10 value="<?=$RxEover?>" READONLY></td>
+ <td class="data1"><input class="text" type="text" name="TxEover" size=10 maxlength=10 value="<?=$TxEover?>" READONLY></td>
+ </tr>
+ </table></td>
+ </tr>
+ <tr>
+ <td class="data">FRAME</td>
+ <td><table width="45%" border=0 cellpadding=0 cellspacing=0>
+ <tr>
+ <td class="data1"><input class="text" type="text" name="RxEframe" size=10 maxlength=10 value="<?=$RxEframe?>" READONLY></td>
+ <td class="data1"><input class="text" type="text" name="dump" size=10 maxlength=10 value="" READONLY></td>
+ </tr>
+ </table></td>
+ </tr>
+ <tr>
+ <td class="data">CARRIERs</td>
+ <td><table width="45%" border=0 cellpadding=0 cellspacing=0>
+ <tr>
+ <td class="data1"><input class="text" type="text" name="dump" size=10 maxlength=10 value="" READONLY></td>
+ <td class="data1"><input class="text" type="text" name="TxEcar" size=10 maxlength=10 value="<?=$TxEcar?>" READONLY></td>
+ </tr>
+ </table></td>
+ </tr>
+ <tr>
+ <td class="data">Collisions</td>
+ <td><table width="45%" border=0 cellpadding=0 cellspacing=0>
+ <tr>
+ <td class="data1"><input class="text" type="text" name="dump" size=10 maxlength=10 value="" READONLY></td>
+ <td class="data1"><input class="text" type="text" name="TxEcoll" size=10 maxlength=10 value="<?=$TxEcoll?>" READONLY></td>
+ </tr>
+ </table></td>
+ </tr>
+ <tr>
+ <td class="data">Queue length</td>
+ <td><table width="45%" border=0 cellpadding=0 cellspacing=0>
+ <tr>
+ <td class="data1"><input class="text" type="text" name="dump" size=10 maxlength=10 value="" DISABLED></td>
+ <td class="data1"><input class="text" type="text" name="TxEqlen" size=10 maxlength=10 value="<?=$TxEqlen?>" READONLY></td>
+ </tr>
+ </table></td>
+ </tr>
+ <tr>
+ <td class="data">BYTES</td>
+ <td><table width="45%" border=0 cellpadding=0 cellspacing=0>
+ <tr>
+ <td class="data1"><input class="text" type="text" name="RxEbytes" size=10 maxlength=10 value="<?=$RxEbytes?>" READONLY></td>
+ <td class="data1"><input class="text" type="text" name="TxEbytes" size=10 maxlength=10 value="<?=$TxEbytes?>" READONLY></td>
+ </tr>
+ </table></td>
+ </tr>
+ </table></td>
+<?php } ?>
+
+</form></tr>
+
+ <tr>
+ <form name="reboot" action="reboot.html" METHOD="GET">
+ <table class="dbtable" border=0 cellpadding=0 cellspacing=0 width=20% align=right valign=bottom><tr>
+ <td><input class="submit" type="submit" name="reboot" value="Restart the modem"></td>
+ <td><input type="hidden" name="IPb" value="<?=$IPb?>"></td>
+ </tr>
+ </table>
+ </form>
+ </tr>
+
+ <script language="JavaScript1.2">
+/*Number check script-
+By JavaScript Kit (www.javascriptkit.com)
+Over 200 free scripts here!
+*/
+
+function checknumber(){
+//var x=document.checknum.pnum.value
+ var IPparam=new Array(12);
+ var dh = <?php echo $dhcp; ?>
+ if (document.cIP.choice.value=="eth0"){
+ IPparam[0]=document.cIP.IPe1.value;
+ IPparam[1]=document.cIP.IPe2.value;
+ IPparam[2]=document.cIP.IPe3.value;
+ IPparam[3]=document.cIP.IPe4.value;
+ IPparam[4]=document.cIP.NETe1.value;
+ IPparam[5]=document.cIP.NETe2.value;
+ IPparam[6]=document.cIP.NETe3.value;
+ IPparam[7]=document.cIP.NETe4.value;
+ IPparam[8]=document.cIP.gtewaye1.value;
+ IPparam[9]=document.cIP.gtewaye2.value;
+ IPparam[10]=document.cIP.gtewaye3.value;
+ IPparam[11]=document.cIP.gtewaye4.value;
+ }
+ if (document.cIP.choice.value=="plc0"){
+ IPparam[0]=document.cIP.IPp1.value;
+ IPparam[1]=document.cIP.IPp2.value;
+ IPparam[2]=document.cIP.IPp3.value;
+ IPparam[3]=document.cIP.IPp4.value;
+ IPparam[4]=document.cIP.NETp1.value;
+ IPparam[5]=document.cIP.NETp2.value;
+ IPparam[6]=document.cIP.NETp3.value;
+ IPparam[7]=document.cIP.NETp4.value;
+ IPparam[8]=document.cIP.gtewayp1.value;
+ IPparam[9]=document.cIP.gtewayp2.value;
+ IPparam[10]=document.cIP.gtewayp3.value;
+ IPparam[11]=document.cIP.gtewayp4.value;
+ }
+ if (document.cIP.choice.value=="br0 "){
+ IPparam[0]=document.cIP.IPb1.value;
+ IPparam[1]=document.cIP.IPb2.value;
+ IPparam[2]=document.cIP.IPb3.value;
+ IPparam[3]=document.cIP.IPb4.value;
+ IPparam[4]=document.cIP.NETb1.value;
+ IPparam[5]=document.cIP.NETb2.value;
+ IPparam[6]=document.cIP.NETb3.value;
+ IPparam[7]=document.cIP.NETb4.value;
+ IPparam[8]=document.cIP.gtewayb1.value;
+ IPparam[9]=document.cIP.gtewayb2.value;
+ IPparam[10]=document.cIP.gtewayb3.value;
+ IPparam[11]=document.cIP.gtewayb4.value;
+ }
+ var brojko=0;
+ testresult=true
+ var anum=/(^\d+$)|(^\d+\.\d+$)/
+
+for (brojko=0;brojko<11;brojko++){
+ x=IPparam[brojko];
+ if (anum.test(x)){
+ if (x<0) {
+ alert("Please input a valid number between 0 and 255!")
+ testresult=false
+ }
+ if (x>255){
+ alert("Please input a valid number between 0 and 255!")
+ testresult=false
+ }
+ }
+else{
+ if (IPparam[brojko]!="") {
+ alert("Please input a valid number between 0 and 255!")
+ testresult=false
+ }
+}
+}
+
+if (dh==0){
+ if ((IPparam[0] & IPparam[4])!=(IPparam[8] & IPparam[4])) {
+ alert("Error: IP and gateway must be in the same network segment")
+ testresult=false
+}
+ if ((IPparam[1] & IPparam[5])!=(IPparam[9] & IPparam[5])) {
+ alert("Error: IP and gateway must be in the same network segment")
+ testresult=false
+}
+ if ((IPparam[2] & IPparam[6])!=(IPparam[10] & IPparam[6])) {
+ alert("Error: IP and gateway must be in the same network segment")
+ testresult=false
+}
+ if ((IPparam[3] & IPparam[7])!=(IPparam[11] & IPparam[7])) {
+ alert("Error: IP and gateway must be in the same network segment")
+ testresult=false
+ }
+}
+return (testresult)
+}
+
+</script>
+
+<script>
+function checkban(){
+if (document.layers||document.all||document.getElementById)
+return checknumber()
+else
+return true
+}
+
+
+
+
+</script>
+<iframe src="calcul.php?choice=<?=$choice?>" width="0" height="0"></iframe>
+
+ </table>
+ </body>
+ </html>
diff --git a/polux/application/boa/spc200/www/disclaimer.html b/polux/application/boa/spc200/www/disclaimer.html
new file mode 100755
index 0000000000..f83ec0f0b3
--- /dev/null
+++ b/polux/application/boa/spc200/www/disclaimer.html
@@ -0,0 +1,8 @@
+<HTML>
+<p align="center"><A HREF="https://www.spidcom.com"><IMG SRC="/logo-spidcom.jpg" BORDER=0></IMG></A></p>
+<p>
+<table bgcolor="#ffaaaa" width=100%><TR><TD align="center">
+ <i><b>This is DEMO version of Web Interface created using Spidcom uPHP technology</b></i></p>
+</TD></TR></table>
+</body>
+</HTML>
diff --git a/polux/application/boa/spc200/www/index.html b/polux/application/boa/spc200/www/index.html
new file mode 100755
index 0000000000..3fd21f6701
--- /dev/null
+++ b/polux/application/boa/spc200/www/index.html
@@ -0,0 +1,10 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
+ <html>
+ <head>
+ <title>SPIDCOM Technologies changes</title>
+ </head>
+<html>
+ <FRAMESET cols="100%, *">
+ <FRAME src="/cgi-bin/mon.html" name="net_master" marginwidth="5" marginheight="5" scrolling="no">
+ </FRAMESET>
+ </html>
diff --git a/polux/application/boa/spc200/www/logo-spidcom.jpg b/polux/application/boa/spc200/www/logo-spidcom.jpg
new file mode 100755
index 0000000000..8d8b7f77c9
--- /dev/null
+++ b/polux/application/boa/spc200/www/logo-spidcom.jpg
Binary files differ
diff --git a/polux/application/boa/spc200/www/spidcom.gif b/polux/application/boa/spc200/www/spidcom.gif
new file mode 100755
index 0000000000..6bf1629a29
--- /dev/null
+++ b/polux/application/boa/spc200/www/spidcom.gif
Binary files differ