Exemple #1
0
void NetworkManager::TunSetting::fromMap(const QVariantMap &setting)
{
    if (setting.contains(QLatin1String(NM_SETTING_TUN_GROUP))) {
        setGroup(setting.value(QLatin1String(NM_SETTING_TUN_GROUP)).toString());
    }

    if (setting.contains(QLatin1String(NM_SETTING_TUN_MODE))) {
        setMode((Mode)setting.value(QLatin1String(NM_SETTING_TUN_MODE)).toUInt());
    }

    if (setting.contains(QLatin1String(NM_SETTING_TUN_MULTI_QUEUE))) {
        setMultiQueue(setting.value(QLatin1String(NM_SETTING_TUN_MULTI_QUEUE)).toBool());
    }

    if (setting.contains(QLatin1String(NM_SETTING_TUN_OWNER))) {
        setOwner(setting.value(QLatin1String(NM_SETTING_TUN_OWNER)).toString());
    }

    if (setting.contains(QLatin1String(NM_SETTING_TUN_PI))) {
        setPi(setting.value(QLatin1String(NM_SETTING_TUN_PI)).toBool());
    }

    if (setting.contains(QLatin1String(NM_SETTING_TUN_VNET_HDR))) {
        setVnetHdr(setting.value(QLatin1String(NM_SETTING_TUN_VNET_HDR)).toBool());
    }
}
Exemple #2
0
NetworkManager::TunSetting::TunSetting(const Ptr &other)
    : Setting(other)
    , d_ptr(new TunSettingPrivate())
{
    setGroup(other->group());
    setMode(other->mode());
    setMultiQueue(other->multiQueue());
    setOwner(other->owner());
    setPi(other->pi());
    setVnetHdr(other->vnetHdr());
}
Exemple #3
0
 inline bool setNumSubProblems(int n) { _numSubProblems = n; setPi(StdRealVector(n, 1)); return true; }