author | kergoth <kergoth> | 2003-08-09 17:14:54 (UTC) |
---|---|---|
committer | kergoth <kergoth> | 2003-08-09 17:14:54 (UTC) |
commit | a7e015198a8c5ad3b6e144a9032b059086253e00 (patch) (unidiff) | |
tree | b712b6f11310d88744fe393a92b3160b741a7efe /noncore/settings/networksettings/ppp/pppdata.h | |
parent | beba0e73306815337bf04dee39502233595e9739 (diff) | |
download | opie-a7e015198a8c5ad3b6e144a9032b059086253e00.zip opie-a7e015198a8c5ad3b6e144a9032b059086253e00.tar.gz opie-a7e015198a8c5ad3b6e144a9032b059086253e00.tar.bz2 |
Merge from BRANCH_1_0
Diffstat (limited to 'noncore/settings/networksettings/ppp/pppdata.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/networksettings/ppp/pppdata.h | 47 |
1 files changed, 38 insertions, 9 deletions
diff --git a/noncore/settings/networksettings/ppp/pppdata.h b/noncore/settings/networksettings/ppp/pppdata.h index 6e1379d..d1cbeb5 100644 --- a/noncore/settings/networksettings/ppp/pppdata.h +++ b/noncore/settings/networksettings/ppp/pppdata.h | |||
@@ -19,420 +19,449 @@ | |||
19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
21 | * Library General Public License for more details. | 21 | * Library General Public License for more details. |
22 | * | 22 | * |
23 | * You should have received a copy of the GNU Library General Public | 23 | * You should have received a copy of the GNU Library General Public |
24 | * License along with this program; if not, write to the Free | 24 | * License along with this program; if not, write to the Free |
25 | * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | 25 | * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
26 | */ | 26 | */ |
27 | 27 | ||
28 | #ifndef _PPPDATA_H_ | 28 | #ifndef _PPPDATA_H_ |
29 | #define _PPPDATA_H_ | 29 | #define _PPPDATA_H_ |
30 | 30 | ||
31 | #include <unistd.h> | 31 | #include <unistd.h> |
32 | #include <sys/types.h> | 32 | #include <sys/types.h> |
33 | 33 | ||
34 | #include <qcolor.h> | 34 | #include <qcolor.h> |
35 | #include <qmap.h> | 35 | #include <qmap.h> |
36 | #include <qstring.h> | 36 | #include <qstring.h> |
37 | #include <qstringlist.h> | 37 | #include <qstringlist.h> |
38 | 38 | ||
39 | #include "kpppconfig.h" | 39 | #include "kpppconfig.h" |
40 | 40 | ||
41 | class Config; | 41 | class Config; |
42 | 42 | ||
43 | // string lengths | 43 | // string lengths |
44 | 44 | ||
45 | #define PATH_SIZE 120 | 45 | #define PATH_SIZE 120 |
46 | #define MODEMSTR_SIZE 80 | 46 | #define MODEMSTR_SIZE 80 |
47 | #define ACCNAME_SIZE 50 | 47 | #define ACCNAME_SIZE 50 |
48 | #define PHONENUMBER_SIZE 60 | 48 | #define PHONENUMBER_SIZE 60 |
49 | #define COMMAND_SIZE 255 | 49 | #define COMMAND_SIZE 255 |
50 | #define IPADDR_SIZE 15 | 50 | #define IPADDR_SIZE 15 |
51 | #define DOMAIN_SIZE 50 | 51 | #define DOMAIN_SIZE 50 |
52 | #define TIMEOUT_SIZE 60 | 52 | #define TIMEOUT_SIZE 60 |
53 | 53 | ||
54 | // | 54 | // |
55 | // keys for config file | 55 | // keys for config file |
56 | // | 56 | // |
57 | 57 | ||
58 | // groups | 58 | // groups |
59 | #define GENERAL_GRP "PPP_General" | 59 | #define GENERAL_GRP "PPP_General" |
60 | #define MODEM_GRP "PPP_Modem" | 60 | #define MODEM_GRP "PPP_Modem" |
61 | #define ACCOUNT_GRP "PPP_Account" | 61 | #define ACCOUNT_GRP "PPP_Account" |
62 | #define ACCLIST_GRP "PPP_Accounts_List" | 62 | #define ACCLIST_GRP "PPP_Accounts_List" |
63 | //#define GRAPH_GRP "Graph" | 63 | //#define GRAPH_GRP "Graph" |
64 | //#define WINPOS_GRP "WindowPosition" | 64 | //#define WINPOS_GRP "WindowPosition" |
65 | 65 | ||
66 | // general | 66 | // general |
67 | #define ACCOUNT_LIST "AccountList" | ||
68 | #define DEVICE_LIST "DeviceList" | ||
67 | #define DEFAULTACCOUNT_KEY "DefaultAccount" | 69 | #define DEFAULTACCOUNT_KEY "DefaultAccount" |
68 | #define PPPDVERSION_KEY "pppdVersion" | 70 | #define PPPDVERSION_KEY "pppdVersion" |
69 | #define PPPDTIMEOUT_KEY "pppdTimeout" | 71 | #define PPPDTIMEOUT_KEY "pppdTimeout" |
70 | #define SHOWCLOCK_KEY "ShowClock" | 72 | #define SHOWCLOCK_KEY "ShowClock" |
71 | #define SHOWLOGWIN_KEY "ShowLogWindow" | 73 | #define SHOWLOGWIN_KEY "ShowLogWindow" |
72 | #define AUTOREDIAL_KEY "AutomaticRedial" | 74 | #define AUTOREDIAL_KEY "AutomaticRedial" |
73 | #define DISCONNECT_KEY "DisconnectOnXServerExit" | 75 | #define DISCONNECT_KEY "DisconnectOnXServerExit" |
74 | #define QUITONDISCONNECT_KEY "QuitOnDisconnect" | 76 | #define QUITONDISCONNECT_KEY "QuitOnDisconnect" |
75 | #define NUMACCOUNTS_KEY "NumberOfAccounts" | 77 | #define NUMACCOUNTS_KEY "HighcountAccounts" |
78 | #define NUMDEVICES_KEY "HighcountDevices" | ||
76 | #define ID_KEY "ID" | 79 | #define ID_KEY "ID" |
77 | 80 | ||
78 | // modem | 81 | // modem |
82 | #define MODEMNAME_KEY "Modem_Name" | ||
79 | #define MODEMDEV_KEY "Device" | 83 | #define MODEMDEV_KEY "Device" |
80 | #define LOCKFILE_KEY "UseLockFile" | 84 | #define LOCKFILE_KEY "UseLockFile" |
81 | #define FLOWCONTROL_KEY "FlowControl" | 85 | #define FLOWCONTROL_KEY "FlowControl" |
82 | #define SPEED_KEY "Speed" | 86 | #define SPEED_KEY "Speed" |
83 | #define TIMEOUT_KEY "Timeout" | 87 | #define TIMEOUT_KEY "Timeout" |
84 | #define TONEDURATION_KEY "ToneDuration" | 88 | #define TONEDURATION_KEY "ToneDuration" |
85 | #define BUSYWAIT_KEY "BusyWait" | 89 | #define BUSYWAIT_KEY "BusyWait" |
86 | #define INITSTR_KEY "InitString" | 90 | #define INITSTR_KEY "InitString" |
87 | #define INITRESP_KEY "InitResponse" | 91 | #define INITRESP_KEY "InitResponse" |
88 | #define PREINITDELAY_KEY "PreInitDelay" | 92 | #define PREINITDELAY_KEY "PreInitDelay" |
89 | #define INITDELAY_KEY "InitDelay" | 93 | #define INITDELAY_KEY "InitDelay" |
90 | #define NODTDETECT_KEY "NoDialToneDetection" | 94 | #define NODTDETECT_KEY "NoDialToneDetection" |
91 | #define DIALTONEWAIT_KEY "WaitForDialTone" | 95 | #define DIALTONEWAIT_KEY "WaitForDialTone" |
92 | #define DIALSTR_KEY "DialString" | 96 | #define DIALSTR_KEY "DialString" |
93 | #define CONNECTRESP_KEY "ConnectResponse" | 97 | #define CONNECTRESP_KEY "ConnectResponse" |
94 | #define BUSYRESP_KEY "BusyResponse" | 98 | #define BUSYRESP_KEY "BusyResponse" |
95 | #define NOCARRIERRESP_KEY "NoCarrierResponse" | 99 | #define NOCARRIERRESP_KEY "NoCarrierResponse" |
96 | #define NODIALTONERESP_KEY "NoDialToneResp" | 100 | #define NODIALTONERESP_KEY "NoDialToneResp" |
97 | #define HANGUPSTR_KEY "HangupString" | 101 | #define HANGUPSTR_KEY "HangupString" |
98 | #define HANGUPRESP_KEY "HangUpResponse" | 102 | #define HANGUPRESP_KEY "HangUpResponse" |
99 | #define ANSWERSTR_KEY "AnswerString" | 103 | #define ANSWERSTR_KEY "AnswerString" |
100 | #define RINGRESP_KEY "RingResponse" | 104 | #define RINGRESP_KEY "RingResponse" |
101 | #define ANSWERRESP_KEY "AnswerResponse" | 105 | #define ANSWERRESP_KEY "AnswerResponse" |
102 | #define ENTER_KEY "Enter" | 106 | #define ENTER_KEY "Enter" |
103 | #define ESCAPESTR_KEY "EscapeString" | 107 | #define ESCAPESTR_KEY "EscapeString" |
104 | #define ESCAPERESP_KEY "EscapeResponse" | 108 | #define ESCAPERESP_KEY "EscapeResponse" |
105 | #define ESCAPEGUARDTIME_KEY "EscapeGuardTime" | 109 | #define ESCAPEGUARDTIME_KEY "EscapeGuardTime" |
106 | #define USECDLINE_KEY "UseCDLine" | 110 | #define USECDLINE_KEY "UseCDLine" |
107 | #define VOLUME_HIGH "VolumeHigh" | 111 | #define VOLUME_HIGH "VolumeHigh" |
108 | #define VOLUME_MEDIUM "VolumeMedium" | 112 | #define VOLUME_MEDIUM "VolumeMedium" |
109 | #define VOLUME_OFF "VolumeOff" | 113 | #define VOLUME_OFF "VolumeOff" |
110 | #define VOLUME_KEY "Volume" | 114 | #define VOLUME_KEY "Volume" |
111 | 115 | ||
112 | // account | 116 | // account |
113 | #define NAME_KEY "Name" | 117 | #define NAME_KEY "Name" |
114 | #define PHONENUMBER_KEY "Phonenumber" | 118 | #define PHONENUMBER_KEY "Phonenumber" |
115 | #define DIAL_PREFIX_KEY "DialPrefix" | 119 | #define DIAL_PREFIX_KEY "DialPrefix" |
116 | #define AUTH_KEY "Authentication" | 120 | #define AUTH_KEY "Authentication" |
117 | #define STORED_PASSWORD_KEY "Password" | 121 | #define STORED_PASSWORD_KEY "Password" |
118 | #define STORED_USERNAME_KEY "Username" | 122 | #define STORED_USERNAME_KEY "Username" |
119 | #define STORE_PASSWORD_KEY "StorePassword" | 123 | #define STORE_PASSWORD_KEY "StorePassword" |
120 | #define BEFORE_CONNECT_KEY "BeforeConnect" | 124 | #define BEFORE_CONNECT_KEY "BeforeConnect" |
121 | #define COMMAND_KEY "Command" | 125 | #define COMMAND_KEY "Command" |
122 | #define DISCONNECT_COMMAND_KEY "DisconnectCommand" | 126 | #define DISCONNECT_COMMAND_KEY "DisconnectCommand" |
123 | #define BEFORE_DISCONNECT_KEY "BeforeDisconnect" | 127 | #define BEFORE_DISCONNECT_KEY "BeforeDisconnect" |
124 | #define IPADDR_KEY "IPAddr" | 128 | #define IPADDR_KEY "IPAddr" |
125 | #define SUBNETMASK_KEY "SubnetMask" | 129 | #define SUBNETMASK_KEY "SubnetMask" |
126 | #define ACCTENABLED_KEY "AccountingEnabled" | 130 | #define ACCTENABLED_KEY "AccountingEnabled" |
127 | #define VOLACCTENABLED_KEY "VolumeAccountingEnabled" | 131 | #define VOLACCTENABLED_KEY "VolumeAccountingEnabled" |
128 | #define ACCTFILE_KEY "AccountingFile" | 132 | #define ACCTFILE_KEY "AccountingFile" |
129 | #define AUTONAME_KEY "AutoName" | 133 | #define AUTONAME_KEY "AutoName" |
130 | #define GATEWAY_KEY "Gateway" | 134 | #define GATEWAY_KEY "Gateway" |
131 | #define DEFAULTROUTE_KEY "DefaultRoute" | 135 | #define DEFAULTROUTE_KEY "DefaultRoute" |
132 | #define DOMAIN_KEY "Domain" | 136 | #define DOMAIN_KEY "Domain" |
133 | #define DNS_KEY "DNS" | 137 | #define DNS_KEY "DNS" |
134 | #define AUTODNS_KEY "AutoDNS" | 138 | #define AUTODNS_KEY "AutoDNS" |
135 | #define EXDNSDISABLED_KEY "ExDNSDisabled" | 139 | #define EXDNSDISABLED_KEY "ExDNSDisabled" |
136 | #define SCRIPTCOM_KEY "ScriptCommands" | 140 | #define SCRIPTCOM_KEY "ScriptCommands" |
137 | #define SCRIPTARG_KEY "ScriptArguments" | 141 | #define SCRIPTARG_KEY "ScriptArguments" |
138 | #define PPPDARG_KEY "pppdArguments" | 142 | #define PPPDARG_KEY "pppdArguments" |
139 | #define PPP_DEBUG_OPTION "PPPDebug" | 143 | #define PPP_DEBUG_OPTION "PPPDebug" |
140 | #define ICONIFY_ON_CONNECT_KEY "iconifyOnConnect" | 144 | #define ICONIFY_ON_CONNECT_KEY "iconifyOnConnect" |
141 | #define DOCKING_KEY "DockIntoPanel" | 145 | #define DOCKING_KEY "DockIntoPanel" |
142 | #define TOTALCOSTS_KEY "TotalCosts" | 146 | #define TOTALCOSTS_KEY "TotalCosts" |
143 | #define TOTALBYTES_KEY "TotalBytes" | 147 | #define TOTALBYTES_KEY "TotalBytes" |
144 | 148 | ||
145 | // pppd errors | 149 | // pppd errors |
146 | #define E_IF_TIMEOUT 1 | 150 | #define E_IF_TIMEOUT 1 |
147 | #define E_PPPD_DIED 2 | 151 | #define E_PPPD_DIED 2 |
148 | 152 | ||
149 | // account list | 153 | // account list |
150 | #define ACCOUNTS_COUNT "Accounts_Count" | 154 | #define ACCOUNTS_COUNT "Accounts_Count" |
151 | #define ACOUNTS_DEV "Accounts_Modem" | 155 | #define ACOUNTS_DEV "Accounts_Modem" |
152 | #define ACOUNTS_ACC "Accounts_Account" | 156 | #define ACOUNTS_ACC "Accounts_Account" |
153 | 157 | ||
158 | #define DEVICESNAMES_LIST "DevicesNames_List" | ||
159 | #define DEVICES_LIST "Devices_List" | ||
160 | #define DEVICES_LIST_SEP ',' | ||
161 | |||
154 | class PPPData { | 162 | class PPPData { |
155 | public: | 163 | public: |
156 | PPPData(); | 164 | PPPData(); |
157 | ~PPPData() {}; | 165 | ~PPPData() {}; |
158 | 166 | ||
159 | enum { NumInitStrings = 2 }; | 167 | enum { NumInitStrings = 2 }; |
160 | 168 | ||
161 | // general functions | 169 | // general functions |
162 | void save(); | 170 | void save(); |
163 | void cancel(); | 171 | void cancel(); |
164 | 172 | ||
173 | QStringList getAccountList(); | ||
174 | |||
165 | static QMap<QString,QString> getConfiguredInterfaces(); | 175 | static QMap<QString,QString> getConfiguredInterfaces(); |
166 | static void setConfiguredInterfaces( QMap<QString,QString> ); | 176 | static void setConfiguredInterfaces( QMap<QString,QString> ); |
167 | 177 | ||
168 | // function to read/write date to configuration file | 178 | // function to read/write date to configuration file |
169 | static Config config(); | 179 | static Config config(); |
170 | QString readConfig(const QString &, const QString &, const QString &); | 180 | QString readConfig(const QString &, const QString &, const QString &); |
171 | int readNumConfig(const QString &, const QString &, int); | 181 | int readNumConfig(const QString &, const QString &, int); |
172 | bool readListConfig(const QString &, const QString &, | 182 | bool readListConfig(const QString &, const QString &, |
173 | QStringList &, char sep = ','); | 183 | QStringList &, char sep = ','); |
174 | void writeConfig(const QString &, const QString &, const QString &); | 184 | void writeConfig(const QString &, const QString &, const QString &); |
175 | void writeConfig(const QString &, const QString &, int); | 185 | void writeConfig(const QString &, const QString &, int); |
176 | void writeListConfig(const QString &, const QString &, | 186 | void writeListConfig(const QString &, const QString &, |
177 | QStringList &, char sep = ','); | 187 | QStringList &, char sep = ','); |
178 | 188 | ||
179 | // return the current account group | 189 | // return the current account group |
180 | QString currentGroup() { return cgroup; } | 190 | QString currentGroup() { return cgroup; } |
181 | QString modemGroup(); | 191 | QString modemGroup(); |
182 | 192 | ||
183 | // functions to set/get general kppp info | 193 | // functions to set/get general kppp info |
184 | QString password(); | 194 | QString password(); |
185 | void setPassword(const QString &); | 195 | void setPassword(const QString &); |
186 | 196 | ||
187 | int currentAccountID() { return caccount; }; | 197 | // int currentAccountID() { return caccount; }; |
188 | const QString defaultAccount(); | 198 | const QString defaultAccount(); |
189 | void setDefaultAccount(const QString &); | 199 | void setDefaultAccount(const QString &); |
190 | 200 | ||
191 | void set_xserver_exit_disconnect(bool set); | 201 | void set_xserver_exit_disconnect(bool set); |
192 | bool get_xserver_exit_disconnect(); | 202 | bool get_xserver_exit_disconnect(); |
193 | 203 | ||
194 | void setPPPDebug(bool set); | 204 | void setPPPDebug(bool set); |
195 | bool getPPPDebug(); | 205 | bool getPPPDebug(); |
196 | 206 | ||
197 | void set_quit_on_disconnect(bool); | 207 | void set_quit_on_disconnect(bool); |
198 | bool quit_on_disconnect(); | 208 | bool quit_on_disconnect(); |
199 | 209 | ||
200 | void set_show_clock_on_caption(bool set); | 210 | void set_show_clock_on_caption(bool set); |
201 | bool get_show_clock_on_caption(); | 211 | bool get_show_clock_on_caption(); |
202 | 212 | ||
203 | void set_show_log_window(bool set); | 213 | void set_show_log_window(bool set); |
204 | bool get_show_log_window(); | 214 | bool get_show_log_window(); |
205 | 215 | ||
206 | void set_automatic_redial(bool set); | 216 | void set_automatic_redial(bool set); |
207 | bool automatic_redial(); | 217 | bool automatic_redial(); |
208 | 218 | ||
209 | // void set_iconify_on_connect(bool set); | 219 | // void set_iconify_on_connect(bool set); |
210 | // bool get_iconify_on_connect(); | 220 | // bool get_iconify_on_connect(); |
211 | 221 | ||
212 | // void set_dock_into_panel(bool set); | 222 | // void set_dock_into_panel(bool set); |
213 | // bool get_dock_into_panel(); | 223 | // bool get_dock_into_panel(); |
214 | 224 | ||
215 | const QString enter(); | 225 | const QString enter(); |
216 | void setEnter(const QString &); | 226 | void setEnter(const QString &); |
217 | 227 | ||
218 | QString pppdVersion(); | 228 | QString pppdVersion(); |
219 | bool pppdVersionMin(int ver, int mod, int patch); | 229 | bool pppdVersionMin(int ver, int mod, int patch); |
220 | 230 | ||
221 | int pppdTimeout(); | 231 | int pppdTimeout(); |
222 | void setpppdTimeout(int); | 232 | void setpppdTimeout(int); |
223 | 233 | ||
224 | int busyWait(); | 234 | int busyWait(); |
225 | void setbusyWait(int); | 235 | void setbusyWait(int); |
226 | 236 | ||
227 | bool modemLockFile(); | 237 | bool modemLockFile(); |
228 | void setModemLockFile(bool set); | 238 | void setModemLockFile(bool set); |
229 | 239 | ||
230 | int modemEscapeGuardTime(); | 240 | int modemEscapeGuardTime(); |
231 | void setModemEscapeGuardTime(int i); | 241 | void setModemEscapeGuardTime(int i); |
232 | 242 | ||
233 | void setModemEscapeStr(const QString &); | 243 | void setModemEscapeStr(const QString &); |
234 | const QString modemEscapeStr(); | 244 | const QString modemEscapeStr(); |
235 | 245 | ||
236 | void setModemEscapeResp(const QString &); | 246 | void setModemEscapeResp(const QString &); |
237 | const QString modemEscapeResp(); | 247 | const QString modemEscapeResp(); |
238 | 248 | ||
239 | const QString modemDevice(); | 249 | // const QString modemName(); |
240 | bool setModemDevice(const QString &); | 250 | // bool setModemName(const QString &); |
251 | // bool changeModemName(const QString &); | ||
252 | |||
253 | const QString modemDevice(); | ||
254 | bool setModemDevice(const QString &); | ||
241 | 255 | ||
242 | const QString flowcontrol(); | 256 | const QString flowcontrol(); |
243 | void setFlowcontrol(const QString &); | 257 | void setFlowcontrol(const QString &); |
244 | 258 | ||
245 | int modemTimeout(); | 259 | int modemTimeout(); |
246 | void setModemTimeout(int); | 260 | void setModemTimeout(int); |
247 | 261 | ||
248 | int modemToneDuration(); | 262 | int modemToneDuration(); |
249 | void setModemToneDuration(int); | 263 | void setModemToneDuration(int); |
250 | 264 | ||
251 | QString volumeInitString(); | 265 | QString volumeInitString(); |
252 | int volume(); | 266 | int volume(); |
253 | void setVolume(int); | 267 | void setVolume(int); |
254 | 268 | ||
255 | int waitForDialTone(); | 269 | int waitForDialTone(); |
256 | void setWaitForDialTone(int i); | 270 | void setWaitForDialTone(int i); |
257 | 271 | ||
258 | // modem command strings/responses | 272 | // modem command strings/responses |
259 | const QString modemInitStr(int i); | 273 | const QString modemInitStr(int i); |
260 | void setModemInitStr(int i, const QString &); | 274 | void setModemInitStr(int i, const QString &); |
261 | 275 | ||
262 | const QString modemInitResp(); | 276 | const QString modemInitResp(); |
263 | void setModemInitResp(const QString &); | 277 | void setModemInitResp(const QString &); |
264 | 278 | ||
265 | int modemPreInitDelay(); | 279 | int modemPreInitDelay(); |
266 | void setModemPreInitDelay(int); | 280 | void setModemPreInitDelay(int); |
267 | 281 | ||
268 | int modemInitDelay(); | 282 | int modemInitDelay(); |
269 | void setModemInitDelay(int); | 283 | void setModemInitDelay(int); |
270 | 284 | ||
271 | QString modemNoDialToneDetectionStr(); | 285 | QString modemNoDialToneDetectionStr(); |
272 | void setModemNoDialToneDetectionStr(const QString &); | 286 | void setModemNoDialToneDetectionStr(const QString &); |
273 | 287 | ||
274 | const QString modemDialStr(); | 288 | const QString modemDialStr(); |
275 | void setModemDialStr(const QString &); | 289 | void setModemDialStr(const QString &); |
276 | 290 | ||
277 | const QString modemConnectResp(); | 291 | const QString modemConnectResp(); |
278 | void setModemConnectResp(const QString &); | 292 | void setModemConnectResp(const QString &); |
279 | 293 | ||
280 | const QString modemBusyResp(); | 294 | const QString modemBusyResp(); |
281 | void setModemBusyResp(const QString &); | 295 | void setModemBusyResp(const QString &); |
282 | 296 | ||
283 | const QString modemNoCarrierResp(); | 297 | const QString modemNoCarrierResp(); |
284 | void setModemNoCarrierResp(const QString &); | 298 | void setModemNoCarrierResp(const QString &); |
285 | 299 | ||
286 | const QString modemNoDialtoneResp(); | 300 | const QString modemNoDialtoneResp(); |
287 | void setModemNoDialtoneResp(const QString &); | 301 | void setModemNoDialtoneResp(const QString &); |
288 | 302 | ||
289 | const QString modemHangupStr(); | 303 | const QString modemHangupStr(); |
290 | void setModemHangupStr(const QString &); | 304 | void setModemHangupStr(const QString &); |
291 | 305 | ||
292 | const QString modemHangupResp(); | 306 | const QString modemHangupResp(); |
293 | void setModemHangupResp(const QString &); | 307 | void setModemHangupResp(const QString &); |
294 | 308 | ||
295 | const QString modemAnswerStr(); | 309 | const QString modemAnswerStr(); |
296 | void setModemAnswerStr(const QString &); | 310 | void setModemAnswerStr(const QString &); |
297 | 311 | ||
298 | const QString modemRingResp(); | 312 | const QString modemRingResp(); |
299 | void setModemRingResp(const QString &); | 313 | void setModemRingResp(const QString &); |
300 | 314 | ||
301 | const QString modemAnswerResp(); | 315 | const QString modemAnswerResp(); |
302 | void setModemAnswerResp(const QString &); | 316 | void setModemAnswerResp(const QString &); |
303 | 317 | ||
304 | QString volumeOff(); | 318 | QString volumeOff(); |
305 | void setVolumeOff(const QString &); | 319 | void setVolumeOff(const QString &); |
306 | 320 | ||
307 | QString volumeMedium(); | 321 | QString volumeMedium(); |
308 | void setVolumeMedium(const QString &); | 322 | void setVolumeMedium(const QString &); |
309 | 323 | ||
310 | QString volumeHigh(); | 324 | QString volumeHigh(); |
311 | void setVolumeHigh(const QString &); | 325 | void setVolumeHigh(const QString &); |
312 | 326 | ||
313 | // functions to set/get account information | 327 | // functions to set/get account information |
314 | int count() const; | 328 | int count() const; |
315 | bool setAccount(const QString &); | 329 | bool setAccount(const QString &); |
316 | bool setAccountbyIndex(int); | 330 | // bool setAccountbyIndex(int); |
317 | 331 | ||
318 | bool isUniqueAccname(const QString &); | 332 | bool isUniqueAccname(const QString &); |
333 | bool isUniqueDevname(const QString &); | ||
319 | 334 | ||
320 | bool deleteAccount(); | 335 | bool deleteAccount(); |
321 | bool deleteAccount(const QString &); | 336 | bool deleteAccount(const QString &); |
322 | int newaccount(); | 337 | int newaccount(); |
323 | int copyaccount(int i); | 338 | int copyaccount(const QString&); |
324 | 339 | ||
325 | const QString accname(); | 340 | const QString accname(); |
326 | void setAccname(const QString &); | 341 | void setAccname(const QString &); |
327 | 342 | ||
328 | QStringList &phonenumbers(); | 343 | QStringList &phonenumbers(); |
329 | const QString phonenumber(); | 344 | const QString phonenumber(); |
330 | void setPhonenumber(const QString &); | 345 | void setPhonenumber(const QString &); |
331 | 346 | ||
332 | const QString dialPrefix(); | 347 | const QString dialPrefix(); |
333 | void setDialPrefix(const QString &); | 348 | void setDialPrefix(const QString &); |
334 | 349 | ||
335 | int authMethod(); | 350 | int authMethod(); |
336 | void setAuthMethod(int); | 351 | void setAuthMethod(int); |
337 | 352 | ||
338 | const QString storedUsername(); | 353 | const QString storedUsername(); |
339 | void setStoredUsername(const QString &); | 354 | void setStoredUsername(const QString &); |
340 | 355 | ||
341 | const QString storedPassword(); | 356 | const QString storedPassword(); |
342 | void setStoredPassword(const QString &); | 357 | void setStoredPassword(const QString &); |
343 | 358 | ||
344 | bool storePassword(); | 359 | bool storePassword(); |
345 | void setStorePassword(bool); | 360 | void setStorePassword(bool); |
346 | 361 | ||
347 | const QString speed(); | 362 | const QString speed(); |
348 | void setSpeed(const QString &); | 363 | void setSpeed(const QString &); |
349 | 364 | ||
350 | const QString command_before_connect(); | 365 | const QString command_before_connect(); |
351 | void setCommand_before_connect(const QString &); | 366 | void setCommand_before_connect(const QString &); |
352 | 367 | ||
353 | const QString command_on_connect(); | 368 | const QString command_on_connect(); |
354 | void setCommand_on_connect(const QString &); | 369 | void setCommand_on_connect(const QString &); |
355 | 370 | ||
356 | const QString command_on_disconnect(); | 371 | const QString command_on_disconnect(); |
357 | void setCommand_on_disconnect(const QString &); | 372 | void setCommand_on_disconnect(const QString &); |
358 | 373 | ||
359 | const QString command_before_disconnect(); | 374 | const QString command_before_disconnect(); |
360 | void setCommand_before_disconnect(const QString &); | 375 | void setCommand_before_disconnect(const QString &); |
361 | 376 | ||
362 | const QString ipaddr(); | 377 | const QString ipaddr(); |
363 | void setIpaddr(const QString &); | 378 | void setIpaddr(const QString &); |
364 | 379 | ||
365 | const QString subnetmask(); | 380 | const QString subnetmask(); |
366 | void setSubnetmask(const QString &); | 381 | void setSubnetmask(const QString &); |
367 | 382 | ||
368 | bool AcctEnabled(); | 383 | bool AcctEnabled(); |
369 | void setAcctEnabled(bool set); | 384 | void setAcctEnabled(bool set); |
370 | 385 | ||
371 | // int VolAcctEnabled(); | 386 | // int VolAcctEnabled(); |
372 | // void setVolAcctEnabled(int set); | 387 | // void setVolAcctEnabled(int set); |
373 | 388 | ||
374 | bool autoDNS(); | 389 | bool autoDNS(); |
375 | void setAutoDNS(bool set); | 390 | void setAutoDNS(bool set); |
376 | 391 | ||
377 | bool exDNSDisabled(); | 392 | bool exDNSDisabled(); |
378 | void setExDNSDisabled(bool set); | 393 | void setExDNSDisabled(bool set); |
379 | 394 | ||
380 | bool autoname(); | 395 | bool autoname(); |
381 | void setAutoname(bool set); | 396 | void setAutoname(bool set); |
382 | 397 | ||
383 | const QString gateway(); | 398 | const QString gateway(); |
384 | void setGateway(const QString &); | 399 | void setGateway(const QString &); |
385 | 400 | ||
386 | bool defaultroute(); | 401 | bool defaultroute(); |
387 | void setDefaultroute(bool set); | 402 | void setDefaultroute(bool set); |
388 | 403 | ||
389 | QStringList &dns(); | 404 | QStringList &dns(); |
390 | void setDns(QStringList &); | 405 | void setDns(QStringList &); |
391 | 406 | ||
392 | const QString domain(); | 407 | const QString domain(); |
393 | void setDomain(const QString &); | 408 | void setDomain(const QString &); |
394 | 409 | ||
395 | QStringList &scriptType(); | 410 | QStringList &scriptType(); |
396 | void setScriptType(QStringList &); | 411 | void setScriptType(QStringList &); |
397 | 412 | ||
398 | QStringList &script(); | 413 | QStringList &script(); |
399 | void setScript(QStringList &); | 414 | void setScript(QStringList &); |
400 | 415 | ||
401 | QStringList &pppdArgument(); | 416 | QStringList &pppdArgument(); |
402 | void setpppdArgumentDefaults(); | 417 | void setpppdArgumentDefaults(); |
403 | void setpppdArgument(QStringList &); | 418 | void setpppdArgument(QStringList &); |
404 | 419 | ||
405 | //functions to change/set the child pppd process info | 420 | //functions to change/set the child pppd process info |
406 | bool pppdRunning() const; | 421 | bool pppdRunning() const; |
407 | void setpppdRunning(bool set); | 422 | void setpppdRunning(bool set); |
408 | 423 | ||
409 | int pppdError() const; | 424 | int pppdError() const; |
410 | void setpppdError(int err); | 425 | void setpppdError(int err); |
411 | 426 | ||
427 | QStringList getDevicesList(); | ||
412 | 428 | ||
413 | static QString encodeWord(const QString &s); | 429 | static QString encodeWord(const QString &s); |
414 | 430 | ||
431 | const QString devname(); | ||
432 | void setDevname(const QString &); | ||
433 | bool setDevice(const QString& ); | ||
434 | bool deleteDevice(); | ||
435 | bool deleteDevice(const QString &); | ||
436 | int newdevice(); | ||
437 | int copydevice(const QString&); | ||
438 | QStringList getDevicesNamesList(); | ||
439 | |||
415 | private: | 440 | private: |
416 | 441 | ||
417 | //static PPPData *_data; | 442 | //static PPPData *_data; |
418 | int modemDeviceGroup; | 443 | // int modemDeviceGroup; |
419 | QString passwd; | 444 | QString passwd; |
420 | // static Config* config; // configuration object | 445 | QString _modemName; |
421 | int highcount; // index of highest account | 446 | int highcount; // index of highest account |
422 | int caccount; // index of the current account | 447 | int highcountdev; // index of highest device |
448 | // int caccount; // index of the current account | ||
423 | QString cgroup; // name of current config group | 449 | QString cgroup; // name of current config group |
424 | pid_t suidprocessid; // process ID of setuid child | 450 | pid_t suidprocessid; // process ID of setuid child |
425 | bool pppdisrunning; // pppd process | 451 | bool pppdisrunning; // pppd process |
426 | // daemon | 452 | // daemon |
427 | int pppderror; // error encounterd running pppd | 453 | int pppderror; // error encounterd running pppd |
428 | int pppdVer, pppdMod, pppdPatch; // pppd version | 454 | int pppdVer, pppdMod, pppdPatch; // pppd version |
429 | 455 | ||
456 | |||
430 | QStringList phonelist; | 457 | QStringList phonelist; |
458 | QStringList accountList; | ||
459 | QStringList deviceList; | ||
431 | QMap<QString,QString> stringEntries; | 460 | QMap<QString,QString> stringEntries; |
432 | QMap<QString,int> intEntries; | 461 | QMap<QString,int> intEntries; |
433 | QMap<QString,QStringList> listEntries; | 462 | QMap<QString,QStringList> listEntries; |
434 | QMap<QString,QChar> sepEntries; | 463 | QMap<QString,QChar> sepEntries; |
435 | 464 | ||
436 | }; | 465 | }; |
437 | 466 | ||
438 | #endif | 467 | #endif |