diff -r 000000000000 -r 3da2a79470a7 testtoolsconn/wintap/utils/commdbupdate.pl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/testtoolsconn/wintap/utils/commdbupdate.pl Mon Mar 08 15:04:18 2010 +0800 @@ -0,0 +1,135 @@ +# +# Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# + + +$#ARGV==6 or die "7 arguments required"; + +my $input = $ARGV[0]; +my $output = $ARGV[1]; +my $ipAddress = $ARGV[2]; +my $ipGateway = $ARGV[3]; +my $ipMask = $ARGV[4]; +my $ipDNS = $ARGV[5]; +my $IpAddrFromServer = $ARGV[6]; + +my $writeEnabled = 1; + +open INPUT, "<$input" or die "Cannot open $input: $!"; +open OUTPUT,">$output" or die "Cannot open $output: $!"; + +my $iapTable = < + Ethernet WinTAP + LANService.Ethernet WinTAP + LANBearer.Ethernet WinTAP + Network.Intranet + 0 + Location.Office + +END + +my $lanBearerTable = < + Ethernet WinTAP + nullagt.agt + ethint + enet + =Ethernet + ethertap + Ethertap.Wins + EtherPkt.drv + -1 + -1 + -1 + +END + +my $lanServiceTable = < + Ethernet WinTAP + ip + $ipMask + $ipGateway + FALSE + $ipAddress + $IpAddrFromServer + $ipDNS + 10.23.58.12 + FALSE + +END + +my $connectionPreferencesTable = < + ConnectionPreferencesTable1 + 1 + OUTGOING + LAN + PROMPT + IAP.Ethernet WinTAP + +END + +while () +{ + if($writeEnabled == 1) + { + print OUTPUT; + } + + #add IAPTable + if(//) + { + print " found..."; + print OUTPUT $iapTable; + print "updated\n"; + } + + #add LANBearerTable + if(//) + { + print " found..."; + print OUTPUT $lanBearerTable; + print "updated\n"; + } + + #add LANServiceTable + if(//) + { + print " found..."; + print OUTPUT $lanServiceTable; + print "updated\n"; + } + + #add ConnectionPreferencesTable + if(//) + { + $writeEnabled = 0; + print " found..."; + print OUTPUT $connectionPreferencesTable; + } + + if(/<\/ConnectionPreferencesTable>/) + { + $writeEnabled = 1; + print OUTPUT; + print "updated\n"; + } + +} + +close INPUT; +close OUTPUT; \ No newline at end of file