1/*
2 SPDX-FileCopyrightText: 2018 Pranav Gade <pranavgade20@gmail.com>
3
4 SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
5*/
6
7#ifndef NETWORKMANAGERQT_MACSECSETTING_H
8#define NETWORKMANAGERQT_MACSECSETTING_H
9
10#include "setting.h"
11#include <networkmanagerqt/networkmanagerqt_export.h>
12
13namespace NetworkManager
14{
15class MacsecSettingPrivate;
16
17/**
18 * Represents Macsec setting
19 */
20class NETWORKMANAGERQT_EXPORT MacsecSetting : public Setting
21{
22public:
23 typedef QSharedPointer<MacsecSetting> Ptr;
24 typedef QList<Ptr> List;
25
26 enum Mode {
27 Psk,
28 Eap,
29 };
30
31 enum Validation {
32 Disable,
33 Check,
34 Strict,
35 };
36
37 MacsecSetting();
38 explicit MacsecSetting(const Ptr &other);
39 ~MacsecSetting() override;
40
41 QString name() const override;
42
43 void setEncrypt(bool encrypt);
44 bool encrypt() const;
45
46 void setMkaCak(const QString &mkaCak);
47 QString mkaCak() const;
48
49 void setMkaCkn(const QString &mkaCkn);
50 QString mkaCkn() const;
51
52 void setMode(Mode mode);
53 Mode mode() const;
54
55 void setParent(const QString &parent);
56 QString parent() const;
57
58 void setPort(qint32 port);
59 qint32 port() const;
60
61 void setSendSci(bool sendSci);
62 bool sendSci() const;
63
64 void setValidation(Validation validation);
65 Validation validation() const;
66
67 void setMkaCakFlags(Setting::SecretFlags flags);
68 Setting::SecretFlags mkaCakFlags() const;
69
70 QStringList needSecrets(bool requestNew = false) const override;
71
72 void secretsFromMap(const QVariantMap &secrets) override;
73
74 QVariantMap secretsToMap() const override;
75
76 void fromMap(const QVariantMap &setting) override;
77
78 QVariantMap toMap() const override;
79
80protected:
81 MacsecSettingPrivate *d_ptr;
82
83private:
84 Q_DECLARE_PRIVATE(MacsecSetting)
85};
86
87NETWORKMANAGERQT_EXPORT QDebug operator<<(QDebug dbg, const MacsecSetting &setting);
88
89}
90
91#endif // NETWORKMANAGERQT_MACSECSETTING_H
92

source code of networkmanager-qt/src/settings/macsecsetting.h