summaryrefslogtreecommitdiff
path: root/noncore/settings/networksettings2/main.cpp
authorwimpie <wimpie>2005-01-11 15:35:46 (UTC)
committer wimpie <wimpie>2005-01-11 15:35:46 (UTC)
commit4c4cdd76caea5a8be4a971892375c7c6b4f4a8b9 (patch) (unidiff)
tree0e8adcc616a1d20b637aad3de568dcb45af05f71 /noncore/settings/networksettings2/main.cpp
parent32e8aa951218c0bd6118ee04bb22ef83b3b7ec2e (diff)
downloadopie-4c4cdd76caea5a8be4a971892375c7c6b4f4a8b9.zip
opie-4c4cdd76caea5a8be4a971892375c7c6b4f4a8b9.tar.gz
opie-4c4cdd76caea5a8be4a971892375c7c6b4f4a8b9.tar.bz2
vpn should now work IF only the vpn plugin would do something.
shortened logical interface names (busybox only supports 10 characters and then ONLY if you recompile it with mappings enabled) Other small fixes
Diffstat (limited to 'noncore/settings/networksettings2/main.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/networksettings2/main.cpp48
1 files changed, 32 insertions, 16 deletions
diff --git a/noncore/settings/networksettings2/main.cpp b/noncore/settings/networksettings2/main.cpp
index 973b4b7..2243826 100644
--- a/noncore/settings/networksettings2/main.cpp
+++ b/noncore/settings/networksettings2/main.cpp
@@ -25,6 +25,8 @@ OPIE_EXPORT_APP( OApplicationFactory<NetworkSettings> )
25#define ACT_PROMPT 3 25#define ACT_PROMPT 3
26// used by interfaces to trigger VPN 26// used by interfaces to trigger VPN prompting
27#define ACT_VPN 4 27#define ACT_TRIGGERVPN 4
28// activate opietooth 28// activate opietooth
29#define ACT_OT 5 29#define ACT_OT 5
30// prompt for VPN networks
31#define ACT_PROMPTVPN 6
30 32
@@ -58,3 +60,7 @@ int main( int argc, char * argv[] ) {
58 } else if( strcmp( argv[i], "--triggervpn" ) == 0 ) { 60 } else if( strcmp( argv[i], "--triggervpn" ) == 0 ) {
59 Action = ACT_VPN; 61 GuiType = QApplication::Tty;
62 Action = ACT_TRIGGERVPN;
63 rmv = 1;
64 } else if( strcmp( argv[i], "--promptvpn" ) == 0 ) {
65 Action = ACT_PROMPTVPN;
60 rmv = 1; 66 rmv = 1;
@@ -97,11 +103,20 @@ int main( int argc, char * argv[] ) {
97 if( NS.canStart( argv[1] ) ) { 103 if( NS.canStart( argv[1] ) ) {
104 QStringList SL;
105 SL << QPEApplication::qpeDir() + "bin/networksettings2"
106 << "--prompt"
107 << argv[1];
108 // exec synchronous -> blocks
109 NSResources->system().execAsUser( SL, 1 );
110 }
111 }
112 break;
113 case ACT_TRIGGERVPN :
114 { NetworkSettingsData NS;
115 if( NS.couldBeTriggered( argv[1] ) ) {
116 // there are VPNS that can be triggered
98 QStringList S; 117 QStringList S;
99 S << QPEApplication::qpeDir() + "/bin/networksettings2"; 118 S << QPEApplication::qpeDir() + "bin/networksettings2";
100 S << "networksettings2"; 119 S << "--promptvpn";
101 S << "--prompt";
102 S << argv[1]; 120 S << argv[1];
103 NSResources->system().execAsUser( S ); 121 NSResources->system().execAsUser( S );
104 Log(("FAILED %s-cNN-allowed\n", argv[1] ));
105 // if we come here , failed
106 printf( "%s-cNN-disallowed", argv[1] );
107 } 122 }
@@ -119,8 +134,8 @@ int main( int argc, char * argv[] ) {
119 if( AP.exec() == QDialog::Accepted ) { 134 if( AP.exec() == QDialog::Accepted ) {
120 Log(("%s-c%ld-allowed\n", 135 Log(("allow profile %ld for %s\n",
121 argv[1], AP.selectedProfile() )); 136 AP.selectedProfile(), argv[1] ));
122 printf( "%s-c%ld-allowed", argv[1], AP.selectedProfile() ); 137 printf( "A%ld%s\n", AP.selectedProfile(), argv[1] );
123 } else { 138 } else {
124 Log(("%s-c%NN-disallowed\n", argv[1] )); 139 Log(("disallow %s\n", argv[1] ));
125 printf( "%s-cNN-disallowed", argv[1] ); 140 printf( "D-%s\n", argv[1] );
126 } 141 }
@@ -128,4 +143,5 @@ int main( int argc, char * argv[] ) {
128 break; 143 break;
129 case ACT_VPN : 144 case ACT_PROMPTVPN :
130 { ActivateVPN AVPN; 145 { ActivateVPN AVPN( argv[1] );
146 Log(("Trigger vpns on interface %s\n", argv[1] ));
131 AVPN.exec(); 147 AVPN.exec();