[arachne] wifi dialer

Arachne at FreeLists---The Arachne Fan Club!

Hi folks, 

let me present to you my latest creation: the wifi "dialer". 
What is a wifi dialer? A small script that prevents Arachne 
from renew the wireless connection to the dhcp server too often. 
"Dialing" gets the dynamic IP address from the dhcp server  
and fakes the settings in arachne.cfg and wattcp.cfg as if 
it were a static IP. "Hangup" empties wattcp.cfg, so that there 
will be no connection until the wifidialer does another 
initialization. This workaround does every bootp/dhcp only 
externally, although Arachne is able to communicate with the 
dhcp server. The connection will be interrupted only if the 
IP address expires on the server. 


---------- arachne.cfg -----------
Connection READY
Dialer @call wifidial.bat /u
Hangup @call wifidial.bat /d

[tcp/ip]
IP_Address WATTCP
IP_Grab 
NameServer 
AltNameServer 
Gateway 
AltGateway 
Netmask 
TCPconfig WIFI.CFG
---------------------------------------


----------- wifidial.bat --------------
@echo off
:: USAGE: WIFIDIAL /U | /D
:: get dynamic IP address from dhcp server and rewrite wattcp.cfg
:: with faked static IP address

for %%i in (u U d D) do if "%1"=="/%%i" goto %%i
goto done

:u = up ("dial")
tcpinfo.exe > wifi.log
type wifi.log|xgrep "IP Address *:"|
  sed -e 's/.*:/my_ip =/' > wifi.cfg
type wifi.log|xgrep "Network Mask *:"|
  sed -e 's/.*:/netmask =/' >> wifi.cfg
type wifi.log|xgrep "Nameserver *:"|
  sed -e 's/.*:/nameserver =/;s/ Time.*//' >> wifi.cfg
type wifi.log|xgrep "DEFAULT"|
  sed -e 's/.*:/gateway =/;s/ *DEFAULT//g' >> wifi.cfg
goto done

:d = down ("hangup")
rem>wifi.cfg
goto done

:done
----------------------------------------------

The script requires tcpinfo.exe and the text utilities xgrep and sed
to be available in the path. Lines above that begin with the sed 
command belong together with the previous line. wifi.cfg must exist 
in Arachne's main directory. It should be an empty file in the 
beginning. 

The script works quite well when I shell out from Arachne. After 
returning to the browser Arachne has already read the new settings 
from wifi.cfg. Arachne crashes when I link the script to Arachne's 
dial and hangup hotkeys as suggested above: 

    Dialer @call wifidial.bat /u
    Hangup @call wifidial.bat /d

This has probably to do with memory. 

I have the impression, other internet applications working with 
WATTCP.CFG do not need this kind of workaround. Either they are 
able to initialize the connection faster or they do not do it 
so frequently. 

Regards, 
Christof

________________________________________________________________

Ceskobratrska cirkev evangelicka - Betlemska kaple na Zizkove
Prokopova 4/216, 130 00 Praha  3, Czech Republic
Tel. (+420) 222 78 06 73 / 222 78 20 02 / 603 18 87 53
http://www.volny.cz/cce.zizkov
                  Arachne at FreeLists                  
-- Arachne, The Premier GPL Web Browser/Suite for DOS --

Other related posts: