openvpn-connection.h
connectivityqt/vpn-connection.h
openvpn-connection.cpp
vpn-connections-list-model.cpp
openvpn-connection.h
connectivityqt/vpn-connection.h
QDBusConnection
QDBusObjectPath
QObject
lomiri/util/DefinesPtrs.h
openvpn-connection.cpp
openvpn-connection.h
vpn-connections-list-model.cpp
connectivityqt::OpenvpnConnection
connectivityqt

    /*
    *Copyright©2015CanonicalLtd.
    *
    *Thisprogramisfreesoftware:youcanredistributeitand/ormodifyit
    *underthetermsoftheGNULesserGeneralPublicLicenseversion3,
    *aspublishedbytheFreeSoftwareFoundation.
    *
    *Thisprogramisdistributedinthehopethatitwillbeuseful,
    *butWITHOUTANYWARRANTY;withouteventheimpliedwarrantyof
    *MERCHANTABILITYorFITNESSFORAPARTICULARPURPOSE.Seethe
    *GNULesserGeneralPublicLicenseformoredetails.
    *
    *YoushouldhavereceivedacopyoftheGNULesserGeneralPublicLicense
    *alongwiththisprogram.Ifnot,see<http://www.gnu.org/licenses/>.
    *
    *Authors:
    *PeteWoods<pete.woods@canonical.com>
    */

    #pragmaonce

    #include<connectivityqt/vpn-connection.h>

    namespaceconnectivityqt
    {

    classQ_DECL_EXPORTOpenvpnConnection:publicVpnConnection
    {
    Q_OBJECT

    public:
    LOMIRI_DEFINES_PTRS(OpenvpnConnection);

    Q_ENUMS(ConnectionType)
    enumConnectionType
    {
    TLS,
    PASSWORD,
    PASSWORD_TLS,
    STATIC_KEY
    };

    Q_ENUMS(DevType)
    enumDevType
    {
    TUN,
    TAP
    };

    Q_ENUMS(Cipher)
    enumCipher
    {
    DEFAULT_CIPHER,
    DES_CBC,
    RC2_CBC,
    DES_EDE_CBC,
    DES_EDE3_CBC,
    DESX_CBC,
    RC2_40_CBC,
    CAST5_CBC,
    AES_128_CBC,
    AES_192_CBC,
    AES_256_CBC,
    CAMELLIA_128_CBC,
    CAMELLIA_192_CBC,
    CAMELLIA_256_CBC,
    SEED_CBC,
    AES_128_CBC_HMAC_SHA1,
    AES_256_CBC_HMAC_SHA1
    };

    Q_ENUMS(Auth)
    enumAuth
    {
    DEFAULT_AUTH,
    NONE,
    RSA_MD4,
    MD5,
    SHA1,
    SHA224,
    SHA256,
    SHA384,
    SHA512,
    RIPEMD160
    };

    Q_ENUMS(TlsType)
    enumTlsType
    {
    SERVER,
    CLIENT
    };

    Q_ENUMS(KeyDir)
    enumKeyDir
    {
    KEY_NONE,
    ZERO,
    ONE
    };

    Q_ENUMS(ProxyType)
    enumProxyType
    {
    NOT_REQUIRED,
    HTTP,
    SOCKS
    };

    OpenvpnConnection(constQDBusObjectPath&path,constQDBusConnection&connection);

    virtual~OpenvpnConnection();

    Typetype()constoverride;

    //Basicproperties

    Q_PROPERTY(QStringcaREADcaWRITEsetCaNOTIFYcaChanged)
    QStringca()const;

    Q_PROPERTY(QStringcertREADcertWRITEsetCertNOTIFYcertChanged)
    QStringcert()const;

    Q_PROPERTY(QStringcertPassREADcertPassWRITEsetCertPassNOTIFYcertPassChanged)
    QStringcertPass()const;

    Q_PROPERTY(ConnectionTypeconnectionTypeREADconnectionTypeWRITEsetConnectionTypeNOTIFYconnectionTypeChanged)
    ConnectionTypeconnectionType()const;

    Q_PROPERTY(QStringkeyREADkeyWRITEsetKeyNOTIFYkeyChanged)
    QStringkey()const;

    Q_PROPERTY(QStringlocalIpREADlocalIpWRITEsetLocalIpNOTIFYlocalIpChanged)
    QStringlocalIp()const;

    Q_PROPERTY(QStringpasswordREADpasswordWRITEsetPasswordNOTIFYpasswordChanged)
    QStringpassword()const;

    Q_PROPERTY(QStringremoteREADremoteWRITEsetRemoteNOTIFYremoteChanged)
    QStringremote()const;

    Q_PROPERTY(QStringremoteIpREADremoteIpWRITEsetRemoteIpNOTIFYremoteIpChanged)
    QStringremoteIp()const;

    Q_PROPERTY(QStringstaticKeyREADstaticKeyWRITEsetStaticKeyNOTIFYstaticKeyChanged)
    QStringstaticKey()const;

    Q_PROPERTY(KeyDirstaticKeyDirectionREADstaticKeyDirectionWRITEsetStaticKeyDirectionNOTIFYstaticKeyDirectionChanged)
    KeyDirstaticKeyDirection()const;

    Q_PROPERTY(QStringusernameREADusernameWRITEsetUsernameNOTIFYusernameChanged)
    QStringusername()const;

    //Advancedgeneralproperties

    Q_PROPERTY(intportREADportWRITEsetPortNOTIFYportChanged)
    intport()const;

    Q_PROPERTY(boolportSetREADportSetWRITEsetPortSetNOTIFYportSetChanged)
    boolportSet()const;

    Q_PROPERTY(intrenegSecondsREADrenegSecondsWRITEsetRenegSecondsNOTIFYrenegSecondsChanged)
    intrenegSeconds()const;

    Q_PROPERTY(boolrenegSecondsSetREADrenegSecondsSetWRITEsetRenegSecondsSetNOTIFYrenegSecondsSetChanged)
    boolrenegSecondsSet()const;

    Q_PROPERTY(boolcompLzoREADcompLzoWRITEsetCompLzoNOTIFYcompLzoChanged)
    boolcompLzo()const;

    Q_PROPERTY(boolprotoTcpREADprotoTcpWRITEsetProtoTcpNOTIFYprotoTcpChanged)
    boolprotoTcp()const;

    Q_PROPERTY(QStringdevREADdevWRITEsetDevNOTIFYdevChanged)
    QStringdev()const;

    Q_PROPERTY(DevTypedevTypeREADdevTypeWRITEsetDevTypeNOTIFYdevTypeChanged)
    DevTypedevType()const;

    Q_PROPERTY(booldevTypeSetREADdevTypeSetWRITEsetDevTypeSetNOTIFYdevTypeSetChanged)
    booldevTypeSet()const;

    Q_PROPERTY(inttunnelMtuREADtunnelMtuWRITEsetTunnelMtuNOTIFYtunnelMtuChanged)
    inttunnelMtu()const;

    Q_PROPERTY(booltunnelMtuSetREADtunnelMtuSetWRITEsetTunnelMtuSetNOTIFYtunnelMtuSetChanged)
    booltunnelMtuSet()const;

    Q_PROPERTY(intfragmentSizeREADfragmentSizeWRITEsetFragmentSizeNOTIFYfragmentSizeChanged)
    intfragmentSize()const;

    Q_PROPERTY(boolfragmentSizeSetREADfragmentSizeSetWRITEsetFragmentSizeSetNOTIFYfragmentSizeSetChanged)
    boolfragmentSizeSet()const;

    Q_PROPERTY(boolmssFixREADmssFixWRITEsetMssFixNOTIFYmssFixChanged)
    boolmssFix()const;

    Q_PROPERTY(boolremoteRandomREADremoteRandomWRITEsetRemoteRandomNOTIFYremoteRandomChanged)
    boolremoteRandom()const;

    //Advancedsecurityproperties

    Q_PROPERTY(CiphercipherREADcipherWRITEsetCipherNOTIFYcipherChanged)
    Ciphercipher()const;

    Q_PROPERTY(intkeysizeREADkeysizeWRITEsetKeysizeNOTIFYkeysizeChanged)
    intkeysize()const;

    Q_PROPERTY(boolkeysizeSetREADkeysizeSetWRITEsetKeysizeSetNOTIFYkeysizeSetChanged)
    boolkeysizeSet()const;

    Q_PROPERTY(AuthauthREADauthWRITEsetAuthNOTIFYauthChanged)
    Authauth()const;

    //AdvancedTLSauthproperties

    Q_PROPERTY(QStringtlsRemoteREADtlsRemoteWRITEsetTlsRemoteNOTIFYtlsRemoteChanged)
    QStringtlsRemote()const;

    Q_PROPERTY(TlsTyperemoteCertTlsREADremoteCertTlsWRITEsetRemoteCertTlsNOTIFYremoteCertTlsChanged)
    TlsTyperemoteCertTls()const;

    Q_PROPERTY(boolremoteCertTlsSetREADremoteCertTlsSetWRITEsetRemoteCertTlsSetNOTIFYremoteCertTlsSetChanged)
    boolremoteCertTlsSet()const;

    Q_PROPERTY(QStringtaREADtaWRITEsetTaNOTIFYtaChanged)
    QStringta()const;

    Q_PROPERTY(KeyDirtaDirREADtaDirWRITEsetTaDirNOTIFYtaDirChanged)
    KeyDirtaDir()const;

    Q_PROPERTY(booltaSetREADtaSetWRITEsetTaSetNOTIFYtaSetChanged)
    booltaSet()const;

    //Advancedproxysettings

    Q_PROPERTY(ProxyTypeproxyTypeREADproxyTypeWRITEsetProxyTypeNOTIFYproxyTypeChanged)
    ProxyTypeproxyType()const;

    Q_PROPERTY(QStringproxyServerREADproxyServerWRITEsetProxyServerNOTIFYproxyServerChanged)
    QStringproxyServer()const;

    Q_PROPERTY(intproxyPortREADproxyPortWRITEsetProxyPortNOTIFYproxyPortChanged)
    intproxyPort()const;

    Q_PROPERTY(boolproxyRetryREADproxyRetryWRITEsetProxyRetryNOTIFYproxyRetryChanged)
    boolproxyRetry()const;

    Q_PROPERTY(QStringproxyUsernameREADproxyUsernameWRITEsetProxyUsernameNOTIFYproxyUsernameChanged)
    QStringproxyUsername()const;

    Q_PROPERTY(QStringproxyPasswordREADproxyPasswordWRITEsetProxyPasswordNOTIFYproxyPasswordChanged)
    QStringproxyPassword()const;

    publicQ_SLOTS:
    //Basicproperties

    voidsetCa(constQString&value);

    voidsetCert(constQString&value);

    voidsetCertPass(constQString&value);

    voidsetConnectionType(ConnectionTypeconnectionType);

    voidsetKey(constQString&value);

    voidsetLocalIp(constQString&value);

    voidsetPassword(constQString&value);

    voidsetRemote(constQString&value);

    voidsetRemoteIp(constQString&value);

    voidsetStaticKey(constQString&value);

    voidsetStaticKeyDirection(KeyDirvalue);

    voidsetUsername(constQString&value);

    //Advancedgeneralproperties

    voidsetPort(intvalue);

    voidsetPortSet(boolvalue);

    voidsetRenegSeconds(intvalue);

    voidsetRenegSecondsSet(boolvalue);

    voidsetCompLzo(boolvalue);

    voidsetProtoTcp(boolvalue);

    voidsetDev(constQString&value);

    voidsetDevType(DevTypevalue);

    voidsetDevTypeSet(boolvalue);

    voidsetTunnelMtu(intvalue);

    voidsetTunnelMtuSet(boolvalue);

    voidsetFragmentSize(intvalue);

    voidsetFragmentSizeSet(boolvalue);

    voidsetMssFix(boolvalue);

    voidsetRemoteRandom(boolvalue);

    //Advancedsecurityproperties

    voidsetCipher(Ciphervalue);

    voidsetKeysize(intvalue);

    voidsetKeysizeSet(boolvalue);

    voidsetAuth(Authvalue);

    //AdvancedTLSauthproperties

    voidsetTlsRemote(constQString&value);

    voidsetRemoteCertTls(TlsTypevalue);

    voidsetRemoteCertTlsSet(boolvalue);

    voidsetTa(constQString&value);

    voidsetTaDir(KeyDirvalue);

    voidsetTaSet(boolvalue);

    //Advancedproxysettings

    voidsetProxyType(ProxyTypevalue);

    voidsetProxyServer(constQString&value);

    voidsetProxyPort(intvalue);

    voidsetProxyRetry(boolvalue);

    voidsetProxyUsername(constQString&value);

    voidsetProxyPassword(constQString&value);

    Q_SIGNALS:
    //Basicproperties

    voidcaChanged(constQString&value);

    voidcertChanged(constQString&value);

    voidcertPassChanged(constQString&value);

    voidconnectionTypeChanged(ConnectionTypeconnectionType);

    voidkeyChanged(constQString&value);

    voidlocalIpChanged(constQString&value);

    voidpasswordChanged(constQString&value);

    voidremoteChanged(constQString&value);

    voidremoteIpChanged(constQString&value);

    voidstaticKeyChanged(constQString&value);

    voidstaticKeyDirectionChanged(KeyDirvalue);

    voidusernameChanged(constQString&value);

    //Advancedgeneralproperties

    voidportChanged(intvalue);

    voidportSetChanged(boolvalue);

    voidrenegSecondsChanged(intvalue);

    voidrenegSecondsSetChanged(boolvalue);

    voidcompLzoChanged(boolvalue);

    voidprotoTcpChanged(boolvalue);

    voiddevChanged(constQString&value);

    voiddevTypeChanged(DevTypevalue);

    voiddevTypeSetChanged(boolvalue);

    voidtunnelMtuChanged(intvalue);

    voidtunnelMtuSetChanged(boolvalue);

    voidfragmentSizeChanged(intvalue);

    voidfragmentSizeSetChanged(boolvalue);

    voidmssFixChanged(boolvalue);

    voidremoteRandomChanged(boolvalue);

    //Advancedsecurityproperties

    voidcipherChanged(Ciphervalue);

    voidkeysizeChanged(intvalue);

    voidkeysizeSetChanged(boolvalue);

    voidauthChanged(Authvalue);

    //AdvancedTLSauthproperties

    voidtlsRemoteChanged(constQString&value);

    voidremoteCertTlsChanged(TlsTypevalue);

    voidremoteCertTlsSetChanged(boolvalue);

    voidtaChanged(constQString&value);

    voidtaDirChanged(KeyDirvalue);

    voidtaSetChanged(boolvalue);

    //Advancedproxytings

    voidproxyTypeChanged(ProxyTypevalue);

    voidproxyServerChanged(constQString&value);

    voidproxyPortChanged(intvalue);

    voidproxyRetryChanged(boolvalue);

    voidproxyUsernameChanged(constQString&value);

    voidproxyPasswordChanged(constQString&value);

    protected:
    classPriv;
    std::shared_ptr<Priv>d;
    };

    }