8#include "pppsetting_p.h"
12NetworkManager::PppSettingPrivate::PppSettingPrivate()
13 : name(NM_SETTING_PPP_SETTING_NAME)
19 , refuseMschapv2(false)
24 , requireMppe128(false)
35NetworkManager::PppSetting::PppSetting()
36 : Setting(Setting::Ppp)
37 , d_ptr(new PppSettingPrivate())
41NetworkManager::PppSetting::PppSetting(
const Ptr &other)
43 , d_ptr(new PppSettingPrivate())
45 setNoAuth(other->noAuth());
46 setRefuseEap(other->refuseEap());
47 setRefusePap(other->refusePap());
48 setRefuseChap(other->refuseChap());
49 setRefuseMschap(other->refuseMschap());
50 setRefuseMschapv2(other->refuseMschapv2());
51 setNoBsdComp(other->noBsdComp());
52 setNoDeflate(other->noDeflate());
53 setNoVjComp(other->noVjComp());
54 setRequireMppe(other->requireMppe());
55 setRequireMppe128(other->requireMppe128());
56 setMppeStateful(other->mppeStateful());
57 setCRtsCts(other->cRtsCts());
58 setBaud(other->baud());
61 setLcpEchoFailure(other->lcpEchoFailure());
62 setLcpEchoInterval(other->lcpEchoInterval());
65NetworkManager::PppSetting::~PppSetting()
77void NetworkManager::PppSetting::setNoAuth(
bool require)
84bool NetworkManager::PppSetting::noAuth()
const
86 Q_D(
const PppSetting);
91void NetworkManager::PppSetting::setRefuseEap(
bool refuse)
95 d->refuseEap = refuse;
98bool NetworkManager::PppSetting::refuseEap()
const
100 Q_D(
const PppSetting);
105void NetworkManager::PppSetting::setRefusePap(
bool refuse)
109 d->refusePap = refuse;
112bool NetworkManager::PppSetting::refusePap()
const
114 Q_D(
const PppSetting);
119void NetworkManager::PppSetting::setRefuseChap(
bool refuse)
123 d->refuseChap = refuse;
126bool NetworkManager::PppSetting::refuseChap()
const
128 Q_D(
const PppSetting);
130 return d->refuseChap;
133void NetworkManager::PppSetting::setRefuseMschap(
bool refuse)
137 d->refuseMschap = refuse;
140bool NetworkManager::PppSetting::refuseMschap()
const
142 Q_D(
const PppSetting);
144 return d->refuseMschap;
147void NetworkManager::PppSetting::setRefuseMschapv2(
bool refuse)
151 d->refuseMschapv2 = refuse;
154bool NetworkManager::PppSetting::refuseMschapv2()
const
156 Q_D(
const PppSetting);
158 return d->refuseMschapv2;
161void NetworkManager::PppSetting::setNoBsdComp(
bool require)
165 d->nobsdcomp = require;
168bool NetworkManager::PppSetting::noBsdComp()
const
170 Q_D(
const PppSetting);
175void NetworkManager::PppSetting::setNoDeflate(
bool require)
179 d->nodeflate = require;
182bool NetworkManager::PppSetting::noDeflate()
const
184 Q_D(
const PppSetting);
189void NetworkManager::PppSetting::setNoVjComp(
bool require)
193 d->noVjComp = require;
196bool NetworkManager::PppSetting::noVjComp()
const
198 Q_D(
const PppSetting);
203void NetworkManager::PppSetting::setRequireMppe(
bool require)
207 d->requireMppe = require;
210bool NetworkManager::PppSetting::requireMppe()
const
212 Q_D(
const PppSetting);
214 return d->requireMppe;
217void NetworkManager::PppSetting::setRequireMppe128(
bool require)
221 d->requireMppe128 = require;
224bool NetworkManager::PppSetting::requireMppe128()
const
226 Q_D(
const PppSetting);
228 return d->requireMppe128;
231void NetworkManager::PppSetting::setMppeStateful(
bool used)
235 d->mppeStateful = used;
238bool NetworkManager::PppSetting::mppeStateful()
const
240 Q_D(
const PppSetting);
242 return d->mppeStateful;
245void NetworkManager::PppSetting::setCRtsCts(
bool control)
249 d->crtscts = control;
252bool NetworkManager::PppSetting::cRtsCts()
const
254 Q_D(
const PppSetting);
259void NetworkManager::PppSetting::setBaud(quint32 baud)
266quint32 NetworkManager::PppSetting::baud()
const
268 Q_D(
const PppSetting);
273void NetworkManager::PppSetting::setMru(quint32 mru)
280quint32 NetworkManager::PppSetting::mru()
const
282 Q_D(
const PppSetting);
287void NetworkManager::PppSetting::setMtu(quint32 mtu)
294quint32 NetworkManager::PppSetting::mtu()
const
296 Q_D(
const PppSetting);
301void NetworkManager::PppSetting::setLcpEchoFailure(quint32 number)
305 d->lcpEchoFailure =
number;
308quint32 NetworkManager::PppSetting::lcpEchoFailure()
const
310 Q_D(
const PppSetting);
312 return d->lcpEchoFailure;
315void NetworkManager::PppSetting::setLcpEchoInterval(quint32 interval)
319 d->lcpEchoInterval = interval;
322quint32 NetworkManager::PppSetting::lcpEchoInterval()
const
324 Q_D(
const PppSetting);
326 return d->lcpEchoInterval;
331 if (setting.contains(
QLatin1String(NM_SETTING_PPP_NOAUTH))) {
332 setNoAuth(setting.value(
QLatin1String(NM_SETTING_PPP_NOAUTH)).toBool());
335 if (setting.contains(
QLatin1String(NM_SETTING_PPP_REFUSE_EAP))) {
336 setRefuseEap(setting.value(
QLatin1String(NM_SETTING_PPP_REFUSE_EAP)).toBool());
339 if (setting.contains(
QLatin1String(NM_SETTING_PPP_REFUSE_PAP))) {
340 setRefusePap(setting.value(
QLatin1String(NM_SETTING_PPP_REFUSE_PAP)).toBool());
343 if (setting.contains(
QLatin1String(NM_SETTING_PPP_REFUSE_CHAP))) {
344 setRefuseChap(setting.value(
QLatin1String(NM_SETTING_PPP_REFUSE_CHAP)).toBool());
347 if (setting.contains(
QLatin1String(NM_SETTING_PPP_REFUSE_MSCHAP))) {
348 setRefuseMschap(setting.value(
QLatin1String(NM_SETTING_PPP_REFUSE_MSCHAP)).toBool());
351 if (setting.contains(
QLatin1String(NM_SETTING_PPP_REFUSE_MSCHAPV2))) {
352 setRefuseMschapv2(setting.value(
QLatin1String(NM_SETTING_PPP_REFUSE_MSCHAPV2)).toBool());
355 if (setting.contains(
QLatin1String(NM_SETTING_PPP_NOBSDCOMP))) {
356 setNoBsdComp(setting.value(
QLatin1String(NM_SETTING_PPP_NOBSDCOMP)).toBool());
359 if (setting.contains(
QLatin1String(NM_SETTING_PPP_NODEFLATE))) {
360 setNoDeflate(setting.value(
QLatin1String(NM_SETTING_PPP_NODEFLATE)).toBool());
363 if (setting.contains(
QLatin1String(NM_SETTING_PPP_NO_VJ_COMP))) {
364 setNoVjComp(setting.value(
QLatin1String(NM_SETTING_PPP_NO_VJ_COMP)).toBool());
367 if (setting.contains(
QLatin1String(NM_SETTING_PPP_REQUIRE_MPPE))) {
368 setRequireMppe(setting.value(
QLatin1String(NM_SETTING_PPP_REQUIRE_MPPE)).toBool());
371 if (setting.contains(
QLatin1String(NM_SETTING_PPP_REQUIRE_MPPE_128))) {
372 setRequireMppe128(setting.value(
QLatin1String(NM_SETTING_PPP_REQUIRE_MPPE_128)).toBool());
375 if (setting.contains(
QLatin1String(NM_SETTING_PPP_MPPE_STATEFUL))) {
376 setMppeStateful(setting.value(
QLatin1String(NM_SETTING_PPP_MPPE_STATEFUL)).toBool());
379 if (setting.contains(
QLatin1String(NM_SETTING_PPP_CRTSCTS))) {
380 setCRtsCts(setting.value(
QLatin1String(NM_SETTING_PPP_CRTSCTS)).toBool());
384 setBaud(setting.value(
QLatin1String(NM_SETTING_PPP_BAUD)).toUInt());
388 setMru(setting.value(
QLatin1String(NM_SETTING_PPP_MRU)).toUInt());
392 setMtu(setting.value(
QLatin1String(NM_SETTING_PPP_MTU)).toUInt());
395 if (setting.contains(
QLatin1String(NM_SETTING_PPP_LCP_ECHO_FAILURE))) {
396 setLcpEchoFailure(setting.value(
QLatin1String(NM_SETTING_PPP_LCP_ECHO_FAILURE)).toUInt());
399 if (setting.contains(
QLatin1String(NM_SETTING_PPP_LCP_ECHO_INTERVAL))) {
400 setLcpEchoInterval(setting.value(
QLatin1String(NM_SETTING_PPP_LCP_ECHO_INTERVAL)).toUInt());
409 setting.insert(
QLatin1String(NM_SETTING_PPP_NOAUTH), noAuth());
413 setting.insert(
QLatin1String(NM_SETTING_PPP_REFUSE_EAP), refuseEap());
417 setting.insert(
QLatin1String(NM_SETTING_PPP_REFUSE_PAP), refusePap());
421 setting.insert(
QLatin1String(NM_SETTING_PPP_REFUSE_CHAP), refuseChap());
424 if (refuseMschap()) {
425 setting.insert(
QLatin1String(NM_SETTING_PPP_REFUSE_MSCHAP), refuseMschap());
428 if (refuseMschapv2()) {
429 setting.insert(
QLatin1String(NM_SETTING_PPP_REFUSE_MSCHAPV2), refuseMschapv2());
433 setting.insert(
QLatin1String(NM_SETTING_PPP_NOBSDCOMP), noBsdComp());
437 setting.insert(
QLatin1String(NM_SETTING_PPP_NODEFLATE), noDeflate());
441 setting.insert(
QLatin1String(NM_SETTING_PPP_NO_VJ_COMP), noVjComp());
445 setting.insert(
QLatin1String(NM_SETTING_PPP_REQUIRE_MPPE), requireMppe());
448 if (requireMppe128()) {
449 setting.insert(
QLatin1String(NM_SETTING_PPP_REQUIRE_MPPE_128), requireMppe128());
452 if (mppeStateful()) {
453 setting.insert(
QLatin1String(NM_SETTING_PPP_MPPE_STATEFUL), mppeStateful());
457 setting.insert(
QLatin1String(NM_SETTING_PPP_CRTSCTS), cRtsCts());
472 if (lcpEchoFailure()) {
473 setting.insert(
QLatin1String(NM_SETTING_PPP_LCP_ECHO_FAILURE), lcpEchoFailure());
476 if (lcpEchoInterval()) {
477 setting.insert(
QLatin1String(NM_SETTING_PPP_LCP_ECHO_INTERVAL), lcpEchoInterval());
485 dbg.
nospace() <<
"type: " << setting.typeAsString(setting.type()) <<
'\n';
486 dbg.
nospace() <<
"initialized: " << !setting.isNull() <<
'\n';
488 dbg.
nospace() << NM_SETTING_PPP_NOAUTH <<
": " << setting.noAuth() <<
'\n';
489 dbg.
nospace() << NM_SETTING_PPP_REFUSE_EAP <<
": " << setting.refuseEap() <<
'\n';
490 dbg.
nospace() << NM_SETTING_PPP_REFUSE_PAP <<
": " << setting.refusePap() <<
'\n';
491 dbg.
nospace() << NM_SETTING_PPP_REFUSE_CHAP <<
": " << setting.refuseChap() <<
'\n';
492 dbg.
nospace() << NM_SETTING_PPP_REFUSE_MSCHAP <<
": " << setting.refuseMschap() <<
'\n';
493 dbg.
nospace() << NM_SETTING_PPP_REFUSE_MSCHAPV2 <<
": " << setting.refuseMschapv2() <<
'\n';
494 dbg.
nospace() << NM_SETTING_PPP_NOBSDCOMP <<
": " << setting.noBsdComp() <<
'\n';
495 dbg.
nospace() << NM_SETTING_PPP_NODEFLATE <<
": " << setting.noDeflate() <<
'\n';
496 dbg.
nospace() << NM_SETTING_PPP_NO_VJ_COMP <<
": " << setting.noVjComp() <<
'\n';
497 dbg.
nospace() << NM_SETTING_PPP_REQUIRE_MPPE <<
": " << setting.requireMppe() <<
'\n';
498 dbg.
nospace() << NM_SETTING_PPP_REQUIRE_MPPE_128 <<
": " << setting.requireMppe128() <<
'\n';
499 dbg.
nospace() << NM_SETTING_PPP_MPPE_STATEFUL <<
": " << setting.mppeStateful() <<
'\n';
500 dbg.
nospace() << NM_SETTING_PPP_CRTSCTS <<
": " << setting.cRtsCts() <<
'\n';
501 dbg.
nospace() << NM_SETTING_PPP_BAUD <<
": " << setting.baud() <<
'\n';
502 dbg.
nospace() << NM_SETTING_PPP_MRU <<
": " << setting.mru() <<
'\n';
503 dbg.
nospace() << NM_SETTING_PPP_MTU <<
": " << setting.mtu() <<
'\n';
504 dbg.
nospace() << NM_SETTING_PPP_LCP_ECHO_FAILURE <<
": " << setting.lcpEchoFailure() <<
'\n';
505 dbg.
nospace() << NM_SETTING_PPP_LCP_ECHO_INTERVAL <<
": " << setting.lcpEchoInterval() <<
'\n';
void fromMap(const QVariantMap &setting) override
Must be reimplemented, default implementation does nothing.
QVariantMap toMap() const override
Must be reimplemented, default implementationd does nothing.
QString name() const override
Must be reimplemented, default implementationd does nothing.
KIOCORE_EXPORT QString number(KIO::filesize_t size)